Collaboration API Documentation

com.filenet.bso.api.util
Interface BsoElements


public interface BsoElements

The BsoElements interface aids in manipulating the upper-level elements of the content (manifest information). This interface treats the content as if it were like a collection of BsoElement entries. It provides low-level methods that are internally called to get, set, add, and remove element functions, and two methods that return iterators over the collection.


Method Summary
 void addElement(BsoElement elem)
          Adds an element to the content and sets the element's change flag.
 void addElementUnchanged(BsoElement elem)
          Adds an element to the content without modifying its change flag.
 boolean checkUpdateConflict(BsoElement elem, BsoElement newElem)
          Internally called to check for update conflicts between a modified element and the given recently-persisted element.
 void clearDeletedList()
          Clears the list of deleted elements.
 java.util.List getAllElements()
          Returns a list of all of the upper-level elements in the content.
 java.util.List getChangedElements()
          Returns a list of all of the changed upper-level elements in the content.
 BsoElement getElement(BsoElement elem)
          Retrieves an element in the content given another element.
 BsoElement getElement(java.lang.String id, int type)
          Retrieves an element in the content given another element.
 boolean postLoad()
          Sets up content after loading it.
 void preStore()
          Sets up content before persisting it.
 void preUpdateProcess()
          Sets up content at the beginning of the update process.
 boolean removeElement(BsoElement elem)
          Removes an element from the content and sets the element's change flag.
 boolean removeElement(java.lang.String id, int type)
          Removes an element from the content and sets the element's change flag.
 boolean reorderElements()
          Reorders the elements.
 BsoElement setElement(BsoElement elem)
          Replaces an existing element with another.
 void setElementChanged(BsoElement elem)
          Sets the change flag of the given element.
 

Method Detail

getAllElements

public java.util.List getAllElements()
Returns a list of all of the upper-level elements in the content. This list will not include deleted elements.

Returns:
A Java List object.

getChangedElements

public java.util.List getChangedElements()
Returns a list of all of the changed upper-level elements in the content. This includes elements that have been deleted, added, or changed.

Returns:
A Java List object.

clearDeletedList

public void clearDeletedList()
Clears the list of deleted elements.

getElement

public BsoElement getElement(BsoElement elem)
Retrieves an element in the content given another element. This method uses the type and manifest ID from the given element to locate and return another element. This method returns null if an element cannot be found.

Parameters:
elem - A similar element to find.

Returns:
The found element or null.

getElement

public BsoElement getElement(java.lang.String id,
                             int type)
Retrieves an element in the content given another element. This method returns an element of a given type and ID, or returns null if an element of the given type and ID cannot be found.

Parameters:
id - A String containing the element's manifest ID.

type - The element type, specified as BsoManifest.TYPE_DOCUMENT_ORDERING, BsoManifest.TYPE_MANIFEST_DOCUMENT, or BsoManifest.TYPE_MANIFEST_PACKAGE.

Returns:
The found element or null.

addElement

public void addElement(BsoElement elem)
Adds an element to the content and sets the element's change flag. To add the element without modifying the change flag, use the addElementUnchanged method.

Parameters:
elem - The BsoElement object to add.

addElementUnchanged

public void addElementUnchanged(BsoElement elem)
Adds an element to the content without modifying its change flag. To add the element and set its change flag, use the addElement method.

Parameters:
elem - The element to add.

removeElement

public boolean removeElement(BsoElement elem)
Removes an element from the content and sets the element's change flag. This method also moves the element into a deleted list.

Parameters:
elem - The element to be removed.

Returns:
true if the element was found and removed; otherwise, returns false.

removeElement

public boolean removeElement(java.lang.String id,
                             int type)
Removes an element from the content and sets the element's change flag. This method also moves the element into a deleted list.
Parameters:
id - A String containing the element's manifest ID.
type - An integer that represents the element type (BsoManifest.TYPE_DOCUMENT_ORDERING, BsoManifest.TYPE_MANIFEST_DOCUMENT, or BsoManifest.TYPE_MANIFEST_PACKAGE).
Returns:
true if the element was found and removed; otherwise, returns false.

setElement

public BsoElement setElement(BsoElement elem)
Replaces an existing element with another. This method also sets the element's change flag.

Parameters:
elem - The replacement element.

Returns:
The element that was replaced or null if the replacement failed.

setElementChanged

public void setElementChanged(BsoElement elem)
Sets the change flag of the given element.
Parameters:
elem - The BsoElement object to change.

reorderElements

public boolean reorderElements()
Reorders the elements. This method also validates the new content to make sure that it is complete. Using the case manifest as an example, this step reorders the manifest document list and returns false if the reordering failed.

Returns:
true if element reordering and content validation succeed; otherwise, returns false.

preUpdateProcess

public void preUpdateProcess()
Sets up content at the beginning of the update process. The case manifest implementation uses this step to save reordering information.

postLoad

public boolean postLoad()
Sets up content after loading it. This method is for internal use only. It performs extra processing on the manifest data after the load operation. For the case manifest implementation, this method simply calls the reorderElements() method.

Returns:
true if the method succeeds; otherwise, returns false

preStore

public void preStore()
Sets up content before persisting it. The case manifest implementation uses this internal method to modify the document ordering.

checkUpdateConflict

public boolean checkUpdateConflict(BsoElement elem,
                                   BsoElement newElem)
Internally called to check for update conflicts between a modified element and the given recently-persisted element.

An update conflict is a situation in which you want to update an element, but someone else has concurrently updated the same element. This check allows you to disregard, for instance, a recent concurrent change to document ordering.

Parameters:
elem - The updated element to check.

newElem - The recently persisted copy of the same element.

Returns:
true if an update conflict exists; otherwise, returns false.

Collaboration API Documentation

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