mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-781: RM Dependency update (update to HEAD QA build #165, Deleted overriding files, Bug fixes)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/UPDATE@52789 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -180,7 +180,6 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.AuditLogPost"
|
||||
parent="webscript">
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="permissionService" ref="PermissionService" />
|
||||
<property name="mimetypeService" ref="mimetypeService" />
|
||||
<property name="recordsManagementAuditService" ref="RecordsManagementAuditService" />
|
||||
@@ -205,10 +204,10 @@
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.ExportPost"
|
||||
parent="webscript">
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="permissionService" ref="PermissionService" />
|
||||
<property name="mimetypeService" ref="mimetypeService" />
|
||||
<property name="exporterService" ref="ExporterService" />
|
||||
<property name="contentStreamer" ref="webscript.content.streamer" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for POST import -->
|
||||
@@ -226,7 +225,6 @@
|
||||
<!-- Base bean for transfer web scripts -->
|
||||
<bean id="rmBaseTransferWebscript" parent="webscript" abstract="true">
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="permissionService" ref="PermissionService" />
|
||||
<property name="mimetypeService" ref="mimetypeService" />
|
||||
<property name="exporterService" ref="ExporterService" />
|
||||
@@ -236,6 +234,7 @@
|
||||
<bean id="webscript.org.alfresco.rma.transfer.get"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.TransferGet"
|
||||
parent="rmBaseTransferWebscript">
|
||||
<property name="contentStreamer" ref="webscript.content.streamer" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for GET transfer report -->
|
||||
@@ -245,6 +244,7 @@
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
<property name="contentStreamer" ref="webscript.content.streamer" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for POST transfer report -->
|
||||
@@ -255,6 +255,7 @@
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="recordsManagementActionService" ref="RecordsManagementActionService" />
|
||||
<property name="dispositionService" ref="DispositionService" />
|
||||
<property name="contentService" ref="ContentService"/>
|
||||
</bean>
|
||||
|
||||
<!-- RM Role API-->
|
||||
@@ -513,7 +514,7 @@
|
||||
<bean id="webscript.org.alfresco.repository.rule.rm-actionconditiondefinitions.get"
|
||||
class="org.alfresco.repo.web.scripts.rule.RmActionConditionDefinitionsGet"
|
||||
parent="webscript">
|
||||
<property name="actionService" ref="ActionService"/>
|
||||
<property name="actionService" ref="ActionService"/>
|
||||
<property name="recordsManagementActionService" ref="RecordsManagementActionService"/>
|
||||
</bean>
|
||||
|
||||
@@ -522,10 +523,10 @@
|
||||
<!-- REST impl for GET Audit Log -->
|
||||
<bean id="webscript.org.alfresco.rma.rmauditlog.get" class="org.alfresco.module.org_alfresco_module_rm.script.AuditLogGet" parent="webscript">
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<property name="contentService" ref="ContentService"/>
|
||||
<property name="permissionService" ref="PermissionService"/>
|
||||
<property name="mimetypeService" ref="mimetypeService"/>
|
||||
<property name="recordsManagementAuditService" ref="RecordsManagementAuditService"/>
|
||||
<property name="contentStreamer" ref="webscript.content.streamer" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for GET Class Definitions for RM/DM -->
|
||||
@@ -558,6 +559,6 @@
|
||||
<property name="filePlanService" ref="FilePlanService" />
|
||||
<property name="filePlanRoleService" ref="FilePlanRoleService" />
|
||||
<property name="authorityService" ref="AuthorityService" />
|
||||
</bean>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -23,35 +23,47 @@ import java.io.IOException;
|
||||
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
import org.alfresco.repo.web.scripts.content.ContentStreamer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Implementation for Java backed webscript to return audit
|
||||
* log of RM events, optionally scoped to an RM node.
|
||||
*
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class AuditLogGet extends BaseAuditRetrievalWebScript
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(AuditLogGet.class);
|
||||
|
||||
|
||||
protected final static String PARAM_EXPORT = "export";
|
||||
|
||||
/** Content Streamer */
|
||||
protected ContentStreamer contentStreamer;
|
||||
|
||||
/**
|
||||
* @param contentStreamer
|
||||
*/
|
||||
public void setContentStreamer(ContentStreamer contentStreamer)
|
||||
{
|
||||
this.contentStreamer = contentStreamer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
|
||||
{
|
||||
File auditTrail = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// parse the parameters and get a file containing the audit trail
|
||||
auditTrail = this.rmAuditService.getAuditTrailFile(parseQueryParameters(req), parseReportFormat(req));
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Streaming audit trail from file: " + auditTrail.getAbsolutePath());
|
||||
|
||||
|
||||
boolean attach = false;
|
||||
String attachFileName = null;
|
||||
String export = req.getParameter(PARAM_EXPORT);
|
||||
@@ -59,13 +71,13 @@ public class AuditLogGet extends BaseAuditRetrievalWebScript
|
||||
{
|
||||
attach = true;
|
||||
attachFileName = auditTrail.getName();
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Exporting audit trail using file name: " + attachFileName);
|
||||
}
|
||||
|
||||
|
||||
// stream the file back to the client
|
||||
streamContent(req, res, auditTrail, attach, attachFileName);
|
||||
contentStreamer.streamContent(req, res, auditTrail, null, attach, attachFileName, null);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -28,6 +28,7 @@ import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour;
|
||||
import org.alfresco.repo.exporter.ACPExportPackageHandler;
|
||||
import org.alfresco.repo.web.scripts.content.ContentStreamer;
|
||||
import org.alfresco.repo.web.scripts.content.StreamACP;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.view.ExporterCrawlerParameters;
|
||||
@@ -46,7 +47,7 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
/**
|
||||
* Creates an RM specific ACP file of nodes to export then streams it back
|
||||
* to the client.
|
||||
*
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class ExportPost extends StreamACP
|
||||
@@ -55,7 +56,18 @@ public class ExportPost extends StreamACP
|
||||
private static Log logger = LogFactory.getLog(ExportPost.class);
|
||||
|
||||
protected static final String PARAM_TRANSFER_FORMAT = "transferFormat";
|
||||
|
||||
|
||||
/** Content Streamer */
|
||||
private ContentStreamer contentStreamer;
|
||||
|
||||
/**
|
||||
* @param contentStreamer
|
||||
*/
|
||||
public void setContentStreamer(ContentStreamer contentStreamer)
|
||||
{
|
||||
this.contentStreamer = contentStreamer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse)
|
||||
*/
|
||||
@@ -73,7 +85,7 @@ public class ExportPost extends StreamACP
|
||||
{
|
||||
// get nodeRefs parameter from form
|
||||
nodeRefs = getNodeRefs(req.getParameter(PARAM_NODE_REFS));
|
||||
|
||||
|
||||
// look for the transfer format
|
||||
String transferFormatParam = req.getParameter(PARAM_TRANSFER_FORMAT);
|
||||
if (transferFormatParam != null && transferFormatParam.length() > 0)
|
||||
@@ -86,39 +98,39 @@ public class ExportPost extends StreamACP
|
||||
// presume the request is a JSON request so get nodeRefs from JSON body
|
||||
JSONObject json = new JSONObject(new JSONTokener(req.getContent().getContent()));
|
||||
nodeRefs = getNodeRefs(json);
|
||||
|
||||
|
||||
if (json.has(PARAM_TRANSFER_FORMAT))
|
||||
{
|
||||
transferFormat = json.getBoolean(PARAM_TRANSFER_FORMAT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// setup the ACP parameters
|
||||
ExporterCrawlerParameters params = new ExporterCrawlerParameters();
|
||||
params.setCrawlSelf(true);
|
||||
params.setCrawlChildNodes(true);
|
||||
params.setExportFrom(new Location(nodeRefs));
|
||||
|
||||
|
||||
// if transfer format has been requested we need to exclude certain aspects
|
||||
if (transferFormat)
|
||||
{
|
||||
// restrict specific aspects from being returned
|
||||
QName[] excludedAspects = new QName[] {
|
||||
QName[] excludedAspects = new QName[] {
|
||||
RenditionModel.ASPECT_RENDITIONED,
|
||||
ContentModel.ASPECT_THUMBNAILED,
|
||||
RecordsManagementModel.ASPECT_DISPOSITION_LIFECYCLE,
|
||||
RecordsManagementSearchBehaviour.ASPECT_RM_SEARCH};
|
||||
params.setExcludeAspects(excludedAspects);
|
||||
}
|
||||
|
||||
|
||||
// create an ACP of the nodes
|
||||
tempACPFile = createACP(params,
|
||||
transferFormat ? ZIP_EXTENSION : ACPExportPackageHandler.ACP_EXTENSION,
|
||||
tempACPFile = createACP(params,
|
||||
transferFormat ? ZIP_EXTENSION : ACPExportPackageHandler.ACP_EXTENSION,
|
||||
transferFormat);
|
||||
|
||||
|
||||
// stream the ACP back to the client as an attachment (forcing save as)
|
||||
streamContent(req, res, tempACPFile, true, tempACPFile.getName());
|
||||
}
|
||||
contentStreamer.streamContent(req, res, tempACPFile, null, true, tempACPFile.getName(), null);
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_BAD_REQUEST,
|
||||
@@ -147,7 +159,7 @@ public class ExportPost extends StreamACP
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Deleting temporary archive: " + tempACPFile.getAbsolutePath());
|
||||
|
||||
|
||||
tempACPFile.delete();
|
||||
}
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour;
|
||||
import org.alfresco.repo.web.scripts.content.ContentStreamer;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.view.ExporterCrawlerParameters;
|
||||
import org.alfresco.service.cmr.view.Location;
|
||||
@@ -39,23 +40,34 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
/**
|
||||
* Streams the nodes of a transfer object to the client in the form of an
|
||||
* ACP file.
|
||||
*
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class TransferGet extends BaseTransferWebScript
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(TransferGet.class);
|
||||
|
||||
|
||||
/** Content Streamer */
|
||||
private ContentStreamer contentStreamer;
|
||||
|
||||
/**
|
||||
* @param contentStreamer
|
||||
*/
|
||||
public void setContentStreamer(ContentStreamer contentStreamer)
|
||||
{
|
||||
this.contentStreamer = contentStreamer;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected File executeTransfer(NodeRef transferNode,
|
||||
WebScriptRequest req, WebScriptResponse res,
|
||||
WebScriptRequest req, WebScriptResponse res,
|
||||
Status status, Cache cache) throws IOException
|
||||
{
|
||||
// get all 'transferred' nodes
|
||||
NodeRef[] itemsToTransfer = getTransferNodes(transferNode);
|
||||
|
||||
|
||||
// setup the ACP parameters
|
||||
ExporterCrawlerParameters params = new ExporterCrawlerParameters();
|
||||
params.setCrawlSelf(true);
|
||||
@@ -67,19 +79,19 @@ public class TransferGet extends BaseTransferWebScript
|
||||
RecordsManagementModel.ASPECT_DISPOSITION_LIFECYCLE,
|
||||
RecordsManagementSearchBehaviour.ASPECT_RM_SEARCH};
|
||||
params.setExcludeAspects(excludedAspects);
|
||||
|
||||
|
||||
// create an archive of all the nodes to transfer
|
||||
File tempFile = createACP(params, ZIP_EXTENSION, true);
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Creating transfer archive for " + itemsToTransfer.length +
|
||||
logger.debug("Creating transfer archive for " + itemsToTransfer.length +
|
||||
" items into file: " + tempFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
// stream the archive back to the client as an attachment (forcing save as)
|
||||
streamContent(req, res, tempFile, true, tempFile.getName());
|
||||
|
||||
contentStreamer.streamContent(req, res, tempFile, null, true, tempFile.getName(), null);
|
||||
|
||||
// return the temp file for deletion
|
||||
return tempFile;
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedul
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.web.scripts.content.ContentStreamer;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -46,69 +47,78 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
|
||||
/**
|
||||
* Returns a JSON representation of a transfer report.
|
||||
*
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class TransferReportGet extends BaseTransferWebScript
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(TransferReportGet.class);
|
||||
|
||||
|
||||
protected static final String REPORT_FILE_PREFIX = "report_";
|
||||
protected static final String REPORT_FILE_SUFFIX = ".json";
|
||||
|
||||
protected DictionaryService ddService;
|
||||
protected RecordsManagementService rmService;
|
||||
protected DispositionService dispositionService;
|
||||
|
||||
protected ContentStreamer contentStreamer;
|
||||
|
||||
/**
|
||||
* Sets the DictionaryService instance
|
||||
*
|
||||
*
|
||||
* @param ddService The DictionaryService instance
|
||||
*/
|
||||
public void setDictionaryService(DictionaryService ddService)
|
||||
{
|
||||
this.ddService = ddService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the disposition service
|
||||
*
|
||||
*
|
||||
* @param dispositionService the disposition service
|
||||
*/
|
||||
public void setDispositionService(DispositionService dispositionService)
|
||||
{
|
||||
this.dispositionService = dispositionService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the RecordsManagementService instance
|
||||
*
|
||||
*
|
||||
* @param rmService RecordsManagementService instance
|
||||
*/
|
||||
public void setRecordsManagementService(RecordsManagementService rmService)
|
||||
{
|
||||
this.rmService = rmService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param contentStreamer
|
||||
*/
|
||||
public void setContentStreamer(ContentStreamer contentStreamer)
|
||||
{
|
||||
this.contentStreamer = contentStreamer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File executeTransfer(NodeRef transferNode,
|
||||
WebScriptRequest req, WebScriptResponse res,
|
||||
WebScriptRequest req, WebScriptResponse res,
|
||||
Status status, Cache cache) throws IOException
|
||||
{
|
||||
// generate the report (will be in JSON format)
|
||||
File report = generateJSONTransferReport(transferNode);
|
||||
|
||||
|
||||
// stream the report back to the client
|
||||
streamContent(req, res, report, false);
|
||||
|
||||
contentStreamer.streamContent(req, res, report, null, false, null, null);
|
||||
|
||||
// return the file for deletion
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a File containing the JSON representation of a transfer report.
|
||||
*
|
||||
*
|
||||
* @param transferNode The transfer node
|
||||
* @return File containing JSON representation of a transfer report
|
||||
* @throws IOException
|
||||
@@ -121,16 +131,16 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
{
|
||||
// get all 'transferred' nodes
|
||||
NodeRef[] itemsToTransfer = getTransferNodes(transferNode);
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Generating JSON transfer report for " + itemsToTransfer.length +
|
||||
logger.debug("Generating JSON transfer report for " + itemsToTransfer.length +
|
||||
" items into file: " + report.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
// create the writer
|
||||
writer = new FileWriter(report);
|
||||
|
||||
|
||||
// use RMService to get disposition authority
|
||||
String dispositionAuthority = null;
|
||||
if (itemsToTransfer.length > 0)
|
||||
@@ -142,7 +152,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
dispositionAuthority = ds.getDispositionAuthority();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write the JSON header
|
||||
writer.write("{\n\t\"data\":\n\t{");
|
||||
writer.write("\n\t\t\"transferDate\": \"");
|
||||
@@ -153,10 +163,10 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
writer.write("\",\n\t\t\"dispositionAuthority\": \"");
|
||||
writer.write(dispositionAuthority != null ? dispositionAuthority : "");
|
||||
writer.write("\",\n\t\t\"items\":\n\t\t[");
|
||||
|
||||
|
||||
// write out JSON representation of items to transfer
|
||||
generateTransferItemsJSON(writer, itemsToTransfer);
|
||||
|
||||
|
||||
// write the JSON footer
|
||||
writer.write("\n\t\t]\n\t}\n}");
|
||||
}
|
||||
@@ -167,13 +177,13 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
try { writer.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates the JSON to represent the given NodeRefs
|
||||
*
|
||||
*
|
||||
* @param writer Writer to write to
|
||||
* @param itemsToTransfer NodeRefs being transferred
|
||||
* @throws IOException
|
||||
@@ -192,7 +202,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
{
|
||||
writer.write(",");
|
||||
}
|
||||
|
||||
|
||||
if (ddService.isSubClass(nodeService.getType(item), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
generateTransferFolderJSON(writer, item);
|
||||
@@ -203,10 +213,10 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates the JSON to represent the given folder.
|
||||
*
|
||||
*
|
||||
* @param writer Writer to write to
|
||||
* @param folderNode Folder being transferred
|
||||
* @throws IOException
|
||||
@@ -215,7 +225,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
throws IOException
|
||||
{
|
||||
// TODO: Add identation
|
||||
|
||||
|
||||
writer.write("\n{\n\"type\":\"folder\",\n");
|
||||
writer.write("\"name\":\"");
|
||||
writer.write((String)nodeService.getProperty(folderNode, ContentModel.PROP_NAME));
|
||||
@@ -224,9 +234,9 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
writer.write("\",\n\"id\":\"");
|
||||
writer.write((String)nodeService.getProperty(folderNode, RecordsManagementModel.PROP_IDENTIFIER));
|
||||
writer.write("\",\n\"children\":\n[");
|
||||
|
||||
|
||||
boolean first = true;
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(folderNode,
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(folderNode,
|
||||
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
for (ChildAssociationRef child : assocs)
|
||||
{
|
||||
@@ -238,7 +248,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
{
|
||||
writer.write(",");
|
||||
}
|
||||
|
||||
|
||||
NodeRef childRef = child.getChildRef();
|
||||
if (ddService.isSubClass(nodeService.getType(childRef), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
@@ -249,13 +259,13 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
generateTransferRecordJSON(writer, childRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writer.write("\n]\n}");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates the JSON to represent the given record.
|
||||
*
|
||||
*
|
||||
* @param writer Writer to write to
|
||||
* @param recordNode Record being transferred
|
||||
* @throws IOException
|
||||
@@ -271,7 +281,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
writer.write("\",\n\"id\":\"");
|
||||
writer.write((String)nodeService.getProperty(recordNode, RecordsManagementModel.PROP_IDENTIFIER));
|
||||
writer.write("\"");
|
||||
|
||||
|
||||
if (this.nodeService.hasAspect(recordNode, RecordsManagementModel.ASPECT_DECLARED_RECORD))
|
||||
{
|
||||
writer.write(",\n\"declaredBy\":\"");
|
||||
@@ -281,7 +291,7 @@ public class TransferReportGet extends BaseTransferWebScript
|
||||
(Date)this.nodeService.getProperty(recordNode, RecordsManagementModel.PROP_DECLARED_AT)));
|
||||
writer.write("\"");
|
||||
}
|
||||
|
||||
|
||||
writer.write("\n}");
|
||||
}
|
||||
}
|
@@ -39,6 +39,7 @@ import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
@@ -78,6 +79,7 @@ public class TransferReportPost extends BaseTransferWebScript
|
||||
protected RecordsManagementActionService rmActionService;
|
||||
protected RecordsManagementService rmService;
|
||||
protected DispositionService dispositionService;
|
||||
protected ContentService contentService;
|
||||
|
||||
/**
|
||||
* Sets the DictionaryService instance
|
||||
@@ -119,6 +121,16 @@ public class TransferReportPost extends BaseTransferWebScript
|
||||
this.rmActionService = rmActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ContentSerivce instance
|
||||
*
|
||||
* @param contentService ContentService instance
|
||||
*/
|
||||
public void setContentService(ContentService contentService)
|
||||
{
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected File executeTransfer(NodeRef transferNode,
|
||||
WebScriptRequest req, WebScriptResponse res,
|
||||
@@ -436,10 +448,10 @@ public class TransferReportPost extends BaseTransferWebScript
|
||||
ContentModel.TYPE_CONTENT, properties).getChildRef();
|
||||
|
||||
// Set the content
|
||||
ContentWriter writer = this.contentService.getWriter(record, ContentModel.PROP_CONTENT, true);
|
||||
ContentWriter writer = contentService.getWriter(record, ContentModel.PROP_CONTENT, true);
|
||||
writer.setMimetype(MimetypeMap.MIMETYPE_HTML);
|
||||
writer.setEncoding("UTF-8");
|
||||
writer.putContent(report);
|
||||
writer.putContent(report);
|
||||
|
||||
return record;
|
||||
}
|
||||
|
Reference in New Issue
Block a user