RM-783: File destruction report action (part one)

* ReportService added ... will be used to consolidate the various reports withing RM (specifically those needed for DOD complicance)
  * Base and declarative implementations of report generators added
  * Destruction report configured with place holder implementation (still need to do name generation, meta-data and final template)
  * Report model added, with destructionReport type defined
  * FileDestructionReport capability added (and capability patch bean updated)
  * Repository action added to file destruction report
  * UI configured to show 'file destruction report' action .. (creates a report and files it as an unfiled record as the destruction report type)
  * fixed up destruction capabilities and actions (capability to destroy record regardless of its current dispostion state did not work)
  * added "AtLeastOne" composite capability condition
  * TODO destruction report template, name and meta-data generation
  * TODO patch to add report template structure to rm data dictionary area
  * TODO start refactor of existing reports including transfer, accession, userRights, filePlan and audit!!



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@52562 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-07-14 09:54:27 +00:00
parent 1e6d49dbab
commit b4d1194ae2
45 changed files with 1602 additions and 108 deletions

View File

@@ -33,6 +33,7 @@ import org.alfresco.module.org_alfresco_module_rm.test.service.RecordsManagement
import org.alfresco.module.org_alfresco_module_rm.test.service.RecordsManagementAdminServiceImplTest;
import org.alfresco.module.org_alfresco_module_rm.test.service.RecordsManagementAuditServiceImplTest;
import org.alfresco.module.org_alfresco_module_rm.test.service.RecordsManagementSearchServiceImplTest;
import org.alfresco.module.org_alfresco_module_rm.test.service.ReportServiceImplTest;
import org.alfresco.module.org_alfresco_module_rm.test.service.VitalRecordServiceImplTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -64,7 +65,8 @@ import org.junit.runners.Suite.SuiteClasses;
CapabilityServiceImplTest.class,
FilePlanRoleServiceImplTest.class,
FilePlanServiceImplTest.class,
FilePlanPermissionServiceImplTest.class
FilePlanPermissionServiceImplTest.class,
ReportServiceImplTest.class
})
public class ServicesTestSuite
{

View File

@@ -0,0 +1,129 @@
/*
* 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.test.service;
import java.util.Set;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
import org.alfresco.module.org_alfresco_module_rm.action.impl.DestroyAction;
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.module.org_alfresco_module_rm.report.action.FileDestructionReport;
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
/**
* Report service implementation unit test.
*
* @author Roy Wetherall
*/
public class ReportServiceImplTest extends BaseRMTestCase implements ReportModel
{
private ReportService reportService;
private RecordsManagementActionService recordsManagementActionService;
@Override
protected boolean isRecordTest()
{
return false;
}
@Override
protected void initServices()
{
super.initServices();
reportService = (ReportService)applicationContext.getBean("ReportService");
recordsManagementActionService = (RecordsManagementActionService)applicationContext.getBean("RecordsManagementActionService");
}
public void testGetReportTypes() throws Exception
{
doTestInTransaction(new Test<Void>()
{
@Override
public Void run() throws Exception
{
Set<QName> reportTypes = reportService.getReportTypes();
assertNotNull(reportTypes);
assertFalse(reportTypes.isEmpty());
for (QName reportType : reportTypes)
{
System.out.println(reportType.toString());
}
return null;
}
});
}
public void testGenerateReport() throws Exception
{
doTestInTransaction(new Test<Void>()
{
@Override
public Void run() throws Exception
{
Report report = reportService.generateReport(TYPE_DESTRUCTION_REPORT, rmFolder);
System.out.println(report.getReportContent().getContentString());
return null;
}
});
}
public void testFileReport() throws Exception
{
doTestInTransaction(new Test<Void>()
{
@Override
public Void run() throws Exception
{
Report report = reportService.generateReport(TYPE_DESTRUCTION_REPORT, rmFolder);
NodeRef reportNodeRef = reportService.fileReport(filePlan, report);
assertNotNull(reportNodeRef);
assertTrue(recordService.isRecord(reportNodeRef));
assertFalse(recordService.isFiled(reportNodeRef));
assertEquals(TYPE_DESTRUCTION_REPORT, nodeService.getType(reportNodeRef));
return null;
}
});
}
public void testFileDestructionReportAction() throws Exception
{
doTestInTransaction(new Test<Void>()
{
@Override
public Void run() throws Exception
{
recordsManagementActionService.executeRecordsManagementAction(rmFolder, DestroyAction.NAME);
recordsManagementActionService.executeRecordsManagementAction(rmFolder, FileDestructionReport.NAME);
return null;
}
});
}
}