1 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
3 // This entire component is a singleton that exists solely to store data.
6 this.wrappedJSObject = this;
9 nsOpenILS.prototype = {
10 classDescription: "OpenILS Data Cache",
11 classID: Components.ID("{dc3e4b5f-c0f4-4b34-bc57-7b4099c3a5d6}"),
12 contractID: "@open-ils.org/openils_data_cache;1",
13 QueryInterface: XPCOMUtils.generateQI(),
16 createInstance: function (aOuter, aIID) {
18 throw Components.results.NS_ERROR_NO_AGGREGATION;
19 if (this.singleton == null)
20 this.singleton = new nsOpenILS();
21 return this.singleton.QueryInterface(aIID);
23 getService: function (aIID) {
25 throw Components.results.NS_ERROR_NO_AGGREGATION;
26 if (this.singleton == null)
27 this.singleton = new nsOpenILS();
28 return this.singleton.QueryInterface(aIID);
32 openMainEGWindow: function() {
33 var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
34 .getService(Components.interfaces.nsIWindowMediator);
35 var targetWindow = wm.getMostRecentWindow("eg_main");
36 if (targetWindow != null) {
39 var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
40 .getService(Components.interfaces.nsIWindowWatcher);
41 ww.openWindow(null, "chrome://open_ils_staff_client/content/main/main.xul", "_blank", "chrome,resizable,dialog=no", null);
46 if (XPCOMUtils.generateNSGetFactory)
47 var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsOpenILS]);
49 var NSGetModule = XPCOMUtils.generateNSGetModule([nsOpenILS]);