some abstraction for interface URL's and api method names
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Dec 2005 15:33:29 +0000 (15:33 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Dec 2005 15:33:29 +0000 (15:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2278 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/evergreen/auth/session.js
Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/main/menu.js
Open-ILS/xul/staff_client/server/patron/display.js

index 066079c..72282d7 100644 (file)
@@ -58,13 +58,13 @@ OpenILS.data.prototype = {
 
        '_fm_objects' : {
 
-               'pgt' : [ 'open-ils.actor', 'open-ils.actor.groups.retrieve', [], true ],
-               'cit' : [ 'open-ils.actor', 'open-ils.actor.user.ident_types.retrieve', [], true ],
-               'cst' : [ 'open-ils.actor', 'open-ils.actor.standings.retrieve', [], true ],
-               'acpl' : [ 'open-ils.search', 'open-ils.search.config.copy_location.retrieve.all', [], true ],
-               'ccs' : [ 'open-ils.search', 'open-ils.search.config.copy_status.retrieve.all', [], true ],
-               'aou' : [ 'open-ils.actor', 'open-ils.actor.org_tree.retrieve', [], true ],
-               'aout' : [ 'open-ils.actor', 'open-ils.actor.org_types.retrieve', [], true ]    
+               'pgt' : [ api.fm_pgt_retrieve.app, api.fm_pgt_retrieve.method, [], true ],
+               'cit' : [ api.fm_cit_retrieve.app, api.fm_cit_retrieve.method, [], true ],
+               'cst' : [ api.fm_cst_retrieve.app, api.fm_cst_retrieve.method, [], true ],
+               'acpl' : [ api.fm_acpl_retrieve.app, api.fm_acpl_retrieve.method, [], true ],
+               'ccs' : [ api.fm_ccs_retrieve.app, api.fm_ccs_retrieve.method, [], true ],
+               'aou' : [ api.fm_aou_retrieve.app, api.fm_aou_retrieve.method, [], true ],
+               'aout' : [ api.fm_aout_retrieve.app, api.fm_aout_retrieve.method, [], true ]    
        },
 
        'stash_retrieve' : function() {
@@ -140,8 +140,8 @@ OpenILS.data.prototype = {
                                var f = gen_fm_retrieval_func(
                                        'au',
                                        [
-                                               'open-ils.search',
-                                               'open-ils.search.actor.user.session',
+                                               api.fm_au_retrieve_via_session.app,
+                                               api.fm_au_retrieve_via_session.method,
                                                [ obj.session ],
                                                false
                                        ]
@@ -174,8 +174,8 @@ OpenILS.data.prototype = {
                this.chain.push(
                        gen_fm_retrieval_func('my_aou', 
                                [ 
-                                       'open-ils.actor', 
-                                       'open-ils.actor.org_unit.full_path.retrieve', 
+                                       api.fm_aou_retrieve_related_via_session.app,
+                                       api.fm_aou_retrieve_related_via_session.method,
                                        [ obj.session ],
                                        true
                                ]
@@ -189,8 +189,8 @@ OpenILS.data.prototype = {
 
                                gen_fm_retrieval_func( 'my_actsc', 
                                        [ 
-                                               'open-ils.circ', 
-                                               'open-ils.circ.stat_cat.actor.retrieve.all', 
+                                               api.fm_actsc_retrieve_via_aou.app,
+                                               api.fm_actsc_retrieve_via_aou.method,
                                                [ obj.session, obj.list.au.home_ou() ],
                                                true
                                        ]
index cacc656..54c0c4e 100644 (file)
@@ -16,16 +16,16 @@ auth.session.prototype = {
 
                try {
                        var init = this.network.request(
-                               'open-ils.auth',
-                               'open-ils.auth.authenticate.init',
+                               api.auth_init.app,
+                               api.auth_init.method,
                                [ this.view.name_prompt.value ]
                        );
 
                        if (init) {
 
                                var robj = this.network.request(
-                                       'open-ils.auth',
-                                       'open-ils.auth.authenticate.complete',
+                                       api.auth_complete.app,
+                                       api.auth_complete.method,
                                        [ 
                                                this.view.name_prompt.value,
                                                hex_md5(
index 9f58bd2..015509c 100644 (file)
@@ -51,7 +51,8 @@ function main_init() {
                                G.OpenILS.data.stash('list','hash');
                                G.OpenILS.data._debug_stash();
 
-                               G.window.open('http://dev.gapines.org/xul/server/main/menu_frame.xul?session='+mw.escape(G.auth.session.key),'test','chrome');
+                               G.window.open(urls.opac + urls.remote_menu_frame 
+                                       + '?session='+mw.escape(G.auth.session.key),'test','chrome');
                        }
                        G.OpenILS.data.init();
                }
index 14a7506..4274388 100644 (file)
@@ -172,15 +172,15 @@ circ.checkout.prototype = {
                try {
                        var barcode = obj.controller.view.checkout_barcode_entry_textbox.value;
                        var permit = obj.network.request(
-                               'open-ils.circ',
-                               'open-ils.circ.permit_checkout',
+                               api.checkout_permit_via_barcode.app,
+                               api.checkout_permit_via_barcode.method,
                                [ obj.session, barcode, obj.patron_id, 0 ]
                        );
 
                        if (permit.status == 0) {
                                var checkout = obj.network.request(
-                                       'open-ils.circ',
-                                       'open-ils.circ.checkout.barcode',
+                                       api.checkout_via_barcode.app,
+                                       api.checkout_via_barcode.method,
                                        [ obj.session, barcode, obj.patron_id ]
                                );
                                obj.list.append(
index 29f6dd9..03b26ba 100644 (file)
@@ -30,7 +30,7 @@ main.menu.prototype = {
                        'cmd_new_window' : [
                                ['command','keypress'],
                                function() {
-                                       obj.window.open('/xul/server/main/menu_frame.xul','test' + 
+                                       obj.window.open(urls.remote_menu_frame,'test' + 
                                                obj.window.appshell_name_increment++ ,'chrome'); 
                                }
                        ],
@@ -49,13 +49,13 @@ main.menu.prototype = {
                        'cmd_circ_checkout' : [
                                ['command','keypress'],
                                function() { 
-                                       obj.set_tab('/xul/server/patron/patron_barcode_entry.xul?session='+obj.w.escape(session),{});
+                                       obj.set_tab(urls.remtoe_patron_barcode_entry + '?session='+obj.w.escape(session),{});
                                }
                        ],
                        'cmd_search_opac' : [
                                ['command','keypress'],
                                function() {
-                                       obj.set_tab('http://dev.gapines.org/',{},{ 'authtoken' : session });
+                                       obj.set_tab(urls.opac,{},{ 'authtoken' : session });
                                }
                        ]
                };
index 38dfdd5..5ba749f 100644 (file)
@@ -44,7 +44,8 @@ patron.display.prototype = {
                                                ['command'],
                                                function(ev) {
                                                        obj.deck.set_iframe(
-                                                               '/xul/server/circ/checkout.xul?session='
+                                                               urls.remote_checkout
+                                                               + '?session='
                                                                + window.escape( obj.session )
                                                                + '&patron_id='
                                                                + window.escape( obj.patron.id() )
@@ -491,8 +492,8 @@ patron.display.prototype = {
                                function() {
                                        try {
                                                var patron = obj.network.request(
-                                                       'open-ils.actor',
-                                                       'open-ils.actor.user.fleshed.retrieve_by_barcode',
+                                                       api.fm_au_retrieve_via_barcode.app,
+                                                       api.fm_au_retrieve_via_barcode.method,
                                                        [ obj.session, obj.barcode ]
                                                );
                                                if (patron) {
@@ -523,8 +524,8 @@ patron.display.prototype = {
                                function() {
                                        try {
                                                var bills = obj.network.request(
-                                                       'open-ils.actor',
-                                                       'open-ils.actor.user.transactions.have_balance',
+                                                       api.fm_mobts_having_balance.app,
+                                                       api.fm_mobts_having_balance.method,
                                                        [ obj.session, obj.patron.id() ]
                                                );
                                                //FIXME// obj.patron.bills( bills );
@@ -542,8 +543,8 @@ patron.display.prototype = {
                                function() {
                                        try {
                                                var checkouts = obj.network.request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.actor.user.checked_out',
+                                                       api.blob_checkouts_retrieve.app,
+                                                       api.blob_checkouts_retrieve.method,
                                                        [ obj.session, obj.patron.id() ]
                                                );
                                                obj.patron.checkouts( checkouts );
@@ -560,8 +561,8 @@ patron.display.prototype = {
                                function() {
                                        try {
                                                var holds = obj.network.request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.holds.retrieve',
+                                                       api.fm_ahr_retrieve.app,
+                                                       api.fm_ahr_retrieve.method,
                                                        [ obj.session, obj.patron.id() ]
                                                );
                                                obj.patron.hold_requests( holds );
@@ -579,7 +580,7 @@ patron.display.prototype = {
                        // Do it
                        JSAN.use('util.exec'); obj.exec = new util.exec();
                        obj.exec.on_error = function(E) {
-                               location.href = '/xul/server/patron/patron_barcode_entry.xul?session=' + window.escape(obj.session);
+                               location.href = urls.remote_patron_barcode_entry + '?session=' + window.escape(obj.session);
                                alert('FIXME: Need better alert and error handling.\nProblem with barcode.\n' + E);
                        }
                        this.exec.chain( chain );