Merged V2.1 to HEAD:

63128: RM-1280: It's possible to create a folder in the root of File Plan via FTP/CIFS/WebDav/NFS
   63265: RM-1183 (Null is displayed in values of Supplemental Marking/Transfer Locations selection lists)
   63266: RM-879 (Web script error when event used in disposition schedule is removed from Management Console)
   63267: RM-1101 (Label is missing for Supplemental Markings/Transfer Locations list on Edit list page)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63280 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-02-26 11:33:35 +00:00
5 changed files with 49 additions and 6 deletions

View File

@@ -58,6 +58,7 @@
<bean id="rma.recordsManagementContainer" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.RecordsManagementContainerType" parent="rm.baseBehaviour">
<property name="identifierService" ref="recordsManagementIdentifierService"/>
<property name="recordService" ref="RecordService" />
<property name="recordFolderService" ref="recordFolderService" />
</bean>
<bean id="rma.filePlan" class="org.alfresco.module.org_alfresco_module_rm.model.rma.type.FilePlanType" parent="rm.baseBehaviour">

View File

@@ -28,7 +28,7 @@
"url" : "${url.serviceContext + "/api/rma/admin/rmconstraints/" + constraint.name}",
"constraintName" : "${constraint.name}",
"caseSensitive" : "${constraint.caseSensitive?string("true", "false")}",
"constraintTitle" : "${constraint.title}",
"constraintTitle" : "${msg(constraint.title)}",
"values" : [
<#list constraint.values as value>
{

View File

@@ -27,8 +27,11 @@ import java.util.Map;
import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.dictionary.ConstraintException;
import org.alfresco.service.cmr.i18n.MessageLookup;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
import org.apache.commons.lang.StringUtils;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* RM Constraint implementation that ensures the value is one of a constrained
@@ -44,7 +47,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
//private static final String ERR_NO_VALUES = "d_dictionary.constraint.list_of_values.no_values";
private static final String ERR_NON_STRING = "d_dictionary.constraint.string_length.non_string";
private static final String ERR_INVALID_VALUE = "d_dictionary.constraint.list_of_values.invalid_value";
private static final String LOV_CONSTRAINT_VALUE = "listconstraint";
private List<String> allowedValues;
private List<String> allowedValuesUpper;
private MatchLogic matchLogic = MatchLogic.AND; // defined match logic used by caveat matching (default = "AND")
@@ -116,6 +119,22 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
}
}
public String getDisplayLabel(String constraintAllowableValue, MessageLookup messageLookup)
{
if (!this.allowedValues.contains(constraintAllowableValue))
{
return null;
}
String key = LOV_CONSTRAINT_VALUE;
key += "." + this.getShortName();
key += "." + constraintAllowableValue;
key = StringUtils.replace(key, ":", "_");
String message = messageLookup.getMessage(key, I18NUtil.getLocale());
return message == null ? constraintAllowableValue : message;
}
private List<String> getAllowedValuesUpper()
{
String runAsUser = AuthenticationUtil.getRunAsUser();

View File

@@ -236,7 +236,7 @@ public class RecordFolderType extends BaseBehaviourBean
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew)
{
NodeRef nodeRef = childAssocRef.getChildRef();
if (nodeService.exists(nodeRef) == true)
if (nodeService.exists(nodeRef) == true && instanceOf(nodeRef, TYPE_RECORD_FOLDER))
{
// ensure nothing is being added to a closed record folder
NodeRef recordFolder = childAssocRef.getParentRef();

View File

@@ -23,6 +23,7 @@ import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
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.recordfolder.RecordFolderService;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.annotation.Behaviour;
@@ -53,6 +54,9 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
/** record service */
protected RecordService recordService;
/** record folder service */
protected RecordFolderService recordFolderService;
/**
* @param identifierService identifier service
*/
@@ -69,6 +73,14 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
this.recordService = recordService;
}
/**
* @param recordFolderService record folder service
*/
public void setRecordFolderService(RecordFolderService recordFolderService)
{
this.recordFolderService = recordFolderService;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.model.BaseTypeBehaviour#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
*/
@@ -104,10 +116,21 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
// This occurs if the RM folder has been created via IMap, WebDav, etc
if (nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT) == false)
{
// TODO it may not always be a record folder ... perhaps if the current user is a admin it would be a record category??
// check the type of the parent to determine what 'kind' of artifact to create
NodeRef parent = childAssocRef.getParentRef();
QName parentType = nodeService.getType(parent);
// Assume any created folder is a rma:recordFolder
if (dictionaryService.isSubClass(parentType, TYPE_FILE_PLAN))
{
// create a rma:recordCategoty since we are in the root of the file plan
nodeService.setType(child, TYPE_RECORD_CATEGORY);
}
else
{
// create a rma:recordFolder and initialise record folder
nodeService.setType(child, TYPE_RECORD_FOLDER);
recordFolderService.setupRecordFolder(child);
}
}
// Catch all to generate the rm id (assuming it doesn't already have one!)