Details
-
Improvement
-
Status: Reopened
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
Normal
Description
We are using the Locationmap with the Dispatcher block of Cocoon 2.2 and found that we can't define the preffix for the SourceFactory because it' harcoded in the LocationmapSourceFactory class.
public static final String LM_PREFIX = "lm";
In our case, we use the locationmap in two diferents blocks with diferent locationmap.xml configurations but because of spring the configurations overlaping between block. As the configurations is diferent for each block, we need anothe preffix to make it works.
I made this changes to make LocationmapSourceFactory configurable:
Entends from "Configurable".
Add a private attribute: private String prefix;
Sustitute any reference to "LM_PREFIX" for the new "prefix" variable.
Implements the follow function to make the config to work.
public void configure(Configuration configuration)
throws ConfigurationException {
prefix = configuration.getAttribute("prefix", LM_PREFIX);
}
Now we can configure like this:
<source-factories>
<component-instance class="org.apache.forrest.locationmap.source.impl.LocationmapSourceFactory"
name="lmx" prefix="lmx"/>
</source-factories>
And call the other instance of Locationmap with uris like this "lmx://*"
public static final String LM_PREFIX = "lm";
In our case, we use the locationmap in two diferents blocks with diferent locationmap.xml configurations but because of spring the configurations overlaping between block. As the configurations is diferent for each block, we need anothe preffix to make it works.
I made this changes to make LocationmapSourceFactory configurable:
Entends from "Configurable".
Add a private attribute: private String prefix;
Sustitute any reference to "LM_PREFIX" for the new "prefix" variable.
Implements the follow function to make the config to work.
public void configure(Configuration configuration)
throws ConfigurationException {
prefix = configuration.getAttribute("prefix", LM_PREFIX);
}
Now we can configure like this:
<source-factories>
<component-instance class="org.apache.forrest.locationmap.source.impl.LocationmapSourceFactory"
name="lmx" prefix="lmx"/>
</source-factories>
And call the other instance of Locationmap with uris like this "lmx://*"