public interface LibraryService
Important things to note:
Modifier and Type | Method and Description |
---|---|
void |
clearPermissions(Guid itemId,
boolean includeDescendants)
Clears the permissions on the given library item (and possibly on all of its descendants) meaning that the item
will inherit its permissions instead.
|
java.util.List<java.lang.String> |
copyFolders(java.util.List<java.lang.String> folders,
java.lang.String destinationFolder,
LibraryConflictResolution conflictResolution)
Copies the given folders to the given destination folder.
|
java.util.List<LibraryItem> |
copyItems(java.util.List<Guid> itemIds,
Guid destinationFolderId,
LibraryConflictResolution conflictResolution)
Copies the given items to the given destination folder.
|
LibraryItem |
createFolder(java.lang.String title,
java.lang.String description,
Guid parentId)
Creates a new folder.
|
java.util.List<LibraryItem> |
getChildItems(Guid folderId)
Returns all items (if any) within the given folder that the calling user has read access to.
|
java.util.List<LibraryItem> |
getChildItemsAsUser(Guid folderId,
UserName userName)
Returns all items (if any) within the given folder that the given user has read access to.
|
java.util.List<LibraryItem> |
getItems(java.util.List<Guid> itemIds)
Returns the items with the given IDs that the calling user has read access to.
|
java.util.List<LibraryItem> |
getItemsAsUser(java.util.List<Guid> itemIds,
UserName userName)
Returns the items with the given IDs that the given user has read access to.
|
java.util.List<java.lang.String> |
getItemTypes()
Returns all item types.
|
AclEntryCollection |
getPermissions(Guid itemId)
Returns the effective permissions of the given library item.
|
LibraryItem |
getRootItem()
Returns the root item.
|
java.lang.String |
idToPath(Guid itemId)
Returns the path to the given library item.
|
java.util.List<LibraryItem> |
moveItems(java.util.List<Guid> itemIds,
Guid destinationFolderId,
LibraryConflictResolution conflictResolution)
Moves the given items to the given destination folder.
|
Guid |
pathToId(java.lang.String path,
java.lang.String type)
Returns the ID of the item of the given type in the given location.
|
void |
removeItems(java.util.List<Guid> itemIds)
Removes the given items.
|
java.util.List<LibraryItem> |
searchItems(java.lang.String searchExpression,
Guid locationId,
int maxResults)
Returns all items, up to the given limit, in the given location that matches the given search expression.
|
java.util.List<LibraryItem> |
searchItemsAsUser(java.lang.String searchExpression,
Guid locationId,
int maxResults,
UserName userName)
Returns all items, up to the given limit, in the given location that matches the given search expression.
|
void |
setDescription(Guid itemId,
java.lang.String description)
Sets the description of the given library item.
|
void |
setPermissions(Guid itemId,
AclEntryCollection aclEntryCollection)
Sets the permissions on the given library item.
|
void |
setProperties(Guid itemId,
java.util.Collection<LibraryProperty> properties)
Sets the properties of the given library item.
|
void |
setTitle(Guid itemId,
java.lang.String title)
Sets the title of the given library item.
|
LibraryItem getRootItem() throws LibraryServiceException
LibraryServiceException
- if an unexpected error occursjava.util.List<LibraryItem> getChildItems(Guid folderId) throws LibraryServiceException
folderId
- the ID of the folder item to retrieve the child items ofLibraryServiceException
- if the folder item does not exist or isn't a folder or if an unexpected error
occursjava.util.List<LibraryItem> getChildItemsAsUser(Guid folderId, UserName userName) throws LibraryServiceException
folderId
- the ID of the folder item to retrieve the child items ofuserName
- the name of the user for which to retrieve the child items asLibraryServiceException
- if the folder item does not exist or isn't a folder or if an unexpected error
occursjava.util.List<LibraryItem> getItems(java.util.List<Guid> itemIds) throws LibraryServiceException
itemIds
- the IDs of the items to retrieveLibraryServiceException
- if an unexpected error occursjava.util.List<LibraryItem> getItemsAsUser(java.util.List<Guid> itemIds, UserName userName) throws LibraryServiceException
itemIds
- the IDs of the items to retrieveuserName
- the name of the user to retrieve items forLibraryServiceException
- if an unexpected error occursjava.util.List<LibraryItem> searchItems(java.lang.String searchExpression, Guid locationId, int maxResults) throws LibraryServiceException
searchExpression
- a library search expressionlocationId
- the ID of a folder item in which to search (all subfolders will also be included) or null if the
entire library should be searchedmaxResults
- the maximum number of items to be returned or a number less than or equal to 0 if all matching
items should be returnedLibraryServiceException
- if an unexpected error occursjava.util.List<LibraryItem> searchItemsAsUser(java.lang.String searchExpression, Guid locationId, int maxResults, UserName userName) throws LibraryServiceException
searchExpression
- a library search expressionlocationId
- the ID of a folder item in which to search (all subfolders will also be included) or null if the
entire library should be searchedmaxResults
- the maximum number of items to be returned or a number less than or equal to 0 if all matching
items should be returneduserName
- the name of the user to search asLibraryServiceException
- if an unexpected error occursjava.util.List<java.lang.String> getItemTypes() throws LibraryServiceException
The current set of available types:
LibraryServiceException
- if an unexpected error occursLibraryItem createFolder(java.lang.String title, java.lang.String description, Guid parentId) throws LibraryServiceException
title
- the title of the new folder, must not be null or an empty string and must not exceed 256 characters,
it also cannot contain any of the following characters: \ / : * ? " < > |description
- a description of the folder, may be null but must not exceed 1000 charactersparentId
- the ID of the parent item, or null if the item should be created directly under the rootLibraryServiceException
- if the title or the description is invalid, if the parent item doesn't exists, if a
folder with the same name in the same location already exists, if the calling user doesn't have write
access to the location or if an unexpected error occursvoid setTitle(Guid itemId, java.lang.String title) throws LibraryServiceException
itemId
- the ID of the library item to set the title for, must not be nulltitle
- the new title, must not be null or an empty string and must not exceed 256 characters, it also cannot
contain any of the following characters: \ / : * ? " < > |LibraryServiceException
- if the library item doesn't exist, if the title is invalid, if the calling user
doesn't have write access to the item or if an unexpected error occursvoid setDescription(Guid itemId, java.lang.String description) throws LibraryServiceException
itemId
- the ID of the library item to set the title for, must not be nulldescription
- the new description, must not exceed 1000 charactersLibraryServiceException
- if the library item doesn't exist, if the description is invalid, if the calling
user doesn't have write access to the item or if an unexpected error occursvoid setProperties(Guid itemId, java.util.Collection<LibraryProperty> properties) throws LibraryServiceException
itemId
- the ID of the library item to set the properties for, must not be nullproperties
- the set of new properties, may be null or empty but each key must not be null or empty or exceed
150 characters, each value must not be null or emptyLibraryServiceException
- if the library item doesn't exist, if any property key exceeds 150 characters, if
the calling user doesn't have write access to the item or if an unexpected error occursjava.util.List<LibraryItem> copyItems(java.util.List<Guid> itemIds, Guid destinationFolderId, LibraryConflictResolution conflictResolution) throws LibraryServiceException
itemIds
- the IDs of the library items to copydestinationFolderId
- the ID of the destination folder, must not be nullconflictResolution
- the conflict resolution algorithm to use on any ID or path conflicts, must not be nullLibraryServiceException
- if the destination folder or any of the items to be copied doesn't exist, if the
calling user doesn't have read access to any of the items or doesn't have write access to the destination
folder, or if an unexpected error occursjava.util.List<java.lang.String> copyFolders(java.util.List<java.lang.String> folders, java.lang.String destinationFolder, LibraryConflictResolution conflictResolution) throws LibraryServiceException
folders
- the paths of the library folders to copydestinationFolder
- the path of the destination folder, must not be null.conflictResolution
- the conflict resolution algorithm to use on any ID or path conflicts, must not be nullLibraryServiceException
- if any of the items to be copied doesn't exist, if the calling user doesn't have
read access to any of the folders or doesn't have write access to the destination folder, or if an
unexpected error occursjava.util.List<LibraryItem> moveItems(java.util.List<Guid> itemIds, Guid destinationFolderId, LibraryConflictResolution conflictResolution) throws LibraryServiceException
itemIds
- the IDs of the library items to movedestinationFolderId
- the ID of the destination folder, must not be nullconflictResolution
- the conflict resolution algorithm to use on any ID or path conflicts, must not be nullLibraryServiceException
- if the destination folder or any of the items to be moved doesn't exist, if the
calling user doesn't have read access to any of the items or doesn't have write access to the destination
folder, or if an unexpected error occursvoid removeItems(java.util.List<Guid> itemIds) throws LibraryServiceException
itemIds
- the IDs of the items to removeLibraryServiceException
- if the calling user doesn't have write access to any of the items or if an
unexpected error occursGuid pathToId(java.lang.String path, java.lang.String type) throws LibraryServiceException
path
- the location of the item, a path starts with a slash and each component is separated with a slash as
welltype
- the type of the itemLibraryServiceException
- if an unexpected error occursjava.lang.String idToPath(Guid itemId) throws LibraryServiceException
itemId
- the ID of the library item, must not be nullLibraryServiceException
- if the item doesn't exist, if the calling user doesn't have read access to the item
or if an unexpected error occursAclEntryCollection getPermissions(Guid itemId) throws LibraryServiceException
itemId
- the ID of the library item, must not be nullLibraryServiceException
- if the item doesn't exist, if the calling user doesn't have read access to the item
or if an unexpected error occursvoid setPermissions(Guid itemId, AclEntryCollection aclEntryCollection) throws LibraryServiceException
itemId
- the ID of the library item, must not be nullaclEntryCollection
- a collection of Access Control List (ACL) entries for the given item, each ACL entry must
have a principal name and at least one permissionLibraryServiceException
- if the item doesn't exist, if the calling user doesn't have owner access to the
item or if an unexpected error occursvoid clearPermissions(Guid itemId, boolean includeDescendants) throws LibraryServiceException
itemId
- the ID of the library item, must not be nullincludeDescendants
- true if the permissions on any descendants should be cleared as well, false otherwiseLibraryServiceException
- if the item doesn't exist, if the calling user doesn't have owner access to the
item or if an unexpected error occursCopyright © 2013-2020 TIBCO Software Inc. All Rights Reserved.