XML Datasource streaming issue [message #259231] |
Tue, 23 October 2007 20:33  |
Eclipse User |
|
|
|
Originally posted by: mdavis.pashllc.com
I noticed that there are several blogs and newsgroup entries using a
stream alternative to an XML file.
However, rather than directly using the stream, in the background a
temporary file is created and used.
There are several issues with the temporary file rather than using the
steam.
a. IO performance. (Self-evident)
b. Security. Some of the data I have is sensitivity. Writing to a
temporary file, that may or may not get properly or quickly removed,
causes a security issue and will not past our QA.
Suggestions:
a. Provide a strong encryption mechanism for XML data.
b. Use the stream rather than the temp file.
Sample:
The following is a synopsis of the code samples i have seen:
// Open a report design - retrieve embedded images etc.
IReportRunnable design =
engine.openReportDesign("path_to/some_report.rptdesign");
// Create task to run the report - use the task to execute the report,
task = engine.createRunAndRenderTask(design);
HashMap contextMap = new HashMap();
// some String representation of XML wrapped by a stream
ByteArrayInputStream is = new
ByteArrayInputStream(xmlData.getBytes(UTF8));
contextMap.put(
"org.eclipse.birt.report.data.oda.xml.inputStream", xmlStream);
contextMap.put(
"org.eclipse.birt.report.data.oda.xml.closeInputStream", new
Boolean(true));
task.setAppContext(contextMap);
// normal exectuion of
IRenderOption options = new RenderOption();
options.setOutputFormat( format );
options.setOutputFileName(filename);
task.setRenderOption(options);
task.run();
task.close();
I apologize if I missed something obvious.
Thanks,
Malcolm
|
|
|
Re: XML Datasource streaming issue [message #259304 is a reply to message #259231] |
Wed, 24 October 2007 11:32  |
Eclipse User |
|
|
|
Malcolm,
Nice solution. If you happen to have a working example, I would love to
add it to my REAPI examples. Contact me direct and we can talk about how
you can get me the example.
Scott Rosenbaum
> I noticed that there are several blogs and newsgroup entries using a
> stream alternative to an XML file.
>
> However, rather than directly using the stream, in the background a
> temporary file is created and used.
>
> There are several issues with the temporary file rather than using the
> steam.
> a. IO performance. (Self-evident)
> b. Security. Some of the data I have is sensitivity. Writing to a
> temporary file, that may or may not get properly or quickly removed,
> causes a security issue and will not past our QA.
> Suggestions:
> a. Provide a strong encryption mechanism for XML data.
> b. Use the stream rather than the temp file.
> Sample:
> The following is a synopsis of the code samples i have seen:
> // Open a report design - retrieve embedded images etc.
> IReportRunnable design =
> engine.openReportDesign("path_to/some_report.rptdesign");
> // Create task to run the report - use the task to execute the report,
> task = engine.createRunAndRenderTask(design);
>
> HashMap contextMap = new HashMap();
>
> // some String representation of XML wrapped by a stream
> ByteArrayInputStream is = new
> ByteArrayInputStream(xmlData.getBytes(UTF8));
>
> contextMap.put(
> "org.eclipse.birt.report.data.oda.xml.inputStream", xmlStream);
> contextMap.put(
> "org.eclipse.birt.report.data.oda.xml.closeInputStream", new
> Boolean(true));
> task.setAppContext(contextMap);
>
> // normal exectuion of
> IRenderOption options = new RenderOption();
> options.setOutputFormat( format );
> options.setOutputFileName(filename);
> task.setRenderOption(options);
> task.run();
> task.close();
> I apologize if I missed something obvious.
> Thanks,
> Malcolm
|
|
|
Powered by
FUDForum. Page generated in 0.02768 seconds