filenet.vw.api

Class VWAttachment

  • java.lang.Object
    • filenet.vw.api.VWAttachment
  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable


    public final class VWAttachment
    extends java.lang.Object
    implements java.io.Externalizable
    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

      Fields 
      Modifier and Type Field and Description
      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

      Constructors 
      Constructor and Description
      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

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o) 
      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, Content Engine 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 Content Engine version series GUID for the attached document, or the special ID value indicating the released or current version.
      int hashCode() 
      static void main(java.lang.String[] args) 
      void readExternal(java.io.ObjectInput in) 
      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 VWAttachment.SEPARATOR.
      void toXML(java.lang.StringBuffer theBuffer)
      Appends an XML string representing this instance to the buffer specified.
      void writeExternal(java.io.ObjectOutput out) 
      • Methods inherited from class java.lang.Object

        getClass, 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, VWAttachment.toString()
    • Method Detail

      • getId

        public java.lang.String getId()
        Gets the object, Content Engine version series, or document ID for the attachment.
        Returns:
        The document ID or Content Engine version series GUID of the attachment. For documents that are stored in the Content Engine, the version series GUID is returned; otherwise, a document ID is returned for a document attachment.
        See Also:
        VWAttachment.getVersion(), VWAttachment.setId(java.lang.String)
      • setId

        public void setId(java.lang.String theId)
                   throws VWException
        Sets the document ID associated with the attachment.
        Parameters:
        theId - The document ID or Content Engine version series GUID. You cannot include the VWAttachment.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: Signifies the released version
        • 0 or empty string: Signifies the current (latest) 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 Content Engine version series GUID for the attached document, or the special ID value indicating the released or current version. A Content Engine 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 Content Engine version series GUID for the attachment, or, if the attachment the released or current version, one of the following special ID values:
        • -1: Signifies the released version
        • 0 or empty string: Signifies the current (latest) version
        See Also:
        VWAttachment.setId(java.lang.String)
      • 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 VWAttachment.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 VWAttachment.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 VWAttachment.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 VWAttachment.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, VWAttachment.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 VWAttachment.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
      • main

        public static void main(java.lang.String[] args)
      • readExternal

        public void readExternal(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • equals

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object

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