mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1099 (Refactor Transfer and Accession reports)
* Added a new FileTransferReport capability git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@58682 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -137,6 +137,26 @@
|
|||||||
<property name="index" value="110" />
|
<property name="index" value="110" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- file transfer report capability -->
|
||||||
|
<bean id="rmFileTransferReportCapability"
|
||||||
|
parent="declarativeCapability">
|
||||||
|
<property name="name" value="FileTransferReport" />
|
||||||
|
<property name="permission" value="FileTransferReport" />
|
||||||
|
<property name="kinds">
|
||||||
|
<list>
|
||||||
|
<value>TRANSFER</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
<property name="conditions">
|
||||||
|
<map>
|
||||||
|
<entry key="capabilityCondition.filling" value="true"/>
|
||||||
|
<entry key="capabilityCondition.frozen" value="false"/>
|
||||||
|
</map>
|
||||||
|
</property>
|
||||||
|
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
|
||||||
|
<property name="index" value="120" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- Non-assignable Capabilities -->
|
<!-- Non-assignable Capabilities -->
|
||||||
|
|
||||||
<bean id="rmInitiateAllTransfersCapability"
|
<bean id="rmInitiateAllTransfersCapability"
|
||||||
|
@@ -54,6 +54,8 @@ capability.DestroyRecordsScheduledForDestruction.title=Destroy Records Scheduled
|
|||||||
capability.DestroyRecords.title=Destroy Records
|
capability.DestroyRecords.title=Destroy Records
|
||||||
capability.DeleteRecords.title=Delete Records
|
capability.DeleteRecords.title=Delete Records
|
||||||
capability.TriggerAnEvent.title=Trigger An Event
|
capability.TriggerAnEvent.title=Trigger An Event
|
||||||
|
capability.FileDestructionReport.title=File Destruction Report
|
||||||
|
capability.FileTransferReport.title=File Transfer Report
|
||||||
|
|
||||||
# Hold Controls
|
# Hold Controls
|
||||||
capability.group.holdControls.title=Hold Controls
|
capability.group.holdControls.title=Hold Controls
|
||||||
|
@@ -87,6 +87,8 @@
|
|||||||
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="FileUnfiledRecords"/>
|
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="FileUnfiledRecords"/>
|
||||||
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="RejectRecords"/>
|
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="RejectRecords"/>
|
||||||
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="LinkToRecords"/>
|
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="LinkToRecords"/>
|
||||||
|
<!-- Since V2.2 -->
|
||||||
|
<includePermissionGroup type="rma:filePlanComponent" permissionGroup="FileTransferReport"/>
|
||||||
</permissionGroup>
|
</permissionGroup>
|
||||||
|
|
||||||
<permissionGroup name="Filing" allowFullControl="false" expose="true">
|
<permissionGroup name="Filing" allowFullControl="false" expose="true">
|
||||||
@@ -167,6 +169,9 @@
|
|||||||
<permissionGroup name="FileUnfiledRecords" expose="false" allowFullControl="false"/>
|
<permissionGroup name="FileUnfiledRecords" expose="false" allowFullControl="false"/>
|
||||||
<permissionGroup name="LinkToRecords" expose="false" allowFullControl="false"/>
|
<permissionGroup name="LinkToRecords" expose="false" allowFullControl="false"/>
|
||||||
|
|
||||||
|
<!-- Added since V2.2 -->
|
||||||
|
<permissionGroup name="FileTransferReport" expose="false" allowFullControl="false"/>
|
||||||
|
|
||||||
<!-- End -->
|
<!-- End -->
|
||||||
|
|
||||||
<permission name="_ReadRecords" expose="false">
|
<permission name="_ReadRecords" expose="false">
|
||||||
@@ -427,6 +432,10 @@
|
|||||||
<grantedToGroup permissionGroup="FileDestructionReport"/>
|
<grantedToGroup permissionGroup="FileDestructionReport"/>
|
||||||
</permission>
|
</permission>
|
||||||
|
|
||||||
|
<permission name="_FileTransferReport" expose="false">
|
||||||
|
<grantedToGroup permissionGroup="FileTransferReport"/>
|
||||||
|
</permission>
|
||||||
|
|
||||||
<permission name="_FileUnfiledRecords" expose="false">
|
<permission name="_FileUnfiledRecords" expose="false">
|
||||||
<grantedToGroup permissionGroup="FileUnfiledRecords"/>
|
<grantedToGroup permissionGroup="FileUnfiledRecords"/>
|
||||||
</permission>
|
</permission>
|
||||||
|
@@ -3,11 +3,21 @@
|
|||||||
|
|
||||||
<beans>
|
<beans>
|
||||||
|
|
||||||
|
<!-- Base bean definitions -->
|
||||||
|
|
||||||
<bean id="rm.baseModulePatch" abstract="true" parent="module.baseComponent">
|
<bean id="rm.baseModulePatch" abstract="true" parent="module.baseComponent">
|
||||||
<property name="retryingTransactionHelper" ref="retryingTransactionHelper"/>
|
<property name="retryingTransactionHelper" ref="retryingTransactionHelper"/>
|
||||||
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="rm.baseCapabilityPatch" abstract="true" parent="rm.baseModulePatch">
|
||||||
|
<property name="filePlanService" ref="FilePlanService"/>
|
||||||
|
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
||||||
|
<property name="capabilityService" ref="CapabilityService"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- RM v2.0 Patches -->
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_notificationTemplatePatch"
|
<bean id="org_alfresco_module_rm_notificationTemplatePatch"
|
||||||
parent="rm.baseModulePatch"
|
parent="rm.baseModulePatch"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.NotificationTemplatePatch">
|
class="org.alfresco.module.org_alfresco_module_rm.patch.NotificationTemplatePatch">
|
||||||
@@ -23,24 +33,6 @@
|
|||||||
<property name="auditService" ref="AuditService"/>
|
<property name="auditService" ref="AuditService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_notificationTemplatePatch_v21"
|
|
||||||
parent="rm.baseModulePatch"
|
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.NotificationTemplatePatch_v21">
|
|
||||||
<property name="moduleId" value="org_alfresco_module_rm"/>
|
|
||||||
<property name="name" value="org_alfresco_module_rm_notificationTemplatePatch_v21"/>
|
|
||||||
<property name="description" value="Patches new versions of the notification templates."/>
|
|
||||||
<property name="sinceVersion" value="2.1"/>
|
|
||||||
<property name="appliesFromVersion" value="2.1"/>
|
|
||||||
<property name="dependsOn">
|
|
||||||
<list>
|
|
||||||
<ref bean="org_alfresco_module_rm_bootstrapData" />
|
|
||||||
</list>
|
|
||||||
</property>
|
|
||||||
<property name="nodeService" ref="NodeService"/>
|
|
||||||
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
|
||||||
<property name="contentService" ref="ContentService"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv2ModelPatch"
|
<bean id="org_alfresco_module_rm_RMv2ModelPatch"
|
||||||
parent="rm.baseModulePatch"
|
parent="rm.baseModulePatch"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv2ModelPatch">
|
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv2ModelPatch">
|
||||||
@@ -84,6 +76,26 @@
|
|||||||
<property name="contentService" ref="ContentService"/>
|
<property name="contentService" ref="ContentService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- RM v2.1 Patches -->
|
||||||
|
|
||||||
|
<bean id="org_alfresco_module_rm_notificationTemplatePatch_v21"
|
||||||
|
parent="rm.baseModulePatch"
|
||||||
|
class="org.alfresco.module.org_alfresco_module_rm.patch.NotificationTemplatePatch_v21">
|
||||||
|
<property name="moduleId" value="org_alfresco_module_rm"/>
|
||||||
|
<property name="name" value="org_alfresco_module_rm_notificationTemplatePatch_v21"/>
|
||||||
|
<property name="description" value="Patches new versions of the notification templates."/>
|
||||||
|
<property name="sinceVersion" value="2.1"/>
|
||||||
|
<property name="appliesFromVersion" value="2.1"/>
|
||||||
|
<property name="dependsOn">
|
||||||
|
<list>
|
||||||
|
<ref bean="org_alfresco_module_rm_bootstrapData" />
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
<property name="nodeService" ref="NodeService"/>
|
||||||
|
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
||||||
|
<property name="contentService" ref="ContentService"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv21InPlacePatch"
|
<bean id="org_alfresco_module_rm_RMv21InPlacePatch"
|
||||||
parent="rm.baseModulePatch"
|
parent="rm.baseModulePatch"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv21InPlacePatch">
|
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv21InPlacePatch">
|
||||||
@@ -101,16 +113,13 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv21CapabilityPatch"
|
<bean id="org_alfresco_module_rm_RMv21CapabilityPatch"
|
||||||
parent="rm.baseModulePatch"
|
parent="rm.baseCapabilityPatch"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv21CapabilityPatch">
|
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv21CapabilityPatch">
|
||||||
<property name="moduleId" value="org_alfresco_module_rm"/>
|
<property name="moduleId" value="org_alfresco_module_rm"/>
|
||||||
<property name="name" value="org_alfresco_module_rm_RMv21CapabilityPatch"/>
|
<property name="name" value="org_alfresco_module_rm_RMv21CapabilityPatch"/>
|
||||||
<property name="description" value="Patches the existing RM data for the RM v2.1 updated capabilities."/>
|
<property name="description" value="Patches the existing RM data for the RM v2.1 updated capabilities."/>
|
||||||
<property name="sinceVersion" value="2.1"/>
|
<property name="sinceVersion" value="2.1"/>
|
||||||
<property name="appliesFromVersion" value="2.1"/>
|
<property name="appliesFromVersion" value="2.1"/>
|
||||||
<property name="filePlanService" ref="FilePlanService"/>
|
|
||||||
<property name="filePlanRoleService" ref="FilePlanRoleService"/>
|
|
||||||
<property name="capabilityService" ref="CapabilityService"/>
|
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv2RMAdminUserPatch"
|
<bean id="org_alfresco_module_rm_RMv2RMAdminUserPatch"
|
||||||
@@ -180,6 +189,8 @@
|
|||||||
<property name="nodeService" ref="NodeService"/>
|
<property name="nodeService" ref="NodeService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- RM v2.2 Patches -->
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv22ReportTemplatePatch"
|
<bean id="org_alfresco_module_rm_RMv22ReportTemplatePatch"
|
||||||
parent="rm.baseModulePatch"
|
parent="rm.baseModulePatch"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv22ReportTemplatePatch">
|
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv22ReportTemplatePatch">
|
||||||
@@ -197,4 +208,14 @@
|
|||||||
<property name="contentService" ref="ContentService"/>
|
<property name="contentService" ref="ContentService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="org_alfresco_module_rm_RMv22CapabilityPatch"
|
||||||
|
parent="rm.baseCapabilityPatch"
|
||||||
|
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv22CapabilityPatch">
|
||||||
|
<property name="moduleId" value="org_alfresco_module_rm"/>
|
||||||
|
<property name="name" value="org_alfresco_module_rm_RMv22CapabilityPatch"/>
|
||||||
|
<property name="description" value="Patches the existing RM data for the RM v2.2 updated capabilities."/>
|
||||||
|
<property name="sinceVersion" value="2.2"/>
|
||||||
|
<property name="appliesFromVersion" value="2.2"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
@@ -115,8 +115,7 @@
|
|||||||
<bean id="transferReport_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
<bean id="transferReport_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
||||||
<property name="objectDefinitionSource">
|
<property name="objectDefinitionSource">
|
||||||
<value>
|
<value>
|
||||||
<!-- FIXME: Which capability do we need to check? -->
|
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.FileTransferReport
|
||||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW
|
|
||||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
|
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
|
||||||
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
|
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
|
||||||
</value>
|
</value>
|
||||||
|
@@ -426,6 +426,17 @@
|
|||||||
<property name="capability" value ="FileDestructionReport"/>
|
<property name="capability" value ="FileDestructionReport"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="jsonConversionComponent.fileTransferReportAction"
|
||||||
|
parent="jsonConversionComponent.baseAction">
|
||||||
|
<property name="name" value="fileTransferReport"/>
|
||||||
|
<property name="kinds">
|
||||||
|
<set>
|
||||||
|
<value>TRANSFER</value>
|
||||||
|
</set>
|
||||||
|
</property>
|
||||||
|
<property name="capability" value ="FileTransferReport"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean id="jsonConversionComponent.transferAction"
|
<bean id="jsonConversionComponent.transferAction"
|
||||||
parent="jsonConversionComponent.baseAction">
|
parent="jsonConversionComponent.baseAction">
|
||||||
<property name="name" value="transfer"/>
|
<property name="name" value="transfer"/>
|
||||||
@@ -613,11 +624,6 @@
|
|||||||
<property name="name" value="downloadZip"/>
|
<property name="name" value="downloadZip"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="jsonConversionComponent.fileReport"
|
|
||||||
parent="jsonConversionComponent.baseAction">
|
|
||||||
<property name="name" value="fileReport"/>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="jsonConversionComponent.transferComplete"
|
<bean id="jsonConversionComponent.transferComplete"
|
||||||
parent="jsonConversionComponent.baseAction">
|
parent="jsonConversionComponent.baseAction">
|
||||||
<property name="name" value="transferComplete"/>
|
<property name="name" value="transferComplete"/>
|
||||||
|
@@ -137,7 +137,8 @@
|
|||||||
"FileDestructionReport",
|
"FileDestructionReport",
|
||||||
"FileUnfiledRecords",
|
"FileUnfiledRecords",
|
||||||
"RejectRecords",
|
"RejectRecords",
|
||||||
"LinkToRecords"
|
"LinkToRecords",
|
||||||
|
"FileTransferReport"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -203,7 +204,8 @@
|
|||||||
"FileDestructionReport",
|
"FileDestructionReport",
|
||||||
"FileUnfiledRecords",
|
"FileUnfiledRecords",
|
||||||
"RejectRecords",
|
"RejectRecords",
|
||||||
"LinkToRecords"
|
"LinkToRecords",
|
||||||
|
"FileTransferReport"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This file is part of Alfresco
|
||||||
|
*
|
||||||
|
* Alfresco is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.alfresco.module.org_alfresco_module_rm.patch;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
|
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.fileplan.FilePlanService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for the capability patch classes
|
||||||
|
*
|
||||||
|
* @author Tuna Aksoy
|
||||||
|
* @since 2.2
|
||||||
|
*/
|
||||||
|
public abstract class BaseRMCapabilityPatch extends ModulePatchComponent
|
||||||
|
{
|
||||||
|
/** File plan service */
|
||||||
|
private FilePlanService filePlanService;
|
||||||
|
|
||||||
|
/** File plan role service */
|
||||||
|
private FilePlanRoleService filePlanRoleService;
|
||||||
|
|
||||||
|
/** Capability service */
|
||||||
|
private CapabilityService capabilityService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param filePlanRoleService file plan role service
|
||||||
|
*/
|
||||||
|
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
||||||
|
{
|
||||||
|
this.filePlanRoleService = filePlanRoleService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param capabilityService capability service
|
||||||
|
*/
|
||||||
|
public void setCapabilityService(CapabilityService capabilityService)
|
||||||
|
{
|
||||||
|
this.capabilityService = capabilityService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param filePlanService file plan service
|
||||||
|
*/
|
||||||
|
public void setFilePlanService(FilePlanService filePlanService)
|
||||||
|
{
|
||||||
|
this.filePlanService = filePlanService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to get the file plans
|
||||||
|
*
|
||||||
|
* @return Set of file plan node references
|
||||||
|
*/
|
||||||
|
protected Set<NodeRef> getFilePlans()
|
||||||
|
{
|
||||||
|
return filePlanService.getFilePlans();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a new capability to the specified roles.
|
||||||
|
*
|
||||||
|
* @param filePlan file plan
|
||||||
|
* @param capabilityName capability name
|
||||||
|
* @param roles roles
|
||||||
|
*/
|
||||||
|
protected void addCapability(NodeRef filePlan, String capabilityName, String ... roles)
|
||||||
|
{
|
||||||
|
Capability capability = capabilityService.getCapability(capabilityName);
|
||||||
|
if (capability == null)
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException("Unable to bootstrap RMv21 capabilities, because capability " + capabilityName + " does not exist.");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String roleName : roles)
|
||||||
|
{
|
||||||
|
Role role = filePlanRoleService.getRole(filePlan, roleName);
|
||||||
|
|
||||||
|
if (role != null)
|
||||||
|
{
|
||||||
|
// get the roles current capabilities
|
||||||
|
Set<Capability> capabilities = role.getCapabilities();
|
||||||
|
|
||||||
|
// only update if the capability is missing
|
||||||
|
if (capabilities.contains(capability) == false)
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
capabilities.add(capability);
|
||||||
|
filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -20,16 +20,8 @@ package org.alfresco.module.org_alfresco_module_rm.patch;
|
|||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
|
||||||
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.dod5015.DOD5015Model;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
|
||||||
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.FilePlanRoleService;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.springframework.beans.factory.BeanNameAware;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RM v2.1 patch to updated modified capabilities.
|
* RM v2.1 patch to updated modified capabilities.
|
||||||
@@ -37,49 +29,15 @@ import org.springframework.beans.factory.BeanNameAware;
|
|||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
public class RMv21CapabilityPatch extends ModulePatchComponent
|
public class RMv21CapabilityPatch extends BaseRMCapabilityPatch
|
||||||
implements BeanNameAware, RecordsManagementModel, DOD5015Model
|
|
||||||
{
|
{
|
||||||
/** file plan service */
|
|
||||||
private FilePlanService filePlanService;
|
|
||||||
|
|
||||||
/** File plan role service */
|
|
||||||
private FilePlanRoleService filePlanRoleService;
|
|
||||||
|
|
||||||
/** Capability service */
|
|
||||||
private CapabilityService capabilityService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param filePlanService file plan service
|
|
||||||
*/
|
|
||||||
public void setFilePlanService(FilePlanService filePlanService)
|
|
||||||
{
|
|
||||||
this.filePlanService = filePlanService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param filePlanRoleService file plan role service
|
|
||||||
*/
|
|
||||||
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
|
|
||||||
{
|
|
||||||
this.filePlanRoleService = filePlanRoleService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param capabilityService capability service
|
|
||||||
*/
|
|
||||||
public void setCapabilityService(CapabilityService capabilityService)
|
|
||||||
{
|
|
||||||
this.capabilityService = capabilityService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
|
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void executePatch() throws Throwable
|
protected void executePatch() throws Throwable
|
||||||
{
|
{
|
||||||
Set<NodeRef> filePlans = filePlanService.getFilePlans();
|
Set<NodeRef> filePlans = getFilePlans();
|
||||||
|
|
||||||
if (logger.isDebugEnabled() == true)
|
if (logger.isDebugEnabled() == true)
|
||||||
{
|
{
|
||||||
@@ -131,45 +89,6 @@ public class RMv21CapabilityPatch extends ModulePatchComponent
|
|||||||
FilePlanRoleService.ROLE_POWER_USER,
|
FilePlanRoleService.ROLE_POWER_USER,
|
||||||
FilePlanRoleService.ROLE_RECORDS_MANAGER,
|
FilePlanRoleService.ROLE_RECORDS_MANAGER,
|
||||||
FilePlanRoleService.ROLE_SECURITY_OFFICER);
|
FilePlanRoleService.ROLE_SECURITY_OFFICER);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a new capability to the specified roles.
|
|
||||||
*
|
|
||||||
* @param filePlan file plan
|
|
||||||
* @param capabilityName capability name
|
|
||||||
* @param roles roles
|
|
||||||
*/
|
|
||||||
private void addCapability(NodeRef filePlan, String capabilityName, String ... roles)
|
|
||||||
{
|
|
||||||
Capability capability = capabilityService.getCapability(capabilityName);
|
|
||||||
if (capability == null)
|
|
||||||
{
|
|
||||||
throw new AlfrescoRuntimeException("Unable to bootstrap RMv21 capabilities, because capability " + capabilityName + " does not exist.");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String roleName : roles)
|
|
||||||
{
|
|
||||||
Role role = filePlanRoleService.getRole(filePlan, roleName);
|
|
||||||
|
|
||||||
if (role != null)
|
|
||||||
{
|
|
||||||
// get the roles current capabilities
|
|
||||||
Set<Capability> capabilities = role.getCapabilities();
|
|
||||||
|
|
||||||
// only update if the capability is missing
|
|
||||||
if (capabilities.contains(capability) == false)
|
|
||||||
{
|
|
||||||
if (logger.isDebugEnabled() == true)
|
|
||||||
{
|
|
||||||
logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
capabilities.add(capability);
|
|
||||||
filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This file is part of Alfresco
|
||||||
|
*
|
||||||
|
* Alfresco is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.alfresco.module.org_alfresco_module_rm.patch;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RM v2.2 patch to updated modified capabilities.
|
||||||
|
*
|
||||||
|
* @author Tuna Aksoy
|
||||||
|
* @since 2.2
|
||||||
|
*/
|
||||||
|
public class RMv22CapabilityPatch extends BaseRMCapabilityPatch
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void executePatch() throws Throwable
|
||||||
|
{
|
||||||
|
Set<NodeRef> filePlans = getFilePlans();
|
||||||
|
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug(" ... updating " + filePlans.size() + " file plans");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (NodeRef filePlan : filePlans)
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug(" ... updating file plan " + filePlan.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new capability
|
||||||
|
addCapability(filePlan,
|
||||||
|
"FileDestructionReport",
|
||||||
|
FilePlanRoleService.ROLE_ADMIN,
|
||||||
|
FilePlanRoleService.ROLE_RECORDS_MANAGER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user