RM: bug fixes

* various behaviour needed to be executed as rmadmin
 * indicator shows for rejected record in collab site
 * can not see "create record" action in UI for rejected record



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@48068 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-03-14 07:47:56 +00:00
parent dbe3ec246d
commit 376dff7857
7 changed files with 86 additions and 41 deletions

View File

@@ -157,4 +157,11 @@
class="org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition.IsRecordCategoryCondition"> class="org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition.IsRecordCategoryCondition">
</bean> </bean>
<bean id="capabilityCondition.isRejectedRecord"
parent="capabilityCondition.base"
class="org.alfresco.module.org_alfresco_module_rm.capability.declarative.condition.HasAspectCapabilityCondition">
<property name="aspectName" value="rma:recordRejectionDetails"/>
<property name="namespaceService" ref="NamespaceService"/>
</bean>
</beans> </beans>

View File

@@ -56,6 +56,7 @@
parent="org_alfresco_module_rm_BaseBehaviour"> parent="org_alfresco_module_rm_BaseBehaviour">
<property name="dictionaryService" ref="DictionaryService"/> <property name="dictionaryService" ref="DictionaryService"/>
<property name="recordsManagementIdentifierService" ref="recordsManagementIdentifierService"/> <property name="recordsManagementIdentifierService" ref="recordsManagementIdentifierService"/>
<property name="filePlanAuthenticationService" ref="FilePlanAuthenticationService"/>
</bean> </bean>
<bean id="org_alfresco_module_rm_RmSiteType" <bean id="org_alfresco_module_rm_RmSiteType"

View File

@@ -300,12 +300,20 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
/** /**
* Called after any Records Management property has been updated. * Called after any Records Management property has been updated.
*/ */
public void onChangeToAnyRmProperty(NodeRef node, Map<QName, Serializable> oldProps, Map<QName, Serializable> newProps) public void onChangeToAnyRmProperty(final NodeRef node, final Map<QName, Serializable> oldProps, final Map<QName, Serializable> newProps)
{
serviceRegistry.getFilePlanAuthenticationService().runAsRmAdmin(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{ {
if (nodeService.exists(node) == true) if (nodeService.exists(node) == true)
{ {
this.lookupAndExecuteScripts(node, oldProps, newProps); RecordsManagementServiceImpl.this.lookupAndExecuteScripts(node, oldProps, newProps);
} }
return null;
}});
} }
/** /**

View File

@@ -21,6 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService; import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService;
import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.PolicyComponent;
@@ -55,6 +56,9 @@ public class RecordContainerType implements RecordsManagementModel,
/** Identity service */ /** Identity service */
private IdentifierService recordsManagementIdentifierService; private IdentifierService recordsManagementIdentifierService;
/** File plan authentication service */
private FilePlanAuthenticationService filePlanAuthenticationService;
/** /**
* Set the policy component * Set the policy component
* @param policyComponent policy component * @param policyComponent policy component
@@ -84,6 +88,14 @@ public class RecordContainerType implements RecordsManagementModel,
this.dictionaryService = dictionaryService; this.dictionaryService = dictionaryService;
} }
/**
* @param filePlanAuthenticationService file plan authentication service
*/
public void setFilePlanAuthenticationService(FilePlanAuthenticationService filePlanAuthenticationService)
{
this.filePlanAuthenticationService = filePlanAuthenticationService;
}
/** /**
* Set the identity service * Set the identity service
* *
@@ -114,7 +126,12 @@ public class RecordContainerType implements RecordsManagementModel,
* Deal with something created within a record container * Deal with something created within a record container
*/ */
@Override @Override
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode) public void onCreateChildAssociation(final ChildAssociationRef childAssocRef, boolean isNewNode)
{
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{ {
// Get the elements of the created association // Get the elements of the created association
final NodeRef child = childAssocRef.getChildRef(); final NodeRef child = childAssocRef.getChildRef();
@@ -143,8 +160,12 @@ public class RecordContainerType implements RecordsManagementModel,
// Catch all to generate the rm id (assuming it doesn't already have one!) // Catch all to generate the rm id (assuming it doesn't already have one!)
setIdenifierProperty(child); setIdenifierProperty(child);
} }
} }
return null;
}
});
} }
/** /**

View File

@@ -334,7 +334,12 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
}); });
} }
public void recordFolderCreate(ChildAssociationRef childAssocRef) public void recordFolderCreate(final ChildAssociationRef childAssocRef)
{
AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{ {
NodeRef nodeRef = childAssocRef.getChildRef(); NodeRef nodeRef = childAssocRef.getChildRef();
if (nodeService.exists(nodeRef) == true) if (nodeService.exists(nodeRef) == true)
@@ -342,6 +347,10 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
applySearchAspect(nodeRef); applySearchAspect(nodeRef);
setupDispositionScheduleProperties(nodeRef); setupDispositionScheduleProperties(nodeRef);
} }
return null;
}
});
} }
private void setupDispositionScheduleProperties(NodeRef recordOrFolder) private void setupDispositionScheduleProperties(NodeRef recordOrFolder)

View File

@@ -310,14 +310,13 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
* *
* @param record rejected record * @param record rejected record
*/ */
public void recordRejectedEmailNotification(NodeRef record, String recordId) public void recordRejectedEmailNotification(NodeRef record, String recordId, String recordCreator)
{ {
ParameterCheck.mandatory("record", record); ParameterCheck.mandatory("record", record);
if (canSendRejectEmail(record) == true) if (canSendRejectEmail(record) == true)
{ {
String site = siteService.getSite(record).getShortName(); String site = siteService.getSite(record).getShortName();
String recordCreator = (String) nodeService.getProperty(record, PROP_RECORD_ORIGINATING_USER_ID);
String rejectReason = (String) nodeService.getProperty(record, PROP_RECORD_REJECTION_REASON); String rejectReason = (String) nodeService.getProperty(record, PROP_RECORD_REJECTION_REASON);
String rejectedPerson = (String) nodeService.getProperty(record, PROP_RECORD_REJECTION_USER_ID); String rejectedPerson = (String) nodeService.getProperty(record, PROP_RECORD_REJECTION_USER_ID);
Date rejectDate = (Date) nodeService.getProperty(record, PROP_RECORD_REJECTION_DATE); Date rejectDate = (Date) nodeService.getProperty(record, PROP_RECORD_REJECTION_DATE);

View File

@@ -573,7 +573,7 @@ public class RecordServiceImpl implements RecordService,
ownableService.setOwner(nodeRef, documentOwner); ownableService.setOwner(nodeRef, documentOwner);
// send an email to the record creator // send an email to the record creator
notificationHelper.recordRejectedEmailNotification(nodeRef, recordId); notificationHelper.recordRejectedEmailNotification(nodeRef, recordId, documentOwner);
return null; return null;
} }