mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM: Compilation warnings cleaned
* including deprecations caused by recent refactoring * all other supurious warnings git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@44873 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
<property name="registry" ref="auditModel.extractorRegistry" />
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="rmService" ref="recordsManagementService" />
|
||||
<property name="rmSecurityService" ref="recordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="filePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<bean id="org_alfresco_module_rm_namePathExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanNamePathDataExtractor">
|
||||
@@ -209,6 +209,7 @@
|
||||
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
|
||||
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
|
||||
<property name="policyComponent" ref="policyComponent"/>
|
||||
<property name="recordService" ref="recordService" />
|
||||
</bean>
|
||||
|
||||
<!-- Job context -->
|
||||
@@ -249,7 +250,7 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.forms.RecordsManagementNodeFormFilter">
|
||||
<property name="filterRegistry" ref="nodeFilterRegistry" />
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<property name="dispositionService" ref="dispositionService"/>
|
||||
<property name="dispositionService" ref="dispositionService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="rmTypeFormFilter"
|
||||
|
@@ -55,7 +55,6 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordContainerType"
|
||||
parent="org_alfresco_module_rm_BaseBehaviour">
|
||||
<property name="dictionaryService" ref="DictionaryService"/>
|
||||
<property name="recordsManagementActionService" ref="RecordsManagementActionService"/>
|
||||
<property name="recordsManagementIdentifierService" ref="recordsManagementIdentifierService"/>
|
||||
</bean>
|
||||
|
||||
@@ -101,13 +100,6 @@
|
||||
<property name="namespaceService" ref="NamespaceService"/>
|
||||
</bean>
|
||||
|
||||
<!-- File Plan Type Behaviour -->
|
||||
<bean id="org_alfresco_module_rm_FilePlanType"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.model.behaviour.FilePlanType"
|
||||
parent="org_alfresco_module_rm_BaseBehaviour">
|
||||
<property name="permissionService" ref="PermissionService"/>
|
||||
</bean>
|
||||
|
||||
<!-- Model Security Definitions -->
|
||||
<import resource="classpath:alfresco/module/org_alfresco_module_rm/model/rm-model-security-context.xml"/>
|
||||
|
||||
|
@@ -43,7 +43,8 @@
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="permissionService" ref="PermissionService" />
|
||||
<property name="recordsManagementService" ref="RecordsManagementService"/>
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService"/>
|
||||
<property name="filePlanPermissionService" ref="FilePlanPermissionService"/>
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -18,7 +18,6 @@
|
||||
<bean id="recordsManagementService" class="org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceImpl"
|
||||
depends-on="org_alfresco_module_rm_dictionaryBootstrap" init-method="init">
|
||||
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry"/>
|
||||
<property name="rmActionService" ref="recordsManagementActionService"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<property name="policyComponent" ref="policyComponent"/>
|
||||
<property name="nodeDAO" ref="nodeDAO"/>
|
||||
@@ -610,7 +609,7 @@
|
||||
<property name="policyComponent" ref="policyComponent" />
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="namespaceService" ref="namespaceService" />
|
||||
<property name="securityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
</bean>
|
||||
|
||||
@@ -891,6 +890,7 @@
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="dictionaryService" ref="dictionaryService" />
|
||||
<property name="recordService" ref="RecordService" />
|
||||
</bean>
|
||||
|
||||
<bean id="FreezeService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
@@ -1175,7 +1175,7 @@
|
||||
<!-- RM Notification Helper -->
|
||||
|
||||
<bean id="recordsManagementNotificationHelper" class="org.alfresco.module.org_alfresco_module_rm.notification.RecordsManagementNotificationHelper" >
|
||||
<property name="securityService" ref="RecordsManagementSecurityService"/>
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
||||
<property name="notificationService" ref="NotificationService"/>
|
||||
<property name="recordsManagementService" ref="RecordsManagementService"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
@@ -1313,10 +1313,9 @@
|
||||
<property name="searchService" ref="SearchService"/>
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="recordsManagementService" ref="RecordsManagementService"/>
|
||||
<property name="recordsManagementActionService" ref="RecordsManagementActionService"/>
|
||||
<property name="permissionService" ref="PermissionService"/>
|
||||
<property name="authorityService" ref="AuthorityService"/>
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService"/>
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
||||
<property name="recordsManagementSearchBehaviour" ref="recordsManagementSearchBehaviour"/>
|
||||
<property name="dispositionService" ref="DispositionService"/>
|
||||
</bean>
|
||||
|
@@ -67,7 +67,6 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.CustomReferenceDefinitionsGet"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementAdminService" ref="RecordsManagementAdminService" />
|
||||
<property name="namespaceService" ref="NamespaceService" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for PUT Custom Reference Definitions -->
|
||||
@@ -227,7 +226,7 @@
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<property name="importerService" ref="ImporterService" />
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<!-- Base bean for transfer web scripts -->
|
||||
@@ -270,14 +269,14 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.admin.RmRolesGet"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<bean id="webscript.org.alfresco.rma.admin.rmrole.rmroles.post"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.admin.RmRolesPost"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
<property name="capabilityService" ref="CapabilityService" />
|
||||
</bean>
|
||||
|
||||
@@ -285,14 +284,14 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.admin.RmRoleGet"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<bean id="webscript.org.alfresco.rma.admin.rmrole.rmrole.put"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.admin.RmRolePut"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
<property name="capabilityService" ref="CapabilityService" />
|
||||
</bean>
|
||||
|
||||
@@ -300,7 +299,7 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.admin.RmRoleDelete"
|
||||
parent="webscript">
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<!-- Capability API -->
|
||||
@@ -386,7 +385,7 @@
|
||||
<property name="personService" ref="PersonService" />
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementSecurityService" ref="RecordsManagementSecurityService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for GET Bootstrap Test Data -->
|
||||
|
@@ -30,7 +30,6 @@ import java.util.Set;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
@@ -98,9 +97,6 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
|
||||
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** Records management action service */
|
||||
private RecordsManagementActionService rmActionService;
|
||||
|
||||
/** Well-known location of the scripts folder. */
|
||||
private NodeRef scriptsFolderNodeRef = new NodeRef("workspace", "SpacesStore", "rm_scripts");
|
||||
@@ -150,16 +146,6 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
|
||||
this.nodeDAO = nodeDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set records management action service
|
||||
*
|
||||
* @param rmActionService records management action service
|
||||
*/
|
||||
public void setRmActionService(RecordsManagementActionService rmActionService)
|
||||
{
|
||||
this.rmActionService = rmActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default RM store reference
|
||||
* @param defaultStoreRef store reference
|
||||
|
@@ -24,9 +24,11 @@ import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.security.ModelSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.service.NotAuditable;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
@@ -38,6 +40,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public interface RecordsManagementServiceRegistry extends ServiceRegistry
|
||||
{
|
||||
/** Service QName constants */
|
||||
@@ -46,13 +49,16 @@ public interface RecordsManagementServiceRegistry extends ServiceRegistry
|
||||
static final QName RECORDS_MANAGEMENT_ADMIN_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementAdminService");
|
||||
static final QName RECORDS_MANAGEMENT_ACTION_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementActionService");
|
||||
static final QName RECORDS_MANAGEMENT_EVENT_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementEventService");
|
||||
static final QName RECORDS_MANAGEMENT_SECURITY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementSecurityService");
|
||||
static final QName RECORDS_MANAGEMENT_AUDIT_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementAuditService");
|
||||
static final QName CAPABILITY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "CapabilityService");
|
||||
static final QName RECORD_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordService");
|
||||
static final QName FREEZE_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "FreezeService");
|
||||
static final QName EXTENDED_SECURITY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "ExtendedSecurityService");
|
||||
static final QName FILE_PLAN_ROLE_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "FilePlanRoleService");
|
||||
static final QName FILE_PLAN_PERMISSION_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "FilePlanPermissionService");
|
||||
@Deprecated
|
||||
static final QName RECORDS_MANAGEMENT_SECURITY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "RecordsManagementSecurityService");
|
||||
|
||||
|
||||
/**
|
||||
* @return records management service
|
||||
@@ -92,7 +98,10 @@ public interface RecordsManagementServiceRegistry extends ServiceRegistry
|
||||
|
||||
/**
|
||||
* @return records management security service
|
||||
*
|
||||
* @deprecated As of release 2.1, replaced with {@link FilePlanRoleService}, {@link FilePlanPermissionService} and {@link ModelSecurityService}
|
||||
*/
|
||||
@Deprecated
|
||||
@NotAuditable
|
||||
RecordsManagementSecurityService getRecordsManagementSecurityService();
|
||||
|
||||
@@ -104,25 +113,36 @@ public interface RecordsManagementServiceRegistry extends ServiceRegistry
|
||||
|
||||
/**
|
||||
* @return capability service
|
||||
* @since 2.0
|
||||
*/
|
||||
@NotAuditable
|
||||
CapabilityService getCapabilityService();
|
||||
|
||||
/**
|
||||
* @return freeze service
|
||||
* @since 2.1
|
||||
*/
|
||||
@NotAuditable
|
||||
FreezeService getFreezeService();
|
||||
|
||||
/**
|
||||
* @return extended security service
|
||||
* @since 2.1
|
||||
*/
|
||||
@NotAuditable
|
||||
ExtendedSecurityService getExtendedSecurityService();
|
||||
|
||||
/**
|
||||
* @return file plan role service
|
||||
* @since 2.1
|
||||
*/
|
||||
@NotAuditable
|
||||
FilePlanRoleService getFilePlanRoleService();
|
||||
|
||||
/**
|
||||
* @return file plan permission service
|
||||
* @since 2.1
|
||||
*/
|
||||
@NotAuditable
|
||||
FilePlanPermissionService getFilePlanPermissionService();
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.repo.service.ServiceDescriptorRegistry;
|
||||
|
||||
@@ -35,6 +36,7 @@ import org.alfresco.repo.service.ServiceDescriptorRegistry;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RecordsManagementServiceRegistryImpl extends ServiceDescriptorRegistry
|
||||
implements RecordsManagementServiceRegistry
|
||||
{
|
||||
@@ -86,6 +88,7 @@ public class RecordsManagementServiceRegistryImpl extends ServiceDescriptorRegis
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry#getRecordsManagementSecurityService()
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public RecordsManagementSecurityService getRecordsManagementSecurityService()
|
||||
{
|
||||
return (RecordsManagementSecurityService) getService(RECORDS_MANAGEMENT_SECURITY_SERVICE);
|
||||
@@ -144,4 +147,13 @@ public class RecordsManagementServiceRegistryImpl extends ServiceDescriptorRegis
|
||||
{
|
||||
return (FilePlanRoleService) getService(FILE_PLAN_ROLE_SERVICE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry#getFilePlanPermissionService()
|
||||
*/
|
||||
@Override
|
||||
public FilePlanPermissionService getFilePlanPermissionService()
|
||||
{
|
||||
return (FilePlanPermissionService) getService(FILE_PLAN_PERMISSION_SERVICE);
|
||||
}
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.repo.audit.extractor.AbstractDataExtractor;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -42,7 +42,7 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
|
||||
{
|
||||
private NodeService nodeService;
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/**
|
||||
* Used to check that the node in the context is a fileplan component
|
||||
@@ -61,11 +61,11 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to get roles
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setRmSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
|
||||
// Get the rm root
|
||||
NodeRef rmRootNodeRef = rmService.getFilePlan(nodeRef);
|
||||
|
||||
Set<Role> roles = rmSecurityService.getRolesByUser(rmRootNodeRef, user);
|
||||
Set<Role> roles = filePlanRoleService.getRolesByUser(rmRootNodeRef, user);
|
||||
StringBuilder sb = new StringBuilder(100);
|
||||
for (Role role : roles)
|
||||
{
|
||||
|
@@ -100,14 +100,12 @@ public class RecordsManagementAuditServiceImpl
|
||||
private static final String MSG_DELETE_OBJECT = "rm.audit.delte-object";
|
||||
private static final String MSG_LOGIN_SUCCEEDED = "rm.audit.login-succeeded";
|
||||
private static final String MSG_LOGIN_FAILED = "rm.audit.login-failed";
|
||||
private static final String MSG_FILED_RECORD = "rm.audit.filed-record";
|
||||
private static final String MSG_REVIEWED = "rm.audit.reviewed";
|
||||
private static final String MSG_CUT_OFF = "rm.audit.cut-off";
|
||||
private static final String MSG_REVERSED_CUT_OFF = "rm.audit.reversed-cut-off";
|
||||
private static final String MSG_DESTROYED_ITEM = "rm.audit.destroyed-item";
|
||||
private static final String MSG_OPENED_RECORD_FOLDER = "rm.audit.opened-record-folder";
|
||||
private static final String MSG_CLOSED_RECORD_FOLDER = "rm.audit.closed-record-folder";
|
||||
private static final String MSG_SETUP_RECORD_FOLDER = "rm.audit.setup-recorder-folder";
|
||||
private static final String MSG_DECLARED_RECORD = "rm.audit.declared-record";
|
||||
private static final String MSG_UNDECLARED_RECORD = "rm.audit.undeclared-record";
|
||||
private static final String MSG_FROZE_ITEM = "rm.audit.froze-item";
|
||||
@@ -920,8 +918,6 @@ public class RecordsManagementAuditServiceImpl
|
||||
Long fromTime = (params.getDateFrom() == null ? null : new Long(params.getDateFrom().getTime()));
|
||||
Long toTime = (params.getDateTo() == null ? null : new Long(params.getDateTo().getTime()));
|
||||
NodeRef nodeRef = params.getNodeRef();
|
||||
String eventName = params.getEvent();
|
||||
QName propertyQName = params.getProperty();
|
||||
int maxEntries = params.getMaxEntries();
|
||||
boolean forward = maxEntries > 0 ? false : true; // Reverse order if the results are limited
|
||||
|
||||
|
@@ -64,6 +64,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
/**
|
||||
* RM After Invocation Provider
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
implements AfterInvocationProvider, InitializingBean
|
||||
{
|
||||
|
@@ -42,7 +42,7 @@ public class ClosedCapabilityCondition extends AbstractCapabilityCondition
|
||||
{
|
||||
result = rmService.isRecordFolderClosed(nodeRef);
|
||||
}
|
||||
else if (rmService.isRecord(nodeRef) == true)
|
||||
else if (recordService.isRecord(nodeRef) == true)
|
||||
{
|
||||
List<ChildAssociationRef> assocs = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
for (ChildAssociationRef assoc : assocs)
|
||||
|
@@ -91,7 +91,7 @@ public class MayBeScheduledCapabilityCondition extends AbstractCapabilityConditi
|
||||
{
|
||||
boolean result = false;
|
||||
boolean isRecordLevelDisposition = dispositionSchedule.isRecordLevelDisposition();
|
||||
if (rmService.isRecord(nodeRef) == true && isRecordLevelDisposition == true)
|
||||
if (recordService.isRecord(nodeRef) == true && isRecordLevelDisposition == true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ public class VitalRecordOrFolderCapabilityCondition extends AbstractCapabilityCo
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
if (rmService.isRecord(nodeRef) == true)
|
||||
if (recordService.isRecord(nodeRef) == true)
|
||||
{
|
||||
// Check the record for the vital record aspect
|
||||
result = nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_VITAL_RECORD);
|
||||
|
@@ -22,7 +22,6 @@ import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -511,7 +510,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
if (! (AuthenticationUtil.isMtEnabled() && AuthenticationUtil.isRunAsUserTheSystemUser()))
|
||||
{
|
||||
// note: userName and userGroupNames must not be null
|
||||
Map<String, List<String>> caveatConstraintDef = caveatConfig.get(constraintName);
|
||||
caveatConfig.get(constraintName);
|
||||
Set<String> userGroupFullNames = authorityService.getAuthoritiesForUser(userName);
|
||||
allowedValues = getRMAllowedValues(userName, userGroupFullNames, constraintName);
|
||||
}
|
||||
|
@@ -15,15 +15,14 @@ import java.util.Map.Entry;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderServiceImpl;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -67,17 +66,14 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
||||
/** Records management service */
|
||||
private RecordsManagementService recordsManagementService;
|
||||
|
||||
/** Records management action service */
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
|
||||
/** Permission service */
|
||||
private PermissionService permissionService;
|
||||
|
||||
/** Authority service */
|
||||
private AuthorityService authorityService;
|
||||
|
||||
/** Records management security service */
|
||||
private RecordsManagementSecurityService recordsManagementSecurityService;
|
||||
/** File plan role service */
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/** Records management search behaviour */
|
||||
private RecordsManagementSearchBehaviour recordsManagementSearchBehaviour;
|
||||
@@ -137,17 +133,6 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set records management action service
|
||||
*
|
||||
* @param recordsManagementActionService the records management action
|
||||
* service
|
||||
*/
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set permission service
|
||||
*
|
||||
@@ -169,14 +154,11 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Set records management security service
|
||||
*
|
||||
* @param recordsManagementSecurityService the records management security
|
||||
* service
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService recordsManagementSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.recordsManagementSecurityService = recordsManagementSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -392,7 +374,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
||||
"All Roles", null);
|
||||
|
||||
// Put all the role groups in it
|
||||
Set<Role> roles = recordsManagementSecurityService.getRoles(rmRoot);
|
||||
Set<Role> roles = filePlanRoleService.getRoles(rmRoot);
|
||||
for (Role role : roles)
|
||||
{
|
||||
logger.info(" - adding role group " + role.getRoleGroupName() + " to all roles group");
|
||||
|
@@ -32,6 +32,7 @@ import org.alfresco.module.org_alfresco_module_rm.action.impl.CompleteEventActio
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
@@ -44,7 +45,7 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
|
||||
/**
|
||||
*
|
||||
* Behaviour executed when a references record is actioned upon.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@@ -69,6 +70,9 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
|
||||
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** Record service */
|
||||
private RecordService recordService;
|
||||
|
||||
/** Action name */
|
||||
private String actionName;
|
||||
@@ -100,19 +104,31 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordsManagementAdminService record management admin service
|
||||
*/
|
||||
public void setRecordsManagementAdminService(RecordsManagementAdminService recordsManagementAdminService)
|
||||
{
|
||||
this.recordsManagementAdminService = recordsManagementAdminService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set policy components
|
||||
*
|
||||
* @param recordService record service
|
||||
*/
|
||||
public void setRecordService(RecordService recordService)
|
||||
{
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param policyComponent policy component
|
||||
*/
|
||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||
@@ -121,15 +137,16 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the reference
|
||||
*
|
||||
* @param reference
|
||||
* @param reference reference name
|
||||
*/
|
||||
public void setReferenceName(String reference)
|
||||
{
|
||||
this.reference = QName.createQName(reference);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param actionName action name
|
||||
*/
|
||||
public void setActionName(String actionName)
|
||||
{
|
||||
this.actionName = actionName;
|
||||
@@ -157,6 +174,13 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Before action exeuction behaviour.
|
||||
*
|
||||
* @param nodeRef
|
||||
* @param name
|
||||
* @param parameters
|
||||
*/
|
||||
public void beforeActionExecution(final NodeRef nodeRef, final String name, final Map<String, Serializable> parameters)
|
||||
{
|
||||
AuthenticationUtil.RunAsWork<Object> work = new AuthenticationUtil.RunAsWork<Object>()
|
||||
@@ -193,7 +217,7 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
|
||||
|
||||
private void processRecordFolder(NodeRef recordFolder)
|
||||
{
|
||||
if (recordsManagementService.isRecord(recordFolder) == true)
|
||||
if (recordService.isRecord(recordFolder) == true)
|
||||
{
|
||||
processRecord(recordFolder);
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ package org.alfresco.module.org_alfresco_module_rm.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -45,34 +44,35 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
{
|
||||
/** Reference to the rm event config node */
|
||||
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
||||
|
||||
private static final NodeRef CONFIG_NODE_REF = new NodeRef(SPACES_STORE, "rm_event_config");
|
||||
|
||||
|
||||
/** Node service */
|
||||
private NodeService nodeService;
|
||||
|
||||
|
||||
/** Content service */
|
||||
private ContentService contentService;
|
||||
|
||||
|
||||
/** Registered event types */
|
||||
private Map<String, RecordsManagementEventType> eventTypes = new HashMap<String, RecordsManagementEventType>(7);
|
||||
|
||||
|
||||
/** Available events */
|
||||
private Map<String, RecordsManagementEvent> events;
|
||||
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the content service
|
||||
*
|
||||
* @param contentService content service
|
||||
* @param contentService content service
|
||||
*/
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
{
|
||||
return new ArrayList<RecordsManagementEventType>(this.eventTypes.values());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#getEvents()
|
||||
*/
|
||||
@@ -102,19 +102,17 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
{
|
||||
return new ArrayList<RecordsManagementEvent>(this.getEventMap().values());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#getEvent(java.lang.String)
|
||||
*/
|
||||
public RecordsManagementEvent getEvent(String eventName)
|
||||
public RecordsManagementEvent getEvent(String eventName)
|
||||
{
|
||||
if (getEventMap().containsKey(eventName) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("The event " + eventName + " does not exist.");
|
||||
}
|
||||
if (getEventMap().containsKey(eventName) == false) { throw new AlfrescoRuntimeException("The event "
|
||||
+ eventName + " does not exist."); }
|
||||
return getEventMap().get(eventName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#existsEvent(java.lang.String)
|
||||
*/
|
||||
@@ -122,46 +120,36 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
{
|
||||
return getEventMap().containsKey(eventName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#existsEventDisplayLabel(java.lang.String)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public boolean existsEventDisplayLabel(String eventDisplayLabel)
|
||||
{
|
||||
for (Iterator iterator = getEventMap().values().iterator(); iterator.hasNext();)
|
||||
{
|
||||
RecordsManagementEvent recordsManagementEvent = (RecordsManagementEvent) iterator.next();
|
||||
if (recordsManagementEvent.getDisplayLabel().equalsIgnoreCase(eventDisplayLabel))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#addEvent(java.lang.String, java.lang.String, java.lang.String)
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#existsEventDisplayLabel(java.lang.String)
|
||||
*/
|
||||
public boolean existsEventDisplayLabel(String eventDisplayLabel)
|
||||
{
|
||||
for (RecordsManagementEvent recordsManagementEvent : getEventMap().values())
|
||||
{
|
||||
if (recordsManagementEvent.getDisplayLabel().equalsIgnoreCase(eventDisplayLabel)) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService#addEvent(java.lang.String,
|
||||
* java.lang.String, java.lang.String)
|
||||
*/
|
||||
public RecordsManagementEvent addEvent(String eventType, String eventName, String eventDisplayLabel)
|
||||
{
|
||||
// Check that the eventType is valid
|
||||
if (eventTypes.containsKey(eventType) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(
|
||||
"Can not add event because event " +
|
||||
eventName +
|
||||
" has an undefined eventType. ("
|
||||
+ eventType + ")");
|
||||
}
|
||||
|
||||
if (eventTypes.containsKey(eventType) == false) { throw new AlfrescoRuntimeException(
|
||||
"Can not add event because event " + eventName + " has an undefined eventType. (" + eventType + ")"); }
|
||||
|
||||
// Create event and add to map
|
||||
RecordsManagementEvent event = new RecordsManagementEvent(eventType, eventName, eventDisplayLabel);
|
||||
getEventMap().put(event.getName(), event);
|
||||
|
||||
|
||||
// Persist the changes to the event list
|
||||
saveEvents();
|
||||
|
||||
|
||||
return new RecordsManagementEvent(eventType, eventName, eventDisplayLabel);
|
||||
}
|
||||
|
||||
@@ -172,15 +160,17 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
{
|
||||
// Remove the event from the map
|
||||
getEventMap().remove(eventName);
|
||||
|
||||
|
||||
// Persist the changes to the event list
|
||||
saveEvents();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to get the event map. Loads initial instance from persisted configuration file.
|
||||
* Helper method to get the event map. Loads initial instance from persisted
|
||||
* configuration file.
|
||||
*
|
||||
* @return Map<String, RecordsManagementEvent> map of available events by event name
|
||||
* @return Map<String, RecordsManagementEvent> map of available events by
|
||||
* event name
|
||||
*/
|
||||
private Map<String, RecordsManagementEvent> getEventMap()
|
||||
{
|
||||
@@ -190,7 +180,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
}
|
||||
return this.events;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the events from the persistant storage
|
||||
*/
|
||||
@@ -201,50 +191,43 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
// Get the event config node
|
||||
if (nodeService.exists(CONFIG_NODE_REF) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to find records management event configuration node.");
|
||||
}
|
||||
|
||||
if (nodeService.exists(CONFIG_NODE_REF) == false) { throw new AlfrescoRuntimeException(
|
||||
"Unable to find records management event configuration node."); }
|
||||
|
||||
// Read content from config node
|
||||
ContentReader reader = contentService.getReader(CONFIG_NODE_REF, ContentModel.PROP_CONTENT);
|
||||
String jsonString = reader.getContentString();
|
||||
|
||||
|
||||
JSONObject configJSON = new JSONObject(jsonString);
|
||||
JSONArray eventsJSON = configJSON.getJSONArray("events");
|
||||
|
||||
|
||||
events = new HashMap<String, RecordsManagementEvent>(eventsJSON.length());
|
||||
|
||||
|
||||
for (int i = 0; i < eventsJSON.length(); i++)
|
||||
{
|
||||
// Get the JSON object that represents the event
|
||||
JSONObject eventJSON = eventsJSON.getJSONObject(i);
|
||||
|
||||
|
||||
// Get the details of the event
|
||||
String eventType = eventJSON.getString("eventType");
|
||||
String eventName = eventJSON.getString("eventName");
|
||||
String eventDisplayLabel = eventJSON.getString("eventDisplayLabel");
|
||||
|
||||
|
||||
// Check that the eventType is valid
|
||||
if (eventTypes.containsKey(eventType) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(
|
||||
"Can not load rm event configuration because event " +
|
||||
eventName +
|
||||
" has an undefined eventType. ("
|
||||
+ eventType + ")");
|
||||
}
|
||||
|
||||
if (eventTypes.containsKey(eventType) == false) { throw new AlfrescoRuntimeException(
|
||||
"Can not load rm event configuration because event " + eventName
|
||||
+ " has an undefined eventType. (" + eventType + ")"); }
|
||||
|
||||
// Create event and add to map
|
||||
RecordsManagementEvent event = new RecordsManagementEvent(eventType, eventName, eventDisplayLabel);
|
||||
events.put(event.getName(), event);
|
||||
events.put(event.getName(), event);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the events to the peristant storage
|
||||
*/
|
||||
@@ -255,14 +238,12 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
// Get the event config node
|
||||
if (nodeService.exists(CONFIG_NODE_REF) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to find records management event configuration node.");
|
||||
}
|
||||
|
||||
JSONObject configJSON = new JSONObject();
|
||||
if (nodeService.exists(CONFIG_NODE_REF) == false) { throw new AlfrescoRuntimeException(
|
||||
"Unable to find records management event configuration node."); }
|
||||
|
||||
JSONObject configJSON = new JSONObject();
|
||||
JSONArray eventsJSON = new JSONArray();
|
||||
|
||||
|
||||
int index = 0;
|
||||
for (RecordsManagementEvent event : events.values())
|
||||
{
|
||||
@@ -270,19 +251,20 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
eventJSON.put("eventType", event.getType());
|
||||
eventJSON.put("eventName", event.getName());
|
||||
eventJSON.put("eventDisplayLabel", event.getDisplayLabel());
|
||||
|
||||
|
||||
eventsJSON.put(index, eventJSON);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
configJSON.put("events", eventsJSON);
|
||||
|
||||
|
||||
// Get content writer
|
||||
ContentWriter contentWriter = contentService.getWriter(CONFIG_NODE_REF, ContentModel.PROP_CONTENT, true);
|
||||
ContentWriter contentWriter = contentService
|
||||
.getWriter(CONFIG_NODE_REF, ContentModel.PROP_CONTENT, true);
|
||||
contentWriter.putContent(configJSON.toString());
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
@@ -294,5 +276,3 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
|
||||
return this.eventTypes.get(eventTypeName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -213,7 +213,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
|
||||
|
||||
protected void addTransientProperties(Form form, NodeRef nodeRef)
|
||||
{
|
||||
if (rmService.isRecord(nodeRef) == true)
|
||||
if (recordService.isRecord(nodeRef) == true)
|
||||
{
|
||||
addTransientPropertyField(form, TRANSIENT_DECLARED, DataTypeDefinition.BOOLEAN, recordService.isDeclared(nodeRef));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.jscript;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.notification.RecordsManagementNotificationHelper;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
import org.alfresco.repo.jscript.ScriptNode;
|
||||
import org.alfresco.scripts.ScriptException;
|
||||
@@ -93,8 +93,8 @@ public class ScriptRecordsManagmentService extends BaseScopableProcessorExtensio
|
||||
*/
|
||||
public void setPermission(ScriptNode node, String permission, String authority)
|
||||
{
|
||||
RecordsManagementSecurityService securityService = rmServices.getRecordsManagementSecurityService();
|
||||
securityService.setPermission(node.getNodeRef(), authority, permission);
|
||||
FilePlanPermissionService filePlanPermissionService = rmServices.getFilePlanPermissionService();
|
||||
filePlanPermissionService.setPermission(node.getNodeRef(), authority, permission);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,8 +106,8 @@ public class ScriptRecordsManagmentService extends BaseScopableProcessorExtensio
|
||||
*/
|
||||
public void deletePermission(ScriptNode node, String permission, String authority)
|
||||
{
|
||||
RecordsManagementSecurityService securityService = rmServices.getRecordsManagementSecurityService();
|
||||
securityService.deletePermission(node.getNodeRef(), authority, permission);
|
||||
FilePlanPermissionService filePlanPermissionService = rmServices.getFilePlanPermissionService();
|
||||
filePlanPermissionService.deletePermission(node.getNodeRef(), authority, permission);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* 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.model.behaviour;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
|
||||
/**
|
||||
* Behaviour associated with the file plan type
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class FilePlanType implements RecordsManagementModel,
|
||||
NodeServicePolicies.OnCreateNodePolicy
|
||||
{
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** Node service */
|
||||
private NodeService nodeService;
|
||||
|
||||
/** Permission service */
|
||||
private PermissionService permissionService;
|
||||
|
||||
/** New record container name */
|
||||
private static final String NAME_NR_CONTAINER = "New Records";
|
||||
|
||||
/**
|
||||
* Set the policy component
|
||||
* @param policyComponent policy component
|
||||
*/
|
||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||
{
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set node service
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setPermissionService(PermissionService permissionService)
|
||||
{
|
||||
this.permissionService = permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bean initialisation method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
// policyComponent.bindClassBehaviour(
|
||||
// NodeServicePolicies.OnCreateNodePolicy.QNAME,
|
||||
// TYPE_FILE_PLAN,
|
||||
// new JavaBehaviour(this, "onCreateNode", NotificationFrequency.TRANSACTION_COMMIT));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
|
||||
*/
|
||||
@Override
|
||||
public void onCreateNode(ChildAssociationRef assoc)
|
||||
{
|
||||
// TODO refactor the file plan behaviours from the service code
|
||||
}
|
||||
}
|
@@ -19,7 +19,6 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
@@ -47,9 +46,6 @@ public class RecordContainerType implements RecordsManagementModel,
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** Records Management Action Service */
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
|
||||
/** Node service */
|
||||
private NodeService nodeService;
|
||||
|
||||
@@ -68,16 +64,6 @@ public class RecordContainerType implements RecordsManagementModel,
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the records management action service
|
||||
*
|
||||
* @param recordsManagementActionService records management action service
|
||||
*/
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set node service
|
||||
*
|
||||
|
@@ -26,12 +26,12 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -66,8 +66,8 @@ public class ModelSecurityServiceImpl implements ModelSecurityService,
|
||||
/** Namespace service */
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
/** Security service */
|
||||
private RecordsManagementSecurityService securityService;
|
||||
/** File plan role service */
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/** Records management service */
|
||||
private RecordsManagementService recordsManagementService;
|
||||
@@ -130,11 +130,11 @@ public class ModelSecurityServiceImpl implements ModelSecurityService,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param securityService records management security service
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setSecurityService(RecordsManagementSecurityService securityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.securityService = securityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,7 +246,7 @@ public class ModelSecurityServiceImpl implements ModelSecurityService,
|
||||
NodeRef filePlan = recordsManagementService.getFilePlan(nodeRef);
|
||||
if (filePlan != null)
|
||||
{
|
||||
Set<Role> roles = securityService.getRolesByUser(filePlan, AuthenticationUtil.getFullyAuthenticatedUser());
|
||||
Set<Role> roles = filePlanRoleService.getRolesByUser(filePlan, AuthenticationUtil.getFullyAuthenticatedUser());
|
||||
for (Role role : roles)
|
||||
{
|
||||
if (Collections.disjoint(role.getCapabilities(), artifact.getCapabilities()) == false)
|
||||
|
@@ -26,8 +26,8 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.repo.notification.EMailNotificationProvider;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
@@ -70,7 +70,7 @@ public class RecordsManagementNotificationHelper
|
||||
/** Services */
|
||||
private NotificationService notificationService;
|
||||
private RecordsManagementService recordsManagementService;
|
||||
private RecordsManagementSecurityService securityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
private SearchService searchService;
|
||||
private NamespaceService namespaceService;
|
||||
private SiteService siteService;
|
||||
@@ -102,11 +102,11 @@ public class RecordsManagementNotificationHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* @param securityService rm security service
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setSecurityService(RecordsManagementSecurityService securityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.securityService = securityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -325,7 +325,7 @@ public class RecordsManagementNotificationHelper
|
||||
public String doWork() throws Exception
|
||||
{
|
||||
// Find the authority for the given role
|
||||
Role role = securityService.getRole(root, notificationRole);
|
||||
Role role = filePlanRoleService.getRole(root, notificationRole);
|
||||
return role.getRoleGroupName();
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
@@ -28,10 +28,10 @@ import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleServiceImpl;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedReaderDynamicAuthority;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityServiceImpl;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.repo.module.AbstractModuleComponent;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -62,8 +62,11 @@ public class RMv21InPlacePatch extends AbstractModuleComponent
|
||||
/** Records management service */
|
||||
private RecordsManagementService recordsManagementService;
|
||||
|
||||
/** Records management security service */
|
||||
private RecordsManagementSecurityService recordsManagementSecurityService;
|
||||
/** File plan permission service */
|
||||
private FilePlanPermissionService filePlanPermissionService;
|
||||
|
||||
/** File plan role service */
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
@@ -90,11 +93,19 @@ public class RMv21InPlacePatch extends AbstractModuleComponent
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordsManagementSecurityService records management security service
|
||||
* @param filePlanPermissionService file plan permission service
|
||||
*/
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService recordsManagementSecurityService)
|
||||
public void setFilePlanPermissionService(FilePlanPermissionService filePlanPermissionService)
|
||||
{
|
||||
this.recordsManagementSecurityService = recordsManagementSecurityService;
|
||||
this.filePlanPermissionService = filePlanPermissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,7 +134,7 @@ public class RMv21InPlacePatch extends AbstractModuleComponent
|
||||
}
|
||||
|
||||
// set permissions
|
||||
recordsManagementSecurityService.setPermission(filePlan, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS);
|
||||
filePlanPermissionService.setPermission(filePlan, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS);
|
||||
permissionService.setPermission(filePlan, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.VIEW_RECORDS, true);
|
||||
|
||||
// create unfiled container
|
||||
@@ -141,7 +152,7 @@ public class RMv21InPlacePatch extends AbstractModuleComponent
|
||||
*/
|
||||
private NodeRef createUnfiledContainer(NodeRef filePlan)
|
||||
{
|
||||
String allRoles = recordsManagementSecurityService.getAllRolesContainerGroup(filePlan);
|
||||
String allRoles = filePlanRoleService.getAllRolesContainerGroup(filePlan);
|
||||
|
||||
// create the properties map
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
|
||||
|
@@ -28,7 +28,6 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.CustomMetadataException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@@ -53,6 +53,7 @@ public class CustomReferenceDefinitionPut extends AbstractRmWebScript
|
||||
private static final String SOURCE = "source";
|
||||
private static final String LABEL = "label";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(CustomReferenceDefinitionPut.class);
|
||||
|
||||
private RecordsManagementAdminService rmAdminService;
|
||||
|
@@ -29,15 +29,14 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* This class provides the implementation for the customrefdefinitions.get webscript.
|
||||
@@ -55,12 +54,6 @@ public class CustomReferenceDefinitionsGet extends DeclarativeWebScript
|
||||
private static Log logger = LogFactory.getLog(CustomReferenceDefinitionsGet.class);
|
||||
|
||||
private RecordsManagementAdminService rmAdminService;
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
this.namespaceService = namespaceService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService)
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.repo.exporter.ACPExportPackageHandler;
|
||||
import org.alfresco.repo.importer.ACPImportPackageHandler;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -41,6 +41,8 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.view.ImporterService;
|
||||
import org.alfresco.service.cmr.view.Location;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
@@ -49,8 +51,6 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.WrappingWebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest;
|
||||
import org.springframework.extensions.webscripts.servlet.FormData.FormField;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public class ImportPost extends DeclarativeWebScript
|
||||
protected DictionaryService dictionaryService;
|
||||
protected ImporterService importerService;
|
||||
protected RecordsManagementService rmService;
|
||||
protected RecordsManagementSecurityService rmSecurityService;
|
||||
protected FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/**
|
||||
* @param nodeService
|
||||
@@ -103,13 +103,11 @@ public class ImportPost extends DeclarativeWebScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RecordsManagementSecurityService instance
|
||||
*
|
||||
* @param rmSecurityService The RecordsManagementSecurityService instance
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,7 +177,7 @@ public class ImportPost extends DeclarativeWebScript
|
||||
// as there is no 'import capability' and the RM admin user is different from
|
||||
// the DM admin user (meaning the webscript 'admin' authentication can't be used)
|
||||
// perform a manual check here to ensure the current user has the RM admin role.
|
||||
boolean isAdmin = this.rmSecurityService.hasRMAdminRole(
|
||||
boolean isAdmin = filePlanRoleService.hasRMAdminRole(
|
||||
this.rmService.getFilePlan(destination),
|
||||
AuthenticationUtil.getRunAsUser());
|
||||
if (!isAdmin)
|
||||
|
@@ -41,7 +41,6 @@ public class RMConstraintGet extends DeclarativeWebScript
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
String requestUrl = req.getURL();
|
||||
String extensionPath = req.getExtensionPath();
|
||||
|
||||
String constraintName = extensionPath.replace('_', ':');
|
||||
|
@@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
@@ -51,7 +51,7 @@ public class UserRightsReportGet extends DeclarativeWebScript
|
||||
protected PersonService personService;
|
||||
protected NodeService nodeService;
|
||||
protected RecordsManagementService rmService;
|
||||
protected RecordsManagementSecurityService rmSecurityService;
|
||||
protected FilePlanRoleService filePlanRoleService;
|
||||
|
||||
/**
|
||||
* Sets the AuthorityService instance
|
||||
@@ -84,23 +84,19 @@ public class UserRightsReportGet extends DeclarativeWebScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RecordsManagementService instance
|
||||
*
|
||||
* @param rmService The RecordsManagementService instance
|
||||
* @param recordsManagementService records management service
|
||||
*/
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
this.rmService = recordsManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RecordsManagementSecurityService instance
|
||||
*
|
||||
* @param rmSecurityService The RecordsManagementSecurityService instance
|
||||
* @param filePlanRoleService file plan role service
|
||||
*/
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -128,7 +124,7 @@ public class UserRightsReportGet extends DeclarativeWebScript
|
||||
NodeRef rmRootNode = rmRoots.get(0);
|
||||
|
||||
// iterate over all the roles for the file plan and construct models
|
||||
Set<Role> roles = this.rmSecurityService.getRoles(rmRootNode);
|
||||
Set<Role> roles = this.filePlanRoleService.getRoles(rmRootNode);
|
||||
for (Role role : roles)
|
||||
{
|
||||
// get or create the RoleModel object for current role
|
||||
|
@@ -23,15 +23,15 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -44,11 +44,11 @@ public class RmRoleDelete extends DeclarativeWebScript
|
||||
private static Log logger = LogFactory.getLog(RmRoleDelete.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
@@ -73,12 +73,12 @@ public class RmRoleDelete extends DeclarativeWebScript
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
// Check that the role exists
|
||||
if (rmSecurityService.existsRole(root, roleParam) == false)
|
||||
if (filePlanRoleService.existsRole(root, roleParam) == false)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The role " + roleParam + " does not exist on the records managment root " + root);
|
||||
}
|
||||
|
||||
rmSecurityService.deleteRole(root, roleParam);
|
||||
filePlanRoleService.deleteRole(root, roleParam);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
@@ -23,15 +23,15 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -44,11 +44,11 @@ public class RmRoleGet extends DeclarativeWebScript
|
||||
private static Log logger = LogFactory.getLog(RmRoleGet.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
@@ -75,12 +75,12 @@ public class RmRoleGet extends DeclarativeWebScript
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
// Check that the role exists
|
||||
if (rmSecurityService.existsRole(root, roleParam) == false)
|
||||
if (filePlanRoleService.existsRole(root, roleParam) == false)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The role " + roleParam + " does not exist on the records managment root " + root);
|
||||
}
|
||||
|
||||
model.put("role", rmSecurityService.getRole(root, roleParam));
|
||||
model.put("role", filePlanRoleService.getRole(root, roleParam));
|
||||
|
||||
return model;
|
||||
}
|
||||
|
@@ -28,8 +28,8 @@ import java.util.Set;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -54,12 +54,12 @@ public class RmRolePut extends DeclarativeWebScript
|
||||
private static Log logger = LogFactory.getLog(RmRolePut.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private CapabilityService capabilityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
@@ -105,12 +105,12 @@ public class RmRolePut extends DeclarativeWebScript
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
// Check that the role exists
|
||||
if (rmSecurityService.existsRole(root, roleParam) == false)
|
||||
if (filePlanRoleService.existsRole(root, roleParam) == false)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The role " + roleParam + " does not exist on the records managment root " + root);
|
||||
}
|
||||
|
||||
Role role = rmSecurityService.updateRole(root, name, displayLabel, capabilites);
|
||||
Role role = filePlanRoleService.updateRole(root, name, displayLabel, capabilites);
|
||||
model.put("role", role);
|
||||
|
||||
}
|
||||
|
@@ -25,69 +25,70 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Get information about record management roles
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class RmRolesGet extends DeclarativeWebScript
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(RmRolesGet.class);
|
||||
@SuppressWarnings("unused")
|
||||
private static Log logger = LogFactory.getLog(RmRolesGet.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private RecordsManagementService rmService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
}
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
}
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Set<Role> roles = null;
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
}
|
||||
|
||||
// TODO should be passed
|
||||
List<NodeRef> roots = rmService.getFilePlans();
|
||||
if (roots != null && roots.size() > 0)
|
||||
{
|
||||
NodeRef root = roots.get(0);
|
||||
@Override
|
||||
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Set<Role> roles = null;
|
||||
|
||||
// Get the user filter
|
||||
String user = req.getParameter("user");
|
||||
if (user != null && user.length() != 0)
|
||||
{
|
||||
roles = rmSecurityService.getRolesByUser(root, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = rmSecurityService.getRoles(root);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = new HashSet<Role>(1);
|
||||
}
|
||||
// TODO should be passed
|
||||
List<NodeRef> roots = rmService.getFilePlans();
|
||||
if (roots != null && roots.size() > 0)
|
||||
{
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
model.put("roles", roles);
|
||||
// Get the user filter
|
||||
String user = req.getParameter("user");
|
||||
if (user != null && user.length() != 0)
|
||||
{
|
||||
roles = filePlanRoleService.getRolesByUser(root, user);
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = filePlanRoleService.getRoles(root);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
roles = new HashSet<Role>(1);
|
||||
}
|
||||
|
||||
return model;
|
||||
model.put("roles", roles);
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
@@ -28,8 +28,8 @@ import java.util.Set;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -54,12 +54,12 @@ public class RmRolesPost extends DeclarativeWebScript
|
||||
private static Log logger = LogFactory.getLog(RmRolesPost.class);
|
||||
|
||||
private RecordsManagementService rmService;
|
||||
private RecordsManagementSecurityService rmSecurityService;
|
||||
private FilePlanRoleService filePlanRoleService;
|
||||
private CapabilityService capabilityService;
|
||||
|
||||
public void setRecordsManagementSecurityService(RecordsManagementSecurityService rmSecurityService)
|
||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||
{
|
||||
this.rmSecurityService = rmSecurityService;
|
||||
this.filePlanRoleService = filePlanRoleService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
@@ -96,7 +96,7 @@ public class RmRolesPost extends DeclarativeWebScript
|
||||
List<NodeRef> roots = rmService.getFilePlans();
|
||||
NodeRef root = roots.get(0);
|
||||
|
||||
Role role = rmSecurityService.createRole(root, name, displayString, capabilites);
|
||||
Role role = filePlanRoleService.createRole(root, name, displayString, capabilites);
|
||||
|
||||
//Set<Role> roles = rmSecurityService.getRoles(root);
|
||||
model.put("role", role);
|
||||
|
@@ -85,7 +85,7 @@ public class CompositeCapabilityTest extends BaseRMTestCase
|
||||
// Give all the users file permission objects
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(rmContainer, user, RMPermissionModel.FILING);
|
||||
filePlanPermissionService.setPermission(rmContainer, user, RMPermissionModel.FILING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.CapabilityCondition;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.CompositeCapability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.DeclarativeCapability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -134,9 +134,9 @@ public class DeclarativeCapabilityTest extends BaseRMTestCase
|
||||
// Give all the users file permission objects
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(rmFolder, user, RMPermissionModel.FILING);
|
||||
securityService.setPermission(moveToFolder, user, RMPermissionModel.READ_RECORDS);
|
||||
securityService.setPermission(moveToCategory, user, RMPermissionModel.READ_RECORDS);
|
||||
filePlanPermissionService.setPermission(rmFolder, user, RMPermissionModel.FILING);
|
||||
filePlanPermissionService.setPermission(moveToFolder, user, RMPermissionModel.READ_RECORDS);
|
||||
filePlanPermissionService.setPermission(moveToCategory, user, RMPermissionModel.READ_RECORDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ public class DeclarativeCapabilityTest extends BaseRMTestCase
|
||||
{
|
||||
AccessStatus accessStatus = capability.hasPermission(filePlanComponent);
|
||||
|
||||
Set<Role> roles = securityService.getRolesByUser(filePlan, userName);
|
||||
Set<Role> roles = filePlanRoleService.getRolesByUser(filePlan, userName);
|
||||
if (roles.isEmpty() == true)
|
||||
{
|
||||
assertEquals("User " + userName + " has no RM role so we expect access to be denied for capability " + capability.getName(),
|
||||
@@ -339,7 +339,7 @@ public class DeclarativeCapabilityTest extends BaseRMTestCase
|
||||
{
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(moveToFolder, user, RMPermissionModel.FILING);
|
||||
filePlanPermissionService.setPermission(moveToFolder, user, RMPermissionModel.FILING);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -435,7 +435,7 @@ public class DeclarativeCapabilityTest extends BaseRMTestCase
|
||||
{
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(moveToCategory, user, RMPermissionModel.FILING);
|
||||
filePlanPermissionService.setPermission(moveToCategory, user, RMPermissionModel.FILING);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -18,11 +18,8 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.security;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
|
||||
/**
|
||||
* Tests method level security of core alfresco services.
|
||||
@@ -66,7 +63,7 @@ public class MethodSecurityTest extends BaseRMTestCase implements RMPermissionMo
|
||||
@Override
|
||||
public Void run()
|
||||
{
|
||||
securityService.setPermission(rmContainer, rmUserName, READ_RECORDS);
|
||||
filePlanPermissionService.setPermission(rmContainer, rmUserName, READ_RECORDS);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -134,8 +134,8 @@ public class RecordsManagementAuditServiceImplTest extends BaseRMTestCase
|
||||
// Give all the users file permission objects
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(filePlan, user, FILING);
|
||||
securityService.setPermission(rmContainer, user, FILING);
|
||||
filePlanPermissionService.setPermission(filePlan, user, FILING);
|
||||
filePlanPermissionService.setPermission(rmContainer, user, FILING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,7 @@ import org.alfresco.util.TestWithUserUtils;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class RecordsManagementSearchServiceImplTest extends BaseRMTestCase
|
||||
{
|
||||
@Override
|
||||
@@ -50,7 +51,7 @@ public class RecordsManagementSearchServiceImplTest extends BaseRMTestCase
|
||||
|
||||
private NodeRef folderLevelRecordFolder;
|
||||
private NodeRef recordLevelRecordFolder;
|
||||
|
||||
|
||||
private NodeRef recordOne;
|
||||
private NodeRef recordTwo;
|
||||
private NodeRef recordThree;
|
||||
|
@@ -23,7 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.notification.RecordsManagementNotificationHelper;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -92,7 +92,7 @@ public class NotificationServiceHelperSystemTest extends BaseRMTestCase
|
||||
person = personService.createPerson(props);
|
||||
|
||||
// Find the authority for the given role
|
||||
Role role = securityService.getRole(filePlan, NOTIFICATION_ROLE);
|
||||
Role role = filePlanRoleService.getRole(filePlan, NOTIFICATION_ROLE);
|
||||
assertNotNull("Notification role could not be retrieved", role);
|
||||
String roleGroup = role.getRoleGroupName();
|
||||
assertNotNull("Notification role group can not be null.", roleGroup);
|
||||
|
@@ -36,8 +36,9 @@ import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RmSiteType;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -122,7 +123,8 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
protected RecordsManagementAdminService adminService;
|
||||
protected RecordsManagementActionService actionService;
|
||||
protected RecordsManagementSearchService rmSearchService;
|
||||
protected RecordsManagementSecurityService securityService;
|
||||
protected FilePlanRoleService filePlanRoleService;
|
||||
protected FilePlanPermissionService filePlanPermissionService;
|
||||
protected CapabilityService capabilityService;
|
||||
protected VitalRecordService vitalRecordService;
|
||||
protected DataSetService dataSetService;
|
||||
@@ -338,7 +340,8 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
adminService = (RecordsManagementAdminService)applicationContext.getBean("RecordsManagementAdminService");
|
||||
actionService = (RecordsManagementActionService)this.applicationContext.getBean("RecordsManagementActionService");
|
||||
rmSearchService = (RecordsManagementSearchService)this.applicationContext.getBean("RecordsManagementSearchService");
|
||||
securityService = (RecordsManagementSecurityService)this.applicationContext.getBean("RecordsManagementSecurityService");
|
||||
filePlanRoleService = (FilePlanRoleService)this.applicationContext.getBean("FilePlanRoleService");
|
||||
filePlanPermissionService = (FilePlanPermissionService)this.applicationContext.getBean("FilePlanPermissionService");
|
||||
capabilityService = (CapabilityService)this.applicationContext.getBean("CapabilityService");
|
||||
vitalRecordService = (VitalRecordService)this.applicationContext.getBean("VitalRecordService");
|
||||
dataSetService = (DataSetService) applicationContext.getBean("DataSetService");
|
||||
@@ -505,23 +508,23 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
|
||||
rmUserName = GUID.generate();
|
||||
rmUserPerson = createPerson(rmUserName);
|
||||
securityService.assignRoleToAuthority(filePlan, "User", rmUserName);
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, "User", rmUserName);
|
||||
|
||||
powerUserName = GUID.generate();
|
||||
powerUserPerson = createPerson(powerUserName);
|
||||
securityService.assignRoleToAuthority(filePlan, "PowerUser", powerUserName);
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, "PowerUser", powerUserName);
|
||||
|
||||
securityOfficerName = GUID.generate();
|
||||
securityOfficerPerson = createPerson(securityOfficerName);
|
||||
securityService.assignRoleToAuthority(filePlan, "SecurityOfficer", securityOfficerName);
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, "SecurityOfficer", securityOfficerName);
|
||||
|
||||
recordsManagerName = GUID.generate();
|
||||
recordsManagerPerson = createPerson(recordsManagerName);
|
||||
securityService.assignRoleToAuthority(filePlan, "RecordsManager", recordsManagerName);
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, "RecordsManager", recordsManagerName);
|
||||
|
||||
rmAdminName = GUID.generate();
|
||||
rmAdminPerson = createPerson(rmAdminName);
|
||||
securityService.assignRoleToAuthority(filePlan, "Administrator", rmAdminName);
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, "Administrator", rmAdminName);
|
||||
|
||||
testUsers = new String[]
|
||||
{
|
||||
@@ -538,8 +541,8 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
// Give all the users file permission objects
|
||||
for (String user : testUsers)
|
||||
{
|
||||
securityService.setPermission(filePlan, user, FILING);
|
||||
securityService.setPermission(rmContainer, user, FILING);
|
||||
filePlanPermissionService.setPermission(filePlan, user, FILING);
|
||||
filePlanPermissionService.setPermission(rmContainer, user, FILING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,8 +33,9 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService
|
||||
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEventService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RmSiteType;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -89,7 +90,8 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
||||
protected RecordsManagementAdminService adminService;
|
||||
protected RecordsManagementActionService actionService;
|
||||
protected RecordsManagementSearchService rmSearchService;
|
||||
protected RecordsManagementSecurityService securityService;
|
||||
protected FilePlanRoleService filePlanRoleService;
|
||||
protected FilePlanPermissionService filePlanPermissionService;
|
||||
protected RecordsManagementAuditService auditService;
|
||||
protected CapabilityService capabilityService;
|
||||
protected VitalRecordService vitalRecordService;
|
||||
@@ -148,7 +150,8 @@ public class BaseRMWebScriptTestCase extends BaseWebScriptTest
|
||||
adminService = (RecordsManagementAdminService)applicationContext.getBean("RecordsManagementAdminService");
|
||||
actionService = (RecordsManagementActionService)applicationContext.getBean("RecordsManagementActionService");
|
||||
rmSearchService = (RecordsManagementSearchService)applicationContext.getBean("RecordsManagementSearchService");
|
||||
securityService = (RecordsManagementSecurityService)applicationContext.getBean("RecordsManagementSecurityService");
|
||||
filePlanRoleService = (FilePlanRoleService)applicationContext.getBean("FilePlanRoleService");
|
||||
filePlanPermissionService = (FilePlanPermissionService)applicationContext.getBean("FilePlanPermissionService");
|
||||
auditService = (RecordsManagementAuditService)applicationContext.getBean("RecordsManagementAuditService");
|
||||
capabilityService = (CapabilityService)applicationContext.getBean("CapabilityService");
|
||||
vitalRecordService = (VitalRecordService)applicationContext.getBean("VitalRecordService");
|
||||
|
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMWebScriptTestCase;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.security.MutableAuthenticationService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
@@ -42,6 +41,7 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
|
||||
*
|
||||
* @author Mark Rogers
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class RMCaveatConfigScriptTest extends BaseRMWebScriptTestCase
|
||||
{
|
||||
private MutableAuthenticationService authenticationService;
|
||||
@@ -90,7 +90,7 @@ public class RMCaveatConfigScriptTest extends BaseRMWebScriptTestCase
|
||||
|
||||
JSONObject top = new JSONObject(response.getContentAsString());
|
||||
System.out.println(response.getContentAsString());
|
||||
JSONArray data = top.getJSONArray("data");
|
||||
assertNotNull(top.getJSONArray("data"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +167,7 @@ public class RMCaveatConfigScriptTest extends BaseRMWebScriptTestCase
|
||||
|
||||
String constraintName = data.getString("constraintName");
|
||||
assertNotNull("constraintName is null", constraintName);
|
||||
JSONArray allowedValues = data.getJSONArray("allowedValues");
|
||||
// JSONArray allowedValues = data.getJSONArray("allowedValues");
|
||||
|
||||
// assertTrue("values not correct", compare(array, allowedValues));
|
||||
|
||||
|
@@ -38,7 +38,8 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsManagementModel
|
||||
public class RoleRestApiTest extends BaseRMWebScriptTestCase
|
||||
implements RecordsManagementModel
|
||||
{
|
||||
protected static final String GET_ROLES_URL = "/api/rma/admin/rmroles";
|
||||
protected static final String SERVICE_URL_PREFIX = "/alfresco/service";
|
||||
@@ -50,11 +51,11 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
String role2 = GUID.generate();
|
||||
|
||||
// Create a couple or roles by hand
|
||||
securityService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
securityService.createRole(filePlan, role2, "My Test Role Too", getListOfCapabilities(5));
|
||||
filePlanRoleService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
filePlanRoleService.createRole(filePlan, role2, "My Test Role Too", getListOfCapabilities(5));
|
||||
|
||||
// Add the admin user to one of the roles
|
||||
securityService.assignRoleToAuthority(filePlan, role1, "admin");
|
||||
filePlanRoleService.assignRoleToAuthority(filePlan, role1, "admin");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -103,8 +104,8 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
finally
|
||||
{
|
||||
// Clean up
|
||||
securityService.deleteRole(filePlan, role1);
|
||||
securityService.deleteRole(filePlan, role2);
|
||||
filePlanRoleService.deleteRole(filePlan, role1);
|
||||
filePlanRoleService.deleteRole(filePlan, role2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -143,7 +144,7 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
}
|
||||
finally
|
||||
{
|
||||
securityService.deleteRole(filePlan, roleName);
|
||||
filePlanRoleService.deleteRole(filePlan, roleName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
public void testPutRole() throws Exception
|
||||
{
|
||||
String role1 = GUID.generate();
|
||||
securityService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
filePlanRoleService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
|
||||
try
|
||||
{
|
||||
@@ -189,7 +190,7 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
finally
|
||||
{
|
||||
// Clean up
|
||||
securityService.deleteRole(filePlan, role1);
|
||||
filePlanRoleService.deleteRole(filePlan, role1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -197,7 +198,7 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
public void testGetRole() throws Exception
|
||||
{
|
||||
String role1 = GUID.generate();
|
||||
securityService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
filePlanRoleService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
|
||||
try
|
||||
{
|
||||
@@ -222,7 +223,7 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
finally
|
||||
{
|
||||
// Clean up
|
||||
securityService.deleteRole(filePlan, role1);
|
||||
filePlanRoleService.deleteRole(filePlan, role1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -230,11 +231,11 @@ public class RoleRestApiTest extends BaseRMWebScriptTestCase implements RecordsM
|
||||
public void testDeleteRole() throws Exception
|
||||
{
|
||||
String role1 = GUID.generate();
|
||||
assertFalse(securityService.existsRole(filePlan, role1));
|
||||
securityService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
assertTrue(securityService.existsRole(filePlan, role1));
|
||||
assertFalse(filePlanRoleService.existsRole(filePlan, role1));
|
||||
filePlanRoleService.createRole(filePlan, role1, "My Test Role", getListOfCapabilities(5));
|
||||
assertTrue(filePlanRoleService.existsRole(filePlan, role1));
|
||||
sendRequest(new DeleteRequest(GET_ROLES_URL + "/" + role1),200);
|
||||
assertFalse(securityService.existsRole(filePlan, role1));
|
||||
assertFalse(filePlanRoleService.existsRole(filePlan, role1));
|
||||
|
||||
// Bad request
|
||||
sendRequest(new DeleteRequest(GET_ROLES_URL + "/cheese"), 404);
|
||||
|
Reference in New Issue
Block a user