[opencms-dev] CmsDefaultXmlContentHandler and TemplateOneModules

Shi Yusen shiys at langhua.cn
Sun Sep 17 08:46:29 CEST 2006


Hi Holger,

I just have a look on the CmsLayoutXmlContentHandler. As its explaination
said, it's a hardcoded mapping resolver.

I should say the handler is a magic. It gives OpenCms the ability of making
adaptors for EAI or JMS.

Generally, if you want to handle the mapping by your own way, you can define
your own handler in the top level XSD, here's an example:
<xsd:appinfo>
    <handler class="cn.langhua.opencms.xml.content.CmsSampleHandler"/>
    <resourcebundle name="cn.langhua.birds.samples.workplace"/>
    <preview uri="${previewtempfile}" />
</xsd:appinfo>

In a sub XSD, 
<xsd:appinfo>
	<mappings>
		<mapping element="basic/description"
mapto="property:description|ExcelImport:sheet1!B2|ExcelExport:shee1!B*" />
		<mapping element="basic/env"
mapto="property:env|ExcelImport:sheet2!B3|ExcelExport:shee1!C*" />
		<mapping element="basic/host"
mapto="property:host|ExcelImport:sheet3!B4|ExcelExport:shee1!D*" />
	</mappings>
</xsd:appinfo>

And in CmsSampleHandler.java, overwrite the resolveLayoutMappings(CmsObject
cms, CmsXmlContent content) and addMapping(CmsXmlContentDefinition
contentDefinition, String elementName, String mapping).

Hope you like it.

Regards,

Shi Yusen/Beijing Langhua Ltd.
--------------------------------------------------------------
Tel: 86-10-88514088, 88514099
Fax: 86-10-88514099
Email: shiys at langhua.cn
Website: http://www.langhua.cn/
--------------------------------------------------------------
 
-----邮件原件-----
发件人: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.
org] 代表 Holger Schick
发送时间: 2006年9月15日 22:28
收件人: The OpenCms mailing list
主题: [opencms-dev] CmsDefaultXmlContentHandler and TemplateOneModules

Hello,
I have some question about the CmsDefaultXmlContentHandler and the 
org.opencms.frontend.templateone.modules.CmsLayoutXmlContentHandler.

I'm trying to find out why the CmsLayoutXmlContentHandler is implemented 
in the template one modules. For what do I need this handler and when 
does opencms calls this class and what is done in the configuration that 
opencms calls this class and not the default class?


Kind Regards

Holger Schick

_______________________________________________
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