mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM-1099 (Refactor Transfer and Accession reports)
* File transfer report and file destruction report are now using the same file report dialogue and the same action. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@58416 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -93,35 +93,6 @@
|
|||||||
|
|
||||||
<!-- Report Actions -->
|
<!-- Report Actions -->
|
||||||
|
|
||||||
<bean id="fileDestructionReport_proxy" parent="rmProxyAction" >
|
|
||||||
<property name="target">
|
|
||||||
<ref bean="fileDestructionReport"/>
|
|
||||||
</property>
|
|
||||||
<property name="interceptorNames">
|
|
||||||
<list>
|
|
||||||
<idref bean="fileDestructionReport_security"/>
|
|
||||||
</list>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="fileDestructionReport_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
|
||||||
<property name="objectDefinitionSource">
|
|
||||||
<value>
|
|
||||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.FileDestructionReport
|
|
||||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
|
|
||||||
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
|
|
||||||
</value>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="fileDestructionReport"
|
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.report.action.FileDestructionReportAction"
|
|
||||||
parent="rmAction">
|
|
||||||
<property name="reportService" ref="ReportService" />
|
|
||||||
<property name="filePlanService" ref="FilePlanService" />
|
|
||||||
<property name="reportType" value="rmr:destructionReport" />
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<bean id="fileReport_proxy" parent="rmProxyAction" >
|
<bean id="fileReport_proxy" parent="rmProxyAction" >
|
||||||
<property name="target">
|
<property name="target">
|
||||||
<ref bean="fileReport"/>
|
<ref bean="fileReport"/>
|
||||||
@@ -136,7 +107,7 @@
|
|||||||
<bean id="fileReport_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
<bean id="fileReport_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
|
||||||
<property name="objectDefinitionSource">
|
<property name="objectDefinitionSource">
|
||||||
<value>
|
<value>
|
||||||
<!-- FIXME -->
|
<!-- FIXME: Find a way to check the capabilities. Do we really need several classes or can we use one class -->
|
||||||
<!-- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.FileDestructionReport -->
|
<!-- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.FileDestructionReport -->
|
||||||
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW
|
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
|
||||||
|
@@ -1,104 +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.report.action;
|
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.report.Report;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.report.ReportModel;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.report.ReportService;
|
|
||||||
import org.alfresco.service.cmr.action.Action;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
|
||||||
import org.alfresco.service.namespace.QName;
|
|
||||||
import org.alfresco.util.ParameterCheck;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File Report Action
|
|
||||||
*
|
|
||||||
* @author Roy Wetherall
|
|
||||||
* @since 2.1
|
|
||||||
*/
|
|
||||||
public class FileDestructionReportAction extends RMActionExecuterAbstractBase
|
|
||||||
implements ReportModel
|
|
||||||
{
|
|
||||||
/** report service */
|
|
||||||
protected ReportService reportService;
|
|
||||||
|
|
||||||
/** file plan service */
|
|
||||||
protected FilePlanService filePlanService;
|
|
||||||
|
|
||||||
/** report type string value */
|
|
||||||
private String reportType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param reportService report service
|
|
||||||
*/
|
|
||||||
public void setReportService(ReportService reportService)
|
|
||||||
{
|
|
||||||
this.reportService = reportService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param filePlanService file plan service
|
|
||||||
*/
|
|
||||||
public void setFilePlanService(FilePlanService filePlanService)
|
|
||||||
{
|
|
||||||
this.filePlanService = filePlanService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param reportType report type string value
|
|
||||||
*/
|
|
||||||
public void setReportType(String reportType)
|
|
||||||
{
|
|
||||||
this.reportType = reportType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return QName report type
|
|
||||||
*/
|
|
||||||
protected QName getReportType()
|
|
||||||
{
|
|
||||||
ParameterCheck.mandatory("this.reportType", reportType);
|
|
||||||
return QName.createQName(reportType, namespaceService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
|
||||||
{
|
|
||||||
// TODO check that the actionedUponNodeRef is in a state to generate a destruction report
|
|
||||||
// ie: is it eligable for destruction .. use fileDestructionReport capability!
|
|
||||||
|
|
||||||
// TODO allow the mimetype of the report to be specified as a parameter
|
|
||||||
|
|
||||||
NodeRef filePlan = filePlanService.getFilePlan(actionedUponNodeRef);
|
|
||||||
if (filePlan == null)
|
|
||||||
{
|
|
||||||
throw new AlfrescoRuntimeException("Unable to file destruction report, because file plan could not be resolved.");
|
|
||||||
}
|
|
||||||
|
|
||||||
Report report = reportService.generateReport(getReportType(), actionedUponNodeRef);
|
|
||||||
reportService.fileReport(filePlan, report);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@@ -37,7 +37,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
|||||||
*/
|
*/
|
||||||
public class FileReportAction extends RMActionExecuterAbstractBase implements ReportModel
|
public class FileReportAction extends RMActionExecuterAbstractBase implements ReportModel
|
||||||
{
|
{
|
||||||
/** Constants for the parameters passed from UI */
|
/** Constants for the parameters passed from the UI */
|
||||||
private static final String REPORT_TYPE = "reportType";
|
private static final String REPORT_TYPE = "reportType";
|
||||||
private static final String DESTINATION = "destination";
|
private static final String DESTINATION = "destination";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user