RM-1099 (Refactor Transfer and Accession reports)

* Bug fixing

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@58601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-12-04 18:31:32 +00:00
parent ea20a6a648
commit 927a6f9c45
2 changed files with 15 additions and 3 deletions

View File

@@ -813,8 +813,15 @@ public class RecordServiceImpl implements RecordService,
writer.putContent(reader);
}
// make record
makeRecord(record);
// Check if the "record" aspect has been applied already.
// In case of filing a report the created node will be made
// a record within the "onCreateChildAssociation" method if
// a destination for the report has been selected.
if (nodeService.hasAspect(record, ASPECT_RECORD) == false)
{
// make record
makeRecord(record);
}
return record;
}

View File

@@ -22,10 +22,12 @@ import java.io.Serializable;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
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.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -74,7 +76,10 @@ public abstract class BaseReportAction extends RMActionExecuterAbstractBase impl
Report report = reportService.generateReport(reportType, actionedUponNodeRef, MimetypeMap.MIMETYPE_HTML, addProperties(actionedUponNodeRef));
NodeRef destination = getDestination(action);
reportService.fileReport(destination, report);
NodeRef filedReport = reportService.fileReport(destination, report);
String filedReportName = (String) nodeService.getProperty(filedReport, ContentModel.PROP_NAME);
action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT, filedReportName);
}
/**