Uploaded image for project: 'Jetspeed 2 (Retired)'
  1. Jetspeed 2 (Retired)
  2. JS2-1238

Pipeline mapper needed to find mapping path by a pipeline name

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 2.2.2
    • Components Core
    • None

    Description

      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

      Attachments

        Activity

          People

            woon_san Woonsan Ko
            woon_san Woonsan Ko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: