RM-783: File destruction report

* patch added 



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@52688 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-07-16 07:24:15 +00:00
parent 21f98c25b4
commit 6d9507a6b9
5 changed files with 59 additions and 37 deletions

View File

@@ -5,9 +5,9 @@ log4j.logger.org.alfresco.module.org_alfresco_module_rm.caveat=warn
log4j.logger.org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityPostProcessor=warn log4j.logger.org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityPostProcessor=warn
# #
# Module patch debug information # Module patches
# #
#log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=debug log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=debug
# #
# RM Permission Debug Information # RM Permission Debug Information

View File

@@ -92,6 +92,7 @@
<property name="filePlanPermissionService" ref="FilePlanPermissionService"/> <property name="filePlanPermissionService" ref="FilePlanPermissionService"/>
<property name="filePlanService" ref="FilePlanService"/> <property name="filePlanService" ref="FilePlanService"/>
<property name="capabilityService" ref="CapabilityService"/> <property name="capabilityService" ref="CapabilityService"/>
<property name="ruleService" ref="RuleService" />
</bean> </bean>
<bean id="org_alfresco_module_rm_RMv21CapabilityPatch" <bean id="org_alfresco_module_rm_RMv21CapabilityPatch"
@@ -150,5 +151,17 @@
<property name="filePlanRoleService" ref="FilePlanRoleService"/> <property name="filePlanRoleService" ref="FilePlanRoleService"/>
<property name="authorityService" ref="AuthorityService"></property> <property name="authorityService" ref="AuthorityService"></property>
</bean> </bean>
<bean id="org_alfresco_module_rm_RMv21ReportServicePatch"
parent="module.baseComponent"
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv21ReportServicePatch">
<property name="moduleId" value="org_alfresco_module_rm"/>
<property name="name" value="org_alfresco_module_rm_RMv21ReportServicePatch"/>
<property name="description" value="Add report service templates."/>
<property name="sinceVersion" value="2.1"/>
<property name="appliesFromVersion" value="2.1"/>
<property name="contentService" ref="ContentService" />
<property name="nodeService" ref="NodeService" />
</bean>
</beans> </beans>

View File

@@ -19,6 +19,8 @@
package org.alfresco.module.org_alfresco_module_rm.patch; package org.alfresco.module.org_alfresco_module_rm.patch;
import org.alfresco.repo.module.AbstractModuleComponent; import org.alfresco.repo.module.AbstractModuleComponent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** /**
@@ -29,11 +31,19 @@ import org.alfresco.repo.module.AbstractModuleComponent;
*/ */
public abstract class ModulePatchComponent extends AbstractModuleComponent public abstract class ModulePatchComponent extends AbstractModuleComponent
{ {
/** logger */
private static Log logger = LogFactory.getLog(ModulePatchComponent.class);
@Override @Override
protected void executeInternal() throws Throwable protected void executeInternal() throws Throwable
{ {
try try
{ {
if (logger.isInfoEnabled() == true)
{
logger.info("Module patch component '" + getName() + "' is executing ...");
}
executePatch(); executePatch();
} }
catch (Throwable exception) catch (Throwable exception)

View File

@@ -32,6 +32,7 @@ import org.alfresco.module.org_alfresco_module_rm.security.ExtendedReaderDynamic
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedWriterDynamicAuthority; import org.alfresco.module.org_alfresco_module_rm.security.ExtendedWriterDynamicAuthority;
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService; import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.rule.RuleService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.BeanNameAware;
@@ -75,6 +76,9 @@ public class RMv21InPlacePatch extends ModulePatchComponent
/** capability service */ /** capability service */
private CapabilityService capabilityService; private CapabilityService capabilityService;
/** rule service */
private RuleService ruleService;
/** /**
* @param filePlanRoleService file plan role service * @param filePlanRoleService file plan role service
*/ */
@@ -107,17 +111,20 @@ public class RMv21InPlacePatch extends ModulePatchComponent
this.capabilityService = capabilityService; this.capabilityService = capabilityService;
} }
/**
* @param ruleService rule service
*/
public void setRuleService(RuleService ruleService)
{
this.ruleService = ruleService;
}
/** /**
* @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
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("RM module: RMv21InPlacePatch executing ...");
}
Set<NodeRef> filePlans = filePlanService.getFilePlans(); Set<NodeRef> filePlans = filePlanService.getFilePlans();
if (logger.isDebugEnabled() == true) if (logger.isDebugEnabled() == true)
@@ -132,25 +139,28 @@ public class RMv21InPlacePatch extends ModulePatchComponent
if (logger.isDebugEnabled() == true) if (logger.isDebugEnabled() == true)
{ {
logger.debug(" ... updating file plan " + filePlan.toString()); logger.debug(" ... updating file plan " + filePlan.toString());
}
ruleService.disableRules();
try
{
// set permissions
filePlanPermissionService.setPermission(filePlan, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS);
filePlanPermissionService.setPermission(filePlan, ExtendedWriterDynamicAuthority.EXTENDED_WRITER, RMPermissionModel.FILING);
// create unfiled container
filePlanService.createUnfiledContainer(filePlan);
// add the inplace roles
filePlanRoleService.createRole(filePlan, ROLE_READERS, ROLE_READERS_LABEL, getCapabilities(ROLE_READERS_CAPABILITIES));
filePlanRoleService.createRole(filePlan, ROLE_WRITERS, ROLE_WRITERS_LABEL, getCapabilities(ROLE_WRITERS_CAPABILITIES));
}
finally
{
ruleService.enableRules();
} }
// set permissions
filePlanPermissionService.setPermission(filePlan, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS);
filePlanPermissionService.setPermission(filePlan, ExtendedWriterDynamicAuthority.EXTENDED_WRITER, RMPermissionModel.FILING);
// create unfiled container
filePlanService.createUnfiledContainer(filePlan);
// add the inplace roles
filePlanRoleService.createRole(filePlan, ROLE_READERS, ROLE_READERS_LABEL, getCapabilities(ROLE_READERS_CAPABILITIES));
filePlanRoleService.createRole(filePlan, ROLE_WRITERS, ROLE_WRITERS_LABEL, getCapabilities(ROLE_WRITERS_CAPABILITIES));
} }
} }
if (logger.isDebugEnabled() == true)
{
logger.debug(" ... complete");
}
} }
private Set<Capability> getCapabilities(String[] capabilityNames) private Set<Capability> getCapabilities(String[] capabilityNames)

View File

@@ -116,12 +116,7 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch() throws Throwable
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("RM Module RMv2FilePlanNodeRef Patch ...");
}
Pair<Long, QName> aspectPair = qnameDAO.getQName(ASPECT_FILE_PLAN_COMPONENT); Pair<Long, QName> aspectPair = qnameDAO.getQName(ASPECT_FILE_PLAN_COMPONENT);
if (aspectPair != null) if (aspectPair != null)
{ {
@@ -179,12 +174,6 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
{ {
behaviourFilter.enableBehaviour(); behaviourFilter.enableBehaviour();
} }
} }
if (logger.isDebugEnabled() == true)
{
logger.debug(" ... complete RM Module RMv2FilePlanNodeRef Patch");
}
} }
} }