[opencms-dev] Re: Why I failed in editing structured content? Can anyone give me a hand

Huang Zhibin zbhuang2002 at hotmail.com
Sat May 20 17:38:04 CEST 2006


Hi Paul,
  Thanks for your answers.
  But it doesn't work. When I changed to <cms:contentload 
collector="singleFile" param="${opencms:uri}wdog_article.xsd" 
editable="true">, wrong info is 
"Error reading resource from path "/wdog_article.xsd". Reason: Unable to 
read resource "/wdog_article.xsd". So I do not think that is it,
maybe something wrong in my configuration file of "Opendcms-modules.xml", 
or anything else?
  Anyway, thanks for your suggestions.
Parker


>From: Paul Weibert <weibert_paul at web.de>
>Reply-To: The OpenCms mailing list <opencms-dev at opencms.org>
>To: opencms-dev at opencms.org
>Subject: [opencms-dev] Re: Why I failed in editing structured content? Can 
anyone give me a hand
>Date: Sat, 20 May 2006 15:03:55 +0200
>
>Hi Huang,
>
>from the error-output
>
>org.opencms.file.CmsVfsResourceNotFoundException: Error reading resource
> > from path "/".
>
>I think  that the variable ${opencms:uri} in the content load line points 
to location  "/"
>
>To solve the problem, yor cann write the complete path to your xml file. 
So that contentload looks some thing lile this:
>
><cms:contentload collector="singleFile" param="/system/modules/........."
>
>or complete the ${opencms:uri} variable, so that it points to your file
>
><cms:contentload collector="singleFile" param="${opencms:uri}myfile.xml" 
editable="true">
>
>
>There are a lot of examples how to do this in the xmlcontentdemo module 
(contained in the default installation of opencms 6.2)
>
>
>
>
>Paul
>
>
>
> > Message: 19
> > Date: Sat, 20 May 2006 06:24:23 +0000
> > From: "Huang Zhibin" <zbhuang2002 at hotmail.com>
> > Subject: [opencms-dev] Why I failed in editing structured content? Can
> > 	anyone give me a hand
> > To: opencms-dev at opencms.org, support at wdogsystems.com
> > Message-ID: <BAY114-F1324EAADE037C07F9B0B7DA2A40 at phx.gbl>
> > Content-Type: text/plain; charset=gb2312; format=flowed
> >
> > Dear all,
> >   I think all have read the demo in
> > 
(http://www.wdogsystems.com/opencms/opencms/demos/structured_content_editing.html)

> > if you want to create a structured content editor with OpenCMS.
> >   But these days following these steps, when I preview the page of
> > /tests/test.html, I met with the problem of
> > "Error: error reading resource from path "/".
> > Reason: unable to read resources "/"
> >   Can anyone tell me why I failed?
> > Thanks.
> > Parker
> >
> > Details:
> > org.opencms.file.CmsVfsResourceNotFoundException: Error reading 
resource
> > from path "/".
> > 	at
> > 
org.opencms.file.CmsVfsResourceNotFoundException.createException(CmsVfsResourceNotFoundException.java:78)

> >
> > 	at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:213)
> > 	at org.opencms.db.CmsDbContext.report(CmsDbContext.java:197)
> > 	at
> > 
org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3867)

> >
> > 	at org.opencms.file.CmsObject.readResource(CmsObject.java:2702)
> > 	at org.opencms.file.CmsObject.readFile(CmsObject.java:2194)
> > 	at org.opencms.file.CmsObject.readFile(CmsObject.java:2167)
> > 	at
> > 
org.opencms.file.collectors.CmsDefaultResourceCollector.getSingleFile(CmsDefaultResourceCollector.java:335)

> >
> > 	at
> > 
org.opencms.file.collectors.CmsDefaultResourceCollector.getResults(CmsDefaultResourceCollector.java:174)

> >
> > 	at
> > 
org.opencms.jsp.CmsJspTagContentLoad.init(CmsJspTagContentLoad.java:794)
> > 	at
> > 
org.opencms.jsp.CmsJspTagContentLoad.doStartTag(CmsJspTagContentLoad.java:290)

> >
> > 	at
> > 
org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.jsptemplates.article_jsp._jspx_meth_cms_contentload_0(article_jsp.java:129)

> >
> > 	at
> > 
org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.jsptemplates.article_jsp._jspService(article_jsp.java:82)

> >
> > 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > 	at
> > 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

> >
> > 	at
> > 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> > 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > 	at
> > 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

> >
> > 	at
> > 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

> >
> > 	at
> > 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)

> >
> > 	at
> > 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:585)

> >
> > 	at
> > 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)

> >
> > 	at
> > 
org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194)

> >
> > 	at
> > 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:170)

> >
> > 	at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:433)
> > 	at
> > 
org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423)

> >
> > 	at
> > 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:174)

> >
> > 	at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:467)
> > 	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:412)
> > 	at
> > 
org.opencms.loader.A_CmsXmlDocumentLoader.load(A_CmsXmlDocumentLoader.java:225)

> >
> > 	at
> > 
org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:719)

> >
> > 	at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1362)
> > 	at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:151)
> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > 	at
> > 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

> >
> > 	at
> > 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

> >
> > 	at
> > 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

> >
> > 	at
> > 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

> >
> > 	at
> > 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> > 	at
> > 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

> >
> > 	at
> > 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

> >
> > 	at
> > 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

> >
> > 	at
> > 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> > 	at
> > 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

> >
> > 	at
> > 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

> >
> > 	at
> > 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

> >
> > 	at
> > 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

> >
> > 	at
> > 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> > 	at
> > 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

> >
> > 	at
> > 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

> >
> > 	at
> > 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> > 	at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> > 	at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> > 	at
> > 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> > 	at
> > 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

> >
> > 	at
> > 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> > 	at
> > 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

> >
> > 	at java.lang.Thread.run(Thread.java:534)
> > Caused by: org.opencms.file.CmsVfsResourceNotFoundException: Unable to 
read
> > resource "/".
> > 	at
> > 
org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1434)
> > 	at
> > 
org.opencms.db.CmsDriverManager.readResource(CmsDriverManager.java:5606)
> > 	at
> > 
org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:5633)

> >
> > 	at
> > 
org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3865)

> >
> > 	... 57 more
> > -----------------------------
> > fiel:	Opendcms-modules.xml
> >         <module>
> >             <name>com.wdogsystems.site</name>
> >             <nicename><![CDATA[Watchdog Systems Website and
> > extranet]]></nicename>
> >             <class/>
> >             <description><![CDATA[This is the project that contains the
> > XSD's and graphics for the watchdog systems website.]]></description>
> >             <version>0.1</version>
> >             <authorname><![CDATA[Zhbin Huang]]></authorname>
> >             
<authoremail><![CDATA[zbhuang2002 at hotmail.com]]></authoremail>
> >             <datecreated/>
> >             <userinstalled/>
> >             <dateinstalled/>
> >             <dependencies/>
> >             <exportpoints>
> >                 <exportpoint
> > uri="/system/modules/com.wdogsystems.site/classes/"
> > destination="WEB-INF/classes/" />
> >             </exportpoints>
> >             <resources>
> >                 <resource uri="/system/modules/com.wdogsystems.site/"/>
> >             </resources>
> >             <parameters/>
> >             <resourcetypes>
> >                 <type
> > class="org.opencms.file.types.CmsResourceTypeXmlContent"
> > name="wdog_article" id="201">
> > 					<properties/>
> >                     <param
> > 
name="schema">/system/modules/com.wdogsystems.site/schemas/wdog_article.xsd</param>

> >
> >                 </type>
> >             </resourcetypes>
> >             <explorertypes>
> >                 <explorertype name="wdog_article"
> > key="fileicon.wdog_article" icon="xmlcontent.gif" 
reference="xmlcontent">
> >                     <newresource page="structurecontent"
> > uri="newresource_xmlcontent.jsp?newresourcetype=wdog_article" 
order="201"
> > />
> >                     <accesscontrol>
> >                         <accessentry principal="GROUP.Administrators"
> > permissions="+r+v+w+c"/>
> >                         <accessentry principal="GROUP.Projectmanagers"
> > permissions="+r+v+w+c"/>
> >                         <accessentry principal="GROUP.Users"
> > permissions="+r+v+w+c"/>
> >                     </accesscontrol>
> >                 </explorertype>
> >             </explorertypes>
> >         </module>
> > ----------------------------------------------------------------------
> > file:	/system/modules/com.wdogsystems.site/schemas/wdog_article.xsd
> >
> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > elementFormDefault="qualified">
> > 	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
> > 	<xsd:element name="XmlContentDocWdogArticles"
> > type="OpenCmsXmlContentDocWdogArticles"/>
> >
> > 	<xsd:complexType name="OpenCmsXmlContentDocWdogArticles">
> > 		<xsd:sequence>
> > 			<xsd:element name="XmlContentDocWdogArticle"
> > type="OpenCmsXmlContentDocWdogArticle" minOccurs="0"
> > maxOccurs="unbounded"/>
> > 		</xsd:sequence>
> > 	</xsd:complexType>
> >
> > 	<xsd:complexType name="OpenCmsXmlContentDocWdogArticle">
> > 		<xsd:sequence>
> > 			<xsd:element name="Title" type="OpenCmsString" />
> > 			<xsd:element name="Intro" type="OpenCmsHtml" />
> > 			<xsd:element name="ReadMoreLink" type="OpenCmsBoolean" />
> > 			<xsd:element name="Image" type="OpenCmsVfsFile" minOccurs="0" />
> > 			<xsd:element name="Form-Include" type="OpenCmsVfsFile" minOccurs="0"
> > maxOccurs="1" />
> > 			<xsd:element name="Text" type="OpenCmsHtml" />
> > 			<xsd:element name="Author" type="OpenCmsString" minOccurs="0"/>
> > 			<xsd:element name="Date" type="OpenCmsDateTime" minOccurs="0"/>
> > 		</xsd:sequence>
> > 		<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
> > 	</xsd:complexType>
> >
> > 	<xsd:annotation>
> > 		<xsd:appinfo>
> > 			<mappings>
> > 				<mapping element="Title" mapto="property:Title" />
> > 			</mappings>
> > 			<layouts>
> > 				<layout element="Image" widget="ImageGalleryWidget" />
> > 			</layouts>
> > 		</xsd:appinfo>
> > 	</xsd:annotation>
> >
> > </xsd:schema>
> > ----------------------------------------------------------------------
> > file:	/system/modules/com.wdogsystems.site/jsptemplates/article.sjp
> >
> > <%@ page session="false" %>
> > <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
> > <html>
> > <head><title>Untitle</title></head>
> > <body>
> >
> > <cms:editable/>
> >
> > <div class="element">
> > 	<cms:contentload collector="singleFile" param="${opencms:uri}"
> > editable="true">
> >
> > 		<h2><cms:contentshow element="Title" /></h2>
> >
> > 		<cms:contentcheck ifexists="Image">
> > 			<img src="<cms:link><cms:contentshow element="Image"/></cms:link>" >
> > 		</cms:contentcheck>
> >
> > 		<p><cms:contentshow element="Text" /></p>
> >
> > 		<cms:contentcheck ifexists="Form-Include">
> > 			<cms:include>
> > 				<cms:contentshow element="Form-Include" />
> > 			</cms:include>
> > 		</cms:contentcheck>
> >
> > 	</cms:contentload>
> > </div>
> > </body>
> > </html>
> > --------------------------------------------
> > fileļ¼š
> > 
/system/modules/com.wdogsystems.site/classes/com/wdogsystems/site/workplace.properties

> >
> > #
> > #Localized Strings and help texts to display on the article editor
> > #
> >
> > fileicon.wdog_article = Watchdog Systems Article
> > title.wdog_article = Create a new Watchdog Systems Article
> >
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please 
visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
> > End of opencms-dev Digest, Vol 93, Issue 6
> > ******************************************
>
>
>_______________________________________________________________
>SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
>kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
>
>_______________________________________________
>This mail is sent to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list