RM-765: Remove DOD meta-data from core RM model

* dod meta-data moved into record meta-data aspect within DOD model
 * by default dod compliance aspect is added to all records (via behaviour) .. will be configurable later (see RM-1116)
 * moved share related DOD config and spring context into separate files and package
 * fixed up RM form filters and overide of FormUIGet to allow the dynamic discovery and addition of form set's relating to the specially marked record meta-data aspects
 * clean up any references to the DOD model in the RM core code
 * Note that the patch for these changes is yet to be added



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@59445 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2014-01-07 05:38:57 +00:00
parent 01200bd1cd
commit 0470d2d705
25 changed files with 258 additions and 140 deletions

View File

@@ -12,7 +12,7 @@
</property>
<property name="labels">
<list>
<value>alfresco/module/org_alfresco_module_rm/dod5015/dod5015-model</value>
<value>alfresco/module/org_alfresco_module_rm/dod5015/messages/dod5015-model</value>
</list>
</property>
</bean>
@@ -21,12 +21,22 @@
<bean id="org_alfresco_module_rm_resourceBundles.dod5015" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.dod5015.dod5015</value>
<value>alfresco.module.org_alfresco_module_rm.dod5015.messages.dod5015</value>
</list>
</property>
</bean>
<!-- add publication date as a disposition property -->
<bean id="disposition.properties.publicationdate" parent="disposition.properties.base">
<property name="name" value="dod:publicationDate" />
<property name="appliesToFolderLevel" value="false"/>
</bean>
<!-- Include classification capabilities, deprecated for now -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/dod5015/dod5015-capabilities-classification-context.xml"/>
<!-- Model behaviour -->
<bean id="dod.dod5015RecordAspect" class="org.alfresco.module.org_alfresco_module_rm.dod5015.model.dod.aspect.DOD5015RecordAspect" parent="rm.baseBehaviour">
</bean>
</beans>

View File

@@ -26,6 +26,7 @@
<namespace uri="http://www.alfresco.org/model/dod5015/1.0" prefix="dod"/>
</namespaces>
<!-- TODO I18N -->
<constraints>
<constraint name="dod:imageFormatList" type="LIST">
<title>Image Formats</title>
@@ -56,6 +57,100 @@
</types>
<aspects>
<!-- DOD5015 Record Properties -->
<!-- @since 2.2 -->
<aspect name="dod:dod5015record">
<title>DOD5015 Record</title>
<parent>rma:recordMetaData</parent>
<properties>
<property name="dod:publicationDate">
<title>Publication Date</title>
<type>d:date</type>
<mandatory>true</mandatory>
</property>
<property name="dod:originator">
<title>Originator</title>
<type>d:text</type>
<mandatory>true</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="dod:originatingOrganization">
<title>Originating Organization</title>
<type>d:text</type>
<mandatory>true</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="dod:mediaType">
<title>Media Type</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="dod:format">
<title>Format</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="dod:dateReceived">
<title>Date Received</title>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<!-- TODO
Do we need to model this as broken up address?
Should we have a separate property for other address or just a multivalue property?
-->
<property name="dod:address">
<title>Addressee</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="dod:otherAddress">
<title>Other Addressee</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
</properties>
</aspect>
<aspect name="dod:scannedRecord">
<title>Scanned Record</title>

View File

@@ -610,6 +610,7 @@
</properties>
</aspect>
<!-- @deprecated as of 2.1 -->
<aspect name="rma:recordsManagementRoot">
<title>Records Management Root</title>
<associations>
@@ -732,88 +733,7 @@
<title>Original Name</title>
<type>d:text</type>
<protected>true</protected>
</property>
<property name="rma:publicationDate">
<title>Publication Date</title>
<type>d:date</type>
<mandatory>true</mandatory>
</property>
<property name="rma:originator">
<title>Originator</title>
<type>d:text</type>
<mandatory>true</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="rma:originatingOrganization">
<title>Originating Organization</title>
<type>d:text</type>
<mandatory>true</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="rma:mediaType">
<title>Media Type</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="rma:format">
<title>Format</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="rma:dateReceived">
<title>Date Received</title>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<!-- TODO
Do we need to model this as broken up address?
Should we have a separate property for other address or just a multivalue property?
-->
<property name="rma:address">
<title>Addressee</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
<property name="rma:otherAddress">
<title>Other Addressee</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
</property>
</properties>

View File

@@ -33,14 +33,8 @@
<property name="appliesToFolderLevel" value="false"/>
</bean>
<bean id="disposition.properties.publicationdate" parent="disposition.properties.base">
<property name="name" value="rma:publicationDate" />
<property name="appliesToFolderLevel" value="false"/>
</bean>
<bean id="disposition.properties.created" parent="disposition.properties.base">
<property name="name" value="cm:created" />
<property name="appliesToRecordLevel" value="false"/>
</bean>
</beans>

View File

@@ -32,7 +32,16 @@ public interface DOD5015Model
public static final String DOD_URI = "http://www.alfresco.org/model/dod5015/1.0";
public static final String DOD_PREFIX = "dod";
// DOD 5015 Custom Type aspects and their properties
// DOD Record
public static final QName ASPECT_DOD_5015_RECORD = QName.createQName(DOD_URI, "dod5015record");
public static final QName PROP_ORIGINATOR = QName.createQName(DOD_URI, "originator");
public static final QName PROP_ORIGINATING_ORGANIZATION = QName.createQName(DOD_URI, "originatingOrganization");
public static final QName PROP_PUBLICATION_DATE = QName.createQName(DOD_URI, "publicationDate");
public static final QName PROP_MEDIA_TYPE = QName.createQName(DOD_URI, "mediaType");
public static final QName PROP_FORMAT = QName.createQName(DOD_URI, "format");
public static final QName PROP_DATE_RECEIVED = QName.createQName(DOD_URI, "dateReceived");
// Scanned Record
public static final QName ASPECT_SCANNED_RECORD = QName.createQName(DOD_URI, "scannedRecord");
public static final QName PROP_SCANNED_FORMAT = QName.createQName(DOD_URI, "scannedFormat");

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.dod5015.model.dod.aspect;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.annotation.Behaviour;
import org.alfresco.repo.policy.annotation.BehaviourBean;
import org.alfresco.repo.policy.annotation.BehaviourKind;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
/**
* dod:dod5015record behaviour bean
*
* @author Roy Wetherall
* @since 2.2
*/
@BehaviourBean
public class DOD5015RecordAspect extends BaseBehaviourBean
implements NodeServicePolicies.OnAddAspectPolicy,
DOD5015Model
{
/**
* Ensure that the DOD record aspect meta-data is applied.
*
* @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
*/
@Behaviour
(
kind=BehaviourKind.CLASS,
type="rma:record",
notificationFrequency = NotificationFrequency.FIRST_EVENT
)
@Override
public void onAddAspect(NodeRef nodeRef, QName aspect)
{
if (nodeService.exists(nodeRef) == true &&
nodeService.hasAspect(nodeRef, ASPECT_DOD_5015_RECORD) == false)
{
nodeService.addAspect(nodeRef, ASPECT_DOD_5015_RECORD, null);
}
}
}

View File

@@ -124,7 +124,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
* @param props
* @param setId
*/
protected void addPropertyFieldsToGroup(Form form, Map<QName, PropertyDefinition> props, String setId)
protected void addPropertyFieldsToGroup(Form form, Map<QName, PropertyDefinition> props, String setId, String setLabel)
{
if (props != null)
{
@@ -137,7 +137,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
NodeRef nodeRef = new NodeRef(id);
Serializable value = nodeService.getProperty(nodeRef, entry.getKey());
FieldGroup group = new FieldGroup(setId, null, false, false, null);
FieldGroup group = new FieldGroup(setId, setLabel, false, false, null);
Field field = FieldUtils.makePropertyField(prop, value, group, namespaceService, dictionaryService);
form.addField(field);

View File

@@ -39,7 +39,9 @@ import org.alfresco.repo.forms.Form;
import org.alfresco.repo.forms.PropertyFieldDefinition;
import org.alfresco.repo.forms.processor.node.FieldUtils;
import org.alfresco.repo.forms.processor.node.FormFieldConstants;
import org.alfresco.repo.i18n.StaticMessageLookup;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.dictionary.AspectDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -169,7 +171,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
for (QName customisable : customisables)
{
addPropertyFieldsToGroup(form, rmAdminService.getCustomPropertyDefinitions(customisable), CUSTOM_RM_FIELD_GROUP_ID);
addPropertyFieldsToGroup(form, rmAdminService.getCustomPropertyDefinitions(customisable), CUSTOM_RM_FIELD_GROUP_ID, null);
}
}
@@ -188,7 +190,15 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
{
String aspectName = aspect.getPrefixedQName(namespaceService).toPrefixString().replace(":", "-");
String setId = RM_METADATA_PREFIX + aspectName;
addPropertyFieldsToGroup(form, dictionaryService.getPropertyDefs(aspect), setId);
String setLabel = null;
AspectDefinition aspectDefinition = dictionaryService.getAspect(aspect);
if (aspectDefinition != null)
{
setLabel = aspectDefinition.getTitle(new StaticMessageLookup());
}
addPropertyFieldsToGroup(form, dictionaryService.getPropertyDefs(aspect), setId, setLabel);
}
}
}

View File

@@ -100,12 +100,12 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
public static final QName ASPECT_RECORD = QName.createQName(RM_URI, "record");
public static final QName PROP_DATE_FILED = QName.createQName(RM_URI, "dateFiled");
public static final QName PROP_ORIGIONAL_NAME = QName.createQName(RM_URI, "origionalName");
public static final QName PROP_ORIGINATOR = QName.createQName(RM_URI, "originator");
public static final QName PROP_ORIGINATING_ORGANIZATION = QName.createQName(RM_URI, "originatingOrganization");
public static final QName PROP_PUBLICATION_DATE = QName.createQName(RM_URI, "publicationDate");
public static final QName PROP_MEDIA_TYPE = QName.createQName(RM_URI, "mediaType");
public static final QName PROP_FORMAT = QName.createQName(RM_URI, "format");
public static final QName PROP_DATE_RECEIVED = QName.createQName(RM_URI, "dateReceived");
// public static final QName PROP_ORIGINATOR = QName.createQName(RM_URI, "originator");
// public static final QName PROP_ORIGINATING_ORGANIZATION = QName.createQName(RM_URI, "originatingOrganization");
// public static final QName PROP_PUBLICATION_DATE = QName.createQName(RM_URI, "publicationDate");
// public static final QName PROP_MEDIA_TYPE = QName.createQName(RM_URI, "mediaType");
// public static final QName PROP_FORMAT = QName.createQName(RM_URI, "format");
// public static final QName PROP_DATE_RECEIVED = QName.createQName(RM_URI, "dateReceived");
// Common record details
public static final QName PROP_LOCATION = QName.createQName(RM_URI, "location");

View File

@@ -21,6 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.aspect;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
import org.alfresco.repo.content.ContentServicePolicies;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.annotation.Behaviour;
import org.alfresco.repo.policy.annotation.BehaviourBean;
import org.alfresco.repo.policy.annotation.BehaviourKind;
@@ -33,9 +34,9 @@ import org.springframework.extensions.surf.util.I18NUtil;
* @author Roy Wetherall
* @since 2.2
*/
@BehaviourBean
@BehaviourBean
(
defaultType = "rma:ghosted"
defaultType = "rma:ghosted" // optional
)
public class GhostedAspect extends BaseBehaviourBean
implements ContentServicePolicies.OnContentUpdatePolicy
@@ -47,11 +48,18 @@ public class GhostedAspect extends BaseBehaviourBean
* Ensure that the content of a ghosted node can not be updated.
*
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean)
*/
*/
@Override
@Behaviour
(
kind = BehaviourKind.CLASS
kind = BehaviourKind.CLASS, // required, use ASSOC for association behaviors
notificationFrequency = NotificationFrequency.EVERY_EVENT, // (defaults to EVERY_EVENT)
policy = "alf:onContentUpdate", // (defaults to alf:<methodname>)
type = "rma:ghosted" // required, unless defaultType set
// isService (default false)
// name (only needs to specified if associated behvaiour object needs to be accessed)
// assocType (defaults to cm:contains, used with BehaviourKind.ASSOC)
)
public void onContentUpdate(NodeRef Content, boolean bNew)
{

View File

@@ -34,6 +34,7 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionD
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.disposition.property.DispositionProperty;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
import org.alfresco.module.org_alfresco_module_rm.job.PublishUpdatesJobExecuter;
import org.alfresco.module.org_alfresco_module_rm.job.publish.PublishExecutor;
@@ -851,7 +852,7 @@ public class DispositionServiceImplTest extends BaseRMTestCase
adParams.put(PROP_DISPOSITION_ACTION_NAME, "cutoff");
adParams.put(PROP_DISPOSITION_DESCRIPTION, "test");
adParams.put(PROP_DISPOSITION_PERIOD, "week|1");
adParams.put(PROP_DISPOSITION_PERIOD_PROPERTY, PROP_PUBLICATION_DATE.toString());
adParams.put(PROP_DISPOSITION_PERIOD_PROPERTY, DOD5015Model.PROP_PUBLICATION_DATE.toString());
dispositionService.addDispositionActionDefinition(testRM263DispositionSchedule, adParams);
@@ -869,7 +870,7 @@ public class DispositionServiceImplTest extends BaseRMTestCase
@Override
public Void run() throws Exception
{
Date pubDate = (Date)nodeService.getProperty(testRM263Record, PROP_PUBLICATION_DATE);
Date pubDate = (Date)nodeService.getProperty(testRM263Record, DOD5015Model.PROP_PUBLICATION_DATE);
assertNull(pubDate);
Date asOfDate = (Date)nodeService.getProperty(testRM263Record, PROP_SEARCH_ASOF);
assertNull(asOfDate);
@@ -879,7 +880,7 @@ public class DispositionServiceImplTest extends BaseRMTestCase
assertNull(da.getAsOfDate());
//rma:recordSearchDispositionActionAsOf"
nodeService.setProperty(testRM263Record, PROP_PUBLICATION_DATE, new Date());
nodeService.setProperty(testRM263Record, DOD5015Model.PROP_PUBLICATION_DATE, new Date());
return null;
}
@@ -887,7 +888,7 @@ public class DispositionServiceImplTest extends BaseRMTestCase
@Override
public void test(Void result) throws Exception
{
Date pubDate = (Date)nodeService.getProperty(testRM263Record, PROP_PUBLICATION_DATE);
Date pubDate = (Date)nodeService.getProperty(testRM263Record, DOD5015Model.PROP_PUBLICATION_DATE);
assertNotNull(pubDate);
Date asOfDate = (Date)nodeService.getProperty(testRM263Record, PROP_SEARCH_ASOF);
assertNotNull(asOfDate);

View File

@@ -27,6 +27,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
import org.alfresco.module.org_alfresco_module_rm.role.Role;
@@ -95,7 +96,7 @@ public class RecordServiceImplTest extends BaseRMTestCase
{
Set<QName> aspects = recordService.getRecordMetaDataAspects();
assertNotNull(aspects);
assertEquals(5, aspects.size());
assertEquals(6, aspects.size());
assertTrue(aspects.containsAll(getAspectList()));
return null;
@@ -108,9 +109,15 @@ public class RecordServiceImplTest extends BaseRMTestCase
*/
private List<QName> getAspectList()
{
QName[] aspects = new QName[] { DOD5015Model.ASPECT_DIGITAL_PHOTOGRAPH_RECORD,
DOD5015Model.ASPECT_PDF_RECORD, DOD5015Model.ASPECT_WEB_RECORD,
DOD5015Model.ASPECT_SCANNED_RECORD, ASPECT_RECORD_META_DATA };
QName[] aspects = new QName[]
{
DOD5015Model.ASPECT_DIGITAL_PHOTOGRAPH_RECORD,
DOD5015Model.ASPECT_PDF_RECORD,
DOD5015Model.ASPECT_WEB_RECORD,
DOD5015Model.ASPECT_SCANNED_RECORD,
ASPECT_RECORD_META_DATA,
DOD5015Model.ASPECT_DOD_5015_RECORD
};
return Arrays.asList(aspects);
}
@@ -648,9 +655,9 @@ public class RecordServiceImplTest extends BaseRMTestCase
@Override
public void runImpl() throws Exception
{
assertTrue(recordService.isPropertyEditable(recordOne, PROP_ORIGINATING_ORGANIZATION));
assertTrue(recordService.isPropertyEditable(recordOne, RecordsManagementModel.PROP_LOCATION));
assertTrue(recordService.isPropertyEditable(recordOne, PROP_DESCRIPTION));
assertTrue(recordService.isPropertyEditable(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION));
assertTrue(recordService.isPropertyEditable(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_DESCRIPTION));
}
});
@@ -663,9 +670,9 @@ public class RecordServiceImplTest extends BaseRMTestCase
{
assertEquals(AccessStatus.ALLOWED, permissionService.hasPermission(recordOne, RMPermissionModel.READ_RECORDS));
assertFalse(recordService.isPropertyEditable(recordOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordOne, PROP_DESCRIPTION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_DESCRIPTION));
}
}, rmUserName);
@@ -677,9 +684,9 @@ public class RecordServiceImplTest extends BaseRMTestCase
@Override
public void runImpl() throws Exception
{
assertFalse(recordService.isPropertyEditable(recordOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordOne, RecordsManagementModel.PROP_LOCATION));
assertTrue(recordService.isPropertyEditable(recordOne, PROP_DESCRIPTION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_DESCRIPTION));
}
}, nonRecordMetadata);
@@ -691,9 +698,9 @@ public class RecordServiceImplTest extends BaseRMTestCase
@Override
public void runImpl() throws Exception
{
assertTrue(recordService.isPropertyEditable(recordOne, PROP_ORIGINATING_ORGANIZATION));
assertTrue(recordService.isPropertyEditable(recordOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordOne, PROP_DESCRIPTION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_DESCRIPTION));
}
}, recordMetadata);
@@ -705,9 +712,9 @@ public class RecordServiceImplTest extends BaseRMTestCase
@Override
public void runImpl() throws Exception
{
assertFalse(recordService.isPropertyEditable(recordOne, PROP_ORIGINATING_ORGANIZATION));
assertFalse(recordService.isPropertyEditable(recordOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordOne, PROP_DESCRIPTION));
assertTrue(recordService.isPropertyEditable(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION));
assertTrue(recordService.isPropertyEditable(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION));
assertFalse(recordService.isPropertyEditable(recordDeclaredOne, PROP_DESCRIPTION));
}
}, declaredRecordMetadata);
@@ -739,36 +746,36 @@ public class RecordServiceImplTest extends BaseRMTestCase
// test rmadmin
canEditProperty(recordOne, ContentModel.PROP_DESCRIPTION, rmAdminName);
canEditProperty(recordOne, PROP_ORIGINATING_ORGANIZATION, rmAdminName);
canEditProperty(recordOne, RecordsManagementModel.PROP_LOCATION, rmAdminName);
cantEditProperty(recordDeclaredOne, ContentModel.PROP_DESCRIPTION, rmAdminName);
canEditProperty(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION, rmAdminName);
canEditProperty(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION, rmAdminName);
// test normal user
cantEditProperty(recordOne, ContentModel.PROP_DESCRIPTION, rmUserName);
cantEditProperty(recordOne, PROP_ORIGINATING_ORGANIZATION, rmUserName);
cantEditProperty(recordOne, RecordsManagementModel.PROP_LOCATION, rmUserName);
cantEditProperty(recordDeclaredOne, ContentModel.PROP_DESCRIPTION, rmUserName);
cantEditProperty(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION, rmUserName);
cantEditProperty(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION, rmUserName);
// test undeclared record with edit non-record metadata capability
canEditProperty(recordOne, ContentModel.PROP_DESCRIPTION, nonRecordMetadata);
cantEditProperty(recordOne, PROP_ORIGINATING_ORGANIZATION, nonRecordMetadata);
cantEditProperty(recordOne, RecordsManagementModel.PROP_LOCATION, nonRecordMetadata);
// test declared record with edit non-record metadata capability
cantEditProperty(recordDeclaredOne, ContentModel.PROP_DESCRIPTION, nonRecordMetadata);
cantEditProperty(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION, nonRecordMetadata);
cantEditProperty(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION, nonRecordMetadata);
// test undeclared record with edit record metadata capability
cantEditProperty(recordOne, ContentModel.PROP_DESCRIPTION, recordMetadata);
canEditProperty(recordOne, PROP_ORIGINATING_ORGANIZATION, recordMetadata);
canEditProperty(recordOne, RecordsManagementModel.PROP_LOCATION, recordMetadata);
// test declared record with edit record metadata capability
cantEditProperty(recordDeclaredOne, ContentModel.PROP_DESCRIPTION, recordMetadata);
cantEditProperty(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION, recordMetadata);
cantEditProperty(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION, recordMetadata);
// test undeclared record with edit declared record metadata capability
cantEditProperty(recordOne, ContentModel.PROP_DESCRIPTION, declaredRecordMetadata);
cantEditProperty(recordOne, PROP_ORIGINATING_ORGANIZATION, declaredRecordMetadata);
cantEditProperty(recordOne, RecordsManagementModel.PROP_LOCATION, declaredRecordMetadata);
// test declared record with edit declared record metadata capability
cantEditProperty(recordDeclaredOne, ContentModel.PROP_DESCRIPTION, declaredRecordMetadata);
canEditProperty(recordDeclaredOne, PROP_ORIGINATING_ORGANIZATION, declaredRecordMetadata);
canEditProperty(recordDeclaredOne, RecordsManagementModel.PROP_LOCATION, declaredRecordMetadata);
}

View File

@@ -23,6 +23,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.model.security.ModelSecurityService;
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
@@ -207,13 +208,13 @@ public class CommonRMTestUtils implements RecordsManagementModel
try
{
// Declare record
nodeService.setProperty(record, RecordsManagementModel.PROP_PUBLICATION_DATE, new Date());
nodeService.setProperty(record, RecordsManagementModel.PROP_MEDIA_TYPE, "mediaTypeValue");
nodeService.setProperty(record, RecordsManagementModel.PROP_FORMAT, "formatValue");
nodeService.setProperty(record, RecordsManagementModel.PROP_DATE_RECEIVED, new Date());
nodeService.setProperty(record, DOD5015Model.PROP_PUBLICATION_DATE, new Date());
nodeService.setProperty(record, DOD5015Model.PROP_MEDIA_TYPE, "mediaTypeValue");
nodeService.setProperty(record, DOD5015Model.PROP_FORMAT, "formatValue");
nodeService.setProperty(record, DOD5015Model.PROP_DATE_RECEIVED, new Date());
nodeService.setProperty(record, RecordsManagementModel.PROP_DATE_FILED, new Date());
nodeService.setProperty(record, RecordsManagementModel.PROP_ORIGINATOR, "origValue");
nodeService.setProperty(record, RecordsManagementModel.PROP_ORIGINATING_ORGANIZATION, "origOrgValue");
nodeService.setProperty(record, DOD5015Model.PROP_ORIGINATOR, "origValue");
nodeService.setProperty(record, DOD5015Model.PROP_ORIGINATING_ORGANIZATION, "origOrgValue");
nodeService.setProperty(record, ContentModel.PROP_TITLE, "titleValue");
actionService.executeRecordsManagementAction(record, "declareRecord");
}