JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Documentation
  • DOCS-61

Inadequate documentation of use of Custom Transform

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: 3.3 Documentation
  • Labels:
    • targeted-3.3.1
  • Environment:

    Windows 7 x64, Eclipse 3.6 w Mule IDE, JDK 6

  • Configuration:
    Hide

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp"
    xmlns:file="http://www.mulesoft.org/schema/mule/file"
    xmlns:https="http://www.mulesoft.org/schema/mule/https"
    xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:spring-security="http://www.mulesoft.org/schema/mule/spring-security"
    xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
    xsi:schemaLocation="
    http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.1/mule-ftp.xsd
    http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
    http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/3.1/mule-https.xsd
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
    http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.1/mule-spring-security.xsd
    http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd">

    <model name="Test">
    <service name="TestService">
    <inbound>
    <http:inbound-endpoint address="http://localhost:8080/test1"
    exchange-pattern="request-response" method="GET">
    <http:body-to-parameter-map-transformer name="ParamTransform" />
    <custom-transformer name="Transformer" class="org.mule.transformer.simple.MapLookup">
    <spring:property name="key" value="textinfo"/>
    </custom-transformer>
    <response>
    <message-properties-transformer>
    <add-message-property key="Content-type" value="text/html" />
    </message-properties-transformer>
    </response>
    </http:inbound-endpoint>
    </inbound>
    <component>
    <method-entry-point-resolver>
    <include-entry-point method="evalParams" />
    </method-entry-point-resolver>
    <singleton-object class="factor3.test.esb.pojo.TestOutput" />
    </component>
    </service>
    </model>
    </mule>

    Show
    <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring-security="http://www.mulesoft.org/schema/mule/spring-security" xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.1/mule-ftp.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/3.1/mule-https.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.1/mule-spring-security.xsd http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd"> <model name="Test"> <service name="TestService"> <inbound> <http:inbound-endpoint address="http://localhost:8080/test1" exchange-pattern="request-response" method="GET"> <http:body-to-parameter-map-transformer name="ParamTransform" /> <custom-transformer name="Transformer" class="org.mule.transformer.simple.MapLookup"> <spring:property name="key" value="textinfo"/> </custom-transformer> <response> <message-properties-transformer> <add-message-property key="Content-type" value="text/html" /> </message-properties-transformer> </response> </http:inbound-endpoint> </inbound> <component> <method-entry-point-resolver> <include-entry-point method="evalParams" /> </method-entry-point-resolver> <singleton-object class="factor3.test.esb.pojo.TestOutput" /> </component> </service> </model> </mule>
  • Similar Issues:
    None

Description

I have attempted to use <custom-transformer> in conjunction with the MapLookup class in order to select a parameter to pass to a method in a component. What I am finding is that there is no documentation or examples of how to do this.

In the configuration given below, the input endpoint is an HTTP request that has parameters associated with it. I use a body-to-map-transformer to convert the parameters into a map. Then I attempt to use a custom-transformer get a specific parameter out of the map.

Problem 1: On your page on available transforms, the custom-transformer is not mentioned.

Problem 2: when I finally found an example of the proper property class to use with a custom transformer with MapLookup (in the Mule 2 User's guide!) the example given does not work. I get an error saying that spring:property is not bound.

This is a major documentation inadequacy (one of many, frankly!) that needs to be corrected if people are going to have any real control over HTTP parameters.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Builds
Hide
Permalink
Pablo Kraan added a comment - 11/Jan/12 09:10 AM

Hi Norman, can you take a look at this issue?

Show
Pablo Kraan added a comment - 11/Jan/12 09:10 AM Hi Norman, can you take a look at this issue?
Hide
Permalink
Janet Revell added a comment - 28/Aug/12 12:32 PM

Here is what I propose in order to address (at minimum) this customer's concerns:
1. Add Custom Transformer to the list of available transformer on this page: http://www.mulesoft.org/documentation/display/MULE3USER/Using+Transformers#UsingTransformers-AvailableTransformers

2. Add information about Transformer Classes (adapted from 2.x user Guide (http://www.mulesoft.org/documentation-3.2/display/MULE2USER/Creating+Custom+Transformers) to this page: http://www.mulesoft.org/documentation/display/MULE3USER/Creating+Custom+Transformers

3. Update the example code snippet included in on the page in item 2 above so that it functions and doesn't return a "spring property is not bound" error.

Would just need help updating the Transformer Classes section of the doc + a new version of the example.

Thoughts?

Show
Janet Revell added a comment - 28/Aug/12 12:32 PM Here is what I propose in order to address (at minimum) this customer's concerns: 1. Add Custom Transformer to the list of available transformer on this page: http://www.mulesoft.org/documentation/display/MULE3USER/Using+Transformers#UsingTransformers-AvailableTransformers 2. Add information about Transformer Classes (adapted from 2.x user Guide (http://www.mulesoft.org/documentation-3.2/display/MULE2USER/Creating+Custom+Transformers) to this page: http://www.mulesoft.org/documentation/display/MULE3USER/Creating+Custom+Transformers 3. Update the example code snippet included in on the page in item 2 above so that it functions and doesn't return a "spring property is not bound" error. Would just need help updating the Transformer Classes section of the doc + a new version of the example. Thoughts?
Hide
Permalink
Janet Revell added a comment - 29/Aug/12 03:10 PM

Have discussed the proposed solutions with Pablo Kraan only to find that the problem is not what we thought. Some observations:

1. The Transformer Classes documentation does exist in the 3.3 docs set, it's just in a slightly different place (one level deeper) in the documentation: http://www.mulesoft.org/documentation/display/MULE3USER/Creating+Custom+Transformer+Class

2. The code snipped included in the example in that section is not out-dated, it actually does not have to do with the issue the reporter was having with the "spring property is not bound" error.

3. The error the reporter experienced was because (from Pablo's observation) he had not imported the spring bean name space. To get the app to work, must import:
a) the namespace xmlns:spring="http://www.springframework.org/schema/beans"
b) the schema http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd

4. The problem, therefore, was not with the custom transform; rather it was a problem with importing namespace and schema.

5. Clearly, however, there are problems that must be addressed:
a) customer could not find the "Creating Custom Transformers" page in the 3.3 docs set b) there was no existing information in the docs set to help him understand how to use a custom transformer to select a parameter in order to pass a method to a component.

Adding to the documentation backlog to investigate, from a big picture perspective, how we can improve the search so that he could have at least arrived at the correct page in the current docs set, and how we should improve the documentation of the custom transformer-- it would seem we need more use case-based examples on how a customer can use a custom transformer. Or where another transformer might be a better fit.

At present, will at least add "Custom Transformer" to the list of Available transformers as something Mule supports building (i.e. it's not OOTB available).

Show
Janet Revell added a comment - 29/Aug/12 03:10 PM Have discussed the proposed solutions with Pablo Kraan only to find that the problem is not what we thought. Some observations: 1. The Transformer Classes documentation does exist in the 3.3 docs set, it's just in a slightly different place (one level deeper) in the documentation: http://www.mulesoft.org/documentation/display/MULE3USER/Creating+Custom+Transformer+Class 2. The code snipped included in the example in that section is not out-dated, it actually does not have to do with the issue the reporter was having with the "spring property is not bound" error. 3. The error the reporter experienced was because (from Pablo's observation) he had not imported the spring bean name space. To get the app to work, must import: a) the namespace xmlns:spring="http://www.springframework.org/schema/beans" b) the schema http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 4. The problem, therefore, was not with the custom transform; rather it was a problem with importing namespace and schema. 5. Clearly, however, there are problems that must be addressed: a) customer could not find the "Creating Custom Transformers" page in the 3.3 docs set b) there was no existing information in the docs set to help him understand how to use a custom transformer to select a parameter in order to pass a method to a component. Adding to the documentation backlog to investigate, from a big picture perspective, how we can improve the search so that he could have at least arrived at the correct page in the current docs set, and how we should improve the documentation of the custom transformer-- it would seem we need more use case-based examples on how a customer can use a custom transformer. Or where another transformer might be a better fit. At present, will at least add "Custom Transformer" to the list of Available transformers as something Mule supports building (i.e. it's not OOTB available).
Hide
Permalink
Janet Revell added a comment - 29/Aug/12 03:19 PM

See previous comment on the issue to see explanation, action, and take away for docs backlog.

Show
Janet Revell added a comment - 29/Aug/12 03:19 PM See previous comment on the issue to see explanation, action, and take away for docs backlog.

People

  • Assignee:
    Janet Revell
    Reporter:
    Robert Brown III
Vote (0)
Watch (0)

Dates

  • Created:
    17/Mar/11 08:33 PM
    Updated:
    30/Nov/12 12:34 PM
    Resolved:
    29/Aug/12 03:19 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.