mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'master' of gitlab.alfresco.com:records-management/records-management into feature/RM-3558-recently-modified-marks
This commit is contained in:
@@ -37,4 +37,6 @@ rm.action.event-not-undone=The event {0} can't be undone, because it's not defin
|
|||||||
rm.action.node-not-record-category=The disposition schedule could not be created, because the actioned upon node ({0}) was not a record category.
|
rm.action.node-not-record-category=The disposition schedule could not be created, because the actioned upon node ({0}) was not a record category.
|
||||||
rm.action.parameter-not-supplied=The parameter ''{0}'' has not been supplied.
|
rm.action.parameter-not-supplied=The parameter ''{0}'' has not been supplied.
|
||||||
rm.action.delete-not-hold-type=The hold couldn't be deleted, because the node isn't of type {0}. (actionedUponNodeRef={1})
|
rm.action.delete-not-hold-type=The hold couldn't be deleted, because the node isn't of type {0}. (actionedUponNodeRef={1})
|
||||||
|
rm.action.cast-to-rm-type=Can't upload a custom folder type to the records management file plan.
|
||||||
rm.action.record-folder-create=Operation failed, because you can't place a record folder into another record folder.
|
rm.action.record-folder-create=Operation failed, because you can't place a record folder into another record folder.
|
||||||
|
|
||||||
|
@@ -3,13 +3,22 @@
|
|||||||
|
|
||||||
<beans>
|
<beans>
|
||||||
|
|
||||||
|
<!-- load version.properties -->
|
||||||
|
<bean id="rm.version.properties" parent="common-placeholder-configurer">
|
||||||
|
<property name="locations">
|
||||||
|
<list>
|
||||||
|
<value>classpath*:alfresco/module/org_alfresco_module_rm/version.properties</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- rm module patch executer -->
|
<!-- rm module patch executer -->
|
||||||
<bean id="rm.modulePatchExecuter" parent="module.baseComponent" class="org.alfresco.module.org_alfresco_module_rm.patch.ModulePatchExecuterImpl">
|
<bean id="rm.modulePatchExecuter" parent="module.baseComponent" class="org.alfresco.module.org_alfresco_module_rm.patch.ModulePatchExecuterImpl">
|
||||||
<property name="moduleId" value="org_alfresco_module_rm"/>
|
<property name="moduleId" value="org_alfresco_module_rm"/>
|
||||||
<property name="description" value="RM patch executer"/>
|
<property name="description" value="RM patch executer"/>
|
||||||
<property name="sinceVersion" value="2.2"/>
|
<property name="sinceVersion" value="2.2"/>
|
||||||
<property name="executeOnceOnly" value="false"/>
|
<property name="executeOnceOnly" value="false"/>
|
||||||
<property name="moduleSchema" value="2502"/>
|
<property name="moduleSchema" value="${version.rm.schema}" />
|
||||||
<property name="attributeService" ref="AttributeService" />
|
<property name="attributeService" ref="AttributeService" />
|
||||||
<property name="dependsOn">
|
<property name="dependsOn">
|
||||||
<list>
|
<list>
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
# RM Schema number
|
||||||
|
|
||||||
|
version.rm.schema=2501
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
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.BaseBehaviourBean;
|
||||||
@@ -43,6 +44,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
|||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rma:recordsManagementContainer behaviour bean.
|
* rma:recordsManagementContainer behaviour bean.
|
||||||
@@ -69,6 +71,9 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
|||||||
/** record folder service */
|
/** record folder service */
|
||||||
protected RecordFolderService recordFolderService;
|
protected RecordFolderService recordFolderService;
|
||||||
|
|
||||||
|
/** I18N */
|
||||||
|
private static final String MSG_CANNOT_CAST_TO_RM_TYPE = "rm.action.cast-to-rm-type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param identifierService identifier service
|
* @param identifierService identifier service
|
||||||
*/
|
*/
|
||||||
@@ -151,6 +156,11 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
|||||||
// This occurs if the RM folder has been created via IMap, WebDav, etc
|
// This occurs if the RM folder has been created via IMap, WebDav, etc
|
||||||
if (!nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT))
|
if (!nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT))
|
||||||
{
|
{
|
||||||
|
// Throw exception if the type is not cm:folder
|
||||||
|
if (!ContentModel.TYPE_FOLDER.equals(childType))
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CANNOT_CAST_TO_RM_TYPE));
|
||||||
|
}
|
||||||
// check the type of the parent to determine what 'kind' of artifact to create
|
// check the type of the parent to determine what 'kind' of artifact to create
|
||||||
NodeRef parent = childAssocRef.getParentRef();
|
NodeRef parent = childAssocRef.getParentRef();
|
||||||
QName parentType = nodeService.getType(parent);
|
QName parentType = nodeService.getType(parent);
|
||||||
|
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* #%L
|
||||||
|
* Alfresco Records Management Module
|
||||||
|
* %%
|
||||||
|
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||||
|
* %%
|
||||||
|
* This file is part of the Alfresco software.
|
||||||
|
* -
|
||||||
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
|
* the paid license agreement will prevail. Otherwise, the software is
|
||||||
|
* provided under the following open source license terms:
|
||||||
|
* -
|
||||||
|
* 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/>.
|
||||||
|
* #L%
|
||||||
|
*/
|
||||||
|
package org.alfresco.module.org_alfresco_module_rm.test.integration.issue;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.test.util.TestModel;
|
||||||
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
|
import org.alfresco.util.GUID;
|
||||||
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integration test for RM-3450
|
||||||
|
*
|
||||||
|
* @author Roxana Lucanu
|
||||||
|
* @since 2.4.1
|
||||||
|
*/
|
||||||
|
public class RM3450Test extends BaseRMTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final String MSG_CANNOT_CAST_TO_RM_TYPE = "rm.action.cast-to-rm-type";
|
||||||
|
|
||||||
|
public void testRM3450() throws Exception
|
||||||
|
{
|
||||||
|
doTestInTransaction(new FailureTest
|
||||||
|
(
|
||||||
|
I18NUtil.getMessage(MSG_CANNOT_CAST_TO_RM_TYPE),
|
||||||
|
AlfrescoRuntimeException.class
|
||||||
|
)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run() throws Exception
|
||||||
|
{
|
||||||
|
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>()
|
||||||
|
{
|
||||||
|
public Object execute() throws Exception
|
||||||
|
{
|
||||||
|
fileFolderService.create(unfiledContainer, GUID.generate(), TestModel.NOT_RM_FOLDER_TYPE).getNodeRef();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, false, true);
|
||||||
|
}
|
||||||
|
}, ADMIN_USER);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -40,4 +40,5 @@ public interface TestModel
|
|||||||
|
|
||||||
public static final QName ASPECT_RECORD_METADATA = QName.createQName(TEST_URI, "recordMetaData");
|
public static final QName ASPECT_RECORD_METADATA = QName.createQName(TEST_URI, "recordMetaData");
|
||||||
public static final QName PROPERTY_RECORD_METADATA = QName.createQName(TEST_URI, "recordMetaDataProperty");
|
public static final QName PROPERTY_RECORD_METADATA = QName.createQName(TEST_URI, "recordMetaDataProperty");
|
||||||
|
public static final QName NOT_RM_FOLDER_TYPE = QName.createQName(TEST_URI, "notRmFolderType");
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,9 @@
|
|||||||
<type name="rmt:customType">
|
<type name="rmt:customType">
|
||||||
<parent>cm:content</parent>
|
<parent>cm:content</parent>
|
||||||
</type>
|
</type>
|
||||||
|
<type name="rmt:notRmFolderType">
|
||||||
|
<parent>cm:folder</parent>
|
||||||
|
</type>
|
||||||
|
|
||||||
</types>
|
</types>
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ import org.mockito.InjectMocks;
|
|||||||
* @author Mihai Cozma
|
* @author Mihai Cozma
|
||||||
* @since 2.4
|
* @since 2.4
|
||||||
*/
|
*/
|
||||||
public class HoldContainerTypeTest extends BaseUnitTest
|
public class HoldContainerTypeUnitTest extends BaseUnitTest
|
||||||
{
|
{
|
||||||
/** test object */
|
/** test object */
|
||||||
private @InjectMocks HoldContainerType holdContainerType;
|
private @InjectMocks HoldContainerType holdContainerType;
|
@@ -26,13 +26,17 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.test.util.TestModel;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -43,7 +47,7 @@ import org.mockito.InjectMocks;
|
|||||||
* @author Ana Bozianu
|
* @author Ana Bozianu
|
||||||
* @since 2.4
|
* @since 2.4
|
||||||
*/
|
*/
|
||||||
public class RecordsManagementContainerTypeTest extends BaseUnitTest
|
public class RecordsManagementContainerTypeUnitTest extends BaseUnitTest
|
||||||
{
|
{
|
||||||
/** test object */
|
/** test object */
|
||||||
private @InjectMocks RecordsManagementContainerType recordManagementContainerType;
|
private @InjectMocks RecordsManagementContainerType recordManagementContainerType;
|
||||||
@@ -94,6 +98,28 @@ public class RecordsManagementContainerTypeTest extends BaseUnitTest
|
|||||||
verify(mockedRecordFolderService, never()).setupRecordFolder(rmFolder);
|
verify(mockedRecordFolderService, never()).setupRecordFolder(rmFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trying to create a RM folder and its sub-types via SFDC, IMap, WebDav, etc
|
||||||
|
* Check that exception is thrown on creating child associations
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testRM3450()
|
||||||
|
{
|
||||||
|
NodeRef rmContainer = generateRMContainer();
|
||||||
|
NodeRef nonRmFolder = generateNonRmFolderNode();
|
||||||
|
|
||||||
|
ChildAssociationRef childAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rmContainer, TestModel.NOT_RM_FOLDER_TYPE, nonRmFolder);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
recordManagementContainerType.onCreateChildAssociation(childAssoc, true);
|
||||||
|
fail("Expected to throw exception on create child association.");
|
||||||
|
}
|
||||||
|
catch (Throwable e)
|
||||||
|
{
|
||||||
|
assertTrue(e instanceof AlfrescoRuntimeException);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a record management container
|
* Generates a record management container
|
||||||
* @return reference to the generated container
|
* @return reference to the generated container
|
||||||
@@ -122,4 +148,19 @@ public class RecordsManagementContainerTypeTest extends BaseUnitTest
|
|||||||
when(mockedNodeService.hasAspect(rmFolder, ASPECT_FILE_PLAN_COMPONENT)).thenReturn(false);
|
when(mockedNodeService.hasAspect(rmFolder, ASPECT_FILE_PLAN_COMPONENT)).thenReturn(false);
|
||||||
return rmFolder;
|
return rmFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a folder node
|
||||||
|
* @return reference to the created folder
|
||||||
|
*/
|
||||||
|
private NodeRef generateNonRmFolderNode()
|
||||||
|
{
|
||||||
|
NodeRef nonRmFolder = generateNodeRef();
|
||||||
|
when(mockedDictionaryService.isSubClass(TestModel.NOT_RM_FOLDER_TYPE, ContentModel.TYPE_FOLDER)).thenReturn(true);
|
||||||
|
when(mockedNodeService.getType(nonRmFolder)).thenReturn(TestModel.NOT_RM_FOLDER_TYPE);
|
||||||
|
when(mockedNodeService.exists(nonRmFolder)).thenReturn(true);
|
||||||
|
when(mockedNodeService.hasAspect(nonRmFolder, ContentModel.ASPECT_HIDDEN)).thenReturn(false);
|
||||||
|
when(mockedNodeService.hasAspect(nonRmFolder, ASPECT_FILE_PLAN_COMPONENT)).thenReturn(false);
|
||||||
|
return nonRmFolder;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -40,7 +40,7 @@ import org.mockito.InjectMocks;
|
|||||||
* @author Mihai Cozma
|
* @author Mihai Cozma
|
||||||
* @since 2.4
|
* @since 2.4
|
||||||
*/
|
*/
|
||||||
public class TransferContainerTypeTest extends BaseUnitTest
|
public class TransferContainerTypeUnitTest extends BaseUnitTest
|
||||||
{
|
{
|
||||||
/** test object */
|
/** test object */
|
||||||
private @InjectMocks TransferContainerType transferContainerType;
|
private @InjectMocks TransferContainerType transferContainerType;
|
Reference in New Issue
Block a user