Merged V1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3876 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3925 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3927 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-09-26 00:02:52 +00:00
parent 7df3c602a1
commit d4c5c3562a
26 changed files with 1299 additions and 461 deletions

View File

@@ -55,7 +55,7 @@ public class WorkflowUtil
if (docNode.hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW) == false)
{
throw new AlfrescoRuntimeException("Cannot approve a document that is not part of a workflow.");
throw new AlfrescoRuntimeException("Cannot approve a node that is not part of a workflow.");
}
// get the simple workflow aspect properties
@@ -69,23 +69,28 @@ public class WorkflowUtil
if (approveMove.booleanValue())
{
// move the document to the specified folder
// move the node to the specified folder
String qname = QName.createValidLocalName(docNode.getName());
nodeService.moveNode(ref, approveFolder, ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, qname));
}
else
{
// copy the document to the specified folder
String qname = QName.createValidLocalName(docNode.getName());
copyService.copy(ref, approveFolder, ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, qname));
// copy the node to the specified folder
String name = docNode.getName();
String qname = QName.createValidLocalName(name);
NodeRef newNode = copyService.copy(ref, approveFolder, ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, qname), true);
// the copy service does not copy the name of the node so we
// need to update the property on the copied item
nodeService.setProperty(newNode, ContentModel.PROP_NAME, name);
}
if (logger.isDebugEnabled())
{
String movedCopied = approveMove ? "moved" : "copied";
logger.debug("Document has been approved and " + movedCopied + " to folder with id of " +
logger.debug("Node has been approved and " + movedCopied + " to folder with id of " +
approveFolder.getId());
}
}
@@ -106,7 +111,7 @@ public class WorkflowUtil
if (docNode.hasAspect(ContentModel.ASPECT_SIMPLE_WORKFLOW) == false)
{
throw new AlfrescoRuntimeException("Cannot reject a document that is not part of a workflow.");
throw new AlfrescoRuntimeException("Cannot reject a node that is not part of a workflow.");
}
// get the simple workflow aspect properties
@@ -118,7 +123,7 @@ public class WorkflowUtil
if (rejectStep == null && rejectMove == null && rejectFolder == null)
{
throw new AlfrescoRuntimeException("The workflow does not have a reject step defined,");
throw new AlfrescoRuntimeException("The workflow does not have a reject step defined.");
}
// first we need to take off the simpleworkflow aspect
@@ -142,7 +147,7 @@ public class WorkflowUtil
if (logger.isDebugEnabled())
{
String movedCopied = rejectMove ? "moved" : "copied";
logger.debug("Document has been rejected and " + movedCopied + " to folder with id of " +
logger.debug("Node has been rejected and " + movedCopied + " to folder with id of " +
rejectFolder.getId());
}
}