uk.org.ogsadai.client.toolkit.activity.indexedfiles
Class AddAndIndexFile

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

public class AddAndIndexFile
extends Activity

This activity adds a flat file to a file system data service resource and indexes it. The following values should be set before the activity is submitted in a request.

This activity has one input - the content of the new file as provided by another activity.


Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.lang.String mDirectory
          Directory in which flat file is to be written
private  java.lang.String[] mFields
          Fields of the file to be indexed
private  java.lang.String mFilename
          Name of flat file into which data is to be stored
private  java.lang.String mFiletype
          Flat file type
private  java.lang.String mIndex
          Directory where index should be placed
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
 
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
 
Constructor Summary
AddAndIndexFile()
          Default constructor.
AddAndIndexFile(java.lang.String filename, java.lang.String dirname)
          Constructor.
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 java.lang.String getDirectory()
          Gets the relative directory where the new file will be placed.
 java.lang.String[] getFields()
          Return the indexed fields.
 java.lang.String getFilename()
          Gets the name of the new file.
 java.lang.String getFiletype()
          Gets the type of flat file that is being indexed.
 java.lang.String getIndex()
          Gets the relative directory where the index will be placed.
 void setFields(java.lang.String[] fields)
          Set the indexed fields.
 void setFile(java.lang.String filename, java.lang.String directory)
          Sets the name of the new flat file and the relative directory in which it is to be created.
 void setFiletype(java.lang.String filetype)
          Sets the type of the flat file.
 void setIndex(java.lang.String index)
          Sets the relative directory where the index will be placed.
 void setInput(ActivityOutput input)
          Sets the input of this activity to be the output from another activity that will provide the data to be written into the new file.
 
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

mFilename

private java.lang.String mFilename
Name of flat file into which data is to be stored


mDirectory

private java.lang.String mDirectory
Directory in which flat file is to be written


mFiletype

private java.lang.String mFiletype
Flat file type


mIndex

private java.lang.String mIndex
Directory where index should be placed


mFields

private java.lang.String[] mFields
Fields of the file to be indexed

Constructor Detail

AddAndIndexFile

public AddAndIndexFile()
Default constructor.

setInput should be called to set the activity that provides input to this activity.


AddAndIndexFile

public AddAndIndexFile(java.lang.String filename,
                       java.lang.String dirname)
Constructor.

setInput should be called to set the activity that provides input to this activity.

Parameters:
filename - Name of the file that is added to the file system
dirname - Directory where the new file will be placed
Throws:
java.lang.IllegalArgumentException - If filename is null.
Method Detail

setFile

public void setFile(java.lang.String filename,
                    java.lang.String directory)
Sets the name of the new flat file and the relative directory in which it is to be created.

Parameters:
filename - Name of the file that is added to the file system
directory - Directory where the new file will be placed
Throws:
java.lang.IllegalArgumentException - If filename is null.

getFilename

public java.lang.String getFilename()
Gets the name of the new file.

Returns:
the name of the file

getDirectory

public java.lang.String getDirectory()
Gets the relative directory where the new file will be placed.

Returns:
the directory.

setFiletype

public void setFiletype(java.lang.String filetype)
Sets the type of the flat file.

Parameters:
filetype - One of the flat file types that this activity is configured to support by the file system data service resource. OGSA-DAI officially supports either SwissProt or OMIM.
Throws:
java.lang.IllegalArgumentException - If filetype is null.

getFiletype

public java.lang.String getFiletype()
Gets the type of flat file that is being indexed.

Returns:
the type of the flat file

setInput

public void setInput(ActivityOutput input)
Sets the input of this activity to be the output from another activity that will provide the data to be written into the new file.

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

getIndex

public java.lang.String getIndex()
Gets the relative directory where the index will be placed.

Returns:
the index directory

setIndex

public void setIndex(java.lang.String index)
Sets the relative directory where the index will be placed.

Parameters:
index - The relative index directory, relative to the root of the file system data service resource.

setFields

public void setFields(java.lang.String[] fields)
Set the indexed fields.

Parameters:
fields - Names of fields of the flat file that will be indexed.
Throws:
java.lang.IllegalArgumentException - If fields is null.

getFields

public java.lang.String[] getFields()
Return the indexed fields.

Returns:
names of the fields that will be indexed.

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