uk.org.ogsadai.client.toolkit.activity.xmldb
Class XMLCreateResource

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

public class XMLCreateResource
extends Activity

This activity creates a new resource within an XML database collection.

This version of the activity has no input and one output. The format of the output is OGSA-DAI specific XML. For example: <createdResource name="someNewResource"/>

Author:
The OGSA-DAI Project Team

Constructor Summary
XMLCreateResource()
          Constructs a request to create a new resource.
XMLCreateResource(java.lang.String content)
          Constructs a request to create a new resource.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 ActivityOutput getOutput()
          Gets the activity's only output.
 java.lang.String getResourceName()
          Gets the name of the added resource.
 void setContent(java.lang.String content)
          Set the resource content.
 void setContentFromFile(java.lang.String contentFileName)
          Set the resource content to be the contents of a file.
 void setParentCollectionName(java.lang.String parentCollectionName)
          Set the parent collection name.
 void setResourceName(java.lang.String resourceName)
          Set the resource name.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLCreateResource

public XMLCreateResource()
Constructs a request to create a new resource.


XMLCreateResource

public XMLCreateResource(java.lang.String content)
                  throws DocumentParsingException
Constructs a request to create a new resource.

Parameters:
content -
Throws:
DocumentParsingException - If the content is not valid XML
Method Detail

setResourceName

public void setResourceName(java.lang.String resourceName)
Set the resource name.

Parameters:
resourceName -

setParentCollectionName

public void setParentCollectionName(java.lang.String parentCollectionName)
Set the parent collection name.

Parameters:
parentCollectionName -

setContent

public void setContent(java.lang.String content)
                throws DocumentParsingException
Set the resource content.

Parameters:
content -
Throws:
DocumentParsingException - If the content is not valid XML

setContentFromFile

public void setContentFromFile(java.lang.String contentFileName)
                        throws java.io.FileNotFoundException,
                               java.io.IOException,
                               DocumentParsingException
Set the resource content to be the contents of a file.

Parameters:
contentFileName - name of file containing resource content
Throws:
java.io.FileNotFoundException - If the file does not exist
java.io.IOException - If an IO exception occurs when attempting to access the file.
DocumentParsingException - If the file is not valid XML
java.lang.IllegalArgumentException - If argument is null

getOutput

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

Returns:
the activity output.

getResourceName

public java.lang.String getResourceName()
                                 throws ActivityOutputException,
                                        DataFormatException
Gets the name of the added resource.

Returns:
String containing the resource name.
Throws:
DataFormatException - If the output data is not in the expected format.
ActivityOutputException - If there is no output data.

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
See Also:
Activity.generateXML()