uk.org.ogsadai.client.toolkit.activity.transform
Class XSLTransform

java.lang.Object
  extended byuk.org.ogsadai.client.toolkit.activity.RequestComponent
      extended byuk.org.ogsadai.client.toolkit.activity.Activity
          extended byuk.org.ogsadai.client.toolkit.activity.transform.XSLTransform

public class XSLTransform
extends Activity

This activity performs an XSL transformation on the data output by another activity.

This activity has one required input - the XML document to be transformed and provided by another activity - one optional input - the XSLT document (if this input is not provided then the document must be provided inline). The activity has one output - the transformed document.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.lang.String mXSLTInput
          XSLT document if passed inline, null otherwise.
private static int XML_INPUT_INDEX
          Index of XML input.
private static int XSLT_INPUT_INDEX
          Index of XSLT input.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
XSLTransform()
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getOutput()
          Gets the activity's only output - the transformed data.
 void setXMLInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to transformed.
 void setXSLTInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to transformed.
 void setXSLTInput(org.w3c.dom.Document input)
          Sets the XSLT document to be passed to the service.
 void setXSLTInput(java.lang.String input)
          Sets the XSLT document to be passed to the service.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getDataService, getName, getSession, setDataService, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

XML_INPUT_INDEX

private static final int XML_INPUT_INDEX
Index of XML input.

See Also:
Constant Field Values

XSLT_INPUT_INDEX

private static final int XSLT_INPUT_INDEX
Index of XSLT input.

See Also:
Constant Field Values

mXSLTInput

private java.lang.String mXSLTInput
XSLT document if passed inline, null otherwise.

Constructor Detail

XSLTransform

public XSLTransform()
Constructor.

setXMLInput should be called to set the activity that provides input to this activity and setXSLTInput to set source of the XSLT document.

Method Detail

setXMLInput

public void setXMLInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to transformed.

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.

setXSLTInput

public void setXSLTInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to transformed.

If either of the other two setXSLTInput methods are called then the XSLT document used will be the one provided to the method called.

Parameters:
input - Output from another activity.
Throws:
java.lang.IllegalArgumentException - If input is null.

setXSLTInput

public void setXSLTInput(org.w3c.dom.Document input)
Sets the XSLT document to be passed to the service.

Parameters:
input - XSLT document.
Throws:
java.lang.IllegalArgumentException - If input is null or does not seem to be an XML document.

setXSLTInput

public void setXSLTInput(java.lang.String input)
Sets the XSLT document to be passed to the service.

Parameters:
input - XSLT document.
Throws:
java.lang.IllegalArgumentException - If input is null or does not seem to be an XML document.

getOutput

public ActivityOutput getOutput()
Gets the activity's only output - the transformed data.

Returns:
the activity output.

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity