Reputation: 382
I am trying to write a HTML content into Alfresco node using this service https://docs.alfresco.com/5.2/references/dev-services-content.html but this service cut out "style", "script" and some other tags!!! how to prevent it and write "style" tag in output stream?
protected void exportReportVHTML(NodeRef reportNodeRef,
String outputFormat, String report) throws JRException, IOException {
ContentWriter contentWriter = alfrescoServices.getContentServiceDefault().getWriter(reportNodeRef,
ContentModel.PROP_CONTENT, true);
OutputStream reportOS = contentWriter.getContentOutputStream();
contentWriter.setMimetype(alfrescoServices.getMimetypeService().getMimetype("html"));
try {
reportOS.write(report.getBytes("UTF-8"));
} catch (Exception jrex) {
jrex.printStackTrace();
jrex.printStackTrace(new PrintWriter(reportOS));
propertyHelper.setNodeProp(reportNodeRef, ContentModel.PROP_DESCRIPTION, jrex.getMessage());
throw jrex;
} finally {
reportOS.close();
}
}
Upvotes: 2
Views: 84