Package org.alfresco.repo.node.archive
Interface NodeArchiveService
-
- All Known Implementing Classes:
NodeArchiveServiceImpl
public interface NodeArchiveServiceA service interface providing methods that map onto the low-level node restore functionality.Node stores may be mapped to an associated archive node store. For example, Alfresco ships with the mapping
workspace://SpacesStore.. maps to ..archive://SpacesStore.
When a node isdeletedfrom a regular workspace, it is moved to an archive store if there is a mapping.This service operates only on nodes that have been archived by either
- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description static org.alfresco.service.namespace.QNameQNAME_ARCHIVED_ITEMStatic 'sys:archivedItem' path for all archived nodes.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.alfresco.service.cmr.repository.NodeRefgetArchivedNode(org.alfresco.service.cmr.repository.NodeRef originalNodeRef)Get the likely node reference for the original node.org.alfresco.service.cmr.repository.NodeRefgetStoreArchiveNode(org.alfresco.service.cmr.repository.StoreRef originalStoreRef)Get the parent node that holds all nodes archived from the given store.booleanhasFullAccess(org.alfresco.service.cmr.repository.NodeRef nodeRef)Check if the current user has authority to access the archived node.org.alfresco.query.PagingResults<org.alfresco.service.cmr.repository.NodeRef>listArchivedNodes(ArchivedNodesCannedQueryBuilder cannedQueryBuilder)Get the archived nodes deleted by the current user.voidpurgeAllArchivedNodes(org.alfresco.service.cmr.repository.StoreRef originalStoreRef)Permanently delete all archived nodes.voidpurgeArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef)Permanently delete the archived node.voidpurgeArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodes)Permanently delete the archived nodes.RestoreNodeReportrestoreArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef)Attempt to restore the given archived node into its original location.RestoreNodeReportrestoreArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef, org.alfresco.service.cmr.repository.NodeRef destinationNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)Attempt to restore the given archived node into a new location.java.util.List<RestoreNodeReport>restoreArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodeRefs)Attempt to restore a list of archived nodes into their original locations, using the original association types and names.java.util.List<RestoreNodeReport>restoreArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodeRefs, org.alfresco.service.cmr.repository.NodeRef destinationNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)Attempt to restore a list of archived nodes into a new location.
-
-
-
Method Detail
-
getStoreArchiveNode
org.alfresco.service.cmr.repository.NodeRef getStoreArchiveNode(org.alfresco.service.cmr.repository.StoreRef originalStoreRef)
Get the parent node that holds all nodes archived from the given store.- Parameters:
originalStoreRef- the original store of the archived nodes. This is the store where the currently archived nodes could originally be found.- Returns:
- Returns the parent of the archived nodes, or null if archiving is not configured for the store
-
getArchivedNode
org.alfresco.service.cmr.repository.NodeRef getArchivedNode(org.alfresco.service.cmr.repository.NodeRef originalNodeRef)
Get the likely node reference for the original node. There is no guarantee that the node exists in the archive store.- Parameters:
originalNodeRef- the original node reference- Returns:
- Returns the node ref of the node if it was archived.
-
restoreArchivedNode
RestoreNodeReport restoreArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef)
Attempt to restore the given archived node into its original location.TRANSACTIONS: This method will execute in a new transaction.
- Parameters:
archivedNodeRef- the node's reference in the archive- Returns:
- Returns the results of the restore operation
-
restoreArchivedNode
RestoreNodeReport restoreArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef, org.alfresco.service.cmr.repository.NodeRef destinationNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
Attempt to restore the given archived node into a new location.TRANSACTIONS: This method will execute in a new transaction.
- Parameters:
archivedNodeRef- the node's reference in the archive. This must be valid.destinationNodeRef- the parent of the restored node, or null to use the original parent node referenceassocTypeQName- the type of the primary association to link the restored node to the destination parent, or null to use the orginal association typeassocQName- the name of the primary association to be created, or null to use the original association name- Returns:
- Returns the results of the restore operation
-
restoreArchivedNodes
java.util.List<RestoreNodeReport> restoreArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodeRefs)
Attempt to restore a list of archived nodes into their original locations, using the original association types and names.TRANSACTIONS: This method will execute in a new transaction.
- Parameters:
archivedNodeRefs- the nodes' references in the archive. These must be valid.- Returns:
- Returns the results of the each attempted restore operation
-
restoreArchivedNodes
java.util.List<RestoreNodeReport> restoreArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodeRefs, org.alfresco.service.cmr.repository.NodeRef destinationNodeRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName)
Attempt to restore a list of archived nodes into a new location.TRANSACTIONS: This method will execute in a new transaction.
- Parameters:
archivedNodeRefs- the nodes' references in the archive. These must be valid.destinationNodeRef- the parent of the restored nodes, or null to use the original parent node referencesassocTypeQName- the type of the primary associations to link the restored node to the destination parent, or null to use the orginal association typesassocQName- the name of the primary associations to be created, or null to use the original association names- Returns:
- Returns the results of the each attempted restore operation
-
purgeArchivedNode
void purgeArchivedNode(org.alfresco.service.cmr.repository.NodeRef archivedNodeRef)
Permanently delete the archived node.- Parameters:
archivedNodeRef- the archived node to delete.- See Also:
NodeService.deleteNode(NodeRef)
-
purgeArchivedNodes
void purgeArchivedNodes(java.util.List<org.alfresco.service.cmr.repository.NodeRef> archivedNodes)
Permanently delete the archived nodes.- Parameters:
archivedNodes- the archived nodes to delete.
-
purgeAllArchivedNodes
void purgeAllArchivedNodes(org.alfresco.service.cmr.repository.StoreRef originalStoreRef)
Permanently delete all archived nodes.- Parameters:
originalStoreRef- the store that the items originally came from
-
listArchivedNodes
org.alfresco.query.PagingResults<org.alfresco.service.cmr.repository.NodeRef> listArchivedNodes(ArchivedNodesCannedQueryBuilder cannedQueryBuilder)
Get the archived nodes deleted by the current user. If the current user is an Administrator, then all the deleted nodes are fetched.- Parameters:
cannedQueryBuilder- the object that holds the required and optional parameters to perform the canned query- Returns:
- the results of the attempted search
- Since:
- 4.2
-
hasFullAccess
boolean hasFullAccess(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Check if the current user has authority to access the archived node.- Parameters:
nodeRef- NodeRef- Returns:
- true if the currently authenticated user has authority to access the archived node, otherwise false.
-
-