[opencms-dev] How to write an own Macro that can be used inContent-XSD

Noz, Felix F.Noz at comundus.com
Wed May 21 11:18:01 CEST 2008


Hi,

I've come across a similar issue some time ago. I think I used a custom XmlContentHandler (defined within the schema) by extending CmsDefaultXmlContentHandler and overwriting the method  getDefault(CmsObject cms, I_CmsXmlContentValue value, Locale locale) by copying the original source code. Then I added my new macro to the resolver by calling resolver.addMacro("key", "value") within the overwritten method.
I found it quite a little bit cumbersome. A neat feature would be to add custom macros in one defined place eg. by using some kind of a macro resolver configuration or customizable macro resolver factory.
So I would also be interested in other solutions.

Regards
Felix

Mit freundlichen Grüßen
i.A. Felix Noz
 
____________________________________________________________________________________
 
Felix Noz
IT-Berater
Dipl. Informatiker (FH)
 
comundus GmbH
Schüttelgrabenring 3, 71332 Waiblingen
 
Telefon +49 (0) 71 51-5 00 28-22
Internet www.comundus.com
 
Geschäftsführer: Klaus Hillemeier
Amtsgericht Stuttgart, HRB 264290
 
comundus ist ein Unternehmen der IT EXCELLENCE Group.
____________________________________________________________________________________





-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Marc Schlegel
Gesendet: Mittwoch, 21. Mai 2008 01:32
An: The OpenCms mailing list
Betreff: [opencms-dev] How to write an own Macro that can be used inContent-XSD

Hello Everyone

While still working/leverageing my structured-content-xsd I stumbled upon the macros, espcially the ${currenttime}. Since I would like to set the time in a default-element in addition to a current date I would like to know how to write my own Macro.

To be more precise, I need someting like <defaults>
    <default element="bla" value="${currentdate} 20:00"/> </defaults>

So, how and where to start to writing the macro "currentdate" which will only give me the actual date e.g. 20.05.08?
Is this possible anyway?

regards
-- Marc

_______________________________________________
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