mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -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");
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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");
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user