Interface IContentObjectValue

  • All Superinterfaces:
    org.eclipse.core.runtime.IAdaptable, ch.ivyteam.ivy.cm.IContentManagementEntity

    public interface IContentObjectValue
    extends ch.ivyteam.ivy.cm.IContentManagementEntity
    Interface to access information about content object value
    Version:
    10.5.2006, kvg: revised and simplified for 4.0
    API:
    This is a public API.
    • Method Detail

      • getDescription

        String getDescription()
        Gets the description
        Returns:
        description (may be empty, but never null)
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setDescription

        void setDescription​(String description,
                            String user)
        Sets the description. If null is given, then empty string will be set
        Parameters:
        description - Description
        user - of the user who changes the description (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getLanguage

        Locale getLanguage()
        Gets the language
        Returns:
        language
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setLanguage

        void setLanguage​(Locale language,
                         String user)
        Sets the language
        Parameters:
        language - new language
        user - Name of the user who changes the language (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getValidFrom

        @Deprecated
        Date getValidFrom()
        Deprecated.
        the valid to/from of cov will be removed without replacement; do not use any more
        Gets the valid from timestamp. Never null.
        Returns:
        valid from timestamp (never null)
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setValidFrom

        @Deprecated
        void setValidFrom​(Date validFrom,
                          String user)
        Deprecated.
        the valid to/from of cov will be removed without replacement; do not use any more
        Sets the valid from timestamp. If validFrom is null the current date will be used.
        Parameters:
        validFrom - New valid from timestamp. If null is given the current date will be used.
        user - Name of the user who changes the valid from (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getValidTo

        @Deprecated
        Date getValidTo()
        Deprecated.
        the valid to/from of cov will be removed without replacement; do not use any more
        Gets the valid to timestamp, null means foreever
        Returns:
        valid to timestamp
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setValidTo

        @Deprecated
        void setValidTo​(Date validTo,
                        String user)
        Deprecated.
        the valid to/from of cov will be removed without replacement; do not use any more
        Sets the valid to timestamp
        Parameters:
        validTo - New valid to timestamp, null means forever
        user - Name of the user who changes the valid to (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getChanged

        Date getChanged()
        Gets timestamp for the last change. Changes include e.g. touch, setting validity, changing language, or value.
        Returns:
        changed timestamp
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getChangedBy

        String getChangedBy()
        Gets the user that has changed this content last time. It can be null if not set at the recent change operation (see change operations, like setValidTo(..)).
        Returns:
        user changed by
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentObject

        IContentObject getContentObject()
        Gets the associated ContentObject (= parent)
        Returns:
        associated content object
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentObjectType

        IContentObjectType getContentObjectType()
        Gets the associated ContentObjectType
        Returns:
        associated content object type
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • isDefault

        boolean isDefault()
        Return true if this is the default value
        Returns:
        true if this is the default value, otherwise false
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setDefault

        void setDefault​(boolean isDefault,
                        String user)
        Sets if this value is the default or not
        Parameters:
        isDefault - Default flag
        user - Name of the user which changes the default (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getPropertyString

        String getPropertyString()
        Gets the property string
        Returns:
        property string, never null, if not set or null was set, empty string is returned.
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • setPropertyString

        void setPropertyString​(String propertyString,
                               String user)
        Sets the property string
        Parameters:
        propertyString - Property string, can be null
        user - name of the user which changes the property string (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • getContentAsString

        String getContentAsString()
        Gets the content as string (works for string and text type). If no content exists or if content was set to empty string, then null will be returned.
        Returns:
        content as string or null if no content exists
        Throws:
        PersistencyException - if DB access fails
        UnsupportedOperationException - if datatype is binary
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentAsBinaryStream

        InputStream getContentAsBinaryStream()
        Gets the content as binary stream. If no content exists, then null will be returned.

        If this content value is a string or text type, then the string/text is UTF-8 encoded in the stream.

        Returns:
        content as binary stream or null if no content exists
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentAsCharacterStream

        Reader getContentAsCharacterStream()
        Gets the content as character stream. If no content exists, then null will be returned.
        Returns:
        content as character stream or null if no content exists
        Throws:
        PersistencyException - if DB access fails
        UnsupportedOperationException - if datatype of value is not TEXT
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentAsByteArray

        byte[] getContentAsByteArray()
        Allows to get binary content directly as an array of bytes. If no content exists, then null will be returned.

        If this content value is a string or text type, then the string/text is UTF-8 encoded in the byte array.

        Returns:
        the content of this value as a byte array or null if no content exists
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • setContent

        void setContent​(String content,
                        String user)
        Sets the content from a string
        Parameters:
        content - The content to set, can be null
        user - Name of the user who sets the content (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        UnsupportedOperationException - if the datatype of this value is not STRING
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setContent

        void setContent​(InputStream content,
                        int contentLength,
                        String user)
        Sets the content from a binary stream. If contentLength is given as 0 (i.e. read all) then the stream will be closed as soon as the content is read, which means that the stream will be closed upon return. If contentLength is > 0 then the stream will still be open when the method returns.
        Parameters:
        content - The content to set, can be null
        contentLength - length of the content to read and write (in bytes), 0 -> to end
        user - Name of the user who sets the content (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        UnsupportedOperationException - if the datatype of this value is not BINARY
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • setContent

        void setContent​(Reader content,
                        int contentLength,
                        String user)
        Sets the content from a character stream. If contentLength is given as 0 (i.e. read all) then the reader will be closed as soon as the content is read, which means that the reader will be closed upon return. If contentLength is > 0 then the reader will still be open when the method returns.
        Parameters:
        content - The content to set, can be null
        contentLength - length of the content to read and write (in chars), 0 -> to end
        user - Name of the user who sets the content (optional, will be used by getChangedBy() method )
        Throws:
        PersistencyException - if DB access fails
        UnsupportedOperationException - if the datatype of this value is not TEXT
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • importContentFromFile

        void importContentFromFile​(File file,
                                   String encoding,
                                   String user)
                            throws IOException
        Import the content from a file. If this value has a non-image (i.e. non-binary) type, then the encoding of the file will be important. It should thus be provided, if non-binary data is read. If encoding is not provided, the platform's default encoding will be used.
        Parameters:
        file - the file to import
        encoding - the encoding of the file to be read (may be null, in which case the platform's default encoding will be assumed). if this value's datatype is "image", the encoding will not be considered.
        user - the name of the user who imports the content (optional, will be used by getChangedBy() method )
        Throws:
        IOException - if file could not be read
        PersistencyException - if DB access fails
        UnsupportedEncodingException - if provided encoding is not supported
        UnsupportedOperationException - if the datatype of this value is neither TEXT nor BINARY
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • exportContentToFile

        void exportContentToFile​(File file,
                                 String encoding)
                          throws IOException,
                                 PersistencyException
        Exports the content to a file using the provided character encoding. If this value is not a character-based type (i.e. of type "image"), the encoding will be ignored. If no encoding is provided, the platform's default encoding will be used by exporting. If the provided file already exists it will be overwritten.
        Parameters:
        file - the file to write to
        encoding - the encoding of the file to be written (may be null, in which case the platform's default encoding will be assumed). If this value's datatype is "image", the encoding will be ignored.
        Throws:
        IOException - if file could not be read
        PersistencyException - if DB access fails
        UnsupportedEncodingException - if provided encoding is not supported
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • delete

        void delete​(String user)
        Deletes this content object value
        Parameters:
        user - the user who deleted this object (optional, will be used by getChangedBy() method)
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • isValid

        boolean isValid()
        Returns true if the entry is valid. False, if the entry is invalid and should no longer be used. E.g. the entry was deleted and this instance should no longer be used.
        Returns:
        True if the entry is valid. False, if the entry is invalid.
        Throws:
        PersistencyException - if db access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.