[open-ils-commits] r9278 - in
branches/dojo-admin/Open-ILS/web/conify: global/actor
global/config global/permission js/fieldmapper
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 8 23:02:57 EDT 2008
Author: miker
Date: 2008-04-08 22:25:45 -0400 (Tue, 08 Apr 2008)
New Revision: 9278
Modified:
branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit.html
branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit_type.html
branches/dojo-admin/Open-ILS/web/conify/global/config/copy_status.html
branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
branches/dojo-admin/Open-ILS/web/conify/global/permission/perm_list.html
branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js
Log:
dojo-ized opensrf js
Modified: branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit.html 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit.html 2008-04-09 02:25:45 UTC (rev 9278)
@@ -32,8 +32,6 @@
<script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf_xhr.js' type='text/javascript'></script>
<!-- Fieldmapper objects -->
<script language='javascript' src='/opac/common/js/fmall.js' type='text/javascript'></script>
Modified: branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit_type.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit_type.html 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/global/actor/org_unit_type.html 2008-04-09 02:25:45 UTC (rev 9278)
@@ -32,8 +32,6 @@
<script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf_xhr.js' type='text/javascript'></script>
<!-- Fieldmapper objects -->
<script language='javascript' src='/opac/common/js/fmall.js' type='text/javascript'></script>
Modified: branches/dojo-admin/Open-ILS/web/conify/global/config/copy_status.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/config/copy_status.html 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/global/config/copy_status.html 2008-04-09 02:25:45 UTC (rev 9278)
@@ -35,8 +35,6 @@
<script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf_xhr.js' type='text/javascript'></script>
<!-- Fieldmapper objects -->
<script language='javascript' src='/opac/common/js/fmall.js' type='text/javascript'></script>
Modified: branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-09 02:25:45 UTC (rev 9278)
@@ -45,8 +45,6 @@
<script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf_xhr.js' type='text/javascript'></script>
<!-- Fieldmapper objects XXX need to dojo-ize this -->
<script language='javascript' src='/opac/common/js/fmall.js' type='text/javascript'></script>
Modified: branches/dojo-admin/Open-ILS/web/conify/global/permission/perm_list.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/permission/perm_list.html 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/global/permission/perm_list.html 2008-04-09 02:25:45 UTC (rev 9278)
@@ -35,8 +35,6 @@
<script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
<script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf.js' type='text/javascript'></script>
- <script language='javascript' src='/opac/common/js/opensrf_xhr.js' type='text/javascript'></script>
<!-- Fieldmapper objects -->
<script language='javascript' src='/opac/common/js/fmall.js' type='text/javascript'></script>
Modified: branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js 2008-04-09 02:25:05 UTC (rev 9277)
+++ branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js 2008-04-09 02:25:45 UTC (rev 9278)
@@ -1,4 +1,5 @@
if(!dojo._hasResource["fieldmapper.Fieldmapper"]){
+
/* generate fieldmapper javascript classes. This expects a global variable
called 'fmclasses' to be fleshed with the classes we need to build */
@@ -8,7 +9,7 @@
dojo._hasResource["fieldmapper.Fieldmapper"] = true;
dojo.provide("fieldmapper.Fieldmapper");
- //dojo.require("opensrf.OpenSRF");
+ dojo.require("OpenSRF");
dojo.declare( "fieldmapper.Fieldmapper", null, {
@@ -56,19 +57,15 @@
isnew : function(n) { if(arguments.length == 1) this.a[0] =n; return this.a[0]; },
ischanged : function(n) { if(arguments.length == 1) this.a[1] =n; return this.a[1]; },
- isdeleted : function(n) { if(arguments.length == 1) this.a[2] =n; return this.a[2]; }
+ isdeleted : function(n) { if(arguments.length == 1) this.a[2] =n; return this.a[2]; },
_request : function ( meth, staff, params ) {
- var ses = fieldmapper.OpenSRF.session_cache[meth[0]];
- if (!ses) {
- ses = fieldmapper.OpenSRF.session_cache[meth[0]] = new OpenSRF.ClientSession( meth[0] );
- }
-
+ var ses = OpenSRF.CachedClientSession( meth[0] );
if (!ses) return null;
var result = null;
+ var args = {};
- var args = {};
if (dojo.isObject(params)) {
args = params;
} else {
@@ -80,11 +77,19 @@
}
args.timeout = 10;
- args.error = function (r) { throw 'Error encountered! ' + r };
+ }
+
+ if (!args.onerror) {
+ args.error = function (r) {
+ throw 'Error encountered! ' + r;
+ }
+ }
+
+ if (!args.oncomplete) {
args.oncomplete = function (r) {
var x = r.recv();
if (x) result = x.content();
- };
+ }
}
args.method = meth[1];
@@ -101,8 +106,8 @@
});
for( var cl in fmclasses ) {
- dojo.provide( 'fieldmapper.' + cl );
- dojo.declare( 'fieldmapper.' + cl , fieldmapper.Fieldmapper, {
+ dojo.provide( cl );
+ dojo.declare( cl , fieldmapper.Fieldmapper, {
constructor : function () {
if (!this.a) this.a = [];
this.classname = this.declaredClass;
@@ -114,18 +119,17 @@
}
}
});
- window[cl] = fieldmapper[cl]; // alias into place
+ fieldmapper[cl] = window[cl]; // alias into place
}
- fieldmapper.OpenSRF.session_cache = {};
+ fieldmapper.OpenSRF = {};
+
+ /* Methods are defined as [ service, method, have_staff ]
+ An optional 3rd component is when a method is followed by true, such methods
+ have a staff counterpart and should have ".staff" appended to the method
+ before the method is called when in XUL mode */
fieldmapper.OpenSRF.methods = {
- /* ---------------------------------------------------------------------------- */
- /* Methods are defined as [ service, method, have_staff ]
- An optional 3rd component is when a method is followed by true, such methods
- have a staff counterpart and should have ".staff" appended to the method
- before the method is called when in XUL mode */
-
SEARCH_MRS : ['open-ils.search','open-ils.search.metabib.multiclass',true],
SEARCH_RS : ['open-ils.search','open-ils.search.biblio.multiclass',true],
SEARCH_MRS_QUERY : ['open-ils.search','open-ils.search.metabib.multiclass.query',true],
More information about the open-ils-commits
mailing list