Moving thread to dev.
On Tue, 2007-05-22 at 23:45 +0200, Markus Angst wrote:
> Joern Nettingsmeier wrote:
> > Markus Angst wrote:
> >>
> >> My first attempt was to use lenya.properties.xml. Since this works only
> >> globally and on a module level, I have to create a module to smuggle the
> >> file into our publication. It works, but it feels like using a big tool
> >> for a small task and I would need a new module for every publication
> >> that needs its own lenya.properties.xml. I think it would be a nice
> >> feature to have a lenya.properties.xml on a publication level (just drop
> >> it into $PUB_HOME).
> >
> > +1. neat idea. thorsten, iirc you came up with that feature in the first
> > place, right? how difficult could this be?
>
> My Java knowledge is very limited, but I feel that tweaking
> modules-core/properties/.../PropertiesModule.java would do.
Yeah, the only problem was that at the time I wrote the code when doing
initialize() I did not had any information about which pubs are builded.
We can implement the following PSEUDO (!!!) code (in the spirit of the
modules properties):
in service(...):
publicationManager = (PublicationManager)
manager.lookup(PublicationManager.ROLE);
in initialize():
String[] pub2src = publicationManager.getPubsIds();
for (int i = 0; i < publication2src.length; i++) {
String id = publication2src[i];
Object value = publicationManager.getBaseURI(id);
if (value != null) {
lenyaPropertiesStringURI = value + SystemUtils.FILE_SEPARATOR
+ PROPERTY_NAME;
filteringProperties =
loadXMLPropertiesFromURI(filteringProperties,
lenyaPropertiesStringURI);
}
}
Where PublicationManager is not working this way. You need to change the
code using Publication[] getPublications(DocumentFactory factory)
instead getPubsIds() and some other changes.
After we fixed the proxy issue I will have a look if no patch submission
beats me to it.
salu2
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]