mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-908 (Add Record Type action is missing)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55066 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,10 +28,11 @@ rm.action.no-open-record-folder=The record folder couldn't be opened because it'
|
||||
rm.action.not-hold-type=The hold couldn't be relinquished, because the node isn't of type {0}. (actionedUponNodeRef={1})
|
||||
rm.action.no-read-mime-message=The mimetype message couldn't be read, because {0}.
|
||||
rm.action.email-declared=The email couldn't be split, because the record is complete. (actionedUponNodeRef={0})
|
||||
rm.action.email-not-record=The email couldn't be split, because the node isn't a record. (actionedUponNodeRef={0})
|
||||
rm.action.email-not-record=The email couldn't be split, because the node isn't a record. (actionedUponNodeRef={0})
|
||||
rm.action.email-create-child-assoc=Couldn't create custom child association.
|
||||
rm.action.node-already-transfer=The node is already being transferred.
|
||||
rm.action.node-not-transfer=The node is not a transfer object.
|
||||
rm.action.undo-not-last=The cut off can't be undone, because the last disposition action was not cut off.
|
||||
rm.action.records_only_undeclared=Only records can be completed.
|
||||
rm.action.event-not-undone=The event {0} can't be undone, because it's not defined on the disposition lifecycle.
|
||||
rm.action.event-not-undone=The event {0} can't be undone, because it's not defined on the disposition lifecycle.
|
||||
rm.action.actioned-upon-has-aspect=The node {0} has already the aspect {1}.
|
@@ -31,7 +31,7 @@ isVital.description=Is the record or record folder vital.
|
||||
|
||||
# Have Disposition Action
|
||||
hasDispositionAction.title=Has disposition action
|
||||
hasDispositionAction.description=Have the nodes got the specified associated disposition action at the specified relative position.
|
||||
hasDispositionAction.description=Have the nodes got the specified associated disposition action at the specified relative position.
|
||||
|
||||
# Are kind
|
||||
isKind.title=Type of records management item
|
||||
@@ -40,7 +40,7 @@ isKind.kind.display-label=Kind
|
||||
|
||||
# Are Record Type
|
||||
isRecordType.title=Has record type
|
||||
isRecordType.description=Are the records of the specified type.
|
||||
isRecordType.description=Are the records of the specified type.
|
||||
|
||||
|
||||
#
|
||||
@@ -133,7 +133,7 @@ createDispositionSchedule.description=Create disposition schedule
|
||||
# File Destruction Report
|
||||
fileDestructionReport.title=File destruction report
|
||||
fileDestructionReport.description=File destruction report
|
||||
# Cut off
|
||||
# Cut off
|
||||
cutoff.title=Cut off
|
||||
cutoff.description=Cut off
|
||||
# Destroy
|
||||
@@ -157,6 +157,9 @@ accession.description=Accession
|
||||
# Retain
|
||||
retain.title=Retain
|
||||
retain.description=Retain
|
||||
# Add Record Types
|
||||
addRecordTypes.title=Add record types
|
||||
addRecordTypes.description=Adds the selected type(s) to the record
|
||||
|
||||
|
||||
# Action parameter constraints
|
||||
|
@@ -267,7 +267,7 @@
|
||||
|
||||
<bean id="retain_proxy" parent="rmProxyAction" >
|
||||
<property name="target">
|
||||
<ref bean="retain"/>
|
||||
<ref bean="retain"/>
|
||||
</property>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
@@ -275,7 +275,7 @@
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="retain" class="org.alfresco.module.org_alfresco_module_rm.action.impl.RetainAction" parent="rmAction"/>
|
||||
|
||||
<!-- open record folder -->
|
||||
@@ -916,4 +916,31 @@
|
||||
<property name="adhocPropertiesAllowed" value="true" />
|
||||
</bean>
|
||||
|
||||
<!-- add record types -->
|
||||
|
||||
<bean id="addRecordTypes_proxy" parent="rmProxyAction" >
|
||||
<property name="target">
|
||||
<ref bean="addRecordTypes"/>
|
||||
</property>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
<idref bean="addRecordTypes_security"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="addRecordTypes_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
|
||||
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="addRecordTypes" class="org.alfresco.module.org_alfresco_module_rm.action.impl.AddRecordTypeAction" parent="rmAction">
|
||||
<property name="publicAction" value="true"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2013 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.action.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
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.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Action to add types to a record
|
||||
*
|
||||
* @author Tuna Aksoy
|
||||
* @since 2.1
|
||||
*/
|
||||
public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(AddRecordTypeAction.class);
|
||||
|
||||
/** I18N */
|
||||
private static final String MSG_ACTIONED_UPON_NOT_RECORD = "rm.action.actioned-upon-not-record";
|
||||
private static final String MSG_ACTIONED_UPON_HAS_ASPECT = "rm.action.actioned-upon-has-aspect";
|
||||
|
||||
/** Parameter names */
|
||||
public static final String PARAM_ADD_RECORD_TYPES = "recordTypes";
|
||||
|
||||
/** Action name */
|
||||
public static final String NAME = "addRecordTypes";
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
|
||||
* org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
{
|
||||
String recordTypes = (String) action.getParameterValue(PARAM_ADD_RECORD_TYPES);
|
||||
String[] types = recordTypes.split(",");
|
||||
for (String type : types)
|
||||
{
|
||||
QName aspectTypeQName = QName.createQName(type, namespaceService);
|
||||
if (nodeService.hasAspect(actionedUponNodeRef, aspectTypeQName) == false)
|
||||
{
|
||||
nodeService.addAspect(actionedUponNodeRef, aspectTypeQName, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.info(I18NUtil.getMessage(MSG_ACTIONED_UPON_HAS_ASPECT, actionedUponNodeRef.toString(), aspectTypeQName.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (logger.isWarnEnabled() == true)
|
||||
{
|
||||
logger.warn(I18NUtil.getMessage(MSG_ACTIONED_UPON_NOT_RECORD, this.getClass().getSimpleName(), actionedUponNodeRef.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ADD_RECORD_TYPES, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_ADD_RECORD_TYPES)));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user