|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.beans.LibraryObjectDefinition
The LibraryObjectDefinition class is used to specify how to construct any Library Object. Generally, a user will use one of the subclasses of LibraryObjectDefinition, e.g. DocumentDefinition to construct a Document.
The main idea behind the use of Definition classes is to afford
extensibility to the way objects are created, without having
to subclass LibrarySession (on which all create methods
are invoked). In order to create a new instance of any object,
you first construct a LibraryObjectDefinition object (or one
of its subclasses), set all of the desired attributes, and then
invoke the appropriate method on LibrarySession (e.g.
createDocument
, createFolder
, etc.)
to actually create the object.
Most of the methods that exist on LibraryObjectDefinition
do not rely on knowledge of a LibrarySession; hence
they generally execute very quickly. Some of the attributes
can be set either by name or by object (e.g. setting the
ClassObject). In the case when the by-name variant
is used, the lookup is not performed until the create method
is invoked on LibrarySession, or unless the lookup is
explicitly requested, for example by calling resolveClassObject
.
resolveClassObject
requires a LibrarySession parameter, as
a connected session is needed to perform the lookup.
As stated before, this class is generally not instantiated directly, as many subclasses are currently defined to create instances of the most common iFS classes. Still, this class implements 3 categories of settings that are generally used by all subclasses of LibraryObjectDefinition:
setName
to set the
name and getName
to get it back.
"FOLDER"
by default). The caller can specify any valid subclass of the
type of instance they are creating; for example, when using
A FolderDefinition, a caller could specify a ClassObject
of "WORKFLOW_FOLDER"
.
setFOO
methods to add the setting as
an attribute name/value pair.
Constructor Summary | |
LibraryObjectDefinition(LibrarySession session)
Constructs a LibraryObjectDefinition. |
Method Summary | |
LibraryObjectDefinition |
clone(LibrarySession sess)
Clone this instance. |
AttributeValue |
getAttribute(java.lang.String name)
Return an AttributeValue object that holds the value of the requested attribute. |
AttributeValue[] |
getAttributes()
Return array of Attribute values that were set for this new instance. |
ClassObject |
getClassObject()
Return the ClassObject for the new instance. |
java.lang.Object |
getOption(java.lang.String name)
Return an option value. |
java.lang.String[] |
getOptionKeys()
Return array of option keys |
void |
removeAttribute(java.lang.String name)
Removes an attribute setting for the new instance. |
void |
removeOption(java.lang.String name)
Removes an option setting for the new instance. |
void |
setAttribute(AttributeValue value)
Set an attribute for the new instance. |
void |
setAttribute(java.lang.String name,
AttributeValue value)
Set an attribute for the new instance. |
void |
setAttributeByUpperCaseName(java.lang.String attrkey,
AttributeValue value)
Set an attribute for the new instance. |
void |
setAttributes(AttributeValue[] values)
Set a number of attributes for the new instance. |
void |
setClassObject(ClassObject libraryClass)
Set the ClassObject for the new instance. |
void |
setOption(java.lang.String name,
java.lang.Object value)
Set an option for the new instance. |
Constructor Detail |
public LibraryObjectDefinition(LibrarySession session) throws IfsException
session
- the sessionIfsException
- if the operation failsMethod Detail |
public LibraryObjectDefinition clone(LibrarySession sess) throws IfsException
sess
- the session.IfsException
- if operation fails.public void setAttribute(java.lang.String name, AttributeValue value) throws IfsException
LibraryDefinitions are also used for update, free, and other repository operations as a way to specify options to the operation.
To set an attribute to the null value (e.g., for
the purpose of updating an object), you need to pass in an
AttributeValue instance with its value set to null
(see AttributeValue.newNullAttributeValue
); note that this is not
the same as passing null for the AttributeValue parameter. The latter
removes the attribute from the internal list of specified values (i.e.
behaves as if the attribute was never set in this definition).
name
- The attribute namevalue
- The attribute value.IfsException
- if operation fails.public void setAttributeByUpperCaseName(java.lang.String attrkey, AttributeValue value) throws IfsException
name
- The attribute namevalue
- The attribute value.IfsException
- if operation fails.public void setAttribute(AttributeValue value) throws IfsException
name
- The attribute namevalue
- The attribute value.IfsException
- if operation fails.public void setAttributes(AttributeValue[] values) throws IfsException
values
- The attribute values.IfsException
- if operation fails.public AttributeValue getAttribute(java.lang.String name) throws IfsException
name
- the name of the AttributeValue to be returnedIfsException
- if operation fails.public void setOption(java.lang.String name, java.lang.Object value) throws IfsException
name
- The option namevalue
- The option value.IfsException
- if operation fails.public java.lang.Object getOption(java.lang.String name) throws IfsException
name
- the name of the optionIfsException
- if operation fails.public java.lang.String[] getOptionKeys() throws IfsException
IfsException
- if operation fails.public void setClassObject(ClassObject libraryClass) throws IfsException
libraryClass
- the desired LibraryObject ClassIfsException
- if operation fails.public ClassObject getClassObject() throws IfsException
public void removeAttribute(java.lang.String name) throws IfsException
name
- The name of the Attribute to be removed.IfsException
- if operation fails.public void removeOption(java.lang.String name) throws IfsException
name
- The name of the option to be removed.IfsException
- if operation fails.public AttributeValue[] getAttributes() throws IfsException
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |