cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Externalizing JXTG tag configuration
Date Wed, 11 May 2005 08:24:11 GMT
right now we have:

registerInstruction("template", StartTemplate.class.getName());
registerInstruction("forEach", StartForEach.class.getName());
registerInstruction("if", StartIf.class.getName());
registerInstruction("choose", StartChoose.class.getName());
registerInstruction("when", StartWhen.class.getName());
registerInstruction("otherwise", StartOtherwise.class.getName());

which puts all tag definitions into a proper map. I'd like to 
externalize that. Few issues:

It was mentioned on the list that it would be the best to store that 
configuration in sitemap-language.xml. From what I see it does not 
contain any component specific configuration. I we are to follow that 
path I have some questions:
- should we modify that file at build time? (block inclusion should 
cause writing configuration int the file)
- how to get the config from that file at runtime?

Implementation details: I'd like to create a JxtgInstructionFactory 
component that is thread safe (configuration should be parsed and shared 
for all JXTG parsers for now). The JxtgTagFactory interface looks like this:

public interface JxtgInstructionFactory {
    public StartInstruction createInstruction( StartElement startElement,
                               Attributes attrs,
                               Stack elementStack )
                                   throws ProcessingException;
}

I could also start from putting the configuration into cocoon.xconf and 
then refactor if needed.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message