uk.org.ogsadai.client.toolkit.activity
Class ExampleActivity

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.ExampleActivity

public class ExampleActivity
extends Activity

This is a template class that can be used for writing new client toolkit activity.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.lang.String mSettingA
          A required setting.
private  int mSettingB
          Another required setting.
private  java.lang.String mSettingC
          An optional setting.
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
ExampleActivity(java.lang.String settingA, int settingB)
          Constructs the activity.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getOutput()
          Gets the activity output.
 int getSomething()
          Get the value of some attribute someAttribute
 void setInput(ActivityOutput input)
          Sets the name of the output of another activity in the same request that will provide data for a specific input of this activity.
 void setSettingC(java.lang.String setting)
          Set value of optional setting
 
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

mSettingA

private java.lang.String mSettingA
A required setting.


mSettingB

private int mSettingB
Another required setting.


mSettingC

private java.lang.String mSettingC
An optional setting.

Constructor Detail

ExampleActivity

public ExampleActivity(java.lang.String settingA,
                       int settingB)
Constructs the activity.

Parameters:
settingA - Arbitrary value for first setting.
settingB - Arbitrary value for second setting.
Method Detail

setSettingC

public void setSettingC(java.lang.String setting)
Set value of optional setting

Parameters:
setting - Arbitrary value for optional setting.

setInput

public final void setInput(ActivityOutput input)
Sets the name of the output of another activity in the same request that will provide data for a specific input of this activity. By this mechanism, activities can be chained to one another.

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

getOutput

public ActivityOutput getOutput()
Gets the activity output.

Returns:
the activity output

getSomething

public int getSomething()
                 throws DataFormatException,
                        NoActivityOutputException
Get the value of some attribute someAttribute

Returns:
the value of some attribute
Throws:
DataFormatException - if the XML output data for the activity's output cannot be parsed.
NoActivityOutputException - if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.

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
Returns:
the XML for the activity