From 2672aacf222afb4b1053bf126f2a3104d2af4632 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 28 Nov 2013 22:12:46 +0000 Subject: [PATCH] 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 --- .../rm-report-context.xml | 31 +----- .../action/FileDestructionReportAction.java | 104 ------------------ .../report/action/FileReportAction.java | 2 +- 3 files changed, 2 insertions(+), 135 deletions(-) delete mode 100644 rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileDestructionReportAction.java diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml index ca06ad2f2e..36861531e3 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml @@ -93,35 +93,6 @@ - - - - - - - - - - - - - - - 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 - - - - - - - - - - @@ -136,7 +107,7 @@ - + org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileDestructionReportAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileDestructionReportAction.java deleted file mode 100644 index 5a83ca2b8e..0000000000 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileDestructionReportAction.java +++ /dev/null @@ -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 . - */ -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); - - } -} \ No newline at end of file diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileReportAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileReportAction.java index 07a1725f40..186160dbb6 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileReportAction.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/action/FileReportAction.java @@ -37,7 +37,7 @@ import org.springframework.extensions.surf.util.I18NUtil; */ 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 DESTINATION = "destination";