|
Collaboration API Documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.filenet.bso.api.util.BsoBaseUtil
The BsoBaseUtil
class provides a collection of static helper methods
for the Content Java API.
Field Summary | |
static java.lang.String |
UTF8_ENCODING
Value for UTF-8 encoding |
Method Summary | |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Boolean propertyValue)
Generates a boolean-valued Property object and adds it
to the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
byte[] propertyValue)
Generates a byte array valued Property object and adds
it to the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.util.Date propertyValue)
Generates a date-valued Property object and adds it to
the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Double propertyValue)
Generates a Double valued Property object and adds it to
the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Integer propertyValue)
Generates an integer-valued Property object and adds
it to the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Object propertyValue)
Generates an object-valued Property object and adds it
to the specified Properties collection. |
static void |
addProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.String propertyValue)
Generates a string-valued Property object and adds it
to the specified Properties collection. |
static com.filenet.wcm.api.Property |
buildProperty(java.lang.String name,
java.lang.String strType,
java.lang.String strValue)
Constructs a Property object. |
static java.lang.String |
convertBinaryToString(byte[] binary,
java.lang.String encoding)
Convert a binary property value which was originally a string back into a string. |
static java.lang.Object |
convertStringValue(int dataType,
java.lang.String strValue)
Converts a given value from a string to an object. |
static int[] |
documentType()
Returns an int array object that specifies BaseObject.TYPE_DOCUMENT . |
static com.filenet.wcm.api.Property |
findProperty(com.filenet.wcm.api.Properties props,
java.lang.String propName)
Finds a Property object with the given property name if present
in a Properties collection. |
static int[] |
folderType()
Returns an int array object that specifies BaseObject.TYPE_FOLDER . |
static java.lang.String |
formatPropertyValue(int datatype,
java.lang.Object val)
Converts the given Property value to a string representation. |
static java.lang.String |
formatPropertyValueForXML(int datatype,
java.lang.Object obj)
Converts the given Property value to a string representation
and encodes the string for XML. |
static byte[] |
getBytes(java.io.InputStream is)
Reads the given InputStream object and returns its
equivalent byte array. |
static com.filenet.wcm.api.ClassDescription |
getClassDescription(com.filenet.wcm.api.ObjectStore store,
int[] objectTypes,
java.lang.String classDisplayName)
Given the class description's display name, returns the matching ClassDescription object from an object store. |
static com.filenet.wcm.api.ClassDescription |
getClassDescription(java.lang.String classDisplayName,
java.util.Iterator classDescriptions)
Given a class name, returns the matching ClassDescription object
from a collection. |
static com.filenet.wcm.api.Folder |
getFolder(com.filenet.wcm.api.ObjectStore store,
java.lang.String folderID)
Generates a Folder object from the given GUID. |
static com.filenet.wcm.api.ObjectStore |
getObjectStore(java.lang.String objectStoreID,
com.filenet.wcm.api.Session session)
Generates an ObjectStore object from the given GUID. |
static com.filenet.wcm.api.Folder |
getParentFolder(com.filenet.wcm.api.ObjectStore store,
java.lang.String folderID)
Generates a Folder object from the given GUID. |
static com.filenet.wcm.api.Property |
getProperty(com.filenet.wcm.api.ReadableMetadataObject object,
java.lang.String propertyName,
boolean refresh)
Retrieves a property, specified by name, from a BaseObject object. |
static java.lang.Object |
getPropertyDefaultValue(com.filenet.wcm.api.PropertyDescription propDesc)
Returns the default value associated with the property specified by the PropertyDescription object,
may return null. |
static java.io.InputStream |
getStream(java.lang.String str,
java.lang.String encoding)
Convert a string into an InputStream using a given encoding. |
static java.lang.String |
getString(java.io.InputStream is)
Reads the given InputStream object and returns a
String object. |
static java.lang.String |
getString(java.io.InputStream is,
java.lang.String encoding)
Reads the given InputStream object and returns an encoded
String object. |
static void |
lockedIncrementCounterProperty(com.filenet.wcm.api.BaseObject object,
java.lang.String counterPropertyName,
int value)
Perform locked increment of integer property. |
static java.lang.String |
lockObject(com.filenet.wcm.api.LockableObject object)
Lock a Content Engine object. |
static void |
removeProperty(com.filenet.wcm.api.Properties props,
java.lang.String propName)
Removes the Property object with the given property name from
the Properties collection, if present. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Boolean propertyValue)
If the Property object exists in the Properties
collection, sets a boolean value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
byte[] propertyValue)
If the Property object exists in the Properties
collection, sets a byte array value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.util.Date propertyValue)
If the Property object exists in the Properties
collection, sets a date value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Double propertyValue)
If the Property object exists in the Properties
collection, sets a double value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.Integer propertyValue)
If the Property object exists in the Properties
collection, sets an integer value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
java.lang.String propertyValue)
If the Property object exists in the Properties
collection, sets a string value on it. |
static void |
setProperty(com.filenet.wcm.api.Properties properties,
java.lang.String propertyName,
com.filenet.wcm.api.ValueObject propertyValue)
If the Property object exists in the Properties
collection, sets an object value on it. |
static void |
setProperty(com.filenet.wcm.api.WriteableMetadataObject object,
java.lang.String propertyName,
boolean propertyValue)
Persists the boolean-valued property, specified by name and value, to a BaseObject object. |
static void |
setProperty(com.filenet.wcm.api.WriteableMetadataObject object,
java.lang.String propertyName,
java.util.Date propertyValue)
Persists the Date-valued property, specified by name and value, to a BaseObject object. |
static void |
setProperty(com.filenet.wcm.api.WriteableMetadataObject object,
java.lang.String propertyName,
int propertyValue)
Persists the int-valued property, specified by name and value, to a BaseObject object. |
static void |
setProperty(com.filenet.wcm.api.WriteableMetadataObject object,
java.lang.String propertyName,
java.lang.String propertyValue)
Persists the string-valued property, specified by name and value, to a BaseObject object. |
static void |
setPropertyValue(com.filenet.wcm.api.Property prop,
java.lang.Object val)
Sets a Property object's value, first casting the Java object
to the correct type. |
static void |
setValueObjectValue(com.filenet.wcm.api.Value valObj,
java.lang.Object val)
Sets a Value object's value, first casting the Java object
to the correct type. |
static void |
unlockObject(com.filenet.wcm.api.LockableObject object,
java.lang.String lockToken)
Unlock a Content Engine object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String UTF8_ENCODING
Method Detail |
public static com.filenet.wcm.api.ObjectStore getObjectStore(java.lang.String objectStoreID, com.filenet.wcm.api.Session session)
ObjectStore
object from the given GUID.
objectStoreID
- A String
representing the ID (in GUID format)
of the object store on the Content Engine server.session
- The Session
object that supplies
logon credentials to the Content Engine server.
ObjectStore
object.public static com.filenet.wcm.api.Folder getFolder(com.filenet.wcm.api.ObjectStore store, java.lang.String folderID)
Folder
object from the given GUID.
store
- The ObjectStore
object.folderID
- A String
containing the ID (in GUID format) of
the Folder
object.
Folder
object.public static com.filenet.wcm.api.Folder getParentFolder(com.filenet.wcm.api.ObjectStore store, java.lang.String folderID)
Folder
object from the given GUID. If you
supply null
for the folderID
parameter, this method returns
the root folder.
store
- The ObjectStore
object.folderID
- A String
containing the ID (in GUID format) of
the Folder
object. If null
,
returns the root folder.
Folder
object.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.String propertyValue)
Property
object and adds it
to the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.util.Date propertyValue)
Property
object and adds it to
the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, byte[] propertyValue)
Property
object and adds
it to the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Boolean propertyValue)
Property
object and adds it
to the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Integer propertyValue)
Property
object and adds
it to the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Double propertyValue)
Double
valued Property
object and adds it to
the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void addProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Object propertyValue)
Property
object and adds it
to the specified Properties
collection.
properties
- A collection of Property
objects.
propertyName
- The name of the new property.
propertyValue
- The value of the new property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.String propertyValue)
Property
object exists in the Properties
collection, sets a string value on it. Otherwise acts like
addProperty(Properties, String, String)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Boolean propertyValue)
Property
object exists in the Properties
collection, sets a boolean value on it. Otherwise acts like
addProperty(Properties, String, Boolean)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, byte[] propertyValue)
Property
object exists in the Properties
collection, sets a byte array value on it. Otherwise acts like
addProperty(Properties, String, byte[])
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Double propertyValue)
Property
object exists in the Properties
collection, sets a double value on it. Otherwise acts like
addProperty(Properties, String, Double)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.lang.Integer propertyValue)
Property
object exists in the Properties
collection, sets an integer value on it. Otherwise acts like
addProperty(Properties, String, Integer)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, java.util.Date propertyValue)
Property
object exists in the Properties
collection, sets a date value on it. Otherwise acts like
addProperty(Properties, String, Date)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static void setProperty(com.filenet.wcm.api.Properties properties, java.lang.String propertyName, com.filenet.wcm.api.ValueObject propertyValue)
Property
object exists in the Properties
collection, sets an object value on it. Otherwise acts like
addProperty(Properties, String, Object)
properties
- A collection of Property
objects.
propertyName
- The name of the property.
propertyValue
- The value of the property.public static com.filenet.wcm.api.ClassDescription getClassDescription(java.lang.String classDisplayName, java.util.Iterator classDescriptions)
ClassDescription
object
from a collection.
classDisplayName
- The name of the ClassDescription
object to return.classDescriptions
- A collection of ClassDescription
objects.
ClassDescription
object.public static com.filenet.wcm.api.ClassDescription getClassDescription(com.filenet.wcm.api.ObjectStore store, int[] objectTypes, java.lang.String classDisplayName)
ClassDescription
object from an object store.
In the objectTypes
parameter, specify the object types
to retrieve as Content Java API BaseObject
objects. If the objectTypes
parameter is not null
,
this method limits the search of the ClassDescriptions
collection
to the specified object types; otherwise, all class descriptions
are searched for a matching name.
store
- An ObjectStore
object.
objectTypes
- An int
array of BaseObject
objects.
classDisplayName
- A String
containing the name
of the ClassDescription
object to return.
ClassDescription
object.public static int[] folderType()
int
array object that specifies BaseObject.TYPE_FOLDER
.
int
array object.public static int[] documentType()
int
array object that specifies BaseObject.TYPE_DOCUMENT
.
int
array object.public static java.lang.String getString(java.io.InputStream is)
InputStream
object and returns a
String
object.
is
- An InputStream
object.
String
object.public static java.lang.String getString(java.io.InputStream is, java.lang.String encoding)
InputStream
object and returns an encoded
String
object.
is
- An InputStream
object.encoding
- An String
that specifies the encoding to apply to the output, such as "UTF-8"..
String
object.public static byte[] getBytes(java.io.InputStream is)
InputStream
object and returns its
equivalent byte array.
is
- An InputStream
object.
public static java.io.InputStream getStream(java.lang.String str, java.lang.String encoding)
InputStream
using a given encoding.str
- the stringencoding
- the encoding to use. If this is null
then UTF-8 encoding
is used.InputStream
public static com.filenet.wcm.api.Property buildProperty(java.lang.String name, java.lang.String strType, java.lang.String strValue)
Property
object.
Based on a given property type, converts the string-valued parameter to the requested property type. Types supported are:
TYPE_BINARY TYPE_BOOLEAN TYPE_DATE TYPE_DOUBLE TYPE_INTEGER TYPE_STRING TYPE_GUID
name
- The name of the property.
strType
- A String
representation of the property
type's int
value, for example, Property.TYPE_BINARY
.
strValue
- A String
representation of the property
value; may be null
. If null
, the
method builds a property whose value is not set.
Property
object.public static java.lang.Object convertStringValue(int dataType, java.lang.String strValue)
Property.TYPE_INTEGER
, this method returns an
integer value of 5.
dataType
- The data type of the input string. You can specify data type by using
constants defined in the Content Java API Property
interface,
for example, Property.TYPE_BINARY
.strValue
- The String
to be converted.
Object
that represents the converted string.public static void setValueObjectValue(com.filenet.wcm.api.Value valObj, java.lang.Object val)
Value
object's value, first casting the Java object
to the correct type. Types supported are:
Integer
String
Double
Values
Date
Boolean
BaseObject
valObj
- The Value
object.val
- A Java Object
representing the new value to be
assigned to this Value
object.
BsoRuntimeException
- Thrown when an unsupported object type is specified as input to this method.public static void setPropertyValue(com.filenet.wcm.api.Property prop, java.lang.Object val)
Property
object's value, first casting the Java object
to the correct type. Supported types are:
Integer
String
Double
Values
Date
Boolean
BaseObject
prop
- The Property
object whose value is to be set.val
- A Java Object
representing the new value to be
assigned to this Property
object.
BsoRuntimeException
- Thrown when an unsupported object type is specified as input to this method.public static com.filenet.wcm.api.Property getProperty(com.filenet.wcm.api.ReadableMetadataObject object, java.lang.String propertyName, boolean refresh)
BaseObject
object. If the refresh
parameter is true,
any underlying property cache will be bypassed and the value will be retrieved from the Content
Engine, resulting in a round-trip.
object
- A BaseObject
object that supports readable metadata.
propertyName
- The name of the Property
to be retrieved.
refresh
- If true, refresh cached properties from Content Engine.
Property
object, or null
if the property does not exist.public static java.lang.String formatPropertyValueForXML(int datatype, java.lang.Object obj)
Property
value to a string representation
and encodes the string for XML. (To simply convert the value to a string
representation without encoding for XML, refer to the formatPropertyValue
method.) The supported data types are:
Boolean Date Double Integer GUID String
datatype
- An integer that represents the type of data.
obj
- A Java Object
that represents the property value.
String
representation of the property value.public static java.lang.String formatPropertyValue(int datatype, java.lang.Object val)
Property
value to a string representation.
(To convert the value to a string
representation and encode for XML, refer to the formatPropertyValueForXML
method.) The supported data types are:
Boolean Date Double Integer GUID String
datatype
- An integer that represents the type of data.
val
- A Java Object
that represents the property value.
public static void setProperty(com.filenet.wcm.api.WriteableMetadataObject object, java.lang.String propertyName, java.lang.String propertyValue)
BaseObject
object.
object
- An object that supports writeable metadata.
propertyName
- A String
specifying the property name.
propertyValue
- A String
specifying the property value.public static void setProperty(com.filenet.wcm.api.WriteableMetadataObject object, java.lang.String propertyName, boolean propertyValue)
BaseObject
object.
object
- An object that supports writeable metadata.
propertyName
- A String
specifying the property name.
propertyValue
- A boolean
specifying the property value.public static void setProperty(com.filenet.wcm.api.WriteableMetadataObject object, java.lang.String propertyName, int propertyValue)
BaseObject
object.
object
- An object that supports writeable metadata.
propertyName
- A String
specifying the property name.
propertyValue
- An int
specifying the property value.public static void setProperty(com.filenet.wcm.api.WriteableMetadataObject object, java.lang.String propertyName, java.util.Date propertyValue)
BaseObject
object.
object
- An object that supports writeable metadata.
propertyName
- A String
specifying the property name.
propertyValue
- An int
specifying the property value.public static java.lang.Object getPropertyDefaultValue(com.filenet.wcm.api.PropertyDescription propDesc) throws java.lang.Exception
PropertyDescription
object,
may return null.
propDesc
- The PropertyDescription
object for the requested property.
Object
that represents the default value of the property.
java.lang.Exception
- Thrown if an error occurs retrieving the default value.public static com.filenet.wcm.api.Property findProperty(com.filenet.wcm.api.Properties props, java.lang.String propName)
Property
object with the given property name if present
in a Properties
collection.Property
object or null if not present.public static void removeProperty(com.filenet.wcm.api.Properties props, java.lang.String propName)
Property
object with the given property name from
the Properties
collection, if present.public static void lockedIncrementCounterProperty(com.filenet.wcm.api.BaseObject object, java.lang.String counterPropertyName, int value)
object
- Content Engine BaseObject which holds proeprty to increment.
counterPropertyName
- Name of integer property to increment.
value
- Postive or negative value to increment counter.public static java.lang.String lockObject(com.filenet.wcm.api.LockableObject object)
object
- Content Engine BaseObject to lock.
String
value which contains the lock token.public static void unlockObject(com.filenet.wcm.api.LockableObject object, java.lang.String lockToken)
object
- Content Engine BaseObject to unlock.
lockToken
- The lock token string returned from the lockObject() method call.public static java.lang.String convertBinaryToString(byte[] binary, java.lang.String encoding)
binary
- Binary value.
encoding
- Specifies character encoding used for conversion, if null, default "UTF-8" is used.
|
Collaboration API Documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |