Jim Nord 22.Jan.12 03:28 PM a Web browser Application development8.5.1 (Lotus Domino)Windows
I have a customer who would like to send an email to a group of users when a document is created via Save and Check In. I decided to build this for them by making a call to a back end agent at the very end of the Save and Check In process.
To track this down I set qwidgets enabled="false" in the qpconfig.xml and restarted the server. I was able to walk through the code and into the submit handler function in page\_base.js. I then extended the code at the end of the process to invoke the agent and everything works beautifully. That is, until I set qwidgets enabled back to "true". After doing that the my extending page\_base.js no longer functions and does not appear to be loaded. This is with cache clearing and on both IE and FireFox.
Two questions here:
1. Why does the Quickr server function differently with qwidgets enabled="false" than qwidgets enabled="true". Or, did I do something wrong in my modification - please see example below.
2. If I didn't do anything wrong then, Is there another way to accomplish this customer request that will work with qwidgets enabled="true"?
I will outline a very simple example that exhibits the problem.
First copy widgets\page\_base.js to a folder on the machine where the extensions live. In my case that is skins\qext\page\_base.js.
dojo.declare("qext.page._base",
[quickr.widgets._transformer, quickr.widgets._event, quickr.widgets.widgetRegistry],
{
..... I left the code unchanged until line 869 of original file
.... or actually 872 since I added a few lines for the
.... dojo.require("quickr.widgets.page._base") line and added
prompt("In Base JS at end of Save and Check IN");
..... no other changes in the file.
I then edited the widgetRegistryConfig_ext.js file and added this to the end:
{
type: 'GLOBALREPLACE',
source: "quickr.widgets.page._base",
use: "qext.page._base"
}
and Yes the line above it does have a }, on it for the prior widget load.
I am running Quickr version 8.5.1 so _base.js line 869 is where I made the modification. To put it into context I copied the whole block here so that you can see where I am adding it.
else{
if(typeof frm["CMI_notifyMembers"] != "undefined" && frm["CMI_notifyMembers"] != null && frm"CMI_notifyMembers"].checked){
var resourceId = id;
var resourceTitle = title;
var args = {
resId: resourceId,
resTitle: resourceTitle,
sendType: "document",
notifySender: (typeof frm"CMI_notifySender"] != "undefined" && frm["CMI_notifySender"] != null) ? frm["CMI_notifySender"].value : false,
target: oWidget,
successfullHandler: handler,
failedHandler: handler,
cancelHandler: handler,
creator: creator,
createdDate: createdDate,
enableConnectorLinks: false };
oWidget.publishEvent(oWidget.ACTION.SENDNOTIFICATION.OPEN, args);
} else if ( wfComment ) { // need to send workflow notification
q_CustomFormUtils.workflow.sendNotification(oWidget.id, id, "submit", wfComment, title);
handler.call(oWidget);
} else {
prompt("In Base JS at end of Save and Check IN");
handler.call(oWidget);
}
}
Essentially all I am doing here is extending the _base.js and adding a prompt in which will occur when a user selects Save and Check In when creating a brand new document.
This works when qwidgets enabled="false" and does not work when qwidgets enabled="true".
I can toggle this setting in my qpconfig.xml, restart the server, clear my cache and see different behavior.