RM: In-place prototype

* demo model 
* file and create actions updated
* bug fixes for demo scenario



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/INPLACE@43030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-10-24 00:24:55 +00:00
parent 389c775945
commit 691865e574
6 changed files with 132 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- Bootstrap Records Management Models -->
<bean id="org_alfresco_module_rm_demoModelBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/module/org_alfresco_module_rm/demo/demo-model.xml</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<model name="demo:demoModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Demo Model</description>
<author>Roy Wetherall</author>
<version>1.0</version>
<!-- Imports are required to allow references to definitions in other models -->
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
<!-- Import Alfresco Records Management Model Definitions -->
<import uri="http://www.alfresco.org/model/recordsmanagement/1.0" prefix="rma" />
</imports>
<!-- Records Management Namespace -->
<namespaces>
<namespace uri="http://www.alfresco.org/model/demomodel/1.0" prefix="demo"/>
</namespaces>
<types>
<type name="demo:purchaseOrder">
<title>Purchase Order</title>
<parent>cm:content</parent>
<properties>
<property name="demo:orderId">
<title>Order Id</title>
<type>d:text</type>
</property>
<property name="demo:customerId">
<title>Customer Id</title>
<type>d:text</type>
</property>
<property name="demo:quantity">
<title>Order Quantity</title>
<type>d:int</type>
</property>
<property name="demo:deliveryDate">
<title>Delivery Date</title>
<type>d:date</type>
</property>
<property name="demo:confirmationSent">
<title>Sales Confirmation Sent</title>
<type>d:boolean</type>
</property>
</properties>
</type>
</types>
</model>

View File

@@ -131,6 +131,9 @@
<!-- Import DOD 5015 --> <!-- Import DOD 5015 -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/dod5015/dod5015-context.xml"/> <import resource="classpath:alfresco/module/org_alfresco_module_rm/dod5015/dod5015-context.xml"/>
<!-- Import Demo Context -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/demo/demo-context.xml"/>
<!-- Import the RM identifier service's --> <!-- Import the RM identifier service's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-id-context.xml"/> <import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-id-context.xml"/>

View File

@@ -86,3 +86,9 @@ editDispositionActionAsOfDate.description=Edit Disposition Action As Of Date
createDispositionSchedule.title=Create Disposition Schedule createDispositionSchedule.title=Create Disposition Schedule
createDispositionSchedule.description=Create Disposition Schedule createDispositionSchedule.description=Create Disposition Schedule
file-record.title=File Record
file-record.description=File a record into the file plan.
create-record.title=Create A Record
create-record.description=Create a record from a document.

View File

@@ -18,6 +18,7 @@
*/ */
package org.alfresco.module.org_alfresco_module_rm.action.dm; package org.alfresco.module.org_alfresco_module_rm.action.dm;
import java.util.Date;
import java.util.List; import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
@@ -51,6 +52,7 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
/** Record service */ /** Record service */
private RecordService recordService; private RecordService recordService;
/** Node service */
private NodeService nodeService; private NodeService nodeService;
/** /**
@@ -69,6 +71,9 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
this.recordService = recordService; this.recordService = recordService;
} }
/**
* @param nodeService node service
*/
public void setNodeService(NodeService nodeService) public void setNodeService(NodeService nodeService)
{ {
this.nodeService = nodeService; this.nodeService = nodeService;
@@ -100,6 +105,20 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
// create record from existing document // create record from existing document
recordService.createRecordFromDocument(filePlan, actionedUponNodeRef); recordService.createRecordFromDocument(filePlan, actionedUponNodeRef);
// DEMO CODE
if (nodeService.getProperty(actionedUponNodeRef, PROP_ORIGINATOR) == null)
{
nodeService.setProperty(actionedUponNodeRef, PROP_ORIGINATOR, "Michelle Smith");
}
if (nodeService.getProperty(actionedUponNodeRef, PROP_ORIGINATING_ORGANIZATION) == null)
{
nodeService.setProperty(actionedUponNodeRef, PROP_ORIGINATING_ORGANIZATION, "Customer Service");
}
if (nodeService.getProperty(actionedUponNodeRef, PROP_PUBLICATION_DATE) == null)
{
nodeService.setProperty(actionedUponNodeRef, PROP_PUBLICATION_DATE, new Date());
}
return null; return null;
} }
}); });

View File

@@ -2,8 +2,11 @@ package org.alfresco.module.org_alfresco_module_rm.action.dm;
import java.util.List; import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -39,16 +42,29 @@ public class FileRecordAction extends ActionExecuterAbstractBase
/** /**
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.ref.NodeRef) * @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) public void executeImpl(final Action ruleAction, final NodeRef actionedUponNodeRef)
{
final NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{ {
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_RECORD_FOLDER);
try try
{ {
fileFolderService.move(actionedUponNodeRef, destinationParent, null); fileFolderService.move(actionedUponNodeRef, destinationParent, null);
} }
catch (FileNotFoundException e) catch (FileNotFoundException e)
{ {
// Do nothing throw new AlfrescoRuntimeException("Could not file record.", e);
} }
return null;
}
});
} }
} }