* Note that the node reference of the record will be the same as the origional
* document.
- *
+ *
* @param filePlan The filePlan in which the record should be placed
* @param nodeRef The node from which the record will be created
* @param isLinked indicates if the newly created record is linked to it's original location or not.
*/
void createRecord(NodeRef filePlan, NodeRef nodeRef, boolean isLinked);
-
+
/**
* Links the newly created record to it's original location.
- *
+ *
* @see #createRecord(NodeRef, NodeRef, boolean)
*/
void createRecord(NodeRef filePlan, NodeRef nodeRef);
-
+
/**
* Indicates whether the record is filed or not
- *
+ *
* @param nodeRef record
* @return boolean true if filed, false otherwise
*/
boolean isFiled(NodeRef record);
+
+ /**
+ * Rejects a node with the provided reason
+ *
+ * @param nodeRef node reference
+ * @param reason reject reason
+ */
+ void rejectRecord(NodeRef nodeRef, String reason);
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java
index 8a7ed841a0..c8274b612e 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java
@@ -23,6 +23,7 @@ import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -90,7 +91,7 @@ public class RecordServiceImpl implements RecordService,
/** Disposition service */
private DispositionService dispositionService;
-
+
/** File plan service */
private FilePlanService filePlanService;
@@ -167,7 +168,7 @@ public class RecordServiceImpl implements RecordService,
{
this.dispositionService = dispositionService;
}
-
+
/**
* @param filePlanService file plan service
*/
@@ -268,7 +269,7 @@ public class RecordServiceImpl implements RecordService,
{
createRecord(filePlan, nodeRef, true);
}
-
+
/**
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#createRecord(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, boolean)
*/
@@ -277,7 +278,7 @@ public class RecordServiceImpl implements RecordService,
ParameterCheck.mandatory("filePlan", filePlan);
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("isLinked", isLinked);
-
+
if (nodeService.hasAspect(nodeRef, ASPECT_RECORD) == false)
{
// first we do a sanity check to ensure that the user has at least write permissions on the document
@@ -322,10 +323,10 @@ public class RecordServiceImpl implements RecordService,
makeRecord(nodeRef);
if (isLinked == true)
- {
+ {
// maintain the original primary location
nodeService.addChild(parentAssoc.getParentRef(), nodeRef, parentAssoc.getTypeQName(), parentAssoc.getQName());
-
+
// set the readers
extendedSecurityService.setExtendedReaders(nodeRef, readers);
}
@@ -425,4 +426,54 @@ public class RecordServiceImpl implements RecordService,
}
}
}
+
+ @Override
+ public void rejectRecord(final NodeRef nodeRef, String reason)
+ {
+ ParameterCheck.mandatory("NodeRef", nodeRef);
+ ParameterCheck.mandatoryString("Reason", reason);
+
+ // do the work of rejecting the record as the system user
+ AuthenticationUtil.runAsSystem(new RunAsWork