Pipeline mapper needed to find mapping path by a pipeline name
--------------------------------------------------------------

                 Key: JS2-1238
                 URL: https://issues.apache.org/jira/browse/JS2-1238
             Project: Jetspeed 2
          Issue Type: Improvement
          Components: Components Core
    Affects Versions: 2.2.1
            Reporter: Woonsan Ko
            Assignee: Woonsan Ko
            Priority: Minor
             Fix For: 2.2.2


Currently we have a configuration for the default pipeline in 
jetspeed.properties as follows:

pipeline.default = jetspeed-pipeline

Also, the default pipeline name is used in JetspeedEngine to find a default 
pipeline component when there's no servlet path mapping is found.
Obviously, this is a good feature because we don't have to stick to physical 
servlet paths.

I think this should be extended as a separate component like PipelineMapper to 
allow some custom servlet filters to leverage it.
For example, when a custom servlet filter is responsible for choosing a 
pipeline for the request and forwarding the request, then the servlet filter 
should be able to find the servlet path mapped to a pipeline because the 
servlet filter needs to use 
ServletContext.getRequestDispatcher(contextRelativePath).forward().

Therefore, I think we can add PipelineMapper component like this:

interface PipelineMapper {
    
    /** Finds pipeline which bean id is equals to pipelineId. */
    Pipeline getPipelineById(String pipelineId);      // ex) 
getPipelineById("jetspeed-pipeline");
    
    /** Finds pipeline which name is equals to pipelineName. */
    Pipeline getPipelineByName(String pipelineName);    // ex) 
getPipelineByName("JetspeedPipeline")
    
    /** Find the servlet mapping path by pipeline bean id. */
    String getPathByPipelineId(String pipelineId);     // ex) 
getPathByPipelineId("jetspeed-pipeline");
    
    /** Find the servlet mapping path by pipeline name. */
    String getPathByPipelineName(String pipelineId);     // ex) 
getPathByPipelineName("JetspeedPipeline");
    
}

FYI, personally, I think it's better to use pipeline name consistently, but it 
is necessary to keep operations with pipeline bean IDs for backward 
compatibility.

This could modify pipelines.xml slightly by wrapping the existing 
'pipeline-map' bean, and add one pair of interface/default impl.

If there's any objection, please let me know.

Regards,

Woonsan

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscr...@portals.apache.org
For additional commands, e-mail: jetspeed-dev-h...@portals.apache.org

Reply via email to