Merged BRANCHES/V2.3 to HEAD:

112606: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        97445: (RECORD ONLY) RM-1932 Changed the notification frequency based on 2.3 code changes
   112629: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        99084: (RECORD ONLY) Merged V2.3 to V2.2 :
             93334: RM-1822 (Non-system-admin user not allowed to read inheritable permissions)
        99085: (RECORD ONLY) Merged V2.3 to V2.2:
             92881: RM-1799 (Root category is not displayed for the non-rm-admin user who created it)
        99086: (RECORD ONLY) Merged V2.3 to V2.2:
             96580: RM-1904 (SubCategory moved to root have inheritance on)
   112663: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        99087: Upgrade Alfresco version to 4.2.4.6
        99088: RM-2026: Unable to complete historical records when mandatory meta-data missing
        99089: Merged HEAD to V2.2:
             89735: RM-1677- No items error for RM Admin if record was declared from moderated/private site
   112665: Fix merge - delete duplicate method.
   112694: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        98839: GERMAN: Updated bundle for RM 2.2.1 based on EN-rev98763
        98840: SPANISH: Updated bundle for RM 2.2.1 based on EN-rev98763
        98841: FRENCH: Updated bundle for RM 2.2.1 based on EN-rev98763
        98842: ITALIAN: Updated bundle for RM 2.2.1 based on EN-rev98763
        98843: JAPANESE: Updated bundle for RM 2.2.1 based on EN-rev98763
        98844: DUTCH: Updated bundle for RM 2.2.1 based on EN-rev98763
        98845: RUSSIAN: Updated bundle for RM 2.2.1 based on EN-rev98763
        98846: BRAZILIAN PORTUGUESE: Updated bundle for RM 2.2.1 based on EN-rev98763
        98847: SIMPLIFIED CHINESE: Updated bundle for RM 2.2.1 based on EN-rev98763
        98848: BRAZILIAN PORTUGUESE: Updated file and remove of wrongly named file for RM 2.2.1 based on EN-rev98763
        98849: ALL LANG: remove file that does not need to be localised
   112700: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        99374: (RECORD ONLY) Merged V2.3 to V2.1.1:
             96823: RM-1903 (Can't manage permissions without "Manage Access Controls" capability)
             97435: RM-1903: Can't manage permissions without "Manage Access Controls" capability
             97436: RM-1903 - updates to unit tests
             97595: RM-1903 (Can't manage permissions without "Manage Access Controls" capability)
        111023: RM-2566 : [RM] Incorrect message appears on the "Requested information" text box
             - replaced <constraint type="Mandatory"> with mandatory="true"
        112550: Merged BRANCHES/V2.1 to BRANCHES/V2.2:
             112549: Update module version to 2.1.2 after merge of hot fix branch.
        112668: Merged BRANCHES/V2.1 to BRANCHES/V2.2:
             70625: (RECORD ONLY) Added JIRA-Ticket Info
             71381: (RECORD ONLY) Fixed RM 2.1 to get it working with Alfresco 4.2.2
   112951: Merged BRANCHES/V2.2 to BRANCHES/V2.3:
        112947: RM-2617 Remove duplicate token from end of localised strings.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@112953 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tom Page
2015-09-24 09:35:52 +00:00
10 changed files with 271 additions and 9 deletions

View File

@@ -74,7 +74,7 @@ rm.classification.exemptionCategoriesFile=/alfresco/module/org_alfresco_module_r
rm.content.cleansing.enabled=false rm.content.cleansing.enabled=false
rm.content.cleaner=contentCleanser.522022M rm.content.cleaner=contentCleanser.522022M
## Indicates whether mandatory properties are checked before completing a record # Indicates whether mandatory properties are checked before completing a record
# #
rm.completerecord.mandatorypropertiescheck.enabled=true rm.completerecord.mandatorypropertiescheck.enabled=true

View File

@@ -22,7 +22,7 @@
<property name="index" value="30" /> <property name="index" value="30" />
</bean> </bean>
<!-- controls user and gropus role assignments --> <!-- controls user and groups role assignments -->
<bean id="rmManageAccessControlsCapability" <bean id="rmManageAccessControlsCapability"
parent="declarativeCapability"> parent="declarativeCapability">
<property name="name" value="ManageAccessControls" /> <property name="name" value="ManageAccessControls" />

View File

@@ -8,9 +8,9 @@ rm.admin.custom-prop-exist=El modelo personalizado no contiene la propiedad ''{0
rm.admin.unknown-aspect=Aspecto desconocido ''{0}''. rm.admin.unknown-aspect=Aspecto desconocido ''{0}''.
rm.admin.constraint-exists=La restricci\u00f3n ''{0}'' ya existe. rm.admin.constraint-exists=La restricci\u00f3n ''{0}'' ya existe.
rm.admin.contraint-cannot-find=No se puede encontrar la definici\u00f3n para la restricci\u00f3n ''{0}''. rm.admin.contraint-cannot-find=No se puede encontrar la definici\u00f3n para la restricci\u00f3n ''{0}''.
rm.admin.unexpected_type_constraint=Tipo ineseperado ''{0}'' para la restricci\u00f3n ''{1}''. The expected is ''{2}''. rm.admin.unexpected_type_constraint=Tipo inesperado ''{0}'' para la restricci\u00f3n ''{1}''. Lo esperado es ''{2}''.
rm.admin.custom-model-not-found=No se puede encontrar el modelo personalizado ''{0}''. rm.admin.custom-model-not-found=No se puede encontrar el modelo personalizado ''{0}''.
rm.admin.custom-model-no-content=El modelo personalizado no t (nodeRef={0}) rm.admin.custom-model-no-content=El modelo personalizado no tiene contenido (nodeRef={0})
rm.admin.error-write-custom-model=Error al escribir contenido de modelo personalizado. (nodeRef={0}) rm.admin.error-write-custom-model=Error al escribir contenido de modelo personalizado. (nodeRef={0})
rm.admin.error-client-id=Error al generar el identificador del cliente porque ya est\u00e1 en uso. (clientid={0}) rm.admin.error-client-id=Error al generar el identificador del cliente porque ya est\u00e1 en uso. (clientid={0})
rm.admin.error-split-id=No se puede separar el identificador ''{0}'', porque el separador ''{1}'' no est\u00e1 presente. rm.admin.error-split-id=No se puede separar el identificador ''{0}'', porque el separador ''{1}'' no est\u00e1 presente.

View File

@@ -266,7 +266,7 @@
</bean> </bean>
<!-- retain --> <!-- retain -->
<!-- No permissoin?? : allow --> <!-- No permission?? : allow -->
<bean id="retain_proxy" parent="rmProxyAction" > <bean id="retain_proxy" parent="rmProxyAction" >
<property name="target"> <property name="target">
@@ -385,6 +385,7 @@
<bean id="declareRecord" class="org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction" parent="rmAction"> <bean id="declareRecord" class="org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction" parent="rmAction">
<property name="publicAction" value="true"/> <property name="publicAction" value="true"/>
<property name="checkMandatoryPropertiesEnabled" value="${rm.completerecord.mandatorypropertiescheck.enabled}"/>
</bean> </bean>
<!-- undeclare record --> <!-- undeclare record -->

View File

@@ -54,6 +54,17 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
/** Logger */ /** Logger */
private static Log logger = LogFactory.getLog(DeclareRecordAction.class); private static Log logger = LogFactory.getLog(DeclareRecordAction.class);
/** check mandatory properties */
private boolean checkMandatoryPropertiesEnabled = true;
/**
* @param checkMandatoryPropertiesEnabled true if check mandatory properties is enabled, false otherwise
*/
public void setCheckMandatoryPropertiesEnabled(boolean checkMandatoryPropertiesEnabled)
{
this.checkMandatoryPropertiesEnabled = checkMandatoryPropertiesEnabled;
}
/** /**
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
@@ -69,7 +80,8 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
{ {
List<String> missingProperties = new ArrayList<String>(5); List<String> missingProperties = new ArrayList<String>(5);
// Aspect not already defined - check mandatory properties then add // Aspect not already defined - check mandatory properties then add
if (mandatoryPropertiesSet(actionedUponNodeRef, missingProperties)) if (!checkMandatoryPropertiesEnabled ||
mandatoryPropertiesSet(actionedUponNodeRef, missingProperties))
{ {
getRecordService().disablePropertyEditableCheck(); getRecordService().disablePropertyEditableCheck();
try try

View File

@@ -108,7 +108,7 @@ public class RM1194ExcludeDoDRecordTypesTest extends BaseRMTestCase implements D
assertNotNull(record); assertNotNull(record);
Set<QName> aspects = recordService.getRecordMetadataAspects(record); Set<QName> aspects = recordService.getRecordMetadataAspects(record);
assertNotNull(aspects); assertNotNull(aspects);
assertEquals(1, aspects.size()); assertEquals(2, aspects.size());
} }
}); });
} }

View File

@@ -0,0 +1,233 @@
/*
* Copyright (C) 2005-2014 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.test.integration.record;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionResult;
import org.alfresco.module.org_alfresco_module_rm.action.impl.DeclareRecordAction;
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
/**
* Complete record tests.
*
* @author Roy Wetherall
* @since 2.2.1
*/
public class CompleteRecordTest extends BaseRMTestCase
{
private static final QName ASPECT_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "recordMetaDataWithProperty");
private static final QName PROP_TEST = QName.createQName("http://www.alfresco.org/model/rmtest/1.0", "customMandatoryProperty");
/** complete record action */
private DeclareRecordAction action;
/**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#initServices()
*/
@Override
protected void initServices()
{
super.initServices();
// get the action
action = (DeclareRecordAction)applicationContext.getBean("declareRecord");
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#tearDownImpl()
*/
@Override
protected void tearDownImpl()
{
super.tearDownImpl();
// ensure action is returned to original state
action.setCheckMandatoryPropertiesEnabled(true);
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a filed record is missing mandatory values
* When I try to complete the record
* Then the missing properties parameter of the action will be populated
* And the record will not be complete
*/
public void testCheckForMandatoryValuesMissing() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given()
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create a record
record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property)
nodeService.addAspect(record, ASPECT_TEST, null);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNotNull(result.getValue());
assertFalse(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
});
}
/**
* Given the the application is configured to check for mandatory values before complete
* And a filed record has all mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testCheckForMandatoryValuePresent() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given()
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(true);
// create a record
record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property)
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
properties.put(PROP_TEST, "something");
nodeService.addAspect(record, ASPECT_TEST, properties);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
});
}
/**
* Given the the application is configured not to check for mandatory values before complete
* And a filed record is missing mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testDontCheckForMandatoryValuesMissing() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given()
{
// disable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(false);
// create a record
record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property)
nodeService.addAspect(record, ASPECT_TEST, null);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
});
}
/**
* Given the the application is configured to not to check for mandatory values before complete
* And a filed record has all mandatory values
* When I try to complete the record
* Then the record is completed
*/
public void testDontCheckForMandatoryValuePresent() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
private NodeRef record;
private RecordsManagementActionResult result;
public void given()
{
// enable mandatory parameter check
action.setCheckMandatoryPropertiesEnabled(false);
// create a record
record = utils.createRecord(rmFolder, "record.txt", "title");
// add the record aspect (that has a mandatory property)
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
properties.put(PROP_TEST, "something");
nodeService.addAspect(record, ASPECT_TEST, properties);
}
public void when()
{
// complete record
result = rmActionService.executeRecordsManagementAction(record, "declareRecord");
}
public void then()
{
assertNotNull(result);
assertNull(result.getValue());
assertTrue(nodeService.hasAspect(record, ASPECT_DECLARED_RECORD));
}
});
}
}

View File

@@ -93,7 +93,7 @@ public class RecordServiceImplTest extends BaseRMTestCase
{ {
Set<QName> aspects = recordService.getRecordMetadataAspects(filePlan); Set<QName> aspects = recordService.getRecordMetadataAspects(filePlan);
assertNotNull(aspects); assertNotNull(aspects);
assertEquals(1, aspects.size()); assertEquals(2, aspects.size());
assertTrue(aspects.containsAll(getAspectList())); assertTrue(aspects.containsAll(getAspectList()));
return null; return null;

View File

@@ -217,7 +217,14 @@
</map> </map>
</property> </property>
</bean> </bean>
<bean id="testRecordMetadataWithPropertyAspectBootstrap" parent="recordMetadataAspectBootstrap">
<property name="recordMetadataAspects">
<map>
<entry key="rmt:recordMetaDataWithProperty" value="rma:filePlan" />
</map>
</property>
</bean>
<bean id="Search" class="org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory" parent="abstractPropertyBackedBean"> <bean id="Search" class="org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory" parent="abstractPropertyBackedBean">
<property name="autoStart"> <property name="autoStart">
<value>false</value> <value>false</value>

View File

@@ -54,6 +54,15 @@
</property> </property>
</properties> </properties>
</aspect> </aspect>
<aspect name="rmt:recordMetaDataWithProperty">
<properties>
<property name="rmt:customMandatoryProperty">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</aspect>
</aspects> </aspects>