com.softwareag.centrasite.api.csom.action
Interface AttachDocumentAction

All Superinterfaces:
CSOAction
All Known Subinterfaces:
CreateAssetActivity

public interface AttachDocumentAction
extends CSOAction

The AttachDocumentAction interface provides a mechanism to attach a document either as InputStream or URI. This interface contains the various document process states such as Initial, Attach Main Document, Attach Missing Document, Attach an Existing Document, Completed etc., wherein the states Attach Missing Document and Attach an Existing Document repeat more than once for the Attach Document action.

 +-----------------------------+
 |                             |
 |   AttachDocumentAction      |
 |                             |
 +-----------------------------+
          |          ^
          |          |
          |          |
          V          |
 +-----------------------------+
 |                             |
 | AttachDocumentSynchronizer  |
 |                             |
 +-----------------------------+
          |          ^
          |          |
          |          |
          V          |
 +-----------------------------+
 |                             |
 |AttachDocumentProcessorThread|
 |                             |
 +-----------------------------+


 
The AttachDocumentAction interface receive the documents to attach for a specified registry object and hand it over to the AttachDocumentProcessorThread, where in case if any of the attached document is dependent on another document then the same instructs the AttachDocumentAction about the missing document.


Method Summary
 java.lang.String getCurrentState()
          Returns status of the document process.
 java.util.Collection<CentraSiteRegistryObject> getExistingAssets()
          Returns existing dependent assets for the specified asset's document.
 java.lang.String getMessage()
          If the AttachDocumentProcessor fails to process the document, this returns the root cause message.
 java.lang.String getMissingFileName()
          Returns the missing file name to be uploaded by the user.
 java.util.Collection<AssetSupportedOption> getSupportedOptions()
          Returns a collection of AssetSupportedOption
 void setAssetName(java.lang.String assetName)
          Sets the name for the asset.
 void setCreateVersion(boolean createVersion)
          If createVersion is true, creates an asset with the next available version and given document.
 void setCredentials(java.net.PasswordAuthentication credentials)
          Sets the credentials if in case of a need to protect documents.
 void setDocument(java.io.InputStream document)
          Sets the document content as InputStream.
 void setDocument(java.lang.String uri)
          Sets the location of the document to the specified URI.
 void setInteractiveResolution(boolean interactiveResolution)
          if the set interactive resolution is true, then system won't interact with user in case missing document already exists.
 void setOrigionalName(java.lang.String origionalName)
          Sets the display name for the attached main document.
 void setOverwriteExisting(boolean overwrite)
          If overwrite is true, overwrites the existing document attached to the asset.
 void setReuseAsset(java.lang.String csoId)
          If a dependent asset exists, sets the user specified asset Id to attach to the asset.
 void setUserVersion(java.lang.String assetName)
          Sets the user-defined version identifier for the asset.
 
Methods inherited from interface com.softwareag.centrasite.api.csom.action.CSOAction
cancel, executeNextStep, executePreviousStep, finishAllSteps, getGroup, getIconURL, getId, getName, getSkippedObjectsWithReason, isAllowed, isApplicable, setObjects
 

Method Detail

setDocument

void setDocument(java.lang.String uri)
                 throws CLLException
Sets the location of the document to the specified URI.

Parameters:
uri - a specific location for the file.
Throws:
CLLException - in case if URI is null.

setDocument

void setDocument(java.io.InputStream document)
                 throws CLLException
Sets the document content as InputStream.

Parameters:
document - the document to be attached as InputStream.
Throws:
CLLException - in case if the document specified by the user is not null or failed to create the file with the given input.

setOrigionalName

void setOrigionalName(java.lang.String origionalName)
                      throws CLLException
Sets the display name for the attached main document.

Parameters:
origionalName - the display name for the main document.
Throws:
CLLException

setAssetName

void setAssetName(java.lang.String assetName)
Sets the name for the asset.

Parameters:
assetName - the name for the asset.

setUserVersion

void setUserVersion(java.lang.String assetName)
Sets the user-defined version identifier for the asset.

Parameters:
assetName - the user-defined version identifier for the asset.

setCredentials

void setCredentials(java.net.PasswordAuthentication credentials)
Sets the credentials if in case of a need to protect documents.

Parameters:
credentials - the PasswordAuthentication that wraps the username and password.

getCurrentState

java.lang.String getCurrentState()
Returns status of the document process. Please see the AttachDocumentState for the supported states.

Specified by:
getCurrentState in interface CSOAction
Returns:
the state of the document process.

getExistingAssets

java.util.Collection<CentraSiteRegistryObject> getExistingAssets()
                                                                 throws CLLException
Returns existing dependent assets for the specified asset's document.

Returns:
the list of existing dependent assets; however if user creates versioned objects then the list contains more than one element.
Throws:
CLLException - in case of a failure to get the existing assets that are dependent on the specified asset's document. assocaited document.

getMissingFileName

java.lang.String getMissingFileName()
Returns the missing file name to be uploaded by the user. If user upload a file different from the missing file, then simply ignore the wrong file and not prompt for the same file again.

Returns:
the missing file name

setReuseAsset

void setReuseAsset(java.lang.String csoId)
                   throws CLLException
If a dependent asset exists, sets the user specified asset Id to attach to the asset.

Parameters:
csoId - CentraSiteObject.getId()
Throws:
CLLException - in case of a failure to get the CentraSiteRegistryObject with the specified Id.

setOverwriteExisting

void setOverwriteExisting(boolean overwrite)
If overwrite is true, overwrites the existing document attached to the asset.

Parameters:
overwrite - overwrites the existing document attached to the asset.

setCreateVersion

void setCreateVersion(boolean createVersion)
If createVersion is true, creates an asset with the next available version and given document.

Parameters:
createVersion - create a new version of the specified asset with the given document.

setInteractiveResolution

void setInteractiveResolution(boolean interactiveResolution)
if the set interactive resolution is true, then system won't interact with user in case missing document already exists.

Parameters:
interactiveResolution - interact with the user for resolving the missing documents.

getMessage

java.lang.String getMessage()
If the AttachDocumentProcessor fails to process the document, this returns the root cause message.

Returns:
root cause message.

getSupportedOptions

java.util.Collection<AssetSupportedOption> getSupportedOptions()
                                                               throws CLLException
Returns a collection of AssetSupportedOption

Returns:
collection of AssetSupportedOption
Throws:
CLLException