mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM: Sprint Demo Bug Fixes
* ensure search behaviour does not execute on non-records * execute vital record update behaviours as rmadmin * allow node parameter processor to handle MT values git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@48065 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -323,7 +323,7 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
if (nodeService.exists(nodeRef) == true)
|
||||
if (nodeService.exists(nodeRef) == true && nodeService.hasAspect(nodeRef, ASPECT_RECORD) == true)
|
||||
{
|
||||
applySearchAspect(nodeRef);
|
||||
setupDispositionScheduleProperties(nodeRef);
|
||||
|
@@ -28,6 +28,7 @@ import org.alfresco.module.org_alfresco_module_rm.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
|
||||
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.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
@@ -57,6 +58,7 @@ public class VitalRecordServiceImpl implements VitalRecordService,
|
||||
private PolicyComponent policyComponent;
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementActionService rmActionService;
|
||||
private FilePlanAuthenticationService filePlanAuthenticationService;
|
||||
|
||||
/** Behaviours */
|
||||
private JavaBehaviour onUpdateProperties;
|
||||
@@ -94,6 +96,11 @@ public class VitalRecordServiceImpl implements VitalRecordService,
|
||||
this.rmActionService = rmActionService;
|
||||
}
|
||||
|
||||
public void setFilePlanAuthenticationService(FilePlanAuthenticationService filePlanAuthenticationService)
|
||||
{
|
||||
this.filePlanAuthenticationService = filePlanAuthenticationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init method.
|
||||
*/
|
||||
@@ -122,11 +129,19 @@ public class VitalRecordServiceImpl implements VitalRecordService,
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
|
||||
public void onUpdateProperties(final NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
|
||||
{
|
||||
if (nodeService.exists(nodeRef) == true)
|
||||
if (nodeService.exists(nodeRef) == true && nodeService.hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT) == true)
|
||||
{
|
||||
rmActionService.executeRecordsManagementAction(nodeRef, "broadcastVitalRecordDefinition");
|
||||
filePlanAuthenticationService.runAsRmAdmin(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
rmActionService.executeRecordsManagementAction(nodeRef, "broadcastVitalRecordDefinition");
|
||||
return null;
|
||||
}}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.repository.MLText;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
@@ -47,7 +48,8 @@ public class NodeParameterProcessor extends ParameterProcessor
|
||||
DataTypeDefinition.DATETIME,
|
||||
DataTypeDefinition.DOUBLE,
|
||||
DataTypeDefinition.FLOAT,
|
||||
DataTypeDefinition.INT
|
||||
DataTypeDefinition.INT,
|
||||
DataTypeDefinition.MLTEXT
|
||||
};
|
||||
|
||||
/** Node service */
|
||||
@@ -107,8 +109,8 @@ public class NodeParameterProcessor extends ParameterProcessor
|
||||
QName type = propertyDefinition.getDataType().getName();
|
||||
if (ArrayUtils.contains(supportedDataTypes, type) == true)
|
||||
{
|
||||
Serializable propertyValue = nodeService.getProperty(actionedUponNodeRef, qname);
|
||||
result = propertyValue.toString();
|
||||
Serializable propertyValue = nodeService.getProperty(actionedUponNodeRef, qname);
|
||||
result = propertyValue.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user