Novell exteNd
Director 5.2 API

com.sssw.cm.api
Interface EbiDirectoryEntry

All Superinterfaces:
Cloneable, Comparable, EbiCmElement, EbiElement, EbiFrameworkElement, EbiSecurableElement, Serializable
All Known Subinterfaces:
EbiDirectory, EbiDocCategory, EbiDocFolder, EbiDocument, EbiQueryResult

public interface EbiDirectoryEntry
extends EbiSecurableElement, EbiCmElement, Comparable

Objects that implement this interface are entries in Directories (see EbiDirectory). Directories themselves are also Directory Entries.

See Also:
EbiDirectory

Field Summary
static int OP_ADD_LEAF_NODE
          The op-code for the "add entry" operation.
 
Fields inherited from interface com.sssw.cm.api.EbiCmElement
OP_COPY, OP_MOVE, OP_REMOVE, OP_UPDATE
 
Method Summary
 boolean exists(EbiContext context)
          Returns true if this Directory Entry exists.
 Collection getChildren(EbiContext context, boolean checkAccess, boolean recursive, boolean IDsOnly)
          Gets the list of children of this Directory Entry.
 EbiContentMgmtDelegate getContentManager()
          Gets the Content Manager that manages the Repository to which this Directory Entry belongs.
 String getID()
          Gets the ID of the Directory Entry.
 String getKey()
          Gets the key representing this entry in the directory list.
 String getName()
          Gets the name of the Directory Entry.
 EbiDirectory getParentDirectory(EbiContext context)
          Returns the Directory to which this Entry belongs.
 String getRepositoryID()
          Gets the Repository ID.
 String getURL(boolean encode)
          Gets the URL of the Directory Entry.
 String getURLDontThrow(boolean encode)
          Gets the URL of the Directory Entry; does not throw an exception if for one reason or another unable to retrieve the URL.
 boolean hasChildren()
          Tells whether the Directory Entry has any child Entries.
 boolean hasNameChanged()
          Tells whether the 'setName' method has been called on the object.
 boolean isChildOf(EbiContext context, EbiDirectoryEntry dirEntry)
          Returns true if the specified Directory Entry is a child of the other Directory Entry: For a Document, a Folder, a Category, or another Document may be its parent.
 boolean isDescendantOf(EbiContext context, EbiDirectoryEntry dirEntry)
          Checks to see whether this Directory Entry is a descendant of the specified other Directory Entry
 boolean isDescendantOf(EbiContext context, EbiDirectoryEntry dirEntry, int depth)
          Checks to see whether this Directory Entry is a descendant of the specified other Directory Entry, given a certain depth value
 boolean isDirectory()
          Determines whether the Entry is a Directory.
 boolean isInDefaultRepository()
          Tells whether this Directory Entry belongs to the Default Repository.
 boolean isInSystemRepository()
          Tells whether this Directory Entry belongs to the System Repository.
 boolean remove(EbiContext context, boolean recursive)
          Removes this Directory Entry.
 void removeChildren(EbiContext context, boolean recursive)
          Removes any children of this Directory Entry.
 void setID()
          Sets/generates the UUID of the Directory Entry.
 void setID(String uuid)
          Sets the UUID of the Directory Entry.
 void setLastModified(Timestamp time)
          Sets the last modified time.
 void setName(String name)
          Sets the name of this entry to a new value, effective when the update method is invoked.
 void setRepositoryID(String repID)
          Sets the Repository ID, this method is intended for internal use only and shouldn't normally be invoked by others.
 void update(EbiContext context)
          Saves any changes made to this Directory Entry via the setter methods, to the Repository
 
Methods implemented from interface com.sssw.fw.api.EbiSecurableElement
getAcl, getObjectID, isUserAuthorized, removeAcl, setAcl
 
Methods implemented from interface com.sssw.cm.api.EbiCmElement
fromXML, toXML, validateOperation
 
Methods implemented from interface java.lang.Comparable
compareTo
 
Methods implemented from interface com.sssw.fw.api.EbiFrameworkElement
getElementUUID, getLastModified, getLastModifiedBy, isEqualTo, isReadOnly, resetReadOnly, setLastModified, setLastModifiedBy, setReadOnly
 

Field Detail

OP_ADD_LEAF_NODE

public static final int OP_ADD_LEAF_NODE
The op-code for the "add entry" operation. For a Dolder, this would imply adding a Document, for a Document, this would imply adding a Child Document.
Method Detail

getID

public String getID()
Gets the ID of the Directory Entry.
Returns:
the ID

getName

public String getName()
Gets the name of the Directory Entry.
Returns:
the name

getURL

public String getURL(boolean encode)
              throws EboUnrecoverableSystemException,
                     EboSecurityException
Gets the URL of the Directory Entry.
Parameters:
encode - whether the returned relative URL string should be encoded (to allow for non-7-bit-ASCII characters in a URL)
Returns:
the URL of the entry; null if the implementation does not support the notion of a URL for an entry

getURLDontThrow

public String getURLDontThrow(boolean encode)
Gets the URL of the Directory Entry; does not throw an exception if for one reason or another unable to retrieve the URL.
Parameters:
encode - whether the returned relative URL string should be encoded (to allow for non-7-bit-ASCII characters in a URL)
Returns:
the URL of the entry; null if the implementation does not support the notion of a URL for an entry or if it for some reason was unable to retrieve the URL

isDirectory

public boolean isDirectory()
Determines whether the Entry is a Directory.
Returns:
true if it is a Directory, false otherwise

setName

public void setName(String name)
Sets the name of this entry to a new value, effective when the update method is invoked. An 'update' method needs to be called for this change to take effect
Parameters:
name - the new name; must not contain the '/' character due to the fact that it is used as the separator in directory entry paths
See Also:
EbiDirectoryEntry.update(EbiContext), EbiContentMgmtDelegate.updateDocument(EbiContext, EbiDocument), EbiContentMgmtDelegate.updateFolder(EbiContext, EbiDocFolder), EbiContentMgmtDelegate.updateCategory(EbiContext, EbiDocCategory)

getKey

public String getKey()
Gets the key representing this entry in the directory list. The key is the lower-cased name of the entry.
Returns:
the key

setRepositoryID

public void setRepositoryID(String repID)
Sets the Repository ID, this method is intended for internal use only and shouldn't normally be invoked by others.
Parameters:
repID - the Repository ID

getRepositoryID

public String getRepositoryID()
Gets the Repository ID.
Returns:
the ID of the Repository to which the Directory Entry belongs

setID

public void setID()
Sets/generates the UUID of the Directory Entry.

setID

public void setID(String uuid)
Sets the UUID of the Directory Entry.
Parameters:
uuid - the UUID of the Directory Entry

getChildren

public Collection getChildren(EbiContext context,
                              boolean checkAccess,
                              boolean recursive,
                              boolean IDsOnly)
                       throws EboUnrecoverableSystemException,
                              EboSecurityException,
                              EboItemExistenceException
Gets the list of children of this Directory Entry.
Parameters:
context - context
checkAccess - whether to filter out items inaccessible by the user whose context is passed in
recursive - whether to recurse the hierarchy
IDsOnly - if true, return a Collection of String IDs of children, otherwise return Java objects (CM elements).
Returns:
a Collection of child elements

hasChildren

public boolean hasChildren()
                    throws EboUnrecoverableSystemException,
                           EboSecurityException
Tells whether the Directory Entry has any child Entries.
Returns:
true if the Directory Entry has at least one child, false otherwise

exists

public boolean exists(EbiContext context)
               throws EboUnrecoverableSystemException,
                      EboSecurityException
Returns true if this Directory Entry exists.
Parameters:
context - context
Returns:
true if the Directory Entry exists, false otherwise

isDescendantOf

public boolean isDescendantOf(EbiContext context,
                              EbiDirectoryEntry dirEntry)
                       throws EboUnrecoverableSystemException,
                              EboSecurityException,
                              EboItemExistenceException
Checks to see whether this Directory Entry is a descendant of the specified other Directory Entry
Parameters:
context - context
dirEntry - the other Directory Entry to check against
Returns:
true if this Directory Entry is a descendant of the specified other Directory Entry, false otherwise

isDescendantOf

public boolean isDescendantOf(EbiContext context,
                              EbiDirectoryEntry dirEntry,
                              int depth)
                       throws EboUnrecoverableSystemException,
                              EboSecurityException,
                              EboItemExistenceException
Checks to see whether this Directory Entry is a descendant of the specified other Directory Entry, given a certain depth value
Parameters:
context - context
dirEntry - the other Directory Entry to check against
depth - specifies how the checking is to be performed; if depth = 0, then the check is an equality comparison, if depth = 1, then the method checks if the Directory Entry is a child of the other Entry, if depth = -1, then the method checks if the Directory Entry is a descendant at any level; for any other value the method checks whether the Directory Entry is a descendant anywhere within the 'depth' number of levels
Returns:
true if this Directory Entry is a descendant of the specified other Directory Entry, false otherwise

isChildOf

public boolean isChildOf(EbiContext context,
                         EbiDirectoryEntry dirEntry)
                  throws EboUnrecoverableSystemException
Returns true if the specified Directory Entry is a child of the other Directory Entry:
Parameters:
context - context
dirEntry - potential parent Directory Entry
Returns:
true if 'parent' is a parent Directory Entry for the 'child', false otherwise

getParentDirectory

public EbiDirectory getParentDirectory(EbiContext context)
                                throws EboUnrecoverableSystemException,
                                       EboSecurityException
Returns the Directory to which this Entry belongs.
Parameters:
context - context
Returns:
the Directory; may be null if this is the Root Directory

getContentManager

public EbiContentMgmtDelegate getContentManager()
                                         throws EboUnrecoverableSystemException,
                                                EboSecurityException
Gets the Content Manager that manages the Repository to which this Directory Entry belongs.
Returns:
the Content Manager Delegate

isInDefaultRepository

public boolean isInDefaultRepository()
                              throws EboUnrecoverableSystemException,
                                     EboSecurityException
Tells whether this Directory Entry belongs to the Default Repository.
Returns:
true if this Directory Entry belongs to the Default Repository, false otherwise

isInSystemRepository

public boolean isInSystemRepository()
                             throws EboUnrecoverableSystemException,
                                    EboSecurityException
Tells whether this Directory Entry belongs to the System Repository.
Returns:
true if this Directory Entry belongs to the System Repository, false otherwise

remove

public boolean remove(EbiContext context,
                      boolean recursive)
               throws EboUnrecoverableSystemException,
                      EboSecurityException,
                      EboItemExistenceException
Removes this Directory Entry.
Parameters:
context - context
recursive - if true, remove any descendants of this Directory Entry, if false, do not attempt to remove the descendants; note that for a Document, 'recursive' of 'false' will result in the Document being removed and any child Documents preserved, whereas for a Directory, this will result in an exception, if any children are found
Returns:
true if the folder was successfully removed, false if it doesn't exist

removeChildren

public void removeChildren(EbiContext context,
                           boolean recursive)
                    throws EboUnrecoverableSystemException,
                           EboSecurityException,
                           EboItemExistenceException
Removes any children of this Directory Entry.
Parameters:
context - context
recursive - if true, remove all of the descendants of this Directory Entry, if false, attempt to remove only the immediate descendants; if 'recursive' is false and any of the children happen to be Directories that are non-empty, then an exception is thrown

update

public void update(EbiContext context)
            throws EboUnrecoverableSystemException,
                   EboSecurityException,
                   EboItemExistenceException
Saves any changes made to this Directory Entry via the setter methods, to the Repository
Parameters:
context - context

hasNameChanged

public boolean hasNameChanged()
Tells whether the 'setName' method has been called on the object.
Returns:
true if the name has changed via the setName method

setLastModified

public void setLastModified(Timestamp time)
Sets the last modified time.
Parameters:
time - the last modified time

Novell exteNd
Director 5.2 API