Original Message:
Sent: Mon April 08, 2024 04:45 AM
From: RAVI KUMAR
Subject: Daeja VIEWONE: Response filter to add Annotation
Hi Guys,
Could you please check this.
------------------------------
RAVI KUMAR
Original Message:
Sent: Wed April 03, 2024 07:03 AM
From: RAVI KUMAR
Subject: Daeja VIEWONE: Response filter to add Annotation
Hi,
I have updated the response filter. Now I am passing the servlet for the parameter annotationFile. Please find below the latest response filter code and annotation output. This servlet generates text annotation output. But still the annotation does not work. Please suggest me how to implement this.
Response Filter:
public void filter(String serverType, PluginServiceCallbacks callbacks, HttpServletRequest request, JSONObject jsonResponse) throws Exception { logger = callbacks.getLogger(); logger.logDebug(ViewerTest.class, "filter", " **Enter filter7()** , Parameters - callbacks :: "+callbacks +", request :: "+request+", jsonResponse :: "+jsonResponse); String lsResponseHTML = (String) jsonResponse.get("responseHTML"); String lsTemp = lsResponseHTML.substring(0,lsResponseHTML.lastIndexOf("</object>")); String lsAnnotationFile = "<param name=\"annotateEdit\" value=\"true\"/>\\r\\n<param name=\"annotationFile\" value=\"https://servername/AnnotationTest/TextAnnotation\"/>\r\n</object>\r\n"; String lsFinalResponseHTML = lsTemp + lsAnnotationFile; logger.logDebug(ViewerTest.class, "filter", " lsFinalResponseHTML :: "+lsFinalResponseHTML); jsonResponse.put("responseHTML", lsFinalResponseHTML); logger.logDebug(ViewerTest.class, "filter", " final jsonResponse :: "+jsonResponse); }
Servlet Output:
Viewer Settings after the plug-in deployment:
Current Output: I have updated annotateEdit and annotationFile parameters through response filter. The parameter annotateEdit enabled the Annotation toolbar. The annotationFile parameter also updated but no annotation is being displayed as expected.
------------------------------
RAVI KUMAR
Original Message:
Sent: Tue March 26, 2024 02:46 PM
From: RAVI KUMAR
Subject: Daeja VIEWONE: Response filter to add Annotation
Hi Friends,
Requirement: I need to add annotation text dynamically in the Daeja VIEWONE viewer screen. I do not want to store Annotation objects in the repository. If the user prints the document the text must be also there in the print.
What I did so far:
1.I implemented a response filter on the service "/v1/viewoneAction". Below is the code.
public void filter(String serverType, PluginServiceCallbacks callbacks, HttpServletRequest request, JSONObject jsonResponse) throws Exception { logger = callbacks.getLogger(); logger.logDebug(ViewerTest.class, "filter", " **Enter filter7()** , Parameters - callbacks :: "+callbacks +", request :: "+request+", jsonResponse :: "+jsonResponse); String lsResponseHTML = (String) jsonResponse.get("responseHTML"); String lsTemp = lsResponseHTML.substring(0,lsResponseHTML.lastIndexOf("</object>")); String lsAnnotationFile = "<param name=\"annotateEdit\" value=\"true\"/>\\r\\n<param name=\"annotationFile\" value=\"/Test/Config/hello.pl\"/>\r\n</object>\r\n"; String lsFinalResponseHTML = lsTemp + lsAnnotationFile; logger.logDebug(ViewerTest.class, "filter", " lsFinalResponseHTML :: "+lsFinalResponseHTML); jsonResponse.put("responseHTML", lsFinalResponseHTML); logger.logDebug(ViewerTest.class, "filter", " final jsonResponse :: "+jsonResponse); }
2.Following is the code in the hello.pl.
#!/usr/bin/perlprint "Content-Type: text/html\n\n";print "<html><body>";print "<h1>Hello, CGI World!</h1>";print "</body></html>";
Output: I could not see the annotation in the viewer. May be I am missing the concept. Could you please help me.
------------------------------
RAVI KUMAR
------------------------------