[opencms-dev] About module creation

Territorio Jordan-V. jordan.territorio at gmail.com
Thu Apr 10 11:40:45 CEST 2008


Hi,

I followed the tutorial at :
http://www.wdogsystems.com/opencms/opencms/demos/structured_content_editing.html

but it seems there is a problem. When i create a new File using the
structured content, an exception occured :
java.lang.NullPointerException at
org.opencms.xml.content.CmsXmlContent.getContentDefinition(CmsXmlContent.java:625)
at org.opencms.xml.content.CmsXmlContent.<init>(CmsXmlContent.java:127)
...

Here is my opencms-modules.xml :
...
<resourcetypes>
                <type
class="org.opencms.file.type.CmsResourceTypeXmlContent" name="DemoType"
id="7001">
                    <param
name="schema">/system/modules/mymodule/schemas/sample_article.xsd</param>
                </type>
            </resourcetypes>
            <explorertypes>
                <explorertype name="DemoType" key="fileicon.DemoType"
icon="xmlcontent.gif" reference="xmlcontent">
                    <newresource page="structurecontent"
uri="newresource_xmlcontent.jsp?newresourcetype=DemoType" order="7001" />
                    <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>
...

And here my /system/modules/mymodule/schemas/sample_article.xsd :
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">

    <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd" />
    <xsd:element name="DemoTypes"
        type="OpenCmsDemoTypes" />

    <xsd:complexType name="OpenCmsDemoTypes">
        <xsd:sequence>
            <xsd:element name="DemoType"
                type="OpenCmsDemoType" minOccurs="0"
                maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="OpenCmsDemoType">
        <xsd:sequence>
            <xsd:element name="Title" type="OpenCmsString" />
            <xsd:element name="Teaser" type="OpenCmsString"
                maxOccurs="3" />
            <xsd:element name="Text" type="OpenCmsHtml" />
        </xsd:sequence>
        <xsd:attribute name="language" type="OpenCmsLocale"
            use="required" />
    </xsd:complexType>
</xsd:schema>


I tried to configure the workspace.properties in classes/mymodules/ (and
even adding the following lines in __property/workspace.properties...) :
fileicon.DemoType = Sample Systems Article
title.DemoType = Create a new Sample Systems Article

I really don't know what I do wrong... i have an OpenCMS 7.0.4 and all is
correct when i restart my server... no error in Tomcat logs...

help... please... lol


2008/4/9, Vikrama Sanjeeva <viki.sanjeeva at gmail.com>:
>
> Hi,
>       You are trying to create structured xml type. Better follow this
> link of how to:
> http://www.wdogsystems.com/opencms/opencms/demos/structured_content_editing.html
>
> elements folder --  use to keep "elements" used in your website. Like
> header, footer, any thing u consider "an-element-in-your-wesbite"
> pages folder -- for e.g: you have a news box, and on clicking "more" link
> of news in this box, detailed news page will open. This detailed new page
> template can be placed in pages folder.
>
>
> remember, both folders are not any specific keywords in OpenCms. You can
> use any name you like.
>
> Bye,
> Viki.
>
> On Wed, Apr 9, 2008 at 4:31 PM, Territorio Jordan-V. <
> jordan.territorio at gmail.com> wrote:
>
> > Thanks Georgi !
> >
> > I saw in project the schemas directory which contains xsd files. The
> > documentation says that xsd files are used to "standardize" content of xml
> > files... but i'm lost, i've created the sample.xsd as in the doc, but if i
> > create an xml file from scratch, the edition fails, launching a fu....ing
> > exception ^^
> >
> > My real problem in the module creation is there :
> > I try to make a module from scratch, and a website using this module (a
> > web portail with login page, where users have access to some information).
> > I noticed that if I create a new "structured content" in my site, the
> > edition fails. So I think that i have to create a file which will inform the
> > workspace of "how organize content for this file". But don't what to do or
> > how associate my structured content file to an xsd or an xml file from my
> > module or something klike that...
> >
> > Maybe i'm not clear... (i'm french, so it could explain that my english
> > is not very explicit :P)
> >
> > 2008/4/9, Georgi Naplatanov <gosho at oles.biz>:
> >
> > > Hello, Territorio Jordan-V.
> > >
> > > The elements folder in the module, usually contains jsps which are
> > > used
> > > in the template(s) to render menus, news, jobs etc.
> > >
> > > The module's folders (under /system/modules) is not visible for user
> > > who
> > > should edit content of the site only and you should not create pages
> > > in
> > > modules folder.
> > >
> > > I saw jsps in pages folder for some opencms modules which makes some
> > > work with posted data. The mail form from template one is one of these
> > > examples.
> > >
> > > HTH
> > >
> > > Best regards
> > > Georgi
> > >
> > >
> > > Territorio Jordan-V. wrote:
> > > > Hi all !!
> > > >
> > > > As ever, i'm a newbie and i try to learn the better way to create a
> > > real
> > > > OpenCMS Module. So my question is, what directory for what pages...
> > > >
> > > > I know that (but not sure)
> > > > resources : to put images or css style, so the graphical ressources
> > > > templates : the jsp templates to organize datas on the screen
> > > > classes : for properties and Java classes uses
> > > > lib : for specials librairies used
> > > >
> > > > But for those i don't know  :
> > > > elements/
> > > > pages/
> > > >
> > > > I've seen that some pages in the demo uses elements to organize a
> > > type of
> > > > content so i think you have to create jsp to organize just one type
> > > of data
> > > > (but I don't know how to proceed)
> > > > So for pages i've no idea...
> > > >
> > > > does someone know more about it, because on wiki i didn't found any
> > > explicit
> > > > description?
> > > >
> > > > Cheers,
> > > > Jordan
> > > >
> > > >
> > > >
> > > >
> > >
> > > >
> > > ------------------------------------------------------------------------
> > > >
> > > >
> > > > _______________________________________________
> > > > 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
> > >
> > >
> > > _______________________________________________
> > > 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
> > >
> >
> >
> >
> > --
> > TERRITORIO Jordan-Victor
> > Ingénieur d'Intégration Java
> > TEAMLOG – Ingenieurs 2000
> >
> > +33 6 30 66 54 69
> > jot at teamlog.com
> >
> >
> > _______________________________________________
> > 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
> >
>
>
>
> _______________________________________________
> 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
>



-- 
TERRITORIO Jordan-Victor
Ingénieur d'Intégration Java
TEAMLOG – Ingenieurs 2000

+33 6 30 66 54 69
jot at teamlog.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080410/5e08a193/attachment.htm>


More information about the opencms-dev mailing list