|
FileNet Content Services Java Connector v3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Not Implemented in CS Java Connector v3.0.
ALink
object represents a relationship between two objects; its
object-valued Head and Tail properties express the relationship. Objects that
can participate in a link relationship include the following objects (and any
subclasses): Choice,
ChoiceList, ClassDescription, CustomObject, Document, EventAction, Folder,
ObjectStore, PropertyDescription, Subscription
, and
VersionSeries
.
To create a Link
object and persist it to a Content Services object
store, call the
createObject
method on an ObjectStore
object. Note that you cannot create a
Link
object that belongs to the base Link
class;
the Link
class must be subclassed on the Content Services object
store. For example:
public void CreateLink() throws BaseException
{
// Retrieve an existing Link subclass to pass into the call to createObject
// (you cannot use the base Link class)
String strMyLinkClass = "{A18E8218-80C5-4DF4-92BF-94D30265711D}"; // hard-coded guid of Link subclass
// Retrieve two existing documents, LinkHead and LinkTail, which are the objects we're linking
Document objDocHead = (Document)objectStore.getObject(BaseObject.TYPE_DOCUMENT,"/LinkFolder/LinkHead");
Document objDocTail = (Document)objectStore.getObject(BaseObject.TYPE_DOCUMENT,"/LinkFolder/LinkTail");
// Create an empty properties collection
Properties linkProps = ObjectFactory.getProperties();
// Populate it with the required Head and Tail properties
Property linkHead = ObjectFactory.getProperty(Property.HEAD);
linkHead.setValue(objDocHead);
linkProps.add(linkHead);
Property linkTail = ObjectFactory.getProperty(Property.TAIL);
linkTail.setValue(objDocTail);
linkProps.add(linkTail);
// Create the link
Link newLink = (Link)objectStore.createObject(strMyLinkClass, linkProps, null);
}
You can instantiate a persisted Link
object in the following ways:
getObject
method on an ObjectStore
object, which returns a link stored in
the object store.
Links
collection, then returning a Link
object from the collection. See the
Links
interface for ways to instantiate a Links
collection.
Field Summary |
Method Summary | |
void |
changeClass(java.lang.String classId,
Properties props,
Permissions perms)
Not Implemented in CS Java Connector v3.0. |
void |
delete()
Not Implemented in CS Java Connector v3.0. |
int |
getAccessMask()
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getPermissionsXML()
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess()
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType)
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType,
java.lang.String userId)
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType,
java.lang.String userId,
java.lang.String domain)
Deprecated. Use (collectionType, userId) form of this method. |
Methods inherited from interface com.filenet.wcm.api.BaseObject |
equals, exportObject, getClassId, getId, getName, getObjectStoreId, getObjectType, getSession, hashCode, thisBaseObject |
Methods inherited from interface com.filenet.wcm.api.WriteableSecurityObject |
setPermissions, setPermissions |
Methods inherited from interface com.filenet.wcm.api.WriteableMetadataObject |
setProperties |
Methods inherited from interface com.filenet.wcm.api.ReadableMetadataObject |
getProperties, getProperties, getPropertiesXML, getPropertyBinaryValue, getPropertyBooleanValue, getPropertyDateValue, getPropertyDoubleValue, getPropertyIntValue, getPropertyStringValue, getPropertyValue, getPropertyValuesValue, refresh, refresh |
Methods inherited from interface com.filenet.wcm.api.ReadableSecurityObject |
getPermissions, getPermissions |
Method Detail |
public void delete()
Not Implemented in CS Java Connector v3.0.
Deletes thisLink
object if the user has appropriate
permissions and there is no constraint upon the object that makes it
unable to be deleted. After a successful call to delete
,
all properties for this Link
object are considered stale
and are removed from cache.
public Permissions getUserAccess()
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) for the current user on thisLink
object. (The current user is
identified in the Session
object.) The elements
in the returned collection are the access rights assigned to the current
user and to any groups to which this user belongs. If the user does not
have explicit rights, this method returns only the access rights of the
groups to which the user belongs.
Note that the returned Permissions
collection represents
basic object permissions (i.e., an object's Permissions property). To
specify the type of permissions (basic object or audit) to retrieve for
the current user, use
getUserAccess(collectionType)
.
To retrieve permissions for a specified user, use
getUserAccess(collectionType, userId, domain)
.
Permissions
collection containing the access rights
for the current user on this Link
object.
public Permissions getUserAccess(java.lang.String collectionType)
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) of the specified type for the current user on thisLink
object. (The current user is
identified in the Session
object.) The elements in the returned collection are the access rights
assigned to the current user and to any groups to which this user belongs.
If the user does not have explicit rights, this method returns only the
access rights of the groups to which the user belongs.
Specify the type of permissions (basic object or audit)
to return in the collectionType
parameter.
If the user is not an Administrator and does not have specific
privileges to access audit permissions, this method throws an
InsufficientPermissionException if the specified collection type is
Property.AUDIT_PERMISSIONS
. This exception occurs even if the user
has been granted full control access rights (Permission.LEVEL_FULL_CONTROL
)
to the object. To set audit permissions privileges for the user, refer to the
Enable security auditing
topic.
To retrieve permissions for a specified user, use the
getUserAccess(collectionType, userId, domain)
form of this method.
collectionType
- A String that is the name of a property whose value is a
collection of Content Services Permission objects.
Use Property.PERMISSIONS
for basic object
permissions or Property.AUDIT_PERMISSIONS
for audit permissions.
Permissions
collection of the specified type containing the
access rights for
the current user on this
Link
object.
public Permissions getUserAccess(java.lang.String collectionType, java.lang.String userId)
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) of the specified type for the specified user on thisLink
object.
The elements in the returned collection are the access rights
assigned to the specified user and to any groups to which this user belongs.
If the user does not have explicit rights, this method returns only the
access rights of the groups to which the user belongs.
Specify the type of permissions to return in the collectionType
parameter.
Currently, the only valid value for collectionType
is the
Property.PERMISSIONS
constant for
basic object permissions
(that is, an object's Permissions property).
getUserAccess()
or
getUserAccess(collectionType)
.
These two methods offer equivalent functionality.
collectionType
- A String that is the name of a property whose value is a
collection of Content Services Permission
objects.
Currently, the only valid value is Property.PERMISSIONS
(for basic object permissions). This method throws a
RemoteServerException if you specify any other value.
userId
- A String (whose value is a User object's Name property) that
identifies the user for whom permissions are to be retrieved.
Permissions
collection of the specified type
containing the access rights for the specified user on this
Link
object.
public Permissions getUserAccess(java.lang.String collectionType, java.lang.String userId, java.lang.String domain)
Not Implemented in CS Java Connector v3.0.
public java.lang.String getPermissionsXML()
Not Implemented in CS Java Connector v3.0.
Retrieves aString
in XML that represents the permissions for this
Link
object. The user must have Read permission on
the object's security (either Permission.LEVEL_VIEW
or
Permission.RIGHT_READ_ACL
) to retrieve the object's
permissions.
This method filters out Access Control Elements (ACEs) that correspond to deleted grantees (users or groups). For example, if an object's permissions list contains a user account that has been deleted from the directory server database, the object's permissions returned by this method will not include permission elements corresponding to that deleted account.
Note that the returned String
represents
basic object permissions
(that is, an object's Permissions property).
String
in XML that represents the basic object permissions
for this object. Permission elements that correspond to deleted grantees
(users or groups) are not included. For documentation
that describes the XML schema used to generate the string, refer to
Schemas
in the FileNet P8 Developer's Roadmap.
public void changeClass(java.lang.String classId, Properties props, Permissions perms)
Not Implemented in CS Java Connector v3.0.
Changes the class with which thisLink
object is
associated in the object store.
The new class and the old class must have the same object type,
BaseObject.TYPE_LINK
.
Since the
required properties for the two classes might differ, this method takes an
optional Properties
collection as one of its parameters.
The collection can be empty or the parameter can be
null
if no changes are required. This method will
throw an exception if you explicitly set the value of a contained
Property
object that cannot be set due to its Settability
property (e.g., it is Read-only). Note that this exception will be thrown
even if the new value of a property you explicitly set is the same as its
old value.
This method also takes an optional Permissions
collection
as one of its parameters.
If this parameter is null
, the Link
object's security is not modified,
even if the object's current security is derived from the default
security for its source class. Note that this Permissions
collection
represents the basic object permissions for the object (i.e., the object's
Permissions property). If you pass in an empty Permissions
collection,
all existing permissions are removed. Note that, if the permissions
are modified inappropriately, it is possible to make a change that cannot
be reversed by the same user.
classId
- A String
that represents the ID or the
symbolic name of the class to which this object is to be
changed. (The ClassDescription
interface has constants for well-known class IDs.)
props
- A Properties
collection. The elements
of the collection specify properties to change. Can be null
or an empty collection if no property changes are required.
perms
- A Permissions
collection. The elements of
the collection specify the permissions to change. Can be null
if no permission changes are necessary. Passing an empty collection
removes all existing permissions.
public int getAccessMask()
Not Implemented in CS Java Connector v3.0.
Returns an integer representing a bit mask of access rights for thisLink
object.
The returned value represents a collection of access rights
granted on this Link
object to the current user.
You can use bitwise comparisons against the access right and level constants
in the Permission
interface to determine the user's specific access rights.
If the Link
object has any markings
applied, the mask reflects any access rights denied by the marking
constraint mask. Use the returned integer to determine if the user has
the appropriate access rights to perform an operation on the object.
Note that if markings are not being used, or you need to specify a
particular user, you can perform a similar function by calling
getUserAccess().asMask()
.
However, the value returned by getAccessMask()
always
accurately reflects the access rights granted to the user, whereas asMask()
can only reflect the access rights as they apply to the Permissions
collection upon which you are acting. For example, the value returned by
asMask()
will not reflect access rights granted or denied
by assigned markings.
|
FileNet Content Services Java Connector v3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |