===== Nuts and Bolts ===== ==== XUL Runner Start Up ==== The general file layout is similar to that given for the Alpha release. Namely, you have your chrome/ directory with content/, locale/, and skin/, along with various manifests and preferences and install scripts. In CVS, we now reside at [[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client|ILS/Open-ILS/xul/staff_client]] I'm going to try to walk through the code this time as if it were actually being executed by XUL Runner. The first (or second) thing XR sees is the **application.ini** ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/application.ini|cvs]]) file, which gives some metadata about the application, as well as the versions of XR that should run the application. XR also looks in the [[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/defaults/preferences/|defaults/preferences/]] directory (relative to the working directory) for Javascript files to execute. XR only executes **pref()** functions, and possibly **user_pref()** functions from these files. These set the same sort of preferences you see with **about:config** in Mozilla. Our preference file is named **evergreen.js** ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/defaults/preferences/evergreen.js|cvs]]), but only the .js part of the filename matters, and you may have more than one. A pertinent line in our preference file is: **pref("toolkit.defaultChromeURI", "chrome://evergreen/content/main/main.xul");** This tells XR where to look next for loading the application. In this case, it'll look for the given URI in **chrome/evergreen.jar**, which is really a zip file generated by the **Makefile** ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/Makefile|cvs]]), containing the contents of the **chrome/** directory ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/|cvs]]) ==== Javascript ==== The **main.xul** file ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.xul|CVS]]) contains the login interface (which in Alpha resided in auth/auth.xul). Through a XUL overlay, we pull in some of the Javascript used by the OPAC, currently: **utils.js**, **md5.js**, **JSON.js**, **fmall.js**, **RemoteRequest.js**, **OrgTree.js**, and **org_utils.js**. For this interface, these are pulled in by the Makefile and bundled into [[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/util/|OpenILS/util/]] at compile-time, but for non-standalone pages, these will probably be freshly pulled and cached from our servers. We also pull in a **main.js** ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.js|CVS]]) and **JSAN.js** ([[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/content/evergreen/main/JSAN.js|CVS]]) from [[http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/xul/staff_client/chrome/content/evergreen/main/|main/]]. We're using JSAN from [[http://www.openjsan.org/]] as an experiment, but its use isn't strictly necessary and even has a few downsides. In Alpha, we associated Javascript with XUL files by use of **