本文整理汇总了Java中org.alfresco.service.cmr.repository.StoreRef.STORE_REF_ARCHIVE_SPACESSTORE属性的典型用法代码示例。如果您正苦于以下问题:Java StoreRef.STORE_REF_ARCHIVE_SPACESSTORE属性的具体用法?Java StoreRef.STORE_REF_ARCHIVE_SPACESSTORE怎么用?Java StoreRef.STORE_REF_ARCHIVE_SPACESSTORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.alfresco.service.cmr.repository.StoreRef
的用法示例。
在下文中一共展示了StoreRef.STORE_REF_ARCHIVE_SPACESSTORE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStoreRef
/**
* Work out which StoreRef this store belongs to.
* @param String representing a store
* @return StoreRef
*/
public StoreRef getStoreRef(String store)
{
if (store != null && !store.isEmpty())
{
switch (store.toLowerCase())
{
case LIVE_NODES:
return StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
case VERSIONS:
return STORE_REF_VERSION2_SPACESSTORE;
case DELETED:
return StoreRef.STORE_REF_ARCHIVE_SPACESSTORE;
case HISTORY:
return STORE_REF_HISTORY;
}
}
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": scope allowed values: nodes,deleted-nodes,versions" });
}
示例2: executeImpl
/**
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
* org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
Set<NodeRef> nodeToTransfer = new HashSet<NodeRef>();
nodeToTransfer.add(actionedUponNodeRef);
TransferDefinition transferDef = new TransferDefinition();
transferDef.setNodes(nodeToTransfer);
//setting sync to true to generate the delete
//transferDef.setSync(true);
if (!transferService.targetExists(TARGET_NAME))
{
TransferTargetImpl newTarget = new TransferTargetImpl();
newTarget.setEndpointProtocol("http");
newTarget.setEndpointHost("localhost");
newTarget.setEndpointPort(9090);
newTarget.setEndpointPath("/alfresco-ftr/service/api/transfer");
newTarget.setName(TARGET_NAME);
newTarget.setTitle("FTR test title target");
newTarget.setUsername("phil");
newTarget.setPassword("phil".toCharArray());
transferService.saveTransferTarget(newTarget);
// get the created target and define the root
// the root is implicitly defined has the root of the current node.
// get underlying node ref corresponding to the target definition
NodeRef transferTargetNodeRef = transferService.getTransferTarget(TARGET_NAME).getNodeRef();
// Get the primary parent of the node the action is execute up on
NodeRef rooTarget = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
//Set the type to "fileTransferTarget" to transferTargetNodeRef and associate it to the root
nodeService.setType(transferTargetNodeRef, TransferModel.TYPE_FILE_TRANSFER_TARGET);
// create the association
nodeService.createAssociation(transferTargetNodeRef, rooTarget, TransferModel.ASSOC_ROOT_FILE_TRANSFER);
}
fileFolderService.delete(actionedUponNodeRef);
transferService.transfer(TARGET_NAME, transferDef, (Collection<TransferCallback>) null);
//just simulate, therefore restore the node.
NodeRef archivedNode = new NodeRef(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE,actionedUponNodeRef.getId());
nodeService.restoreNode(archivedNode, null,null, null);
}
开发者ID:Alfresco,项目名称:alfresco-file-transfer-receiver,代码行数:43,代码来源:DeleteFileTransferActionExecuter.java
示例3: processNode
protected void processNode(TransferManifestNormalNode node)
{
if (log.isDebugEnabled())
{
log.debug("Processing node with incoming noderef of " + node.getNodeRef());
}
logComment("Primary Processing incoming node: " + node.getNodeRef() + " -- Source path = " + node.getParentPath() + "/" + node.getPrimaryParentAssoc().getQName());
ChildAssociationRef primaryParentAssoc = node.getPrimaryParentAssoc();
if (primaryParentAssoc == null)
{
error(node, MSG_NO_PRIMARY_PARENT_SUPPLIED);
}
CorrespondingNodeResolver.ResolvedParentChildPair resolvedNodes = nodeResolver.resolveCorrespondingNode(node
.getNodeRef(), primaryParentAssoc, node.getParentPath());
// Does a corresponding node exist in this repo?
if (resolvedNodes.resolvedChild != null)
{
if (log.isTraceEnabled())
{
log.trace("REPO_PRIMARY_MANIFEST_PROCESSOR - node DOES exist!");
logInvasionHierarchy(resolvedNodes.resolvedParent, resolvedNodes.resolvedChild, nodeService, log);
}
// Yes, the corresponding node does exist. Update it.
if (log.isDebugEnabled())
{
log.debug("Incoming noderef " + node.getNodeRef() + " has been resolved to existing local noderef "
+ resolvedNodes.resolvedChild);
}
update(node, resolvedNodes, primaryParentAssoc);
if (log.isTraceEnabled())
{
log.trace("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
}
}
else
{
// No, there is no corresponding node.
NodeRef archiveNodeRef = new NodeRef(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, node.getNodeRef().getId());
if (nodeService.exists(archiveNodeRef))
{
// We have found a node in the archive store that has the same
// UUID as the one that we've been sent. If it remains it may cause problems later on
// We delete from the archive store and treat the new node as a create.
if (log.isInfoEnabled())
{
log.info("Located an archived node with UUID matching transferred node: " + archiveNodeRef);
log.info("Attempting to restore " + archiveNodeRef);
}
logComment("Delete node from archive: " + archiveNodeRef);
nodeService.deleteNode(archiveNodeRef);
}
if (log.isDebugEnabled())
{
log.debug("Incoming noderef has no corresponding local noderef: " + node.getNodeRef());
}
if (log.isTraceEnabled())
{
log.trace("REPO_PRIMARY_MANIFEST_PROCESSOR - node DOES NOT esist yet! Name: '" + node.getProperties().get(ContentModel.PROP_NAME) + "', parentPath: '"
+ node.getParentPath() + "'");
}
create(node, resolvedNodes, primaryParentAssoc);
if (log.isTraceEnabled())
{
log.trace("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
}
}
}