Collaboration API Documentation

com.filenet.bso.api.collaboration.data
Class RelationshipInfo

java.lang.Object
  |
  +--com.filenet.bso.api.collaboration.data.RelationshipInfo
All Implemented Interfaces:
java.io.Serializable

public class RelationshipInfo
extends java.lang.Object
implements java.io.Serializable

The RelationshipInfo class is a collection of data used to create a Relationship object in a teamspace. A teamspace relationship is created by generating a RelationshipInfo object from the CollaborationFactory and adding it to the teamspace using the teamspace's RelationshipManager object.

See Also:
CollaborationFactory, RelationshipManager, Relationship, Serialized Form

Constructor Summary
protected RelationshipInfo()
          Default constructor.
  RelationshipInfo(int fromType, java.lang.String fromID, int toType, java.lang.String toID, java.lang.String toVersionID)
          Construct a relationship from a teamspace object to a local object which resides in the same object store as the teamspace.
  RelationshipInfo(int fromType, java.lang.String fromID, int toType, java.lang.String extObjectStore, java.lang.String extID, java.lang.String extVersionID, java.lang.String title)
          Construct a relationship from a teamspace object to an external object.
  RelationshipInfo(int fromType, java.lang.String fromID, java.lang.String extURL, java.lang.String title)
          Construct a relationship from a teamspace object to a URL.
  RelationshipInfo(int fromType, java.lang.String fromID, filenet.vw.api.VWAttachment attachment)
          Construct a relationship from a teamspace object to an eProcess attachment.
 
Method Summary
 void fixupVerifyRelationship(com.filenet.wcm.api.ObjectStore store)
          Verify and attempt to repair the RelationshipInfo object.
 boolean getIsRelationshipProtected()
          Get the IsRelationshipProtected property.
 RelationshipInfo getOtherWay()
          Returns a RelationshipInfo object for the opposite direction of a two-way relationship if this object has isTwoWay set.
 java.lang.String getOwnerID()
          Get the owner ID setting for this relationship.
 com.filenet.wcm.api.Properties getProperties()
          Get the extra properties to be set on this relationship object.
 java.lang.String getRelationshipFromID()
          Get the RelationshipFromID property.
 int getRelationshipFromType()
          Get the RelationshipFromType property.
 java.lang.String getRelationshipToExtID()
          Get the RelationshipExternalID property.
 java.lang.String getRelationshipToExtObjectStore()
          Get the RelationshipExternalObjectStore property.
 java.lang.String getRelationshipToExtURL()
          Get the RelationshipExternalURL property.
 java.lang.String getRelationshipToExtVersionID()
          Get the RelationshipExternalVersionID property.
 java.lang.String getRelationshipToID()
          Get the RelationshipToID property.
 int getRelationshipToType()
          Get the RelationshipToType property.
 java.lang.String getRelationshipToVersionID()
          Get the RelationshipToVersionID property.
 java.lang.String getTitle()
          Get the relationship's Title property.
 boolean isEmptyAttachment()
           
 boolean isTwoWay()
          Determine whether this relationship is two-way.
 void setIsRelationshipProtected(boolean isRelationshipProtected)
          Set relationship protection.
 void setIsTwoWay(boolean isTwoWay)
          Set the two-way flag.
 void setOwnerID(java.lang.String ownerID)
          Set the owner ID for this relationship.
 void setProperties(com.filenet.wcm.api.Properties relationshipProps)
          Set extra properties for this relationship object.
 void setRelationshipFromID(java.lang.String id)
          Set the from-end's ID.
 void setRelationshipFromType(int type)
          Set the from-end's type.
 void setRelationshipToExtID(java.lang.String id)
          Set the external to-end's ID.
 void setRelationshipToExtObjectStore(java.lang.String obs)
          Set the external to-end's object store ID.
 void setRelationshipToExtURL(java.lang.String url)
          Set the external URL.
 void setRelationshipToExtVersionID(java.lang.String id)
          Set the external to-end's document version ID.
 void setRelationshipToID(java.lang.String id)
          Set the local to-end's ID.
 void setRelationshipToType(int type)
          Set the to-end's type.
 void setRelationshipToVersionID(java.lang.String id)
          Set the local to-end's document version ID.
 void setTitle(java.lang.String title)
          Set the title for the relationship object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationshipInfo

protected RelationshipInfo()
Default constructor. Normally, instances are created by the constructors with additional arguments.

RelationshipInfo

public RelationshipInfo(int fromType,
                        java.lang.String fromID,
                        int toType,
                        java.lang.String toID,
                        java.lang.String toVersionID)
Construct a relationship from a teamspace object to a local object which resides in the same object store as the teamspace.
Parameters:
fromType - The type of object on the from-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration, or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

fromID - The ID of the object on the from-end of the relationship. If this is a Document object, the ID should be that of the document's VersionSeries, rather than the document itself.

toType - The type of the object on the to-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration, or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

toID - The ID of a local object on the to-end of the relationship. The object should be in the same object store as that of the teamspace. Also, if toType is RELTYPE_LOCAL_DOCUMENT, this ID should be that of the document's version series, rather than the document itself.

toVersionID - The ID of a specific document on the to-end of the relationship or the special constant, Relationship.RELEASED_VERSION. This should only be set if this is a RELTYPE_LOCAL_DOCUMENT, and even then only if the current version is not desired. Otherwise, this parameter should be null. If this is set to RELEASED_VERSION, the latest released version is used rather than a specific document version.

RelationshipInfo

public RelationshipInfo(int fromType,
                        java.lang.String fromID,
                        int toType,
                        java.lang.String extObjectStore,
                        java.lang.String extID,
                        java.lang.String extVersionID,
                        java.lang.String title)
Construct a relationship from a teamspace object to an external object.
Parameters:
fromType - the type of the object on the from-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

fromID - the ID of the object on the from-end of the relationship. If this is a Document object, then the ID should be that of the document's VersionSeries rather than the document itself.

toType - the type of the object on the to-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

extObjectStore - the object store of the object at the to-end of the relationship. This may be either the name of the object store or its GUID.

extID - the ID of a external object on the to-end of the relationship. If this is a Document object, then the ID should be that of the VersionSeries rather than the document itself.

extVersionID - the ID of a specific document on the to-end of the relationship or the special constant, Relationship.RELEASED_VERSION. This should only be set if this is a RELTYPE_EXTERNAL_DOCUMENT, and even then only if the current version is not desired, otherwise this should be null. If this is set to RELEASED_VERSION, then the latest released version is used rather than a specific document version.

title - the name of this relationship. This may be null but should be set later with setTitle since external objects should always have a title.

RelationshipInfo

public RelationshipInfo(int fromType,
                        java.lang.String fromID,
                        java.lang.String extURL,
                        java.lang.String title)
Construct a relationship from a teamspace object to a URL.
Parameters:
fromType - the type of the object on the from-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

fromID - the ID of the object on the from-end of the relationship. If this is a Document object, then the ID should be that of the document's VersionSeries rather than the document itself.

extURL - the URL

title - the name of this relationship. This may be null in which case the title will be set to extURL's value.

RelationshipInfo

public RelationshipInfo(int fromType,
                        java.lang.String fromID,
                        filenet.vw.api.VWAttachment attachment)
Construct a relationship from a teamspace object to an eProcess attachment.
Parameters:
fromType - the type of the object on the from-end of the relationship. This should be one of the RELTYPE constants defined in Relationship, one of the collaboration types defined in Collaboration or BaseObject's TYPE_DOCUMENT, TYPE_VERSIONSERIES or TYPE_FOLDER.

fromID - the ID of the object on the from-end of the relationship. If this is a Document object, then the ID should be that of the document's VersionSeries rather than the document itself.

attachment - an eProcess attachment which defines the to-end of the relationship
Method Detail

isEmptyAttachment

public boolean isEmptyAttachment()

setTitle

public void setTitle(java.lang.String title)
Set the title for the relationship object.
Parameters:
title - The new value of the relationship's title.

getTitle

public java.lang.String getTitle()
Get the relationship's Title property. May be null.
Returns:
The value of the Title property.

setRelationshipFromType

public void setRelationshipFromType(int type)
Set the from-end's type. The constructor should normally be used to set this, but this method can be used to update an existing RelationshipInfo object.
Parameters:
type - The new value for the from-end's type.

getRelationshipFromType

public int getRelationshipFromType()
Get the RelationshipFromType property. This is a required property of a Relationship object which specifies the type of object the from-end of the relationship is referencing. This type should only be types RELTYPE_LOCAL_DOCUMENT, RELTYPE_LOCAL_FOLDER or RELTYPE_LOCAL_CUSTOMOBJECT.
Returns:
The value of the RelationshipFromType property.

setRelationshipFromID

public void setRelationshipFromID(java.lang.String id)
Set the from-end's ID. The constructor should normally be used to set this, but this method can be used to "patch" an existing RelationshipInfo object.
Parameters:
id - The new value for the from-end's ID.

getRelationshipFromID

public java.lang.String getRelationshipFromID()
Get the RelationshipFromID property. This is a required property of a Relationship object which specifies the ID of the from-end of a relationship. If this object is a Document, then the Document's VersionSeries ID will be returned.
Returns:
The value of the RelationshipFromID property.

setRelationshipToType

public void setRelationshipToType(int type)
Set the to-end's type. The constructor should normally be used to set this, but this method can be used to update an existing RelationshipInfo object.
Parameters:
type - The new value for the to-end's type.

getRelationshipToType

public int getRelationshipToType()
Get the RelationshipToType property. This is a required property of a relationship which specifies what the to-end of the relationship is referencing.
Returns:
The value of the RelationshipToType property.

setRelationshipToID

public void setRelationshipToID(java.lang.String id)
Set the local to-end's ID. The constructor should normally be used to set this, but this method can be used to update an existing RelationshipInfo object.
Parameters:
id - The new value for the local to-end's ID.

getRelationshipToID

public java.lang.String getRelationshipToID()
Get the RelationshipToID property. This is set to the ID of a local, same object store as the Collaboration store, object that is the to-end of this relationship. In the case of a local Document, this will be the ID of the Document's VersionSeries. If the to-end is not local, then this will be null.
Returns:
The value of the RelationshipToID property.

setRelationshipToVersionID

public void setRelationshipToVersionID(java.lang.String id)
Set the local to-end's document version ID. The constructor should normally be used to set this, but this method can be used to "patch" an existing RelationshipInfo object.
Parameters:
id - The new value for the local to-end's version ID.

getRelationshipToVersionID

public java.lang.String getRelationshipToVersionID()
Get the RelationshipToVersionID property. This is set to the ID of a specific version of a local Document that is by the to-end of a relationship or to the Relationship.RELEASED_VERSION constant. This, by implication, means the to type is a RELTYPE_LOCAL_DOCUMENT. In other cases, this will be null.
Returns:
The value of the RelationshipToVersionID property.

setRelationshipToExtObjectStore

public void setRelationshipToExtObjectStore(java.lang.String obs)
Set the external to-end's object store ID. The constructor should normally be used to set this, but this method can be used to "patch" an existing RelationshipInfo object.
Parameters:
obs - The new value for the external object store ID.

getRelationshipToExtObjectStore

public java.lang.String getRelationshipToExtObjectStore()
Get the RelationshipExternalObjectStore property. This is set to either the ID or the name of an object store that is being referenced by the to-end of a relationship. Returns null if the relationship is not to an external object.
Returns:
The value of the RelationshipExternalObjectStore property.

setRelationshipToExtID

public void setRelationshipToExtID(java.lang.String id)
Set the external to-end's ID. The constructor should normally be used to set this, but this method can be used to update an existing RelationshipInfo object.
Parameters:
id - The new value for the external to-end's ID.

getRelationshipToExtID

public java.lang.String getRelationshipToExtID()
Get the RelationshipExternalID property. This will be set to the ID of some external object that is being referenced by the to-end of a relationship. This object will be outside the Collaboration object store. In the case of a Document, this will be the VersionSeries of that Document. Returns null if this relationship is not to an external object.
Returns:
The value of the RelationshipExternalID property.

setRelationshipToExtVersionID

public void setRelationshipToExtVersionID(java.lang.String id)
Set the external to-end's document version ID. The constructor should normally be used to set this, but this method can be used to update an existing RelationshipInfo object.
Parameters:
id - The new value for the external to-end's version ID.

getRelationshipToExtVersionID

public java.lang.String getRelationshipToExtVersionID()
Get the RelationshipExternalVersionID property. This will only be set to the ID of some Document object or the Relationship.RELEASED_VERSION constant for a RELTYPE_EXTERNAL_DOCUMENT on the to-end of the relationship. Otherwise, this will return null.
Returns:
The value of the RelationshipExternalVersionID property.

setRelationshipToExtURL

public void setRelationshipToExtURL(java.lang.String url)
Set the external URL. The constructor should normally be used to set this, but this method can be used to upate an existing RelationshipInfo object.
Parameters:
url - The new value for the external to-end's version ID.

getRelationshipToExtURL

public java.lang.String getRelationshipToExtURL()
Get the RelationshipExternalURL property.
Returns:
The value of the RelationshipExternalURL property

setIsRelationshipProtected

public void setIsRelationshipProtected(boolean isRelationshipProtected)
Set relationship protection. Protected relationships may not be deleted by the API's removeRelationship method.
Parameters:
isRelationshipProtected - Set to true to protect this relationship.

getIsRelationshipProtected

public boolean getIsRelationshipProtected()
Get the IsRelationshipProtected property. If this is true, the API code will not delete the Relationship using the removeRelationship method.
Returns:
The value of the IsRelationshipProtected property.

setIsTwoWay

public void setIsTwoWay(boolean isTwoWay)
Set the two-way flag. A two-way relationship must have both from- and to-ends in the same teamspace.
Parameters:
isTwoWay - true if this relationship is two-way.

isTwoWay

public boolean isTwoWay()
Determine whether this relationship is two-way.
Returns:
true if this is a two-way relationship.

setOwnerID

public void setOwnerID(java.lang.String ownerID)
Set the owner ID for this relationship. Needed only if the owner is to be someone other than the current logged on user.
Parameters:
ownerID - The owner ID.

getOwnerID

public java.lang.String getOwnerID()
Get the owner ID setting for this relationship.
Returns:
The owner ID.

setProperties

public void setProperties(com.filenet.wcm.api.Properties relationshipProps)
Set extra properties for this relationship object.
Parameters:
relationshipProps - The new properties to set.

getProperties

public com.filenet.wcm.api.Properties getProperties()
Get the extra properties to be set on this relationship object.
Returns:
The extra properties.

getOtherWay

public RelationshipInfo getOtherWay()
Returns a RelationshipInfo object for the opposite direction of a two-way relationship if this object has isTwoWay set.
Returns:
The opposite direction of a two-way relationship. Returns null if the current object does not have isTwoWay set to true.
Throws:
IllegalStateException - if fixupVerifyRelationship.

fixupVerifyRelationship

public void fixupVerifyRelationship(com.filenet.wcm.api.ObjectStore store)
Verify and attempt to repair the RelationshipInfo object. This will turn a external to-object into a local to-object, if possible, and will also turn document IDs into version series IDs, if needed.
Parameters:
store - The object store containing the "from" object.
Throws:
java.lang.IllegalArgumentException - if something isn't valid. Typically occurs when a property is set when it should not be for the particular RELTYPE, or the property is not set when it should be.
BsoRuntimeException - if a problem is detected with a local ID.

Collaboration API Documentation

Copyright © 2002 - 2004 FileNet Corporation. All rights reserved.