Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9580

XSLT Component: Support custom URI resolver which depends on dynamic resource URI of the endpoint

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • camel-core
    • None
    • Unknown

    Description

      The XSLT component allows already specifying custom URI resolvers via the parameter uriResolver. However, when your custom URI resolver depends on the dynamic URI of the endpoint then the current solution is not sufficient. Suppose you have a dynamically created XSLT endpoint, like

      <camel:recipientList>
      <camel:simple>xslt:${header.XSLT_FILE}?uriResolver=#uriResolver</camel:simple>
      </camel:recipientList>

      where the resource URI of the XSLT document is also dynamic (in the example via the header XSLT_File). In this case you cannot hand-over the dynamic resource URI to the custom URI resolver.

      The contribution solves this problem by introducing a new parameter uriResolverFactory where you can specify a factory which implements the method

      URIResolver createUriResolver(CamelContext camelContext, String resourceUri)

      This method is called when the endpoint is created and gives you access to the endpoint resource URI.

      We also support that the resource URI factory can be set on the component so that you must not set the factory on each endpoint.

      Further advantage of the new approach is that you can now easily extend the default resource resolver org.apache.camel.builder.xml.XsltUriResolver which also depends on the resource URI of the endpoint.

      Attachments

        Activity

          People

            forsthofer Franz Forsthofer
            forsthofer Franz Forsthofer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: