Defining transformations in the transformation descriptor

Define transformations using the <transformation:transformation/> in ibm-portal-transformation.xml, which is deployed to the console along with the transformation code.

About this task

Each transformation definition contains a description, a title, and one of the following elements depending on the transformation type:
  • <transformation:java-class/> element that provides the fully-qualified class name of the JAR file with the transformation class
  • <transformation:function-name/> element that provides the name of the JavaScript function
  • <transformation:url/> element that provides the relative or absolute URL to the servlet performing the transformation. The servlet must be deployed on the same application server as the console.

Procedure

  1. Open the ibm-portal-transformation.xml file.
  2. Enter a <transformation:transformation/> element, its description, and title.
    <transformation:transformation uniqueName=
       "com.ibm.TIP.samples.actions.transformation.JavaTransformationSample">
    
       <transformation:description uniqueName=
          "com.ibm.TIP.samples.actions.transformations.JavaTransformationSample.description">
          <base:nls-ref key="JavaTransformationSample.description" locationName=
             "classes/com/ibm/TIP/samples/actions/transformations/nl/JavaTransformationSample" />
       </transformation:description>
    
       <transformation:title uniqueName=
          "com.ibm.TIP.samples.transformation.JavaTransformationSample.title">
          <base:nls-ref key="JavaTransformationSample.title" locationName=
             "classes/com/ibm/TIP/samples/actions/transformations/nl/JavaTransformationSample" />
       </transformation:title>
    
    </transformation:transformation>
  3. If it is a Java transformation, enter the <transformation:java-class/> element.
       <transformation:java-class>
          com.ibm.TIP.samples.actions.transformations.JavaTransformationSample
       </transformation:java-class>
  4. If it is a JavaScript transformation, enter the <transformation:function-name/> element.
       <transformation:function-name>
          TIPJavaScriptTransformationSample
       </transformation:function-name>
  5. If it is a URL servlet transformation, enter the <transformation:url/> element.
       <transformation:url>
          https://www.example.com:9046/ibm/ClientSideActions/servlet/com.ibm.TIP.
    URLTransformationSampleServlet </transformation:url>