You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "Javier Puerto (JIRA)" <ji...@apache.org> on 2009/05/12 11:37:45 UTC

[jira] Created: (FOR-1164) The 'lm' preffix is harcoded, make it configurable

The 'lm' preffix is harcoded, make it configurable
--------------------------------------------------

                 Key: FOR-1164
                 URL: https://issues.apache.org/jira/browse/FOR-1164
             Project: Forrest
          Issue Type: Improvement
          Components: Locationmap
            Reporter: Javier Puerto
            Priority: Minor


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://*"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FOR-1164) The 'lm' preffix is harcoded, make it configurable

Posted by "Thorsten Scherler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FOR-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thorsten Scherler closed FOR-1164.
----------------------------------

    Resolution: Fixed

Committed revision 773885.

muchas gracias Javier

> The 'lm' preffix is harcoded, make it configurable
> --------------------------------------------------
>
>                 Key: FOR-1164
>                 URL: https://issues.apache.org/jira/browse/FOR-1164
>             Project: Forrest
>          Issue Type: Improvement
>          Components: Locationmap
>            Reporter: Javier Puerto
>            Priority: Minor
>
> 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://*"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (FOR-1164) The 'lm' preffix is harcoded, make it configurable

Posted by "Thorsten Scherler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FOR-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thorsten Scherler reopened FOR-1164:
------------------------------------


The patch is not "deep" enough since there are still some places in the code where we have a fixed "lm" value for the variable.

The problem is in org.apache.forrest.locationmap.lm.LocationMap
public static final String ANCHOR_NAME = "lm";

We are using in a couple of classes LocationMap.ANCHOR_NAME which is causing problems for the "new" prefixed source Factories because in the end it will always look up lm and not e.g. "lmx"

> The 'lm' preffix is harcoded, make it configurable
> --------------------------------------------------
>
>                 Key: FOR-1164
>                 URL: https://issues.apache.org/jira/browse/FOR-1164
>             Project: Forrest
>          Issue Type: Improvement
>          Components: Locationmap
>            Reporter: Javier Puerto
>            Priority: Minor
>
> 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://*"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.