[opencms-dev] About module creation

Georgi Naplatanov gosho at oles.biz
Wed Apr 9 16:03:36 CEST 2008


> 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...

You have to edit opencms-modules.xml file in WEB-INF/config/ folder.
See documentation or opencms's modules which contains xsd files for example.

The section for your module in opencms-modules.xml file should be like this:

<module>
            <name>biz.oles.opencms.poll</name>
            <nicename/>
            <class/>
            <description/>
            <version>1.2</version>
            <authorname/>
            <authoremail/>
            <datecreated/>
            <userinstalled/>
            <dateinstalled/>
            <dependencies/>
            <exportpoints>
                <exportpoint
uri="/system/modules/biz.oles.opencms.poll/lib/"
destination="WEB-INF/lib/"/>
                <exportpoint
uri="/system/modules/biz.oles.opencms.poll/classes/"
destination="WEB-INF/classes/"/>
            </exportpoints>
            <resources>
                <resource uri="/system/modules/biz.oles.opencms.poll/"/>
                <resource
uri="/system/workplace/resources/filetypes/poll.gif"/>
            </resources>
            <parameters/>
            <resourcetypes>
                <type
class="org.opencms.file.types.CmsResourceTypeXmlContent" name="poll"
id="333">
                    <properties>
                        <property>
                            <name>content-conversion</name>
                            <value
type="shared"><![CDATA[cleanup;xhtml]]></value>
                        </property>
                        <property>
                            <name>template-elements</name>
                            <value type="shared"><![CDATA[]]></value>
                        </property>
                    </properties>
                    <param
name="schema">/system/modules/biz.oles.opencms.poll/schemas/poll.xsd</param>
                </type>
            </resourcetypes>
            <explorertypes>
                <explorertype name="poll" key="fileicon.poll"
icon="poll.gif" reference="xmlcontent">
                    <newresource page="structurecontent"
uri="newresource_xmlcontent.jsp?newresourcetype=poll" order="333"
autosetnavigation="false" autosettitle="false" info="desc.poll"/>
                    <accesscontrol>
                        <accessentry principal="ROLE.WORKPLACE_USER"
permissions="+r+v+w+c"/>
                    </accesscontrol>
                </explorertype>
            </explorertypes>
        </module>

> Maybe i'm not clear... (i'm french, so it could explain that my english is
> not very explicit :P)

Don't worry my native language is not english too.

Best regards
Georgi

Territorio Jordan-V. 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
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> 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