Enabling the Copy Pages to File function
You must make the changes to your servlet code that are described in this section
only if all of the following are true:
- You have created a custom servlet that uses the ODWEK Java APIs for your end-users to retrieve data stored in Content Manager OnDemand
- You have configured the HTML5 Line Data Viewer so that it is the viewer that launches for line data viewing
- You want to use the Copy pages to file functionality available from the HTML5 Line Data Viewer toolbar
If one or more of the conditions listed are not true, then you do not need to make the changes to your servlet code that are described in this section, and you will not be able to use the Copy pages to file function.
After the viewerPassthru() call to ODWEK, add a check to see if any HTTP headers are needed by
the ODWEK code. If so, then the servlet needs to pass those HTTP headers back to the browser. A
sample of how you might update your servlet to use the new functionality is as
follows:
InputStream is = req.getInputStream();
data = odServer.viewerPassthru(query_string, is);
Hashtable<String,String> headers = odServer.getHeaders();
if (!headers.isEmpty())
{
Set<String> keys = headers.keySet();
for (String key: keys) {
res.setHeader(key, headers.get(key));
}
}
out.write(data);