Interface FavoritesContainer
- All Superinterfaces:
MetadataInterface,PublicObjectContainerInterface,PublicObjectInterface,Remote
- All Known Subinterfaces:
FavoritesFolder,FavoritesGroup
- Since:
- 9.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant used to indicate that the container can hold an unlimited number of favorites.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 TypeMethodDescriptionvoidaddFavorite(MetadataInterface favorite) Adds a new item to the list of favorites.voidaddFavoritesGroup(FavoritesGroup subGroup) Adds a new child group to this container.booleancontainsFavorite(MetadataInterface favorite) Returns true if the specified object is a direct member of this container.intReturns the number of favorites in this container.intgetFavoriteIndex(MetadataInterface favorite) Returns the index of the specified favorite, or -1 if the favorite does not exist within this container.List<MetadataInterface> Returns the list of all favorites contained within this container.List<MetadataInterface> getFavorites(SortOrder[] order) Deprecated.should not be usedintgetFavoritesGroupIndex(FavoritesGroup subGroup) Returns the index of the specified favorites group, or -1 if the group does not exist within this container.List<FavoritesGroup> Returns the list of all favorites groups contained within this container.intReturns the maximum number of favorites allowed under this container.intReturns the number of favorites in this container, as well as any nested favorites groups, recursively.booleanhasDuplicateFavoritesGroup(String name) Check if there's a duplicate favorites group in this container with the same name.voidinsertFavorite(MetadataInterface favorite, int index) Inserts a new item to the list of favorites at the specified index.voidinsertFavoritesGroup(FavoritesGroup subGroup, int index) Inserts a new child group to this container at the specified index.booleanisEmpty()Returns true if this container has no elements, either favorites or child favorite groups.voidmoveFavorite(MetadataInterface favorite, int newPosition) Deprecated.voidClears the container by removing all favorites and favorites groups, recursively.voidRemoves all existing favorites from this particular container.voidRemoves all existing child favorite groups from this particular container.voidremoveFavorite(MetadataInterface favorite) Removes the specified object from the list of favorites.voidremoveFavoritesGroup(FavoritesGroup subGroup) Removes the specified object from the list favorites groups.voidsetMaxCapacity(int capacity) Sets the maximum number of favorites allowed to be contained within this folder at a given time.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, getParent, 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.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
-
CAPACITY_UNLIMITED
static final int CAPACITY_UNLIMITEDConstant used to indicate that the container can hold an unlimited number of favorites.- See Also:
-
-
Method Details
-
getFavorites
Returns the list of all favorites contained within this container. An empty list is returned if this container contains no favorites.- Returns:
- list of favorites
- Throws:
ServiceExceptionRemoteException
-
getFavorites
Deprecated.should not be usedReturns the list of all favorites contained within this folder, and sorted in the proper order. If anullvalue is passed in for the order, a default order will be applied (sorting by name then type). An empty list will be returned if this folder contains no favorites.- Parameters:
order-- Returns:
- list of favorites sorted in the appropriate order
- Throws:
ServiceExceptionRemoteException
-
getFavoriteIndex
Returns the index of the specified favorite, or -1 if the favorite does not exist within this container.- Parameters:
favorite- the favorite to search for- Returns:
- the index of the favorite, or -1 if not found
- Throws:
ServiceExceptionRemoteException
-
getFavoriteCount
Returns the number of favorites in this container. This method returns the total count of this specific container, and does not include the count of any nested favorites groups, if applicable. Any child favorites groups are also not included in this count.- Returns:
- the number of favorites
- Throws:
ServiceExceptionRemoteException
-
getTotalFavoriteCount
Returns the number of favorites in this container, as well as any nested favorites groups, recursively. UsegetFavoriteCount()if a recursive search is not needed. The returned count only includes objects that have been added as favorites. Nested favorites groups are not included.- Returns:
- the number of favorites
- Throws:
ServiceExceptionRemoteException
-
containsFavorite
Returns true if the specified object is a direct member of this container. Note, this method does not search within any nested favorites groups to determine if the object is contained or not.- Parameters:
favorite- the favorite item- Returns:
- true if contained within the folder, false otherwise
- Throws:
ServiceExceptionRemoteException
-
isEmpty
Returns true if this container has no elements, either favorites or child favorite groups.- Returns:
- true if this container is empty
- Throws:
ServiceExceptionRemoteException
-
addFavorite
Adds a new item to the list of favorites. If the object is already contained within the list, it will not be re-added.- Parameters:
favorite- the favorite item- Throws:
ServiceExceptionRemoteException
-
insertFavorite
Inserts a new item to the list of favorites at the specified index. If the object is already contained within the list, it will not be re-added.- Parameters:
favorite- the favorite itemindex- the index where the favorite should be added- Throws:
ServiceExceptionRemoteException
-
removeFavorite
Removes the specified object from the list of favorites.- Parameters:
favorite- the favorite item- Throws:
ServiceExceptionRemoteException
-
removeAllFavorites
Removes all existing favorites from this particular container.- Throws:
ServiceExceptionRemoteException
-
getFavoritesGroups
Returns the list of all favorites groups contained within this container. An empty list is returned if this container contains no child groups.- Returns:
- list of favorites groups
- Throws:
ServiceExceptionRemoteException
-
getFavoritesGroupIndex
Returns the index of the specified favorites group, or -1 if the group does not exist within this container.- Parameters:
subGroup- the favorites group to search for- Returns:
- the index of the child group, or -1 if not found
- Throws:
ServiceExceptionRemoteException
-
addFavoritesGroup
Adds a new child group to this container. If the object is already contained within the list, it will not be re-added.- Parameters:
subGroup- the child favorites group- Throws:
ServiceExceptionRemoteException
-
insertFavoritesGroup
void insertFavoritesGroup(FavoritesGroup subGroup, int index) throws ServiceException, RemoteException Inserts a new child group to this container at the specified index. If the object is already contained within the list, it will not be re-added.- Parameters:
subGroup- the child favorites groupindex- the index where the group should be added- Throws:
ServiceExceptionRemoteException
-
removeFavoritesGroup
Removes the specified object from the list favorites groups.Important: Removing the favorites group will remove the object from its association with its parent container. This will essentially leave the group orphaned, but it will not delete it from the metadata server. The group will need to be either deleted or re-added to another (or same) favorites container.
- Parameters:
subGroup- the child favorites group- Throws:
ServiceExceptionRemoteException
-
removeAllFavoritesGroups
Removes all existing child favorite groups from this particular container.Important: Removing the favorites group will remove the object from its association with its parent container. This will essentially leave the group orphaned, but it will not delete it from the metadata server. The group will need to be either deleted or re-added to another (or same) favorites container.
- Throws:
ServiceExceptionRemoteException
-
removeAll
Clears the container by removing all favorites and favorites groups, recursively.- Throws:
ServiceExceptionRemoteException
-
hasDuplicateFavoritesGroup
Check if there's a duplicate favorites group in this container with the same name.- Parameters:
name- the name to check for.- Returns:
- true if this container has a favorites group with the given name, false otherwise.
- Throws:
ServiceExceptionRemoteException
-
setMaxCapacity
Sets the maximum number of favorites allowed to be contained within this folder at a given time. This method is typically used for favorites containers that are used in a history based context.If an object is added as a favorite such that it exceeds the capacity settings, the favorites container will remove the oldest value. This way the container will never contain more objects than what's specified by the capacity. If the capacity is set to a lesser value than the current number of favorites, the list of favorites will be trimmed (by removing the oldest favorite) until the size matches the maximum capacity.
- Parameters:
capacity- the maximum capacity of favorites allowed in this container- Throws:
ServiceExceptionRemoteException
-
getMaxCapacity
Returns the maximum number of favorites allowed under this container.- Returns:
- the maximum capactiy of favorites.
- Throws:
ServiceExceptionRemoteException
-
moveFavorite
void moveFavorite(MetadataInterface favorite, int newPosition) throws ServiceException, RemoteException Deprecated.Moves an existing favorite to the specified location.- Parameters:
favorite- the favorite itemnewPosition- the new position to move the item to- Throws:
IllegalArgumentException- if the object does not exist within this containerServiceExceptionRemoteException
-