com.sas.services.information.metadata
Interface FolderInterface

All Superinterfaces:
MetadataInterface, MutableContainerInterface, PublicObjectContainerInterface, PublicObjectInterface, java.rmi.Remote
All Known Subinterfaces:
FilteredFolderInterface, FilteredRepositoryInterface, MyDocumentsInterface, MyInboxInterface, MyResultsInterface, PersonalRepositoryInterface, RootFolderInterface, VirtualFolderInterface
All Known Implementing Classes:
DavPerson, FilteredFolder, FilteredRepository, Folder, MyDocuments, MyInbox, MyResults, PersonalRepository, VirtualFolder

public interface FolderInterface
extends MetadataInterface, MutableContainerInterface

This is a generic interface for interacting with a Folder object.

Note: This interface currently has no support for ordering of items within a Folder although the contents are returned in an ordered list. It may be useful to subclass the list of items to allow sorting by name, date created, date modified, etc.

Since:
1.0

Field Summary
static java.lang.String FOLDER_TYPE_BIP
          The type string that most BIP applications like.
 
Fields inherited from interface com.sas.services.information.metadata.MetadataInterface
METADATA_STATE_DELETED, METADATA_STATE_DESTROYED, METADATA_STATE_NEW, METADATA_STATE_NORMAL, PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA
 
Method Summary
 void addItem(MetadataInterface item)
          Add an item to the folder.
 MetadataInterface addNewItem(java.lang.String name, java.lang.String type)
          Create a new metadata object to add to the folder.
 void addSubfolder(FolderInterface folder)
          Add an existing folder to this one as a subfolder.
 void deleteItem(MetadataInterface item)
          Delete an item from this folder.
 void deleteSubfolder(java.lang.String name)
          Delete a subfolder.
 java.util.Date getContentCreateDate()
          Get the content create date.
 ContentInfo getContentInfo()
          Returns the ContentInfoobject corresponding to the root of the given PathUrl.
 java.util.Date getContentModifyDate()
          Get the content modification date.
 java.lang.String getFolderType()
          Get the folder type.
 MetadataInterface getItem(java.lang.String name)
          Get a named item from the folder.
 MetadataInterface getItemByClass(java.lang.String name, java.lang.Class itemClass)
          Get a named item from the folder.
 MetadataInterface getItemByType(java.lang.String name, java.lang.String metadataType)
          Get a named item from the folder.
 java.util.List getItems()
          List all items in the folder.
 java.util.List getItemsByClass(java.lang.Class itemClass)
          List the items in the folder that match the Class passed in as a parameter.
 java.util.List getItemsByType(java.lang.String metadataType)
          Get a list of items in the folder of a specific type.
 java.util.List getItemSublist(int start, int end)
          Get a sublist of items from this folder
 java.util.List getItemSublist(int start, int end, java.lang.String sort)
          Get a sublist of items from this folder which are sorted.
 FolderInterface getParent()
          Get parent folder.
 java.lang.String getPath()
          Get path of the current folder.
 FolderInterface getSubfolder(java.lang.String name)
          Get a named subfolder.
 java.util.List getSubfolders()
          Get all the folders immediately below this one in the hiearchy.
 int getTotalNumberOfItems()
          Get the total number of items in this folder
 boolean hasDuplicate(java.lang.String name, java.lang.String type)
          Check if there's a duplicate object in this folder with the same name and of the same type.
 boolean hasDuplicateSubfolder(java.lang.String name)
          Check if this folder already has a subfolder with the given name.
 boolean isEmpty()
          Returns true if this folder has no subfolders and no member objects.
 boolean isItemNameUnique(MetadataInterface member)
          Validate that the name of the metadata object is unique within the Folder.
 FolderInterface makeSubfolder(java.lang.String name)
          Makes a subfolder under the current folder.
 FolderInterface makeSubfolder(java.lang.String name, java.lang.String type)
          Make a subfolder of a specific type.
 boolean moveMembersOnOverflow()
          Check for too many objects in a folder.
 void removeItem(MetadataInterface item)
          Remove an item from the folder.
 void removeSubfolder(java.lang.String name)
          Remove a subfolder from the current folder.
 void setContentCreateDate(java.util.Date date)
          Set the Date that the content folder was created.
 void setContentModifyDate(java.util.Date date)
          Set the date when an object was last added to or removed from this folder.
 void setFolderType(java.lang.String type)
          Set the folder type.
 
Methods inherited from interface com.sas.services.information.metadata.MetadataInterface
add, addAccessControl, addAttribute, addAttributes, addDocument, addExtension, addGroup, addImplementor, addKeyword, addObjectProperty, addObjectProperty, addPermissions, addPrompt, addPropertySet, addRemark, addResponsibleParty, addTransactionListener, addUsedByPrototype, checkin, checkout, commit, copyTo, countAssociatedObjects, delete, deleteAttribute, deleteAttributes, destroy, getAccessControls, getAttribute, getAttributes, getAuthorizationUtil, getCreateDate, getDescription, getDocuments, getEntityKey, getEntityURL, getExtensions, getGroups, getGUID, getIdentities, getImplementors, getKeywords, getLockedBy, getModifyDate, getObjectProperties, getParentPath, getParents, getPath, getPaths, getPermission, getPermissions, getPermissions, getPreviousVersionNames, getPrimaryPropertyGroup, getPrompt, getPrompts, getPropertyBag, getPropertySets, getRemarksList, getReposId, getRepository, getRepositoryEntity, getRepositoryName, getReposKey, getResponsibleParties, getState, getTrackingId, getType, getUsageVersion, getUsedByPrototypes, getUsingPrototype, getVersion, isAuthorized, isCompatible, isDeleted, isDestroyed, isLoggingEnabled, isObjectAlive, isReadCompatible, logMessage, mapNameToFilesystem, mapUrlToFilesystem, moveTo, newServiceObject, refresh, removeAccessControl, removeDocument, removeExtension, removeGroup, removeImplementor, removeKeyword, removeObjectProperty, removePermissions, removePrompt, removePropertySet, removeResponsibleParty, removeUsedByPrototype, rollback, setAttribute, setAttributes, setDeleted, setDescription, setDocuments, setExtensions, setGroups, setGUID, setKeywords, setName, setObjectProperties, setPermission, setPrimaryPropertyGroup, setPrompt, setPrompts, setRemarksList, setRepository, setUsingPrototype, startTransaction, toByteArray, transactionEvent, uncheckout, update, updateFromBag, version
 
Methods inherited from interface com.sas.services.information.publicobject.MutableContainerInterface
addChild, insertChild, removeChild
 
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectContainerInterface
getChildAt, getChildCount, getChildren, getChildren, newChild
 
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor
 

Field Detail

FOLDER_TYPE_BIP

static final java.lang.String FOLDER_TYPE_BIP
The type string that most BIP applications like.

See Also:
Constant Field Values
Method Detail

getPath

java.lang.String getPath()
                         throws java.rmi.RemoteException
Get path of the current folder. This is the path starting with the Tree just below the Bip Service SoftwareComponent down to this folder, with forward-slash separators.

Returns:
The path string for this folder.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

getItems

java.util.List getItems()
                        throws ServiceException,
                               java.rmi.RemoteException
List all items in the folder. These are only the individual items. Subfolders will be returned separately.

Returns:
A List of MetadataInterface objects in this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getItemsByType

java.util.List getItemsByType(java.lang.String metadataType)
                              throws ServiceException,
                                     java.rmi.RemoteException
Get a list of items in the folder of a specific type.

Parameters:
metadataType - A String that will match the output from the object's getType method.
Returns:
A List of MetadataInterface objects whose getType() method returns the string specified by metadataType.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getItemsByClass

java.util.List getItemsByClass(java.lang.Class itemClass)
                               throws ServiceException,
                                      java.rmi.RemoteException
List the items in the folder that match the Class passed in as a parameter. This Class should be a subclass of MetadataInterface.

Parameters:
itemClass - The Class used to filter the folder objects to return.
Returns:
A List of MetadataInterface objects that match the itemClass.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getItem

MetadataInterface getItem(java.lang.String name)
                          throws ServiceException,
                                 java.rmi.RemoteException
Get a named item from the folder. With only a name, we can't guarantee that the object coming back will be the one the user wants. Even if we ask for a type, name collisions can occur.

Parameters:
name - The name of the object to return.
Returns:
A MetadataInterface object matching name.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getItemByType

MetadataInterface getItemByType(java.lang.String name,
                                java.lang.String metadataType)
                                throws ServiceException,
                                       java.rmi.RemoteException
Get a named item from the folder. With only a name, we can't guarantee that the object coming back will be the one the user wants. Even if we ask for a type, name collisions can occur.

Parameters:
name - The name of the object to return.
metadataType - The type of object to return.
Returns:
A MetadataInterface object that matches the name and type requested, or null if none is found.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getItemByClass

MetadataInterface getItemByClass(java.lang.String name,
                                 java.lang.Class itemClass)
                                 throws ServiceException,
                                        java.rmi.RemoteException
Get a named item from the folder. It must match both the name and the Class provided. If no Class is provided on the call, the first object matching the name is retuned. If no match is found, null is returned.

Parameters:
name - The name of the object to return.
itemClass - The Class of the object to return.
Returns:
A MetadataInterface object in the folder that matches the name and Class requested.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getSubfolders

java.util.List getSubfolders()
                             throws ServiceException,
                                    java.rmi.RemoteException
Get all the folders immediately below this one in the hiearchy.

Returns:
A List of FolderInterface objects that are members of this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getSubfolder

FolderInterface getSubfolder(java.lang.String name)
                             throws ServiceException,
                                    java.rmi.RemoteException
Get a named subfolder.

Parameters:
name - The name of the folder to return.
Returns:
A FolderInterface object with the name requested, or null if it doesn't exist.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

addItem

void addItem(MetadataInterface item)
             throws ServiceException,
                    java.rmi.RemoteException
Add an item to the folder. The item should already exist. This method makes the association that puts it in this folder, but doesn't create the item in the store.

Parameters:
item - The item to add to this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

addNewItem

MetadataInterface addNewItem(java.lang.String name,
                             java.lang.String type)
                             throws ServiceException,
                                    java.rmi.RemoteException
Create a new metadata object to add to the folder.

Parameters:
name - The name of the new object.
type - The repository-specific type of the new object.
Returns:
The new metadata object.
Throws:
ServiceException - In the event of repository failure.
java.rmi.RemoteException - In the event of remote object failure.

removeItem

void removeItem(MetadataInterface item)
                throws ServiceException,
                       java.rmi.RemoteException
Remove an item from the folder. This call just breaks the association with the item, and leaves it otherwise undisturbed in the repository.

Parameters:
item - The item to remove from this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

deleteItem

void deleteItem(MetadataInterface item)
                throws ServiceException,
                       java.rmi.RemoteException
Delete an item from this folder. This method deletes the item from the repository as well as removing it from the folder.

Parameters:
item - The item to delete from this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

makeSubfolder

FolderInterface makeSubfolder(java.lang.String name,
                              java.lang.String type)
                              throws ServiceException,
                                     java.rmi.RemoteException
Make a subfolder of a specific type. the type string should be the smart object type.

Parameters:
name - The name of the new subfolder.
type - The smart object type of the new subfolder.
Returns:
A new subfolder of this folder.
Throws:
ServiceException - If the type is not a FolderInterface derivative, or if a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

makeSubfolder

FolderInterface makeSubfolder(java.lang.String name)
                              throws ServiceException,
                                     java.rmi.RemoteException
Makes a subfolder under the current folder.

Parameters:
name - The name of the folder to create.
Returns:
The new folder
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

addSubfolder

void addSubfolder(FolderInterface folder)
                  throws ServiceException,
                         java.rmi.RemoteException
Add an existing folder to this one as a subfolder.

Parameters:
folder - The folder to add to this one as a subfolder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

removeSubfolder

void removeSubfolder(java.lang.String name)
                     throws ServiceException,
                            java.rmi.RemoteException
Remove a subfolder from the current folder. This breaks the association, but does not remove it from the repository.

Parameters:
name - The name of the subfolder to remove.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

deleteSubfolder

void deleteSubfolder(java.lang.String name)
                     throws ServiceException,
                            java.rmi.RemoteException
Delete a subfolder. This will only work if the folder is empty.

Parameters:
name - The name of the subfolder to delete.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

getParent

FolderInterface getParent()
                          throws ServiceException,
                                 java.rmi.RemoteException
Get parent folder.

If the current folder has more than one parent, the preferred (first) parent folder is returned.

Specified by:
getParent in interface MetadataInterface
Returns:
The parent Folder of this folder.
Throws:
ServiceException - if a repository error occurs.
java.rmi.RemoteException - in the event of remote object failure.

setFolderType

void setFolderType(java.lang.String type)
                   throws ServiceException,
                          java.rmi.RemoteException
Set the folder type.

Parameters:
type - The String indicating the type of the folder.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getFolderType

java.lang.String getFolderType()
                               throws ServiceException,
                                      java.rmi.RemoteException
Get the folder type.

Returns:
A String with the type of folder.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getItemSublist

java.util.List getItemSublist(int start,
                              int end)
                              throws java.rmi.RemoteException,
                                     ServiceException
Get a sublist of items from this folder

Parameters:
start - item number to start at
end - item number to end at
Returns:
The sublist of items.
Throws:
java.rmi.RemoteException
ServiceException

getItemSublist

java.util.List getItemSublist(int start,
                              int end,
                              java.lang.String sort)
                              throws java.rmi.RemoteException,
                                     ServiceException
Get a sublist of items from this folder which are sorted.

Parameters:
start - item number to start at
end - item number to end at
sort - one of name, namedescending, desc, descdescending, date, datedescending, type, typedescending, defaults to name
Returns:
The sorted sublist of items.
Throws:
java.rmi.RemoteException
ServiceException

getTotalNumberOfItems

int getTotalNumberOfItems()
                          throws java.rmi.RemoteException,
                                 ServiceException
Get the total number of items in this folder

Returns:
The number of items in the folder.
Throws:
java.rmi.RemoteException
ServiceException

hasDuplicate

boolean hasDuplicate(java.lang.String name,
                     java.lang.String type)
                     throws ServiceException,
                            java.rmi.RemoteException
Check if there's a duplicate object in this folder with the same name and of the same type.

Parameters:
name - The name to check for.
type - The type to check for. This should be the value of the PublicType attribute because I can't necessarily instantiate the object if the current user doesn't have ReadMetadata permission on it. I need to construct a filter to do a getCountNoSecurity with.
Returns:
true if this folder has an object with the given name and type, false otherwise.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

hasDuplicateSubfolder

boolean hasDuplicateSubfolder(java.lang.String name)
                              throws ServiceException,
                                     java.rmi.RemoteException
Check if this folder already has a subfolder with the given name.

Parameters:
name - The name of the subfolder to check for.
Returns:
true if this folder has a subfolder with the given name, false otherwise.
Throws:
ServiceException - If a metadata server, or other service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

isEmpty

boolean isEmpty()
                throws ServiceException,
                       java.rmi.RemoteException
Returns true if this folder has no subfolders and no member objects. This method may return false even if both getSubfolders() and getItems() return empty lists due to objects hidden by access controls.

Returns:
true if this folder has no subfolders and no member objects
Throws:
ServiceException - If a metadata server, or other service level error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getContentInfo

ContentInfo getContentInfo()
                           throws ServiceException,
                                  java.rmi.RemoteException
Returns the ContentInfoobject corresponding to the root of the given PathUrl.

Implementation Note: computed results are cached; repeated calls are not expensive.

Returns:
The ContentInfo object with the path and credentials for the content area, or null if the folder isn't content mapped.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

getContentCreateDate

java.util.Date getContentCreateDate()
                                    throws ServiceException,
                                           java.rmi.RemoteException
Get the content create date. This is maintained separately from the metadata create date, which is when the Tree object itself was created. This date indicates when the content folder was created.

Returns:
The Date when the content folder was created.
Throws:
ServiceException - If a service level error occured.
java.rmi.RemoteException - In the event of remote object failure.

setContentCreateDate

void setContentCreateDate(java.util.Date date)
                          throws ServiceException,
                                 java.rmi.RemoteException
Set the Date that the content folder was created.

Parameters:
date - The date that the mapped content folder was created.
Throws:
ServiceException - If a service level error occured.
java.rmi.RemoteException - In the event of remote object failure.

getContentModifyDate

java.util.Date getContentModifyDate()
                                    throws ServiceException,
                                           java.rmi.RemoteException
Get the content modification date. This is the date and time of the most recent addition to or deletion from this folder. This information may be maintained by the client.

Returns:
The Date when an object was last added or removed.
Throws:
ServiceException - If a service level error occured.
java.rmi.RemoteException - In the event of remote object failure.

setContentModifyDate

void setContentModifyDate(java.util.Date date)
                          throws ServiceException,
                                 java.rmi.RemoteException
Set the date when an object was last added to or removed from this folder.

Parameters:
date - The last time the contents of this folder were modified.
Throws:
ServiceException - If a service level error occured.
java.rmi.RemoteException - In the event of remote object failure.

isItemNameUnique

boolean isItemNameUnique(MetadataInterface member)
                         throws ServiceException,
                                java.rmi.RemoteException
Validate that the name of the metadata object is unique within the Folder. The object should already be an item in the folder. If it's not, then the hasDuplicate call should be made. If the member name is unique in the folder, the method returns true. Otherwise it returns false. This method does not validate the name string itself.

Parameters:
member - The item to check for a unique name in the folder.
Returns:
True if the member's name is unique, false otherwise.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.

moveMembersOnOverflow

boolean moveMembersOnOverflow()
                              throws ServiceException,
                                     java.rmi.RemoteException
Check for too many objects in a folder. If the folder contains more than a limit defined by the folder, the current members of the folder are moved to a new subfolder. The new subfolder will be named "1", "2", etc. Subfolders are not considered in the count.

Returns:
true if objects were moved to a subfolder
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.