Package ch.ivyteam.ivy.cm
Interface IContentObjectValue
-
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable,ch.ivyteam.ivy.cm.IContentManagementEntity
public interface IContentObjectValue extends ch.ivyteam.ivy.cm.IContentManagementEntityInterface 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 Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddelete(String user)Deletes this content object valuevoidexportContentToFile(File file, String encoding)Exports the content to a file using the provided character encoding.DategetChanged()Gets timestamp for the last change.StringgetChangedBy()Gets the user that has changed this content last time.InputStreamgetContentAsBinaryStream()Gets the content as binary stream.byte[]getContentAsByteArray()Allows to get binary content directly as an array of bytes.ReadergetContentAsCharacterStream()Gets the content as character stream.StringgetContentAsString()Gets the content as string (works for string and text type).IContentObjectgetContentObject()Gets the associated ContentObject (= parent)IContentObjectTypegetContentObjectType()Gets the associated ContentObjectTypeStringgetDescription()Gets the descriptionLocalegetLanguage()Gets the languageStringgetPropertyString()Gets the property stringDategetValidFrom()Deprecated.the valid to/from of cov will be removed without replacement; do not use any moreDategetValidTo()Deprecated.the valid to/from of cov will be removed without replacement; do not use any morevoidimportContentFromFile(File file, String encoding, String user)Import the content from a file.booleanisDefault()Return true if this is the default valuebooleanisValid()Returns true if the entry is valid.voidsetContent(InputStream content, int contentLength, String user)Sets the content from a binary stream.voidsetContent(Reader content, int contentLength, String user)Sets the content from a character stream.voidsetContent(String content, String user)Sets the content from a stringvoidsetDefault(boolean isDefault, String user)Sets if this value is the default or notvoidsetDescription(String description, String user)Sets the description.voidsetLanguage(Locale language, String user)Sets the languagevoidsetPropertyString(String propertyString, String user)Sets the property stringvoidsetValidFrom(Date validFrom, String user)Deprecated.the valid to/from of cov will be removed without replacement; do not use any morevoidsetValidTo(Date validTo, String user)Deprecated.the valid to/from of cov will be removed without replacement; do not use any more
-
-
-
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- Descriptionuser- of the user who changes the description (optional, will be used bygetChangedBy()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 languageuser- Name of the user who changes the language (optional, will be used bygetChangedBy()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 moreGets 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 moreSets 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 bygetChangedBy()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 moreGets 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 moreSets the valid to timestamp- Parameters:
validTo- New valid to timestamp, null means foreveruser- Name of the user who changes the valid to (optional, will be used bygetChangedBy()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, likesetValidTo(..)).- 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 flaguser- Name of the user which changes the default (optional, will be used bygetChangedBy()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 ornullwas 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 benulluser- name of the user which changes the property string (optional, will be used bygetChangedBy()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, thennullwill be returned.- Returns:
- content as string or
nullif no content exists - Throws:
PersistencyException- if DB access failsUnsupportedOperationException- 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, thennullwill 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
nullif 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, thennullwill be returned.- Returns:
- content as character stream or
nullif no content exists - Throws:
PersistencyException- if DB access failsUnsupportedOperationException- 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, thennullwill 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
nullif 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 benulluser- Name of the user who sets the content (optional, will be used bygetChangedBy()method )- Throws:
PersistencyException- if DB access failsUnsupportedOperationException- 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 benullcontentLength- length of the content to read and write (in bytes), 0 -> to enduser- Name of the user who sets the content (optional, will be used bygetChangedBy()method )- Throws:
PersistencyException- if DB access failsUnsupportedOperationException- 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 benullcontentLength- length of the content to read and write (in chars), 0 -> to enduser- Name of the user who sets the content (optional, will be used bygetChangedBy()method )- Throws:
PersistencyException- if DB access failsUnsupportedOperationException- 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 importencoding- 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 bygetChangedBy()method )- Throws:
IOException- if file could not be readPersistencyException- if DB access failsUnsupportedEncodingException- if provided encoding is not supportedUnsupportedOperationException- 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
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 toencoding- 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 readPersistencyException- if DB access failsUnsupportedEncodingException- 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 bygetChangedBy()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.
-
-