Package com.saperion.connector.rmi
Class AbstractFolderRMIClientCommand
java.lang.Object
com.saperion.connector.rmi.AbstractRMIClientCommand
com.saperion.connector.rmi.AbstractFolderRMIClientCommand
- All Implemented Interfaces:
SaRMIClientCommand
- Direct Known Subclasses:
AbstractDocRMIClientCommand
Class representing the folder operations of the backend.
-
Field Summary
Fields inherited from class com.saperion.connector.rmi.AbstractRMIClientCommand
APPEND_CONTENT, appl, credentials, LOGGER, props, session, sessionInfo, sysConnector, writeBufferSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToFolder
(String folderTableDDC, String documentId, String documentDDC, String folderId) Adds the document to a given folder.copyFolder
(String folderTableDDC, String folderId, String destinationId, String beforeChild, boolean withDocuments) Copies the given node and all it’s children to the destination.createFolder
(SaFolderSaveInfo info) Creates a new node below a given node.void
deleteFolder
(String folderTableDDC, String folderId) Deletes a given node.long
getDocumentFolderCount
(String folderTableDDC, String documentDDC, String sysRowId) Returns the total count over all folders from all users in which the specified document is countained in.getDocumentFolders
(String folderTableDDC, String documentDDC, String sysRowId) Returns a list of folder properties which contains all nodes the document is contained in.getFolderChildren
(String folderTableDDC, String folderId, int depth, SaQueryInfo filter, int allowedMaxNrOfChildFoldersPerLevel) Returns a cursor with the children of the given node.getFolderClass
(String className) Reads the folder class with the given name.getFolderFromPath
(String folderTableDDC, String startNodeId, String folderPath, boolean exact) Returns the node(s) which match to the given path.getFolderInfo
(String folderTableDDC, String folderId, boolean forceLoadVariables) Reads the folder info object for the given folder.getFolderParent
(String folderTableDDC, String folderId) Returns the parent of the given node.getFolderRights
(String folderTableDDC, String folderId) Returns the rights mask for the given folder and user.getFolderUpdateInfo
(Map<String, Long> folderIds) Get the Set of folders that shall be refreshed.void
moveFolder
(String folderTableDDC, String folderId, String destinationId, String beforeChild) Moves the given node to a new destination.void
moveToFolder
(String folderTableDDC, String documentId, String documentDDC, String folderId, String destinationId) Moves the document’s filing to the given node.void
removeFromFolder
(String folderTableDDC, String documentSysRowId, String documentDDC, String folderId) Remove the document filing from the given node.searchFolderClass
(SaFolderClassSearchInfo searchInfo) Searches for folder classes with the specified properties.searchFolderDocuments
(String folderTableDDC, String folderId, SaQueryInfo hqlFilter) HQL search extended with additional folder informations and depth.void
setFolderAcl
(String folderTableDDC, String folderId, String aclName) Sets an ACL for the given folder.void
updateFolder
(String folderTableDDC, String folderId, List<SaPropertyValue> values) Updates a given node with the given properties.Methods inherited from class com.saperion.connector.rmi.AbstractRMIClientCommand
getRemoteCommand, init, reLogon, reLogonAfterConnectionFailure
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.saperion.connector.rmi.SaRMIClientCommand
addComment, addHistory, cacheDocument, changePassword, checkoutDocument, checkoutDocument, checkSapUrl, clearContent, closeDocument, closeSession, createDocument, createExternalStorageFolderMapping, createLink, deleteDocument, deleteExternalStorageFolderMapping, deleteSetting, discardDocument, dsicardCheckout, executeCommand, finishSQLTransaction, finishTransaction, getACLNames, getACLRights, getAcls, getAllACLs, getAnnotations, getArchivedSize, getAuthorizedUsers, getBoxCount, getBoxDefinitions, getCommandInfos, getCommandInfos, getCommentInfos, getCommitMode, getCompleteHistoryInfos, getCurrentUserRole, getDDC, getDeleteMode, getEventsEnabled, getExternalStorageFoldersForUpload, getExternalStorageFoldersForUpload, getExternalStorageMapping, getFeatures, getFieldDescriptions, getFieldDescriptions, getFulltext, getFullTextFields, getHDocForSysRowId, getHistoryInfos, getIdsFromQuery, getInvolvedUsers, getLicenseCount, getLockInfo, getLocks, getLocks, getMandant, getMember, getMembers, getNodeAccessData, getOutOfOffice, getParentTask, getRealDBName, getRMIVersion, getServerInfos, getSession, getSetting, getStringQueryResult, getSubstitute, getSystemConnector, getSystemFiles, getSystemInfo, getSystemSetting, getTask, getTaskAuditList, getTaskList, getThumbnail, getToken, getUserIdsForQuery, getUsers, getUserSetting, getVersionList, getWorkflowDefinitions, invoke, isAlive, isRevisionEnabled, listActiveSessions, loadDDCNames, loadFolderDDCNames, loadSettings, loadSystemFile, loadWorkflowDDCName, lockNode, logClientEvent, logoff, logon, logon, logon, newInvoke, readDocumentFirst, readDocumentFirst, readDocumentMetadata, readDocumentNext, readVersionMetadata, readVersionMetadata, releaseDocument, removeElement, removeElement, resolveLatestHdoc, restoreVersion, saveDocument, saveDocument, searchSettings, sendBarcode, setACLName, setAnnotations, setElementMark, setEventsEnabled, setLocale, setOutOfOffice, setSetting, setSubstitute, setUsedLicense, setUserSetting, setVariables, startSQLTransaction, startTransaction, storeDocument, storeDocument, storeSystemFile, unlockNode, updateExternalStorageUploadStatus, writeContent, writeContent, writeContent, writeContent
-
Constructor Details
-
AbstractFolderRMIClientCommand
public AbstractFolderRMIClientCommand()
-
-
Method Details
-
addToFolder
public void addToFolder(String folderTableDDC, String documentId, String documentDDC, String folderId) throws SaSystemException, SaAuthenticationException, SaDDCException, SaSetNodeException Adds the document to a given folder. A document can be filed in multiple folders, but each filing operation must be called separately.- Parameters:
folderTableDDC
- Folder tabledocumentId
- Document SysRowIddocumentDDC
- Document DDC namefolderId
- Destination folder ID- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exceptionSaSetNodeException
- Document is not fileable- See Also:
-
copyFolder
public String copyFolder(String folderTableDDC, String folderId, String destinationId, String beforeChild, boolean withDocuments) throws SaSystemException, SaAuthenticationException, SaDDCException Copies the given node and all it’s children to the destination. Note that only real children are copied, so links are not followed. Document filings can optionally be copied too, however this is an expensive operation, as each document has to be updated.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDdestinationId
- Destination folder IDbeforeChild
- Child ID or empty for appendwithDocuments
- True, if documents should be copied- Returns:
- new folder id
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
createFolder
public String createFolder(SaFolderSaveInfo info) throws SaSystemException, SaAuthenticationException, SaDDCException Creates a new node below a given node. The parent node can be the root node (empty id).- Parameters:
info
- Folder save info- Returns:
- Folder ID
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
deleteFolder
public void deleteFolder(String folderTableDDC, String folderId) throws SaSystemException, SaAuthenticationException, SaDDCException Deletes a given node. It must not have children or filed document, i.e. the user must delete/remove all these before deleting the node.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder ID- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception
-
getDocumentFolders
public List<SaDocumentInfo> getDocumentFolders(String folderTableDDC, String documentDDC, String sysRowId) throws SaSystemException, SaAuthenticationException, SaDDCException, SaSetNodeException Returns a list of folder properties which contains all nodes the document is contained in. The list is returned only for one node table, so if the document is filed in multiple node tables, this must be queried separately.- Parameters:
folderTableDDC
- Folder tabledocumentDDC
- Document DDCsysRowId
- Document sysrowid- Returns:
- List of folder properties
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exceptionSaSetNodeException
- Document is not fileable- See Also:
-
getDocumentFolderCount
public long getDocumentFolderCount(String folderTableDDC, String documentDDC, String sysRowId) throws SaSystemException, SaAuthenticationException, SaDDCException, SaSetNodeException Returns the total count over all folders from all users in which the specified document is countained in.- Parameters:
folderTableDDC
- Folder tabledocumentDDC
- Document DDCsysRowId
- Document sysrowid- Returns:
- folder count
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exceptionSaSetNodeException
- Document is not fileable- See Also:
-
getFolderChildren
public List<SaDocumentInfo> getFolderChildren(String folderTableDDC, String folderId, int depth, SaQueryInfo filter, int allowedMaxNrOfChildFoldersPerLevel) throws SaSystemException, SaAuthenticationException, SaDBException, SaFolderException Returns a cursor with the children of the given node. The function accepts a depth parameter. In case of a depth greater than one, the returned nodes are ordered in a depth-first order, and the caller must detect parent-child relationship with the appropriate fields (SysParentID, SysRowID). Note that searching with a depth greater than one is not a fast operation. It is recommended to use depth = 1 and only load further levels on demand if required. The allowedMaxNrOfChildFolders parameter is used to restrict the absolute number of hits loaded from the database. It is intended to be used to protect the system from overload problems caused by very large query-results. The depth-filtering is done after the query has returned from the database. So keep in mind that children found on deeper levels than specified in the depth-parameter are relevant for the total number of children found.
The default value for allowedMaxNrOfChildFolders can be configured with the setting rmi.getfolderchildren.maxresults in saperion.properties of JavaCoreServer. When this setting is set to a value > 0, it is not possible to search for an unlimited number of child nodes by passing a value of -1 for this parameter.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDdepth
- Depthfilter
- Additional HQL filter criteriaallowedMaxNrOfChildFoldersPerLevel
- allowed maximum number of results- Returns:
- List of folder information
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDBException
- Database exceptionSaFolderException
- Folder Exception- See Also:
-
getFolderInfo
public SaDocumentInfo getFolderInfo(String folderTableDDC, String folderId, boolean forceLoadVariables) throws SaSystemException, SaAuthenticationException, SaDBException, SaFolderException Reads the folder info object for the given folder.- Parameters:
forceLoadVariables
-folderTableDDC
- Folder tablefolderId
- Folder id- Returns:
- Folder info object
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDBException
- Database exceptionSaFolderException
- Folder Exception- See Also:
-
getFolderFromPath
public List<SaDocumentInfo> getFolderFromPath(String folderTableDDC, String startNodeId, String folderPath, boolean exact) throws SaSystemException, SaAuthenticationException, SaDBException Returns the node(s) which match to the given path. Path names are built using the SysFolderName field of each node. As path separator, the backslash ('\') is used. The path can be searched relative to a given node, to allow for searching within Personal folders and the like. If exact is set to false, the folderPath can contain wildcards (%). Searching with wildcards can be slow depending on the number of entries in the folder-table and the database in use.- Parameters:
folderTableDDC
- Folder tablestartNodeId
- Startnode ID or null/empty if no relative search is requiredfolderPath
- Search pathexact
- if true, the path will be matched using '='. If false, LIKE will be used.- Returns:
- Folder list
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDBException
- Database exception- See Also:
-
getFolderParent
public SaDocumentInfo getFolderParent(String folderTableDDC, String folderId) throws SaSystemException, SaAuthenticationException, SaDBException Returns the parent of the given node. Please note that in case of a node to which another node links, the real parent is returned, not the parent of the link.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder ID- Returns:
- Properties of the folder or null, if not found
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDBException
- Database exception- See Also:
-
getFolderRights
public SaDocAccessData getFolderRights(String folderTableDDC, String folderId) throws SaSystemException, SaAuthenticationException, SaDDCException Returns the rights mask for the given folder and user. The effective rights are calculated by using ACL inheritance.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder ID- Returns:
- Folder access data
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
moveFolder
public void moveFolder(String folderTableDDC, String folderId, String destinationId, String beforeChild) throws SaSystemException, SaAuthenticationException, SaDDCException Moves the given node to a new destination. Document filings are always moved with the node. This is not a quick operation, as path and security information must be updated.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDdestinationId
- Destination folder IDbeforeChild
- Child ID or empty for append- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
moveToFolder
public void moveToFolder(String folderTableDDC, String documentId, String documentDDC, String folderId, String destinationId) throws SaSystemException, SaAuthenticationException, SaDDCException Moves the document’s filing to the given node. It is removed from the original folder. Both source node and destination node must exist.- Parameters:
folderTableDDC
- Folder tabledocumentId
- Document SysRowIddocumentDDC
- Document DDC namefolderId
- Source folder IDdestinationId
- Destination folder ID- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
removeFromFolder
public void removeFromFolder(String folderTableDDC, String documentSysRowId, String documentDDC, String folderId) throws SaSystemException, SaAuthenticationException, SaDDCException Remove the document filing from the given node.- Parameters:
folderTableDDC
- Folder tabledocumentSysRowId
- Document SysRowIddocumentDDC
- Document DDC namefolderId
- Folder ID- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
searchFolderDocuments
public List<SaDocumentInfo> searchFolderDocuments(String folderTableDDC, String folderId, SaQueryInfo hqlFilter) throws SaSystemException, SaAuthenticationException, SaDDCException HQL search extended with additional folder informations and depth.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDhqlFilter
- HQL query for document tables. The DDC name must be defined as $DDC$.- Returns:
- List of documents from each involved DDC's
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
setFolderAcl
public void setFolderAcl(String folderTableDDC, String folderId, String aclName) throws SaSystemException, SaAuthenticationException, SaDDCException Sets an ACL for the given folder. The node’s SysACLUserList is recalculated, and if the node has children, the same is true for all the node’s children.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDaclName
- ACL name- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
updateFolder
public void updateFolder(String folderTableDDC, String folderId, List<SaPropertyValue> values) throws SaSystemException, SaAuthenticationException, SaDDCException Updates a given node with the given properties.- Parameters:
folderTableDDC
- Folder tablefolderId
- Folder IDvalues
- Values- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- Authentication errorSaDDCException
- Database exception- See Also:
-
getFolderClass
public SaFolderClass getFolderClass(String className) throws SaSystemException, SaAuthenticationException, SaDDCException Reads the folder class with the given name.- Parameters:
className
- Class name in dotted notation- Returns:
- Folder classs
- Throws:
SaSystemException
- Remote exceptionSaAuthenticationException
- authentication errorSaDDCException
- Database exception- See Also:
-
searchFolderClass
public Set<SaFolderClass> searchFolderClass(SaFolderClassSearchInfo searchInfo) throws SaSystemException, SaAuthenticationException Searches for folder classes with the specified properties.- Parameters:
searchInfo
- bean with properties to search for- Returns:
- set of classes that match the specified properties
- Throws:
SaSystemException
- system exceptionSaAuthenticationException
- authentication error- See Also:
-
getFolderUpdateInfo
public Set<FolderUpdateInfo> getFolderUpdateInfo(Map<String, Long> folderIds) throws SaSystemException, SaAuthenticationExceptionGet the Set of folders that shall be refreshed.- Parameters:
folderIds
- Map of SYSROWIDs with time stamps of last refresh to check.- Returns:
- Set of folders that shall be refreshed.
- Throws:
SaSystemException
- general errorSaAuthenticationException
- error on the authentification / insufficient rights- See Also:
-