Interface FolderInterface
- All Superinterfaces:
MetadataInterface,MutableContainerInterface,PublicObjectContainerInterface,PublicObjectInterface,Remote
- All Known Subinterfaces:
FilteredFolderInterface,FilteredRepositoryInterface,MyDocumentsInterface,MyInboxInterface,MyResultsInterface,PersonalRepositoryInterface,RootFolderInterface,VirtualFolderInterface
- All Known Implementing Classes:
DavPerson,FilteredFolder,FilteredRepository,Folder,MyDocuments,MyInbox,MyResults,PersonalRepository,ServerVirtualFolder,VirtualFolder
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
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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
Modifier and TypeMethodDescriptionvoidaddItem(MetadataInterface item) Add an item to the folder.addNewItem(String name, String type) Create a new metadata object to add to the folder.voidaddSubfolder(FolderInterface folder) Add an existing folder to this one as a subfolder.voiddeleteItem(MetadataInterface item) Delete an item from this folder.voiddeleteSubfolder(String name) Delete a subfolder.DateGet the content create date.Returns theContentInfoobject corresponding to the root of the given PathUrl.DateGet the content modification date.StringGet the folder type.getItem(String name) Get a named item from the folder.getItemByClass(String name, Class itemClass) Get a named item from the folder.getItemByType(String name, String metadataType) Get a named item from the folder.ListgetItems()List all items in the folder.ListgetItemsByClass(Class itemClass) List the items in the folder that match the Class passed in as a parameter.ListgetItemsByType(String metadataType) Get a list of items in the folder of a specific type.ListgetItemSublist(int start, int end) Get a sublist of items from this folderListgetItemSublist(int start, int end, String sort) Get a sublist of items from this folder which are sorted.Get parent folder.StringgetPath()Get path of the current folder.getPublicTypeItem(String name, String type) Find an item in this Folder with the given name and type.getSubfolder(String name) Get a named subfolder.ListGet all the folders immediately below this one in the hiearchy.intGet the total number of items in this folderbooleanhasDuplicate(String name, String type) Check if there's a duplicate object in this folder with the same name and of the same type.booleanhasDuplicateSubfolder(String name) Check if this folder already has a subfolder with the given name.booleanisEmpty()Returns true if this folder has no subfolders and no member objects.booleanisItemNameUnique(MetadataInterface member) Validate that the name of the metadata object is unique within the Folder.makeSubfolder(String name) Makes a subfolder under the current folder.makeSubfolder(String name, String type) Make a subfolder of a specific type.booleanCheck for too many objects in a folder.voidremoveItem(MetadataInterface item) Remove an item from the folder.voidremoveSubfolder(String name) Remove a subfolder from the current folder.voidsetContentCreateDate(Date date) Set the Date that the content folder was created.voidsetContentModifyDate(Date date) Set the date when an object was last added to or removed from this folder.voidsetFolderType(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, addNoteTextStore, addNoteTextStore, addObjectProperty, addObjectProperty, addPermissions, addPrompt, addPropertySet, addRemark, addResponsibleParty, addTransactionListener, addUsedByPrototype, checkin, checkout, commit, copyTo, countAssociatedObjects, delete, deleteAttribute, deleteAttributes, destroy, getAccessControls, getAttribute, getAttributes, getAuthorizationUtil, getCreateDate, getCreatedBy, getDescription, getDocuments, getEntityKey, getEntityURL, getExtensions, getGroups, getGUID, getIdentities, getImplementors, getKeywords, getLockedBy, getModifiedBy, getModifyDate, getNoteTextStore, getNoteTextStores, getNoteTextStoresByRole, 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, isObjectAlive, isReadCompatible, mapNameToFilesystem, mapUrlToFilesystem, moveTo, newServiceObject, refresh, removeAccessControl, removeDocument, removeExtension, removeGroup, removeImplementor, removeKeyword, removeNoteTextStore, removeObjectProperty, removePermissions, removePrompt, removePropertySet, removeResponsibleParty, removeResponsiblePartyByIdentity, removeUsedByPrototype, rollback, setAttribute, setAttributes, setDeleted, setDescription, setDocuments, setExtensions, setGroups, setGUID, setKeywords, setName, setNoteTextStores, setObjectProperties, setPermission, setPrimaryPropertyGroup, setPrompt, setPrompts, setRemarksList, setRepository, setUsingPrototype, startTransaction, toByteArray, transactionEvent, uncheckout, update, updateFromBag, versionMethods inherited from interface com.sas.services.information.publicobject.MutableContainerInterface
addChild, insertChild, removeChildMethods inherited from interface com.sas.services.information.publicobject.PublicObjectContainerInterface
getChildAt, getChildCount, getChildren, getChildren, newChildMethods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor
-
Field Details
-
FOLDER_TYPE_BIP
static final String FOLDER_TYPE_BIPThe type string that most BIP applications like.- See Also:
-
-
Method Details
-
getPath
String getPath() throws RemoteExceptionGet 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:
RemoteException- in the event of remote object failure.
-
getItems
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.RemoteException- in the event of remote object failure.
-
getItemsByType
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.RemoteException- in the event of remote object failure.
-
getItemsByClass
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.RemoteException- in the event of remote object failure.
-
getItem
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.RemoteException- in the event of remote object failure.
-
getPublicTypeItem
MetadataInterface getPublicTypeItem(String name, String type) throws ServiceException, RemoteException Find an item in this Folder with the given name and type. This will use search to get the item, so it will always go to the server to find the object. The upside is, it will always get a fresh copy of the object. The downside is, no caching applies. This doesn't populate the folders items, and will always go to the server.- Parameters:
name- The name of the object to find. If null, a null is returned.type- The public type name of the object type. If this is null, a null is returned. If the type is not recognized as a public type, a ServiceException will be thrown- Returns:
- The matching item in this folder, or null if none exists.
- Throws:
ServiceException- if the type is not a public type, or if a repository error occurs.RemoteException- in the event of remote object failure.
-
getItemByType
MetadataInterface getItemByType(String name, String metadataType) throws ServiceException, 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.RemoteException- in the event of remote object failure.
-
getItemByClass
MetadataInterface getItemByClass(String name, Class itemClass) throws ServiceException, 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.RemoteException- in the event of remote object failure.
-
getSubfolders
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.RemoteException- in the event of remote object failure.
-
getSubfolder
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.RemoteException- in the event of remote object failure.
-
addItem
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.RemoteException- in the event of remote object failure.
-
addNewItem
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.RemoteException- In the event of remote object failure.
-
removeItem
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.RemoteException- in the event of remote object failure.
-
deleteItem
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.RemoteException- in the event of remote object failure.
-
makeSubfolder
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.RemoteException- In the event of remote object failure.
-
makeSubfolder
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.RemoteException- in the event of remote object failure.
-
addSubfolder
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.RemoteException- in the event of remote object failure.
-
removeSubfolder
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.RemoteException- in the event of remote object failure.
-
deleteSubfolder
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.RemoteException- in the event of remote object failure.
-
getParent
Get parent folder.If the current folder has more than one parent, the preferred (first) parent folder is returned.
- Specified by:
getParentin interfaceMetadataInterface- Returns:
- The parent Folder of this folder.
- Throws:
ServiceException- if a repository error occurs.RemoteException- in the event of remote object failure.
-
setFolderType
Set the folder type.- Parameters:
type- The String indicating the type of the folder.- Throws:
ServiceException- If a repository error occurs.RemoteException- In the event of remote object failure.
-
getFolderType
Get the folder type.- Returns:
- A String with the type of folder.
- Throws:
ServiceException- If a repository error occurs.RemoteException- In the event of remote object failure.
-
getItemSublist
Get a sublist of items from this folder- Parameters:
start- item number to start atend- item number to end at- Returns:
- The sublist of items.
- Throws:
RemoteExceptionServiceException
-
getItemSublist
Get a sublist of items from this folder which are sorted.- Parameters:
start- item number to start atend- item number to end atsort- one of name, namedescending, desc, descdescending, date, datedescending, type, typedescending, defaults to name- Returns:
- The sorted sublist of items.
- Throws:
RemoteExceptionServiceException
-
getTotalNumberOfItems
Get the total number of items in this folder- Returns:
- The number of items in the folder.
- Throws:
RemoteExceptionServiceException
-
hasDuplicate
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.RemoteException- In the event of remote object failure.
-
hasDuplicateSubfolder
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.RemoteException- In the event of remote object failure.
-
isEmpty
Returns true if this folder has no subfolders and no member objects. This method may return false even if bothgetSubfolders()andgetItems()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.RemoteException- In the event of remote object failure.
-
getContentInfo
Returns theContentInfoobject 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.RemoteException- In the event of remote object failure.
-
getContentCreateDate
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.RemoteException- In the event of remote object failure.
-
setContentCreateDate
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.RemoteException- In the event of remote object failure.
-
getContentModifyDate
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.RemoteException- In the event of remote object failure.
-
setContentModifyDate
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.RemoteException- In the event of remote object failure.
-
isItemNameUnique
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.RemoteException- In the event of remote object failure.
-
moveMembersOnOverflow
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.RemoteException- In the event of remote object failure.
-