Thank you. Please post the code to add the Annotation. My requirement is, The Case Information Must be shown on Document when I print.
Original Message:
Sent: Fri February 03, 2023 03:28 AM
From: shashi kumar
Subject: Showing Case Information in "Daeja ViewONE Virtual Viewer"
Hi Ravi,
Yes , when we open another document daeja opening in same tab content pane and it is not setting case information details on the new document . below code should fix the issue . also I've followed the community post on this question, If I understand correctly you only want to show the case information details while opening document for information purpose only and you don't want to create any annotations on document (the below code does same) . let me know if you really want to add annotation on document I can change the code and repost again but please note that will show annotation while printing document.
//load sample ecm desktop load handler for checksrequire([ "dojo/_base/lang", "ecm/widget/viewer/ContentViewer", "ecm/widget/viewer/ContentViewerPane", "dojo/dom-construct"], function(lang, ContentViewer, ContentViewerPane, domConstruct) { /*ContentViewer.prototype.onDocumentOpened = function(item,preview) { setTimeout(lang.hitch(this,function() { require(["dojo/query","dojo/_base/array","dojo/dom-construct"], function(query,array,domConstruct) { var n = query('canvas'); if(n && item) { var vp = ["Name" , "Creator" , "DateCreated" , "MinorVersionNumber"]; var ps = ""; array.forEach(vp, lang.hitch(this,function(v) { ps += "</span>"+v+" : "+item.attributes[v]+"</span> "; // Change this line to get case properties (I am loading document props for demo ) })); var d = "<div> Case Information <br> "+ps+"</div>" var domNode = domConstruct.toDom(d); domConstruct.place(domNode,n[0],"before"); } }) }),2000); };*/ ContentViewerPane.prototype.onDocumentLoaded = function() { var tab = this.contentViewerTab; if (this.contentViewerTab) { // points to the current opened document contentpane var paneNode = this.contentViewerTab.domNode; var _this = this; require(["dojo/query", "dojo/_base/array", "dojo/dom-construct"], function(query, array, domConstruct) { var n = query('canvas', paneNode); // this limits the case information to be added in current opened document var item = _this.contentViewerTab.viewerItem.item; if (n && item) { var vp = ["Name", "Creator", "DateCreated", "MinorVersionNumber"]; var ps = ""; array.forEach(vp, lang.hitch(this, function(v) { ps += "</span>" + v + " : " + item.attributes[v] + "</span> "; // Change this line to get case properties (I am loading document props for demo ) })); var d = "<div> Case Information <br> " + ps + "</div>" var domNode = domConstruct.toDom(d); domConstruct.place(domNode, n[0], "before"); } }); } }});
------------------------------
shashi kumar
Original Message:
Sent: Thu February 02, 2023 08:01 AM
From: RAVI KUMAR PATNALA
Subject: Showing Case Information in "Daeja ViewONE Virtual Viewer"
Hi Shashi,
Thank you. I tried the above code. It works only if I declare "dojo/dom-construct" in the beginning also. Below is the code which is working for me. One issue with this code is, it is getting called only once. If I open the same document or other case document this is not showing Case Information. I think this because of setTimeout(). As per the java script documentation, the function setTimeout() will be called only once.
//load sample ecm desktop load handler for checksrequire([ "dojo/_base/lang", "ecm/widget/viewer/ContentViewer", "dojo/dom-construct"], function(lang,ContentViewer,domConstruct) { ContentViewer.prototype.onDocumentOpened = function(item,preview) { setTimeout(lang.hitch(this,function() { require(["dojo/query","dojo/_base/array","dojo/dom-construct"], function(query,array,domConstruct) { var n = query('canvas'); if(n && item) { var vp = ["Name" , "Creator" , "DateCreated" , "MinorVersionNumber"]; var ps = ""; array.forEach(vp, lang.hitch(this,function(v) { ps += "</span>"+v+" : "+item.attributes[v]+"</span> "; // Change this line to get case properties (I am loading document props for demo ) })); var d = "<div> Case Information <br> "+ps+"</div>" var domNode = domConstruct.toDom(d); domConstruct.place(domNode,n[0],"before"); } }) }),2000); }});
------------------------------
RAVI KUMAR PATNALA
Original Message:
Sent: Mon January 30, 2023 08:39 AM
From: shashi kumar
Subject: Showing Case Information in "Daeja ViewONE Virtual Viewer"
I've added small piece of code to replicate your scenario for Daeja viewer in ICN 3.0.13
//load sample ecm desktop load handler for checksrequire([ "dojo/_base/lang", "ecm/widget/viewer/ContentViewer"], function(lang,ContentViewer) { ContentViewer.prototype.onDocumentOpened = function(item,preview) { setTimeout(lang.hitch(this,function() { require(["dojo/query","dojo/_base/array","dojo/dom-construct"], function(query,array,domConstruct) { var n = query('canvas'); if(n && item) { var vp = ["Name" , "Creator" , "DateCreated" , "MinorVersionNumber"]; var ps = ""; array.forEach(vp, lang.hitch(this,function(v) { ps += "</span>"+v+" : "+item.attributes[v]+"</span> "; // Change this line to get case properties (I am loading document props for demo ) })); var d = "<div> Case Information <br> "+ps+"</div>" var domNode = domConstruct.toDom(d); domConstruct.place(domNode,n[0],"before"); } }) }),2000); }});
------------------------------
shashi kumar
Original Message:
Sent: Fri January 20, 2023 10:49 AM
From: RAVI KUMAR PATNALA
Subject: Showing Case Information in "Daeja ViewONE Virtual Viewer"
Hello Team,
We have a requirement to show the Case Information (CaseID, Case Creation Date and Custom Properties) on the documents(TIFF) of the case. There should be a button called "Print" in Case Information Page. When the user clicks on it, should open the Viewer and show the documents along with Case Information. This Case Information helps the users to identify for which Case the document belongs to.
This requirement we have implemented in BPF application with some customization. This is not an annotation object in the content engine. Please check the attachment "BPF_Screenshot1".
We want to implement the same requirement in Case Manager. Currently all the documents are shown in "Daeja ViewONE Virtual Viewer".
Could you please help me how to achieve this requirement? Is there any out of the box setting or we need to do customization?
Thank you in advance.
------------------------------
RAVI KUMAR PATNALA
------------------------------