Class NavigationClassicConnectorService
java.lang.Object
com.saperion.ngc.model.ClassicConnectorService
com.saperion.ngc.model.navigation.NavigationClassicConnectorService
- All Implemented Interfaces:
NavigationService
,Service
public class NavigationClassicConnectorService
extends ClassicConnectorService
implements NavigationService
Navigation service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Tree parts. -
Field Summary
Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
Fields inherited from interface com.saperion.ngc.model.navigation.NavigationService
NO_LIMIT_MAX_NR_OF_NODES_PER_LEVEL
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DefClassicConnectorService.Constructor - used for mock tests. -
Method Summary
Modifier and TypeMethodDescriptionaddFavoriteFolder
(String name, Properties props, String content) Adds a new node to the favorite folder with the given name, properties and content.addFolder
(NavigationNode node, String childName, com.saperion.constants.SaFolderConstants.FOLDER_TYPE nodeType, Properties properties) Adds a folder with the given name to the node and returns the result containing the new child.addLinkFolder
(NavigationNode node, String childName, FolderId destination) Adds a link folder with the given name to the node and returns the result containing the new child.void
addToFolder
(Set<FolderId> folderIds, Set<DocumentId> documentIDs) Adds documents to the specified folders.addWebpartFolder
(NavigationNode node, String childName, String destination) Adds a webpart folder with the given name to the node and returns the result containing the new child.copyFolder
(FolderId folderId, NavigationNode destinationNode, FolderId beforeChildId, boolean withDocuments) Copies a folder to the specified location.void
deleteFolder
(NavigationNode node) Deletes the given folder.void
Deletes the folder identified by the specified id.getBoxCount
(int boxId) Deprecated.com.saperion.wf.BoxCount
getBoxTotalAndUnreadCount
(int boxId, WorkflowNodeInfo.Filter boxFilter) Returns the count of all elements and of all unread elements in the given box.getBoxTotalAndUnreadCounts
(Set<Integer> boxIds) Returns the count of all elements and of all unread elements in the given boxes.long
Retrieves the count over all folders the document is contained in.Retrieves the folders that contain the specified document.getFolderAcl
(FolderId folderId) Gets ACL for folder.Search a folder by id.final FolderNode
getFolderByPath
(String ddc, String path) Search a folder by path.Retrieves the children of the folder identified by the specified id.getFolderClass
(String className) Returns the folder class with the specified name or null if no such class exists.getFolderClassesForDDC
(String ddcName, com.saperion.constants.SaFolderConstants.CLASS_TYPE classType) Returns all folder classes of a certain type that can be used for the specified DDC.Retrieves information about the specified folder.Reads all folder table names.final NavigationTree
getFolderTree
(FolderId root, com.saperion.rmi.SaQueryInfo filter) Generates a folder tree stated at. Set<com.saperion.folder.FolderUpdateInfo>
getFolderUpdateInfo
(Map<String, Long> folderIds) Get Set of folders to refresh on client side.int
Reads the inbox id for the current user.final com.saperion.ngc.iform.xml.Form
getMaskDefinition
(String maskName) Retrieves the mask definition with the given name.com.saperion.ngc.iform.xml.Form
getMaskDefinition
(String maskName, boolean ignoreCompatibility) Retrieves the mask definition with the given name.final NavigationTree
getNavigationTree
(String folderDDC, com.saperion.rmi.SaQueryInfo filter) Returns the navigation tree.getNextLevelFolders
(NavigationNode node, com.saperion.rmi.SaQueryInfo filter, int allowedMaxNrOfNodesPerLevel) Returns the folders of the next level.com.saperion.wf.BoxCount
Returns the number or read and unread tasks for the current user.final NavigationNode
getWorkflowNodes
(NavigationNode navigationNode) Reads the workflow tree part.boolean
void
moveFolder
(FolderId folderId, FolderId targetFolderId, FolderId beforeFolderId) Moves folder.void
removeFromFolder
(Set<FolderId> folderSysRowIds, DocumentId documentId) Removes the specified document from a folder.renameFolder
(NavigationNode node, String name) Renames folder.final FolderId
resolveLink
(FolderId linkId) Resolves a link folder and returns the link destination.void
setFolderAcl
(FolderId folderId, String acl) Sets ACL for folder.void
storeMaskDefinition
(String maskName, com.saperion.ngc.iform.xml.Form mask) Deprecated.method no longer supportedvoid
updateFolder
(FolderId id, Properties nameValuePairs) Updates the properties of a folder.Methods inherited from class com.saperion.ngc.model.ClassicConnectorService
convertAuthenticationException, getCachedDDC, getConnectionProvider, getCurrentUserFromSession, getSession, getWfConnectionProvider, isActive
-
Constructor Details
-
NavigationClassicConnectorService
public NavigationClassicConnectorService()Creates a new DefClassicConnectorService. -
NavigationClassicConnectorService
Constructor - used for mock tests.- Parameters:
conProvider
- Connection provider
-
-
Method Details
-
getMaskDefinition
public final com.saperion.ngc.iform.xml.Form getMaskDefinition(String maskName) throws SystemException, UnsupportedFormException, AuthenticationException Retrieves the mask definition with the given name.- Specified by:
getMaskDefinition
in interfaceNavigationService
- Parameters:
maskName
- Mask definition name- Returns:
- Form
- Throws:
SystemException
- system exceptionUnsupportedFormException
- when the form can not be used in WebClientAuthenticationException
- authentication exception- See Also:
-
getMaskDefinition
public com.saperion.ngc.iform.xml.Form getMaskDefinition(String maskName, boolean ignoreCompatibility) throws SystemException, UnsupportedFormException, AuthenticationException Retrieves the mask definition with the given name. If ignoreCompatibility is set to true, masks that are not compatible with web client are returened, too.- Specified by:
getMaskDefinition
in interfaceNavigationService
- Parameters:
maskName
- Mask definition nameignoreCompatibility
- if true, masks that are not compatible with the web client are returned- Returns:
- Form
- Throws:
SystemException
- system exceptionUnsupportedFormException
- when the form can not be used in WebClientAuthenticationException
- authentication exception- See Also:
-
storeMaskDefinition
@Deprecated public void storeMaskDefinition(String maskName, com.saperion.ngc.iform.xml.Form mask) throws jakarta.xml.bind.JAXBException Deprecated.method no longer supportedStores the given form as mask with the given name.- Specified by:
storeMaskDefinition
in interfaceNavigationService
- Parameters:
maskName
- Mask namemask
- Mask form- Throws:
jakarta.xml.bind.JAXBException
- JAXBException- See Also:
-
getInboxId
Reads the inbox id for the current user.- Specified by:
getInboxId
in interfaceNavigationService
- Returns:
- Inbox id
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getBoxCount
@Deprecated public Long getBoxCount(int boxId) throws com.saperion.exception.SaAuthenticationException, com.saperion.exception.SaSystemException Deprecated.usegetBoxTotalAndUnreadCount(int, Filter)
insteadLoads and returns the box count for the given box.- Specified by:
getBoxCount
in interfaceNavigationService
- Parameters:
boxId
- The if of the box to get the cout from.- Returns:
- the number of box workflow items.
- Throws:
com.saperion.exception.SaAuthenticationException
- If an authentication exception occurs.com.saperion.exception.SaSystemException
- If a system exception occurs.- See Also:
-
getBoxTotalAndUnreadCounts
public Map<Integer,com.saperion.wf.BoxCount> getBoxTotalAndUnreadCounts(Set<Integer> boxIds) throws com.saperion.exception.SaAuthenticationException, com.saperion.exception.SaSystemException Returns the count of all elements and of all unread elements in the given boxes.- Specified by:
getBoxTotalAndUnreadCounts
in interfaceNavigationService
- Parameters:
boxIds
- The if of the box to get the cout from.- Returns:
- the number of all elements and of all unread element
- Throws:
com.saperion.exception.SaAuthenticationException
- If an authentication exception occurs.com.saperion.exception.SaSystemException
- If a system exception occurs.- See Also:
-
getFolderTree
public final NavigationTree getFolderTree(FolderId root, com.saperion.rmi.SaQueryInfo filter) throws NavigationException, AuthenticationException, SystemException, DatabaseException, UnknownFolderTypeException Generates a folder tree stated at. - Specified by:
getFolderTree
in interfaceNavigationService
- Parameters:
root
- Root nodefilter
- Filter object- Returns:
- Folder tree
- Throws:
NavigationException
- navigation exceptionAuthenticationException
- Authentication exceptionSystemException
- system exceptionDatabaseException
- database exceptionUnknownFolderTypeException
- when a folder with an unknown type is found- See Also:
-
getFolderByPath
public final FolderNode getFolderByPath(String ddc, String path) throws NavigationException, AuthenticationException, SystemException, DatabaseException, UnknownFolderTypeException Search a folder by path.- Specified by:
getFolderByPath
in interfaceNavigationService
- Parameters:
ddc
- folder ddcpath
- Absolute path- Returns:
- FolderNode or null, if not found.
- Throws:
NavigationException
- navigation exceptionAuthenticationException
- Authentication exceptionSystemException
- system exceptionDatabaseException
- database exceptionUnknownFolderTypeException
- when a folder with an unknown type is found- See Also:
-
getFolderById
public FolderNode getFolderById(FolderId id) throws AuthenticationException, SystemException, NavigationException, DatabaseException, UnknownFolderTypeException Search a folder by id.- Specified by:
getFolderById
in interfaceNavigationService
- Parameters:
id
- folder id- Returns:
- folder node or null, if not found
- Throws:
AuthenticationException
- Authentication exceptionSystemException
- system exceptionNavigationException
- navigation exceptionDatabaseException
- database exceptionUnknownFolderTypeException
- when a folder with an unknown type is found- See Also:
-
resolveLink
public final FolderId resolveLink(FolderId linkId) throws NavigationException, AuthenticationException Resolves a link folder and returns the link destination.- Specified by:
resolveLink
in interfaceNavigationService
- Parameters:
linkId
- Link folder id- Returns:
- Destination folder id
- Throws:
NavigationException
- navigation exceptionAuthenticationException
- Authentication exception- See Also:
-
moveFolder
public void moveFolder(FolderId folderId, FolderId targetFolderId, FolderId beforeFolderId) throws FolderMoveException, DuplicateFolderException Moves folder.- Specified by:
moveFolder
in interfaceNavigationService
- Parameters:
folderId
- folder idtargetFolderId
- target folderbeforeFolderId
- before folder- Throws:
FolderMoveException
- if moving failed or is not allowedDuplicateFolderException
- if a node with the same name already exists- See Also:
-
addFavoriteFolder
public FolderId addFavoriteFolder(String name, Properties props, String content) throws AuthenticationException, SystemException, DatabaseException, UnknownFolderTypeException, InvalidFolderNameException Adds a new node to the favorite folder with the given name, properties and content.- Specified by:
addFavoriteFolder
in interfaceNavigationService
- Parameters:
name
- Folder nameprops
- Propertiescontent
- Content- Returns:
- Folder id
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exceptionDatabaseException
- database exceptionUnknownFolderTypeException
- when a folder with an unknown type is foundInvalidFolderNameException
- when the folder name contained an invalid character- See Also:
-
addToFolder
public void addToFolder(Set<FolderId> folderIds, Set<DocumentId> documentIDs) throws SystemException, AuthenticationException, DatabaseException, NavigationException Adds documents to the specified folders.- Specified by:
addToFolder
in interfaceNavigationService
- Parameters:
folderIds
- folder idsdocumentIDs
- ids of documents- Throws:
DatabaseException
SystemException
- system exceptionAuthenticationException
- authentication exceptionNavigationException
- navigation exception- See Also:
-
removeFromFolder
public void removeFromFolder(Set<FolderId> folderSysRowIds, DocumentId documentId) throws SystemException, AuthenticationException Removes the specified document from a folder.- Specified by:
removeFromFolder
in interfaceNavigationService
- Parameters:
folderSysRowIds
- folders to remove fromdocumentId
- ID of document to remove- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getDocumentFolders
public List<FolderId> getDocumentFolders(DocumentId id) throws SystemException, AuthenticationException Retrieves the folders that contain the specified document.- Specified by:
getDocumentFolders
in interfaceNavigationService
- Parameters:
id
- document's id- Returns:
- list of folder document infos
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getDocumentFolderCount
Retrieves the count over all folders the document is contained in.- Specified by:
getDocumentFolderCount
in interfaceNavigationService
- Parameters:
id
- document's id- Returns:
- folder count
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
setFolderAcl
public void setFolderAcl(FolderId folderId, String acl) throws SystemException, AuthenticationException Sets ACL for folder.- Specified by:
setFolderAcl
in interfaceNavigationService
- Parameters:
folderId
- folderIdacl
- set of ACL names- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getFolderAcl
Gets ACL for folder.- Specified by:
getFolderAcl
in interfaceNavigationService
- Parameters:
folderId
- folderId- Returns:
- list of ACL names
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getFolderTables
Reads all folder table names.- Specified by:
getFolderTables
in interfaceNavigationService
- Returns:
- List of folder table names
- Throws:
SystemException
- System exceptionAuthenticationException
- authentication exception- See Also:
-
hasFolder
- Specified by:
hasFolder
in interfaceNavigationService
- Parameters:
folderId
- Folder ID- Returns:
- True, if folder exists.
- Throws:
SystemException
- System exceptionAuthenticationException
- authentication exception- See Also:
-
getFolderInfo
public FolderInfo getFolderInfo(FolderId id) throws SystemException, AuthenticationException, DatabaseException, NavigationException Retrieves information about the specified folder.- Specified by:
getFolderInfo
in interfaceNavigationService
- Parameters:
id
- folder id- Returns:
- folder info
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exceptionNavigationException
- navigation exception- See Also:
-
updateFolder
public void updateFolder(FolderId id, Properties nameValuePairs) throws SystemException, AuthenticationException, DatabaseException Updates the properties of a folder.- Specified by:
updateFolder
in interfaceNavigationService
- Parameters:
id
- id of the folder to updatenameValuePairs
- properties to update- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exception- See Also:
-
getFolderClass
public FolderClass getFolderClass(String className) throws SystemException, AuthenticationException, DatabaseException Returns the folder class with the specified name or null if no such class exists.- Specified by:
getFolderClass
in interfaceNavigationService
- Parameters:
className
- class name- Returns:
- folder class or null if not found
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exception- See Also:
-
getFolderClassesForDDC
public Set<FolderClass> getFolderClassesForDDC(String ddcName, com.saperion.constants.SaFolderConstants.CLASS_TYPE classType) throws SystemException, AuthenticationException Returns all folder classes of a certain type that can be used for the specified DDC.- Specified by:
getFolderClassesForDDC
in interfaceNavigationService
- Parameters:
ddcName
- DDC nameclassType
- the type of class to search for- Returns:
- set of folder classes
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
deleteFolderById
public void deleteFolderById(FolderId id) throws SystemException, AuthenticationException, DatabaseException, NavigationException Deletes the folder identified by the specified id.- Specified by:
deleteFolderById
in interfaceNavigationService
- Parameters:
id
- folder id- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exceptionNavigationException
- navigation exception- See Also:
-
getFolderChildren
public List<FolderInfo> getFolderChildren(FolderId id) throws SystemException, AuthenticationException, DatabaseException, NavigationException Retrieves the children of the folder identified by the specified id. Only the direct descendants of the node are returned.- Specified by:
getFolderChildren
in interfaceNavigationService
- Parameters:
id
- folder id- Returns:
- list of children
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exceptionNavigationException
- navigation exception- See Also:
-
getFolderUpdateInfo
public Set<com.saperion.folder.FolderUpdateInfo> getFolderUpdateInfo(Map<String, Long> folderIds) throws SystemException, AuthenticationExceptionGet Set of folders to refresh on client side.- Specified by:
getFolderUpdateInfo
in interfaceNavigationService
- Parameters:
folderIds
- Map of SYSROWIDs with time stamps of last refresh to check.- Returns:
- Set of folders that shall be refreshed.
- Throws:
SystemException
- general errorAuthenticationException
- error on the authentification / insufficient rights- See Also:
-
getTaskCounts
Returns the number or read and unread tasks for the current user. The count is created by summing up the counts of all workflow boxes.- Specified by:
getTaskCounts
in interfaceNavigationService
- Returns:
- global count
- Throws:
AuthenticationException
- not logged in or not allowedSystemException
- system error when checking for tasks- See Also:
-
getBoxTotalAndUnreadCount(int, Filter)
instead