Process API

filenet.vw.api
Class VWAttachment

java.lang.Object
  extended by filenet.vw.api.VWAttachment
All Implemented Interfaces:
java.io.Serializable

public final class VWAttachment
extends java.lang.Object
implements java.io.Serializable

Use this class to access the identity, associated library or object store, type, Document ID, and version series of an attachment used in a workflow process.

Examples of retrieving and setting attachments follow:

 VWAttachment vwattach = (VWAttachment) stepElement.getParameterValue("attachmentfield");
 vwattach = new VWAttachment();
 vwattach.setId(versionseries_id);
 vwattach.setVersion(versionid);
 vwattach.setLibraryName("myobjectstore");
 vwattach.setLibraryType(VWLibraryType.LIBRARY_TYPE_CONTENT_ENGINE);
 vwattach.setType(VWAttachmentType.ATTACHMENT_TYPE_DOCUMENT);
 stepElement.setParameter("attachmentfield", vwattach, false); 

Since:
VWWS3.10
See Also:
VWDataField, VWParameter, Serialized Form

Field Summary
static char SEPARATOR
          Insert this separator ('|' or hex 7C) between attributes of a string-formatted attachment, as in an XML file or an XML transfer stream to the server.
 
Constructor Summary
VWAttachment()
          Creates a VWAttachment object with empty values, initially.
VWAttachment(java.lang.String theValue)
          Creates a VWAttachment object and sets the initial value.
 
Method Summary
static java.lang.String _get_FILE_AUTHOR()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_DATE()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_REVISION()
          For FileNet internal use only, do not call.
 java.lang.String getAttachmentDescription()
          Gets the description for this attachment.
 java.lang.String getAttachmentName()
          Gets the name associated with this attachment.
 java.lang.String getId()
          Gets the object, version series, or document ID for the attachment.
 java.lang.String getLibraryName()
          Gets the name of the library or object store where the attachment resides.
 int getLibraryType()
          Gets the library type of the library or object store that contains this attachment.
 int getType()
          Gets the attachment type value for the associated attachement.
 java.lang.String getVersion()
          Gets the version of this attachment.
 void setAttachmentDescription(java.lang.String theAttachmentDescription)
          Sets the description for an attachment.
 void setAttachmentName(java.lang.String theAttachmentName)
          Sets the document name for this attachment.
 void setId(java.lang.String theId)
          Sets the document ID associated with the attachment.
 void setLibraryName(java.lang.String theLibraryName)
          Sets the name of the library or object store associated with this attachment.
 void setLibraryType(int theLibraryType)
          Sets the library or object store type for the library or object store containing this attachment.
 void setType(int theAttachmentType)
          Sets the attachment type value for the associated attachment.
 void setVersion(java.lang.String theVersion)
          Sets the GUID for the attachment version for this attachment document.
 java.lang.String toString()
          Gets the String representation of a VWAttachment object associated with a document contained in library or object store The String contains seven elements; each element is delimited by the SEPARATOR.
 void toXML(java.lang.StringBuffer theBuffer)
          Appends an XML string representing this instance to the buffer specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
Insert this separator ('|' or hex 7C) between attributes of a string-formatted attachment, as in an XML file or an XML transfer stream to the server. You cannot use this character in String data members of this class.

See Also:
Constant Field Values
Constructor Detail

VWAttachment

public VWAttachment()
Creates a VWAttachment object with empty values, initially.


VWAttachment

public VWAttachment(java.lang.String theValue)
             throws VWException
Creates a VWAttachment object and sets the initial value.

Parameters:
theValue - A String representation of the attachment values in the format produced by toString().
Throws:
VWException - Thrown if the passed in value is not valid, due to either format or content.
See Also:
VWAttachmentType, VWLibraryType, toString()
Method Detail

_get_FILE_DATE

public static java.lang.String _get_FILE_DATE()
For FileNet internal use only, do not call.

Returns:
the file date

_get_FILE_AUTHOR

public static java.lang.String _get_FILE_AUTHOR()
For FileNet internal use only, do not call.

Returns:
the file author

_get_FILE_REVISION

public static java.lang.String _get_FILE_REVISION()
For FileNet internal use only, do not call.

Returns:
the file revision

getId

public java.lang.String getId()
Gets the object, version series, or document ID for the attachment. For documents that are stored in the Content Engine, the version series is returned; otherwise, a document ID will be returned for a document attachment.

Returns:
The document ID or version series GUID of the attachment. For documents that are stored in the Content Engine, the version series is returned; otherwise, a document ID will be returned for a document attachment.
See Also:
getVersion()

setId

public void setId(java.lang.String theId)
           throws VWException
Sets the document ID associated with the attachment.

Parameters:
theId - The document ID or version series GUID. You cannot include the SEPARATOR character, which is reserved for internal use. In addition, special ID values may be used, whose values and their effects are as follows:

  • -1: Sets the most current released version
  • 0 or empty string: Sets the most current version

Throws:
VWException - Thrown for various causes, including when the restricted <SEPARATOR> character is found in the input String.

getVersion

public java.lang.String getVersion()
Gets the version of this attachment. A version is a unique instance of a document or stored search. Each time a document is updated, a new version is created.

Returns:
A String containing the GUID for the attachment version, null if the current version is selected, and null if the document type is not a document or stored search.

setVersion

public void setVersion(java.lang.String theVersion)
                throws VWException
Sets the GUID for the attachment version for this attachment document.

Parameters:
theVersion - The String value of the new version GUID for the attachment.
Throws:
VWException - Thrown if the method fails to set the attachment version information.

getLibraryName

public java.lang.String getLibraryName()
Gets the name of the library or object store where the attachment resides.

Returns:
A String value that contains the name of the library or object store containing the attachment.

setLibraryName

public void setLibraryName(java.lang.String theLibraryName)
                    throws VWException
Sets the name of the library or object store associated with this attachment.

Parameters:
theLibraryName - String value to set as the library or object store name. You cannot use the SEPARATOR character, which is reserved for internal use.

Library and Object store names conform to the database naming convention rules for your database. In general, this means that an object store name may be up to 64 characters long and cannot contain any of the following characters:

    \ / : * ? " < > |

See the documentation for your database for information on further restrictions that apply.

Throws:
VWException - This method throws an exception if the restricted <SEPARATOR> character is found in the String.

getAttachmentName

public java.lang.String getAttachmentName()
Gets the name associated with this attachment. If a translation source exists, the authored name of the attachment is translated.

Note: The translation is done only at runtime, so will not appear in design-time applications (such as the Process Designer or Configuration Console).

Returns:
A String containing the translated name for this attachment, if a translation source exists; otherwise the authored name is returned.

setAttachmentName

public void setAttachmentName(java.lang.String theAttachmentName)
                       throws VWException
Sets the document name for this attachment.

Parameters:
theAttachmentName - A String containing the attachment name. You cannot use the SEPARATOR character, which is reserved for internal use.
Throws:
VWException - Thrown if the restricted <SEPARATOR> character is found in the specified string.

getAttachmentDescription

public java.lang.String getAttachmentDescription()
Gets the description for this attachment. If a translation source exists, the authored description of the attachment is translated.

Note: The translation is done only at runtime, so will not appear in design-time applications (such as the Process Designer or Configuration Console).

Returns:
A String containing the translated description for this attachment, if a translated source exists; otherwise the authored description is returned.

setAttachmentDescription

public void setAttachmentDescription(java.lang.String theAttachmentDescription)
                              throws VWException
Sets the description for an attachment.

Parameters:
theAttachmentDescription - A String containing the attachment description. You cannot use the SEPARATOR character, which is reserved for internal use.
Throws:
VWException - This method throws an exception if the restricted <SEPARATOR> character is found in the String.

getType

public int getType()
Gets the attachment type value for the associated attachement.

Returns:
An integer value associated with the associated attachement's attachment type description.
See Also:
VWAttachmentType

setType

public void setType(int theAttachmentType)
             throws VWException
Sets the attachment type value for the associated attachment.

Parameters:
theAttachmentType - Integer value of the new type for the associated attachment. You cannot use the SEPARATOR character, which is reserved for internal use.
Throws:
VWException - Thrown if the restricted <SEPARATOR> character is found in the String.
See Also:
VWAttachmentType

getLibraryType

public int getLibraryType()
Gets the library type of the library or object store that contains this attachment.

Returns:
An integer value associated with the localizable library or object store type description.
See Also:
VWLibraryType, setLibraryType(int)

setLibraryType

public void setLibraryType(int theLibraryType)
                    throws VWException
Sets the library or object store type for the library or object store containing this attachment.

Parameters:
theLibraryType - An integer value for the new library or object store type of the attachment.
Throws:
VWException - Thrown if the library or object store type is invalid.
See Also:
VWLibraryType

toString

public java.lang.String toString()
Gets the String representation of a VWAttachment object associated with a document contained in library or object store The String contains seven elements; each element is delimited by the SEPARATOR. The String elements are:

  1. Attachment name
  2. Attachment description
  3. Attachment type
  4. Type of * library or object store that has the attachment
  5. Name of the * library or object store that has the attachment
  6. Attachment ID
  7. (Optional) version, if the attachment is a document or stored search

Overrides:
toString in class java.lang.Object
Returns:
A String representation of a VWAttachment object.
See Also:
VWAttachmentType, VWLibraryType

toXML

public void toXML(java.lang.StringBuffer theBuffer)
           throws VWException
Appends an XML string representing this instance to the buffer specified.

Warning: This XML string is nonextensible, and cannot be modified in any way.

Parameters:
theBuffer - A StringBuffer that will be appended with the XML content.
Throws:
VWException - Thrown if the specified buffer is null.
See Also:
VWXMLUtil

Process API

© Copyright IBM Corporation 2002, 2008. All rights reserved.