FileNet Content Services
Java Connector v3.0

com.filenet.wcm.api
Interface ReadableMetadataObject

All Superinterfaces:
BaseObject, java.io.Serializable, ValueObject
All Known Subinterfaces:
Annotation, ChoiceList, ChoiceList, ClassDescription, ClassDescription, CustomObject, Document, Document, Domain, DynamicReferentialContainmentRelationship, Event, EventAction, FeatureAddOn, Folder, Folder, Group, Link, MarkingSet, ObjectStore, ObjectStore, PropertyDescription, PropertyDescription, PublishRequest, PublishTemplate, ReadableSecurityObject, Realm, ReferentialContainmentRelationship, SearchPropertyDescription, SecurityPolicy, StoredSearch, StyleTemplate, Subscription, User, VersionSeries, WorkflowDefinition, WorkflowSubscription, WriteableMetadataObject, WriteableSecurityObject

public interface ReadableMetadataObject
extends BaseObject

An object implementing the ReadableMetadataObject interface is an object for which metadata (including properties, but not permissions) can be examined.

See Also:
CS Java Toolkit Developer's Guide

Field Summary
 
Fields inherited from interface com.filenet.wcm.api.BaseObject
EXPORT_DEFAULT, EXPORT_ENCODED_CONTENT, EXPORT_FULL, EXPORT_OBJECT_ID, EXPORT_OBJECT_SECURITY, IMPORT_DEFAULT, IMPORT_OBJECT_ID, IMPORT_OWNER, IMPORT_PERMISSIONS, TYPE_ACTIVE_MARKING, TYPE_ANNOTATION, TYPE_ANY, TYPE_CBR_ENGINE_TYPE, TYPE_CHOICE, TYPE_CHOICELIST, TYPE_CLASS_SUBSCRIPTION, TYPE_CLASSDEFINITION, TYPE_CLASSDESCRIPTION, TYPE_COLUMN_DEFINITION, TYPE_COMPUTER, TYPE_CONTENT_CACHE_SERVICE, TYPE_CONTENT_MGR_SERVICE, TYPE_CONTENT_REFERENCE, TYPE_CONTENT_TRANSFER, TYPE_CUSTOMOBJECT, TYPE_DOCUMENT, TYPE_DOCUMENT_CLASSIFICATION_ACTION, TYPE_DOCUMENT_LIFECYCLE_ACTION, TYPE_DOCUMENT_LIFECYCLE_POLICY, TYPE_DOCUMENTSTATE, TYPE_DOMAIN, TYPE_DYNAMIC_REFERENTIAL_CONTAINMENT_RELATIONSHIP, TYPE_ENTIRENETWORK, TYPE_EVENT, TYPE_EVENT_ACTION, TYPE_FEATURE_ADD_ON, TYPE_FILESTORE, TYPE_FOLDER, TYPE_GROUP, TYPE_INSTANCE_SUBSCRIPTION, TYPE_LINK, TYPE_LOCALIZED_STRING, TYPE_MARKING_SET, TYPE_MULTIPLEVALUES, TYPE_OBJECT_STORE, TYPE_OBJECTSET, TYPE_OBJSTORE_SERVICE, TYPE_PERMISSION, TYPE_PROPERTY_DEFINITION, TYPE_PROPERTYDESCRIPTION, TYPE_PROPERTYDESCRIPTIONS, TYPE_PUBLISH_REQUEST, TYPE_PUBLISH_TEMPLATE, TYPE_READONLY_OBJECT_SET, TYPE_REALM, TYPE_REFERENTIAL_CONTAINMENT_RELATIONSHIP, TYPE_SECURITY_POLICY, TYPE_SECURITY_TEMPLATE, TYPE_STORAGE_POLICY, TYPE_STORED_SEARCH, TYPE_STYLE_TEMPLATE, TYPE_SUBSCRIPTION, TYPE_TABLE_DEFINITION, TYPE_TRANSIENT, TYPE_USER, TYPE_VERSIONSERIES, TYPE_WORKFLOW_CLASS_SUBSCRIPTION, TYPE_WORKFLOW_INSTANCE_SUBSCRIPTION, TYPE_WORKFLOWDEFINITION, TYPE_XML_PROPERTY_MAPPING_SCRIPT
 
Method Summary
 Properties getProperties()
          Returns all the properties for this ReadableMetadataObject object.
 Properties getProperties(java.lang.String[] propNames)
          Returns the requested properties for this ReadableMetadataObject object.
 java.lang.String getPropertiesXML(java.lang.String[] propNames)
          Returns a string in XML that represents the requested properties for this ReadableMetadataObject object.
 byte[] getPropertyBinaryValue(java.lang.String name)
          Returns the value--cast or converted to a byte array--of the named property for this ReadableMetadataObject.
 boolean getPropertyBooleanValue(java.lang.String name)
          Returns the value--cast or converted to a boolean--of the named property for this ReadableMetadataObject.
 java.util.Date getPropertyDateValue(java.lang.String name)
          Returns the value--cast or converted to a Date--of the named property for this ReadableMetadataObject.
 double getPropertyDoubleValue(java.lang.String name)
          Returns the value--cast or converted to a double--of the named property for this ReadableMetadataObject.
 int getPropertyIntValue(java.lang.String name)
          Returns the value--cast or converted to an int--of the named property for this ReadableMetadataObject.
 java.lang.String getPropertyStringValue(java.lang.String name)
          Returns the value--cast or converted to a String--of the named property for this ReadableMetadataObject.
 java.lang.Object getPropertyValue(java.lang.String name)
          Returns the value of the named property as an Object for this ReadableMetadataObject.
 Values getPropertyValuesValue(java.lang.String name)
          Returns the value--cast or converted to a Values collection--of the named property for this ReadableMetadataObject.
 void refresh()
          Deletes data stored in cache.
 void refresh(java.lang.String[] staleProperties)
          Behaves like refresh(), except that only the specifically-named properties are removed from the locally-cached data.
 
Methods inherited from interface com.filenet.wcm.api.BaseObject
equals, exportObject, getClassId, getId, getName, getObjectStoreId, getObjectType, getSession, hashCode, thisBaseObject
 

Method Detail

getProperties

public Properties getProperties()
                         throws PropertyNotFoundException
Returns all the properties for this ReadableMetadataObject object. Note that if the object implementing this ReadableMetadataObject object is a ChoiceList object, the ChoiceList object must be a top-level choice list (and not a contained choice list).

The object implementing the ReadableMetadataObject interface caches the results from a call to the getProperties method. If properties from a previous call were cached, this method attempts to eliminate network roundtrips to the server on subsequent calls by retrieving the cached values for the properties.

To retrieve a specific set of properties, use the getProperties(propNames) form of this method.

Returns:
A Properties collection that contains all the properties for this ReadableMetadataObject object.

Throws:
PropertyNotFoundException - Thrown when this method is unable to retrieve properties for this ReadableMetadataObject object from the Content Services server.


getProperties

public Properties getProperties(java.lang.String[] propNames)
                         throws PropertyNotFoundException
Returns the requested properties for this ReadableMetadataObject object. If the propNames parameter is null or an empty array, this method returns all properties for this ReadableMetadataObject object. The Property elements in the collection are returned in the same order as their corresponding elements in the specified propNames array. Note that if the object implementing this ReadableMetadataObject object is a ChoiceList object, the ChoiceList object must be a top-level choice list (and not a contained choice list).

The object implementing the ReadableMetadataObject interface caches the results from a call to the getProperties method. If properties from a previous call were cached, this method attempts to eliminate network roundtrips to the server on subsequent calls by retrieving the cached values for the requested properties.

To retrieve all properties for the object, use getProperties().

Parameters:
propNames - A String array whose elements specify the symbolic names of the properties to retrieve. If null or an empty array, retrieves all properties. However, if you pass in a null, you must first explicitly cast it to a String[] to avoid a compilation error.

Returns:
A Properties collection that contains the requested properties for this ReadableMetadataObject object.

Throws:
PropertyNotFoundException - Thrown when this method is unable to retrieve the specified properties from the Content Services server.


getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)
                                  throws PropertyNotFoundException
Returns the value of the named property as an Object for this ReadableMetadataObject. If the property is a multi-valued property, the returned object is a Values collection, which will contain one or more Value objects.

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
An Object that is the value for the property specified in the name parameter. Returns null when the property value has not been set in the Content Services server.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyBooleanValue

public boolean getPropertyBooleanValue(java.lang.String name)
                                throws PropertyNotFoundException
Returns the value--cast or converted to a boolean--of the named property for this ReadableMetadataObject. If the value is null, which means the property was not populated in the Content Services, this method returns false. (See Property.hasNullValue for more information on null property values.)

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A boolean that is the value for the property specified in the name parameter. Returns false in the case of a null value.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyBinaryValue

public byte[] getPropertyBinaryValue(java.lang.String name)
                              throws PropertyNotFoundException
Returns the value--cast or converted to a byte array--of the named property for this ReadableMetadataObject.

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A byte array of binary values for the property specified in the name parameter.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyDateValue

public java.util.Date getPropertyDateValue(java.lang.String name)
                                    throws PropertyNotFoundException
Returns the value--cast or converted to a Date--of the named property for this ReadableMetadataObject.

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A Date that is the value for the property specified in the name parameter. Returns null when the property value has not been set in the Content Services server.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyDoubleValue

public double getPropertyDoubleValue(java.lang.String name)
                              throws PropertyNotFoundException
Returns the value--cast or converted to a double--of the named property for this ReadableMetadataObject. If the value is null, which means the property was not populated in the Content Services server, this method returns Double.NaN. (See Property.hasNullValue for more information on null property values.)

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A double that is the value for the property specified in the name parameter. Returns Double.NaN in the case of a null value.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyIntValue

public int getPropertyIntValue(java.lang.String name)
                        throws PropertyNotFoundException
Returns the value--cast or converted to an int--of the named property for this ReadableMetadataObject. If the value is null, which means the property was not populated in the Content Services server, this method returns Integer.MIN_VALUE. (See Property.hasNullValue for more information on null property values.)

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
An int that is the value for the property specified in the name parameter. Returns Integer.MIN_VALUE in the case of a null value.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyStringValue

public java.lang.String getPropertyStringValue(java.lang.String name)
                                        throws PropertyNotFoundException
Returns the value--cast or converted to a String--of the named property for this ReadableMetadataObject. The returned value is null if the property's value was not set in the Content Services server. (See Property.hasNullValue for more information on null property values.)

Parameters:
name - A String that is the symbolic name of the property for which the value is to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A String that is the value for the property specified in the name parameter. Returns null when the property value has not been set in the Content Services server.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

getPropertyValuesValue

public Values getPropertyValuesValue(java.lang.String name)
                              throws PropertyNotFoundException
Returns the value--cast or converted to a Values collection--of the named property for this ReadableMetadataObject.

Parameters:
name - A String that is the symbolic name of the property for which the values are to be retrieved. (The Property interface has constants for well-known properties.)

Returns:
A Values collection that is the value for the property specified in the name parameter.

Throws:
PropertyNotFoundException - Thrown when the named property does not exist for this ReadableMetadataObject object.

refresh

public void refresh()
Deletes data stored in cache. A request made after the stored data is deleted causes a call to the Content Services server to retrieve fresh data.

If your application is performing versioning-related activities on a Document object and then retrieving properties from a VersionSeries object (or vice versa), you should call refresh before attempting to retrieve the properties (or before calling a convenience method, such as getCurrentVersion, that retrieves a property). Because a VersionSeries object and any Document objects obtained from it are separate, unrelated Java objects, state changes that occur because of a versioning-related operation on one object will not be reflected in the other object's cached properties.

After a call to refresh, references to property collections and other objects currently held by objects external to the CS Java Connector remain valid. However, those references have been released by the API. For example, assume that your application has a copy of the Document property, idmDocCurVerNum, and is performing some checkout/checkin activity. A call to refresh deletes the data stored in the cache, which forces the retrieval of fresh data (including the idmDocCurVerNum property with its current value) by a subsequently-called method that requests data. However, the copy of the property held by your application is now stale. As a result, your application may experience semantic errors because the application is now working with stale data.


refresh

public void refresh(java.lang.String[] staleProperties)
Behaves like refresh(), except that only the specifically-named properties are removed from the locally-cached data.

Parameters:
staleProperties - A String array of property symbolic names.

getPropertiesXML

public java.lang.String getPropertiesXML(java.lang.String[] propNames)
Returns a string in XML that represents the requested properties for this ReadableMetadataObject object. If the propNames parameter is null or an empty array, this method returns all properties for this ReadableMetadataObject object. If the array includes properties that do not exist for this ReadableMetadataObject object, those properties are ignored (no exception is thrown).

This method's results are never cached (unlike the non-XML forms of the getProperties method). Also, this method always makes a roundtrip to the Content Services server and never uses cached properties.

Parameters:
propNames - A String array whose elements specify the symbolic names of the properties to retrieve. If null or an empty array, retrieves all properties. However, if you pass in a null, you must first explicitly cast it to a String[] to avoid a compilation error.

Returns:
A String containing an XML representation of the requested properties for this ReadableMetadataObject object.


FileNet Content Services
Java Connector v3.0