RM Prototype:

* stoppped hidden RM actions from appearing in UI
  * added file record action (TODO run-as RecordsManager and make applicable via aspect)
  * added hook points to allow customisation of Rule UI and customised for file record action



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/INPLACE@42700 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-10-17 05:00:56 +00:00
parent 4e433635df
commit 389c775945
12 changed files with 130 additions and 13 deletions

View File

@@ -35,5 +35,6 @@ public enum FilePlanComponentKind
RECORD,
TRANSFER,
HOLD,
DISPOSITION_SCHEDULE;
DISPOSITION_SCHEDULE,
UNFILED_RECORD_CONTAINER;
}

View File

@@ -526,6 +526,10 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
{
result = FilePlanComponentKind.DISPOSITION_SCHEDULE;
}
else if (instanceOf(nodeRef, TYPE_UNFILED_RECORD_CONTAINER) == true)
{
result = FilePlanComponentKind.UNFILED_RECORD_CONTAINER;
}
}
return result;

View File

@@ -282,12 +282,23 @@ public abstract class RMActionExecuterAbstractBase extends ActionExecuterAbstra
PropertyCheck.mandatory(this, "recordsManagementService", recordsManagementService);
PropertyCheck.mandatory(this, "recordsManagementAdminService", recordsManagementAdminService);
PropertyCheck.mandatory(this, "recordsManagementEventService", recordsManagementEventService);
for(AbstractCapability capability : capabilities)
{
capability.registerAction(this);
}
}
/**
* Indicates whether this records management action is public or not
*
* @return boolean true if public, false otherwise
*/
public boolean isPublicAction()
{
return publicAction;
}
/**
* @see org.alfresco.repo.action.CommonResourceAbstractBase#setBeanName(java.lang.String)
*/

View File

@@ -0,0 +1,54 @@
package org.alfresco.module.org_alfresco_module_rm.action.dm;
import java.util.List;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.NodeRef;
public class FileRecordAction extends ActionExecuterAbstractBase
{
public static final String NAME = "file-record";
public static final String PARAM_DESTINATION_RECORD_FOLDER = "destination-record-folder";
/**
* FileFolder service
*/
private FileFolderService fileFolderService;
public void setFileFolderService(FileFolderService fileFolderService)
{
this.fileFolderService = fileFolderService;
}
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(
PARAM_DESTINATION_RECORD_FOLDER,
DataTypeDefinition.NODE_REF,
true,
getParamDisplayLabel(PARAM_DESTINATION_RECORD_FOLDER)));
}
/**
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.ref.NodeRef)
*/
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
{
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
try
{
fileFolderService.move(actionedUponNodeRef, destinationParent, null);
}
catch (FileNotFoundException e)
{
// Do nothing
}
}
}

View File

@@ -18,6 +18,7 @@
*/
package org.alfresco.module.org_alfresco_module_rm.capability;
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
import org.alfresco.repo.action.RuntimeActionService;
@@ -59,7 +60,10 @@ public class RMActionProxyFactoryBean extends ProxyFactoryBean
{
public Void doWork() throws Exception
{
runtimeActionService.registerActionExecuter((ActionExecuter) getObject());
if (((RMActionExecuterAbstractBase)getTargetSource().getTarget()).isPublicAction() == true)
{
runtimeActionService.registerActionExecuter((ActionExecuter) getObject());
}
recordsManagementActionService.register((RecordsManagementAction) getObject());
return null;
}

View File

@@ -140,7 +140,11 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
rmNodeValues.put("kind", kind.toString());
// File plan node reference
rmNodeValues.put("filePlan", recordsManagementService.getFilePlan(nodeRef).toString());
NodeRef filePlan = recordsManagementService.getFilePlan(nodeRef);
rmNodeValues.put("filePlan", filePlan.toString());
// Unfiled container node reference
rmNodeValues.put("unfiledRecordContainer", recordService.getUnfiledRecordContainer(filePlan).toString());
// Set the indicators array
setIndicators(rmNodeValues, nodeRef);

View File

@@ -64,5 +64,7 @@ public interface RecordService
// TODO NodeRef createAndFileRecord(NodeRef recordFolder, NodeRef document);
// TODO void fileRecord(NodeRef recordFolder, NodeRef record);
// TODO void fileRecord(NodeRef recordFolder, NodeRef record);
public NodeRef getUnfiledRecordContainer(NodeRef filePlan);
}

View File

@@ -47,18 +47,25 @@ import org.alfresco.service.namespace.RegexQNamePattern;
*/
public class RecordServiceImpl implements RecordService, RecordsManagementModel
{
/** Node service **/
private NodeService nodeService;
/** Indentiy service */
private IdentifierService identifierService;
/** Records management service */
private RecordsManagementService recordsManagementService;
/** Dictionary service */
private DictionaryService dictionaryService;
/** Policy component */
private PolicyComponent policyComponent;
/** Permission service */
private PermissionService permissionService;
/** Records management security service */
private RecordsManagementSecurityService recordsManagementSecurityService;
/** List of available record meta-data aspects */
@@ -182,7 +189,7 @@ public class RecordServiceImpl implements RecordService, RecordsManagementModel
ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(document);
/// get the new record container for the file plan
NodeRef newRecordContainer = getNewRecordContainer(filePlan);
NodeRef newRecordContainer = getUnfiledRecordContainer(filePlan);
if (newRecordContainer == null)
{
throw new AlfrescoRuntimeException("Unable to create record, because new record container could not be found.");
@@ -219,12 +226,12 @@ public class RecordServiceImpl implements RecordService, RecordsManagementModel
* @param filePlan
* @return
*/
private NodeRef getNewRecordContainer(NodeRef filePlan)
public NodeRef getUnfiledRecordContainer(NodeRef filePlan)
{
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(filePlan, ASSOC_UNFILED_RECORDS, RegexQNamePattern.MATCH_ALL);
if (assocs.size() != 1)
{
throw new AlfrescoRuntimeException("Error getting the new record container, because the container cannot be indentified.");
throw new AlfrescoRuntimeException("Error getting the unfiled container, because the container cannot be indentified.");
}
return assocs.get(0).getChildRef();
}