Merging changes from trunk into the new-json branch to keep it in sync with trunk new-json
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Jun 2007 14:11:35 +0000 (14:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Jun 2007 14:11:35 +0000 (14:11 +0000)
$ svn merge -r 7305:HEAD svn://svn.open-ils.org/ILS/trunk
Changeset 7305 is the changeset where the new-json branch was created in the ILS tree
This is the first sync merge

git-svn-id: svn://svn.open-ils.org/ILS/branches/new-json@7421 dcc99617-32d9-48b4-a31d-7c20da2025e4

519 files changed:
Evergreen/src/javascript/backend/circ/circ_item_config.js
Evergreen/src/javascript/backend/circ/circ_permit_hold.js
Evergreen/staff_client/LICENSE [deleted file]
Evergreen/staff_client/Makefile [deleted file]
Evergreen/staff_client/README [deleted file]
Evergreen/staff_client/application.ini [deleted file]
Evergreen/staff_client/chrome/chrome.manifest [deleted file]
Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_scripts_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/OpenSRF/OpenSRF_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/auth/auth.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/auth/auth.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/auth/auth_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/brief.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/browse_list_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/cat.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/cat.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/cat_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_add_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_display.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/copy_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/details.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc_fixed.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc_keys.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc_rules.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/marc_validate.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/record_list.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/record_list.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/record_list_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/volume.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/checkin.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/checkin.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/checkin_items.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/checkin_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_items.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/circ/receipt_template_editor.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/contents.rdf [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/about.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/app_shell.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/app_shell.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/app_shell_menus_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/grid_list.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/grid_list_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/list_box.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/paged_tree.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/main/paged_tree_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/opac/opac.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/opac/opac.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_checkout_items.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_contact_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_status_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_holds.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_items.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_new_legacy.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_results.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/patron/patron_utils.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/stat_cat/copy_stat_cat_editor.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/stat_cat/patron_stat_cat_editor.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_bundle.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/survey/survey.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/survey/survey_bundle.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/survey/survey_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/survey/survey_wizard.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/datetime.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/error.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/explode.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/file.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/filter_console.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/fm_utils.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/fm_view.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/functional.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/make_wiki_table.pl [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/populate.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/print.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/ses.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/shell.html [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/sound.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/util.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/util_overlay.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/validate.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/widgets.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/win.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/xpcom.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/xuledit.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/util/xuledit.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js [deleted file]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul [deleted file]
Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.properties [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.properties [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/checkin.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/circ_tree.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.properties [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/contents.rdf [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/hold_capture.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/paged_tree.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.properties [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_display.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search_form.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/stat_cat.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/survey.dtd [deleted file]
Evergreen/staff_client/chrome/locale/en-US/evergreen/z39_50.dtd [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/app_shell.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/auth.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/browse_list.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/cat.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/checkin.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/circ_tree.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/clam_shell.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/contents.rdf [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/evergreen.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/hold_capture.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/marc.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/images/cooltext001.png [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/images/main_logo.jpg [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/clicked.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/cow.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/die.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/gong.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/redalert.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/media/sounds/turn.wav [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/opac.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/paged_tree.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_display.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_display_contact.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_display_status.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_search.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_search_form.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/patron_search_results.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/stat_cat.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/survey.css [deleted file]
Evergreen/staff_client/chrome/skin/evergreen/z39_50.css [deleted file]
Evergreen/staff_client/defaults/preferences/evergreen.js [deleted file]
Evergreen/staff_client/install.js [deleted file]
Evergreen/staff_client/install.rdf [deleted file]
Evergreen/xul/staff_client/server/patron/ue.js
Open-ILS/examples/fm_IDL.xml
Open-ILS/examples/fm_IDL.xsd [new file with mode: 0644]
Open-ILS/examples/oils_obj.xsd [new file with mode: 0644]
Open-ILS/examples/oils_persist.xsd [new file with mode: 0644]
Open-ILS/examples/reporter.xsd [new file with mode: 0644]
Open-ILS/src/Makefile
Open-ILS/src/apachemods/mod_rest_gateway.c
Open-ILS/src/c-apps/Makefile
Open-ILS/src/c-apps/oils_auth.c
Open-ILS/src/c-apps/oils_idl-core.c
Open-ILS/src/extras/fieldmapper_IDL.pl
Open-ILS/src/extras/import/marc2bre.pl
Open-ILS/src/extras/oils_requestor.c
Open-ILS/src/java/Makefile [new file with mode: 0644]
Open-ILS/src/java/org/open_ils/idl/IDLField.java [new file with mode: 0644]
Open-ILS/src/java/org/open_ils/idl/IDLLink.java [new file with mode: 0644]
Open-ILS/src/java/org/open_ils/idl/IDLObject.java [new file with mode: 0644]
Open-ILS/src/java/org/open_ils/idl/IDLParser.java [new file with mode: 0644]
Open-ILS/src/java/org/open_ils/test/TestIDL.java [new file with mode: 0644]
Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Transit.pm
Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/Utils/ZClient.pm [new file with mode: 0644]
Open-ILS/src/python/oils/const.py
Open-ILS/src/python/oils/utils/idl.py
Open-ILS/src/sql/Pg/020.schema.functions.sql
Open-ILS/src/support-scripts/test-scripts/container.pl
Open-ILS/web/opac/common/js/RemoteRequest.js
Open-ILS/web/opac/images/eg_tiny_logo.jpg [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/common.dtd [deleted file]
Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/locale/en-US/opac_advanced.dtd [deleted file]
Open-ILS/web/opac/locale/en-US/opac_common.dtd [deleted file]
Open-ILS/web/opac/locale/en-US/opac_holds.dtd [deleted file]
Open-ILS/web/opac/locale/en-US/opac_rdetail.dtd [deleted file]
Open-ILS/web/opac/locale/en-US/opac_result.dtd [deleted file]
Open-ILS/web/opac/skin/default/js/holds.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_global.xml
Open-ILS/web/opac/skin/default/xml/advanced/advanced_quick.xml
Open-ILS/web/opac/skin/default/xml/common/cn_browse.xml
Open-ILS/web/opac/skin/default/xml/common/fonts.xml
Open-ILS/web/opac/skin/default/xml/common/holds.xml
Open-ILS/web/opac/skin/default/xml/common/libselect.xml
Open-ILS/web/opac/skin/default/xml/common/login.xml
Open-ILS/web/opac/skin/default/xml/common/searchbar.xml
Open-ILS/web/opac/skin/default/xml/common/sidebar.xml
Open-ILS/web/opac/skin/default/xml/common/statusbar.xml
Open-ILS/web/opac/skin/default/xml/common/tips.xml
Open-ILS/web/opac/skin/default/xml/footer.xml
Open-ILS/web/opac/skin/default/xml/home/index_body.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_bookbags.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_fines.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_holds.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_prefs.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_summary.xml
Open-ILS/web/opac/skin/default/xml/page_myopac.xml
Open-ILS/web/opac/skin/default/xml/page_rdetail.xml
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_copyinfo.xml
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_extras.xml
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Open-ILS/web/opac/skin/default/xml/result/result_info.xml
Open-ILS/web/opac/skin/default/xml/result/result_lowhits.xml
Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Open-ILS/web/reports/oils_rpt_editor.xhtml
Open-ILS/web/reports/oils_rpt_param_editor.js
Open-ILS/web/reports/oils_rpt_report_editor.js
Open-ILS/web/reports/oils_rpt_tforms.js
Open-ILS/web/reports/oils_rpt_vars.js
Open-ILS/web/reports/oils_rpt_widget.js
Open-ILS/web/reports/xul/source-setup.js
Open-ILS/web/reports/xul/template-config.js
Open-ILS/web/reports/xul/transforms.js
Open-ILS/xul/staff_client/Makefile
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/util/date.js
Open-ILS/xul/staff_client/chrome/content/util/error.js
Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/components/nsIOpenILS.xpt
Open-ILS/xul/staff_client/external/prune_dirs.sh
Open-ILS/xul/staff_client/server/admin/adminlib.js
Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
Open-ILS/xul/staff_client/server/admin/transit_list.js
Open-ILS/xul/staff_client/server/admin/transit_list.xul
Open-ILS/xul/staff_client/server/cat/copy_browser.js
Open-ILS/xul/staff_client/server/cat/copy_browser.xul
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/copy_status.xul
Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul
Open-ILS/xul/staff_client/server/main/gen_offline_widgets.xul
Open-ILS/xul/staff_client/server/main/ws_info.xul
Open-ILS/xul/staff_client/server/patron/bills.js
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/search_form.js
Open-ILS/xul/staff_client/server/patron/search_form.xul
OpenSRF/bin/osrf_ctl.sh [deleted file]
OpenSRF/doc/Application-HOWTO.txt [deleted file]
OpenSRF/doc/OpenSRF-Messaging-Protocol.html [deleted file]
OpenSRF/doc/Persist-API.html [deleted file]
OpenSRF/doc/Roadmap.txt [deleted file]
OpenSRF/doc/dokuwiki-doc-stubber.pl [deleted file]
OpenSRF/examples/bootstrap.conf.example [deleted file]
OpenSRF/examples/fieldmapper2cdbi.xsl [deleted file]
OpenSRF/examples/fieldmapper2javascript.xsl [deleted file]
OpenSRF/examples/fieldmapper2perl.xsl [deleted file]
OpenSRF/examples/gen-fieldmapper.xml [deleted file]
OpenSRF/examples/math_bench.pl [deleted file]
OpenSRF/examples/math_xul_client/Makefile [deleted file]
OpenSRF/examples/math_xul_client/install.js [deleted file]
OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml [deleted file]
OpenSRF/examples/math_xul_client/math/content/contents.rdf [deleted file]
OpenSRF/examples/math_xul_client/math/content/math.xul [deleted file]
OpenSRF/examples/math_xul_client/math/content/math_app.js [deleted file]
OpenSRF/examples/math_xul_client/math/content/math_overlay.xul [deleted file]
OpenSRF/examples/math_xul_client/math/locale/en-US/contents.rdf [deleted file]
OpenSRF/examples/math_xul_client/math/locale/en-US/math.dtd [deleted file]
OpenSRF/examples/math_xul_client/math/skin/contents.rdf [deleted file]
OpenSRF/examples/math_xul_client/math/skin/math.css [deleted file]
OpenSRF/examples/multisession-test.pl [deleted file]
OpenSRF/examples/opensrf.xml.example [deleted file]
OpenSRF/examples/opensrf_core.xml.example [deleted file]
OpenSRF/examples/register.pl [deleted file]
OpenSRF/examples/srfsh.xml.example [deleted file]
OpenSRF/src/Makefile [deleted file]
OpenSRF/src/c-apps/Makefile [deleted file]
OpenSRF/src/c-apps/osrf_dbmath.c [deleted file]
OpenSRF/src/c-apps/osrf_math.c [deleted file]
OpenSRF/src/c-apps/osrf_version.c [deleted file]
OpenSRF/src/extras/docgen.xsl [deleted file]
OpenSRF/src/gateway/Makefile [deleted file]
OpenSRF/src/gateway/apachetools.c [deleted file]
OpenSRF/src/gateway/apachetools.h [deleted file]
OpenSRF/src/gateway/fieldmapper-c-xml-out.pl [deleted file]
OpenSRF/src/gateway/osrf_json_gateway.c [deleted file]
OpenSRF/src/java/Makefile [deleted file]
OpenSRF/src/java/ext/stax-api-1.0.1.jar [deleted file]
OpenSRF/src/java/ext/wstx-asl-3.2.1.jar [deleted file]
OpenSRF/src/java/org/opensrf/ClientSession.java [deleted file]
OpenSRF/src/java/org/opensrf/Message.java [deleted file]
OpenSRF/src/java/org/opensrf/Method.java [deleted file]
OpenSRF/src/java/org/opensrf/MethodException.java [deleted file]
OpenSRF/src/java/org/opensrf/Request.java [deleted file]
OpenSRF/src/java/org/opensrf/Result.java [deleted file]
OpenSRF/src/java/org/opensrf/ServerSession.java [deleted file]
OpenSRF/src/java/org/opensrf/Session.java [deleted file]
OpenSRF/src/java/org/opensrf/Stack.java [deleted file]
OpenSRF/src/java/org/opensrf/net/xmpp/XMPPException.java [deleted file]
OpenSRF/src/java/org/opensrf/net/xmpp/XMPPMessage.java [deleted file]
OpenSRF/src/java/org/opensrf/net/xmpp/XMPPReader.java [deleted file]
OpenSRF/src/java/org/opensrf/net/xmpp/XMPPSession.java [deleted file]
OpenSRF/src/java/org/opensrf/test/TestClient.java [deleted file]
OpenSRF/src/java/org/opensrf/test/TestConfig.java [deleted file]
OpenSRF/src/java/org/opensrf/test/TestJSON.java [deleted file]
OpenSRF/src/java/org/opensrf/test/TestXMPP.java [deleted file]
OpenSRF/src/java/org/opensrf/util/Config.java [deleted file]
OpenSRF/src/java/org/opensrf/util/ConfigException.java [deleted file]
OpenSRF/src/java/org/opensrf/util/JSONException.java [deleted file]
OpenSRF/src/java/org/opensrf/util/JSONReader.java [deleted file]
OpenSRF/src/java/org/opensrf/util/JSONWriter.java [deleted file]
OpenSRF/src/java/org/opensrf/util/OSRFObject.java [deleted file]
OpenSRF/src/java/org/opensrf/util/OSRFRegistry.java [deleted file]
OpenSRF/src/java/org/opensrf/util/OSRFSerializable.java [deleted file]
OpenSRF/src/java/org/opensrf/util/Utils.java [deleted file]
OpenSRF/src/javascript/JSON.js [deleted file]
OpenSRF/src/javascript/md5.js [deleted file]
OpenSRF/src/javascript/opensrf_app_session.js [deleted file]
OpenSRF/src/javascript/opensrf_config.js [deleted file]
OpenSRF/src/javascript/opensrf_dom_element.js [deleted file]
OpenSRF/src/javascript/opensrf_domain_object.js [deleted file]
OpenSRF/src/javascript/opensrf_jabber_transport.js [deleted file]
OpenSRF/src/javascript/opensrf_msg_stack.js [deleted file]
OpenSRF/src/javascript/opensrf_transport.js [deleted file]
OpenSRF/src/javascript/opensrf_utils.js [deleted file]
OpenSRF/src/jserver/Makefile [deleted file]
OpenSRF/src/jserver/osrf_chat.c [deleted file]
OpenSRF/src/jserver/osrf_chat.h [deleted file]
OpenSRF/src/jserver/osrf_chat_main.c [deleted file]
OpenSRF/src/libstack/Makefile [deleted file]
OpenSRF/src/libstack/Makefile.JSON [deleted file]
OpenSRF/src/libstack/legacy_json.c [deleted file]
OpenSRF/src/libstack/legacy_json.h [deleted file]
OpenSRF/src/libstack/opensrf.c [deleted file]
OpenSRF/src/libstack/osrfConfig.c [deleted file]
OpenSRF/src/libstack/osrfConfig.h [deleted file]
OpenSRF/src/libstack/osrf_app_session.c [deleted file]
OpenSRF/src/libstack/osrf_app_session.h [deleted file]
OpenSRF/src/libstack/osrf_application.c [deleted file]
OpenSRF/src/libstack/osrf_application.h [deleted file]
OpenSRF/src/libstack/osrf_big_hash.c [deleted file]
OpenSRF/src/libstack/osrf_big_hash.h [deleted file]
OpenSRF/src/libstack/osrf_big_list.c [deleted file]
OpenSRF/src/libstack/osrf_big_list.h [deleted file]
OpenSRF/src/libstack/osrf_cache.c [deleted file]
OpenSRF/src/libstack/osrf_cache.h [deleted file]
OpenSRF/src/libstack/osrf_hash.c [deleted file]
OpenSRF/src/libstack/osrf_hash.h [deleted file]
OpenSRF/src/libstack/osrf_json.h [deleted file]
OpenSRF/src/libstack/osrf_json_object.c [deleted file]
OpenSRF/src/libstack/osrf_json_parser.c [deleted file]
OpenSRF/src/libstack/osrf_json_tools.c [deleted file]
OpenSRF/src/libstack/osrf_json_utils.h [deleted file]
OpenSRF/src/libstack/osrf_list.c [deleted file]
OpenSRF/src/libstack/osrf_list.h [deleted file]
OpenSRF/src/libstack/osrf_message.c [deleted file]
OpenSRF/src/libstack/osrf_message.h [deleted file]
OpenSRF/src/libstack/osrf_prefork.c [deleted file]
OpenSRF/src/libstack/osrf_prefork.h [deleted file]
OpenSRF/src/libstack/osrf_settings.c [deleted file]
OpenSRF/src/libstack/osrf_settings.h [deleted file]
OpenSRF/src/libstack/osrf_stack.c [deleted file]
OpenSRF/src/libstack/osrf_stack.h [deleted file]
OpenSRF/src/libstack/osrf_system.c [deleted file]
OpenSRF/src/libstack/osrf_system.h [deleted file]
OpenSRF/src/libstack/osrf_transgroup.c [deleted file]
OpenSRF/src/libstack/osrf_transgroup.h [deleted file]
OpenSRF/src/libtransport/Makefile [deleted file]
OpenSRF/src/libtransport/basic_client.c [deleted file]
OpenSRF/src/libtransport/component.c [deleted file]
OpenSRF/src/libtransport/transport_client.c [deleted file]
OpenSRF/src/libtransport/transport_client.h [deleted file]
OpenSRF/src/libtransport/transport_message.c [deleted file]
OpenSRF/src/libtransport/transport_message.h [deleted file]
OpenSRF/src/libtransport/transport_session.c [deleted file]
OpenSRF/src/libtransport/transport_session.h [deleted file]
OpenSRF/src/objson/Makefile [deleted file]
OpenSRF/src/objson/json2xml.c [deleted file]
OpenSRF/src/objson/json2xml.h [deleted file]
OpenSRF/src/objson/json_parser.c [deleted file]
OpenSRF/src/objson/json_parser.h [deleted file]
OpenSRF/src/objson/object.c [deleted file]
OpenSRF/src/objson/object.h [deleted file]
OpenSRF/src/objson/objson_test.c [deleted file]
OpenSRF/src/patch/README [deleted file]
OpenSRF/src/patch/mod_offline.c [deleted file]
OpenSRF/src/patch/nad.c [deleted file]
OpenSRF/src/perlmods/JSON.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/AppSession.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application/Client.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application/Demo/Math.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application/Demo/MathDB.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application/Persist.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Application/Settings.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DOM.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObject.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectAttr.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectCollection.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DOM/Element/params.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMethod.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMultiSearch.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsPrimitive.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsSearch.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/DomainObjectCollection.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/EX.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/MultiSession.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/System.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Jabber.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JInbound.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JMessageWrapper.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JPeerConnection.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JabberClient.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/Listener.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/PeerHandle.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/UnixServer.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/Cache.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/Config.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/LogServer.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/SettingsClient.pm [deleted file]
OpenSRF/src/perlmods/OpenSRF/Utils/SettingsParser.pm [deleted file]
OpenSRF/src/python/osrf/__init__.py [deleted file]
OpenSRF/src/python/osrf/conf.py [deleted file]
OpenSRF/src/python/osrf/const.py [deleted file]
OpenSRF/src/python/osrf/ex.py [deleted file]
OpenSRF/src/python/osrf/json.py [deleted file]
OpenSRF/src/python/osrf/log.py [deleted file]
OpenSRF/src/python/osrf/net.py [deleted file]
OpenSRF/src/python/osrf/ses.py [deleted file]
OpenSRF/src/python/osrf/set.py [deleted file]
OpenSRF/src/python/osrf/stack.py [deleted file]
OpenSRF/src/python/osrf/system.py [deleted file]
OpenSRF/src/python/osrf/utils.py [deleted file]
OpenSRF/src/python/srfsh.py [deleted file]
OpenSRF/src/router/Makefile [deleted file]
OpenSRF/src/router/osrf_router.c [deleted file]
OpenSRF/src/router/osrf_router.h [deleted file]
OpenSRF/src/router/osrf_router_main.c [deleted file]
OpenSRF/src/srfsh/Makefile [deleted file]
OpenSRF/src/srfsh/srfsh.c [deleted file]
OpenSRF/src/srfsh/srfsh.h [deleted file]
OpenSRF/src/utils/Makefile [deleted file]
OpenSRF/src/utils/fieldmapper-c.pl [deleted file]
OpenSRF/src/utils/log.c [deleted file]
OpenSRF/src/utils/log.h [deleted file]
OpenSRF/src/utils/md5.c [deleted file]
OpenSRF/src/utils/md5.h [deleted file]
OpenSRF/src/utils/sha.c [deleted file]
OpenSRF/src/utils/sha.h [deleted file]
OpenSRF/src/utils/socket_bundle.c [deleted file]
OpenSRF/src/utils/socket_bundle.h [deleted file]
OpenSRF/src/utils/socket_test.c [deleted file]
OpenSRF/src/utils/string_array.c [deleted file]
OpenSRF/src/utils/string_array.h [deleted file]
OpenSRF/src/utils/utils.c [deleted file]
OpenSRF/src/utils/utils.h [deleted file]
OpenSRF/src/utils/xml_utils.c [deleted file]
OpenSRF/src/utils/xml_utils.h [deleted file]
OpenSRF/src/xinclude/Makefile [deleted file]
OpenSRF/src/xinclude/mod_xinclude.c [deleted file]
config.sh
install.conf.default
install.sh

index b36f014..ec1f518 100644 (file)
@@ -451,8 +451,8 @@ function getItemConfig() {
 
 
 function setMaxFineByCircLocation() {
-       var max_libs = [ 'ARL', 'DTRL', 'SJRLS' ];
-       var mid_libs = [ 'CHRL', 'ECGR', 'FRRLS', 'HCLS', 'OCRL', 'OHOOP', 'OKRL', 'PMRLS', 'PPL', 'STRL' ];
+       var max_libs = [ 'DTRL', 'SJRLS' ];
+       var mid_libs = [ 'ARL', 'CHRL', 'ECGR', 'FRRLS', 'HCLS', 'OCRL', 'OHOOP', 'OKRL', 'PMRLS', 'PPL', 'STRL' ];
 
        var cl = (volume && volume.id != -1) ? volume.owning_lib : currentLocation.id;
        var max_fine = null;
index 41e3374..80b36b8 100644 (file)
@@ -5,7 +5,7 @@ log_vars('circ_permit_hold');
 
 
 /* is a staff member placing this hold? */
-var isStaffHold = isGroupDescendant('Staff', patronProfile);
+var isStaffHold = isGroupDescendantId('Staff', requestor.profile);
 
 
 /* non-staff members are allowed 50 open holds at most */
@@ -14,7 +14,10 @@ if( ! isStaffHold ) {
    log_info("patron has " + count + " open holds");
    if( count >= 50 ) 
       result.events.push('MAX_HOLDS');
-} 
+} else {
+    log_info("This is a staff-placed hold");
+}
+
 
 
 if( isTrue(patron.barred) ) 
diff --git a/Evergreen/staff_client/LICENSE b/Evergreen/staff_client/LICENSE
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/Makefile b/Evergreen/staff_client/Makefile
deleted file mode 100644 (file)
index dbd6209..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-VERSION=0.1.0
-PACKAGE=Evergreen
-DESCRIPTION=Evergreen Staff Client 
-BUILD=2005072719
-
-RETRIEVE_FIELDMAPPER=wget -N http://dev.gapines.org/opac/common/js/util/fieldmapper.js
-RETRIEVE_FM_ALL=wget -N http://dev.gapines.org/opac/common/js/fmall.js
-RETRIEVE_ORG_TREE=wget -N http://dev.gapines.org/opac/common/js/OrgTree.js
-RETRIEVE_CLIENT_CONFIG=cp ../../../../../../OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml .
-
-all: build package
-       @echo
-       @echo How do makefiles work again?
-       @echo BUILD = ${BUILD}
-       touch application.ini
-
-build: generated open-ils patron circ
-       @echo
-       @echo Everything before packaging
-
-package: evergreen.xpi
-       @echo
-       @echo Packaging
-
-stamp: 
-       sed -i s/^Version=.\*/Version=${VERSION}/ application.ini 
-       sed -i s/^BuildID=.\*/BuildID=${BUILD}/ application.ini
-       sed -i s/^Name=.\*/Name=${PACKAGE}/ application.ini 
-       sed -i 's/<em:version>.*<\/em:version>/<em:version>${VERSION}<\/em:version>/' install.rdf 
-       sed -i 's/<em:name>.*<\/em:name>/<em:name>${PACKAGE}<\/em:name>/' install.rdf 
-       sed -i 's/<em:description>.*<\/em:description>/<em:description>${DESCRIPTION}<\/em:description>/' install.rdf 
-       sed -i "s/extVersion: '.\*'/extVersion: '${VERSION}'/" install.js 
-       sed -i "s/extFullName: '.\*'/extFullName: '${DESCRIPTION}'/" install.js 
-       sed -i 's/auth\.title ".*"/auth\.title "${DESCRIPTION}"/' chrome/locale/en-US/evergreen/auth.dtd 
-       sed -i 's/auth\.version ".*"/auth\.version "${PACKAGE} ${VERSION} ${BUILD}"/' chrome/locale/en-US/evergreen/auth.dtd 
-
-generated:
-       @echo
-       @echo These things are installation specific.  The staff client is the last thing you should try to build.
-       #(cd chrome/content/evergreen/util ; ${RETRIEVE_FIELDMAPPER} );
-       (cd chrome/content/evergreen/Open-ILS/util/ ; ${RETRIEVE_ORG_TREE} );
-       (cd chrome/content/evergreen/conf ; ${RETRIEVE_CLIENT_CONFIG} );
-       (cd chrome/content/evergreen/Open-ILS/util/ ; ${RETRIEVE_FM_ALL} );
-
-open-ils:
-       cp ../../OpenSRF/src/javascript/*.js chrome/content/evergreen/OpenSRF/
-       cp ../../Open-ILS/web/opac/common/js/*.js chrome/content/evergreen/Open-ILS/util/
-       #cp ../../Open-ILS/src/javascript/widgets/*.js chrome/content/evergreen/Open-ILS/widgets/
-       #cp ../../Open-ILS/src/javascript/widgets/menu/*.js chrome/content/evergreen/Open-ILS/widgets/menu/
-
-patron:
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_items/g | sed s/PagedTree/PatronItems/g > chrome/content/evergreen/patron/patron_items_overlay.xul )
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_search_results/g | sed s/PagedTree/PatronSearchResults/g > chrome/content/evergreen/patron/patron_search_results_overlay.xul )
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_checkout_items/g | sed s/PagedTree/PatronCheckoutItems/g > chrome/content/evergreen/patron/patron_checkout_items_overlay.xul )
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_holds/g | sed s/PagedTree/PatronHolds/g > chrome/content/evergreen/patron/patron_holds_overlay.xul )
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_items.dtd)
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_search_results.dtd)
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_checkout_items.dtd)
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_holds.dtd)
-
-circ:
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/checkin_items/g | sed s/PagedTree/CheckinItems/g > chrome/content/evergreen/circ/checkin_items_overlay.xul )
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/checkin_items.dtd)
-       (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/hold_capture_items/g | sed s/PagedTree/HoldCaptureItems/g > chrome/content/evergreen/circ/hold_capture_items_overlay.xul )
-       (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/hold_capture_items.dtd)
-
-evergreen.xpi: evergreen.jar
-       @echo
-       @echo make the xpi file
-       zip -r evergreen.xpi chrome/ defaults/ install.js install.rdf application.ini Makefile LICENSE README -x \*CVS\* > /dev/null
-
-evergreen.jar: build
-       @echo
-       @echo make the jar file
-       (cd chrome; zip -r evergreen.jar content/ locale/ skin/ -x \*CVS\* > /dev/null )
-
-clean:
-       @echo
-       @echo delete derived files
-       rm -f evergreen.xpi
-       rm -f chrome/evergreen.jar
-       rm -f chrome/content/evergreen/patron/patron_items_overlay.xul chrome/locale/en-US/evergreen/patron_items.dtd
-       rm -f chrome/content/evergreen/patron/patron_search_results_overlay.xul chrome/locale/en-US/evergreen/patron_search_results.dtd
-       rm -f chrome/content/evergreen/patron/patron_checkout_items_overlay.xul chrome/locale/en-US/evergreen/patron_checkout_items.dtd
-       rm -f chrome/content/evergreen/patron/patron_holds_overlay.xul chrome/locale/en-US/evergreen/patron_holds.dtd
-       rm -f chrome/content/evergreen/circ/checkin_items_overlay.xul chrome/locale/en-US/evergreen/checkin_items.dtd
-       rm -f chrome/content/evergreen/circ/hold_capture_items_overlay.xul chrome/locale/en-US/evergreen/hold_capture_items.dtd
-       rm -f chrome/content/evergreen/conf/client_config.xml
-       rm -f chrome/content/evergreen/util/fieldmapper.js
-       rm -f chrome/content/evergreen/util/OrgTree.js
-       rm -f chrome/content/evergreen/OpenSRF/*js
-       rm -f chrome/content/evergreen/Open-ILS/util/*js
-       rm -f chrome/content/evergreen/Open-ILS/widgets/*js
-       rm -f chrome/content/evergreen/Open-ILS/widgets/menu/*js
diff --git a/Evergreen/staff_client/README b/Evergreen/staff_client/README
deleted file mode 100644 (file)
index e79cef8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This part of the tree is deprecated.. it was a previous incarnation of the staff client now at ILS/Open-ILS/xul/staff_client/
diff --git a/Evergreen/staff_client/application.ini b/Evergreen/staff_client/application.ini
deleted file mode 100644 (file)
index 88a6227..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-[App]
-; Modified by Jason for Evergreen
-; This file is used by XUL Runner like so:  xulrunner ./application.ini
-;
-; This field specifies your organization's name.  This field is recommended,
-; but optional.
-Vendor=PINES
-;
-; This field specifies your application's name.  This field is required.
-Name=Evergreen
-;
-; This field specifies your application's version.  This field is optional.
-Version=0.1.0
-;
-; This field specifies your application's build ID (timestamp).  This field is
-; required.
-BuildID=2005072719
-;
-; This field specifies a compact copyright notice for your application.  This
-; field is optional.
-Copyright=Copyright (c) 2005 GPLS/PINES
-;
-; This ID is just an example.  Every XUL app ought to have it's own unique ID.
-; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
-; irc.mozilla.org and /msg botbot uuid.  This field is optional.
-ID={c3dd711b-c9b4-4785-b8f8-6157149c8905}
-
-[Gecko]
-;
-; This field is required.  It specifies the minimum Gecko version that this
-; application requires.  Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MinVersion=1.8
-;
-; This field is optional.  It specifies the maximum Gecko version that this
-; application requires.  It should be specified if your application uses
-; unfrozen interfaces.  Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MaxVersion=1.9
diff --git a/Evergreen/staff_client/chrome/chrome.manifest b/Evergreen/staff_client/chrome/chrome.manifest
deleted file mode 100644 (file)
index 4179af3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-content evergreen jar:evergreen.jar!/content/evergreen/
-locale evergreen en-US jar:evergreen.jar!/locale/en-US/evergreen/
-skin evergreen evergreen jar:evergreen.jar!/skin/evergreen/
diff --git a/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS.js b/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS.js
deleted file mode 100644 (file)
index 2f4a13c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-function OpenILS_init(params) { 
-       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg,function(i,o){try{return [i,o.toString()];}catch(E){return [i,o];}}))' }));
-
-       try {
-
-               switch(params.app) {
-                       case 'Auth' : auth_init(params); break;
-                       case 'AppShell' : app_shell_init(params); register_AppShell(params.w); break;
-                       case 'Opac' : opac_init(params); break;
-                       case 'PatronSearch' : patron_search_init(params); break;
-                       case 'PatronDisplay' : patron_display_init(params); break;
-                       case 'Checkin' : checkin_init(params); break;
-                       case 'HoldCapture' : hold_capture_init(params); break;
-               }
-
-       } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-
-       try {
-
-               //register_document(params.w.document);
-               register_window(params.w);
-
-       } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function OpenILS_exit(params) {
-       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg,function(i,o){try{return [i,o.toString()];}catch(E){return [i,o];}}))' }));
-
-       /*
-       try {
-       
-               switch(params.app) {
-                       case 'Auth' : auth_exit(params); break;
-                       case 'AppShell' : app_shell_exit(params); unregister_AppShell(params.w); break;
-                       case 'Opac' : opac_exit(params); break;
-                       case 'PatronSearch' : patron_search_exit(params); break;
-                       case 'PatronDisplay' : patron_display_exit(params); break;
-                       case 'Checkin' : checkin_exit(params); break;
-                       case 'HoldCapture' : hold_capture_exit(params); break;
-               }
-
-       } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-       */
-
-       try {
-
-               // buggy for now
-               //unregister_document(params.w.document);
-               unregister_window(params.w);
-
-       } catch(E) { sdump('D_ERROR',js2JSON(E)+'\n'); }
-
-       sdump('D_TRACE','Exiting OpenILS_exit\n');
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_overlay.xul
deleted file mode 100644 (file)
index 7acee43..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenILS_overlay"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/Open-ILS/OpenILS_scripts_overlay.xul"?>
-
-       <OpenILS id="OpenILS_js">
-
-               <!-- OpenSRF -->
-               <script>
-               <![CDATA[
-                       var myPackageDir = "evergreen"; var ses; dump('Loading all the js in the OpenILS overlay...\n');
-                       /*
-                       Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService).registerListener(
-                               { 
-                                       observe: function( msg ) { 
-                                               if (! msg.message.match( /delta/ ) ) {
-                                                       var s = '';
-                                                       for (var i in msg) {
-                                                               s += 'msg.' + i + ' = ' + msg[i] + '\n';
-                                                       }
-                                                       alert(s); 
-                                               }
-                                       },
-                                       QueryInterface: function (iid) { 
-                                               if (!iid.equals(Components.interfaces.nsIConsoleListener) 
-                                                       && !iid.equals(Components.interfaces.nsISupports)) { 
-                                                       throw Components.results.NS_ERROR_NO_INTERFACE; 
-                                               } 
-                                               return this; 
-                                       }
-                               }
-                       );
-                       */
-               ]]>
-               </script>
-               <OpenSRF id="OpenSRF_js" />
-
-               <util id="util_js" />
-
-               <apps id="apps_js" />
-
-       </OpenILS>
-
-       <stringbundleset id="string_bundles">
-               <stringbundle id="main_strings" src="chrome://evergreen/locale/OpenILS.properties"/>
-               <!-- <stringbundle id="patron_strings" src="chrome://evergreen/locale/patron.properties"/> -->
-       </stringbundleset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_scripts_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS_scripts_overlay.xul
deleted file mode 100644 (file)
index 870c137..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenILS_scripts_overlay"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <apps id="apps_js">
-               <script src="chrome://evergreen/content/Open-ILS/OpenILS.js" />
-               <script src="chrome://evergreen/content/auth/auth.js" />
-               <script src="chrome://evergreen/content/main/app_shell.js" />
-               <script src="chrome://evergreen/content/main/clam_shell.js" />
-               <script src="chrome://evergreen/content/main/paged_tree.js" />
-               <script src="chrome://evergreen/content/main/grid_list.js" />
-               <script src="chrome://evergreen/content/main/list_box.js" />
-               <script src="chrome://evergreen/content/opac/opac.js" />
-               <script src="chrome://evergreen/content/patron/patron_utils.js" />
-               <script src="chrome://evergreen/content/patron/patron_search.js" />
-               <script src="chrome://evergreen/content/patron/patron_search_form.js" />
-               <script src="chrome://evergreen/content/patron/patron_search_results.js" />
-               <script src="chrome://evergreen/content/patron/patron_display.js" />
-               <script src="chrome://evergreen/content/patron/patron_checkout_items.js" />
-               <script src="chrome://evergreen/content/patron/patron_items.js" />
-               <script src="chrome://evergreen/content/patron/patron_holds.js" />
-               <script src="chrome://evergreen/content/patron/patron_bills.js" />
-               <script src="chrome://evergreen/content/patron/patron_edit.js" />
-               <script src="chrome://evergreen/content/circ/circ_utils.js" />
-               <script src="chrome://evergreen/content/circ/checkin.js" />
-               <script src="chrome://evergreen/content/circ/checkin_items.js" />
-               <script src="chrome://evergreen/content/circ/hold_capture.js" />
-               <script src="chrome://evergreen/content/circ/hold_capture_items.js" />
-       </apps>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/OpenSRF/OpenSRF_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/OpenSRF/OpenSRF_overlay.xul
deleted file mode 100644 (file)
index cb60096..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="OpenSRF"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<OpenSRF id="OpenSRF_js">
-       <script>dump('Loading all the js in the OpenSRF overlay...\n');</script>
-       <!--
-       <script src="JSON.js" />
-       <script src="md5.js" />
-       <script src="opensrf_utils.js" />
-       <script src="opensrf_config.js" />
-       <script src="opensrf_dom_element.js" />
-       <script src="opensrf_domain_object.js" />
-       <script src="opensrf_transport.js" />
-       <script src="opensrf_jabber_transport.js" />
-       <script src="opensrf_msg_stack.js" />
-       <script src="opensrf_app_session.js" />
-       -->
-</OpenSRF>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js b/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js
deleted file mode 100644 (file)
index 4083ded..0000000
+++ /dev/null
@@ -1,545 +0,0 @@
-// the master Global variable
-var G = { 
-/////////////////////////////////////////////////////////////////////////////////////
-
-       // pointer to the auth window
-       'main_window' : self,   
-
-       // list of open window references, used for debugging in shell
-       'win_list' : [],        
-
-       // list of Top Level menu interface window references
-       'appshell_list' : [],   
-
-       // list of documents for debugging.  BROKEN
-       'doc_list' : [],        
-
-       // Windows need unique names.  This number helps.
-       'window_name_increment' : 0, 
-
-       // This number gets put into the title bar for Top Level menu interface windows
-       'appshell_name_increment' : 0,
-
-       // I was using this to make sure I could shove references into new windows
-       // correctly.  However, it's JSON that tends to behave weirdly when crossing
-       // window boundaries.  [ 'a', 'b', 'c' ] could turn into { '1' : 'a', '2' : 'b',
-       'main_test_variable' : 'Hello World',
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-       // Flag for whether the staff client should act as if it were offline or not
-       'offline' : false,
-
-       // Array of Session Keys.  This is an array mostly by accident, we usually
-       // only deal with one session.  But this could be useful for implementing
-       // overrides with other logins.
-       'auth_ses' : [],
-
-       // Org Unit for the login user
-       'user_ou' : '',
-
-       // The related org units for the login user
-       'my_orgs' : [], 'my_orgs_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-       // The Org Unit tree
-       'org_tree' : '', 'org_tree_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-       // Historically, was the list of actor::profile's, but now it's user groups.
-       'ap_list' : [], 'ap_hash' : {},
-
-       // config::identification_type
-       'cit_list' : [], 'cit_hash' : {},
-
-       // config::standing
-       'cst_list' : [], 'cst_hash' : {},
-
-       // assett::copy_location, and for my_orgs
-       'acpl_list' : [], 'acpl_hash' : {},
-       'acpl_my_orgs' : [], 'acpl_my_orgs_hash' : {},
-
-       // actor::org_unit_type
-       'aout_list' : [], 'aout_hash' : {},
-
-       // config::copy_status
-       'ccs_list' : [], 'ccs_hash' : {},
-
-       // asset::stat_cat.   WHERE IS THIS POPULATED AGAIN?
-       'asc_list' : [],
-
-       // actor::stat_cat
-       'actsc_list' : [], 'actsc_hash' : {},
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-       'itemsout_header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!\r\nYou have the following items:<hr/><ol>',
-       'itemsout_line_item' : '<li>%TITLE: 50%\r\nBarcode: %COPY_BARCODE% Due: %DUE_D%\r\n',
-       'itemsout_footer' : '</ol><hr />%PINES_CODE% %TODAY%\r\nYou were helped by %STAFF_FIRSTNAME% %STAFF_LASTNAME%',
-
-       'checkout_header' : 'Welcome %PATRON_FIRSTNAME%, to %LIBRARY%!\r\nYou checked out the following items:<hr/><ol>',
-       'checkout_line_item' : '<li>%TITLE%\r\nBarcode: %COPY_BARCODE% Due: %DUE_D%\r\n',
-       'checkout_footer' : '</ol><hr />%PINES_CODE% %TODAY%\r\nYou were helped by %STAFF_FIRSTNAME% %STAFF_LASTNAME%'
-
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-};
-
-var debug_ignore_auth_failures = false;
-
-var mw = G['main_window'];
-var auth_meter_incr = 10;
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-function auth_init() {
-       sdump('D_AUTH','TESTING: auth.js: ' + mw.G['main_test_variable'] + '\n');
-       sdump('D_AUTH',arg_dump(arguments));
-
-       var np = document.getElementById('name_prompt');
-               np.addEventListener("keypress",handle_keypress,false);
-               np.focus();
-       var pp = document.getElementById('password_prompt');
-               pp.addEventListener("keypress",handle_keypress,false);
-       self.addEventListener("unload",nice_shutdown,false);
-
-       G['sound'] = xp_sound_init(); snd_logon();
-       var pref = Components.classes["@mozilla.org/preferences-service;1"]
-               .getService(Components.interfaces.nsIPrefBranch);
-       if (pref) {
-               pref.setCharPref("capability.principal.codebase.p0.granted", "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
-               pref.setCharPref("capability.principal.codebase.p0.id", "http://dev.gapines.org");
-       }
-}
-
-function handle_keypress(ev) {
-       if (ev.keyCode && ev.keyCode == 13) {
-               switch(this) {
-                       case document.getElementById('name_prompt') :
-                               ev.preventDefault();
-                               var pp = document.getElementById('password_prompt');
-                               pp.focus(); pp.select();
-                       break;
-                       case document.getElementById('password_prompt') :
-                               ev.preventDefault();
-                               var sb = document.getElementById('submit_button');
-                               sb.focus();
-                               authenticate();
-                       break;
-                       default:
-                       break;
-               }
-       }
-}
-
-function disable_login_prompts() {
-       sdump('D_AUTH',arg_dump(arguments));
-       disable_widgets(document,'password_prompt','name_prompt','submit_button');
-       G.sound.beep();
-}
-
-function enable_login_prompts() {
-       sdump('D_AUTH',arg_dump(arguments));
-       enable_widgets(document,'password_prompt','name_prompt','submit_button');
-       document.getElementById('password_prompt').value = '';
-       var np = document.getElementById('name_prompt');
-               np.focus(); np.select();
-       document.getElementById('auth_meter').value = 0;
-       document.getElementById('auth_meter').setAttribute('real', '0.0');
-       G.sound.beep();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
-
-function authenticate() {
-       sdump('D_AUTH',arg_dump(arguments));
-       timer_init('cat');
-       var name = document.getElementById('name_prompt').value;
-       if (name.length == 0) { enable_login_prompts(); return; }
-       // Talk to the system and authenticate the user.
-       user_async_request(
-               'open-ils.auth',
-               'open-ils.auth.authenticate.init',
-               [ name ],
-               auth_init_callback
-       );
-}
-
-function auth_init_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var auth_init;
-       try {
-               auth_init = request.getResultObject();
-               if (!auth_init) { throw('null result'); }
-       } catch(E) {
-               G.offline = true;
-               sdump('D_ERROR','Error trying to communicate with the server.  Entering OFFLINE mode.\n' + js2JSON(E) + '\n');
-               s_alert('Error trying to communicate with the server.  Entering OFFLINE mode.\n' + js2JSON(E) + '\n');
-       }
-
-       sdump( 'D_AUTH', 'D_AUTH_INIT: ' + typeof(auth_init) + ' : ' + auth_init + '\n');
-       var name = document.getElementById('name_prompt').value;
-       var pw = document.getElementById('password_prompt').value;
-       G.name = name; G.pw = pw;
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.auth',
-               'open-ils.auth.authenticate.complete',
-               [ name, hex_md5(auth_init + hex_md5(pw)) ],
-               auth_ses_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function auth_ses_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var auth_ses;
-       try {
-               auth_ses = request.getResultObject();
-               if (!auth_ses) { if (!G.offline) { throw('null result'); } }
-               if (auth_ses == 0) { throw('0 result'); }
-               if (instanceOf(auth_ses,ex)) {
-                       throw(auth_ses.err_msg());
-               }
-       } catch(E) {
-               alert('Login failed on auth_ses: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       mw.G.auth_ses = [ auth_ses ];
-       sdump( 'D_AUTH', 'D_AUTH_SES: ' + typeof(mw.G['auth_ses'][0]) + ' : ' + mw.G['auth_ses'][0] + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       //'open-ils.actor.user.profiles.retrieve',
-       user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.groups.retrieve',
-               [],
-               ap_list_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function ap_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       //var ap_file = get_file('ap_list');
-       var ap_list;
-       try {
-               ap_list = request.getResultObject();
-               if (!ap_list && G.offline) { 
-                       //ap_list = get_object_in_file('ap_list');
-               }
-               if (!ap_list) { throw('null result'); }
-               if (ap_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               handle_error('Login failed on ap_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('ap_list',ap_list); } catch(E) { handle_error(E); }
-       mw.G.ap_list = ap_list;
-       mw.G.ap_hash = convert_object_list_to_hash( ap_list );
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.user.ident_types.retrieve',
-               [],
-               cit_list_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function cit_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var cit_list;
-       try {
-               cit_list = request.getResultObject();
-               //if (!cit_list && G.offline) { cit_list = get_object_in_file('cit_list'); }
-               if (!cit_list) { throw('null result'); }
-               if (cit_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               alert('Login failed on cit_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('cit_list',cit_list); } catch(E) { handle_error(E); }
-       mw.G.cit_list = cit_list;
-       mw.G.cit_hash = convert_object_list_to_hash( cit_list );
-       
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.standings.retrieve',
-               [],
-               cst_list_callback
-       );
-
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function cst_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var cst_list;
-       try {
-               cst_list = request.getResultObject();
-               //if (!cst_list && G.offline) { cst_list = get_object_in_file('cst_list'); }
-               if (!cst_list) { throw('null result'); }
-               if (cst_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               alert('Login failed on cst_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('cst_list',cst_list); } catch(E) { handle_error(E); }
-       mw.G.cst_list = cst_list;
-       mw.G.cst_hash = convert_object_list_to_hash( cst_list );
-       sdump('D_AUTH', 'cst_list = ' + js2JSON(cst_list) + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.search',
-               'open-ils.search.config.copy_location.retrieve.all',
-               [],
-               acpl_list_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-
-}
-
-function acpl_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var acpl_list;
-       try {
-               acpl_list = request.getResultObject();
-               //if (!acpl_list && G.offline) { acpl_list = get_object_in_file('acpl_list'); }
-               if (!acpl_list) { throw('null result'); }
-               if (acpl_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               alert('Login failed on acpl_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('acpl_list',acpl_list); } catch(E) { handle_error(E); }
-       mw.G.acpl_list = acpl_list;
-       mw.G.acpl_hash = convert_object_list_to_hash( acpl_list );
-       sdump('D_AUTH', 'acpl_list = ' + js2JSON(acpl_list) + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.search',
-               'open-ils.search.config.copy_status.retrieve.all',
-               [],
-               ccs_list_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function ccs_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var ccs_list;
-       try {
-               ccs_list = request.getResultObject();
-               //if (!ccs_list && G.offline) { ccs_list = get_object_in_file('ccs_list'); }
-               if (!ccs_list) { throw('null result'); }
-               if (ccs_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               alert('Login failed on ccs_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('ccs_list',ccs_list); } catch(E) { handle_error(E); }
-       mw.G.ccs_list = ccs_list;
-       mw.G.ccs_hash = convert_object_list_to_hash( ccs_list );
-       sdump('D_AUTH', 'ccs_list = ' + js2JSON(ccs_list) + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.search',
-               'open-ils.search.actor.user.session',
-               [ mw.G['auth_ses'][0] ],
-               user_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function user_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var user;
-       var user_ou;
-       try {
-               user = request.getResultObject();
-               if (!user && G.offline) { 
-                       //user = new au(); 
-                       //user.home_ou( get_object_in_file('user_ou') );
-               }
-               if (!user) { throw('null result'); }
-               if (typeof(user) != 'object') { throw('result not an object' + user); }
-       } catch(E) {
-               alert('Login failed on user: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('user_ou',user.home_ou()); } catch(E) { handle_error(E); }
-       mw.G.user = user;
-       mw.G.user_ou = user.home_ou();
-       sdump('D_AUTH', "user: " + js2JSON(mw.G['user']) + '\n');
-       sdump('D_AUTH', "user_ou: " + js2JSON(mw.G['user_ou']) + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.org_tree.retrieve',
-               [],
-               org_tree_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function org_tree_callback(request) {
-       var org_tree;
-       try {
-               org_tree = request.getResultObject();
-               //if (!org_tree && G.offline) { org_tree = get_object_in_file('org_tree'); }
-               if (!org_tree) { throw('null result'); }
-               if (typeof(org_tree) != 'object') { throw('result not an object' + org_tree); }
-       } catch(E) {
-               alert('Login failed on org_tree: ' + js2JSON(E)); enable_login_prompts(); return;
-       }
-
-       //mw.G.org_tree = globalOrgTree;
-       //try { set_object_in_file('org_tree',org_tree); } catch(E) { handle_error(E); }
-       mw.G.org_tree = org_tree;
-       mw.G.org_tree_hash = convert_object_list_to_hash( flatten_ou_branch( mw.G.org_tree ) );
-       mw.G.user_ou = find_ou( mw.G.org_tree, mw.G.user_ou );
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       /*user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.org_types.retrieve',
-               [ mw.G.auth_ses[0] ],
-               org_type_callback
-       );*/
-       org_type_callback();
-}
-
-function org_type_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var aout_list = globalOrgTypes;
-       /*try {
-               aout_list = request.getResultObject();
-               if (!aout_list) { throw('null result'); }
-               if (typeof(aout_list) != 'object') { throw('result not an object' + aout_list); }
-               if (aout_list.length == 0) { throw('empty aout_list'); }
-       } catch(E) {
-               alert('Login failed on aout_list: ' + js2JSON(E)); enable_login_prompts(); return;
-       }*/
-       mw.G.aout_list = aout_list;
-       mw.G.aout_hash = convert_object_list_to_hash( aout_list );
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.actor',
-               'open-ils.actor.org_unit.full_path.retrieve',
-               [ mw.G.auth_ses[0] ],
-               my_orgs_callback
-       );
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function my_orgs_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var my_orgs;
-       try {
-               my_orgs = request.getResultObject();
-               //if (!my_orgs && G.offline) { my_orgs = get_object_in_file('my_orgs'); }
-               if (!my_orgs) { throw('null result'); }
-               if (typeof(my_orgs) != 'object') { throw('result not an object' + my_orgs); }
-               if (my_orgs.length == 0) { throw('empty my_orgs'); }
-       } catch(E) {
-               alert('Login failed on my_orgs: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-
-       //try { set_object_in_file('my_orgs',my_orgs); } catch(E) { handle_error(E); }
-       mw.G.my_orgs = my_orgs;
-       mw.G.my_orgs_hash = convert_object_list_to_hash( my_orgs );
-       sdump('D_AUTH','my_orgs = ' + js2JSON(my_orgs) + '\n');
-       mw.G.acpl_my_orgs = filter_list( 
-               mw.G.acpl_list, 
-               function (obj) {
-                       if ( typeof obj != 'object' ) return null;
-                       if ( mw.G.my_orgs_hash[ obj.owning_lib() ] ) return obj;
-               }
-       );
-       mw.G.acpl_my_orgs_hash = convert_object_list_to_hash( mw.G.acpl_my_orgs );
-       //sdump('D_AUTH', 'my_orgs.length = ' + mw.G.my_orgs.length + '   other_orgs.length = ' + mw.G.other_orgs.length + '\n');
-
-       /////////////////////////////////////////////////////////////////////////////////////////////////////
-       user_async_request(
-               'open-ils.circ',
-               'open-ils.circ.stat_cat.actor.retrieve.all',
-               [ mw.G.auth_ses[0], mw.G.user_ou.id() ],
-               my_actsc_list_callback
-       );
-
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-}
-
-function my_actsc_list_callback(request) {
-       sdump('D_AUTH',arg_dump(arguments));
-       var actsc_list;
-       try {
-               actsc_list = request.getResultObject();
-               //if (!actsc_list && G.offline) { actsc_list = get_object_in_file('actsc_list'); }
-               if (!actsc_list) { throw('null result'); }
-               //if (actsc_list.length == 0) { throw('zero length result'); }
-       } catch(E) {
-               alert('Login failed on actsc_list: ' + js2JSON(E)); 
-               if (!debug_ignore_auth_failures) {
-                       enable_login_prompts(); return;
-               }
-       }
-       //try { set_object_in_file('actsc_list',actsc_list); } catch(E) { handle_error(E); }
-       mw.G.actsc_list = actsc_list;
-       mw.G.actsc_hash = convert_object_list_to_hash( actsc_list );
-       sdump('D_AUTH', 'actsc_list = ' + js2JSON(actsc_list) + '\n');
-
-       incr_progressmeter(document,'auth_meter',auth_meter_incr);
-
-       spawn_main();
-
-       mw.minimize();
-
-}
-
-
-function logoff() {
-       sdump('D_AUTH',arg_dump(arguments));
-       mw.G['auth_ses'] = '';
-       close_all_windows();
-       enable_login_prompts();
-       incr_progressmeter(document,'auth_meter',-100);
-       snd_logoff();
-}
-
-function nice_shutdown() {
-       sdump('D_AUTH',arg_dump(arguments));
-       if (ses) { logoff(); ses.disconnect(); }
-       snd_exit;
-       close_all_windows();
-       window.close();
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/auth/auth.xul b/Evergreen/staff_client/chrome/content/evergreen/auth/auth.xul
deleted file mode 100644 (file)
index 736185a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Open-ILS Staff Client -->
-<!-- Screen: Auth/Login -->
-
-<!-- Modified by Jason for Evergreen -->
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/auth.dtd">
-
-<window id="auth_win" title="&auth.title;" 
-       orient="vertical" style="overflow: auto"  persist="width height"
-       onload="mw.OpenILS_init({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
-       onunload="mw.OpenILS_exit({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/auth.css" type="text/css"?>
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/Open-ILS/OpenILS_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/auth/auth_overlay.xul"?>
-
-       <!-- More Localization -->
-       <stringbundleset id="string_bundles"/>
-
-       <!-- The logic for this app -->
-       <OpenILS id="OpenILS_js" />
-
-       <!-- The logic for this screen -->
-       <!--<Auth id="auth_js" />-->
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="auth_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="auth_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="auth_main" />
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/auth/auth_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/auth/auth_overlay.xul
deleted file mode 100644 (file)
index b949fe6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/auth.dtd">
-<overlay id="auth_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- Modified by Jason for Evergreen -->
-
-<!-- The javascript logic for the staff client -->
-<!--
-<Auth id="auth_js">
-       <script src="auth.js" />
-</Auth>
--->
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="auth_cmds">
-       <command id="cmd_login" oncommand="
-               disable_login_prompts();
-               authenticate();
-       "/>
-       <command id="cmd_logoff" oncommand="logoff();"/>
-       <command id="cmd_close_window" oncommand="nice_shutdown();"/>
-</commandset>
-
-<!-- The top level widget for the staff client -->
-<box id="auth_main" flex="1" orient="vertical">
-       <deck id="main_deck">
-               <groupbox id="main_groupbox" flex="1"/>
-               <iframe id="print_frame" flex="1"/>
-               <iframe id="scratch_pad" flex="1"/>
-       </deck>
-       <button label="Console" accesskey="C" oncommand="try {mw.spawn_javascript_console(mw.document,'new_window','',{}); } catch(E) { alert(E); }"/>
-       <button label="FConsole" accesskey="F" oncommand="try {mw.spawn_filter_console(mw.document,'new_window','',{}); } catch(E) { alert(E); }"/>
-</box>
-
-<groupbox id="main_groupbox" flex="1">
-       <caption id="main_caption" label="&auth.login_header;"/>
-       <label value="&auth.version;"/>
-       <label value="Development Version"/>
-       <label value=" "/>
-       <grid>
-               <columns>
-                       <column />
-                       <column />
-               </columns>
-               <rows>
-                       <row>
-                               <label value="&auth.name_prompt;" control="name_prompt" accesskey="&auth.name_prompt.key;"/>
-                               <textbox id="name_prompt" value=""/>
-                       </row>
-                       <row>
-                               <label value="&auth.password_prompt;" control="password_prompt" accesskey="&auth.password_prompt.key;"/>
-                               <textbox id="password_prompt" value="" type="password"/>
-                       </row>
-                       <row>
-                               <label/>
-                               <hbox>
-                               <button id="submit_button" label="&auth.submit_prompt;" accesskey="&auth.submit_prompt.key;" command="cmd_login"/>
-                               <button label="&auth.logoff_prompt;" accesskey="&auth.logoff_prompt.key;" command="cmd_logoff"/>
-                               </hbox>
-                       </row>
-                       <row>
-                               <label/>
-                               <label/>
-                       </row>
-                       <row>
-                               <label/>
-                               <button label="&auth.quit_prompt;" accesskey="&auth.quit_prompt.key;" command="cmd_close_window"/>
-                       </row>
-               </rows>
-       </grid>
-       <progressmeter id="auth_meter" mode="normal" value="0"/>
-</groupbox>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="auth_keys">
-       <key id="auth-login-key" modifiers="accel" key="S" command="cmd_login"/>
-       <key id="auth-logoff-key" modifiers="accel" key="L" command="cmd_logoff"/>
-       <key id="auth-close-key" modifiers="accel" key="Q" command="cmd_close_window"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/brief.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/brief.xul
deleted file mode 100644 (file)
index c545e1f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="brief_win" title="Record Details" 
-       orient="vertical" style="overflow: scroll" width="800" height="500"
-       onload="my_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
-       <script>
-       <![CDATA[
-               var myPackageDir = "evergreen";
-
-               function my_init() {
-
-                       var mods = user_request(
-                               'open-ils.search',
-                               'open-ils.search.biblio.record.mods_slim.retrieve',
-                               [ find_this_id ]
-                       )[0];
-
-                       if (mods.title()) document.getElementById('title').setAttribute('value',mods.title());
-                       if (mods.author()) document.getElementById('author').setAttribute('value',mods.author());
-                       if (mods.edition()) document.getElementById('edition').setAttribute('value',mods.edition());
-                       if (mods.pubdate()) document.getElementById('pubdate').setAttribute('value',mods.pubdate());
-                       if (mods.tcn()) document.getElementById('tcn').setAttribute('value',mods.tcn());
-
-                       user_request(
-                               'open-ils.cat',
-                               'open-ils.cat.biblio.record.metadata.retrieve',
-                               [ find_this_id ],
-                               function (req) {
-                                       var meta = req.getResultObject()[0];
-                                       document.getElementById('creator').setAttribute('value',meta.creator());
-                                       document.getElementById('editor').setAttribute('value',meta.editor());
-                                       document.getElementById('edit_date').setAttribute('value',formatted_date(meta.edit_date(),"%D"));
-                               }
-                       );
-               }
-
-       ]]>
-       </script>
-
-       <groupbox flex="1">
-               <caption label="Record Details"/>
-               <hbox flex="1">
-                       <label style="font-weight: bold;" value="Title:" /><label id="title" /> 
-                       <label style="font-weight: bold;" value="Author:" /><label id="author" />
-                       <label style="font-weight: bold;" value="Edition:" /> <label id="edition" />
-                       <label style="font-weight: bold;" value="Pub Date:" /> <label id="pubdate" />
-               </hbox>
-               <hbox flex="1">
-                       <label style="font-weight: bold;" value="TCN:" /> <label id="tcn" />
-                       <label style="font-weight: bold;" value="Created By:" /> <label id="creator" />
-                       <label style="font-weight: bold;" value="Last Edited By:" /> <label id="editor" />
-                       <label style="font-weight: bold;" value="Last Edited On:" /> <label id="edit_date" />
-               </hbox>
-       </groupbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js b/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js
deleted file mode 100644 (file)
index 4a49d74..0000000
+++ /dev/null
@@ -1,709 +0,0 @@
-// find_this_id = document id
-
-var org_shortname2id = {};
-var my_treerow;
-var browse_meter_per = 0;
-var orgs_with_copies = [];
-var orgs_with_copies_hash = {};
-
-function my_init() {
-       timer_init('cat');
-       mw.sdump('D_CAT','TESTING: browse_list.js: ' + mw.G['main_test_variable'] + '\n');
-       var tc = document.getElementById('browse_list_tree_children');
-       build_tree_branch(tc,mw.G['org_tree'],true);
-       my_treerow = document.getElementById( 'org_unit_' + mw.G.user_ou.id() ).firstChild;
-       document.getElementById('browse_meter').value = 0;
-       document.getElementById('browse_meter').setAttribute('real', '0.0');
-       gather_copies();
-       //populate_tree();
-}
-
-function refresh_browse_list() {
-       mw.sdump('D_CAT','=-=-=-=-=-=-=-=-=\n\n\nrefresh_browse_list()\n');
-       setTimeout(
-               function() {
-                       // Prune tree
-                       var nl = document.getElementsByTagName('treeitem');
-                       for (var i = 0; i < nl.length; i++) {
-                               var v_treeitem = nl[i];
-                               if (v_treeitem.getAttribute('object_type') == 'volume') {
-                                       var org_treechildren = v_treeitem.parentNode;
-                                       var org_treeitem = org_treechildren.parentNode;
-                                       org_treeitem.removeChild(org_treechildren);
-                                       var org_treerow = org_treeitem.firstChild;
-                                       org_treerow.childNodes[1].setAttribute('label','0');
-                                       org_treerow.childNodes[2].setAttribute('label','0');
-                               }
-                       }
-                       document.getElementById('browse_meter').value = 0;
-                       document.getElementById('browse_meter').setAttribute('real', '0.0');
-                       gather_copies();
-               }, 0
-       );
-}
-
-function button_toggle_my_libraries(ev) {
-       // label = Hide My Libraries
-       // alt_label = Show My Libraries
-       var target = document.getElementById('browse_list_button1');
-       if (!target) { mw.sdump('D_CAT','eh?\n'); return; }
-       swap_attributes('browse_list_button1','label','alt_label');
-       var toggle = cycle_attribute( target,'toggle', [ '1', '2' ] );
-       for (var i in mw.G.my_orgs) {
-               var lib = mw.G.my_orgs[i];
-               var item = document.getElementById('org_unit_'+lib.id());
-               if (item) {
-                       if (toggle == '2') {
-                               hide_branch(item);
-                       } else {
-                               unhide_branch(item);
-                       }
-               }
-       }
-}
-
-function button_toggle_libraries(ev) {
-       // label = Show Other Libraries With Copies
-       // alt_label = Show Just My Libraries
-       var target = document.getElementById('browse_list_button2');
-       if (!target) { mw.sdump('D_CAT','eh?\n'); return; }
-       swap_attributes('browse_list_button2','label','alt_label');
-       var toggle = cycle_attribute( target,'toggle',['1','2'] );
-       if (toggle == '1') {
-               mw.sdump('D_CAT','Showing just my libraries...\n');
-               /*hide_branch( document.getElementById('org_unit_PINES') );
-               for (var i = 0; i < mw.G.my_orgs.length; i++) {
-                       unhide_branch(
-                               document.getElementById( 'org_unit_' + mw.G.my_orgs[i].id() )
-                       );
-               }*/
-               var nl = document.getElementsByTagName('treeitem');
-               for (var i = 0; i < nl.length; i++) {
-                       var item = nl[i];
-                       if (item.getAttribute('id').substr(0,9) != 'org_unit_') continue;
-                       if (mw.G.my_orgs_hash[ item.getAttribute('myid') ]) {
-                               //item.setAttribute('hidden','false');
-                               unhide_branch(item);
-                       } else {
-                               //item.setAttribute('hidden','true');
-                               hide_branch(item);
-                       }
-               }
-       } else {
-               mw.sdump('D_CAT','Showing other libraries with copies...\n');
-               var nl = document.getElementsByTagName('treeitem');
-               for (var i = 0; i < nl.length; i++) {
-                       var item = nl[i];
-                       if (item.getAttribute('copies') == 'true') {
-                               //item.setAttribute('hidden','false');
-                               //mw.sdump('D_CAT','\tunhiding ' + item.getAttribute('id') + '\n');
-                               unhide_branch(item);
-                       } else {
-                               //item.setAttribute('hidden','true');
-                               //mw.sdump('D_CAT','\thiding ' + item.getAttribute('id') + '\n');
-                               //hide_branch(item);
-                       }
-               }
-
-       }
-}
-
-function unhide_branch(item,do_open,do_copies) {
-       if (item.getAttribute('id') == 'org_unit_PINES') { return; }
-       //mw.sdump('D_CAT','Unhiding ' + item.getAttribute('id') + '\n');
-       item.setAttribute('hidden','false');
-       if (do_open) {
-               item.setAttribute('open','true');
-       }
-       if (do_copies) {
-               item.setAttribute('copies','true');
-       }
-       if (item.parentNode && item.parentNode.setAttribute) {
-               var id = item.parentNode.getAttribute('id');
-               if (id.substr(0,7) != 'browse_' && id != 'org_unit_PINES') {
-                       unhide_branch(item.parentNode,do_open,do_copies);
-               }
-       }
-}
-
-function hide_branch(item,do_open,do_copies) {
-       if (item.getAttribute('id') == 'org_unit_PINES') { return; }
-       //mw.sdump('D_CAT','Hiding ' + item.getAttribute('id') + '\n');
-       item.setAttribute('hidden','true');
-       if (do_open) {
-               item.setAttribute('open','false');
-       }
-       if (do_copies) {
-               item.setAttribute('copies','true');
-       }
-       if (item.parentNode && item.parentNode.setAttribute) {
-               var id = item.parentNode.getAttribute('id');
-               if (id.substr(0,7) != 'browse_' && id != 'org_unit_PINES') {
-                       hide_branch(item.parentNode,do_open,do_copies);
-               }
-       }
-}
-
-function gather_copies() {
-       // loop the libs
-       mw.sdump('D_CAT','Hello : ' + timer_elapsed('world') + '\n');
-/*     user_async_request(
-                       'open-ils.cat',
-                       'open-ils.cat.asset.copy_tree.global.retrieve',
-                       [ mw.G['auth_ses'][0], find_this_id  ],
-                       gather_copies_callback
-               );
-*/
-       var orgs_with_copies = [];
-       try {
-               orgs_with_copies = user_request(
-                       'open-ils.cat',
-                       'open-ils.cat.actor.org_unit.retrieve_by_title',
-                       [ find_this_id ]
-               )[0];
-       } catch(E) {
-               handle_error(E);
-       }
-       for (var i = 0; i < orgs_with_copies.length; i++) {
-               orgs_with_copies_hash[ orgs_with_copies[i] ] = true;
-       }
-       var bucket = new Array();
-       for (var i = 0; i < mw.G.my_orgs.length; i++ ) {
-               //if (find_id_object_in_list( mw.G.aout_list, mw.G.my_orgs[i].ou_type() ).can_have_vols() == '0')
-               if ( mw.G.aout_list[ mw.G.my_orgs[i].ou_type() ].can_have_vols() == '0')
-                       continue;
-               if ( ! orgs_with_copies_hash[ mw.G.my_orgs[i].id() ] ) continue;
-               bucket.push( mw.G.my_orgs[i].id() );
-       }
-       document.getElementById('browse_libs').setAttribute('value','Retrieving my copies...');
-       user_async_request(
-               'open-ils.cat',
-               'open-ils.cat.asset.copy_tree.retrieve',
-               [ mw.G['auth_ses'][0], find_this_id, bucket ],
-               function (request) {
-                       gather_copies_callback(request);
-                       document.getElementById('browse_libs').setAttribute('value','Retrieving copies from other libraries...');
-                       gather_other_copies();
-               }
-       );
-       mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
-}
-
-function gather_other_copies() {
-       var w_s = 10; var c_s = 0;
-       var bucket = new Array();
-
-       var nl = document.getElementsByTagName('treeitem');
-       for (var i = 0; i < nl.length; i++) {
-               var item = nl[i];
-               if (item.getAttribute('can_have_vols') == '0') continue;
-               //if ( find_id_object_in_list( mw.G.my_orgs, item.getAttribute('myid') ) ) { continue; }
-               if ( mw.G.my_orgs_hash[ item.getAttribute('myid') ] ) { continue; }
-               if ( ! orgs_with_copies_hash[ item.getAttribute('myid') ] ) continue;
-               bucket.push( item.getAttribute('myid') );
-               if (++c_s >= w_s) {
-                       user_async_request(
-                               'open-ils.cat',
-                               'open-ils.cat.asset.copy_tree.retrieve',
-                               [ mw.G['auth_ses'][0], find_this_id, bucket ],
-                               gather_copies_callback
-                       );
-                       mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
-                       bucket = new Array();
-                       c_s = 0;
-               }
-       }
-       if (bucket.length > 0) {
-               user_async_request(
-                       'open-ils.cat',
-                       'open-ils.cat.asset.copy_tree.retrieve',
-                       [ mw.G['auth_ses'][0], find_this_id, bucket ],
-                       gather_copies_callback
-               );
-               mw.sdump('D_CAT','((((((((((((((((( Count = ' + counter_incr('world') + '\n');
-       }
-       browse_meter_per = 100 / counter_peek('world');
-       mw.sdump('D_CAT',timer_elapsed('world') + ' : World : ' + timer_elapsed('gather') + '\n');
-}
-
-function find_my_treerow_index() {
-       var nl = document.getElementById('browse_list_tree').getElementsByTagName('treerow');
-       var count = 0;
-       //mw.sdump('D_CAT','find_my_treerow:  count = ' + count + '  nl.length = ' + nl.length + '\n');
-       for (var i = 0; i < nl.length; i++) {
-               var row = nl[i];
-               var item = row.parentNode;
-               if (item.getAttribute('id') == 'org_unit_' + mw.G.user_ou.id() ) {
-                       return count;
-               }
-               var open_attr = item.getAttribute('open');
-               var hidden_prop = item.hidden;
-               //mw.sdump('D_CAT','id = ' + item.getAttribute('id') + '   hidden_attr = ' + hidden_attr + '   hidden_prop = ' + hidden_prop + '\n');
-               if (hidden_prop.toString() == 'false' && open_attr.toString() == 'true') {
-                       count++;
-               }
-       }
-       return 0;
-}
-
-function gather_copies_callback(request) {
-       mw.sdump('D_CAT','gather_copies_callback : ' + timer_elapsed('gather') + ' : ' + ' count = ' + counter_incr('gather') + '\n');
-       var result = request.getResultObject();
-       var n_volumes = 0; var n_copies = 0; var flag = false;
-       //mw.sdump('D_CAT','copybrowser result = ' + js2JSON(result) + '\n=-=-=\n');
-       for (var y in result) {
-               if (result[y] && (typeof(result[y])=='object')) {
-                       var volume = result[y]; n_volumes++;
-                       //mw.sdump('D_CAT','\nvolume = ' + js2JSON(volume) + '\n');
-                       mw.sdump('D_CAT',' volume id = ' + volume.id() + '\n');
-                       var lib = find_ou( mw.G.org_tree, volume.owning_lib() );
-                       mw.sdump('D_CAT','lib = ' + js2JSON(lib) + '\n');
-                       if ( lib.id() == mw.G.user_ou.id() ) { flag = true; }
-                       var callnumber = volume.label();
-                       var copies = volume.copies();
-                       //mw.sdump('D_CAT','\tcopies = ' + js2JSON(copies) + '\n');
-                       var item = document.getElementById('org_unit_'+lib.id());
-                       if (!item) { mw.sdump('D_CAT','skipping\n'); continue; }
-
-                       var item_row = item.firstChild;
-                       var volumes_treecell;
-                       if (item_row.childNodes.length == 1) {
-                               volumes_treecell = document.createElement('treecell');
-                               volumes_treecell.setAttribute('label','0');
-                               item_row.appendChild(volumes_treecell);
-                       } else {
-                               volumes_treecell = item_row.childNodes[1];
-                       }
-                       volumes_treecell.setAttribute(
-                               'label',
-                               parseInt(volumes_treecell.getAttribute('label')) + 1
-                       );
-
-                       var copies_treecell;
-                       if (item_row.childNodes.length < 3) {
-                               copies_treecell = document.createElement('treecell');
-                               copies_treecell.setAttribute('label','0');
-                               item_row.appendChild(copies_treecell);
-                       } else {
-                               copies_treecell = item_row.childNodes[2];
-                       }
-                       copies_treecell.setAttribute(
-                               'label',
-                               parseInt(copies_treecell.getAttribute('label')) + copies.length
-                       );
-
-
-                       var cn_treechildren;
-                       var nl = item.getElementsByTagName('treechildren');
-                       //unhide_branch(item,false,true);
-                       item.setAttribute('copies',true);
-                       if (nl.length == 0) {
-                               cn_treechildren = document.createElement('treechildren');
-                               item.appendChild(cn_treechildren);
-                       } else {
-                               cn_treechildren = nl[0];
-                       }
-
-                       var cn_treeitem = document.createElement('treeitem');
-                               cn_treeitem.setAttribute('container','true');
-                               cn_treeitem.setAttribute('open','true');
-                               cn_treeitem.setAttribute('object_type','volume');
-                               cn_treeitem.setAttribute('volume_id',volume.id());
-                               cn_treeitem.setAttribute('callnumber',volume.label());
-                               cn_treeitem.setAttribute('ou_id',lib.id());
-
-                       cn_treechildren.appendChild(cn_treeitem);
-
-                       var cn_treerow = document.createElement('treerow');
-                       cn_treeitem.appendChild(cn_treerow);
-
-                       var cn_treecell = document.createElement('treecell');
-                               cn_treecell.setAttribute('label',callnumber);
-                       cn_treerow.appendChild(cn_treecell);
-
-                       var treechildren = document.createElement('treechildren');
-                       cn_treeitem.appendChild(treechildren);
-                       //mw.sdump('D_CAT', 'org_unit_'+lib+' item = '+item.tagName+'\n');
-                       for (var j = 0; j < copies.length; j++) {
-                               var copy = copies[j]; n_copies++;
-                               //mw.sdump('D_CAT','barcode: ' + copy.barcode() + '\n');
-
-                               var treeitem = document.createElement('treeitem');
-                                       treeitem.setAttribute('open','true');
-                                       treeitem.setAttribute('container','true');
-                                       treeitem.setAttribute('class','barcode_row');
-                                       treeitem.setAttribute('object_type','copy');
-                                       treeitem.setAttribute('ou_shortname',lib.shortname());
-                                       treeitem.setAttribute('ou_id',lib.id());
-                                       treeitem.setAttribute('callnumber',callnumber);
-                                       treeitem.setAttribute('barcode',copy.barcode());
-                                       treeitem.setAttribute('copy_id',copy.id());
-                                       treeitem.setAttribute('volume_id',volume.id());
-                                       //treeitem.setAttribute('copy',js2JSON(copy));
-                               treechildren.appendChild(treeitem);
-
-                               var treerow = document.createElement('treerow');
-                               treeitem.appendChild(treerow);
-
-                               var list = [ 
-                                       copy.barcode() ,
-                                       '',
-                                       '',
-                                       lib.shortname() ,
-                                       callnumber ,
-                                       copy.copy_number() ,
-                                       copy.location(), //mw.G.acpl_hash[ copy.location() ].name() ,
-                                       copy.circ_lib(), //mw.G.org_tree_hash[ copy.circ_lib() ].shortname(),
-                                       yesno( copy.circulate() ) ,
-                                       yesno( copy.ref() ) ,
-                                       yesno( copy.opac_visible() ) ,
-                                       copy.circ_as_type() ,
-                                       copy.circ_modifier() ,
-                                       copy.loan_duration() ,
-                                       copy.fine_level() ,
-                                       copy.create_date() ,
-                                       copy.creator() ,
-                                       copy.edit_date() ,
-                                       copy.editor() ,
-                                       yesno( copy.deposit() ),
-                                       copy.deposit_amount() ,
-                                       copy.price() ,
-                                       mw.G.ccs_hash[ copy.status() ].name()
-                               ];
-
-                               for (var i = 0; i < list.length; i++ ) {
-                                       var treecell = document.createElement('treecell');
-                                               treecell.setAttribute('label',list[i]);
-                                       treerow.appendChild(treecell);
-                               }
-                                               
-                       }
-               } else {
-                       mw.sdump('D_CAT','gather_copies problem: ' + result[y] + '\n');
-                       //throw(result[0]);
-               }
-       }
-       var tree = document.getElementById('browse_list_tree');
-       if (tree.currentIndex != -1) {
-               //mw.sdump('D_CAT','currentIndex != -1 = ' + tree.currentIndex + '\n');
-               //tree.treeBoxObject.scrollToRow( tree.currentIndex );
-               tree.treeBoxObject.ensureRowIsVisible( tree.currentIndex );
-       } else if (flag) {
-               //mw.sdump('D_CAT','currentIndex == -1\n');
-               var find = find_my_treerow_index();
-               mw.sdump('D_CAT','find = ' + find + ' n_volumes = ' + n_volumes + ' n_copies = ' + n_copies + '\n');
-               //alert('find = ' + find + ' n_volumes = ' + n_volumes + ' n_copies = ' + n_copies + '\n');
-               if (find > 0) { 
-                       find = find + n_volumes + n_copies;
-                       tree.view.selection.select( find ); 
-               }
-               //tree.treeBoxObject.ensureRowIsVisible( find );
-       }
-       var meter = document.getElementById('browse_meter');
-       var real = parseFloat( meter.getAttribute('real') ) + browse_meter_per;
-       meter.setAttribute('real',real);
-       meter.value = Math.ceil( real );
-       if ( counter_peek('gather') == counter_peek('world') ) {
-               document.getElementById('browse_libs').setAttribute('value','Finished');
-               document.getElementById('browse_libs').setAttribute('hidden','true');
-               meter.value = 100;
-               meter.setAttribute('hidden','true');
-       }
-       mw.sdump('D_CAT','gather callback   done : ' + timer_elapsed('gather') + '\n');
-}
-
-
-function build_tree_branch(treechildren,org,hide) {
-       var id = org.id();
-       var name = org.name();
-       var shortname = org.shortname(); org_shortname2id[shortname] = id;
-       var children = org.children();
-       var flag = mw.G.aout_hash[ org.ou_type() ].can_have_vols() == '1';
-       var item = make_treeitem('org_unit_' + id, name, flag);
-       item.setAttribute('hidden',hide);
-       item.setAttribute('ou_id',org.id());
-       //if ( find_id_object_in_list( mw.G.my_orgs, id ) ) { 
-       if ( mw.G.my_orgs_hash[ id ] ) {
-               item.setAttribute('open','true'); 
-               item.setAttribute('hidden','false');
-               item.setAttribute('myorg','true');
-       }
-       item.setAttribute( 
-               'can_have_vols', 
-               //find_id_object_in_list( mw.G.aout_list, org.ou_type() ).can_have_vols() 
-               mw.G.aout_hash[ org.ou_type() ].can_have_vols()
-       );
-       item.setAttribute( 'myid', org.id() );
-       if (children && (children.length > 0)) {
-               var n_treechildren = document.createElement('treechildren');
-               for (var i in children) {
-                       var child = children[i];
-                       build_tree_branch(n_treechildren, child, true);
-               }
-               item.appendChild(n_treechildren);
-       }
-       treechildren.appendChild(item);
-}
-
-function make_treeitem(id,name,flag) {
-       var treeitem = document.createElement('treeitem');
-               treeitem.setAttribute('id',id);
-               treeitem.setAttribute('container','true');
-       var treerow = make_treerow(name,flag);
-               treeitem.appendChild(treerow);
-               treeitem.setAttribute('object_type','org_unit');
-       return treeitem;
-}
-
-function make_treerow(name,flag) {
-       var treerow = document.createElement('treerow');
-       var treecell = document.createElement('treecell');
-               treecell.setAttribute('label',name);
-       treerow.appendChild(treecell);
-       treecell = document.createElement('treecell');
-               if (flag) treecell.setAttribute('label',0);
-       treerow.appendChild(treecell);
-       treecell = document.createElement('treecell');
-               if (flag) treecell.setAttribute('label',0);
-       treerow.appendChild(treecell);
-
-       return treerow;
-}
-
-function get_selected_rows_by_object_type(tree,object_type) {
-       var items = get_list_from_tree_selection(tree);
-       var command = "filter_list(items, function (obj) { return obj.getAttribute('object_type') == '" + object_type + "'; } );";
-       return eval(command);
-}
-
-function build_CopyBrowser_Context(ev) {
-       mw.sdump('D_CAT','build_CopyBrowser_Context: ev.target.tagName = ' + ev.target.tagName + '\n');
-       mw.sdump('D_CAT','this = ' + this.tagName + '\n');
-
-       var popup = document.getElementById('browse_menu');
-       empty_widget(popup);
-
-       var volume_flag = 0; var copy_flag = 0; var library_flag = 0;
-
-       var hitlist = document.getElementById('browse_list_tree');
-       var start = new Object(); var end = new Object();
-       var numRanges = hitlist.view.selection.getRangeCount();
-       for (var t=0; t<numRanges; t++){
-               hitlist.view.selection.getRangeAt(t,start,end);
-               for (var v=start.value; v<=end.value; v++){
-                       var i = hitlist.contentView.getItemAtIndex(v);
-                       //mw.sdump('D_CAT',i + ':' + i.firstChild.childNodes.length + '\n');
-                       switch( i.getAttribute('object_type') ) {
-                               case 'volume' : volume_flag++; break;
-                               case 'copy' : copy_flag++; break;
-                               case 'org_unit' : if (i.getAttribute('can_have_vols') == '1') library_flag++; break;
-                       }
-               }
-       }
-       mw.sdump('D_CAT','volume_flag = ' + volume_flag + ' copy_flag = ' + copy_flag + ' library_flag = ' + library_flag + '\n');
-       if (library_flag > 0) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       menuitem.setAttribute('label','Add Volumes');
-                       menuitem.setAttribute('command','cmd_volume_add');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-       }
-       if (volume_flag == 1) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       menuitem.setAttribute('label','Mark Volume as Copy Transfer Destination');
-                       menuitem.setAttribute('oncommand','mark_volume("browse_list_tree");');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-       }
-       if (volume_flag > 0) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       if (volume_flag > 1) {
-                               menuitem.setAttribute('label','Edit Volumes');
-                       } else {
-                               menuitem.setAttribute('label','Edit Volume');
-                       }
-                       menuitem.setAttribute('command','cmd_volume_edit');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-               menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       menuitem.setAttribute('label','Add Copies');
-                       menuitem.setAttribute('command','cmd_copy_add');
-               menuitem = document.createElement('menuitem');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-       }
-       if (copy_flag > 0) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       if (copy_flag > 1) {
-                               menuitem.setAttribute('label','Add Copies to Bucket');
-                       } else {
-                               menuitem.setAttribute('label','Add Copy to Bucket');
-                       }
-                       menuitem.setAttribute('oncommand','add_to_bucket("browse_list_tree");');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       if (copy_flag > 1) {
-                               menuitem.setAttribute('label','Edit Copies');
-                       } else {
-                               menuitem.setAttribute('label','Edit Copy');
-                       }
-                       menuitem.setAttribute('command','cmd_copy_edit');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-       }
-       if (volume_flag > 0) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       if (volume_flag > 1) {
-                               menuitem.setAttribute('label','Delete Volumes');
-                       } else {
-                               menuitem.setAttribute('label','Delete Volume');
-                       }
-                       menuitem.setAttribute('command','cmd_volume_delete');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-
-       }
-       if (copy_flag > 0) {
-               var menuitem = document.createElement('menuitem');
-               popup.appendChild(menuitem);
-                       if (copy_flag > 1) {
-                               menuitem.setAttribute('label','Delete Copies');
-                       } else {
-                               menuitem.setAttribute('label','Delete Copy');
-                       }
-                       menuitem.setAttribute('command','cmd_copy_delete');
-               popup.appendChild( document.createElement( 'menuseparator' ) );
-       }
-
-       var menuitem = document.createElement('menuitem');
-       popup.appendChild(menuitem);
-               menuitem.setAttribute('label','Refresh Listing');
-               menuitem.setAttribute('command','cmd_refresh');
-}
-
-function volume_add(tab,params) {
-       mw.sdump('D_CAT','trying to volume_add()\n');
-       params['shortcut'] = 'volume_add';
-       var w;
-       //var items = get_selected_rows(tree);
-       var items = get_list_from_tree_selection(params.tree);
-       items = filter_list(
-               items,
-               function (obj) {
-                       return obj.getAttribute('object_type') == 'org_unit';
-               }
-       );
-       var chrome = 'chrome://open_ils_staff_client/content/cat/volume_copy_add_wizard.xul';
-       if (tab) {
-               parentWindow.new_tab('main_tabbox');
-               w = parentWindow.replace_tab('main_tabbox','Add Volume',chrome);
-       } else {
-               w = mw.new_window( chrome );
-       }
-       mw.sdump('D_CAT','setting use_this_tree\n');
-       w.tree_items = items;
-       w.record_id = find_this_id;
-       w.params = params;
-}
-
-function copy_add(tab,params) {
-       mw.sdump('D_CAT','trying to copy_add()\n');
-       params['shortcut'] = 'copy_add';
-       var w;
-       //var items = get_selected_rows(tree);
-       var items = get_list_from_tree_selection(params.tree);
-       items = filter_list(
-               items,
-               function (obj) {
-                       return obj.getAttribute('object_type') == 'volume';
-               }
-       );
-       var chrome = 'chrome://open_ils_staff_client/content/cat/copy_add_wizard.xul';
-       if (tab) {
-               parentWindow.new_tab('main_tabbox');
-               w = parentWindow.replace_tab('main_tabbox','Add Copy',chrome);
-       } else {
-               w = mw.new_window( chrome );
-       }
-       mw.sdump('D_CAT','setting use_this_tree\n');
-       w.tree_items = items;
-       w.record_id = find_this_id;
-       w.params = params;
-}
-
-function volume_edit(tab,params) {
-       mw.sdump('D_CAT','trying to volume_edit()\n');
-       params['shortcut'] = 'volume_edit';
-       var w;
-       //var items = get_selected_rows(tree);
-       var items = get_list_from_tree_selection(params.tree);
-       items = filter_list(
-               items,
-               function (obj) {
-                       return obj.getAttribute('object_type') == 'volume';
-               }
-       );
-       var chrome = 'chrome://open_ils_staff_client/content/cat/volume_edit_wizard.xul';
-       if (tab) {
-               parentWindow.new_tab('main_tabbox');
-               w = parentWindow.replace_tab('main_tabbox','Edit Volumes',chrome);
-       } else {
-               w = mw.new_window( chrome );
-       }
-       mw.sdump('D_CAT','setting use_this_tree\n');
-       w.tree_items = items;
-       w.record_id = find_this_id;
-       w.params = params;
-
-}
-
-function volume_delete(tab,params) {
-       var volumes = get_selected_rows_by_object_type(params.tree,'volume'); 
-       var cn_list = [];
-       for (var i = 0; i < volumes.length; i++) {
-               var cn = new acn();
-               cn.id( volumes[i].getAttribute('volume_id') );
-               cn.isdeleted( '1' );
-               cn_list.push( cn );
-       }
-       try {
-               var result = user_request(
-                               'open-ils.cat',
-                               'open-ils.cat.asset.volume_tree.fleshed.batch.update',
-                               [ mw.G['auth_ses'][0], cn_list]
-               );
-               mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
-       } catch(E) {
-               handle_error(E);
-       }
-       refresh_browse_list();
-}
-
-function copy_delete(tab,params) {
-       var copies = get_selected_rows_by_object_type(params.tree,'copy'); 
-       var cn_list = [];
-       for (var i = 0; i < copies.length; i++) {
-               var cn = new acn();
-               cn.id( copies[i].getAttribute('volume_id') );
-
-               var cp = new acp();
-               cp.id( copies[i].getAttribute('copy_id') );
-               cp.isdeleted( '1' );
-
-               cn.copies( [ cp ] );
-               cn_list.push( cn );
-       }
-       try {
-               var result = user_request(
-                               'open-ils.cat',
-                               'open-ils.cat.asset.volume_tree.fleshed.batch.update',
-                               [ mw.G['auth_ses'][0], cn_list]
-               );
-               mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
-       } catch(E) {
-               handle_error(E);
-       }
-       refresh_browse_list();
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.xul
deleted file mode 100644 (file)
index 5358ae4..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="browse_list_win" title="&browse_list.win_title;" 
-       orient="vertical" style="overflow: scroll" width="800" height="500"
-       onload="my_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/browse_list_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="browse_list_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="browse_list_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="browse_list_keys" />
-
-       <!-- Context menus -->
-       <popupset id="browse_list_popupset" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="browse_list_vbox" class="test_class"/>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list_overlay.xul
deleted file mode 100644 (file)
index ae4473c..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="browse_list_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="browse_list_js">
-       <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
-       <util id="util_js"/>
-       <script src="browse_list.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="browse_list_cmds">
-       <command id="cmd_edit_browse" oncommand="spawn_editors();"/>
-       <command id="cmd_volume_add" oncommand="volume_add(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
-       <command id="cmd_volume_edit" oncommand="volume_edit(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
-       <command id="cmd_volume_delete" oncommand="volume_delete(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
-       <command id="cmd_copy_add" oncommand="copy_add(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
-       <!--<command id="cmd_copy_edit" oncommand="spawn_batch_copy_editor(window.app_shell, 'new_tab', 'main_tabbox', { 'tree' : document.getElementById('browse_list_tree') , 'refresh_func' : refresh_browse_list });"/>-->
-       <command id="cmd_copy_edit" oncommand="spawn_batch_copy_editor(window.parent_window.document, 'replace_iframe', 'copy_editor', { 'tree' : document.getElementById('browse_list_tree') , 'refresh_func' : refresh_browse_list }); window.parent_window.document.getElementById('copy_editor_tab').disabled = false;"/>
-       <command id="cmd_copy_delete" oncommand="copy_delete(false,{ 'tree' : 'browse_list_tree', 'refresh_func' : refresh_browse_list });"/>
-       <command id="cmd_toggle_my_libs" oncommand="button_toggle_my_libraries(event);"/>
-       <command id="cmd_toggle_libs" oncommand="button_toggle_libraries(event);"/>
-       <command id="cmd_refresh" oncommand="refresh_browse_list();"/>
-       <command id="cmd_alert" oncommand="alert('Not Yet Implemented');"/>
-</commandset>
-
-<!-- Context menus -->
-<popupset id="browse_list_popupset">
-       <popup id="browse_menu" onpopupshowing="build_CopyBrowser_Context(event);">
-       <!--
-               <menuitem id="browse_menu1" label="Add Volume" command="cmd_volume_add"/>
-               <menuitem id="browse_menu2" label="Edit Volume" command="cmd_alert" disabled="true"/>
-               <menuseparator id="browse_menu_sep1"/>
-               <menuitem id="browse_menu3" label="Add Copy" command="cmd_copy_add" disabled="true"/>
-               <menuitem id="browse_menu4" label="Edit Copy" command="cmd_copy_edit"/>
-               <menuseparator id="browse_menu_sep2"/>
-               <menuitem id="browse_menu5" label="Refresh Display" command="cmd_refresh"/>
-       -->
-       </popup>
-</popupset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="browse_list_vbox" flex="1">
-       <hbox id="browse_list_buttonbox"/>
-       <tree id="browse_list_tree"/>
-</vbox>
-
-<hbox id="browse_list_buttonbox">
-       <!--
-       <button id="browse_list_button1" label="Hide My Libraries" alt_label="Show My Libraries" toggle="1" command="cmd_toggle_my_libs"/>
-       -->
-       <button id="browse_list_button3" label="Refresh" command="cmd_refresh"/>
-       <button id="browse_list_button2" label="Show Other Libraries With Copies" alt_label="Show Just My Libraries" toggle="1" command="cmd_toggle_libs"/>
-       <label id="browse_libs"/>
-       <progressmeter id="browse_meter" mode="normal" value="0" flex="1"/>
-</hbox>
-
-<tree id="browse_list_tree" enableColumnDrag="true" flex="1">
-       <treecols id="browse_list_treecols">
-               <treecol id="browse1" label="&browse_list.location;" flex="2" primary="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse1b" label="Volumes" flex="0"/> <splitter class="tree-splitter"/>
-               <treecol id="browse1a" label="Copies" flex="0"/> <splitter class="tree-splitter"/>
-               <treecol id="browse2" label="&browse_list.library;" flex="1"/> <splitter class="tree-splitter"/>
-               <treecol id="browse3" label="&browse_list.callnumber;" flex="1"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4" label="&browse_list.copy_number;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4aa" label="&browse_list.location2;" flex="1"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4a" label="&browse_list.circ_lib;" flex="1"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4b" label="&browse_list.circulate;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4bb" label="&browse_list.ref;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4bbb" label="&browse_list.opac_visible;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4c" label="&browse_list.circ_as_type;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4d" label="&browse_list.circ_modifier;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4e" label="&browse_list.loan_duration;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse4f" label="&browse_list.fine_level;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse5" label="&browse_list.create_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse6" label="&browse_list.creator;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse7" label="&browse_list.edit_date;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse8" label="&browse_list.editor;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse9" label="&browse_list.deposit;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse10" label="&browse_list.deposit_amount;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse11" label="&browse_list.price;" flex="1" hidden="true"/> <splitter class="tree-splitter"/>
-               <treecol id="browse12" label="&browse_list.status;" flex="1" hidden="false"/> <splitter class="tree-splitter"/>
-       </treecols>
-       <treechildren id="browse_list_tree_children" context="browse_menu"/>
-</tree>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="browse_list_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/cat.js b/Evergreen/staff_client/chrome/content/evergreen/cat/cat.js
deleted file mode 100644 (file)
index 5874990..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-function my_init() {
-       document.getElementById('search-entry-box').focus();
-       mw.sdump('D_CAT','TESTING: cat.js: ' + mw.G['main_test_variable'] + '\n');
-       populate_lib_list(
-               'search-copy-count-menu',
-               'search-copy-count-popup',
-               mw.G.user_ou
-       );
-}
-
-function search(s_type, s_loc, s_fmt, s_ord, s_term) {
-       var w_type = document.getElementById(s_type);
-       var w_loc = document.getElementById(s_loc);
-       var w_fmt = document.getElementById(s_fmt);
-       var w_term = document.getElementById(s_term);
-       var w_order = document.getElementById(s_ord);
-       var frame_box = document.getElementById('cat_result_box');
-       while (frame_box.lastChild) { frame_box.removeChild(frame_box.lastChild); }
-       switch(w_type.value) {
-               case 'barcode':
-                       alert('Not Yet Implemented');
-                       break;
-               case 'id':
-                       alert('Not Yet Implemented');
-                       break;
-               case 'title': case 'author': case 'tcn': case 'subject':
-                       var frame = document.createElement('iframe');
-                       frame_box.appendChild(frame);
-                       frame.setAttribute('flex','1');
-                       frame.setAttribute('src','chrome://evergreen/content/cat/record_list.xul');
-                       frame.contentWindow.parentWindow = parentWindow;
-                       frame.contentWindow.search_term = w_term.value;
-                       frame.contentWindow.search_type = w_type.value;
-                       frame.contentWindow.search_location = w_loc.value;
-                       frame.contentWindow.search_order = w_order.value;
-                       frame.contentWindow.catWindow = this;
-                       frame.contentWindow.tabWindow = tabWindow;
-                       frame.contentWindow.mw = mw;
-                       frame.contentWindow.am_i_a_top_level_tab = false;
-                       mw.sdump('D_CAT','here ====>\n');
-                       frame.contentWindow.addEventListener('load',function (e) { mw.sdump('D_CAT','here1<==\n'); this.test_hash['hello1'] = 'boo'; }, false);
-                       frame.contentWindow.addEventListener('load',function (e) { mw.sdump('D_CAT','here2<==\n'); this.test_hash['hello2'] = 'boo'; }, false);
-                       break;
-               case 'isbn':
-                       alert('Not Yet Implemented');
-                       break;
-               case 'callnumber':
-                       alert('Not Yet Implemented');
-                       break;
-               case 'all':
-                       alert('Not Yet Implemented');
-                       break;
-               default:
-                       alert('This case is not handled: ' + w_type.value);
-                       break;
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/cat.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/cat.xul
deleted file mode 100644 (file)
index dddaba1..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="cat_win" title="&cat.title;" 
-       orient="vertical" style="overflow: scroll"
-       onload="my_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/cat_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="cat_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="cat_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="cat_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="cat_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/cat_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/cat_overlay.xul
deleted file mode 100644 (file)
index 1640a46..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="cat_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="cat_js">
-       <script>var ses;</script>
-       <util id="util_js"/>
-       <script src="cat.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="cat_cmds">
-       <command id="cmd_search" oncommand="
-               search(
-                       'search-type-menu',
-                       'search-copy-count-menu',
-                       'search-format-menu',
-                       'search-order-menu',
-                       'search-entry-box'
-               );
-       "/>
-       <command id="cmd_test" oncommand="
-               /*spawn_copy_browser( document.getElementById('search-entry-box').value );*/
-               spawn_marc_editor( document.getElementById('search-entry-box').value );
-       "/>
-       <command id="cmd_alert" oncommand="
-               alert('Not Yet Implemented');
-       
-       "/>
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="cat_vbox" flex="1" style="min-width: 100px; overflow: scroll;">
-       <vbox id="cat_search_box"/>
-       <vbox id="cat_result_box" flex="1"/>
-</vbox>
-
-<!-- The search box -->
-<vbox id="cat_search_box">
-       <groupbox id="search_groupbox"/>
-</vbox>
-
-<groupbox id="search_groupbox">
-       <caption label="&cat.search_criteria;"/>
-       <grid id="search_grid"/>
-</groupbox>
-
-<grid id="search_grid">
-       <columns> 
-               <column/> <column/> 
-               <column/> <column/> 
-               <column/>
-               <column flex="1"/> 
-       </columns>
-       <rows>
-               <row id="search_row1"/>
-               <row id="search_row2"/>
-               <row id="search_row3"/>
-       </rows>
-</grid>
-
-<row id="search_row1">
-       <label 
-               value="&cat.search_type;" 
-               control="search-type-menu" 
-               accesskey="&cat.search_type.key;"
-       />
-       <menulist id="search-type-menu"/>
-
-       <label
-               value="&cat.search_term;" 
-               control="search-entry-box" 
-               accesskey="&cat.search_term.key;"
-       />
-       <textbox id="search-entry-box" flex="1"/>
-
-
-       <!--<label 
-               value="&cat.search_location;" 
-               control="search-location-menu" 
-               accesskey="&cat.search_location.key;"
-       />
-       <menulist id="search-location-menu"/>-->
-</row>
-<row id="search_row2">
-       <label 
-               value="&cat.search_format;" 
-               control="search-format-menu" 
-               accesskey="&cat.search_format.key;"
-       />
-       <menulist id="search-format-menu"/>
-       <label 
-               value="&cat.search_count_copy;" 
-               control="search-copy-count-menu" 
-               accesskey="&cat.search_count_copy.key;"
-       />
-       <menulist id="search-copy-count-menu"/>
-
-</row>
-<row id="search_row3">
-       <label 
-               value="&cat.search_order;" 
-               control="search-order-menu" 
-               accesskey="&cat.search_order.key;"
-       />
-       <menulist id="search-order-menu"/>
-       <spacer/>
-       <hbox>
-               <button label="&cat.search_submit;" accesskey="&cat.search_submit.key;" command="cmd_search"/>
-               <button label="&cat.search_advanced;" accesskey="&cat.search_advanced.key;" command="cmd_alert"/>
-       </hbox>
-
-
-</row>
-
-<!-- The search location -->
-<!-- This should be populated by a script -->
-<menulist id="search-location-menu">
-       <menupopup id="search-location-popup">
-               <menuitem label="This Library (Athens-Clarke County Library)" value="PINES.ARL.ATH" />
-               <menuitem label="This Library System (Athens Regional Library)" value="PINES.ARL" />
-               <menuitem label="All PINES Libraries" value="PINES" />
-       </menupopup>
-</menulist>
-
-<menulist id="search-copy-count-menu">
-       <menupopup id="search-copy-count-popup"/>
-</menulist>
-
-
-
-<!-- The search format -->
-<menulist id="search-format-menu">
-       <menupopup id="search-format-popup" command="cmd_alert">
-               <menuitem label="&cat.type_of_material;" value="all" />
-               <menuitem label="&cat.fixed.BKS;" value="BKS" />
-               <menuitem label="&cat.fixed.SER;" value="SER" />
-               <menuitem label="&cat.fixed.VIS;" value="VIS" />
-               <menuitem label="&cat.fixed.MIX;" value="MIX" />
-               <menuitem label="&cat.fixed.MAP;" value="MAP" />
-               <menuitem label="&cat.fixed.SCO;" value="SCO" />
-               <menuitem label="&cat.fixed.REC;" value="REC" />
-               <menuitem label="&cat.fixed.COM;" value="COM" />
-       </menupopup>
-</menulist>
-
-<!-- The search order -->
-<menulist id="search-order-menu">
-       <menupopup id="search-order-popup" command="cmd_alert">
-               <menuitem label="&cat.search_title;" value="title" />
-               <menuitem label="&cat.search_author;" value="author" />
-               <menuitem label="&cat.search_pubyear;" value="pubyear" />
-       </menupopup>
-</menulist>
-
-
-<!-- The search type -->
-<menulist id="search-type-menu">
-       <menupopup id="search-type-popup">
-               <menuitem label="&cat.search_barcode;" value="barcode" />
-               <menuitem label="&cat.search_tcn;" value="tcn" />
-               <menuitem label="&cat.search_isbn;" value="isbn" />
-               <menuitem label="&cat.search_title;" value="title" selected="true"/>
-               <menuitem label="&cat.search_author;" value="author" />
-               <menuitem label="&cat.search_subject;" value="subject" />
-               <menuitem label="&cat.search_callnumber;" value="callnumber" />
-               <menuitem label="&cat.search_id;" value="id" />
-               <menuitem label="&cat.search_all;" value="all" />
-       </menupopup>
-</menulist>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="cat_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy.js b/Evergreen/staff_client/chrome/content/evergreen/cat/copy.js
deleted file mode 100644 (file)
index 33ddfcf..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-var local_stat_cats;
-var local_stat_cat_entries = {};
-
-function my_init() {
-       mw.sdump('D_CAT','entering my_init for copy.js\n');
-       mw.sdump('D_CAT','TESTING: copy.js: ' + mw.G['main_test_variable'] + '\n');
-       mw.sdump('D_CAT','real_parentWindow: ' + real_parentWindow + '\n');
-       populate_copy_status_list('copy-status-menu','copy-status-popup','0');
-       populate_copy_location_list('shelving-location-menu','shelving-location-popup');
-       populate_lib_list_with_branch('circulating-library-menu','circulating-library-popup', mw.G.user_ou, mw.G.org_tree, true );
-       mw.sdump('D_CAT','super_dump cn_list = ' + super_dump_norecurse(cn_list) + '\n');
-       mw.sdump('D_CAT','my_init: cn_list = ' + js2JSON(cn_list) + '\n');
-       /*cn_list = fixJSON(cn_list);
-       mw.sdump('D_CAT','super_dump cn_list = ' + super_dump_norecurse(cn_list) + '\n');
-       mw.sdump('D_CAT','my_init: cn_list = ' + js2JSON(cn_list) + '\n');*/
-       var pertinent_libs = [];
-       for (var i = 0; i < cn_list.length; i++) {
-               var cn = cn_list[i];
-               for (var j = 0; j < cn.copies().length; j++) {
-                       var cp = cn.copies()[j];
-                       add_to_listbox(
-                               i,j,
-                               mw.G.org_tree_hash[ cn.owning_lib() ].shortname(),
-                               cn.label(),
-                               cp.barcode()
-                       );
-               }
-               pertinent_libs.push( cn.owning_lib() );
-       }
-       local_stat_cats = mw.G.asc_list;
-       populate_listbox_with_local_stat_cats_myself(
-               local_stat_cats,
-               local_stat_cat_entries,
-               'local_attr_listbox',
-               pertinent_libs,
-               'open-ils.circ',
-               'open-ils.circ.stat_cat.asset.multirange.intersect.retrieve',
-               false
-       );
-       /*
-       if (params.select_all) {
-               document.getElementById('ephemeral_listbox').selectAll();
-       }
-       */
-       transfer_attributes();
-       apply_attributes();
-}
-
-function transfer_attributes(event) {
-       /*
-       var items = event.target.selectedItems;
-       mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
-       if (items.length == 0) { return; }
-       */
-
-       // Dump items
-
-       /*
-       var dump_copies = map_list(
-               items,
-               function (obj) {
-                       var cnp = obj.getAttribute('cn_pos');
-                       var cpp = obj.getAttribute('cp_pos');
-                       return cn_list[cnp].copies()[cpp];
-               }
-       );
-       */
-
-       var dump_copies = map_flat_list(
-               cn_list,
-               function (cn) {
-                       return cn.copies();
-               }
-       );
-
-       for (var i in dump_copies) {
-               mw.sdump('D_CAT','\n\n\n,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_\n\n\n');
-               mw.sdump('D_CAT', js2JSON(dump_copies[i]) );
-               mw.sdump('D_CAT','\n\n\n,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_\n\n\n');
-       }
-
-       // Transfer values from first item to XUL
-
-       /*
-       var cp_pos = items[0].getAttribute('cp_pos');
-       var cn_pos = items[0].getAttribute('cn_pos');
-       var cp_list = cn_list[cn_pos].copies();
-       var copy = cp_list[cp_pos];
-       */
-       var copy = cn_list[0].copies()[0];
-       if (copy.circ_lib()) set_widget_value_for_display(
-               document.getElementById('circulating-library-menu'),
-               copy.circ_lib().id()
-       );
-       if (copy.location()) set_widget_value_for_display(
-               document.getElementById('shelving-location-menu'),
-               copy.location().id()
-       );
-       if (copy.status()) set_widget_value_for_display(
-               document.getElementById('copy-status-menu'),
-               copy.status().id()
-       );
-       if (copy.loan_duration()) set_widget_value_for_display(
-               document.getElementById('loan-duration-menu'),
-               copy.loan_duration()
-       );
-       if (copy.fine_level()) set_widget_value_for_display(
-               document.getElementById('fine-level-menu'),
-               copy.fine_level()
-       );
-       if (copy.circulate()) set_widget_value_for_display(
-               document.getElementById('circulate_menu'),
-               copy.circulate()
-       );
-       if (copy.deposit()) set_widget_value_for_display(
-               document.getElementById('deposit_menu'),
-               copy.deposit()
-       );
-       if (copy.deposit_amount()) set_widget_value_for_display(
-               document.getElementById('deposit_amount'),
-               copy.deposit_amount()
-       );
-       if (copy.price()) set_widget_value_for_display(
-               document.getElementById('price'),
-               copy.price()
-       );
-       if (copy.ref()) set_widget_value_for_display(
-               document.getElementById('reference_menu'),
-               copy.ref()
-       );
-       if (copy.opac_visible()) set_widget_value_for_display(
-               document.getElementById('opac_visible_menu'),
-               copy.opac_visible()
-       );
-
-       for (var i in copy.stat_cat_entries()) {
-               var entry = copy.stat_cat_entries()[i];
-               var menuitem = document.getElementById('menuitem_stat_cat_entry_' + entry.id());
-               if (menuitem) {
-                       menuitem.parentNode.parentNode.selectedItem = menuitem;
-               }
-       }
-       mw.sdump('D_CAT','select fired\n');
-}
-
-
-function save_attributes() {
-       real_parentWindow.cn_list = cn_list;
-       real_parentWindow.document.getElementById('volume_add').canAdvance = true;
-       //window.close();
-}
-
-function apply_attributes() {
-       var circ_lib = document.getElementById('circulating-library-menu').value;
-       var shelving_loc = document.getElementById('shelving-location-menu').value;
-       var copy_status = document.getElementById('copy-status-menu').value;
-       var loan_duration = document.getElementById('loan-duration-menu').value;
-       var fine_level = document.getElementById('fine-level-menu').value;
-       var circulate = document.getElementById('circulate_menu').value;
-       var deposit = document.getElementById('deposit_menu').value;
-       var deposit_amount = document.getElementById('deposit_amount').value;
-       var price = document.getElementById('price').value;
-       var ref = document.getElementById('reference_menu').value;
-       var opac = document.getElementById('opac_visible_menu').value;
-       /*
-       var listbox = document.getElementById('ephemeral_listbox');
-       var items = listbox.selectedItems;
-       mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
-       */
-       for (var i = 0; i < cn_list.length; i++) {
-               for (var j = 0; j < cn_list[i].copies().length; j++) {
-                       /*
-                       var listitem = items[i];
-                       var cn_pos = listitem.getAttribute('cn_pos');
-                       var cp_pos = listitem.getAttribute('cp_pos');
-                       var copy_node = cn_list[cn_pos].copies()[cp_pos];
-                       */
-                       var copy_node = cn_list[i].copies()[j];
-                       copy_node.circ_lib(     mw.G.org_tree_hash[ circ_lib ]);
-                       copy_node.location(     mw.G.acpl_hash[ shelving_loc ]);
-                       copy_node.status(       mw.G.ccs_hash[ copy_status ]);
-                       copy_node.loan_duration(loan_duration);
-                       copy_node.fine_level(fine_level);
-                       copy_node.circulate(circulate);
-                       copy_node.deposit(deposit);
-                       copy_node.deposit_amount(deposit_amount);
-                       copy_node.price(price);
-                       copy_node.ref(ref);
-                       copy_node.opac_visible(opac);
-                       copy_node.ischanged(1);
-               }
-       }
-
-       mw.sdump('D_CAT','changed cn_list: ' + js2JSON(cn_list) + '\n');
-}
-
-function apply_attribute(ev) {
-       mw.sdump('D_CAT','Entering apply_attribute with element id = ');
-       var popup_id;
-       if (ev.target.tagName == 'menuitem') {
-               popup_id = ev.target.parentNode.getAttribute('id');
-       } else {
-               popup_id = ev.target.getAttribute('id');
-       }
-       mw.sdump('D_CAT',popup_id + '\n');
-       mw.sdump('D_CAT','ev.target = ' + ev.target + '  .tagName = ' + ev.target.tagName + '\n');
-
-       var circ_lib = document.getElementById('circulating-library-menu').value;
-       var shelving_loc = document.getElementById('shelving-location-menu').value;
-       var copy_status = document.getElementById('copy-status-menu').value;
-       var loan_duration = document.getElementById('loan-duration-menu').value;
-       var fine_level = document.getElementById('fine-level-menu').value;
-       var circulate = document.getElementById('circulate_menu').value;
-       var deposit = document.getElementById('deposit_menu').value;
-       var deposit_amount = document.getElementById('deposit_amount').value;
-       var price = document.getElementById('price').value;
-       var ref = document.getElementById('reference_menu').value;
-       var opac = document.getElementById('opac_visible_menu').value;
-       /*
-       var listbox = document.getElementById('ephemeral_listbox');
-       var items = listbox.selectedItems;
-
-       mw.sdump('D_CAT','selectedItems.length = ' + items.length + '\n');
-       */
-       mw.sdump('D_CAT','before  cn_list: ' + js2JSON(cn_list) + '\n');
-       for (var i = 0; i < cn_list.length; i++) {
-       for (var j = 0; j < cn_list[i].copies().length; j++) {
-               /*
-               var listitem = items[i];
-               var cn_pos = listitem.getAttribute('cn_pos');
-               var cp_pos = listitem.getAttribute('cp_pos');
-               var copy_node = cn_list[cn_pos].copies()[cp_pos];
-               */
-               var copy_node = cn_list[i].copies()[j];
-
-               mw.sdump('D_CAT','\n\n\n\n+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+\n\n\n\n');
-               mw.sdump('D_CAT','Setting copy ' + copy_node.id() + '...\n');
-               switch(popup_id) {
-                       case 'circulating-library-popup':
-                               mw.sdump('D_CAT','\tbefore circ_lib = ' + js2JSON(copy_node.circ_lib()) + '\n');
-                               copy_node.circ_lib(     mw.G.org_tree_hash[ circ_lib ] );
-                               mw.sdump('D_CAT','\tafter  circ_lib = ' + js2JSON(copy_node.circ_lib()) + '\n');
-                               break;
-                       case 'shelving-location-popup':
-                               mw.sdump('D_CAT','\tbefore location = ' + js2JSON(copy_node.location()) + '\n');
-                               copy_node.location(     mw.G.acpl_hash[ shelving_loc ] );
-                               mw.sdump('D_CAT','\tafter  location = ' + js2JSON(copy_node.location()) + '\n');
-                               break;
-                       case 'copy-status-popup':
-                               mw.sdump('D_CAT','\tbefore status = ' + js2JSON(copy_node.status()) + '\n');
-                               copy_node.status(       mw.G.ccs_hash[ copy_status ]);
-                               mw.sdump('D_CAT','\tafter  status = ' + js2JSON(copy_node.status()) + '\n');
-                               break;
-                       case 'loan-duration-popup':
-                               mw.sdump('D_CAT','\tbefore loan_duration = ' + js2JSON(copy_node.loan_duration()) + '\n');
-                               copy_node.loan_duration(loan_duration);
-                               mw.sdump('D_CAT','\tafter  loan_duration = ' + js2JSON(copy_node.loan_duration()) + '\n');
-                               break;
-                       case 'fine-level-popup':
-                               mw.sdump('D_CAT','\tbefore fine_level = ' + js2JSON(copy_node.fine_level()) + '\n');
-                               copy_node.fine_level(fine_level);
-                               mw.sdump('D_CAT','\tafter  fine_level = ' + js2JSON(copy_node.fine_level()) + '\n');
-                               break;
-                       case 'circulate_popup':
-                               mw.sdump('D_CAT','\tbefore circulate = ' + js2JSON(copy_node.circulate()) + '\n');
-                               copy_node.circulate(circulate);
-                               mw.sdump('D_CAT','\tafter  circulate = ' + js2JSON(copy_node.circulate()) + '\n');
-                               break;
-                       case 'deposit_popup':
-                               mw.sdump('D_CAT','\tbefore deposit = ' + js2JSON(copy_node.deposit()) + '\n');
-                               copy_node.deposit(deposit);
-                               mw.sdump('D_CAT','\tafter  deposit = ' + js2JSON(copy_node.deposit()) + '\n');
-                               break;
-                       case 'deposit_amount':
-                               mw.sdump('D_CAT','\tbefore deposit_amount = ' + js2JSON(copy_node.deposit_amount()) + '\n');
-                               copy_node.deposit_amount(deposit_amount);
-                               mw.sdump('D_CAT','\tafter  deposit_amount = ' + js2JSON(copy_node.deposit_amount()) + '\n');
-                               break;
-                       case 'price':
-                               mw.sdump('D_CAT','\tbefore price = ' + js2JSON(copy_node.price()) + '\n');
-                               copy_node.price(price);
-                               mw.sdump('D_CAT','\tafter  price = ' + js2JSON(copy_node.price()) + '\n');
-                               break;
-                       case 'reference_popup':
-                               mw.sdump('D_CAT','\tbefore ref = ' + js2JSON(copy_node.ref()) + '\n');
-                               copy_node.ref(ref);
-                               mw.sdump('D_CAT','\tafter  ref = ' + js2JSON(copy_node.ref()) + '\n');
-                               break;
-                       case 'opac_visible_popup':
-                               mw.sdump('D_CAT','\tbefore opac_visible = ' + js2JSON(copy_node.opac_visible()) + '\n');
-                               copy_node.opac_visible(opac);
-                               mw.sdump('D_CAT','\tafter  opac_visible = ' + js2JSON(copy_node.opac_visible()) + '\n');
-                               break;
-                       default:
-                               mw.sdump('D_CAT','\t++++++++ Unhandled.. this should be a stat_cat: ' + popup_id + ' / ' + ev.target.tagName + '\n');
-                               update_stat_cat_entry(copy_node,ev.target);
-                               break;
-               }
-               mw.sdump('D_CAT','\n\n\n\n+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+\n\n\n\n');
-               copy_node.ischanged(1);
-       }
-       }
-
-       mw.sdump('D_CAT','changed cn_list: ' + js2JSON(cn_list) + '\n');
-}
-
-function update_stat_cat_entry(copy,menuitem) {
-       mw.sdump('D_CAT','\tupdate_stat_cat_entry: value = ' + menuitem.value + '\n');
-       var entries = copy.stat_cat_entries();
-       //mw.sdump('D_CAT','\n\n\ncopy = ' + js2JSON(copy) + '\n');
-       //mw.sdump('D_CAT','\n\n\ncopy.stat_cat_entries() = ' + js2JSON(copy.stat_cat_entries()) + '\n');
-       var stat_cat_id = menuitem.getAttribute('stat_cat');
-       var entry = find_attr_object_in_list(entries,'stat_cat',stat_cat_id);
-       if (entry) {
-               mw.sdump('D_CAT','\tReplacing old stat_cat_entry with ');
-
-               entries = filter_list(
-                       entries,
-                       function (obj) {
-                               return (obj.id() != entry.id());
-                       }
-               );
-
-       } else {
-               mw.sdump('D_CAT','\tAppending new stat_cat_entry = ');
-       }
-       mw.sdump('D_CAT',js2JSON(local_stat_cat_entries[menuitem.value]) + '\n');
-       entries.push( local_stat_cat_entries[ menuitem.value ] );
-       copy.stat_cat_entries( entries );
-}
-
-var add_to_listbox_first_comma = 0;
-
-function add_to_listbox(cn_pos,cp_pos,name,callnumber,barcode) {
-       mw.sdump('D_CAT','xul: name = ' + name + ' cn = ' + callnumber + ' bc = ' + barcode + '\n');
-       var desc = document.getElementById('description_box');
-       if (add_to_listbox_first_comma++ == 0) {
-               desc.appendChild( document.createTextNode( ' ' + barcode ) );
-       } else {
-               desc.appendChild( document.createTextNode( ', ' + barcode ) );
-       }
-       /*
-       var listbox = document.getElementById('ephemeral_listbox');
-       var listitem = document.createElement('listitem');
-               listitem.setAttribute('cn_pos',cn_pos);
-               listitem.setAttribute('cp_pos',cp_pos);
-       listbox.appendChild(listitem);
-       var listcell1 = document.createElement('listcell');
-               listcell1.setAttribute('label',name);
-       listitem.appendChild(listcell1);
-       var listcell2 = document.createElement('listcell');
-               listcell2.setAttribute('label',callnumber);
-       listitem.appendChild(listcell2);
-       var listcell3 = document.createElement('listcell');
-               listcell3.setAttribute('label',barcode);
-       listitem.appendChild(listcell3);
-       */
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy.xul
deleted file mode 100644 (file)
index d083ca1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Copy Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="copy_win" title="&copy.title;" 
-       orient="vertical" style="overflow: scroll" persist="width height"
-       onload="
-               my_init();
-       "
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/copy_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="copy_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="copy_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="copy_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="copy_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_add_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_add_wizard.xul
deleted file mode 100644 (file)
index 2c3c323..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_add" title="&copy.wizard.title;" 
-       orient="vertical" style="overflow: auto"
-       onload="my_init();" width="800" height="600"
-       onwizardfinish="send_to_bill();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/volume_copy_add_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="volume_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="volume_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="volume_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <!--<wizardpage id="page1"/>-->
-       <wizardpage id="page2"/>
-       <wizardpage id="page3"/>
-       <wizardpage id="page4"/>
-
-</wizard>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_display.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_display.xul
deleted file mode 100644 (file)
index 8bb7753..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="copy_display_win" title="hello"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <OpenSRF id="OpenSRF_js"/>
-       <util id="util_js"/>
-
-       <vbox id="copy_display_vbox" flex="1" pack="center" align="center">
-               <label name="click_label" datum="1" click_evt="click_evt"/>
-               <label name="edit_date" datum="1" render_filter="^(.){10}" click_evt="click_evt" />
-               <label name="call_number" datum="1" render_path="label" click_evt="click_evt" />
-               <label name="fine_level" datum="1" click_evt="click_evt"/>
-               <label name="creator" datum="1" render_path="usrname" click_evt="click_evt"/>
-               <label name="creator" datum="1" render_path="home_ou/name" click_evt="click_evt"/>
-               <textbox name="status" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
-               <textbox name="circulate" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
-               <label name="circ_as_type" datum="1" click_evt="click_evt"/>
-               <label name="stat_cat_entries" datum="1" click_evt="click_evt"/>
-               <label name="isnew" datum="1" click_evt="click_evt"/>
-               <label name="editor" datum="1" render_path="usrname" click_evt="click_evt"/>
-               <label name="ischanged" datum="1" click_evt="click_evt"/>
-               <label name="id" datum="1" click_evt="click_evt"/>
-               <label name="isdeleted" datum="1" click_evt="click_evt"/>
-               <textbox name="deposit" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
-               <label name="location" datum="1" click_evt="click_evt"/>
-               <label name="loan_duration" datum="1" click_evt="click_evt"/>
-               <label name="ref" datum="1" click_evt="click_evt"/>
-               <label name="create_date" datum="1" click_evt="click_evt"/>
-               <textbox name="barcode" datum="1" change_evt="validate_evt,edit_evt" click_evt="click_evt" />
-               <label name="deposit_amount" datum="1" click_evt="click_evt"/>
-               <textbox name="opac_visible" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
-               <label name="copy_number" datum="1" click_evt="click_evt"/>
-               <textbox name="price" datum="1" change_evt="edit_evt" click_evt="click_evt"/>
-               <label name="circ_modifier" datum="1" click_evt="click_evt"/>
-               <label name="circ_lib" datum="1" render_path="name" click_evt="click_evt"/>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.js b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.js
deleted file mode 100644 (file)
index 3c5b278..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-var cn_list;
-
-function copy_edit_init() {
-       mw.sdump('D_CAT','entering my_init for copy_edit.js\n');
-       mw.sdump('D_CAT','TESTING: copy_edit.js: ' + mw.G['main_test_variable'] + '\n');
-       mw.sdump('D_CAT','Gathering copies to put in the acn object...\n');
-       var id_mapped_list = [];
-       var filtered_list = [];
-       if (params.tree) {
-               var list = get_list_from_tree_selection( params.tree );
-               mw.sdump('D_CAT','list.length = ' + list.length + '\n');
-               filtered_list = filtered_list.concat( 
-                       filter_list(
-                               list,
-                               function (obj) {
-                                       return (obj.getAttribute('object_type') == 'copy');
-                               }
-                       )
-               );
-               mw.sdump('D_CAT','filtered_list.length = ' + filtered_list.length + '\n');
-               id_mapped_list = id_mapped_list.concat(
-                       map_list(
-                               filtered_list,
-                               function (obj) {
-                                       return obj.getAttribute('copy_id');
-                               }
-                       )
-               );
-               mw.sdump('D_CAT','id_mapped_list.length = ' + id_mapped_list.length + '\n');
-       }
-       if (params.copy_ids) {
-               id_mapped_list = id_mapped_list.concat( params.copy_ids );
-       }
-       var result = [];
-       try {
-               result = user_request(
-                       'open-ils.search',
-                       'open-ils.search.asset.copy.fleshed.batch.retrieve', 
-                       [ id_mapped_list ]
-               )[0];
-       } catch(E) {
-               handle_error(E);
-       }
-       mw.sdump('D_CAT','result.length = ' + result.length + '\n');
-       cn_list = new Array();
-       for (var i in result) {
-               cn_list[i] = new acn();
-               try { cn_list[i].label( filtered_list[i].getAttribute('callnumber') ); } catch(E) { cn_list[i].label( 'dummy callnumber' ); }
-               try { cn_list[i].owning_lib( filtered_list[i].getAttribute('ou_id') ); } catch(E) { cn_list[i].owning_lib( 1 ); }
-               cn_list[i].copies( [ result[i] ] );
-       }
-       mw.sdump('D_CAT','cn_list = ' + js2JSON(cn_list) + '\n');
-       spawn_legacy_copy_editor();
-}
-
-function spawn_legacy_copy_editor() {
-       mw.sdump('D_CAT','trying to spawn_copy_editor()\n');
-       var params = { 'select_all' : true };
-       var chrome = 'chrome://evergreen/content/cat/copy.xul';
-       var frame = document.getElementById('copy_edit_frame');
-       frame.setAttribute('src',chrome);
-       frame.setAttribute('flex','1');
-       frame.contentWindow.cn_list = cn_list;
-       frame.contentWindow.mw = mw;
-       frame.contentWindow.real_parentWindow = this;
-       frame.contentWindow.parentWindow = window.app_shell;
-       frame.contentWindow.params = params;
-}
-
-function save_edited_copies() {
-       //mw.sdump('D_CAT','trying to save ====================================================================================\n\n\n');
-       //mw.sdump('D_CAT','cn_list = ' + js2JSON(cn_list) + '\n\n');
-       var copies = [];
-       for (var i = 0; i < cn_list.length; i++) {
-               var cn_copies = cn_list[i].copies();
-               for (var j = 0; j < cn_copies.length; j++) {
-                       copies.push( cn_copies[j] );
-               }
-       }
-       //mw.sdump('D_CAT','copies = ' + js2JSON(copies) + '\n\n');
-       try {
-               var result = user_request(
-                       'open-ils.cat',
-                       'open-ils.cat.asset.copy.fleshed.batch.update',
-                       [ mw.G.auth_ses[0], copies ]
-               )[0];
-               if (result == '1') {
-                       alert('Successfully updated these copies.\n');
-               } else {
-                       throw('There was an error updating the copies.\n');
-               }
-               mw.sdump('D_CAT','Result = ' + js2JSON(result) + '\n');
-               refresh_spawning_browse_list();
-       } catch(E) {
-               handle_error(E);
-       }
-}
-
-function refresh_spawning_browse_list() {
-       try {
-               params.refresh_func();
-       } catch(E) {
-               mw.sdump('D_CAT','refresh_spawning_browse_list error: ' + js2JSON(E) + '\n');
-       }
-}
-
-function spawn_marc_from_copy_editor() {
-       try {
-               var record_id = user_request(
-                       'open-ils.search',
-                       'open-ils.search.biblio.find_by_barcode',
-                       [ cn_list[0].copies()[0].barcode() ]
-               )[0].ids[0];
-               marc_view(app_shell,record_id);
-       } catch(E) {
-               handle_error(E);
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit.xul
deleted file mode 100644 (file)
index b6271c2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Copy Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="copy_edit_win" title="&copy.title;" 
-       orient="vertical" style="overflow: scroll" persist="width height"
-       onload=" copy_edit_init(); "
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/copy_edit_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="copy_edit_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="copy_edit_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="copy_edit_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="copy_edit_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_edit_overlay.xul
deleted file mode 100644 (file)
index 8d83c1d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="copy_edit_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="copy_edit_js">
-       <util id="util_js"/>
-       <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
-       <script src="chrome://evergreen/content/util/ses.js" />-->
-       <script src="copy_edit.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="copy_edit_cmds">
-       <command id="cmd_alert" oncommand="
-               alert(event.target.tagName + '  Not Yet Implemented');
-       "/>
-       <command id="cmd_edit_save" oncommand="
-               save_edited_copies();
-       "/>
-       <command id="cmd_edit_close" oncommand="
-               mw.close_tab(app_shell,'main_tabbox');
-       "/>
-       <command id="cmd_view_marc" oncommand="
-               spawn_marc_from_copy_editor();
-       "/>
-       <command id="cmd_refresh_parent" oncommand="
-               refresh_spawning_browse_list();
-       "/>
-</commandset>
-
-<vbox id="copy_edit_vbox" flex="1">
-       <iframe id="copy_edit_frame" flex="1"/>
-       <hbox id="copy_edit_hbox" flex="0">
-               <button id="copy_edit_close" label="Close Editor" command="cmd_edit_close"/>
-               <button id="copy_edit_marc" label="View MARC" command="cmd_view_marc"/>
-               <spacer id="copy_edit_spacer" flex="1"/>
-               <button id="copy_edit_save" label="Save Changes" command="cmd_edit_save"/>
-       </hbox>
-</vbox>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="copy_edit_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/copy_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/copy_overlay.xul
deleted file mode 100644 (file)
index 8489172..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="copy_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="copy_js">
-       <util id="util_js"/>
-       <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
-       <script src="chrome://evergreen/content/util/ses.js" />-->
-       <script src="copy.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="copy_cmds">
-       <command id="cmd_alert" oncommand="
-               alert(event.target.tagName + '  Not Yet Implemented');
-       "/>
-       <command id="cmd_apply" oncommand="
-               apply_attribute(event);
-       "/>
-       <command id="cmd_save" oncommand="
-               save_attributes();
-       "/>
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="copy_vbox" flex="1">
-       <vbox flex="1">
-               <hbox flex="1">
-                       <deck id="pines_info_deck"/>
-                       <splitter collapse="after"> <grippy/> </splitter>
-                       <vbox>
-                               <deck id="local_info_deck"/>
-                               <!--
-                               <splitter collapse="after"> <grippy/> </splitter>
-                               <vbox>
-                                       <listbox id="notes_listbox"/>   
-                                       <hbox id="note_button_box"/>
-                               </vbox>
-                               -->
-                       </vbox>
-               </hbox>
-               <hbox id="copy_button_box"/>
-       </vbox>
-       <splitter collapse="after"> <grippy/> </splitter>
-       <vbox flex="1" hidden="false">
-               <deck id="bottom_deck"/>
-       </vbox>
-</vbox>
-
-<hbox id="copy_button_box">
-       <!--
-       <button label="&copy.save;" accesskey="&copy.save.key;" command="cmd_alert"/>
-       <spacer flex="1"/>
-       <button label="&copy.reload;" accesskey="&copy.reload.key;" command="cmd_alert"/>
-       <button label="&copy.bucket;" accesskey="&copy.bucket.key;" command="cmd_alert"/>
-       <button label="&copy.clone;" accesskey="&copy.clone.key;" command="cmd_alert"/>
-       <button label="&copy.transfer;" accesskey="&copy.transfer.key;" command="cmd_alert"/>
-       <button label="&copy.delete;" accesskey="&copy.delete.key;" command="cmd_alert"/>
-       <button id="apply_attr_button" label="Apply these Attributes to the selected Copies" command="cmd_apply"/>
-       <button id="save_attr_button" label="Save Changes" command="cmd_save"/>
-       -->
-</hbox>
-
-<hbox id="note_button_box">
-       <hbox flex="1">
-               <button label="&copy.notes.delete;" accesskey="&copy.notes.delete.key;" command="cmd_alert"/>
-               <button label="&copy.notes.add;" accesskey="&copy.notes.add.key;" command="cmd_alert"/>
-       </hbox>
-       <button label="&copy.close;" accesskey="&copy.close.key;" oncommand="window.close();"/>
-</hbox>
-
-<deck id="bottom_deck" flex="1">
-       <vbox>
-               <description id="description_box">Modifying the following copies:</description>
-               <listbox id="ephemeral_listbox" flex="1" seltype="multiple" onselect="transfer_attributes(event);" hidden="true">
-                       <listhead>
-                               <listheader/>
-                               <listheader label="Location"/>
-                               <listheader label="Call Number"/>
-                               <listheader label="Barcode"/>
-                       </listhead>
-                       <listcols>
-                               <listcol/>
-                               <listcol flex="1"/>
-                               <listcol flex="1"/>
-                               <listcol flex="1"/>
-                       </listcols>
-               </listbox>
-       </vbox>
-</deck>
-
-
-<deck id="pines_info_deck" flex="1">
-       <vbox>
-               <listbox id="pines_attr_listbox"/>
-       </vbox>
-</deck>
-
-<deck id="local_info_deck" flex="1">
-       <vbox>
-               <listbox id="local_attr_listbox"/>
-               <hbox pack="end"><button disabled="true" label="&copy.edit_categories;" command="cmd_alert"/></hbox>
-       </vbox>
-</deck>
-
-<!-- At some point we will programatically populate these grids and menus -->
-
-<menulist id="shelving-location-menu">
-       <menupopup id="shelving-location-popup" command="cmd_apply">
-               <menuitem id="shelving-location-prompt" label="Select one..." hidden="true"/>
-       </menupopup>
-</menulist>
-
-<listbox id="notes_listbox" flex="1">
-       <listhead>
-               <listheader label="&copy.notes.opac;"/>
-               <listheader label="&copy.notes.date;"/>
-               <listheader label="&copy.notes.from;"/>
-               <listheader label="&copy.notes;"/>
-       </listhead>
-       <listcols>
-               <listcol/>
-               <listcol/>
-               <listcol/>
-               <listcol flex="1"/>
-       </listcols>
-       <!--
-       <listitem allowevents="true">
-               <listcell>
-                       <checkbox/>
-               </listcell>
-               <listcell label="2004-12-01"/>
-               <listcell label="Admin"/>
-               <listcell label="Legacy Fields: Item Type = BOOK, Item Cat1 = FICTION, Item Cat2 = ADULT"/>
-       </listitem>
-       -->
-</listbox>
-
-<listbox id="local_attr_listbox" flex="1">
-       <listhead>
-               <listheader />
-               <listheader label="&copy.local.attr;"/>
-               <listheader label="&copy.local.attr.value;"/>
-       </listhead>
-       <listcols>
-               <listcol />
-               <listcol flex="1"/>
-               <listcol flex="2"/>
-       </listcols>
-       <!--
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.stat.genre;"/>
-               <listcell>
-                       <menulist id="stat-genre-menu"/>
-                       <hbox pack="end" flex="1">
-                               <button disabled="true" label="&copy.edit_entries;" command="cmd_alert"/>
-                       </hbox>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.stat.audience;"/>
-               <listcell>
-                       <menulist id="stat-audience-menu"/>
-                       <hbox pack="end" flex="1">
-                               <button disabled="true" label="&copy.edit_entries;" command="cmd_alert"/>
-                       </hbox>
-               </listcell>
-       </listitem>
-       -->
-</listbox>
-
-<listbox id="pines_attr_listbox" flex="1">
-       <listhead>
-               <listheader label="&copy.pines.attr;"/>
-               <listheader label="&copy.pines.attr.value;"/>
-       </listhead>
-       <listcols>
-               <listcol flex="1"/>
-               <listcol flex="2"/>
-       </listcols>
-       <listitem allowevents="true" hidden="true">
-               <listcell label="&copy.attr.barcode;"/>
-               <listcell label="330620563200"/>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.copy_status;"/>
-               <listcell>
-                       <menulist id="copy-status-menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.shelving_location;"/>
-               <listcell>
-                       <menulist id="shelving-location-menu"/>
-                       <!--<hbox pack="end" flex="1">
-                               <button disabled="true" label="&copy.edit_entries;" command="cmd_alert"/>
-                       </hbox>-->
-               </listcell>
-       </listitem>
-
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.circulating_lib;"/>
-               <listcell>
-                       <menulist id="circulating-library-menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.loan_duration;"/>
-               <listcell>
-                       <menulist id="loan-duration-menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.fine_level;"/>
-               <listcell>
-                       <menulist id="fine-level-menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.circulate;"/>
-               <listcell>
-                       <menulist id="circulate_menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.deposit;"/>
-               <listcell>
-                       <menulist id="deposit_menu"/>
-                       <label value="&copy.attr.deposit_amount;"/>
-                       <textbox id="deposit_amount" size="6" onchange="apply_attribute(event);" value="0.00"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.price;"/>
-               <listcell>
-                       <textbox id="price" size="6" onchange="apply_attribute(event);" value="0.00"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.reference_material;"/>
-               <listcell>
-                       <menulist id="reference_menu"/>
-               </listcell>
-       </listitem>
-       <listitem allowevents="true">
-               <listcell label="&copy.attr.opac_visible;"/>
-               <listcell>
-                       <menulist id="opac_visible_menu"/>
-               </listcell>
-       </listitem>
-</listbox>
-
-<menulist id="opac_visible_menu">
-       <menupopup id="opac_visible_popup" command="cmd_apply">
-               <menuitem label="&copy.attr.opac_visible.yes;" value="1" selected="true"/>
-               <menuitem label="&copy.attr.opac_visible.no;" value="0"/>
-       </menupopup>
-</menulist>
-
-<menulist id="reference_menu">
-       <menupopup id="reference_popup" command="cmd_apply" >
-               <menuitem label="&copy.attr.reference_material.no;" value="0" selected="true"/>
-               <menuitem label="&copy.attr.reference_material.yes;" value="1"/>
-       </menupopup>
-</menulist>
-
-<menulist id="deposit_menu">
-       <menupopup id="deposit_popup" command="cmd_apply">
-               <menuitem label="&copy.attr.deposit.no;" value="0" selected="true"/>
-               <menuitem label="&copy.attr.deposit.yes;" value="1"/>
-       </menupopup>
-</menulist>
-
-<menulist id="circulate_menu">
-       <menupopup id="circulate_popup" command="cmd_apply">
-               <menuitem label="&copy.attr.circulate.yes;" value="1" selected="true"/>
-               <menuitem label="&copy.attr.circulate.no;" value="0"/>
-       </menupopup>
-</menulist>
-
-<menulist id="fine-level-menu">
-       <menupopup id="fine-level-popup" command="cmd_apply">
-               <menuitem label="&copy.attr.fine_level.normal;" value="2" selected="true"/>
-               <menuitem label="&copy.attr.fine_level.high;" value="3"/>
-               <menuitem label="&copy.attr.fine_level.low;" value="1"/>
-       </menupopup>
-</menulist>
-
-<menulist id="loan-duration-menu">
-       <menupopup id="loan-duration-popup" command="cmd_apply">
-               <menuitem label="&copy.attr.loan_duration.normal;" value="2" selected="true"/>
-               <menuitem label="&copy.attr.loan_duration.long;" value="3"/>
-               <menuitem label="&copy.attr.loan_duration.short;" value="1"/>
-       </menupopup>
-</menulist>
-
-<menulist id="circulating-library-menu">
-       <menupopup id="circulating-library-popup" command="cmd_apply">
-       </menupopup>
-</menulist>
-
-<menulist id="copy-status-menu">
-       <menupopup id="copy-status-popup" command="cmd_apply">
-               <!-- <menuitem label="&copy.attr.copy_status.example1;" value="&copy.attr.copy_status.example1;"/> -->
-       </menupopup>
-</menulist>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="copy_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/details.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/details.xul
deleted file mode 100644 (file)
index 7e08783..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="details_win" title="Record Details" 
-       orient="vertical" style="overflow: scroll" width="800" height="500"
-       onload="my_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
-       <script>
-       <![CDATA[
-               var myPackageDir = "evergreen";
-
-               function my_init() {
-
-                       /*document.getElementById('copy_editor_tab').disabled = true;*/
-                       chain_exec(
-                               my_init_spawn_brief_view,
-                               my_init_spawn_marc_view,
-                               my_init_spawn_copy_browser,
-                               /* my_init_spawn_opac_view, */
-                               my_init_spawn_marc_editor
-                       );
-
-               }
-
-               function my_init_spawn_brief_view() {
-                       spawn_brief_view(
-                               document, 'replace_iframe', 'brief_view', {
-                                       'find_this_id' : find_this_id
-                               }
-                       ).find_this_id = find_this_id;
-               }
-
-               function my_init_spawn_marc_view() {
-                       var html = user_request(
-                               "open-ils.search",
-                               "open-ils.search.biblio.record.html",
-                               [ find_this_id ]
-                       )[0];
-                       spawn_interface(
-                               document, 'replace_browser', 'marc_view',
-                               'data:text/html,' + html,
-                               'MARC View2', {}
-                       );
-               }
-
-               function my_init_spawn_marc_editor() {
-                       spawn_marc_editor(
-                               document, 'replace_iframe', 'marc_edit', {
-                                       'find_this_id' : find_this_id
-                               }
-                       ).find_this_id = find_this_id;
-               }
-
-               function my_init_spawn_copy_browser() {
-                       var w = spawn_copy_browser(
-                               document, 'replace_iframe', 'copy_browser', {
-                                       'find_this_id' : find_this_id
-                               }
-                       );
-                       w.find_this_id = find_this_id;
-                       w.parent_window = window;
-               }
-
-               function my_init_spawn_opac_view() {
-                       dump('trying to spawn: ' + params.opac_url + '\n');
-                       spawn_interface(
-                               document, 'replace_browser', 'opac_view',
-                               params.opac_url, 'OPAC View', {}
-                       );
-               }
-       ]]>
-       </script>
-
-       <vbox flex="1">
-               <hbox id="brief_view"/>
-               <tabbox flex="1">
-                       <tabs>
-                               <!-- <tab label="OPAC View"/> -->
-                               <tab label="MARC View"/>
-                               <tab label="MARC Edit"/>
-                               <tab label="Copy Browser"/>
-                               <tab label="Copy Editor" id="copy_editor_tab" />
-                       </tabs>
-                       <tabpanels flex="1">
-                               <!-- <tabpanel id="opac_view"/> -->
-                               <tabpanel id="marc_view"/>
-                               <tabpanel id="marc_edit"/>
-                               <tabpanel id="copy_browser"/>
-                               <tabpanel id="copy_editor">
-                                       <description>
-                                               Select some copies in the Copy Browser tab to edit.
-                                       </description>
-                               </tabpanel>
-                       </tabpanels>
-               </tabbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc.js b/Evergreen/staff_client/chrome/content/evergreen/cat/marc.js
deleted file mode 100644 (file)
index 830fd8f..0000000
+++ /dev/null
@@ -1,915 +0,0 @@
-mw.sdump('D_CAT','loading marc.js\n');
-
-var character_measure = {};
-var tree;
-var meta;
-var backup_tree;
-
-function my_init() {
-       mw.sdump('D_CAT','Entering my_init() : ' + timer_elapsed('cat') + '\n');
-       mw.sdump('D_CAT','TESTING: marc.js: ' + mw.G['main_test_variable'] + '\n');
-
-       try {
-               mw.sdump('D_CAT',"DOC ID " + find_this_id + "\n" );
-       } catch(E) {
-               
-       }
-
-       if (! params.import_tree ) {
-               tree = retrieve_record( find_this_id );
-               /*
-               meta = retrieve_meta_record( find_this_id );
-               document.getElementById('meta_create_date').setAttribute('value',
-                       meta.create_date().split('.')[0]        
-               );
-               document.getElementById('meta_creator').setAttribute('value',
-                       meta.creator()  
-               );
-               document.getElementById('meta_edit_date').setAttribute('value',
-                       meta.edit_date().split('.')[0]
-               );
-               document.getElementById('meta_editor').setAttribute('value',
-                       meta.editor()   
-               );
-               document.getElementById('meta_tcn_publisher').setAttribute('value',
-                       meta.tcn_value()        
-               );
-               if (params.record_columns) {
-                       var text = document.createTextNode(
-                               params.record_columns[1] + ' / ' + params.record_columns[2]
-                       );
-                       document.getElementById('meta_title_author').appendChild(
-                               text
-                       );
-               }
-               */
-       } else {
-               tree = params.import_tree;
-       }
-       if (tree.name() == 'collection') { 
-               tree = find_list(
-                       tree.children(),
-                       function (obj) {
-                               return (obj.name() == 'record');
-                       }
-               ); 
-       }
-
-       //mw.sdump('D_CAT','Retrieved: ' + js2JSON(tree) + '\n');
-       //mw.sdump('D_CAT','Retrieved: ' + js2JSON(meta) + '\n');
-       build_grid( 
-               document.getElementById('ctrl_rows'), 
-               document.getElementById('data_rows'), 
-               tree
-       );
-       fixed_fields_show_only('fixed_grid','BKS');
-       apply_event_listeners('fixed_grid','fixed');
-       character_measure = measure_character('marc_win','M');
-       window.addEventListener('resize',my_resize_handler,false);
-       handle_tag_change();
-       document.getElementById('data_rows').firstChild.firstChild.firstChild.focus();
-       mw.sdump('D_CAT','Exiting my_init() : ' + timer_elapsed('cat') + '\n');
-}
-
-function measure_character(w,c) {
-       var el = document.getElementById(w);
-       var b = document.createElement('hbox');
-       var l = document.createElement('label');
-       l.setAttribute('class','marc');
-       el.appendChild(b);
-       b.appendChild(l);
-       var lwidth = l.boxObject.width;
-       l.value = c;
-       lwidth = Math.abs( l.boxObject.width - lwidth);
-       var lheight = l.boxObject.height;
-       b.removeChild(l); el.removeChild(b);
-       return { "width" : lwidth, "height" : lheight };
-}
-
-function my_resize_handler(ev) {
-       mw.sdump('D_CAT','resize\n');
-       resizeAllWrappers('ctrl_rows');
-       resizeAllWrappers('data_rows');
-}
-
-function retrieve_record(id) {
-       mw.sdump('D_CAT','Entering retrieve_record() : ' + timer_elapsed('cat') + '\n');
-       var result;
-       try {
-               result = user_request(
-                       'open-ils.cat',
-                       'open-ils.cat.biblio.record.tree.retrieve',
-                       [ id ]
-               );
-       } catch(E) {
-               handle_error(E);
-       }
-       //var result = [ JSON2js( test_nodeset() ) ];
-       /*var result = user_request(
-               'open-ils.cat',
-               'open-ils.cat.biblio.record.tree.retrieve.test',
-               [ id ]
-       );*/
-       if (typeof(result[0]) != 'object') {
-               alert( 'user_request gave ' + js2JSON(result) );
-               mw.sdump('D_CAT','Exiting retrieve_record() : ' + timer_elapsed('cat') + '\n');
-               return 0;
-       } else {
-               /*
-               mw.sdump('D_CAT','Entering nodeset2tree() : ' + timer_elapsed('cat') + '\n');
-               result[0] = nodeset2tree( result[0] )[0];
-               mw.sdump('D_CAT','Exiting nodeset2tree() : ' + timer_elapsed('cat') + '\n');
-               */
-               mw.sdump('D_CAT','Exiting retrieve_record() : ' + timer_elapsed('cat') + '\n');
-               return result[0];
-       }
-}
-
-function retrieve_meta_record(id) {
-       mw.sdump('D_CAT','Entering retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
-       var result;
-       try {
-               result = user_request(
-                       'open-ils.cat',
-                       'open-ils.cat.biblio.record.metadata.retrieve',
-                       [ id ]
-               );
-       } catch(E) {
-               handle_error(E);
-       }
-       if (typeof(result[0]) != 'object') {
-               alert( 'user_request gave ' + js2JSON(result) );
-               mw.sdump('D_CAT','Exiting retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
-               return 0;
-       } else {
-               mw.sdump('D_CAT','Exiting retrieve_meta_record() : ' + timer_elapsed('cat') + '\n');
-               return result[0][0];
-       }
-}
-
-
-
-function empty_me(p) {
-       while (p.lastChild) {
-               //mw.sdump('D_CAT','emptying ' + p.lastChild.tagName + '\n');
-               empty_me(p.lastChild);
-               p.removeChild(p.lastChild);
-       }
-}
-
-function empty_grid( ctrl_rows, data_rows ) {
-       var rows = document.getElementById(ctrl_rows);
-       empty_me(rows);
-       rows = document.getElementById(data_rows);
-       empty_me(rows);
-}
-
-function build_grid( ctrl_rows, data_rows, root ) {
-       mw.sdump('D_CAT','Entering build_grid() : ' + timer_elapsed('cat') + '\n');
-       var ctrl_count = 1; var data_count = 1;
-       //mw.sdump('D_CAT', 'what is root?\n' + pretty_print(js2JSON(root)) + '\n');
-       mw.sdump('D_CAT','root.children.length = ' + root.children.length + '\n');
-       root_loop: 
-       var children = root.children();
-       for (var i in children) {
-               var node = children[i];
-               var node_type = node.node_type();
-               var row = {};
-               switch(node_type) {
-                       case 18: case '18': /* namespace */ 
-                               break;
-                       case 1: case '1': /* element */
-                               row = get_row(node);
-                               switch(row.type) {
-                                       case 'leader': case 'controlfield':
-                                                       populate_xul_row( 
-                                                               ctrl_rows, 
-                                                               row, 
-                                                               'ctrl_' + ctrl_count++
-                                                       );
-                                               break;
-                                       case 'datafield':
-                                                       populate_xul_row( 
-                                                               data_rows, 
-                                                               row, 
-                                                               'data_' + data_count++
-                                                       );
-                                               break;
-                                       default:
-                                               mw.sdump('D_CAT','Unexpected row type: ' + 
-                                                       js2JSON(node) + '\n');
-                                               break;
-                               }
-                               break;
-                       default: /* eh? */
-                               mw.sdump('D_CAT', 'Did not expect node_type = ' + node_type + 
-                                       ' : ' + js2JSON(node) + '\n');
-                               break;
-               }
-               //mw.sdump('D_CAT', i + ' ' + dump_ns_node(node) + '\n');
-       }
-       mw.sdump('D_CAT','Exiting build_grid() : ' + timer_elapsed('cat') + '\n');
-}
-
-function get_row( top ) {
-       var row = { 
-               'field' : { 'id' : '1' },
-               'tag' : { 'value' : '', 'id' : '-1' },
-               'ind1' : { 'value' : '', 'id' : '-1' },
-               'ind2' : { 'value' : '', 'id' : '-1' },
-               'data' : { 'value' : '', 'id' : '-1' }
-       };
-       var name = top.name(); 
-       var id = top.intra_doc_id(); 
-       var children = top.children();
-       row.field.id = id;
-       mw.sdump('D_CAT','Making row.... row.field.id = <' + id + '>\n');
-       if (name == 'leader') { row.tag.value = 'LDR'; row.tag.id = id; }
-       row.type = name;
-       top_loop:
-       for (var i in children) {
-               var node = children[i];
-               var node_type = node.node_type();
-               var node_name = node.name();
-               var node_value = node.value();
-               var node_id = node.intra_doc_id();
-               var node_children = node.children();
-               switch(node_type) {
-                       case 18: case '18': /* namespace */ 
-                               continue top_loop;
-                       case 2: case '2': /* attribute */ 
-                               switch(node_name) {
-                                       case 'tag':
-                                               row.tag.value = node_value;
-                                               row.tag.id = node_id;
-                                               break;
-                                       case 'ind1':
-                                               row.ind1.value = node_value;
-                                               row.ind1.id = node_id;
-                                               break;
-                                       case 'ind2':
-                                               row.ind2.value = node_value;
-                                               row.ind2.id = node_id;
-                                               break;
-                                       default:
-                                               mw.sdump('D_CAT','\tattribute surprise on node_name = ' +
-                                                       node_name + ' : ' 
-                                                       + js2JSON(node) + '\n');
-                                               break;
-                               }
-                               break;
-                       case 1: case '1': /* element */
-                               switch(node_name) {
-                                       case 'subfield':
-                                               row.data.value = row.data.value + 
-                                               String.fromCharCode(8225) +
-                                               node_children[0].value() + ' ' + 
-                                               node_children[1].value() + ' ';
-                                               row.data.id = node_id;
-                                               break;
-                                       default:
-                                               mw.sdump('D_CAT','\telement surprise on node_name = ' +
-                                                       node_name + ' : ' 
-                                                       + js2JSON(node) + '\n');
-                                               break;
-                               }
-                               break;
-                       case 3: case '3': /* textNode */
-                               row.data.value = node_value;
-                               row.data.id = node_id;
-                               break;
-                       default: /* eh? */
-                               mw.sdump('D_CAT','\tunknown type surprise on node_type = ' +
-                                       node_type + ' : '  +
-                                       js2JSON(node) + '\n');
-                               break;
-               }
-       }
-       //mw.sdump('D_CAT',js2JSON(row) + '\n');
-       return row;
-}
-
-function build_xul_row( id, type ) {
-       switch(type) {
-               case 'leader': case 'controlfield':
-                       return build_ctrl_row( id );
-                       break;
-               case 'datafield':
-                       return build_data_row( id );
-                       break;
-               default:
-                       mw.sdump('D_CAT','Unexpected row type\n');
-                       break;
-       }
-}
-
-function build_data_row( id ) {
-       //mw.sdump('D_CAT','Entering build_xul_row() : ' + timer_elapsed('cat') + '\n');
-       var xul_row = document.createElement('row');
-       xul_row.setAttribute('id',id);
-       xul_row.setAttribute('class','field_row data_row');
-       //xul_rows.appendChild(xul_row);
-
-       /* the elements in the row */
-       var wrapper1 = document.createElement('hbox');
-       wrapper1.setAttribute( 'class', 'marc_wrapper marc_tag_wrapper');
-       var xul_col1 = document.createElement('textbox');
-               xul_col1.setAttribute( 'cols', '3');
-               xul_col1.setAttribute( 'rows', '1');
-               xul_col1.setAttribute( 'multiline', 'true');
-               xul_col1.setAttribute( 'size', '3');
-               xul_col1.setAttribute( 'class', 'marc marc_tag');
-               wrapper1.appendChild(xul_col1);
-               xul_row.appendChild(wrapper1);
-       var wrapper2 = document.createElement('hbox');
-       wrapper2.setAttribute( 'class', 'marc_wrapper marc_ind_wrapper marc_ind1_wrapper');
-       var xul_col2 = document.createElement('textbox');
-               xul_col2.setAttribute( 'cols', '1');
-               xul_col2.setAttribute( 'rows', '1');
-               xul_col2.setAttribute( 'multiline', 'true');
-               xul_col2.setAttribute( 'size', '1');
-               xul_col2.setAttribute( 'class', 'marc marc_ind marc_ind1');
-               wrapper2.appendChild(xul_col2);
-               xul_row.appendChild(wrapper2);
-       var wrapper3 = document.createElement('hbox');
-       wrapper3.setAttribute( 'class', 'marc_wrapper marc_ind_wrapper marc_ind2_wrapper');
-       var xul_col3 = document.createElement('textbox');
-               xul_col3.setAttribute( 'cols', '1');
-               xul_col3.setAttribute( 'rows', '1');
-               xul_col3.setAttribute( 'multiline', 'true');
-               xul_col3.setAttribute( 'size', '1');
-               xul_col3.setAttribute( 'class', 'marc marc_ind marc_ind2');
-               wrapper3.appendChild(xul_col3);
-               xul_row.appendChild(wrapper3);
-       var wrapper4 = document.createElement('hbox');
-       wrapper4.setAttribute( 'class', 'marc_wrapper marc_data_wrapper');
-       var xul_col4 = document.createElement('textbox');
-               xul_col4.setAttribute( 'subfields', 'true');
-               xul_col4.setAttribute( 'cols', '60');
-               xul_col4.setAttribute( 'size', '60');
-               xul_col4.setAttribute( 'rows', '1');
-               xul_col4.setAttribute( 'multiline', 'true');
-               xul_col4.setAttribute( 'class', 'marc marc_data resizable');
-               xul_col4.setAttribute( 'flex', '1');
-               wrapper4.appendChild(xul_col4);
-               xul_row.appendChild(wrapper4);
-
-       return xul_row;
-       //mw.sdump('D_CAT','Exiting build_xul_row() : ' + timer_elapsed('cat') + '\n');
-}
-
-function build_ctrl_row( id ) {
-       //mw.sdump('D_CAT','Entering build_xul_row() : ' + timer_elapsed('cat') + '\n');
-       var xul_row = document.createElement('row');
-       xul_row.setAttribute('class','field_row ctrl_row');
-       xul_row.setAttribute('id',id);
-       //xul_rows.appendChild(xul_row);
-
-       /* the elements in the row */
-       var wrapper1 = document.createElement('hbox');
-       wrapper1.setAttribute( 'class', 'marc_wrapper marc_tag_wrapper ctrl_wrapper');
-       var xul_col1 = document.createElement('textbox');
-               xul_col1.setAttribute( 'cols', '3');
-               xul_col1.setAttribute( 'rows', '1');
-               xul_col1.setAttribute( 'multiline', 'true');
-               xul_col1.setAttribute( 'size', '3');
-               xul_col1.setAttribute( 'class', 'marc marc_tag ctrl');
-               xul_col1.setAttribute( 'disabled', 'true');
-               wrapper1.appendChild(xul_col1);
-               xul_row.appendChild(wrapper1);
-       var wrapper4 = document.createElement('hbox');
-       wrapper4.setAttribute( 'class', 'marc_wrapper marc_data_wrapper ctrl_wrapper');
-       var xul_col4 = document.createElement('textbox');
-               xul_col4.setAttribute( 'cols', '60');
-               xul_col4.setAttribute( 'size', '60');
-               xul_col4.setAttribute( 'rows', '1');
-               xul_col4.setAttribute( 'multiline', 'true');
-               xul_col4.setAttribute( 'class', 'marc marc_data ctrl');
-               xul_col4.setAttribute( 'flex', '1');
-               xul_col4.setAttribute( 'disabled', 'true');
-               wrapper4.appendChild(xul_col4);
-               xul_row.appendChild(wrapper4);
-
-       return xul_row;
-       //mw.sdump('D_CAT','Exiting build_xul_row() : ' + timer_elapsed('cat') + '\n');
-}
-
-
-function apply_event_listeners(c,which) {
-       switch(which) {
-               case 'ctrl':
-                       break;
-               case 'data':
-                       c[0].firstChild.addEventListener("change",handle_tag_change,false);
-                       c[0].firstChild.addEventListener("keypress",handle_keypress,false);
-                       c[1].firstChild.addEventListener("keypress",handle_keypress,false);
-                       c[1].firstChild.addEventListener("change",handle_tag_change,false);
-                       c[2].firstChild.addEventListener("keypress",handle_keypress,false);
-                       c[2].firstChild.addEventListener("change",handle_tag_change,false);
-                       c[3].firstChild.addEventListener("keypress",handle_keypress,false);
-                       c[3].firstChild.addEventListener("change",handle_tag_change,false);
-                       c[3].firstChild.addEventListener("change",handle_change,false);
-                       break;
-               case 'fixed':
-                       var g = document.getElementById(c);
-                       var nl = g.getElementsByTagName('textbox');
-                       for (var i in nl) {
-                               if (typeof(nl[i])=='object') {
-                                       nl[i].addEventListener("change",handle_fixed_change,false);
-                               }
-                       }
-                       break;
-       }
-}
-
-function populate_xul_row( xul_rows, row, id ) {
-
-       var r = document.getElementById(id);
-       if (!r) {
-               r = build_xul_row(id,row.type);
-               xul_rows.appendChild(r);
-               //r = document.getElementById(id);
-       }
-       r.setAttribute('notempty','true');
-       r.setAttribute('mynode',row.field.id);
-       var c = r.childNodes;
-       switch(row.type) {
-               case 'leader': case 'controlfield':
-                       c[0].firstChild.value = row.tag.value;
-                       c[0].firstChild.select();
-                       c[0].firstChild.setAttribute('mynode', row.tag.id);
-                       c[1].firstChild.value = row.data.value;
-                       c[1].firstChild.select();
-                       c[1].firstChild.setAttribute('mynode', row.data.id);
-                       apply_event_listeners(c,'ctrl');
-                       break;
-               case 'datafield':
-                       c[0].firstChild.value = row.tag.value;
-                       c[0].firstChild.select();
-                       c[0].firstChild.setAttribute('mynode', row.tag.id);
-                       c[1].firstChild.value = row.ind1.value;
-                       c[1].firstChild.select();
-                       c[1].firstChild.setAttribute('mynode', row.ind1.id);
-                       c[2].firstChild.value = row.ind2.value;
-                       c[2].firstChild.select();
-                       c[2].firstChild.setAttribute('mynode', row.ind2.id);
-                       c[3].firstChild.value = row.data.value;
-                       c[3].firstChild.select();
-                       c[3].firstChild.setAttribute('mynode', row.data.id);
-                       apply_event_listeners(c,'data');
-                       break;
-       }
-       //resizeWrapper(c3);
-}
-
-function handle_change(ev) {
-       mw.sdump('D_CAT','handle_change\n');
-       var t = ev.target;
-       // parse subfields
-       resizeWrapper(t);
-}
-
-function resizeWrapper(t) {
-       if (t.tagName != 'textbox') { return; }
-       var wrapper = t.parentNode;
-       var width = wrapper.boxObject.width;
-       var height = wrapper.boxObject.height;
-
-       /*var lwidth = character_measure.width * t.value.length; // linux */
-       var lwidth = (character_measure.width*2+5) * t.value.length; // windows
-       var lheight = character_measure.height;
-
-       if (width == 0) { width = lwidth; }
-       var xrows = Math.ceil( lwidth / width );
-       if (xrows < 1) { xrows = 1; }
-       var xheight = (xrows * (lheight+5)); 
-
-       //mw.sdump('D_CAT',wrapper.parentNode.id + ' wrapper: ' + width + 'x' + height + ' label: ' + lwidth + 'x' + lheight + '\n');
-       wrapper.setAttribute('style','min-height: ' + xheight + 'px;');
-}
-
-function resizeAllWrappers(rows) {
-       mw.sdump('D_CAT','Entering resizeAllWrappers() : ' + timer_elapsed('cat') + '\n');
-       var p = document.getElementById(rows);
-       var c = p.childNodes;
-       for (var r in c) {
-               if (typeof(c[r])=='object') {
-                       if (c[r].getAttribute('notempty')) {
-                               resizeWrapper(c[r].lastChild.firstChild);
-                       } else {
-                               p.removeChild(c[r]);
-                       }
-               }
-       }
-       mw.sdump('D_CAT','Exiting resizeAllWrappers() : ' + timer_elapsed('cat') + '\n');
-}
-
-function find_element_with_id(ns_slice,id) {
-       // we might change this in the future to be a hash lookup
-       // { node id => [lvl 1 index, lvl 2 index, lvl 3 index]  }
-       // with the hash being populated when the tree is generated
-       // and updated when we go to insert nodes
-       //mw.sdump('D_CAT','Find ' + id + ' in ' + js2JSON(ns_slice) + '\n');
-       //mw.sdump('D_CAT','Find ' + id + '\n');
-       for (i in ns_slice) {
-               if (ns_slice[i].intra_doc_id() == id) {
-                       //mw.sdump('D_CAT','Found at index ' + i + '\n');
-                       return i;
-               }
-       }
-       mw.sdump('D_CAT',id + 'not found in' + js2JSON(ns_slice) + '\n');
-}
-
-function delete_children(branch) {
-       var children = branch.children();
-       for (var c in children) {
-               children[c].isdeleted(1);
-               mw.sdump('D_CAT', children[c].name() + ':' +
-                       children[c].id() + ':' +
-                       children[c].intra_doc_id() + '.is_deleted = 1\n');
-               if (children[c].children()) {
-                       delete_children(children[c]);
-               }
-       }
-}
-
-function submit_marc() {
-       // walk through the marc grid and compare with the tree
-       // 1) updates and deletes
-
-mw.sdump('D_CAT','Updates and Deletes\n');
-       backup_tree = JSON2js( js2JSON( tree ) );
-
-       var tree_fields = tree.children(); // LEVEL 1
-       var ctrl_rows = document.getElementById('ctrl_rows').childNodes;
-       for (var r = 0; r < ctrl_rows.length ; r++) {
-               //if (r == 0) { continue; } // skip leader for now
-               //mw.sdump('D_CAT', r + '\n');
-               var tag_node_id;
-               try {
-                       tag_node_id = ctrl_rows[r].getAttribute('mynode');
-               } catch(E) {
-                       mw.sdump('D_CAT','Could not find mynode in ctrl_rows[' + r + ']\n');
-                       continue;
-               }
-               //mw.sdump('D_CAT', r + ':' + ctrl_rows[r].tagName + ':' + tag_node_id + '\n' );
-               if (tag_node_id) {
-mw.sdump('D_CAT','Processing ctrl_rows[' + r + '], tag_node_id = ' + tag_node_id + '\n');
-                       if (tag_node_id < 0) { continue; } // new node, handle elsewhere
-mw.sdump('D_CAT','1st find =========================================\n')
-                       var tree_pos = find_element_with_id(tree_fields,tag_node_id);
-                       if (tree_pos == null) { alert('tree_pos problem!'); }
-                       var tree_field = tree_fields[tree_pos];
-
-                       if (ctrl_rows[r].getAttribute('hidden') == 'true') {
-                               tree_field.isdeleted(1);
-                               mw.sdump('D_CAT', tree_field.name() + ':' +
-                                       tree_field.id() + ':' +
-                                       tree_field.intra_doc_id() + '.isdeleted = 1\n');
-                               delete_children(tree_field);
-                               continue;
-                       }
-
-                       var col1 = ctrl_rows[r].childNodes[0].firstChild;
-                       var col2 = ctrl_rows[r].childNodes[1].firstChild;
-                       var id1 = col1.getAttribute('mynode');
-                       var id2 = col2.getAttribute('mynode');
-                       mw.sdump('D_CAT','id1 = ' + id1 + ' col1.value = ' + col1.value + '  id2 = ' + id2 + ' col2.value = ' + col2.value + '\n');
-                       var tree_field_children = tree_field.children(); // LEVEL 2
-
-                       if (r == 0) { // leader is special.  Only one child
-                               if (tree_field_children[0].value() != col2.value) {
-                                       tree_field_children[0].value(col2.value);
-                                       tree_field_children[0].ischanged(1);
-                                       mw.sdump('D_CAT', tree_field_children[0].name() + ':' +
-                                               tree_field_children[0].id() + ':' +
-                                               tree_field_children[0].intra_doc_id() +
-                                               '.ischanged = 1\n');
-                               }
-                               continue;
-                       }
-
-mw.sdump('D_CAT','2nd find =========================================\n')
-                       var tree_tag = find_element_with_id(tree_field_children,id1);
-mw.sdump('D_CAT','3rd find =========================================\n')
-                       var tree_value = find_element_with_id(tree_field_children,id2);
-                       if (tree_tag == null) { alert('tree_tag problem!'); }
-                       if (tree_value == null) { alert('tree_value problem!'); }
-                       if (tree_field_children[tree_tag].value() != col1.value) {
-                               tree_field_children[tree_tag].value(col1.value);
-                               tree_field_children[tree_tag].ischanged(1);
-                               mw.sdump('D_CAT', tree_field_children[tree_tag].name() + ':' +
-                                       tree_field_children[tree_tag].id() + ':' +
-                                       tree_field_children[tree_tag].intra_doc_id() +
-                                       '.ischanged = 1\n');
-                       }
-                       if (tree_field_children[tree_value].value() != col2.value) {
-                               tree_field_children[tree_value].value(col2.value);
-                               tree_field_children[tree_value].ischanged(1);
-                               mw.sdump('D_CAT', tree_field_children[tree_value].name() + ':' +
-                                       tree_field_children[tree_value].id() + ':' +
-                                       tree_field_children[tree_value].intra_doc_id() +
-                                       '.ischanged = 1\n');
-                       }
-               }
-       }
-       var data_rows = document.getElementById('data_rows').childNodes;
-       for (var r = 0; r < data_rows.length ; r++ ) {
-               var tag_node_id;
-               try {
-                       tag_node_id = data_rows[r].getAttribute('mynode');
-               } catch(E) {
-                       continue;
-               }
-               //mw.sdump('D_CAT', r + ':' + data_rows[r].tagName + ':' + tag_node_id + '\n' );
-               if (tag_node_id) {
-mw.sdump('D_CAT','Processing data_rows[' + r + '], tag_node_id = ' + tag_node_id + '\n');
-                       if (tag_node_id < 0) { continue; } // new node, handle elsewhere
-mw.sdump('D_CAT','4th find =========================================\n')
-                       var tree_pos = find_element_with_id(tree_fields,tag_node_id);
-                       if (tree_pos == null) { alert('tree_pos problem!'); }
-                       var tree_field = tree_fields[tree_pos];
-
-                       if (data_rows[r].getAttribute('hidden') == 'true') {
-                               tree_field.isdeleted(1);
-                               mw.sdump('D_CAT',tree_field.name() + ':' +
-                                       tree_field.id() + ':' +
-                                       tree_field.intra_doc_id() +
-                                       '.isdeleted = 1\n');
-                               delete_children(tree_field);
-                               continue;
-                       }
-
-                       var col1 = data_rows[r].childNodes[0].firstChild;
-                       var col2 = data_rows[r].childNodes[1].firstChild;
-                       var col3 = data_rows[r].childNodes[2].firstChild;
-                       var col4 = data_rows[r].childNodes[3].firstChild;
-                       var id1 = col1.getAttribute('mynode');
-                       var id2 = col2.getAttribute('mynode');
-                       var id3 = col3.getAttribute('mynode');
-                       var id4 = col4.getAttribute('mynode');
-                       var tree_field_children = tree_field.children(); // LEVEL 2
-mw.sdump('D_CAT','5th find =========================================\n')
-                       var tree_tag = find_element_with_id(tree_field_children,id1);
-mw.sdump('D_CAT','6th find =========================================\n')
-                       var tree_ind1 = find_element_with_id(tree_field_children,id2);
-mw.sdump('D_CAT','7th find =========================================\n')
-                       var tree_ind2 = find_element_with_id(tree_field_children,id3);
-mw.sdump('D_CAT','8th find =========================================\n')
-                       var tree_data = find_element_with_id(tree_field_children,id4);
-                       if (tree_tag == null) { alert('tree_tag problem!'); }
-                       if (tree_ind1 == null) { alert('tree_ind1 problem!'); }
-                       if (tree_ind2 == null) { alert('tree_ind2 problem!'); }
-                       if (tree_data == null) { alert('tree_data problem!'); }
-                       if (tree_field_children[tree_tag].value() != col1.value) {
-                               tree_field_children[tree_tag].value(col1.value);
-                               tree_field_children[tree_tag].ischanged(1);
-                               mw.sdump('D_CAT', tree_field_children[tree_tag].name() + ':' +
-                                       tree_field_children[tree_tag].id() + ':' +
-                                       tree_field_children[tree_tag].intra_doc_id() +
-                                       '.is_changed = 1\n');
-                       }
-                       if (tree_field_children[tree_ind1].value() != col2.value) {
-                               tree_field_children[tree_ind1].value(col2.value);
-                               tree_field_children[tree_ind1].ischanged(1);
-                               mw.sdump('D_CAT', tree_field_children[tree_ind1].name() + ':' +
-                                       tree_field_children[tree_ind1].id() + ':' +
-                                       tree_field_children[tree_ind1].intra_doc_id() +
-                                       '.is_changed = 1\n');
-                       }
-                       if (tree_field_children[tree_ind2].value() != col3.value) {
-                               tree_field_children[tree_ind2].value(col3.value);
-                               tree_field_children[tree_ind2].ischanged(1);
-                               mw.sdump('D_CAT', tree_field_children[tree_ind2].name() + ':' +
-                                       tree_field_children[tree_ind2].id() + ':' +
-                                       tree_field_children[tree_ind2].intra_doc_id() +
-                                       '.is_changed = 1\n');
-                       }
-                       process_subfields(tree_field_children,col4.value); // LEVEL 3
-               }
-       }
-
-
-       // 2) inserts
-mw.sdump('D_CAT','Inserts\n');
-
-       for (var r = 0; r < ctrl_rows.length ; r++) {
-               var newnode;
-               try {
-                       newnode = ctrl_rows[r].getAttribute('newnode');
-               } catch(E) {
-                       continue;
-               }
-               if (newnode=='true') {
-mw.sdump('D_CAT','New node = ctrl_rows[' + r + ']');
-                       if (ctrl_rows[r].getAttribute('hidden')=='true') { continue; }
-                       var col1 = ctrl_rows[r].childNodes[0].firstChild.value;
-                       var col2 = ctrl_rows[r].childNodes[1].firstChild.value;
-                       var level1 = new brn(); 
-                               populate_node( level1, 1, 'controlfield' );
-                       var level2a = new brn(); 
-                               populate_node( level2a, 2, 'tag' );
-                               level2a.value(col1);
-                       var level2b = new brn();
-                               populate_node( level2b, 3, null );
-                               level2b.value(col2);
-                       level1.children([ level2a, level2b ]);
-                       ctrl_rows[r].setAttribute('mynode', level1.intra_doc_id());
-mw.sdump('D_CAT',' with intra_doc_id = ' + level1.intra_doc_id() + '\n');
-                       insert_into_tree(tree.children(),ctrl_rows[r],level1);
-               }
-       }
-
-       for (var r = 0; r < data_rows.length ; r++) {
-               var newnode;
-               try {
-                       newnode = data_rows[r].getAttribute('newnode');
-               } catch(E) {
-                       continue;
-               }
-               if (newnode=='true') {
-mw.sdump('D_CAT','New node = data_rows[' + r + ']');
-                       if (data_rows[r].getAttribute('hidden')=='true') { continue; }
-                       var col1 = data_rows[r].childNodes[0].firstChild.value;
-                       var col2 = data_rows[r].childNodes[1].firstChild.value;
-                       var col3 = data_rows[r].childNodes[2].firstChild.value;
-                       var col4 = data_rows[r].childNodes[3].firstChild.value;
-                       var level1 = new brn(); 
-                               populate_node( level1, 1, 'datafield' );
-                       var level2a = new brn(); 
-                               populate_node( level2a, 2, 'tag' );
-                               level2a.value(col1);
-                       var level2b = new brn();
-                               populate_node( level2b, 2, 'ind1' );
-                               level2b.value(col2);
-                       var level2c = new brn();
-                               populate_node( level2c, 2, 'ind2' );
-                               level2c.value(col3);
-                       level1.children([ level2a, level2b, level2c ]);
-                       process_subfields(level1.children(),col4);
-                       data_rows[r].setAttribute('mynode', level1.intra_doc_id());
-mw.sdump('D_CAT',' with intra_doc_id = ' + level1.intra_doc_id() + '\n');
-                       insert_into_tree(tree.children(),data_rows[r],level1);
-               }
-
-       }
-       //mw.sdump('D_CAT','******\nSending: ' + pretty_print(js2JSON(tree)) + '\n');
-       mw.sdump('D_CAT','Auth session: ' + mw.G['auth_ses'][0] + '\n');
-       try {
-               if (params.import_tree) {
-
-                       if (params.new_tree) {
-                               tree = user_request(
-                                       'open-ils.cat',
-                                       'open-ils.cat.biblio.record_tree.create',
-                                       [ mw.G.auth_ses[0], tree ]
-                               )[0];
-                       } else {
-                               tree = user_request(
-                                       'open-ils.cat',
-                                       'open-ils.cat.biblio.record.tree.import',
-                                       [ mw.G['auth_ses'][0], tree ]
-                               )[0];
-                       }
-               } else {
-                       tree = user_request(
-                                       'open-ils.cat',
-                                       'open-ils.cat.biblio.record.tree.commit',
-                                       [ mw.G['auth_ses'][0], tree ]
-                       )[0];
-               }
-               if (typeof(tree) == 'object') {
-                       mw.sdump('D_CAT','\n\n\n\nnew tree = ' + js2JSON(tree) + '\n');
-                       params.import_tree = false;
-                       new_node_id = -1;
-                       empty_grid('ctrl_rows','data_rows');
-                       build_grid( 
-                               document.getElementById('ctrl_rows'), 
-                               document.getElementById('data_rows'), 
-                               tree
-                       );
-                       handle_tag_change();
-                       my_resize_handler();
-                       alert('MARC record successfully updated.');
-               } else {
-                       throw('result: ' + tree + '\n');
-               }
-       } catch(E) {
-               mw.sdump('D_CAT','backup_tree\n');
-               tree = backup_tree;
-               handle_tag_change();
-               my_resize_handler();
-               handle_error(E);
-       }
-}
-
-function insert_into_tree(branch,r,n) {
-       var s = nextSibling_not_hidden(r);
-       if (s) {
-               mw.sdump('D_CAT','9th find =========================================\n')
-               mw.sdump('D_CAT','s = ' + s + '\n');
-               mw.sdump('D_CAT','s.getAttribute mynode = <' + s.getAttribute('mynode') + '>\n');
-               var pos = find_element_with_id(branch,s.getAttribute('mynode'));
-               branch.splice(pos,0,n);
-       } else {
-               branch.push(n);
-       }
-}
-
-var new_node_id = -1;
-function populate_node(node,ntype,name) {
-       node.intra_doc_id( new_node_id-- );
-       node.isnew( 1 );
-       node.node_type( ntype );
-       node.name( name );
-       mw.sdump('D_CAT', node.name() + ':' + node.intra_doc_id() + '.is_new = 1\n');
-}
-
-function process_subfields(tfc,datastring) {
-       mw.sdump('D_CAT','process_subfields: <' + tfc + '> <' + datastring + '>\n');
-       var orig_subfields = [];
-       //mw.sdump('D_CAT','\n');
-       for (var i in tfc) {
-               mw.sdump('D_CAT',i + ' : ' + typeof(tfc[i]) + ' : ' + js2JSON(tfc[i]) + ' : node_type() = ' + tfc[i].node_type() + '\n');
-               try {
-                       if (tfc[i].node_type() == 1) {
-                               var orig_data = tfc[i].children()[1].value();
-                               orig_data = orig_data.replace(/^\s+/,'').replace(/\s+$/,'');
-                               orig_subfields.push( [ 
-                                       i, // subfield node index
-                                       tfc[i].children()[0].value(), // subf indicator
-                                       orig_data // data
-                               ] );
-                       }
-
-               } catch(E) {
-                       mw.sdump('D_CAT','\tan error? gasp: ' + js2JSON(E) + '\n');
-                       continue;
-               }
-       }
-       datastring = datastring.replace(/^\s+/,'').replace(/\s+$/,'');
-       var local_subf_array = datastring.split(String.fromCharCode(8225));
-       // Our validation routines should assert that the beginning of
-       // a data string start with the subfield delimiter symbol.  We're
-       // passing the buck of the 'implicit' subfield-a check elsewhere.
-       local_subf_array.shift();
-       mw.sdump('D_CAT','orig_subfields = ' + js2JSON(orig_subfields) + '\n');
-       mw.sdump('D_CAT','local_subfields = ' + js2JSON(local_subf_array) + '\n');
-       for (var i in local_subf_array) {
-               if ((local_subf_array[i]=='')||(local_subf_array==null)) { continue; }
-               var s_ind = local_subf_array[i].substr(0,1);
-               var s_data = local_subf_array[i].substr(1).replace(/^\s+/,'').replace(/\s+$/,'');
-               mw.sdump('D_CAT','Processing code = ' + s_ind + ' and value = ' + s_data + '\n');
-               if (!orig_subfields[i]) { // new subfield
-                       mw.sdump('D_CAT','making new subfield : i = ' + i + '\n');
-                       var level1 = new brn(); 
-                               populate_node( level1, 1, 'subfield' );
-                       var level2a = new brn(); 
-                               populate_node( level2a, 2, 'code' );
-                               level2a.value(s_ind);
-                       var level2b = new brn();
-                               populate_node( level2b, 3, null );
-                               level2b.value(s_data);
-                       level1.children([ level2a, level2b ]);
-                       tfc.push(level1);
-                       mw.sdump('D_CAT','New node = ' + js2JSON(level1) + '\n');
-               } else {
-                       var orig_node = orig_subfields[i][0];
-                       var orig_ind = orig_subfields[i][1];
-                       var orig_data = orig_subfields[i][2];
-                       if (orig_ind != s_ind) { // update subf indicator
-                               tfc[orig_node].children()[0].value(s_ind);
-                               tfc[orig_node].children()[0].ischanged(1);
-                               mw.sdump('D_CAT', tfc[orig_node].children()[0].name() + ':' +
-                                       tfc[orig_node].children()[0].id() + ':' +
-                                       tfc[orig_node].children()[0].intra_doc_id() +
-                                       '.is_changed = 1\n');
-                       mw.sdump('D_CAT','Updated node = ' + js2JSON(tfc[orig_node].children()[0]) + '\n');
-                       }
-                       if (orig_data != s_data) { // update subf data
-                               tfc[orig_node].children()[1].value(s_data);
-                               tfc[orig_node].children()[1].ischanged(1);
-                               mw.sdump('D_CAT', tfc[orig_node].children()[1].name() + ':' +
-                                       tfc[orig_node].children()[1].id() + ':' +
-                                       tfc[orig_node].children()[1].intra_doc_id() +
-                                       '.is_changed = 1\n');
-                       mw.sdump('D_CAT','Updated node = ' + js2JSON(tfc[orig_node].children()[1]) + '\n');
-                       }
-               }
-       }
-       // delete any remaining
-       for (var i = local_subf_array.length; i < orig_subfields.length; i++) {
-               var orig_node = orig_subfields[i][0];
-               tfc[orig_node].isdeleted(1);
-               mw.sdump('D_CAT', tfc[orig_node].name() + ':' +
-                       tfc[orig_node].id() + ':' +
-                       tfc[orig_node].intra_doc_id() + '.is_deleted = 1\n');
-               delete_children(tfc[orig_node]);
-       }
-}
-
-
-
-function test_nodeset() {
-       return null;
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/marc.xul
deleted file mode 100644 (file)
index 3fded65..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's MARC Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/marc.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<window id="marc_win" title="&cat.title;" 
-       orient="vertical" style="overflow: scroll" 
-       width="800" height="600" persist="width height"
-       onload="
-               my_init();
-       "
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/marc_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="marc_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="marc_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="marc_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="marc_vbox" class="test_class"/>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc_fixed.js b/Evergreen/staff_client/chrome/content/evergreen/cat/marc_fixed.js
deleted file mode 100644 (file)
index 220710e..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-function pad_fixed(value,field) {
-       var padding = '';
-       if (field == '008') {
-               for (var i = value.length; i<40; i++) {
-                       padding = padding + ' ';
-               }
-       } else if (field == 'LDR') {
-               for (var i = value.length; i<24; i++) {
-                       padding = padding + ' ';
-               }
-       }
-       return padding;
-}
-
-
-function handle_fixed_change(ev) {
-       mw.sdump('D_CAT','Entering handle_fixed_change\n');
-       if (ev.target.tagName != 'textbox') { mw.sdump('D_CAT','early exit\n'); return; }
-       var t = ev.target;
-       var field = t.getAttribute('field');
-       var spos = t.getAttribute('spos');
-       var epos = t.getAttribute('epos');
-       var size = t.getAttribute('size');
-       if ( (epos - spos + 1) != size ) { 
-               mw.sdump('D_CAT','Invalid fixed field DTD: field='+field+' spos='+spos+
-                       ' epos='+epos+' size='+size+'\n');
-               alert('Invalid fixed field DTD: field='+field+' spos='+spos+
-                       ' epos='+epos+' size='+size+'\n');
-       }
-       if (t.value.length > size) {
-               t.value = t.value.substr(0,size);
-       } else if (t.value.length < size) {
-               var padding = '';
-               for (var i = 0; i<(size-t.value.length); i++) {
-                       padding = padding + ' ';
-               }
-               t.value = t.value + padding;
-       }
-       var fixed = find_textbox('ctrl_rows', field);
-       //mw.sdump('D_CAT','length of fixed: ' + fixed.value.length + '\n');
-       fixed.value = fixed.value + pad_fixed(fixed.value,field);
-       mw.sdump('D_CAT','length of fixed: ' + fixed.value.length + '\n');
-
-       //mw.sdump('D_CAT','field='+field+' spos='+spos+' epos='+epos+' size='+size+' t="'+t.value+'"\n');
-       mw.sdump('D_CAT','replacing "'+fixed.value+'"\n');
-       fixed.value = fixed.value.substr(0,spos) + t.value + fixed.value.substr(1+Number(epos));
-       mw.sdump('D_CAT','     with "'+fixed.value+'"\n');
-}
-
-function find_textbox(where, field) {
-       var rows = document.getElementById(where).childNodes;
-       var ideal_sibling;
-       for (var r in rows) {
-               if (typeof(rows[r])=='object') {
-                       //mw.sdump('D_CAT',r + ':' + rows[r] + '\n');
-                       var t = rows[r].childNodes[0].firstChild;
-                       if (t.value == field) {
-                               return rows[r].childNodes[1].firstChild;
-                       } else if (t.value < field) {
-                               ideal_sibling = rows[r];
-                       }
-               }
-       }
-       var new_r = build_ctrl_row('ctrl_' + new_row_id--);
-       new_r.setAttribute('notempty','true');                  
-       new_r.setAttribute('newnode','true');
-       if (ideal_sibling.nextSibling) {
-               rows.insertBefore(new_r,ideal_sibling.nextSibling);
-       } else {
-               rows.appendChild(new_r);
-       }
-       new_r.childNodes[0].firstChild.value = field;
-       new_r.childNodes[1].firstChild.value = padding;
-       return new_r.childNodes[1].firstChild;
-}
-
-function fixed_fields_update_all(grid) {
-       var g = document.getElementById(grid);
-       var nl = g.getElementsByTagName('textbox');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       var t = nl[i];
-                       var field = t.getAttribute('field');
-                       var spos = t.getAttribute('spos');
-                       var epos = t.getAttribute('epos');
-                       var size = t.getAttribute('size');
-                       var data = find_textbox('ctrl_rows',field);
-                       data.value = data.value + pad_fixed(data.value,field);
-                       t.value = data.value.substr(spos,size);
-               }
-       }
-}
-
-
-function fixed_fields_hide_all(grid) {
-       var g = document.getElementById(grid);
-       var nl = g.getElementsByTagName('label');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       nl[i].setAttribute('hidden','true');
-               }
-       }
-       nl = g.getElementsByTagName('textbox');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       nl[i].setAttribute('hidden','true');
-               }
-       }
-}
-
-function fixed_fields_show_all(grid) {
-       var g = document.getElementById(grid);
-       var nl = g.getElementsByTagName('label');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       nl[i].setAttribute('hidden','false');
-               }
-       }
-       nl = g.getElementsByTagName('textbox');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       nl[i].setAttribute('hidden','false');
-               }
-       }
-}
-
-function fixed_fields_show_only(grid,attr) {
-       fixed_fields_hide_all(grid);
-       fixed_fields_update_all(grid);
-       var g = document.getElementById(grid);
-       var nl = g.getElementsByTagName('label');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       if (nl[i].getAttribute(attr) == 'true') {
-                               nl[i].setAttribute('hidden','false');
-                       }
-               }
-       }
-       nl = g.getElementsByTagName('textbox');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       if (nl[i].getAttribute(attr) == 'true') {
-                               nl[i].setAttribute('hidden','false');
-                       }
-               }
-       }
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc_keys.js b/Evergreen/staff_client/chrome/content/evergreen/cat/marc_keys.js
deleted file mode 100644 (file)
index 6deb8d6..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-function handle_keyup(ev) {
-       if (ev.target.tagName != 'textbox') { return; }
-       //mw.sdump('D_CAT','keyCode:' + ev.keyCode + ' charCode:' + ev.charCode + ' shift:' + ev.shiftKey + ' ctrl:' + ev.ctrlKey + ' meta:' + ev.metaKey + '\n');
-       resizeWrapper(ev.target);
-}
-
-function handle_keypress(ev) {
-       mw.sdump('D_CAT','keyCode:' + ev.keyCode + ' charCode:' + ev.charCode + ' shift:' + ev.shiftKey + ' ctrl:' + ev.ctrlKey + ' meta:' + ev.metaKey + '\n');
-       if (ev.target.tagName != 'textbox') { return; }
-       var rstatus = false;
-       if (ev.charCode) {
-               switch(ev.charCode) {
-                       case 100: 
-                               if (ev.ctrlKey) { /* control+d */
-                                       rstatus = handle_key_c_d(ev);
-                               }
-                               break;
-               }
-       } else if (ev.keyCode) {
-               switch(ev.keyCode) {
-                       case 13: /* enter */
-                       case 77: /* mac enter */
-                               rstatus = handle_key_enter(ev);
-                               break;
-                       case 46: 
-                               if (ev.ctrlKey) { /* control+del */
-                                       rstatus = handle_key_c_del(ev);
-                               }
-                               break;
-                       case 9: 
-                               if (ev.shiftKey) { /* shift+tab */
-                                       rstatus = navigate_col_left(ev.target,true);
-                               } else { /* tab */
-                                       rstatus = navigate_col_right(ev.target,true);
-                               }
-                               break;
-               }
-       }
-       resizeWrapper(ev.target);
-       if (rstatus) {
-               ev.preventDefault();
-       }
-       return rstatus;
-}
-
-function handle_key_c_d(ev) {
-       if (ev.target.tagName != 'textbox') { return; }
-       var t = ev.target;
-       if ((ev.ctrlKey)&&(ev.charCode==100)&&(t.getAttribute('subfields')=='true')) {
-               var n_ev = document.createEvent("KeyEvents");
-               if (n_ev) { /* the best way... fake a keypress */
-                       n_ev.initKeyEvent("keypress", 1, 1, null, 0, 0, 0, 0, 0, 8225);
-                       t.inputField.dispatchEvent(n_ev);
-               } else { /* this destroys the widget's undo buffer */
-                       var s_start = t.selectionStart; var s_end = t.selectionEnd;
-                       var first_half = t.value.substr(0,s_start);
-                       var second_half = t.value.substr(s_end);
-                       t.value = first_half + String.fromCharCode(8225) + second_half;
-                       t.setSelectionRange(s_start+1,s_start+1);
-               }
-               return true;
-       } else {
-               return false;
-       }
-}
-
-function handle_key_c_del(ev) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       if (ev.target.tagName != 'textbox') { return; }
-       var t = ev.target;
-       var r = t.parentNode.parentNode;
-       if ((ev.ctrlKey)&&(ev.keyCode==46)) {
-               r.setAttribute('hidden','true');
-               handle_tag_change(ev);
-               if (! navigate_row_down(t,which_col_am_i(t),false) ) {
-                       navigate_row_up(t,which_col_am_i(t),false);
-                       mw.sdump('D_CAT',"let's go up\n");
-               }
-               return true;
-       } else {
-               return false;
-       }
-}
-
-var new_row_id = -1;
-function handle_key_enter(ev) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       if (ev.target.tagName != 'textbox') { return; }
-       var t = ev.target; 
-       if ((ev.keyCode == 13) || (ev.keyCode == 77)) {
-               if (ev.ctrlKey) { // add new row
-                       var new_r = build_data_row('data_' + new_row_id--);
-                       new_r.setAttribute('notempty','true');                  
-                       new_r.setAttribute('newnode','true');                   
-                       var w = t.parentNode;
-                       var r = w.parentNode;
-                       var rows = r.parentNode;
-                       var sibling_row;
-                       if (ev.shiftKey) {
-                               sibling_row = r;
-                       } else {
-                               sibling_row = r.nextSibling;
-                       }
-                       if (sibling_row) {
-                               rows.insertBefore(new_r,sibling_row);
-                       } else {
-                               rows.appendChild(new_r);
-                       }
-                       var c = new_r.childNodes;
-                       apply_event_listeners(c,'data');
-                       c[1].firstChild.value = ' '; // indicator 1
-                       c[2].firstChild.value = ' '; // indicator 2
-                       c[0].firstChild.focus();
-                       return true;
-               } else { // move to next row
-                       navigate_row_down(t,which_col_am_i(t),true);
-                       return true;
-               }
-       } else {
-               return false;
-       }
-}
-
-function which_col_am_i(t) {
-       var r = t.parentNode.parentNode;
-       for (var i in r.childNodes) {
-               if (t == r.childNodes[i].firstChild) {
-                       return i;
-               }
-       }
-}
-
-function nextSibling_not_hidden(e) {
-       var s = e.nextSibling;
-       while ((s)&&(s.getAttribute('hidden')=='true')) {
-               s = s.nextSibling;
-       }
-       return s;
-}
-
-function previousSibling_not_hidden(e) {
-       var s = e.previousSibling;
-       while ((s)&&(s.getAttribute('hidden')=='true')) {
-               s = s.previousSibling;
-       }
-       return s;
-}
-
-function navigate_row_down(t,c,wrap) {
-       // rows -> row (r) -> wrapper -> textbox (t)
-       var r = t.parentNode.parentNode;
-       var sibling_row = nextSibling_not_hidden(r);
-       if (sibling_row) {
-               sibling_row.childNodes[c].firstChild.focus();
-               if (c == 0) {
-                       sibling_row.childNodes[c].firstChild.select();
-               }
-       } else {
-               if (wrap) {
-                       r.parentNode.firstChild.childNodes[c].firstChild.focus();
-               } else {
-                       return false;
-               }
-       }
-       return true;
-}
-
-function navigate_row_up(t,c,wrap) {
-       // rows -> row (r) -> wrapper -> textbox (t)
-       var r = t.parentNode.parentNode;
-       var sibling_row = previousSibling_not_hidden(r);
-       if (sibling_row) {
-               sibling_row.childNodes[c].firstChild.focus();
-       } else {
-               if (wrap) {
-                       r.parentNode.lastChild.childNodes[c].firstChild.focus();
-               } else {
-                       return false;
-               }
-       }
-       return true;
-}
-
-function navigate_col_left(t,wrap) {
-       // rows -> row -> wrapper (w) -> textbox (t)
-       var w = t.parentNode;
-       var sibling_wrapper = w.previousSibling;
-       if (sibling_wrapper) {
-               sibling_wrapper.firstChild.focus();
-               if (sibling_wrapper.parentNode.childNodes[3] != sibling_wrapper) {
-                       sibling_wrapper.firstChild.select();
-               }
-       } else {
-               if (wrap) {
-                       return navigate_row_up(t,3,false);
-               } else {
-                       return false;
-               }
-       }
-       return true;
-}
-
-function navigate_col_right(t,wrap) {
-       // rows -> row -> wrapper (w) -> textbox (t)
-       var w = t.parentNode;
-       var sibling_wrapper = w.nextSibling;
-       if (sibling_wrapper) {
-               sibling_wrapper.firstChild.focus();
-               if (sibling_wrapper.parentNode.childNodes[3] != sibling_wrapper) {
-                       sibling_wrapper.firstChild.select();
-               }
-       } else {
-               if (wrap) {
-                       return navigate_row_down(t,0);
-               } else {
-                       return false;
-               }
-       }
-       return true;
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/marc_overlay.xul
deleted file mode 100644 (file)
index 3b1a5ce..0000000
+++ /dev/null
@@ -1,930 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="marc_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="marc_js">
-       <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
-       <!--<script src="chrome://evergreen/content/util/RemoteRequest.js" />
-       <script src="chrome://evergreen/content/util/ses.js" />-->
-       <util id="util_js"/>
-       <script src="marc_rules.js" />
-       <script src="marc_validate.js" />
-       <script src="marc_fixed.js" />
-       <script src="marc_keys.js" />
-       <script src="marc.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="marc_cmds">
-       <command id="cmd_marc_validate" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               validate_marc();
-       "/>
-       <command id="cmd_marc_explain" oncommand="
-               explain_marc();
-       "/>
-       <command id="cmd_marc_submit" oncommand="
-               submit_marc();
-       "/>
-       <command id="cmd_marc_reload" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               reload_marc();
-       "/>
-       <command id="cmd_marc_export" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               export_marc();
-       "/>
-       <command id="cmd_marc_legend" oncommand="
-               legend_marc();
-       "/>
-       <command id="cmd_close_window" oncommand="
-               mw.close_tab(app_shell,'main_tabbox');
-       "/>
-       <command id="cmd_marc_fixed_BKS" oncommand="
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','BKS');
-       "/>
-       <command id="cmd_marc_fixed_SER" oncommand="
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','SER');
-       "/>
-       <command id="cmd_marc_fixed_VIS" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','VIS');
-       "/>
-       <command id="cmd_marc_fixed_MIX" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','MIX');
-       "/>
-       <command id="cmd_marc_fixed_MAP" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','MAP');
-       "/>
-       <command id="cmd_marc_fixed_SCO" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','SCO');
-       "/>
-       <command id="cmd_marc_fixed_REC" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','REC');
-       "/>
-       <command id="cmd_marc_fixed_COM" disabled="true" oncommand="
-               alert('Feature Not Yet Implemented');
-               document.getElementById('ctrl_deck').setAttribute('selectedIndex',0);
-               fixed_fields_show_only('fixed_grid','COM');
-       "/>
-       <command id="cmd_marc_control_fields" oncommand="
-               var deck = document.getElementById('data_deck');
-               if (deck.getAttribute('selectedIndex') == '1') {
-                       deck.setAttribute('selectedIndex','0');
-               } else {
-                       deck.setAttribute('selectedIndex','1');
-               }
-       "/>
-       <command id="cmd_marc_cover_art" oncommand="
-               var box = document.getElementById('art_groupbox');
-               if (box.getAttribute('hidden') == 'true') {
-                       box.setAttribute('hidden','false');
-               } else {
-                       box.setAttribute('hidden','true');
-               }
-       "/>
-       <command id="cmd_marc_meta_data" oncommand="
-               var box = document.getElementById('meta_groupbox');
-               if (box.getAttribute('hidden') == 'true') {
-                       box.setAttribute('hidden','false');
-               } else {
-                       box.setAttribute('hidden','true');
-               }
-       "/>
-
-</commandset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="marc_vbox" flex="1">
-       <toolbox id="marc_toolbox"/>
-<!--   <deck id="meta_deck"/>
-       <splitter collapse="before"> <grippy/> </splitter> -->
-       <deck id="ctrl_deck"/>
-       <splitter collapse="before"> <grippy/> </splitter>
-       <deck id="data_deck"/>
-       <hbox id="marc_buttons_box"/>
-</vbox>
-
-<hbox id="marc_buttons_box" class="marc_buttons_box">
-       <button label="&marc.file.close;" accesskey="&marc.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
-       <button label="&marc.file.reload;" accesskey="&marc.file.reload.key;" key="file-reload-key" observes="cmd_marc_reload"/>
-       <button label="&marc.file.publish;" accesskey="&marc.file.publish.key;" key="file-publish-key" observes="cmd_marc_submit"/>
-</hbox>
-
-<!-- The main top level menubar -->
-<toolbox id="marc_toolbox">
-       <menubar id="marc_menubar">
-               <menu id="marc-file" label="&marc.file;" accesskey="&marc.file.key;"/>
-               <menu id="marc-display" label="&marc.display;" accesskey="&marc.display.key;"/>
-       </menubar>
-</toolbox>
-
-<!-- The File menu on the marc menu -->
-<menu id="marc-file">
-       <menupopup id="marc-popup">
-               <menuitem label="&marc.file.validate;" accesskey="&marc.file.validate.key;" key="file-validate-key" observes="cmd_marc_validate"/>
-               <menuseparator />
-               <menuitem label="&marc.file.reload;" accesskey="&marc.file.reload.key;" key="file-reload-key" observes="cmd_marc_reload"/>
-               <menuitem label="&marc.file.export;" accesskey="&marc.file.export.key;" key="file-export-key" observes="cmd_marc_export"/>
-               <menuitem label="&marc.file.publish;" accesskey="&marc.file.publish.key;" key="file-publish-key" observes="cmd_marc_submit"/>
-               <menuseparator />
-               <menuitem label="&marc.file.close;" accesskey="&marc.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
-       </menupopup>
-</menu>
-
-<!-- The Display menu on the marc menu -->
-<menu id="marc-display">
-       <menupopup id="display-popup">
-               <menuitem id="explain_marc" label="&marc.display.explain;" accesskey="&marc.display.explain.key;" key="display-explain-key" observes="cmd_marc_explain"/>
-               <menuitem label="&marc.display.legend;" accesskey="&marc.display.legend.key;" key="file-legend-key" observes="cmd_marc_legend"/>
-               <menuseparator />
-               <menuitem label="&marc.display.cover_art;" accesskey="&marc.display.cover_art.key;" key="file-cover-art-key" observes="cmd_marc_cover_art"/>
-               <menuitem label="&marc.display.meta_data;" accesskey="&marc.display.meta_data.key;" key="file-meta-data-key" observes="cmd_marc_meta_data"/>
-               <menuitem label="&marc.display.control_fields;" accesskey="&marc.display.control_fields.key;" key="file-control-fields-key" observes="cmd_marc_control_fields"/>
-               <menuseparator />
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.BKS;" accesskey="&marc.display.fixed.BKS.key;" key="file-fixed-BKS-key" observes="cmd_marc_fixed_BKS"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.SER;" accesskey="&marc.display.fixed.SER.key;" key="file-fixed-SER-key" observes="cmd_marc_fixed_SER"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.VIS;" accesskey="&marc.display.fixed.VIS.key;" key="file-fixed-VIS-key" observes="cmd_marc_fixed_VIS"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.MIX;" accesskey="&marc.display.fixed.MIX.key;" key="file-fixed-MIX-key" observes="cmd_marc_fixed_MIX"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.MAP;" accesskey="&marc.display.fixed.MAP.key;" key="file-fixed-MAP-key" observes="cmd_marc_fixed_MAP"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.SCO;" accesskey="&marc.display.fixed.SCO.key;" key="file-fixed-SCO-key" observes="cmd_marc_fixed_SCO"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.REC;" accesskey="&marc.display.fixed.REC.key;" key="file-fixed-REC-key" observes="cmd_marc_fixed_REC"/>
-               <menuitem type="radio" name="fixed_field_display" label="&marc.display.fixed.COM;" accesskey="&marc.display.fixed.COM.key;" key="file-fixed-COM-key" observes="cmd_marc_fixed_COM"/>
-       </menupopup>
-</menu>
-
-<deck id="meta_deck" flex="0">
-</deck>
-
-<deck id="ctrl_deck" flex="1">
-       <hbox flex="1">
-               <groupbox id="art_groupbox" hidden="true"/>
-               <vbox flex="1" style="overflow: auto;">
-                       <groupbox id="meta_groupbox"/>
-                       <groupbox id="fixed_groupbox"/>
-               </vbox>
-       </hbox>
-</deck>
-
-<deck id="data_deck" flex="1">
-       <groupbox id="data_groupbox"/>
-       <groupbox id="ctrl_groupbox"/>
-       <groupbox id="help_groupbox"/>
-</deck>
-
-<groupbox id="meta_groupbox" flex="1" hidden="true">
-       <caption label="&marc.groupbox.meta;"/>
-       <grid id="meta_grid"/>
-</groupbox>
-
-<groupbox id="data_groupbox"> 
-       <caption label="&marc.groupbox.data;"/>
-       <grid id="data_grid"/>
-</groupbox>
-
-<groupbox id="ctrl_groupbox">
-       <caption label="&marc.groupbox.control;"/>
-       <grid id="ctrl_grid"/>
-</groupbox>
-
-<groupbox id="fixed_groupbox">
-       <caption label="&marc.groupbox.fixed;"/>
-       <grid id="fixed_grid"/>
-</groupbox>
-
-<groupbox id="art_groupbox">
-       <caption label="&marc.groupbox.cover;"/>
-       <image src="chrome://evergreen/content/images/noimage.jpg"/>
-</groupbox>
-
-<grid id="meta_grid" flex="1" class="meta_grid">
-       <columns class="fixed_columns">
-               <column/> 
-               <column flex="1"/> 
-               <column/> <column /> <column/> <column />
-       </columns>
-       <rows>
-               <row id="meta_row1"/>
-               <row id="meta_row2"/>
-       </rows>
-</grid>
-               
-<row id="meta_row1">
-       <label value="Title/Author"/>
-       <description id="meta_title_author"/>
-       <label value="Creation Date"/>
-       <label id="meta_create_date"/>
-       <label value="Created By"/>
-       <label id="meta_creator"/>
-</row>
-<row id="meta_row2">
-       <label value="TCN/Publisher/etc"/>
-       <label id="meta_tcn_publisher"/>
-       <label value="Modification Date"/>
-       <label id="meta_edit_date"/>
-       <label value="Last Modified By"/>
-       <label id="meta_editor"/>
-</row>
-
-<grid id="fixed_grid" flex="1" class="fixed_grid">
-       <columns class="fixed_columns">
-               <column/> <column flex="1"/> <column/> <column flex="1"/>
-               <column/> <column flex="1"/> <column/> <column flex="1"/>
-               <column/> <column flex="1"/> <column/> <column flex="1"/>
-       </columns>
-       <rows class="fixed_rows">
-               <row id="fixed_row1" class="fixed_row"/>
-               <row id="fixed_row2" class="fixed_row"/>
-               <row id="fixed_row3" class="fixed_row"/>
-               <row id="fixed_row4" class="fixed_row"/>
-       </rows>
-</grid>
-
-<row id="fixed_row1">
-       <hbox>
-               <label 
-                       value="&marc.LDR.type.short;" 
-                       tooltiptext="&marc.LDR.type.desc;"
-                       onclick="window.open('&marc.LDR.type.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.LDR.type.field;"
-                       spos="&marc.LDR.type.field_start_pos;"
-                       epos="&marc.LDR.type.field_end_pos;"
-                       size="&marc.LDR.type.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.LDR.elvl.short;" 
-                       tooltiptext="&marc.LDR.elvl.desc;"
-                       onclick="window.open('&marc.LDR.elvl.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.LDR.elvl.field;"
-                       spos="&marc.LDR.elvl.field_start_pos;"
-                       epos="&marc.LDR.elvl.field_end_pos;"
-                       size="&marc.LDR.elvl.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.srce.short;" 
-                       tooltiptext="&marc.008.srce.desc;"
-                       onclick="window.open('&marc.008.srce.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.srce.field;"
-                       spos="&marc.008.srce.field_start_pos;"
-                       epos="&marc.008.srce.field_end_pos;"
-                       size="&marc.008.srce.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.VIS.SCO.REC.COM.audn.short;" 
-                       tooltiptext="&marc.008.BKS.VIS.SCO.REC.COM.audn.desc;"
-                       onclick="window.open('&marc.008.BKS.VIS.SCO.REC.COM.audn.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.BKS.SER.VIS.MAP.COM.gpub.short;" 
-                       tooltiptext="&marc.008.BKS.SER.VIS.MAP.COM.gpub.desc;"
-                       onclick="window.open('&marc.008.BKS.SER.VIS.MAP.COM.gpub.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.VIS.SCO.REC.COM.audn.field;"
-                       spos="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_start_pos;"
-                       epos="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_end_pos;"
-                       size="&marc.008.BKS.VIS.SCO.REC.COM.audn.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field;"
-                       spos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos;"
-                       epos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos;"
-                       size="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.LDR.ctrl.short;" 
-                       tooltiptext="&marc.LDR.ctrl.desc;"
-                       onclick="window.open('&marc.LDR.ctrl.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.LDR.ctrl.field;"
-                       spos="&marc.LDR.ctrl.field_start_pos;"
-                       epos="&marc.LDR.ctrl.field_end_pos;"
-                       size="&marc.LDR.ctrl.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.lang.short;" 
-                       tooltiptext="&marc.008.lang.desc;"
-                       onclick="window.open('&marc.008.lang.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.lang.field;"
-                       spos="&marc.008.lang.field_start_pos;"
-                       epos="&marc.008.lang.field_end_pos;"
-                       size="&marc.008.lang.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-</row>
-<row id="fixed_row2">
-       <hbox>
-               <label 
-                       value="&marc.LDR.blvl.short;" 
-                       tooltiptext="&marc.LDR.blvl.desc;"
-                       onclick="window.open('&marc.LDR.blvl.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.LDR.blvl.field;"
-                       spos="&marc.LDR.blvl.field_start_pos;"
-                       epos="&marc.LDR.blvl.field_end_pos;"
-                       size="&marc.LDR.blvl.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.SER.MIX.SCO.REC.form.short;" 
-                       tooltiptext="&marc.008.BKS.SER.MIX.SCO.REC.form.desc;"
-                       onclick="window.open('&marc.008.BKS.SER.MIX.SCO.REC.form.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.SER.MIX.SCO.REC.form.field;"
-                       spos="&marc.008.BKS.SER.MIX.SCO.REC.form.field_start_pos;"
-                       epos="&marc.008.BKS.SER.MIX.SCO.REC.form.field_end_pos;"
-                       size="&marc.008.BKS.SER.MIX.SCO.REC.form.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.SER.conf.short;" 
-                       tooltiptext="&marc.008.BKS.SER.conf.desc;"
-                       onclick="window.open('&marc.008.BKS.SER.conf.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.SER.conf.field;"
-                       spos="&marc.008.BKS.SER.conf.field_start_pos;"
-                       epos="&marc.008.BKS.SER.conf.field_end_pos;"
-                       size="&marc.008.BKS.SER.conf.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.biog.short;" 
-                       tooltiptext="&marc.008.BKS.biog.desc;"
-                       onclick="window.open('&marc.008.BKS.biog.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.freq.short;" 
-                       tooltiptext="&marc.008.SER.freq.desc;"
-                       onclick="window.open('&marc.008.SER.freq.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.biog.field;"
-                       spos="&marc.008.BKS.biog.field_start_pos;"
-                       epos="&marc.008.BKS.biog.field_end_pos;"
-                       size="&marc.008.BKS.biog.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.freq.field;"
-                       spos="&marc.008.SER.freq.field_start_pos;"
-                       epos="&marc.008.SER.freq.field_end_pos;"
-                       size="&marc.008.SER.freq.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.mrec.short;" 
-                       tooltiptext="&marc.008.mrec.desc;"
-                       onclick="window.open('&marc.008.mrec.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.mrec.field;"
-                       spos="&marc.008.mrec.field_start_pos;"
-                       epos="&marc.008.mrec.field_end_pos;"
-                       size="&marc.008.mrec.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.ctry.short;" 
-                       tooltiptext="&marc.008.ctry.desc;"
-                       onclick="window.open('&marc.008.ctry.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.ctry.field;"
-                       spos="&marc.008.ctry.field_start_pos;"
-                       epos="&marc.008.ctry.field_end_pos;"
-                       size="&marc.008.ctry.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-</row>
-
-<row id="fixed_row3">
-       <hbox>
-               <label 
-                       value="&marc.008.SER.succ.short;" 
-                       tooltiptext="&marc.008.SER.succ.desc;"
-                       onclick="window.open('&marc.008.SER.succ.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.SER.succ.field;"
-                       spos="&marc.008.SER.succ.field_start_pos;"
-                       epos="&marc.008.SER.succ.field_end_pos;"
-                       size="&marc.008.SER.succ.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.cont.short;" 
-                       tooltiptext="&marc.008.BKS.cont.desc;"
-                       onclick="window.open('&marc.008.BKS.cont.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.orig.short;" 
-                       tooltiptext="&marc.008.SER.orig.desc;"
-                       onclick="window.open('&marc.008.SER.orig.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.cont.field;"
-                       spos="&marc.008.BKS.cont.field_start_pos;"
-                       epos="&marc.008.BKS.cont.field_end_pos;"
-                       size="&marc.008.BKS.cont.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.orig.field;"
-                       spos="&marc.008.SER.orig.field_start_pos;"
-                       epos="&marc.008.SER.orig.field_end_pos;"
-                       size="&marc.008.SER.orig.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.SER.VIS.MAP.COM.gpub.short;" 
-                       tooltiptext="&marc.008.BKS.SER.VIS.MAP.COM.gpub.desc;"
-                       onclick="window.open('&marc.008.BKS.SER.VIS.MAP.COM.gpub.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.entw.short;" 
-                       tooltiptext="&marc.008.SER.entw.desc;"
-                       onclick="window.open('&marc.008.SER.entw.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field;"
-                       spos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos;"
-                       epos="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos;"
-                       size="&marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.entw.field;"
-                       spos="&marc.008.SER.entw.field_start_pos;"
-                       epos="&marc.008.SER.entw.field_end_pos;"
-                       size="&marc.008.SER.entw.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.litf.short;" 
-                       tooltiptext="&marc.008.BKS.litf.desc;"
-                       onclick="window.open('&marc.008.BKS.litf.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.regl.short;" 
-                       tooltiptext="&marc.008.SER.regl.desc;"
-                       onclick="window.open('&marc.008.SER.regl.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.litf.field;"
-                       spos="&marc.008.BKS.litf.field_start_pos;"
-                       epos="&marc.008.BKS.litf.field_end_pos;"
-                       size="&marc.008.BKS.litf.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.regl.field;"
-                       spos="&marc.008.SER.regl.field_start_pos;"
-                       epos="&marc.008.SER.regl.field_end_pos;"
-                       size="&marc.008.SER.regl.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.MAP.indx.short;" 
-                       tooltiptext="&marc.008.BKS.MAP.indx.desc;"
-                       onclick="window.open('&marc.008.BKS.MAP.indx.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.issn.short;" 
-                       tooltiptext="&marc.008.SER.issn.desc;"
-                       onclick="window.open('&marc.008.SER.issn.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.MAP.indx.field;"
-                       spos="&marc.008.BKS.MAP.indx.field_start_pos;"
-                       epos="&marc.008.BKS.MAP.indx.field_end_pos;"
-                       size="&marc.008.BKS.MAP.indx.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.issn.field;"
-                       spos="&marc.008.SER.issn.field_start_pos;"
-                       epos="&marc.008.SER.issn.field_end_pos;"
-                       size="&marc.008.SER.issn.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.SER.alph.short;" 
-                       tooltiptext="&marc.008.SER.alph.desc;"
-                       onclick="window.open('&marc.008.SER.alph.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.SER.alph.field;"
-                       spos="&marc.008.SER.alph.field_start_pos;"
-                       epos="&marc.008.SER.alph.field_end_pos;"
-                       size="&marc.008.SER.alph.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-</row>
-
-<row id="fixed_row4">
-       <hbox>
-               <label 
-                       value="&marc.LDR.desc.short;" 
-                       tooltiptext="&marc.LDR.desc.desc;"
-                       onclick="window.open('&marc.LDR.desc.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.LDR.desc.field;"
-                       spos="&marc.LDR.desc.field_start_pos;"
-                       epos="&marc.LDR.desc.field_end_pos;"
-                       size="&marc.LDR.desc.field_size;"
-                       BKS="true" SER="true" VIS="true" MIX="true" 
-                       MAP="true" SCO="true" REC="true" COM="true" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.ills.short;" 
-                       tooltiptext="&marc.008.BKS.ills.desc;"
-                       onclick="window.open('&marc.008.BKS.ills.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.srtp.short;" 
-                       tooltiptext="&marc.008.SER.srtp.desc;"
-                       onclick="window.open('&marc.008.SER.srtp.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.ills.field;"
-                       spos="&marc.008.BKS.ills.field_start_pos;"
-                       epos="&marc.008.BKS.ills.field_end_pos;"
-                       size="&marc.008.BKS.ills.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.srtp.field;"
-                       spos="&marc.008.SER.srtp.field_start_pos;"
-                       epos="&marc.008.SER.srtp.field_end_pos;"
-                       size="&marc.008.SER.srtp.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.BKS.fest.short;" 
-                       tooltiptext="&marc.008.BKS.fest.desc;"
-                       onclick="window.open('&marc.008.BKS.fest.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-               <label 
-                       value="&marc.008.SER.cont.short;" 
-                       tooltiptext="&marc.008.SER.cont.desc;"
-                       onclick="window.open('&marc.008.SER.cont.help;');"
-                       class="fixed_label"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.BKS.fest.field;"
-                       spos="&marc.008.BKS.fest.field_start_pos;"
-                       epos="&marc.008.BKS.fest.field_end_pos;"
-                       size="&marc.008.BKS.fest.field_size;"
-                       BKS="true" SER="false" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-               <textbox
-                       field="&marc.008.SER.cont.field;"
-                       spos="&marc.008.SER.cont.field_start_pos;"
-                       epos="&marc.008.SER.cont.field_end_pos;"
-                       size="&marc.008.SER.cont.field_size;"
-                       BKS="false" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.dtst.short;" 
-                       tooltiptext="&marc.008.dtst.desc;"
-                       onclick="window.open('&marc.008.dtst.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.dtst.field;"
-                       spos="&marc.008.dtst.field_start_pos;"
-                       epos="&marc.008.dtst.field_end_pos;"
-                       size="&marc.008.dtst.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.date1.short;" 
-                       tooltiptext="&marc.008.date1.desc;"
-                       onclick="window.open('&marc.008.dates.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.date1.field;"
-                       spos="&marc.008.date1.field_start_pos;"
-                       epos="&marc.008.date1.field_end_pos;"
-                       size="&marc.008.date1.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-       <hbox>
-               <label 
-                       value="&marc.008.date2.short;" 
-                       tooltiptext="&marc.008.date2.desc;"
-                       onclick="window.open('&marc.008.dates.help;');"
-                       class="fixed_label"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-               />
-       </hbox>
-       <hbox>
-               <textbox
-                       field="&marc.008.date2.field;"
-                       spos="&marc.008.date2.field_start_pos;"
-                       epos="&marc.008.date2.field_end_pos;"
-                       size="&marc.008.date2.field_size;"
-                       BKS="true" SER="true" VIS="false" MIX="false" 
-                       MAP="false" SCO="false" REC="false" COM="false" 
-                       onclick="this.select();"
-               />
-       </hbox>
-</row>
-
-<grid id="ctrl_grid" flex="1" class="ctrl_grid">
-       <columns id="ctrl_columns">
-               <column id="ctrl_column1"/>
-               <column id="ctrl_column2" flex="1"/>
-       </columns>
-       <rows id="ctrl_rows"/>
-</grid>
-
-<grid id="data_grid" flex="1" class="data_grid">
-       <columns id="data_columns">
-               <column id="data_column1"/>
-               <column id="data_column2"/>
-               <column id="data_column3"/>
-               <column id="data_column4" flex="1"/>
-       </columns>
-       <rows id="data_rows"/>
-</grid>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="marc_keys">
-       <key id="marc-close-editor-key" modifiers="accel" key="&marc.close.editor.key;" command="cmd_close_window"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc_rules.js b/Evergreen/staff_client/chrome/content/evergreen/cat/marc_rules.js
deleted file mode 100644 (file)
index b9e8031..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-var marc_rules = {"001":{"desc":"CONTROL NUMBER","repeat":"NR"},"002":{"desc":"LOCALLY DEFINED (UNOFFICIAL)","repeat":"NR"},"003":{"desc":"CONTROL NUMBER IDENTIFIER","repeat":"NR"},"005":{"desc":"DATE AND TIME OF LATEST TRANSACTION","repeat":"NR"},"006":{"desc":"FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS--GENERAL INFORMATION","repeat":"R"},"007":{"desc":"PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION","repeat":"R"},"008":{"desc":"FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION","repeat":"NR"},"010":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"LC control number ","repeat":"NR"},"b":{"desc":"NUCMC control number ","repeat":"R"},"desc":"LIBRARY OF CONGRESS CONTROL NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR","z":{"desc":"Canceled/invalid LC control number ","repeat":"R"}},"013":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Number ","repeat":"NR"},"b":{"desc":"Country ","repeat":"NR"},"c":{"desc":"Type of number ","repeat":"NR"},"d":{"desc":"Date ","repeat":"R"},"desc":"PATENT CONTROL INFORMATION","e":{"desc":"Status ","repeat":"R"},"f":{"desc":"Party to document ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"015":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"National bibliography number ","repeat":"R"},"desc":"NATIONAL BIBLIOGRAPHY NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"016":{"2":{"desc":"Source ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Record control number ","repeat":"NR"},"desc":"NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER","ind1":{"allowed":" 7","desc":"National bibliographic agency"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled or invalid record control number ","repeat":"R"}},"017":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Copyright registration number ","repeat":"R"},"b":{"desc":"Assigning agency ","repeat":"NR"},"desc":"COPYRIGHT OR LEGAL DEPOSIT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"018":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Copyright article-fee code ","repeat":"NR"},"desc":"COPYRIGHT ARTICLE-FEE CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"020":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"International Standard Book Number ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"NR"},"desc":"INTERNATIONAL STANDARD BOOK NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid ISBN ","repeat":"R"}},"022":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"International Standard Serial Number ","repeat":"NR"},"desc":"INTERNATIONAL STANDARD SERIAL NUMBER","ind1":{"allowed":" 01","desc":"Level of international interest"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","y":{"desc":"Incorrect ISSN ","repeat":"R"},"z":{"desc":"Canceled ISSN ","repeat":"R"}},"024":{"2":{"desc":"Source of number or code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Standard number or code ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"NR"},"d":{"desc":"Additional codes following the standard number or code ","repeat":"NR"},"desc":"OTHER STANDARD IDENTIFIER","ind1":{"allowed":"0123478","desc":"Type of standard number or code"},"ind2":{"allowed":" 01","desc":"Difference indicator"},"repeat":"R","z":{"desc":"Canceled/invalid standard number or code ","repeat":"R"}},"025":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Overseas acquisition number ","repeat":"R"},"desc":"OVERSEAS ACQUISITION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"026":{"2":{"desc":"Source ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"First and second groups of characters ","repeat":"R"},"b":{"desc":"Third and fourth groups of characters ","repeat":"R"},"c":{"desc":"Date ","repeat":"NR"},"d":{"desc":"Number of volume or part ","repeat":"R"},"desc":"FINGERPRINT IDENTIFIER","e":{"desc":"Unparsed fingerprint ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"027":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Standard technical report number ","repeat":"NR"},"desc":"STANDARD TECHNICAL REPORT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid number ","repeat":"R"}},"028":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publisher number ","repeat":"NR"},"b":{"desc":"Source ","repeat":"NR"},"desc":"PUBLISHER NUMBER","ind1":{"allowed":"012345","desc":"Type of publisher number"},"ind2":{"allowed":"0123","desc":"Note/added entry controller"},"repeat":"R"},"030":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"CODEN ","repeat":"NR"},"desc":"CODEN DESIGNATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid CODEN ","repeat":"R"}},"032":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Postal registration number ","repeat":"NR"},"b":{"desc":"Source (agency assigning number) ","repeat":"NR"},"desc":"POSTAL REGISTRATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"033":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Formatted date/time ","repeat":"R"},"b":{"desc":"Geographic classification area code ","repeat":"R"},"c":{"desc":"Geographic classification subarea code ","repeat":"R"},"desc":"DATE/TIME AND PLACE OF AN EVENT","ind1":{"allowed":" 012","desc":"Type of date in subfield $a"},"ind2":{"allowed":" 012","desc":"Type of event"},"repeat":"R"},"034":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Category of scale ","repeat":"NR"},"b":{"desc":"Constant ratio linear horizontal scale ","repeat":"R"},"c":{"desc":"Constant ratio linear vertical scale ","repeat":"R"},"d":{"desc":"Coordinates--westernmost longitude ","repeat":"NR"},"desc":"CODED CARTOGRAPHIC MATHEMATICAL DATA","e":{"desc":"Coordinates--easternmost longitude ","repeat":"NR"},"f":{"desc":"Coordinates--northernmost latitude ","repeat":"NR"},"g":{"desc":"Coordinates--southernmost latitude ","repeat":"NR"},"h":{"desc":"Angular scale ","repeat":"R"},"ind1":{"allowed":"013","desc":"Type of scale"},"ind2":{"allowed":" 01","desc":"Type of ring"},"j":{"desc":"Declination--northern limit ","repeat":"NR"},"k":{"desc":"Declination--southern limit ","repeat":"NR"},"m":{"desc":"Right ascension--eastern limit ","repeat":"NR"},"n":{"desc":"Right ascension--western limit ","repeat":"NR"},"p":{"desc":"Equinox ","repeat":"NR"},"repeat":"R","s":{"desc":"G-ring latitude ","repeat":"R"},"t":{"desc":"G-ring longitude ","repeat":"R"}},"035":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"System control number ","repeat":"NR"},"desc":"SYSTEM CONTROL NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid control number ","repeat":"R"}},"036":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Original study number ","repeat":"NR"},"b":{"desc":"Source (agency assigning number) ","repeat":"NR"},"desc":"ORIGINAL STUDY NUMBER FOR COMPUTER DATA FILES","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"037":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Stock number ","repeat":"NR"},"b":{"desc":"Source of stock number/acquisition ","repeat":"NR"},"c":{"desc":"Terms of availability ","repeat":"R"},"desc":"SOURCE OF ACQUISITION","f":{"desc":"Form of issue ","repeat":"R"},"g":{"desc":"Additional format characteristics ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Note ","repeat":"R"},"repeat":"R"},"038":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Record content licensor ","repeat":"NR"},"desc":"RECORD CONTENT LICENSOR","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"040":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Original cataloging agency ","repeat":"NR"},"b":{"desc":"Language of cataloging ","repeat":"NR"},"c":{"desc":"Transcribing agency ","repeat":"NR"},"d":{"desc":"Modifying agency ","repeat":"R"},"desc":"CATALOGING SOURCE","e":{"desc":"Description conventions ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"041":{"2":{"desc":"Source of code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Language code of text/sound track or separate title ","repeat":"R"},"b":{"desc":"Language code of summary or abstract/overprinted title or subtitle ","repeat":"R"},"d":{"desc":"Language code of sung or spoken text ","repeat":"R"},"desc":"LANGUAGE CODE","e":{"desc":"Language code of librettos ","repeat":"R"},"f":{"desc":"Language code of table of contents ","repeat":"R"},"g":{"desc":"Language code of accompanying material other than librettos ","repeat":"R"},"h":{"desc":"Language code of original and/or intermediate translations of text ","repeat":"R"},"ind1":{"allowed":"01","desc":"Translation indication"},"ind2":{"allowed":" 7","desc":"Source of code"},"repeat":"R"},"042":{"a":{"desc":"Authentication code ","repeat":"R"},"desc":"AUTHENTICATION CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"043":{"2":{"desc":"Source of local code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic area code ","repeat":"R"},"b":{"desc":"Local GAC code ","repeat":"R"},"c":{"desc":"ISO code ","repeat":"R"},"desc":"GEOGRAPHIC AREA CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"044":{"2":{"desc":"Source of local subentity code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"MARC country code ","repeat":"R"},"b":{"desc":"Local subentity code ","repeat":"R"},"c":{"desc":"ISO country code ","repeat":"R"},"desc":"COUNTRY OF PUBLISHING/PRODUCING ENTITY CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"045":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Time period code ","repeat":"R"},"b":{"desc":"Formatted 9999 B.C. through C.E. time period ","repeat":"R"},"c":{"desc":"Formatted pre-9999 B.C. time period ","repeat":"R"},"desc":"TIME PERIOD OF CONTENT","ind1":{"allowed":" 012","desc":"Type of time period in subfield $b or $c"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"046":{"2":{"desc":"Source of date ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of date code ","repeat":"NR"},"b":{"desc":"Date 1 (B.C. date) ","repeat":"NR"},"c":{"desc":"Date 1 (C.E. date) ","repeat":"NR"},"d":{"desc":"Date 2 (B.C. date) ","repeat":"NR"},"desc":"SPECIAL CODED DATES","e":{"desc":"Date 2 (C.E. date) ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Date resource modified ","repeat":"NR"},"k":{"desc":"Beginning or single date created ","repeat":"NR"},"l":{"desc":"Ending date created ","repeat":"NR"},"m":{"desc":"Beginning of date valid ","repeat":"NR"},"n":{"desc":"End of date valid ","repeat":"NR"},"repeat":"R"},"047":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Form of musical composition code ","repeat":"R"},"desc":"FORM OF MUSICAL COMPOSITION CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"048":{"8":{"desc":"Field link and sequence number","repeat":"R"},"a":{"desc":"Performer or ensemble ","repeat":"R"},"b":{"desc":"Soloist ","repeat":"R"},"desc":"NUMBER OF MUSICAL INSTRUMENTS OR VOICES CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"050":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"LIBRARY OF CONGRESS CALL NUMBER","ind1":{"allowed":" 01","desc":"Existence in LC collection"},"ind2":{"allowed":"04","desc":"Source of call number"},"repeat":"R"},"051":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"LIBRARY OF CONGRESS COPY, ISSUE, OFFPRINT STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"052":{"2":{"desc":"Code source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic classification area code ","repeat":"NR"},"b":{"desc":"Geographic classification subarea code ","repeat":"R"},"d":{"desc":"Populated place name ","repeat":"R"},"desc":"GEOGRAPHIC CLASSIFICATION","ind1":{"allowed":" 17","desc":"Code source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"055":{"2":{"desc":"Source of call/class number ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"CLASSIFICATION NUMBERS ASSIGNED IN CANADA","ind1":{"allowed":" 01","desc":"Existence in NLC collection"},"ind2":{"allowed":"0123456789","desc":"Type, completeness, source of class/call number"},"repeat":"R"},"060":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"NATIONAL LIBRARY OF MEDICINE CALL NUMBER","ind1":{"allowed":" 01","desc":"Existence in NLM collection"},"ind2":{"allowed":"04","desc":"Source of call number"},"repeat":"R"},"061":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"NATIONAL LIBRARY OF MEDICINE COPY STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"066":{"a":{"desc":"Primary G0 character set ","repeat":"NR"},"b":{"desc":"Primary G1 character set ","repeat":"NR"},"c":{"desc":"Alternate G0 or G1 character set ","repeat":"R"},"desc":"CHARACTER SETS PRESENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"070":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"NATIONAL AGRICULTURAL LIBRARY CALL NUMBER","ind1":{"allowed":"01","desc":"Existence in NAL collection"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"071":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"c":{"desc":"Copy information ","repeat":"NR"},"desc":"NATIONAL AGRICULTURAL LIBRARY COPY STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"072":{"2":{"desc":"Source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Subject category code ","repeat":"NR"},"desc":"SUBJECT CATEGORY CODE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"07","desc":"Source specified in subfield $2"},"repeat":"R","x":{"desc":"Subject category code subdivision ","repeat":"R"}},"074":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"GPO item number ","repeat":"NR"},"desc":"GPO ITEM NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid GPO item number ","repeat":"R"}},"080":{"2":{"desc":"Edition identifier ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Universal Decimal Classification number ","repeat":"NR"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"UNIVERSAL DECIMAL CLASSIFICATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Common auxiliary subdivision ","repeat":"R"}},"082":{"2":{"desc":"Edition number ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"DEWEY DECIMAL CLASSIFICATION NUMBER","ind1":{"allowed":"01","desc":"Type of edition"},"ind2":{"allowed":" 04","desc":"Source of classification number"},"repeat":"R"},"084":{"2":{"desc":"Source of number ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"R"},"b":{"desc":"Item number ","repeat":"NR"},"desc":"OTHER CLASSIFICATION NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"086":{"2":{"desc":"Number source ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Classification number ","repeat":"NR"},"desc":"GOVERNMENT DOCUMENT CLASSIFICATION NUMBER","ind1":{"allowed":" 01","desc":"Number source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid classification number ","repeat":"R"}},"088":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Report number ","repeat":"NR"},"desc":"REPORT NUMBER","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Canceled/invalid report number ","repeat":"R"}},"100":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"MAIN ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"110":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"MAIN ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"111":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"MAIN ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"NR","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"}},"130":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"MAIN ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"}},"210":{"2":{"desc":"Source ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Abbreviated title ","repeat":"NR"},"b":{"desc":"Qualifying information ","repeat":"NR"},"desc":"ABBREVIATED TITLE","ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":" 0","desc":"Type"},"repeat":"R"},"222":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Key title ","repeat":"NR"},"b":{"desc":"Qualifying information ","repeat":"NR"},"desc":"KEY TITLE","ind1":{"allowed":" ","desc":"Specifies whether variant title and/or added entry is required"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"repeat":"R"},"240":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Uniform title printed or displayed"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"242":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"c":{"desc":"Statement of responsibility, etc. ","repeat":"NR"},"desc":"TRANSLATION OF TITLE BY CATALOGING AGENCY","h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","y":{"desc":"Language code of translated title ","repeat":"NR"}},"243":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"COLLECTIVE UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Uniform title printed or displayed"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"245":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"c":{"desc":"Statement of responsibility, etc. ","repeat":"NR"},"desc":"TITLE STATEMENT","f":{"desc":"Inclusive dates ","repeat":"NR"},"g":{"desc":"Bulk dates ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"NR","s":{"desc":"Version ","repeat":"NR"}},"246":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title proper/short title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"desc":"VARYING FORM OF TITLE","f":{"desc":"Date or sequential designation ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"0123","desc":"Note/added entry controller"},"ind2":{"allowed":" 012345678","desc":"Type of title"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R"},"247":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"b":{"desc":"Remainder of title ","repeat":"NR"},"desc":"FORMER TITLE","f":{"desc":"Date or sequential designation ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Title added entry"},"ind2":{"allowed":"01","desc":"Note controller"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"250":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Edition statement ","repeat":"NR"},"b":{"desc":"Remainder of edition statement ","repeat":"NR"},"desc":"EDITION STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"254":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Musical presentation statement ","repeat":"NR"},"desc":"MUSICAL PRESENTATION STATEMENT","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"255":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Statement of scale ","repeat":"NR"},"b":{"desc":"Statement of projection ","repeat":"NR"},"c":{"desc":"Statement of coordinates ","repeat":"NR"},"d":{"desc":"Statement of zone ","repeat":"NR"},"desc":"CARTOGRAPHIC MATHEMATICAL DATA","e":{"desc":"Statement of equinox ","repeat":"NR"},"f":{"desc":"Outer G-ring coordinate pairs ","repeat":"NR"},"g":{"desc":"Exclusion G-ring coordinate pairs ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"256":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Computer file characteristics ","repeat":"NR"},"desc":"COMPUTER FILE CHARACTERISTICS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"257":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Country of producing entity ","repeat":"NR"},"desc":"COUNTRY OF PRODUCING ENTITY FOR ARCHIVAL FILMS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"260":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Place of publication, distribution, etc. ","repeat":"R"},"b":{"desc":"Name of publisher, distributor, etc. ","repeat":"R"},"c":{"desc":"Date of publication, distribution, etc. ","repeat":"R"},"d":{"desc":"Plate or publisher's number for music (Pre-AACR 2) ","repeat":"NR"},"desc":"PUBLICATION, DISTRIBUTION, ETC. (IMPRINT)","e":{"desc":"Place of manufacture ","repeat":"NR"},"f":{"desc":"Manufacturer ","repeat":"NR"},"g":{"desc":"Date of manufacture ","repeat":"NR"},"ind1":{"allowed":" 23","desc":"Sequence of publishing statements"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"261":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Producing company ","repeat":"R"},"b":{"desc":"Releasing company (primary distributor) ","repeat":"R"},"d":{"desc":"Date of production, release, etc. ","repeat":"R"},"desc":"IMPRINT STATEMENT FOR FILMS (Pre-AACR 1 Revised)","e":{"desc":"Contractual producer ","repeat":"R"},"f":{"desc":"Place of production, release, etc. ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"262":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Place of production, release, etc. ","repeat":"NR"},"b":{"desc":"Publisher or trade name ","repeat":"NR"},"c":{"desc":"Date of production, release, etc. ","repeat":"NR"},"desc":"IMPRINT STATEMENT FOR SOUND RECORDINGS (Pre-AACR 2)","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Serial identification ","repeat":"NR"},"l":{"desc":"Matrix and/or take number ","repeat":"NR"},"repeat":"NR"},"263":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Projected publication date ","repeat":"NR"},"desc":"PROJECTED PUBLICATION DATE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"270":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Address ","repeat":"R"},"b":{"desc":"City ","repeat":"NR"},"c":{"desc":"State or province ","repeat":"NR"},"d":{"desc":"Country ","repeat":"NR"},"desc":"ADDRESS","e":{"desc":"Postal code ","repeat":"NR"},"f":{"desc":"Terms preceding attention name ","repeat":"NR"},"g":{"desc":"Attention name ","repeat":"NR"},"h":{"desc":"Attention position ","repeat":"NR"},"i":{"desc":"Type of address ","repeat":"NR"},"ind1":{"allowed":" 12","desc":"Level"},"ind2":{"allowed":" 07","desc":"Type of address"},"j":{"desc":"Specialized telephone number ","repeat":"R"},"k":{"desc":"Telephone number ","repeat":"R"},"l":{"desc":"Fax number ","repeat":"R"},"m":{"desc":"Electronic mail address ","repeat":"R"},"n":{"desc":"TDD or TTY number ","repeat":"R"},"p":{"desc":"Contact person ","repeat":"R"},"q":{"desc":"Title of contact person ","repeat":"R"},"r":{"desc":"Hours ","repeat":"R"},"repeat":"R","z":{"desc":"Public note ","repeat":"R"}},"300":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Extent ","repeat":"R"},"b":{"desc":"Other physical details ","repeat":"NR"},"c":{"desc":"Dimensions ","repeat":"R"},"desc":"PHYSICAL DESCRIPTION","e":{"desc":"Accompanying material ","repeat":"NR"},"f":{"desc":"Type of unit ","repeat":"R"},"g":{"desc":"Size of unit ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"306":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Playing time ","repeat":"R"},"desc":"PLAYING TIME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"307":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Hours ","repeat":"NR"},"b":{"desc":"Additional information ","repeat":"NR"},"desc":"HOURS, ETC.","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"310":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Current publication frequency ","repeat":"NR"},"b":{"desc":"Date of current publication frequency ","repeat":"NR"},"desc":"CURRENT PUBLICATION FREQUENCY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"321":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Former publication frequency ","repeat":"NR"},"b":{"desc":"Dates of former publication frequency ","repeat":"NR"},"desc":"FORMER PUBLICATION FREQUENCY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"340":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Material base and configuration ","repeat":"R"},"b":{"desc":"Dimensions ","repeat":"R"},"c":{"desc":"Materials applied to surface ","repeat":"R"},"d":{"desc":"Information recording technique ","repeat":"R"},"desc":"PHYSICAL MEDIUM","e":{"desc":"Support ","repeat":"R"},"f":{"desc":"Production rate/ratio ","repeat":"R"},"h":{"desc":"Location within medium ","repeat":"R"},"i":{"desc":"Technical specifications of medium ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"342":{"2":{"desc":"Reference method used ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name ","repeat":"NR"},"b":{"desc":"Coordinate or distance units ","repeat":"NR"},"c":{"desc":"Latitude resolution ","repeat":"NR"},"d":{"desc":"Longitude resolution ","repeat":"NR"},"desc":"GEOSPATIAL REFERENCE DATA","e":{"desc":"Standard parallel or oblique line latitude ","repeat":"R"},"f":{"desc":"Oblique line longitude ","repeat":"R"},"g":{"desc":"Longitude of central meridian or projection center ","repeat":"NR"},"h":{"desc":"Latitude of projection origin or projection center ","repeat":"NR"},"i":{"desc":"False easting ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Geospatial reference dimension"},"ind2":{"allowed":"012345678","desc":"Geospatial reference method"},"j":{"desc":"False northing ","repeat":"NR"},"k":{"desc":"Scale factor ","repeat":"NR"},"l":{"desc":"Height of perspective point above surface ","repeat":"NR"},"m":{"desc":"Azimuthal angle ","repeat":"NR"},"o":{"desc":"Landsat number and path number ","repeat":"NR"},"p":{"desc":"Zone identifier ","repeat":"NR"},"q":{"desc":"Ellipsoid name ","repeat":"NR"},"r":{"desc":"Semi-major axis ","repeat":"NR"},"repeat":"R","s":{"desc":"Denominator of flattening ratio ","repeat":"NR"},"t":{"desc":"Vertical resolution ","repeat":"NR"},"u":{"desc":"Vertical encoding method ","repeat":"NR"},"v":{"desc":"Local planar, local, or other projection or grid description ","repeat":"NR"},"w":{"desc":"Local planar or local georeference information ","repeat":"NR"}},"343":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Planar coordinate encoding method ","repeat":"NR"},"b":{"desc":"Planar distance units ","repeat":"NR"},"c":{"desc":"Abscissa resolution ","repeat":"NR"},"d":{"desc":"Ordinate resolution ","repeat":"NR"},"desc":"PLANAR COORDINATE DATA","e":{"desc":"Distance resolution ","repeat":"NR"},"f":{"desc":"Bearing resolution ","repeat":"NR"},"g":{"desc":"Bearing units ","repeat":"NR"},"h":{"desc":"Bearing reference direction ","repeat":"NR"},"i":{"desc":"Bearing reference meridian ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"351":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Organization ","repeat":"R"},"b":{"desc":"Arrangement ","repeat":"R"},"c":{"desc":"Hierarchical level ","repeat":"NR"},"desc":"ORGANIZATION AND ARRANGEMENT OF MATERIALS","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"352":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Direct reference method ","repeat":"NR"},"b":{"desc":"Object type ","repeat":"R"},"c":{"desc":"Object count ","repeat":"R"},"d":{"desc":"Row count ","repeat":"NR"},"desc":"DIGITAL GRAPHIC REPRESENTATION","e":{"desc":"Column count ","repeat":"NR"},"f":{"desc":"Vertical count ","repeat":"NR"},"g":{"desc":"VPF topology level ","repeat":"NR"},"i":{"desc":"Indirect reference description ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"q":{"desc":"Format of the digital image ","repeat":"R"},"repeat":"R"},"355":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Security classification ","repeat":"NR"},"b":{"desc":"Handling instructions ","repeat":"R"},"c":{"desc":"External dissemination information ","repeat":"R"},"d":{"desc":"Downgrading or declassification event ","repeat":"NR"},"desc":"SECURITY CLASSIFICATION CONTROL","e":{"desc":"Classification system ","repeat":"NR"},"f":{"desc":"Country of origin code ","repeat":"NR"},"g":{"desc":"Downgrading date ","repeat":"NR"},"h":{"desc":"Declassification date ","repeat":"NR"},"ind1":{"allowed":"0123458","desc":"Controlled element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Authorization ","repeat":"R"},"repeat":"R"},"357":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Originator control term ","repeat":"NR"},"b":{"desc":"Originating agency ","repeat":"R"},"c":{"desc":"Authorized recipients of material ","repeat":"R"},"desc":"ORIGINATOR DISSEMINATION CONTROL","g":{"desc":"Other restrictions ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"362":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Dates of publication and/or sequential designation ","repeat":"NR"},"desc":"DATES OF PUBLICATION AND/OR SEQUENTIAL DESIGNATION","ind1":{"allowed":"01","desc":"Format of date"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"Source of information ","repeat":"NR"}},"365":{"2":{"desc":"Source of price type code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Price type code ","repeat":"NR"},"b":{"desc":"Price amount ","repeat":"NR"},"c":{"desc":"Currency code ","repeat":"NR"},"d":{"desc":"Unit of pricing ","repeat":"NR"},"desc":"TRADE PRICE","e":{"desc":"Price note ","repeat":"NR"},"f":{"desc":"Price effective from ","repeat":"NR"},"g":{"desc":"Price effective until ","repeat":"NR"},"h":{"desc":"Tax rate 1 ","repeat":"NR"},"i":{"desc":"Tax rate 2 ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"ISO country code ","repeat":"NR"},"k":{"desc":"MARC country code ","repeat":"NR"},"m":{"desc":"Identification of pricing entity ","repeat":"NR"},"repeat":"R"},"366":{"2":{"desc":"Source of availability status code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publishers' compressed title identification ","repeat":"NR"},"b":{"desc":"Detailed date of publication ","repeat":"NR"},"c":{"desc":"Availability status code ","repeat":"NR"},"d":{"desc":"Expected next availability date ","repeat":"NR"},"desc":"TRADE AVAILABILITY INFORMATION","e":{"desc":"Note ","repeat":"NR"},"f":{"desc":"Publishers' discount category ","repeat":"NR"},"g":{"desc":"Date made out of print ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"ISO country code ","repeat":"NR"},"k":{"desc":"MARC country code ","repeat":"NR"},"m":{"desc":"Identification of agency ","repeat":"NR"},"repeat":"R"},"400":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number  ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--PERSONAL NAME ","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation  ","repeat":"NR"},"x":{"desc":"International Standard Serial Number  ","repeat":"NR"}},"410":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SERIES STATEMENT/ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation  ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"411":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":"01","desc":"Pronoun represents main entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume number/sequential designation  ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"440":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Title ","repeat":"NR"},"desc":"SERIES STATEMENT/ADDED ENTRY--TITLE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R","v":{"desc":"Volume number/sequential designation  ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"490":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Series statement ","repeat":"R"},"desc":"SERIES STATEMENT","ind1":{"allowed":"01","desc":"Specifies whether series is traced"},"ind2":{"allowed":" ","desc":"Undefined"},"l":{"desc":"Library of Congress call number ","repeat":"NR"},"repeat":"R","v":{"desc":"Volume number/sequential designation  ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"500":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"General note ","repeat":"NR"},"desc":"GENERAL NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"501":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"With note ","repeat":"NR"},"desc":"WITH NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"502":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Dissertation note ","repeat":"NR"},"desc":"DISSERTATION NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"504":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Bibliography, etc. note ","repeat":"NR"},"b":{"desc":"Number of references ","repeat":"NR"},"desc":"BIBLIOGRAPHY, ETC. NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"505":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Formatted contents note ","repeat":"NR"},"desc":"FORMATTED CONTENTS NOTE","g":{"desc":"Miscellaneous information ","repeat":"R"},"ind1":{"allowed":"0128","desc":"Display constant controller"},"ind2":{"allowed":" 0","desc":"Level of content designation"},"r":{"desc":"Statement of responsibility ","repeat":"R"},"repeat":"R","t":{"desc":"Title ","repeat":"R"},"u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"506":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Terms governing access ","repeat":"NR"},"b":{"desc":"Jurisdiction ","repeat":"R"},"c":{"desc":"Physical access provisions ","repeat":"R"},"d":{"desc":"Authorized users ","repeat":"R"},"desc":"RESTRICTIONS ON ACCESS NOTE","e":{"desc":"Authorization ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"507":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Representative fraction of scale note ","repeat":"NR"},"b":{"desc":"Remainder of scale note ","repeat":"NR"},"desc":"SCALE NOTE FOR GRAPHIC MATERIAL","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"NR"},"508":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Creation/production credits note ","repeat":"NR"},"desc":"CREATION/PRODUCTION CREDITS NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"510":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name of source ","repeat":"NR"},"b":{"desc":"Coverage of source ","repeat":"NR"},"c":{"desc":"Location within source ","repeat":"NR"},"desc":"CITATION/REFERENCES NOTE","ind1":{"allowed":"01234","desc":"Coverage/location in source"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"511":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Participant or performer note ","repeat":"NR"},"desc":"PARTICIPANT OR PERFORMER NOTE","ind1":{"allowed":"01","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"513":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of report ","repeat":"NR"},"b":{"desc":"Period covered ","repeat":"NR"},"desc":"TYPE OF REPORT AND PERIOD COVERED NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"514":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Attribute accuracy report ","repeat":"NR"},"b":{"desc":"Attribute accuracy value ","repeat":"R"},"c":{"desc":"Attribute accuracy explanation ","repeat":"R"},"d":{"desc":"Logical consistency report ","repeat":"NR"},"desc":"DATA QUALITY NOTE","e":{"desc":"Completeness report ","repeat":"NR"},"f":{"desc":"Horizontal position accuracy report ","repeat":"NR"},"g":{"desc":"Horizontal position accuracy value ","repeat":"R"},"h":{"desc":"Horizontal position accuracy explanation ","repeat":"R"},"i":{"desc":"Vertical positional accuracy report ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Vertical positional accuracy value ","repeat":"R"},"k":{"desc":"Vertical positional accuracy explanation ","repeat":"R"},"m":{"desc":"Cloud cover ","repeat":"NR"},"repeat":"NR","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"z":{"desc":"Display note ","repeat":"R"}},"515":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Numbering peculiarities note ","repeat":"NR"},"desc":"NUMBERING PECULIARITIES NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"516":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of computer file or data note ","repeat":"NR"},"desc":"TYPE OF COMPUTER FILE OR DATA NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"518":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Date/time and place of an event note ","repeat":"NR"},"desc":"DATE/TIME AND PLACE OF AN EVENT NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"520":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Summary, etc. note ","repeat":"NR"},"b":{"desc":"Expansion of summary note ","repeat":"NR"},"desc":"SUMMARY, ETC.","ind1":{"allowed":" 01238","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"521":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Target audience note ","repeat":"R"},"b":{"desc":"Source ","repeat":"NR"},"desc":"TARGET AUDIENCE NOTE","ind1":{"allowed":" 012348","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"522":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic coverage note ","repeat":"NR"},"desc":"GEOGRAPHIC COVERAGE NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"524":{"2":{"desc":"Source of schema used ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Preferred citation of described materials note ","repeat":"NR"},"desc":"PREFERRED CITATION OF DESCRIBED MATERIALS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"525":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Supplement note ","repeat":"NR"},"desc":"SUPPLEMENT NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"526":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Program name ","repeat":"NR"},"b":{"desc":"Interest level ","repeat":"NR"},"c":{"desc":"Reading level ","repeat":"NR"},"d":{"desc":"Title point value ","repeat":"NR"},"desc":"STUDY PROGRAM INFORMATION NOTE","i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"530":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Additional physical form available note ","repeat":"NR"},"b":{"desc":"Availability source ","repeat":"NR"},"c":{"desc":"Availability conditions ","repeat":"NR"},"d":{"desc":"Order number ","repeat":"NR"},"desc":"ADDITIONAL PHYSICAL FORM AVAILABLE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"533":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Fixed-length data elements of reproduction ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Type of reproduction ","repeat":"NR"},"b":{"desc":"Place of reproduction ","repeat":"R"},"c":{"desc":"Agency responsible for reproduction ","repeat":"R"},"d":{"desc":"Date of reproduction ","repeat":"NR"},"desc":"REPRODUCTION NOTE","e":{"desc":"Physical description of reproduction ","repeat":"NR"},"f":{"desc":"Series statement of reproduction ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"m":{"desc":"Dates and/or sequential designation of issues reproduced ","repeat":"R"},"n":{"desc":"Note about reproduction ","repeat":"R"},"repeat":"R"},"534":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry of original ","repeat":"NR"},"b":{"desc":"Edition statement of original ","repeat":"NR"},"c":{"desc":"Publication, distribution, etc. of original ","repeat":"NR"},"desc":"ORIGINAL VERSION NOTE","e":{"desc":"Physical description, etc. of original ","repeat":"NR"},"f":{"desc":"Series statement of original ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Key title of original ","repeat":"R"},"l":{"desc":"Location of original ","repeat":"NR"},"m":{"desc":"Material specific details ","repeat":"NR"},"n":{"desc":"Note about original ","repeat":"R"},"p":{"desc":"Introductory phrase ","repeat":"NR"},"repeat":"R","t":{"desc":"Title statement of original ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"R"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"535":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Custodian ","repeat":"NR"},"b":{"desc":"Postal address ","repeat":"R"},"c":{"desc":"Country ","repeat":"R"},"d":{"desc":"Telecommunications address ","repeat":"R"},"desc":"LOCATION OF ORIGINALS/DUPLICATES NOTE","g":{"desc":"Repository location code ","repeat":"NR"},"ind1":{"allowed":"12","desc":"Additional information about custodian"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"536":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Text of note ","repeat":"NR"},"b":{"desc":"Contract number ","repeat":"R"},"c":{"desc":"Grant number ","repeat":"R"},"d":{"desc":"Undifferentiated number ","repeat":"R"},"desc":"FUNDING INFORMATION NOTE","e":{"desc":"Program element number ","repeat":"R"},"f":{"desc":"Project number ","repeat":"R"},"g":{"desc":"Task number ","repeat":"R"},"h":{"desc":"Work unit number ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"538":{"3":{"desc":"Materials specified  ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"System details note ","repeat":"NR"},"desc":"SYSTEM DETAILS NOTE","i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"540":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Terms governing use and reproduction ","repeat":"NR"},"b":{"desc":"Jurisdiction ","repeat":"NR"},"c":{"desc":"Authorization ","repeat":"NR"},"d":{"desc":"Authorized users ","repeat":"NR"},"desc":"TERMS GOVERNING USE AND REPRODUCTION NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"541":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Source of acquisition ","repeat":"NR"},"b":{"desc":"Address ","repeat":"NR"},"c":{"desc":"Method of acquisition ","repeat":"NR"},"d":{"desc":"Date of acquisition ","repeat":"NR"},"desc":"IMMEDIATE SOURCE OF ACQUISITION NOTE","e":{"desc":"Accession number ","repeat":"NR"},"f":{"desc":"Owner ","repeat":"NR"},"h":{"desc":"Purchase price ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Extent ","repeat":"R"},"o":{"desc":"Type of unit ","repeat":"R"},"repeat":"R"},"544":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Custodian ","repeat":"R"},"b":{"desc":"Address ","repeat":"R"},"c":{"desc":"Country ","repeat":"R"},"d":{"desc":"Title ","repeat":"R"},"desc":"LOCATION OF OTHER ARCHIVAL MATERIALS NOTE","e":{"desc":"Provenance ","repeat":"R"},"ind1":{"allowed":" 01","desc":"Relationship"},"ind2":{"allowed":" ","desc":"Undefined"},"n":{"desc":"Note ","repeat":"R"},"repeat":"R"},"545":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Biographical or historical note ","repeat":"NR"},"b":{"desc":"Expansion ","repeat":"NR"},"desc":"BIOGRAPHICAL OR HISTORICAL DATA","ind1":{"allowed":" 01","desc":"Type of data"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"546":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Language note ","repeat":"NR"},"b":{"desc":"Information code or alphabet ","repeat":"R"},"desc":"LANGUAGE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"547":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Former title complexity note ","repeat":"NR"},"desc":"FORMER TITLE COMPLEXITY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"550":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Issuing body note ","repeat":"NR"},"desc":"ISSUING BODY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"552":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Entity type label ","repeat":"NR"},"b":{"desc":"Entity type definition and source ","repeat":"NR"},"c":{"desc":"Attribute label ","repeat":"NR"},"d":{"desc":"Attribute definition and source ","repeat":"NR"},"desc":"ENTITY AND ATTRIBUTE INFORMATION NOTE","e":{"desc":"Enumerated domain value ","repeat":"R"},"f":{"desc":"Enumerated domain value definition and source ","repeat":"R"},"g":{"desc":"Range domain minimum and maximum ","repeat":"NR"},"h":{"desc":"Codeset name and source ","repeat":"NR"},"i":{"desc":"Unrepresentable domain ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribute units of measurement and resolution ","repeat":"NR"},"k":{"desc":"Beginning date and ending date of attribute values ","repeat":"NR"},"l":{"desc":"Attribute value accuracy ","repeat":"NR"},"m":{"desc":"Attribute value accuracy explanation ","repeat":"NR"},"n":{"desc":"Attribute measurement frequency ","repeat":"NR"},"o":{"desc":"Entity and attribute overview ","repeat":"R"},"p":{"desc":"Entity and attribute detail citation ","repeat":"R"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"z":{"desc":"Display note ","repeat":"R"}},"555":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Cumulative index/finding aids note ","repeat":"NR"},"b":{"desc":"Availability source ","repeat":"R"},"c":{"desc":"Degree of control ","repeat":"NR"},"d":{"desc":"Bibliographic reference ","repeat":"NR"},"desc":"CUMULATIVE INDEX/FINDING AIDS NOTE","ind1":{"allowed":" 08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"556":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Information about documentation note ","repeat":"NR"},"desc":"INFORMATION ABOUT DOCUMENTATION NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"International Standard Book Number ","repeat":"R"}},"561":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"History ","repeat":"NR"},"desc":"OWNERSHIP AND CUSTODIAL HISTORY","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"562":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Identifying markings ","repeat":"R"},"b":{"desc":"Copy identification ","repeat":"R"},"c":{"desc":"Version identification ","repeat":"R"},"d":{"desc":"Presentation format ","repeat":"R"},"desc":"COPY AND VERSION IDENTIFICATION NOTE","e":{"desc":"Number of copies ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"563":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Binding note ","repeat":"NR"},"desc":"BINDING INFORMATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"}},"565":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Number of cases/variables ","repeat":"NR"},"b":{"desc":"Name of variable ","repeat":"R"},"c":{"desc":"Unit of analysis ","repeat":"R"},"d":{"desc":"Universe of data ","repeat":"R"},"desc":"CASE FILE CHARACTERISTICS NOTE","e":{"desc":"Filing scheme or code ","repeat":"R"},"ind1":{"allowed":" 08","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"567":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Methodology note ","repeat":"NR"},"desc":"METHODOLOGY NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"580":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Linking entry complexity note ","repeat":"NR"},"desc":"LINKING ENTRY COMPLEXITY NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"581":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Publications about described materials note","repeat":"NR"},"desc":"PUBLICATIONS ABOUT DESCRIBED MATERIALS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","z":{"desc":"International Standard Book Number ","repeat":"R"}},"583":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Action ","repeat":"NR"},"b":{"desc":"Action identification ","repeat":"R"},"c":{"desc":"Time/date of action ","repeat":"R"},"d":{"desc":"Action interval ","repeat":"R"},"desc":"ACTION NOTE","e":{"desc":"Contingency for action ","repeat":"R"},"f":{"desc":"Authorization ","repeat":"R"},"h":{"desc":"Jurisdiction ","repeat":"R"},"i":{"desc":"Method of action ","repeat":"R"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Site of action ","repeat":"R"},"k":{"desc":"Action agent ","repeat":"R"},"l":{"desc":"Status ","repeat":"R"},"n":{"desc":"Extent ","repeat":"R"},"o":{"desc":"Type of unit ","repeat":"R"},"repeat":"R","u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"584":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Accumulation ","repeat":"R"},"b":{"desc":"Frequency of use ","repeat":"R"},"desc":"ACCUMULATION AND FREQUENCY OF USE NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"585":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Exhibitions note ","repeat":"NR"},"desc":"EXHIBITIONS NOTE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"586":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Awards note ","repeat":"NR"},"desc":"AWARDS NOTE","ind1":{"allowed":" 8","desc":"Display constant controller"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"600":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"610":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"611":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"630":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"648":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Chronological term ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--CHRONOLOGICAL TERM","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"650":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Topical term or geographic name as entry element ","repeat":"NR"},"b":{"desc":"Topical term following geographic name as entry element ","repeat":"NR"},"c":{"desc":"Location of event ","repeat":"NR"},"d":{"desc":"Active dates ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--TOPICAL TERM","e":{"desc":"Relator term ","repeat":"NR"},"ind1":{"allowed":" 012","desc":"Level of subject"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"651":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Geographic name ","repeat":"NR"},"desc":"SUBJECT ADDED ENTRY--GEOGRAPHIC NAME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"653":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uncontrolled term ","repeat":"R"},"desc":"INDEX TERM--UNCONTROLLED","ind1":{"allowed":" 012","desc":"Level of index term"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"654":{"2":{"desc":"Source of heading or term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Focus term ","repeat":"R"},"b":{"desc":"Non-focus term ","repeat":"R"},"c":{"desc":"Facet/hierarchy designation ","repeat":"R"},"desc":"SUBJECT ADDED ENTRY--FACETED TOPICAL TERMS","ind1":{"allowed":" 012","desc":"Level of subject"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"655":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Genre/form data or focus term ","repeat":"NR"},"b":{"desc":"Non-focus term ","repeat":"R"},"c":{"desc":"Facet/hierarchy designation ","repeat":"R"},"desc":"INDEX TERM--GENRE/FORM","ind1":{"allowed":" 0","desc":"Type of heading"},"ind2":{"allowed":"01234567","desc":"Thesaurus"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"656":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Occupation ","repeat":"NR"},"desc":"INDEX TERM--OCCUPATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"7","desc":"Source of term"},"k":{"desc":"Form ","repeat":"NR"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"657":{"2":{"desc":"Source of term ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Function ","repeat":"NR"},"desc":"INDEX TERM--FUNCTION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"7","desc":"Source of term"},"repeat":"R","v":{"desc":"Form subdivision ","repeat":"R"},"x":{"desc":"General subdivision ","repeat":"R"},"y":{"desc":"Chronological subdivision ","repeat":"R"},"z":{"desc":"Geographic subdivision ","repeat":"R"}},"658":{"2":{"desc":"Source of term or code ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main curriculum objective ","repeat":"NR"},"b":{"desc":"Subordinate curriculum objective ","repeat":"R"},"c":{"desc":"Curriculum code ","repeat":"NR"},"d":{"desc":"Correlation factor ","repeat":"NR"},"desc":"INDEX TERM--CURRICULUM OBJECTIVE","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"700":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"710":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"711":{"3":{"desc":"Materials specified ","repeat":"NR"},"4":{"desc":"Relator code ","repeat":"R"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"720":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Name ","repeat":"NR"},"desc":"ADDED ENTRY--UNCONTROLLED NAME","e":{"desc":"Relator term ","repeat":"R"},"ind1":{"allowed":" 12","desc":"Type of name"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"730":{"3":{"desc":"Materials specified ","repeat":"NR"},"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"}},"740":{"5":{"desc":"Institution to which field applies ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uncontrolled related/analytical title ","repeat":"NR"},"desc":"ADDED ENTRY--UNCONTROLLED RELATED/ANALYTICAL TITLE","h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"0-9","desc":"Nonfiling characters"},"ind2":{"allowed":" 2","desc":"Type of added entry"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"repeat":"R"},"752":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Country ","repeat":"NR"},"b":{"desc":"State, province, territory ","repeat":"NR"},"c":{"desc":"County, region, islands area ","repeat":"NR"},"d":{"desc":"City ","repeat":"NR"},"desc":"ADDED ENTRY--HIERARCHICAL PLACE NAME","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"753":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Make and model of machine ","repeat":"NR"},"b":{"desc":"Programming language ","repeat":"NR"},"c":{"desc":"Operating system ","repeat":"NR"},"desc":"SYSTEM DETAILS ACCESS TO COMPUTER FILES","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"754":{"2":{"desc":"Source of taxonomic identification ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Taxonomic name ","repeat":"R"},"c":{"desc":"Taxonomic category ","repeat":"R"},"d":{"desc":"Common or alternative name ","repeat":"R"},"desc":"ADDED ENTRY--TAXONOMIC IDENTIFICATION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R","x":{"desc":"Non-public note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"760":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"MAIN SERIES ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"762":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUBSERIES ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"765":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ORIGINAL LANGUAGE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"767":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"TRANSLATION ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"770":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUPPLEMENT/SPECIAL ISSUE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"772":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUPPLEMENT PARENT ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 08","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Stan dard Book Number ","repeat":"R"}},"773":{"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"HOST ITEM ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"p":{"desc":"Abbreviated title ","repeat":"NR"},"q":{"desc":"Enumeration and first page ","repeat":"NR"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"774":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"CONSTITUENT UNIT ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"775":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"OTHER EDITION ENTRY","e":{"desc":"Language code ","repeat":"NR"},"f":{"desc":"Country code ","repeat":"NR"},"g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"776":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ADDITIONAL PHYSICAL FORM ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"777":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"ISSUED WITH ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"}},"780":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"PRECEDING ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":"01234567","desc":"Type of relationship"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"785":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"SUCCEEDING ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":"012345678","desc":"Type of relationship"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standa rd Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"786":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"DATA SOURCE ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"j":{"desc":"Period of content ","repeat":"NR"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"p":{"desc":"Abbreviated title ","repeat":"NR"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"v":{"desc":"Source Contribution ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"787":{"6":{"desc":"Linkage ","repeat":"NR"},"7":{"desc":"Control subfield ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Main entry heading ","repeat":"NR"},"b":{"desc":"Edition ","repeat":"NR"},"c":{"desc":"Qualifying information ","repeat":"NR"},"d":{"desc":"Place, publisher, and date of publication ","repeat":"NR"},"desc":"NONSPECIFIC RELATIONSHIP ENTRY","g":{"desc":"Relationship information ","repeat":"R"},"h":{"desc":"Physical description ","repeat":"NR"},"i":{"desc":"Display text ","repeat":"NR"},"ind1":{"allowed":"01","desc":"Note controller"},"ind2":{"allowed":" 8","desc":"Display constant controller"},"k":{"desc":"Series data for related item ","repeat":"R"},"m":{"desc":"Material-specific details ","repeat":"NR"},"n":{"desc":"Note ","repeat":"R"},"o":{"desc":"Other item identifier ","repeat":"R"},"r":{"desc":"Report number ","repeat":"R"},"repeat":"R","s":{"desc":"Uniform title ","repeat":"NR"},"t":{"desc":"Title ","repeat":"NR"},"u":{"desc":"Standard Technical Report Number ","repeat":"NR"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"International Standard Serial Number ","repeat":"NR"},"y":{"desc":"CODEN designation ","repeat":"NR"},"z":{"desc":"International Standard Book Number ","repeat":"R"}},"800":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Personal name ","repeat":"NR"},"b":{"desc":"Numeration ","repeat":"NR"},"c":{"desc":"Titles and other words associated with a name ","repeat":"R"},"d":{"desc":"Dates associated with a name ","repeat":"NR"},"desc":"SERIES ADDED ENTRY--PERSONAL NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"013","desc":"Type of personal name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Attribution qualifier ","repeat":"R"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work  ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Fuller form of name ","repeat":"NR"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation  ","repeat":"NR"}},"810":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Corporate name or jurisdiction name as entry element ","repeat":"NR"},"b":{"desc":"Subordinate unit ","repeat":"R"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting or treaty signing ","repeat":"R"},"desc":"SERIES ADDED ENTRY--CORPORATE NAME","e":{"desc":"Relator term ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of corporate name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"811":{"4":{"desc":"Relator code ","repeat":"R"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Meeting name or jurisdiction name as entry element ","repeat":"NR"},"c":{"desc":"Location of meeting ","repeat":"NR"},"d":{"desc":"Date of meeting ","repeat":"NR"},"desc":"SERIES ADDED ENTRY--MEETING NAME","e":{"desc":"Subordinate unit ","repeat":"R"},"f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of meeting name entry element"},"ind2":{"allowed":" ","desc":"Undefined"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"n":{"desc":"Number of part/section/meeting ","repeat":"R"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"q":{"desc":"Name of meeting following jurisdiction name entry element ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"u":{"desc":"Affiliation ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"830":{"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Uniform title ","repeat":"NR"},"d":{"desc":"Date of treaty signing ","repeat":"R"},"desc":"SERIES ADDED ENTRY--UNIFORM TITLE","f":{"desc":"Date of a work ","repeat":"NR"},"g":{"desc":"Miscellaneous information ","repeat":"NR"},"h":{"desc":"Medium ","repeat":"NR"},"ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":"0-9","desc":"Nonfiling characters"},"k":{"desc":"Form subheading ","repeat":"R"},"l":{"desc":"Language of a work ","repeat":"NR"},"m":{"desc":"Medium of performance for music ","repeat":"R"},"n":{"desc":"Number of part/section of a work ","repeat":"R"},"o":{"desc":"Arranged statement for music ","repeat":"NR"},"p":{"desc":"Name of part/section of a work ","repeat":"R"},"r":{"desc":"Key for music ","repeat":"NR"},"repeat":"R","s":{"desc":"Version ","repeat":"NR"},"t":{"desc":"Title of a work ","repeat":"NR"},"v":{"desc":"Volume/sequential designation ","repeat":"NR"}},"841":{"desc":"HOLDINGS CODED DATA VALUES","repeat":"NR"},"842":{"desc":"TEXTUAL PHYSICAL FORM DESIGNATOR","repeat":"NR"},"843":{"desc":"REPRODUCTION NOTE","repeat":"R"},"844":{"desc":"NAME OF UNIT","repeat":"NR"},"845":{"desc":"TERMS GOVERNING USE AND REPRODUCTION NOTE","repeat":"R"},"850":{"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Holding institution ","repeat":"R"},"desc":"HOLDING INSTITUTION","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"},"852":{"2":{"desc":"Source of classification or shelving scheme ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Sequence number ","repeat":"NR"},"a":{"desc":"Location ","repeat":"NR"},"b":{"desc":"Sublocation or collection ","repeat":"R"},"c":{"desc":"Shelving location ","repeat":"R"},"desc":"LOCATION","e":{"desc":"Address ","repeat":"R"},"f":{"desc":"Coded location qualifier ","repeat":"R"},"g":{"desc":"Non-coded location qualifier ","repeat":"R"},"h":{"desc":"Classification part ","repeat":"NR"},"i":{"desc":"Item part ","repeat":"R"},"ind1":{"allowed":" 012345678","desc":"Shelving scheme"},"ind2":{"allowed":" 012","desc":"Shelving order"},"j":{"desc":"Shelving control number ","repeat":"NR"},"k":{"desc":"Call number prefix ","repeat":"R"},"l":{"desc":"Shelving form of title ","repeat":"NR"},"m":{"desc":"Call number suffix ","repeat":"R"},"n":{"desc":"Country code ","repeat":"NR"},"p":{"desc":"Piece designation ","repeat":"NR"},"q":{"desc":"Piece physical condition ","repeat":"NR"},"repeat":"R","s":{"desc":"Copyright article-fee code ","repeat":"R"},"t":{"desc":"Copy number ","repeat":"NR"},"x":{"desc":"Nonpublic note ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"853":{"desc":"CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"854":{"desc":"CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL","repeat":"R"},"855":{"desc":"CAPTIONS AND PATTERN--INDEXES","repeat":"R"},"856":{"2":{"desc":"Access method ","repeat":"NR"},"3":{"desc":"Materials specified ","repeat":"NR"},"6":{"desc":"Linkage ","repeat":"NR"},"8":{"desc":"Field link and sequence number ","repeat":"R"},"a":{"desc":"Host name ","repeat":"R"},"b":{"desc":"Access number ","repeat":"R"},"c":{"desc":"Compression information ","repeat":"R"},"d":{"desc":"Path ","repeat":"R"},"desc":"ELECTRONIC LOCATION AND ACCESS","f":{"desc":"Electronic name ","repeat":"R"},"h":{"desc":"Processor of request ","repeat":"NR"},"i":{"desc":"Instruction ","repeat":"R"},"ind1":{"allowed":" 012347","desc":"Access method"},"ind2":{"allowed":" 0128","desc":"Relationship"},"j":{"desc":"Bits per second ","repeat":"NR"},"k":{"desc":"Password ","repeat":"NR"},"l":{"desc":"Logon ","repeat":"NR"},"m":{"desc":"Contact for access assistance ","repeat":"R"},"n":{"desc":"Name of location of host ","repeat":"NR"},"o":{"desc":"Operating system ","repeat":"NR"},"p":{"desc":"Port ","repeat":"NR"},"q":{"desc":"Electronic format type ","repeat":"NR"},"r":{"desc":"Settings ","repeat":"NR"},"repeat":"R","s":{"desc":"File size ","repeat":"R"},"t":{"desc":"Terminal emulation ","repeat":"R"},"u":{"desc":"Uniform Resource Identifier ","repeat":"R"},"v":{"desc":"Hours access method available ","repeat":"R"},"w":{"desc":"Record control number ","repeat":"R"},"x":{"desc":"Nonpublic note ","repeat":"R"},"y":{"desc":"Link text ","repeat":"R"},"z":{"desc":"Public note ","repeat":"R"}},"863":{"desc":"ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"864":{"desc":"ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL","repeat":"R"},"865":{"desc":"ENUMERATION AND CHRONOLOGY--INDEXES","repeat":"R"},"866":{"desc":"TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"867":{"desc":"TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL","repeat":"R"},"868":{"desc":"TEXTUAL HOLDINGS--INDEXES","repeat":"R"},"876":{"desc":"ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT","repeat":"R"},"877":{"desc":"ITEM INFORMATION--SUPPLEMENTARY MATERIAL","repeat":"R"},"878":{"desc":"ITEM INFORMATION--INDEXES","repeat":"R"},"880":{"6":{"desc":"Linkage","repeat":"NR"},"desc":"ALTERNATE GRAPHIC REPRESENTATION","repeat":"R"},"886":{"0":{"desc":"Foreign MARC subfield","repeat":"NR"},"1":{"desc":"Foreign MARC subfield","repeat":"NR"},"2":{"desc":"Source of data","repeat":"NR"},"3":{"desc":"Source of data","repeat":"NR"},"4":{"desc":"Source of data","repeat":"NR"},"5":{"desc":"Source of data","repeat":"NR"},"6":{"desc":"Source of data","repeat":"NR"},"7":{"desc":"Source of data","repeat":"NR"},"8":{"desc":"Source of data","repeat":"NR"},"9":{"desc":"Source of data","repeat":"NR"},"a":{"desc":"Tag of the foreign MARC field","repeat":"NR"},"b":{"desc":"Content of the foreign MARC field","repeat":"NR"},"c":{"desc":"Foreign MARC subfield","repeat":"NR"},"d":{"desc":"Foreign MARC subfield","repeat":"NR"},"desc":"FOREIGN MARC INFORMATION FIELD","e":{"desc":"Foreign MARC subfield","repeat":"NR"},"f":{"desc":"Foreign MARC subfield","repeat":"NR"},"g":{"desc":"Foreign MARC subfield","repeat":"NR"},"h":{"desc":"Foreign MARC subfield","repeat":"NR"},"i":{"desc":"Foreign MARC subfield","repeat":"NR"},"ind1":{"allowed":"012","desc":"Type of field"},"ind2":{"allowed":" ","desc":"Undefined"},"j":{"desc":"Foreign MARC subfield","repeat":"NR"},"k":{"desc":"Foreign MARC subfield","repeat":"NR"},"l":{"desc":"Foreign MARC subfield","repeat":"NR"},"m":{"desc":"Foreign MARC subfield","repeat":"NR"},"n":{"desc":"Foreign MARC subfield","repeat":"NR"},"o":{"desc":"Foreign MARC subfield","repeat":"NR"},"p":{"desc":"Foreign MARC subfield","repeat":"NR"},"q":{"desc":"Foreign MARC subfield","repeat":"NR"},"r":{"desc":"Foreign MARC subfield","repeat":"NR"},"repeat":"R","s":{"desc":"Foreign MARC subfield","repeat":"NR"},"t":{"desc":"Foreign MARC subfield","repeat":"NR"},"u":{"desc":"Foreign MARC subfield","repeat":"NR"},"v":{"desc":"Foreign MARC subfield","repeat":"NR"},"w":{"desc":"Foreign MARC subfield","repeat":"NR"},"x":{"desc":"Foreign MARC subfield","repeat":"NR"},"y":{"desc":"Foreign MARC subfield","repeat":"NR"},"z":{"desc":"Foreign MARC subfield","repeat":"NR"}},"887":{"2":{"desc":"Source of data","repeat":"NR"},"a":{"desc":"Content of non-MARC field","repeat":"NR"},"desc":"NON-MARC INFORMATION FIELD","ind1":{"allowed":" ","desc":"Undefined"},"ind2":{"allowed":" ","desc":"Undefined"},"repeat":"R"}};
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/marc_validate.js b/Evergreen/staff_client/chrome/content/evergreen/cat/marc_validate.js
deleted file mode 100644 (file)
index 9dabff6..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-var rule_warnings = [];
-var tag_seen;
-
-function explain_marc() {
-       var s = '';
-       for (var w in rule_warnings) {
-               s = s + rule_warnings[w];
-       }
-       alert(s);
-}
-
-function legend_marc() {
-       var s = '';
-       var rows = document.getElementById('ctrl_rows').childNodes;
-       for (var r in rows) {
-               if (    (typeof(rows[r]) == 'object') &&
-                       (rows[r].tagName == 'row') &&
-                       (rows[r].getAttribute('hidden') != 'true')
-               ) {
-                       var tagnumber = rows[r].firstChild.firstChild.value;
-                       if ((marc_rules[tagnumber])&&(marc_rules[tagnumber].desc)) {
-                               s = s + tagnumber + '\t' + marc_rules[tagnumber].desc + '\n';
-                       } else {
-                               s = s + tagnumber + '\n';
-                       }
-               }
-       }
-       rows = document.getElementById('data_rows').childNodes;
-       for (var r in rows) {
-               if (    (typeof(rows[r]) == 'object') &&
-                       (rows[r].tagName == 'row') &&
-                       (rows[r].getAttribute('hidden') != 'true')
-               ) {
-                       var tagnumber = rows[r].firstChild.firstChild.value;
-                       if ((marc_rules[tagnumber])&&(marc_rules[tagnumber].desc)) {
-                               s = s + tagnumber + '\t' + marc_rules[tagnumber].desc + '\n';
-                       } else {
-                               s = s + tagnumber + '\n';
-                       }
-               }
-       }
-       alert(s);
-
-}
-
-function handle_tag_change(ev) {
-       mw.sdump('D_CAT','Entering handle_tag_change: ' + timer_elapsed('cat') + '\n');
-       try {
-       rule_warnings = []; disable_widgets('explain_marc');
-       tag_seen = {};
-       var rows = document.getElementById('ctrl_rows').childNodes;
-       for (var r in rows) {
-               if ((typeof(rows[r]) == 'object')&&(rows[r].tagName == 'row')) {
-                       test_tagnumber_rule(rows[r]);
-               }
-       }
-       rows = document.getElementById('data_rows').childNodes;
-       for (var r in rows) {
-               if (    (typeof(rows[r]) == 'object') &&
-                       (rows[r].tagName == 'row') &&
-                       (rows[r].getAttribute('hidden') != 'true')
-               ) {
-                       test_tagnumber_rule(rows[r]);
-                       test_ind1_rule(rows[r]);
-                       test_ind2_rule(rows[r]);
-                       test_subfield_rule(rows[r]);
-               }
-       }
-       if (rule_warnings.length > 0) { 
-               enable_widgets('explain_marc'); }
-       } catch(E) {
-               handle_error(E);
-       }
-       mw.sdump('D_CAT','Exiting handle_tag_change: ' + timer_elapsed('cat') + '\n');
-}
-
-function test_tagnumber_rule(r) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       try {
-       var t = r.firstChild.firstChild;
-       if (t.value.length > 3) { 
-               t.value = t.value.substr(0,3); 
-       } else if (t.value.length < 3) {
-               switch(t.value.length) {
-                       case 2: t.value = '0' + t.value; break;
-                       case 1: t.value = '00' + t.value; break;
-                       case 0: t.value = '000'; break;
-               }
-       }
-       removeCSSClass(t,'invalid');
-       if (marc_rules[t.value]) {
-               var rule = marc_rules[t.value];
-               if (tag_seen[t.value]) { tag_seen[t.value]++; } else { tag_seen[t.value] = 1; }
-               if ( (rule.repeat == 'NR') && (tag_seen[t.value] > 1) ) {
-                       addCSSClass(t,'invalid');
-                       var s = 'Tag ' + t.value + ' should be Non-Repeating\n';
-                       rule_warnings.push(s); mw.sdump('D_CAT',s);
-               }
-       } else if (t.value != 'LDR') {
-               addCSSClass(t,'invalid');
-               var s = 'Tag ' + t.value + ' is unknown.\n';
-               rule_warnings.push(s); mw.sdump('D_CAT',s);
-       }
-       } catch(E) {
-               handle_error();
-       }
-}
-
-function test_ind1_rule(r) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       var tagnumber = r.childNodes[0].firstChild.value;
-       var ind1 = r.childNodes[1].firstChild;
-       removeCSSClass(ind1,'invalid');
-       if ((marc_rules[tagnumber]) && (marc_rules[tagnumber].ind1)) {
-               var regex = '/^[' + marc_rules[tagnumber].ind1.allowed + ']$/';
-               if (! ind1.value.match(eval(regex)) ) {
-                       addCSSClass(ind1,'invalid');
-                       var s = 'Tag ' + tagnumber + ' Indicator 1 should be one of these characters: "' + marc_rules[tagnumber].ind1.allowed + '"\n';
-                       rule_warnings.push(s); mw.sdump('D_CAT',s);
-               }
-       }
-}
-
-function test_ind2_rule(r) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       var tagnumber = r.childNodes[0].firstChild.value;
-       var ind2 = r.childNodes[2].firstChild;
-       removeCSSClass(ind2,'invalid');
-       if ((marc_rules[tagnumber]) && (marc_rules[tagnumber].ind2)) {
-               var regex = '/^[' + marc_rules[tagnumber].ind2.allowed + ']$/';
-               if (! ind2.value.match(eval(regex)) ) {
-                       addCSSClass(ind2,'invalid');
-                       var s = 'Tag ' + tagnumber + ' Indicator 2 should be one of these characters: "' + marc_rules[tagnumber].ind2.allowed + '"\n';
-                       rule_warnings.push(s); mw.sdump('D_CAT',s);
-               }
-       }
-}
-
-function test_subfield_rule(r) {
-       // rows (rows) -> row (r) -> wrapper (w) -> textbox (t)
-       var tagnumber = r.childNodes[0].firstChild.value;
-       var data = r.childNodes[3].firstChild;
-       removeCSSClass(data,'invalid');
-       if (marc_rules[tagnumber]) {
-               var datastring = data.value.replace(/^\s+/,'').replace(/\s+$/,'');
-               var subf_array = datastring.split(String.fromCharCode(8225));
-               if ( (subf_array[0] == '')||(subf_array[0] == null) ) {
-                       subf_array.shift();
-               } else {
-                       addCSSClass(data,'invalid');
-                       var s = 'DEBUG: Need to add code to make an implicit subfield-a\n';
-                       rule_warnings.push(s); mw.sdump('D_CAT',s);
-                       subf_array.shift();
-               }
-               var subf_seen = {};
-               for (var i in subf_array) {
-                       if ((subf_array[i]=='')||(subf_array==null)) { 
-                               addCSSClass(data,'invalid');
-                               var s = 'You have incomplete subfield delimiters.\n';
-                               rule_warnings.push(s); mw.sdump('D_CAT',s);
-                               continue;
-                       }
-                       var s_ind = subf_array[i].substr(0,1);
-                       if (subf_seen[s_ind]) { subf_seen[s_ind]++; } else { subf_seen[s_ind] = 1; }
-                       var rule = marc_rules[tagnumber][s_ind];
-                       if (rule) {
-                               if ( (rule.repeat == 'NR') && (subf_seen[s_ind]>1) ) {
-                                       addCSSClass(data,'invalid');
-                                       var s = 'Tag ' + tagnumber + ' subfield-' + s_ind + ' should be Non-Repeating\n';
-                                       rule_warnings.push(s); mw.sdump('D_CAT',s);
-                               }
-                       } else {
-                               addCSSClass(data,'invalid');
-                               var s = 'Tag ' + tagnumber + ' does not have a subfield-' + s_ind + '\n';
-                               rule_warnings.push(s); mw.sdump('D_CAT',s);
-                       }
-               }
-       }
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/record_list.js b/Evergreen/staff_client/chrome/content/evergreen/cat/record_list.js
deleted file mode 100644 (file)
index 1dd5af3..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-mw.sdump('D_CAT','Parsing record_list.js\n');
-
-var test_hash = { 'a' : '123' } ;
-
-function my_init() {
-       timer_init('cat');
-       mw.sdump('D_CAT','TESTING: record_list.js: ' + mw.G['main_test_variable'] + '\n');
-       mw.sdump('D_CAT','test_hash = ' + js2JSON(test_hash) + '\n');
-       mw.sdump('D_CAT','search_term = ' + search_term + '  search_type = ' + search_type + '  search_order = ' + search_order + '  search_location = ' + search_location + '\n');
-       var b = document.getElementById('count_copy_toggle');
-       b.setAttribute('label','Click to Show Records for All Libraries');
-       b.setAttribute('alt_label','Click to Show Only Records with Copies at ' + find_ou(mw.G['org_tree'],search_location).name());
-       b.setAttribute('value','-1');
-       b.setAttribute('oncommand','toggle_view(event);');
-
-       search();
-}
-
-function toggle_view(ev) {
-       var b = ev.target;
-       var value = b.getAttribute('value');
-       var label = b.getAttribute('label');
-       var alt_label = b.getAttribute('alt_label');
-       var temp = label; label = alt_label; alt_label = temp;
-       b.setAttribute('label',label); b.setAttribute('alt_label',alt_label);
-       b.setAttribute('value',-value);
-       var rows = document.getElementById('record_list_tree_children');
-       var nl = rows.getElementsByTagName('treeitem');
-       for (var i in nl) {
-               if (typeof(nl[i])=='object') {
-                       var treeitem = nl[i];
-                       var treerow = treeitem.firstChild;
-                       var copy_count_cell = treerow.lastChild;
-                       var copy_count = copy_count_cell.getAttribute('label');
-                       if (value == '-1') {
-                               treeitem.setAttribute('hidden','false');
-                       } else {
-                               if (copy_count == '0') {
-                                       treeitem.setAttribute('hidden','true');
-                               }
-                       }
-               }
-       }
-}
-
-function search() {
-       var result;
-       mw.sdump('D_CAT','search_type = ' + search_type + '  search_order = ' + search_order + '  search_term = ' + search_term + '\n');
-       switch(search_type) {
-               case 'tcn':
-                       try {
-                               result = user_request(
-                                       'open-ils.search',
-                                       'open-ils.search.cat.biblio.tcn',
-                                       [ search_term ]
-                               );
-                       } catch(E) {
-                               handle_error(E);
-                       }
-                       break;
-               default:
-                       try {
-                               result = user_request(
-                                       'open-ils.search',
-                                       'open-ils.search.cat.biblio.class',
-                                       [ search_location, search_type, search_order, search_term ]
-                               );
-                       } catch(E) {
-                               handle_error(E);
-                       }
-                       break;
-       }
-       // populate record_list with results
-       //mw.sdump('D_CAT', js2JSON( result ) + '\n');
-       var tc = document.getElementById('record_list_tree_children');
-       for (var i in result) {
-               if (typeof(result[i])=='object') {
-                       var data = result[i];
-                       var item = make_treeitem(data['doc_id']);
-                       var row = make_treerow(
-                               data['title'],
-                               data['author'],
-                               data['tcn'],
-                               data['publisher'],
-                               data['pubdate'],
-                               data['isbn'],
-                               data['isbn'],
-                               data['copy_count']
-                       );
-                       if (data['copy_count'] == 0) {
-                               item.setAttribute('hidden','true');
-                       }
-                       item.appendChild( row );
-                       tc.appendChild( item );
-               } else {
-                       //mw.sdump('D_CAT','unexpected typeof(result['+i+']) = ' + typeof(result[i]) + ' : ' + result[i] + '\n');
-               }
-       }
-}
-
-function make_treeitem(owner_doc) {
-       var treeitem = document.createElement('treeitem');
-       treeitem.setAttribute('id',owner_doc);
-       //mw.sdump('D_CAT','treeitem = ' + treeitem + '\n');
-       return treeitem;
-}
-
-function make_treerow() {
-       var treerow = document.createElement('treerow');
-       //mw.sdump('D_CAT','treerow = ' + treerow + '\n');
-       //mw.sdump('D_CAT','arguments.length = ' + arguments.length + ' arguments = ' + js2JSON(arguments) + '\n');
-       for (var i = 0; i < arguments.length; i++) {
-               //mw.sdump('D_CAT',i + ' : ' + arguments[i] + '\n');
-               var treecell = document.createElement('treecell');
-               //mw.sdump('D_CAT','treecell = ' + treecell + '\n');
-               var text = '';
-               if (typeof(arguments[i])=='object') {
-                       for (var j in arguments[i]) {
-                               text = text + arguments[i][j] + ' / ';
-                       }
-               } else {
-                       text = arguments[i];
-               }
-               treecell.setAttribute('label',text);
-               treerow.appendChild(treecell);
-       }
-       return treerow;
-}
-
-function spawn_editors(tab) {
-       var hitlist = document.getElementById('record_list_tree');
-       var start = new Object();
-       var end = new Object();
-       var numRanges = hitlist.view.selection.getRangeCount();
-       for (var t=0; t<numRanges; t++){
-               hitlist.view.selection.getRangeAt(t,start,end);
-               for (var v=start.value; v<=end.value; v++){
-                       var i = hitlist.contentView.getItemAtIndex(v);
-                       mw.sdump('D_CAT',i.tagName + '\n');
-                       var params = [
-                               i.getAttribute('id'),
-                               i.firstChild.childNodes[0].getAttribute('label'),
-                               i.firstChild.childNodes[1].getAttribute('label'),
-                               i.firstChild.childNodes[2].getAttribute('label'),
-                               i.firstChild.childNodes[3].getAttribute('label'),
-                               i.firstChild.childNodes[4].getAttribute('label'),
-                               i.firstChild.childNodes[5].getAttribute('label'),
-                               i.firstChild.childNodes[6].getAttribute('label')
-                       ];
-                       var w = spawn_marc_editor(
-                               window.app_shell,'new_tab','main_tabbox', {
-                                       'find_this_id' : params[0],
-                                       'record_columns' : params
-                               }
-                       );
-                       w.find_this_id = params[0];
-                       w.record_columns = params;
-               }
-       }
-}
-
-function spawn_browsers(tab) {
-       var hitlist = document.getElementById('record_list_tree');
-       var start = new Object();
-       var end = new Object();
-       var numRanges = hitlist.view.selection.getRangeCount();
-       for (var t=0; t<numRanges; t++){
-               hitlist.view.selection.getRangeAt(t,start,end);
-               for (var v=start.value; v<=end.value; v++){
-                       var i = hitlist.contentView.getItemAtIndex(v);
-                       mw.sdump('D_CAT',i.tagName + '\n');
-                       var params = [ i.getAttribute('id') ];
-                       var w = spawn_copy_browser(
-                               window.app_shell,'new_tab','main_tabbox', {
-                                       'find_this_id' : params[0],
-                                       'record_columns' : params
-                               }
-                       );
-                       w.find_this_id = params[0];
-                       w.record_columns = params;
-               }
-       }
-}
-
-/*
-function spawn_copy_browser(tab,params) {
-       mw.sdump('D_CAT','trying to spawn_marc_editor('+params[0]+')\n');
-       var w;
-       var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
-       if (tab) {
-               tabWindow.new_tab('main_tabbox');
-               w = tabWindow.replace_tab('main_tabbox','COPIES',chrome);
-       } else {
-               w = mw.new_window( chrome );
-       }
-       w.find_this_id = params[0];
-       w.record_columns = params;
-}
-
-
-function spawn_marc_editor(tab,params) {
-       mw.sdump('D_CAT','trying to spawn_marc_editor('+params[0]+')\n');
-       var w;
-       var chrome = 'chrome://evergreen/content/cat/marc.xul';
-       if (tab) {
-               tabWindow.new_tab('main_tabbox');
-               w = tabWindow.replace_tab('main_tabbox','MARC',chrome);
-       } else {
-               w = mw.new_window( chrome );
-       }
-       w.find_this_id = params[0];
-       w.record_columns = params;
-}
-*/
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/record_list.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/record_list.xul
deleted file mode 100644 (file)
index ca88d29..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: Cataloger's Search Result Screen -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/cat.dtd">
-
-<page id="record_list_win" title="&record_list.win_title;" 
-       orient="vertical" style="overflow: scroll"
-       onload="my_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/record_list_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="record_list_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="record_list_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="record_list_keys" />
-
-       <!-- Context menus -->
-       <popupset id="record_list_popupset" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="record_list_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/record_list_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/record_list_overlay.xul
deleted file mode 100644 (file)
index 85718ab..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="record_list_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="record_list_js">
-       <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
-       <util id="util_js"/>
-       <script src="record_list.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="record_list_cmds">
-       <command id="cmd_edit_record" oncommand="spawn_editors(false);"/>
-       <command id="cmd_edit_record_tab" oncommand="spawn_editors(true);"/>
-       <command id="cmd_browse_record" oncommand="spawn_browsers(false);"/>
-       <command id="cmd_browse_record_tab" oncommand="spawn_browsers(true);"/>
-       <command id="cmd_alert" oncommand="alert('Not Yet Implemented');"/>
-</commandset>
-
-<!-- Context menus -->
-<popupset id="record_list_popupset">
-       <popup id="record_menu">
-               <menuitem label="&cat.popup.edit_record.tab;" command="cmd_edit_record_tab"/>
-               <menuitem label="&cat.popup.edit_record.window;" command="cmd_edit_record"/>
-               <menuitem label="&cat.popup.browse_record.tab;" command="cmd_browse_record_tab"/>
-               <menuitem label="&cat.popup.browse_record.window;" command="cmd_browse_record"/>
-               <menuitem label="&cat.popup.add_to_bucket;" oncommand="
-                       alert('Not Yet Implemented');
-               "/>
-       </popup>
-</popupset>
-
-<!-- The top level widget for the cat client -->
-<vbox id="record_list_vbox" flex="1">
-       <button id="count_copy_toggle" label="Show Results For All Libraries"/>
-       <tree id="record_list_tree"/>
-</vbox>
-
-<tree id="record_list_tree" enableColumnDrag="true" flex="1">
-       <treecols>
-               <treecol id="record_list_title" label="&record_list.title;" flex="2"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_author" label="&record_list.author;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_tcn" label="&record_list.tcn;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_publisher" label="&record_list.publisher;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_pubyear" label="&record_list.pubyear;" flex="1"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_isbn" label="&record_list.isbn;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_issn" label="&record_list.issn;" flex="1" hidden="true"/>
-               <splitter class="tree-splitter"/>
-               <treecol id="record_list_copy_count" label="&record_list.copy_count;" flex="1" hidden="true"/>
-       </treecols>
-       <treechildren id="record_list_tree_children" context="record_menu"/>
-</tree>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="record_list_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul
deleted file mode 100644 (file)
index 5071121..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="spine_label" title="Spine Label Wizard"
-       orient="vertical" style="overflow: auto"
-       onload="spine_label_init()" width="800" height="600"
-       onwizardfinish="print_all_labels()"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <script>
-       <![CDATA[
-
-               var spine_labels;
-
-               function spine_label_init() {
-                       try { spine_labels = params.spine_labels; } catch(E) { sdump('D_ERROR',js2JSON(E) + '\n'); }
-                       if (!spine_labels) spine_labels = [ [ 'A Call Number', '1' ] ];
-                       var rows = document.getElementById('page1_rows');
-                       for (var i = 0; i < spine_labels.length; i++) {
-                               var sl = spine_labels[i];
-                               var label = sl[0];
-                               var count = sl[1];
-                               var row = document.createElement('row'); rows.appendChild(row);
-                               var btn = document.createElement('button'); row.appendChild(btn);
-                                       btn.setAttribute('label','Test Print');
-                               var label_tb = document.createElement('textbox'); row.appendChild(label_tb);
-                                       label_tb.setAttribute('multiline','true');
-                                       label_tb.setAttribute('value',label);
-                                       label_tb.setAttribute('name','label_' + i);
-                               var count_tb = document.createElement('textbox'); row.appendChild(count_tb);
-                                       count_tb.setAttribute('multiline','true');
-                                       count_tb.setAttribute('value',count);
-                                       count_tb.setAttribute('name','count_' + i);
-                               btn.addEventListener('command',
-                                       function() {
-                                               sPrint(label2html(label_tb.value), false, { 'marginLeft' : document.getElementById('margin') } );       
-                                       }, false
-                               );
-                       }
-               }
-
-               function print_all_labels() {
-                       var html = '';
-                       for (var i = 0; i < spine_labels.length; i++) {
-                               var label = document.getElementsByAttribute('name','label_'+i)[0].value;
-                               var count = document.getElementsByAttribute('name','count_'+i)[0].value;
-                               for (var j = 0; j < count; j++) {
-                                       html += label2html(label);
-                               }
-                       }
-                       sPrint(html, false);
-               }
-
-               function label2html(s) {
-                       var html = '';
-                       var a = s.split('\n');
-                       for (var i = 0; i < document.getElementById('rows').value; i++) {
-                               if (typeof a[i] != 'undefined' ) {
-                                       html += a[i].substr(0,document.getElementById('cols').value);
-                               }
-                               html += print_crlf;
-                       }
-                       for (var i = 0; i < document.getElementById('between').value; i++) {
-                               html += print_crlf;
-                       }
-                       return html;
-               }
-
-       ]]>
-       </script>
-
-
-       <wizardpage id="page1" description="Printing Spine Labels" onpageadvanced="">
-               <grid>
-                       <columns> <column flex="0" /> <column flex="1" /> <column flex="0" /> </columns>
-                       <rows id="page1_rows">
-                               <row><spacer/><description>For this Pre-Beta release, we're focusing on the dot-matrix printers used by PINES (OKI MICROLINE 320 Turbo 9 Pin Printer).  In the future, we will support all manner of label sheets with various printers.  We'll also have optional template variables for things like shelving location, copy number, and barcode.  For now, please check the character dimensions for a spine label, the number of lines between labels, and the left-margin for the printer:</description><grid><columns><column/><column/></columns><rows><row><label value="Left Margin"/><textbox id="margin" value=".63"/></row><row><label value="Columns"/><textbox id="cols" value="9"/></row><row><label value="Rows"/><textbox id="rows" value="9"/></row><row><label value="Lines Between"/><textbox id="between" value="2"/></row></rows></grid></row>
-                               <row><spacer/></row>
-                               <row><spacer/><label value="Label" /><label value="Print This Many"/></row>
-                       </rows>
-               </grid>
-       </wizardpage>
-
-</wizard>
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js b/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js
deleted file mode 100644 (file)
index 0bd5051..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-var data = {}; var data_backup; var cn_list = [];
-var new_id = -1;
-
-function my_init() {
-       mw.sdump('D_CAT','entering my_init for volume.js\n');
-       mw.sdump('D_CAT','TESTING: volume.js: ' + mw.G['main_test_variable'] + '\n');
-       mw.sdump('D_CAT','record_id = ' + record_id + '\n');
-       mw.sdump('D_CAT','tree_items: ' + tree_items + '\n');
-       if (params.shortcut == 'volume_add') {
-               build_page_one();
-       } else if (params.shortcut == 'copy_add') {
-               build_page_two();
-       } else {
-               mw.sdump('D_CAT','broken\n');
-       }
-       listen_for_enter('volume_add');
-       mw.sdump('D_CAT','exiting my_init for volume.js\n');
-}
-
-function listen_for_enter(w) {
-       if (typeof(w) != 'object') {
-               w = document.getElementById(w);
-       }
-       w.addEventListener('keypress',
-               function (ev) {
-                       mw.sdump('D_CAT','wizard: ev.target.tagName = ' + ev.target.tagName + '\n');
-                       mw.sdump('D_CAT','\tev.keyCode = ' + ev.keyCode + '\n');
-                       mw.sdump('D_CAT','\tev.charCode = ' + ev.charCode + '\n');
-                       if ((ev.target.tagName == 'textbox') && (ev.keyCode == 13)) {
-                               ev.preventDefault();
-                               ev.stopPropagation(); // XBL bindings? bleh
-                               fake_tab_for_textboxes(w,ev.target);
-                               return true;
-                       }
-               },
-               true
-       );
-}
-
-function page1_add_volume_row(ou) {
-       var row = document.createElement('row');
-               row.setAttribute('id','p1_' + ou.id());
-       document.getElementById('page1_rows').appendChild(row);
-       var label = document.createElement('label');
-               label.setAttribute('value',ou.name());
-       row.appendChild(label);
-       var textbox = document.createElement('textbox');
-               textbox.setAttribute('size','1');
-               textbox.setAttribute('value','0');
-       row.appendChild(textbox);
-}
-
-function page2_add_volume_row(ou,ti) {
-       mw.sdump('D_CAT','page2_add_volume_row...\n');
-       var desired_volumes = 
-               document.getElementById('p1_' + ou.id()).lastChild.value;
-       mw.sdump('D_CAT','ou = ' + ou.name() + '  desired = ' + desired_volumes + '\n');
-       if (desired_volumes > 0) { } else { return; }
-       var rows = document.getElementById('page2_rows');
-       var row = document.createElement('row');
-       rows.appendChild(row);
-       var label = document.createElement('label');
-               label.setAttribute('value',ou.name());
-       row.appendChild(label);
-       for (var i = 0; i < desired_volumes; i++) {
-               var cn_row = document.createElement('row');
-                       //cn_row.setAttribute('id','p2_'+ou.id());
-                       cn_row.setAttribute('ou_name',ou.name());
-                       cn_row.setAttribute('ou_id',ou.id());
-                       //cn_row.setAttribute('spine_row','1');
-               rows.appendChild(cn_row);
-               cn_row.appendChild( document.createElement('label') );
-               var cn_text1 = document.createElement('textbox');
-                       cn_text1.setAttribute('size','20');
-                       cn_text1.setAttribute('value','A Call Number');
-                       //cn_text1.setAttribute('spine_cn','1');
-               cn_row.appendChild( cn_text1 );
-               var cn_text2 = document.createElement('textbox');
-                       cn_text2.setAttribute('size','4');
-                       cn_text2.setAttribute('value','0');
-               cn_row.appendChild( cn_text2 );
-               /*
-               var cn_text3 = document.createElement('textbox');
-                       cn_text3.setAttribute('size','4');
-                       cn_text3.setAttribute('value','0');
-                       cn_text3.setAttribute('spine_label_count','1');
-               cn_row.appendChild( cn_text3 );
-               */
-       }
-}
-
-function copy_add_page2_add_volume_row(ou,ti) {
-       mw.sdump('D_CAT','copy_add_page2_add_volume_row...\n');
-       var rows = document.getElementById('page2_rows');
-       var row = document.getElementById('page2_row_cn_' + ou.id() );
-       if (!row) {
-               row = document.createElement('row');
-               row.setAttribute('id','page2_row_cn' + ou.id() );
-               rows.appendChild(row);
-       }
-       var label = document.createElement('label');
-               label.setAttribute('value',ou.name());
-       row.appendChild(label);
-               var cn_row = document.createElement('row');
-                       //cn_row.setAttribute('id','p2_'+ou.id());
-                       cn_row.setAttribute('ou_name',ou.name());
-                       cn_row.setAttribute('ou_id',ou.id());
-                       cn_row.setAttribute('volume_id',ti.getAttribute('volume_id'));
-                       //cn_row.setAttribute('spine_row','1');
-               rows.appendChild(cn_row);
-               cn_row.appendChild( document.createElement('label') );
-               var cn_text1 = document.createElement('textbox');
-                       cn_text1.setAttribute('size','20');
-                       cn_text1.setAttribute('volume_id',ti.getAttribute('volume_id'));
-                       cn_text1.setAttribute('value',ti.getAttribute('callnumber'));
-                       //cn_text1.setAttribute('spine_cn','1');
-               cn_row.appendChild( cn_text1 );
-               cn_text1.disabled = true;
-               var cn_text2 = document.createElement('textbox');
-                       cn_text2.setAttribute('size','4');
-                       cn_text2.setAttribute('value','0');
-               cn_row.appendChild( cn_text2 );
-               /*
-               var cn_text3 = document.createElement('textbox');
-                       cn_text3.setAttribute('size','4');
-                       cn_text3.setAttribute('value','0');
-                       cn_text3.setAttribute('spine_label_count','1');
-               cn_row.appendChild( cn_text3 );
-               */
-}
-
-function page3_add_volume_row(id,data) {
-       if (data.length>0) { } else { return; }
-       var rows = document.getElementById('page3_rows');
-       var org_row = document.createElement('row');
-       rows.appendChild(org_row);
-               var org_label = document.createElement('label');
-                       org_label.setAttribute('value',data[0].name);
-               org_row.appendChild(org_label);
-       for (var i in data) {
-               var callnumber = data[i].callnumber;
-               var desired_copies = data[i].copies;
-               var cn_row = document.createElement('row');
-               rows.appendChild(cn_row);
-               var cn_box = document.createElement('hbox');
-               cn_row.appendChild(cn_box);
-               cn_box.appendChild( document.createElement('spacer') );
-               var cn_label = document.createElement('label');
-                       cn_label.setAttribute('value',callnumber);
-               cn_box.appendChild(cn_label);
-               for (var c = 0; c < desired_copies; c++) {
-                       var bc_row = document.createElement('row');
-                       rows.appendChild(bc_row);
-                       bc_row.appendChild( document.createElement('label') );
-                       var bc_text = document.createElement('textbox');
-                               bc_text.setAttribute('size','15');
-                               bc_text.setAttribute('ou_name',data[i].name);
-                               bc_text.setAttribute('ou_id',id);
-                               bc_text.setAttribute('volume_id',data[i].volume_id);
-                               bc_text.setAttribute('callnumber',callnumber);
-                       bc_row.appendChild(bc_text);
-               }
-       }
-}
-
-function page_four_add_volume_row(name,callnumber,barcode) {
-       mw.sdump('D_CAT','xul: name = ' + name + ' cn = ' + callnumber + ' bc = ' + barcode + '\n');
-       var listbox = document.getElementById('ephemeral_listbox');
-       var listitem = document.createElement('listitem');
-       listbox.appendChild(listitem);
-       var listcell1 = document.createElement('listcell');
-               listcell1.setAttribute('label',name);
-       listitem.appendChild(listcell1);
-       var listcell2 = document.createElement('listcell');
-               listcell2.setAttribute('label',callnumber);
-       listitem.appendChild(listcell2);
-       var listcell3 = document.createElement('listcell');
-               listcell3.setAttribute('label',barcode);
-       listitem.appendChild(listcell3);
-
-}
-
-function build_page_one() {
-       mw.sdump('D_CAT','build_page_one\n');
-       for (var i in tree_items) {
-               var ti = tree_items[i];
-               switch( ti.getAttribute('object_type') ) {
-                       case 'org_unit' :
-                               if (params.shortcut == 'volume_add') {
-                                       var id = ti.getAttribute('id').split('_')[2];
-                                       var ou = mw.G.org_tree_hash[id];
-                                       var check_ou = check_volume_ou_perm( id );
-                                       if ( check_ou ) {
-                                               page1_add_volume_row( check_ou );
-                                       }
-                               }
-                       break;
-               }
-       }
-}
-
-function build_page_two() {
-       mw.sdump('D_CAT','build_page_two\n');
-       for (var i in tree_items) {
-               var ti = tree_items[i];
-               mw.sdump('D_CAT','Considering item with object_type = ' + ti.getAttribute('object_type') + '\n');
-               switch( ti.getAttribute('object_type') ) {
-                       case 'org_unit' :
-                               var id = ti.getAttribute('id').split('_')[2];
-                               var ou = mw.G.org_tree_hash[id];
-                               var check_ou = check_volume_ou_perm( id );
-                               if ( check_ou ) {
-                                       page2_add_volume_row( check_ou, ti );
-                               }
-                       break;
-                       case 'volume' :
-                               if (params.shortcut == 'copy_add') {
-                                       var check_ou = find_ou( mw.G.user_ou , ti.getAttribute('ou_id') );
-                                       if (check_ou) {
-                                               copy_add_page2_add_volume_row( check_ou, ti );  
-                                       }
-                               }
-                       break;
-               }
-       }
-}
-
-function build_page_three() {
-       mw.sdump('D_CAT','build_page_three\n');
-       var rows = document.getElementById('page2_rows');
-       for (var i = 0; i < rows.childNodes.length; i++) {
-               var row = rows.childNodes[i];
-               mw.sdump('D_CAT',row + '\n');
-               var ou_id = row.getAttribute('ou_id');
-               var ou_name = row.getAttribute('ou_name');
-               var volume_id = row.getAttribute('volume_id');
-               if (ou_id) {
-                       var call_number = row.childNodes[1].value;
-                       if (!call_number) { continue; }
-                       var desired_copies = row.childNodes[2].value;
-                       if (!data[ou_id]) { data[ou_id] = []; }
-                       data[ou_id].push( 
-                               { 
-                                       'callnumber' : call_number, 
-                                       'copies' : desired_copies,
-                                       'name' : ou_name,
-                                       'volume_id' : volume_id
-                               } 
-                       );
-               }
-       }
-       for (var i in data) {
-               mw.sdump('D_CAT','i: ' + i + ' data[i]: ' + js2JSON(data[i]) + '\n');
-               page3_add_volume_row( i, data[i]);
-       }
-}
-
-function build_page_four() {
-       mw.sdump('D_CAT','build page four\n');
-       document.getElementById('volume_add').canAdvance = false;
-       var new_data = [];
-       var rows = document.getElementById('page3_rows');
-       var nl = rows.getElementsByTagName('textbox');
-        for (var i in nl) {
-                if (typeof(nl[i])=='object') {
-                        var t = nl[i];
-                        var ou_id = t.getAttribute('ou_id');
-                        var ou_name = t.getAttribute('ou_name');
-                        var callnumber = t.getAttribute('callnumber');
-                       var volume_id = t.getAttribute('volume_id');
-                        var barcode = t.value;
-                       //page_four_add_volume_row(ou_name,callnumber,barcode);
-                       mw.sdump('D_CAT','t.tagName = ' + t.tagName + ' ou_id = ' + ou_id + ' cn = ' + callnumber + ' volume_id = ' + volume_id + ' bc = ' + barcode + '\n');
-                       if (! new_data[ou_id] ) { new_data[ou_id] = {}; }
-                       if (! new_data[ou_id][callnumber] ) {
-                               new_data[ou_id][callnumber] = [];
-                       }
-                       if (! new_data[ou_id][callnumber]['barcode'] ) {
-                               new_data[ou_id][callnumber]['barcode'] = [];
-                       }
-                       new_data[ou_id][callnumber].barcode.push(barcode);
-                       if (params.shortcut == 'copy_add') {
-                               new_data[ou_id][callnumber].volume_id = volume_id;
-                       }
-                }
-        }
-       cn_list = [];
-       for (var ou_id in new_data) {
-               for (var cnum in new_data[ou_id]) {
-                       //var ou_shortname = find_ou(mw.G['org_tree'],ou_id).shortname();
-                       //var ou_shortname = mw.G.org_tree_hash[ou_id].shortname();
-                       var cn = new acn();
-                       cn.label(cnum);
-                       cn.owning_lib(ou_id);
-                       cn.record(record_id);
-                       if (params.shortcut == 'volume_add') {
-                               cn.isnew(1);
-                               cn.id(new_id--);
-                       } else if (params.shortcut == 'copy_add') {
-                               cn.id( new_data[ou_id][cnum].volume_id );
-                       }
-                       cn.copies([]);
-       
-                       for (var c in new_data[ou_id][cnum].barcode) {
-                               var cp = new acp();
-                               cp.id(new_id--);
-                               cp.isnew(1);
-                               cp.barcode(new_data[ou_id][cnum].barcode[c]);
-                               cp.circ_lib(    mw.G.org_tree_hash[ ou_id ]);
-                               cn.copies().push(cp);
-                               cp.stat_cat_entries( [] );
-                       }
-
-                       cn_list.push(cn);
-               }
-       }
-       mw.sdump('D_CAT','Final data object: ' + js2JSON(cn_list) + '\n');
-       mw.sdump('D_CAT','Final data object: ' + cn_list + '\n');
-       spawn_local_legacy_copy_editor();
-}
-
-function send_to_bill() {
-       mw.sdump('D_DEBUG','cn_list = \n' + js2JSON( cn_list ) + '\n');
-       try {
-               var result = user_request(
-                               'open-ils.cat',
-                               'open-ils.cat.asset.volume_tree.fleshed.batch.update',
-                               [ mw.G['auth_ses'][0], cn_list]
-               );
-               mw.sdump('D_CAT','volume_tree.fleshed.batch.update result: ' + js2JSON(result) + '\n');
-       } catch(E) {
-               handle_error(E);
-       }
-       var spine_labels = mw.map_list( 
-               cn_list, 
-               function(cn) { 
-                       var label = cn.label(); var copies = cn.copies();
-                       if (copies) { copies = copies.length; } else { copies = 0; }
-                       return [ label, copies ]; 
-               } 
-       );
-       //alert( window.app_shell );
-       try {
-               spawn_spine_label_wizard(document,'new_window','',{ 'spine_labels' : spine_labels }); 
-       } catch(E) {
-               sdump('D_ERROR', 'spine label: ' + js2JSON(E) + '\n');
-       }
-       refresh_spawning_browse_list();
-}
-
-function refresh_spawning_browse_list() {
-       try {
-               params.refresh_func();
-       } catch(E) {
-               mw.sdump('D_CAT','refresh_spawning_browse_list error: ' + js2JSON(E) + '\n');
-       }
-}
-
-function spawn_local_legacy_copy_editor(tab) {
-       mw.sdump('D_CAT','trying to spawn_copy_editor()\n');
-       var params = { 'select_all' : true };
-       var chrome = 'chrome://evergreen/content/cat/copy.xul';
-       var frame = document.getElementById('page4_iframe');
-       frame.setAttribute('src',chrome);
-       frame.setAttribute('flex','1');
-       frame.contentWindow.cn_list = cn_list;
-       frame.contentWindow.mw = mw;
-       frame.contentWindow.real_parentWindow = this;
-       frame.contentWindow.parentWindow = window.app_shell;
-       frame.contentWindow.params = params;
-}
-
-function backup_data() {
-       data_backup = data;
-}
-
-function restore_data() {
-       data = data_backup;
-}
-
-function check_volume_ou_perm(id) {
-       var top_ou = mw.G.org_tree_hash[ mw.G.user_ou.id() ];
-       var check_ou = find_ou(top_ou, id);
-       return check_ou;
-}
-
-// ***************************************************** Batch Volume Edit
-
-function volume_edit_init() {
-       mw.sdump('D_CAT','TESTING: volume.js: ' + mw.G['main_test_variable'] + '\n');
-       build_batch_edit_page1();
-       listen_for_enter('volume_edit');
-}
-
-function build_batch_edit_page1() {
-       var rows = document.getElementById('page1_rows');
-
-       var org = {};
-
-       for (var i = 0; i < tree_items.length; i++) {
-               var volume = tree_items[i];
-               if (!  org[ volume.getAttribute('ou_id') ] ) {
-                       org[ volume.getAttribute('ou_id') ] = new Array();
-               }
-               org[ volume.getAttribute('ou_id') ].push( volume );
-       }
-
-       for (var i in org) {
-               var row = document.createElement('row');
-               rows.appendChild(row);
-               var lib = document.createElement('label');
-               row.appendChild(lib);
-                       lib.setAttribute( 'value', mw.G.org_tree_hash[i].shortname() );
-
-               for (var j = 0; j < org[i].length; j++) {
-                       var volume = org[i][j];
-
-                       var vrow = document.createElement('row');
-                       rows.appendChild(vrow);
-                       vrow.appendChild( document.createElement('label') );
-
-                       var t = document.createElement('textbox');
-                       vrow.appendChild( t );
-                       t.value = volume.getAttribute('callnumber');
-                       t.setAttribute( 'original', volume.getAttribute('callnumber') );
-                       t.setAttribute( 'volume_id', volume.getAttribute('volume_id') );
-               }
-       }
-}
-
-function submit_edited_volumes() {
-       var nl = document.getElementsByTagName('textbox');
-       for (var i = 0; i < nl.length; i++) {
-               var t = nl[i];
-               if (t.getAttribute('original') == t.value) continue;
-               var cn = new acn();
-               cn.id( t.getAttribute('volume_id') );
-               cn.label( t.value );
-               cn.ischanged('1');
-               cn_list.push( cn );
-       }
-       send_to_bill();
-       mw.sdump('D_DEBUG','cn_list = \n' + js2JSON(cn_list) + '\n');
-}
-
-function spine_labels() {
-       var nl = document.getElementsByTagName('row');
-       var spine_labels = [];
-       for (var i = 0; i < nl.length; i++) {
-               var r = nl[i]; var cn = ''; var count = 0;
-               if (! r.getAttribute('spine_row')) continue;
-               for (var j = 0; j < r.childNodes.length; j++) {
-                       var c = r.childNodes[j];
-                       if (c.getAttribute('spine_cn')) cn = c.value;
-                       if (c.getAttribute('spine_label_count')) count = c.value;
-               }
-               spine_labels.push( [ cn, count ] );
-       }
-       mw.spawn_spine_label_wizard(document,'new_window','',{ 'spine_labels' : spine_labels }); 
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_overlay.xul
deleted file mode 100644 (file)
index 2386667..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="volume_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="volume_js">
-       <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
-       <util id="util_js"/>
-       <script src="volume.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="volume_cmds">
-       <command id="cmd_alert" oncommand="
-               alert('Feature Not Yet Implemented');
-       "/>
-       <command id="cmd_batch_edit" oncommand="
-               spawn_local_legacy_copy_editor();       
-       "/>
-</commandset>
-
-<wizardpage id="page1" description="&volume.wizard.page1;" onpageadvanced="build_page_two();">
-       <groupbox>
-               <caption label="How many volumes?"/>
-               <grid>
-                       <columns> <column flex="0"/> <column flex="0"/> </columns>
-                       <rows id="page1_rows"/>
-               </grid>
-       </groupbox>
-</wizardpage>
-
-<wizardpage id="page2" description="&volume.wizard.page2;" onpageadvanced="build_page_three()" onpagerewound="var rows = document.getElementById('page2_rows'); while (rows.childNodes.length > 1) { rows.removeChild(rows.lastChild); }">
-       <groupbox>
-               <caption label="What call numbers and how many copies?"/>
-               <grid>
-                       <columns>
-                               <column flex="0"/>
-                               <column flex="0"/>
-                               <column flex="0"/>
-                       </columns>
-                       <rows id="page2_rows">
-                               <row>
-                                       <label />
-                                       <label value="Call Number" />
-                                       <label value="# of Copies" />
-                                       <!--
-                                       <label value="# of Spine Labels" />
-                                       -->
-                               </row>
-                       </rows>
-               </grid>
-               <!--
-               <hbox>
-                       <button label="Edit and Print Spine Labels" accesskey="E" oncommand="spine_labels()"/>
-               </hbox>
-               -->
-       </groupbox>
-</wizardpage>
-
-<wizardpage id="page3" description="&volume.wizard.page3;" onpageadvanced="backup_data(); build_page_four()" onpagerewound="var rows = document.getElementById('page3_rows'); while (rows.childNodes.length > 1) { rows.removeChild(rows.lastChild); }">
-       <groupbox>
-               <caption label="What are the barcodes?"/>
-               <grid>
-                       <columns>
-                               <column flex="0"/> <column flex="0"/>
-                       </columns>
-                       <rows id="page3_rows">
-                               <row>
-                                       <label value="" />
-                                       <label value="Barcode" />
-                               </row>
-                       </rows>
-               </grid>
-       </groupbox>
-</wizardpage>
-
-<wizardpage id="page4" description="something" onpagerewound="restore_data();" flex="1">
-       <iframe id="page4_iframe" flex="1"/>
-</wizardpage>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="volume_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/volume_copy_add_wizard.xul
deleted file mode 100644 (file)
index 26834d8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_add" title="&volume.wizard.title;" 
-       orient="vertical" style="overflow: auto"
-       onload="my_init();" width="800" height="600"
-       onwizardfinish="send_to_bill();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/volume_copy_add_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="volume_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="volume_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="volume_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <wizardpage id="page1"/>
-       <wizardpage id="page2"/>
-       <wizardpage id="page3"/>
-       <wizardpage id="page4"/>
-
-</wizard>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_overlay.xul
deleted file mode 100644 (file)
index 087b7b2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/cat.dtd">
-<overlay id="volume_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- The javascript logic for the staff client -->
-<Evergreen id="volume_js">
-       <!--<script src="chrome://evergreen/content/evergreen/fieldmapper.js" />-->
-       <util id="util_js"/>
-       <script src="volume.js" />
-</Evergreen>
-
-<!-- Some logic abstracted a bit.  Sort of like an API list -->
-<commandset id="volume_cmds">
-       <command id="cmd_alert" oncommand="
-               alert('Feature Not Yet Implemented');
-       "/>
-</commandset>
-
-<wizardpage id="page1" description="Entering Call Numbers" onpageadvanced="">
-       <groupbox>
-               <caption label="Modify Call Numbers?"/>
-               <grid>
-                       <columns> <column flex="0"/> <column flex="0"/> </columns>
-                       <rows id="page1_rows"/>
-               </grid>
-       </groupbox>
-</wizardpage>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="volume_keys">
-       <key id="" modifiers="accel" key="A" command="cmd_"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/volume_edit_wizard.xul
deleted file mode 100644 (file)
index bc449ff..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/cat.dtd">
-<wizard id="volume_edit" title="Batch Volume Editor"
-       orient="vertical" style="overflow: auto"
-       onload="volume_edit_init();" width="800" height="600"
-       onwizardfinish="submit_edited_volumes();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/cat/volume_edit_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- The logic for this app -->
-       <Evergreen id="volume_js" />
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="volume_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="volume_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <wizardpage id="page1"/>
-
-</wizard>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/checkin.js b/Evergreen/staff_client/chrome/content/evergreen/circ/checkin.js
deleted file mode 100755 (executable)
index aa7ae95..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-sdump('D_TRACE','Loading checkin.js\n');
-
-function checkin_init(p) {
-       sdump('D_CHECKIN',"TESTING: checkin.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-
-       // gives: p.clamshell, p.right_panel, p.left_panel, p.inner_left_clamshell, p.inner_top_panel, p.inner_bottom_panel
-       checkin_clamshell_init(p);
-
-       // gives: p.checkin_items, p.redraw_checkin_items
-       checkin_checkin_items_init(p);
-
-       p.refresh = function() {
-       }
-
-       p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
-       p.retrieve_button.addEventListener(
-               'command',
-               function (ev) {
-                       spawn_patron_display(
-                               p.w.app_shell,'new_tab','main_tabbox',
-                               {
-                                       'patron' : retrieve_patron_by_id(
-                                               p._patron.id()
-                                       )
-                               }
-                       );
-               }
-               ,false
-       );
-
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function checkin_clamshell_init(p) {
-       p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
-       p.left_panel = p.clamshell.first_deck;
-       p.right_panel = p.clamshell.second_deck;
-}
-
-function checkin_checkin_items_init(p) {
-       p.checkin_items = checkin_items_init( { 'w' : p.w, 'node' : p.checkin_items_node, 'debug' : p.app } );
-
-       var checkins = [];
-
-       var backdate_tb = p.checkin_items_node.getElementsByAttribute('id','checkin_effective_date_textbox')[0];
-       backdate_tb.value = formatted_date( new Date(), '%Y-%m-%d');
-       backdate_tb.addEventListener(
-               'change',
-               function () {
-                       var flag = false;
-                       var darray = backdate_tb.value.split('-');
-                       var year = darray[0]; if ( (!year) || (year.length != 4) || (!parseInt(year)) ) flag = true;
-                       var month = darray[1]; if ( (!month) || (month.length !=2) || (!parseInt(month)) ) flag = true;
-                       var day = darray[2]; if ( (!day) || (day.length !=2) || (!parseInt(day)) ) flag = true;
-                       if (flag) {
-                               snd_bad();
-                               backdate_tb.value = formatted_date( new Date(), '%Y-%m-%d');
-                       }
-               },
-               false
-       );
-
-       var tb = p.checkin_items_node.getElementsByAttribute('id','checkin_barcode_entry_textbox')[0];
-       var submit_button = p.checkin_items_node.getElementsByAttribute('id','checkin_submit_barcode_button')[0];
-
-       p.attempt_checkin = function(barcode) {
-               try {
-                       //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
-                       var check = checkin_by_copy_barcode( barcode, backdate_tb.value );
-                       if (check) {
-                               sdump('D_CHECKIN','check = ' + check + '\n' + pretty_print( js2JSON( check ) ) + '\n');
-
-                               if (check.status > -1) {
-                                       checkins.push( check );
-                                       p.checkin_items.add_checkin_items( [ checkins.length - 1 ] );
-                               } else {
-                                       // should be handled already
-                               }
-
-                               tb.value = '';
-                       }
-               } catch(E) {
-                       handle_error(E);
-               }
-               tb.select(); tb.focus();
-       }
-
-       tb.addEventListener(
-               'keypress',
-               function(ev) {
-                       if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_checkin( tb.value ); }
-               },
-               false
-       );
-       submit_button.addEventListener(
-               'command',
-               function(ev) {
-                       p.attempt_checkin( tb.value );
-               },
-               false
-       );
-
-       p.redraw_checkin_items = function() {
-               p.checkin_items.clear_checkin_items();
-               for (var i = 0; i < checkins.length; i++) {
-                       p.checkin_items.add_checkin_items( [ i ] );
-               }
-       }
-
-       p.checkin_items.register_checkin_items_select_callback(
-               function (ev) {
-                       sdump('D_CHECKIN','Firing checkin_items_select_callback\n');
-                       var checkin_items = get_list_from_tree_selection( p.checkin_items.paged_tree.tree );
-                       /* grab cover art for selected item? */
-               }
-       );
-       p.checkin_items.register_flesh_checkin_items_function(
-               function (treeitem) {
-                       sdump('D_CHECKIN','Firing flesh_checkin_items_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       p.checkin_items.map_checkin_items_to_cols( checkins[ record_id ], treeitem );
-               }
-       );
-       p.checkin_items.register_context_builder(
-               function (ev) {
-                       sdump('D_CHECKIN','Firing context_builder\n');
-                       empty_widget(p.checkin_items.paged_tree.popup);
-                       var checkin_items = get_list_from_tree_selection( p.checkin_items.paged_tree.tree );
-                       var menuitem;
-
-                       /*** COPY EDITOR ***/
-                       menuitem = p.checkin_items.paged_tree.w.document.createElement('menuitem');
-                       p.checkin_items.paged_tree.popup.appendChild( menuitem );
-                       menuitem.setAttribute('label',getString('circ.context_edit'));
-                       menuitem.addEventListener(
-                               'command',
-                               function (ev) {
-                                       for (var i = 0; i < checkin_items.length; i++) {
-                                               var idx = checkin_items[i].getAttribute('record_id');
-                                               var copy = checkins[idx].copy;
-                                               sdump('D_CHECKIN','Firing copy edit context\n');
-                                               spawn_batch_copy_editor(
-                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
-                                                               'copy_ids' : [ copy.id() ]
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** OPAC ***/
-                       menuitem = p.checkin_items.paged_tree.w.document.createElement('menuitem');
-                       p.checkin_items.paged_tree.popup.appendChild( menuitem );
-                       menuitem.setAttribute('label',getString('circ.context_opac'));
-                       menuitem.addEventListener(
-                               'command',
-                               function (ev) {
-                                       alert('Not Yet Implemented');
-                                       for (var i = 0; i < checkin_items.length; i++) {
-                                               var idx = checkin_items[i].getAttribute('record_id');
-                                               sdump('D_CHECKIN','Firing opac context\n');
-                                       }
-                               },
-                               false
-                       );
-                       
-               }
-       );
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/checkin.xul b/Evergreen/staff_client/chrome/content/evergreen/circ/checkin.xul
deleted file mode 100755 (executable)
index b22c1f5..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/checkin.dtd">
-
-<page id="checkin_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="try {
-               params.w = window; 
-               params.app = 'Checkin'; 
-               params.clamshell_node = document.getElementById('ClamShell_main');
-               params.checkin_items_node = document.getElementById('CheckinItems_main');
-               params.commandset_node = document.getElementById('universal_cmds');
-               mw.focus_widget( document, 'checkin_barcode_entry_textbox' );
-               mw.OpenILS_init(params);
-               } catch(E) {
-                       alert(E);
-               }"
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading checkin.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/checkin.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/circ/checkin_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="Checkin_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="Checkin_main" />
-
-       <popupset id="universal_popupset" />
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/checkin_items.js b/Evergreen/staff_client/chrome/content/evergreen/circ/checkin_items.js
deleted file mode 100644 (file)
index c006b71..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-sdump('D_TRACE','Loading checkin_items.js\n');
-
-function checkin_items_init(p) {
-       sdump('D_CHECKIN_ITEMS',"TESTING: checkin_items.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.checkin_items_cols = checkin_cols();
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.checkin_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
-       p.add_checkin_items = p.paged_tree.add_rows;
-       p.clear_checkin_items = p.paged_tree.clear_tree;
-
-       p.register_checkin_items_select_callback = function (f) {
-               sdump('D_CHECKIN_ITEMS','p.register_checkin_items_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_checkin_items_function = function (f) {
-               sdump('D_CHECKIN_ITEMS','p.register_flesh_checkin_items_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_context_builder = function (f) {
-               sdump('D_CHECKIN_ITEMS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_checkin_items_to_cols = function (checkin_items, treeitem) {
-               sdump('D_CHECKIN_ITEMS','p.map_checkin_items_to_cols( ' + checkin_items + ',' + treeitem + ')\n');
-               checkin_items_tree_map_checkin_items_to_cols(p, checkin_items, treeitem);       
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function checkin_items_tree_map_checkin_items_to_cols(p, checkin_items, treeitem) {
-       sdump('D_CHECKIN_ITEMS',arg_dump(arguments,{1:true}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var cols = new Array();
-       for (var i = 0; i < p.checkin_items_cols.length; i++) {
-               var hash = p.checkin_items_cols[i];
-               sdump('D_CHECKIN_ITEMS','Considering ' + js2JSON(hash) + '\n');
-               var obj_string = 'checkin_items';
-               switch( hash.fm_class ) {
-                       case 'acp' : obj_string = 'checkin_items.copy'; break;
-                       case 'circ' : obj_string = 'checkin_items.circ'; break;
-                       case 'mvr' : obj_string = 'checkin_items.record'; break;
-               }
-               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-               sdump('D_CHECKIN_ITEMS','cmd = ' + cmd + '\n');
-               var col = '';
-               try {
-                       col = eval( cmd );
-                       sdump('D_CHECKIN_ITEMS','eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-               cols.push( col );
-       }
-       sdump('D_CHECKIN_ITEMS','cols = ' + js2JSON(cols) + '\n');
-       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/checkin_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/circ/checkin_overlay.xul
deleted file mode 100755 (executable)
index 8bf1a01..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/checkin.dtd">
-<overlay id="checkin_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading checkin_overlay.xul\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/circ/checkin_items_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-
-</commandset>
-
-<!-- main widget for checkin -->
-<box id="Checkin_main" flex="1" orient="vertical">
-       <groupbox id="Checkin_groupbox" orient="vertical" flex="1">
-               <box id="ClamShell_main" />
-       </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck">
-       <box id="PatronDisplayStatus_main" />
-       <spacer id="csfds" flex="1" />
-</deck>
-
-<deck id="ClamShell_second_deck">
-       <groupbox id="cssdgb">
-               <caption id="cssdgbc" label="&circ.checkin.caption;"/>
-               <box id="CheckinItems_main"/>
-       </groupbox>
-</deck>
-
-<hbox id="CheckinItems_insert1">
-       <label id="checkin_scan_barcode_label" value="&circ.checkin.scan_label;" accesskey="&circ.checkin.scan_label.accesskey;" control="checkin_barcode_entry_textbox"/>
-        <textbox id="checkin_barcode_entry_textbox"/>
-        <button id="checkin_submit_barcode_button" label="&circ.checkin.submit_label;" accesskey="&circ.checkin.submit_label.accesskey;"/>
-       <spacer flex="1"/>
-       <label value="Effective Date:" control="checkin_effective_date_textbox"/>
-       <textbox id="checkin_effective_date_textbox"/>
-</hbox>
-
-<hbox id="CheckinItems_insert2" />
-<hbox id="CheckinItems_insert3" />
-<hbox id="CheckinItems_insert4" />
-
-<hbox id="PatronDisplayStatus_insert2">
-       <label id="PatronSearch_patron_name" class="patronNameMedium"
-               tooltiptext="&checkin_patron.name.label;"
-               value=" "
-               render="true" fm_class="au" 
-               render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
-       <button id="PatronSearch_retrieve_button" 
-               disabled="true"
-               label="&checkin_patron.retrieve;" 
-               accesskey="&checkin_patron.retrieve.accesskey;"/>
-</hbox>
-
-<hbox id="CheckinItems_insert3">
-       <button id="checkin_print" label="&checkin.print_receipt_label;" accesskey="&checkin.print_receipt_label.accesskey;" command="cmd_broken"/>
-       <button id="checkin_reprint" label="&checkin.reprint_receipt_label;" accesskey="&checkin.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
-       <spacer id="cii3s" flex="1"/>
-       <checkbox id="checkin_auto" label="&checkin.auto_print_label;" accesskey="&checkin.auto_print_label.accesskey;"/> 
-       <button id="checkin_done" label="&checkin.done_label;" accesskey="&checkin.done_label.accesskey;" command="cmd_broken"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="Checkin_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js b/Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js
deleted file mode 100644 (file)
index a95085b..0000000
+++ /dev/null
@@ -1,491 +0,0 @@
-sdump('D_TRACE','Loading circ_tree.js\n');
-
-function is_barcode_valid( barcode ) {
-
-       // consider checkdigit, length, etc.
-
-       return check_checkdigit( barcode );
-}
-
-function cancel_hold( hold ) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               var result = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.hold.cancel',
-                       [ mw.G.auth_ses[0], hold.id() ]
-               )[0];
-               sdump('D_CIRC_UTILS','result = ' + result + '\n');
-               return result;
-       } catch(E) {
-               handle_error(E);
-               return null;
-       }
-}
-
-function mark_circ_as_lost(circ) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               var result = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.circulation.set_lost',
-                       [ mw.G.auth_ses[0], circ.id() ]
-               )[0];
-               sdump('D_CIRC_UTILS','result = ' + result + '\n');
-               return result;
-       } catch(E) {
-               handle_error(E);
-               return null;
-       }
-}
-
-function mark_circ_as_missing(circ) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               var result = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.circulation.set_missing',
-                       [ mw.G.auth_ses[0], circ.id() ]
-               )[0];
-               sdump('D_CIRC_UTILS','result = ' + result + '\n');
-               return result;
-       } catch(E) {
-               handle_error(E);
-               return null;
-       }
-}
-
-function checkout_permit(barcode, patron_id, num_of_open_async_checkout_requests, f) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true,1:true,2:true}));
-       try {
-               var check = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.permit_checkout',
-                       [ mw.G.auth_ses[0], barcode, patron_id, num_of_open_async_checkout_requests ],
-                       f
-               )[0];
-               if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
-               return check;   
-       } catch(E) {
-               handle_error(E);
-               return null;
-       }       
-}
-
-function checkout_by_copy_barcode(barcode, patron_id, f) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true,1:true}));
-       try {
-               var check = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.checkout.barcode',
-                       [ mw.G.auth_ses[0], barcode, patron_id ],
-                       f
-               )[0];
-               if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
-               return check;
-       } catch(E) {
-               sdump('D_ERROR',E);
-               return null;
-       }
-}
-
-function hold_capture_by_copy_barcode( barcode, retrieve_flag ) {
-       try {
-               var check = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.hold.capture_copy.barcode',
-                       [ mw.G.auth_ses[0], barcode, retrieve_flag ]
-               )[0];
-               check.text = 'Captured for Hold';
-               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
-               return check;
-       } catch(E) {
-               handle_error(E, true);
-               return null;
-       }
-}
-
-function checkin_by_copy_barcode(barcode, backdate, f) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               if (backdate && (backdate == formatted_date(new Date(),'%Y-%m-%d')) ) backdate = null;
-
-               var check = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.checkin.barcode',
-                       [ mw.G.auth_ses[0], barcode, null, backdate ],
-                       f
-               )[0];
-
-               /*
-               { // REMOVE_ME, forcing a condition for testing
-                       check.status = 1;
-                       check.text = 'This copy is the first that could fulfill a hold.  Do it?';
-               }
-               */
-
-               if (!f) {
-                       sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
-                       if (check.status != 0) {
-                               switch(check.status) {
-                                       case '1': case 1: /* possible hold capture */
-                                               var rv = yns_alert(
-                                                       check.text,
-                                                       'Alert',
-                                                       "Capture",
-                                                       "Don't Capture",
-                                                       null,
-                                                       "Check here to confirm this message"
-                                               );
-                                               switch(rv) {
-                                                       case 0: /* capture */
-                                                       try {
-                                                               var check2 = hold_capture_by_copy_barcode( barcode );
-                                                               if (check2) {
-                                                                       sdump('D_CIRC_UTILS','check2 = ' + js2JSON(check2) + '\n');
-                                                                       check.copy = check2.copy;
-                                                                       check.text = check2.text;
-                                                                       check.route_to = check2.route_to;
-                                                                       var patron = retrieve_patron_by_id( check.hold.usr() );
-                                                                       sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
-                                                                               check.record.title() + '  Author: ' + check.record.author() + 
-                                                                               '<br />\r\n' + 'Route To: ' + check.route_to + '  Patron: ' + 
-                                                                               patron.card().barcode() + ' ' + patron.family_name() + ', ' + 
-                                                                               patron.first_given_name() + '<br />\r\n'
-                                                                       );
-
-                                                               }
-
-                                                       } catch(E) { 
-                                                               sdump('D_ERROR',E + '\n'); 
-                                                               /* 
-                                                               // demo testing 
-                                                               check.text = 'Captured for Hold';
-                                                               check.route_to = 'ARL-ATH';
-                                                               */
-                                                       }
-                                                       break;
-                                                       case 1: /* don't capture */
-
-                                                               check.text = 'Not Captured for Hold';
-                                                       break;
-                                               }
-                                       break;
-                                       case '2': case 2: /* LOST??? */
-                                               var patron = retrieve_patron_by_id( check.circ.usr() );
-                                               var msg = check.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
-                                                               check.record.title() + '  Author: ' + check.record.author() + '\r\n' +
-                                                               'Patron: ' + patron.card().barcode() + ' ' + patron.family_name() + ', ' +
-                                                               patron.first_given_name();
-                                               var pcheck = yns_alert(
-                                                       msg,
-                                                       'Lost Item',
-                                                       'Edit Copy & Patron',
-                                                       "Just Continue",
-                                                       null,
-                                                       "Check here to confirm this message"
-                                               ); 
-                                               if (pcheck == 0) {
-                                                       var w = mw.spawn_main();
-                                                       setTimeout(
-                                                               function() {
-                                                                       mw.spawn_patron_display(w.document,'new_tab','main_tabbox',{'patron':patron});
-                                                                       mw.spawn_batch_copy_editor(w.document,'new_tab','main_tabbox',
-                                                                               {'copy_ids':[ check.copy.id() ]});
-                                                               }, 0
-                                                       );
-                                               }
-                                       break;
-                                       case '3': case 3: /* TRANSIT ELSEWHERE */
-                                               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
-                                               var msg = check.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
-                                                               check.record.title() + '  Author: ' + check.record.author() + 
-                                                               '\r\n' + 'Route To: ' + check.route_to + '\r\n';
-                                               var pcheck = yns_alert(
-                                                       msg,
-                                                       'Alert',
-                                                       'Print Receipt',
-                                                       "Don't Print",
-                                                       null,
-                                                       "Check here to confirm this message"
-                                               ); 
-                                               if (pcheck == 0) {
-                                                       sPrint( msg.match( /\n/g, '<br />\r\n'), true );
-                                               }
-
-                                       break;
-                                       case '4': case 4: /* transit for hold is complete */
-                                               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
-                                               var msg = check.text + '\r\n' + 'Barcode: ' + barcode + '  Title: ' + 
-                                                               check.record.title() + '  Author: ' + check.record.author() + 
-                                                               '\r\n' + 'Route To: ' + check.route_to +
-                                                               '\r\n';
-                                               var pcheck = yns_alert(
-                                                       msg,
-                                                       'Alert',
-                                                       'Print Receipt',
-                                                       "Don't Print",
-                                                       null,
-                                                       "Check here to confirm this message"
-                                               ); 
-                                               if (pcheck == 0) {
-                                                       sPrint( msg.match( /\n/g, '<br />\r\n'), true );
-                                               }
-
-                                       break;
-
-                                       default: 
-                                               if (parseInt(check.route_to)) check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
-                                               var msg = check.text + '\r\nBarcode: ' + barcode + '  Route To: ' + check.route_to;
-                                               var pcheck = yns_alert(
-                                                       msg,
-                                                       'Alert',
-                                                       'Print Receipt',
-                                                       "Don't Print",
-                                                       null,
-                                                       "Check here to confirm this message"
-                                               ); 
-                                               if (pcheck == 0) {
-                                                       sPrint( msg.match( /\n/g, '<br />\r\n'), true );
-                                               }
-                                       break;
-                               }
-                       } else {  // status == 0
-                       }
-                       if (parseInt(check.route_to)) {
-                               if (check.route_to != mw.G.user_ou.id()) {
-                                       check.route_to = mw.G.org_tree_hash[ check.route_to ].shortname();
-                               } else {
-                                       check.route_to = mw.G.acpl_hash[ check.copy.location() ].name();
-                               }
-                       }
-               }
-               return check;
-       } catch(E) {
-               handle_error(E, true);
-               return null;
-       }
-}
-
-function renew_by_circ_id(id, f) {
-       sdump('D_CIRC_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               var check = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.renew',
-                       [ mw.G.auth_ses[0], id ],
-                       f
-               )[0];
-               if (!f) sdump('D_CIRC_UTILS','check = ' + js2JSON(check) + '\n');
-               return check;
-       } catch(E) {
-               sdump('D_ERROR',E);
-               return null;
-       }
-}
-
-function hold_cols() {
-       var cols = [
-{
-       'id' : 'request_time', 'label' : getString('ahr_request_time_label'), 'flex' : 0,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 
-       'fm_field_render' : '.request_time().toString().substr(0,10)'
-},
-{
-       'id' : 'status', 'label' : getString('ahr_status_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 'fm_field_render' : '.status()'
-},
-{
-       'id' : 'hold_type', 'label' : getString('ahr_hold_type_label'), 'flex' : 0,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 'fm_field_render' : '.hold_type()'
-},
-{
-       'id' : 'pickup_lib', 'label' : getString('ahr_pickup_lib_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 
-       'fm_field_render' : 'mw.G.org_tree_hash[ $$.pickup_lib() ].name()'
-},
-{
-       'id' : 'pickup_lib_shortname', 'label' : getString('ahr_pickup_lib_label'), 'flex' : 0,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'ahr', 
-       'fm_field_render' : 'mw.G.org_tree_hash[ $$.pickup_lib() ].shortname()'
-},
-               {
-                       'id' : 'title', 'label' : getString('mvr_label_title'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.title()'
-               },
-               {
-                       'id' : 'author', 'label' : getString('mvr_label_author'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.author()'
-               },
-{
-       'id' : 'capture_time', 'label' : getString('ahr_capture_time_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.capture_time()'
-},
-{
-       'id' : 'current_copy', 'label' : getString('ahr_current_copy_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.current_copy()'
-},
-{
-       'id' : 'email_notify', 'label' : getString('ahr_email_notify_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.email_notify()'
-},
-{
-       'id' : 'expire_time', 'label' : getString('ahr_expire_time_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.expire_time()'
-},
-{
-       'id' : 'fulfillment_time', 'label' : getString('ahr_fulfillment_time_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.fulfillment_time()'
-},
-{
-       'id' : 'holdable_formats', 'label' : getString('ahr_holdable_formats_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.holdable_formats()'
-},
-{
-       'id' : 'id', 'label' : getString('ahr_id_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.id()'
-},
-{
-       'id' : 'phone_notify', 'label' : getString('ahr_phone_notify_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.phone_notify()'
-},
-{
-       'id' : 'prev_check_time', 'label' : getString('ahr_prev_check_time_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.prev_check_time()'
-},
-{
-       'id' : 'requestor', 'label' : getString('ahr_requestor_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.requestor()'
-},
-{
-       'id' : 'selection_depth', 'label' : getString('ahr_selection_depth_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.selection_depth()'
-},
-{
-       'id' : 'target', 'label' : getString('ahr_target_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.target()'
-},
-{
-       'id' : 'usr', 'label' : getString('ahr_usr_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : true, 'fm_class' : 'ahr', 'fm_field_render' : '.usr()'
-}
-       ];
-       return cols;
-}
-
-function checkin_cols() {
-       var cols = [
-               {
-                       'id' : 'checkin_status', 'label' : getString('checkin_label_status'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : '', 'fm_field_render' : '.status.toString()'
-               },
-               {
-                       'id' : 'checkin_route_to', 'label' : getString('checkin_label_route_to'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : '', 'fm_field_render' : '.route_to.toString()'
-               },
-               {
-                       'id' : 'checkin_text', 'label' : getString('checkin_label_text'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : '', 'fm_field_render' : '.text.toString()'
-               }
-       ];
-       var std_cols = map_list( 
-               circ_cols(), 
-               function(o){ if ((o.fm_class == 'acp')||(o.fm_class == 'circ')) o.hidden = true; return o; }
-       );
-       return cols.concat( std_cols );
-}
-
-function circ_cols() {
-       return  [
-               {
-                       'id' : 'acp_id', 'label' : getString('acp_label_id'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.id()'
-               },
-               {
-                       'id' : 'circ_id', 'label' : getString('circ_label_id'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.id()'
-               },
-               {
-                       'id' : 'mvr_doc_id', 'label' : getString('mvr_label_doc_id'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'mvr', 'fm_field_render' : '.doc_id()'
-               },
-               {
-                       'id' : 'barcode', 'label' : getString('acp_label_barcode'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : '.barcode()'
-               },
-               {
-                       'id' : 'call_number', 'label' : getString('acp_label_call_number'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.call_number()'
-               },
-               {
-                       'id' : 'copy_number', 'label' : getString('acp_label_copy_number'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.copy_number()'
-               },
-               {
-                       'id' : 'location', 'label' : getString('acp_label_location'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.location()'
-               },
-               {
-                       'id' : 'loan_duration', 'label' : getString('acp_label_loan_duration'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.loan_duration()'
-               },
-               {
-                       'id' : 'circ_lib', 'label' : getString('acp_label_circ_lib'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_lib()'
-               },
-               {
-                       'id' : 'fine_level', 'label' : getString('acp_label_fine_level'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.fine_level()'
-               },
-               {
-                       'id' : 'deposit', 'label' : getString('acp_label_deposit'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.deposit()'
-               },
-               {
-                       'id' : 'deposit_amount', 'label' : getString('acp_label_deposit_amount'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.deposit_amount()'
-               },
-               {
-                       'id' : 'price', 'label' : getString('acp_label_price'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.price()'
-               },
-               {
-                       'id' : 'circ_as_type', 'label' : getString('acp_label_circ_as_type'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_as_type()'
-               },
-               {
-                       'id' : 'circ_modifier', 'label' : getString('acp_label_circ_modifier'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'acp', 'fm_field_render' : '.circ_modifier()'
-               },
-               {
-                       'id' : 'xact_start', 'label' : getString('circ_label_xact_start'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.xact_start()'
-               },
-               {
-                       'id' : 'xact_finish', 'label' : getString('circ_label_xact_finish'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.xact_finish()'
-               },
-               {
-                       'id' : 'due_date', 'label' : getString('circ_label_due_date'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.due_date().substr(0,10)'
-               },
-               {
-                       'id' : 'title', 'label' : getString('mvr_label_title'), 'flex' : 2,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.title()'
-               },
-               {
-                       'id' : 'author', 'label' : getString('mvr_label_author'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.author()'
-               },
-               {
-                       'id' : 'renewal_remaining', 'label' : getString('circ_label_renewal_remaining'), 'flex' : 0,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.renewal_remaining()'
-               },
-               {
-                       'id' : 'status', 'label' : getString('acp_label_status'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : 'mw.G.ccs_hash[ $$.status() ].name()'
-               }
-       ]
-};
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.js b/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.js
deleted file mode 100755 (executable)
index b7b1388..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-sdump('D_TRACE','Loading hold_capture.js\n');
-
-function hold_capture_init(p) {
-       sdump('D_HOLD_CAPTURE',"TESTING: hold_capture.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-
-       // gives: p.clamshell, p.right_panel, p.left_panel, p.inner_left_clamshell, p.inner_top_panel, p.inner_bottom_panel
-       hold_capture_clamshell_init(p);
-
-       // gives: p.hold_capture_items, p.redraw_hold_capture_items
-       hold_capture_hold_capture_items_init(p);
-
-       p.refresh = function() {
-       }
-
-       p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
-       p.retrieve_button.addEventListener(
-               'command',
-               function (ev) {
-                       spawn_patron_display(
-                               p.w.app_shell,'new_tab','main_tabbox',
-                               {
-                                       'patron' : retrieve_patron_by_id(
-                                               p._patron.id()
-                                       )
-                               }
-                       );
-               }
-               ,false
-       );
-
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function hold_capture_clamshell_init(p) {
-       p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
-       p.left_panel = p.clamshell.first_deck;
-       p.right_panel = p.clamshell.second_deck;
-}
-
-function hold_capture_hold_capture_items_init(p) {
-       p.hold_capture_items = hold_capture_items_init( { 'w' : p.w, 'node' : p.hold_capture_items_node, 'debug' : p.app } );
-
-       var hold_captures = [];
-       var tb = p.hold_capture_items_node.getElementsByAttribute('id','hold_capture_barcode_entry_textbox')[0];
-       var submit_button = p.hold_capture_items_node.getElementsByAttribute('id','hold_capture_submit_barcode_button')[0];
-
-       p.attempt_hold_capture = function(barcode) {
-               try {
-                       //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
-                       var check = hold_capture_by_copy_barcode( barcode, true );  // barcode, flesh
-                       if (check) {
-                               sdump('D_HOLD_CAPTURE','check = ' + check + '\n' + pretty_print( js2JSON( check ) ) + '\n');
-
-                               check.status = 0;
-                               check.text = 'Captured for Hold Request';
-
-                               hold_captures.push( check );
-                               p.hold_capture_items.add_hold_capture_items( [ hold_captures.length - 1 ] );
-
-                               var patron = retrieve_patron_by_id( check.hold.usr() );
-
-                               sPrint(check.text + '<br />\r\n' + 'Barcode: ' + barcode + '  Title: ' + check.record.title() + 
-                                       '  Author: ' + check.record.author() + '<br />\r\n' +
-                                       'Route To: ' + check.route_to + 
-                                       '  Patron: ' + patron.card().barcode() + ' ' + patron.family_name() + ', ' + patron.first_given_name() + 
-                                       '<br />\r\n'
-                               );
-                               tb.value = ''; 
-                       }
-               } catch(E) {
-                       handle_error(E);
-               }
-               tb.select(); tb.focus();
-       }
-
-       tb.addEventListener(
-               'keypress',
-               function(ev) {
-                       if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_hold_capture( tb.value ); }
-               },
-               false
-       );
-       submit_button.addEventListener(
-               'command',
-               function(ev) {
-                       p.attempt_hold_capture( tb.value );
-               },
-               false
-       );
-
-       p.redraw_hold_capture_items = function() {
-               p.hold_capture_items.clear_hold_capture_items();
-               for (var i = 0; i < hold_captures.length; i++) {
-                       p.hold_capture_items.add_hold_capture_items( [ i ] );
-               }
-       }
-
-       p.hold_capture_items.register_hold_capture_items_select_callback(
-               function (ev) {
-                       sdump('D_HOLD_CAPTURE','Firing hold_capture_items_select_callback\n');
-                       var hold_capture_items = get_list_from_tree_selection( p.hold_capture_items.paged_tree.tree );
-                       /* grab cover art for selected item? */
-               }
-       );
-       p.hold_capture_items.register_flesh_hold_capture_items_function(
-               function (treeitem) {
-                       sdump('D_HOLD_CAPTURE','Firing flesh_hold_capture_items_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       p.hold_capture_items.map_hold_capture_items_to_cols( hold_captures[ record_id ], treeitem );
-               }
-       );
-       p.hold_capture_items.register_context_builder(
-               function (ev) {
-                       sdump('D_HOLD_CAPTURE','Firing context_builder\n');
-                       empty_widget(p.hold_capture_items.paged_tree.popup);
-                       var hold_capture_items = get_list_from_tree_selection( p.hold_capture_items.paged_tree.tree );
-                       var menuitem;
-
-                       /*** COPY EDITOR ***/
-                       menuitem = p.hold_capture_items.paged_tree.w.document.createElement('menuitem');
-                       p.hold_capture_items.paged_tree.popup.appendChild( menuitem );
-                       menuitem.setAttribute('label',getString('circ.context_edit'));
-                       menuitem.addEventListener(
-                               'command',
-                               function (ev) {
-                                       for (var i = 0; i < hold_capture_items.length; i++) {
-                                               var idx = hold_capture_items[i].getAttribute('record_id');
-                                               var copy = hold_captures[idx].copy;
-                                               sdump('D_HOLD_CAPTURE','Firing copy edit context\n');
-                                               spawn_batch_copy_editor(
-                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
-                                                               'copy_ids' : [ copy.id() ]
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** OPAC ***/
-                       menuitem = p.hold_capture_items.paged_tree.w.document.createElement('menuitem');
-                       p.hold_capture_items.paged_tree.popup.appendChild( menuitem );
-                       menuitem.setAttribute('label',getString('circ.context_opac'));
-                       menuitem.addEventListener(
-                               'command',
-                               function (ev) {
-                                       alert('Not Yet Implemented');
-                                       for (var i = 0; i < hold_capture_items.length; i++) {
-                                               var idx = hold_capture_items[i].getAttribute('record_id');
-                                               sdump('D_HOLD_CAPTURE','Firing opac context\n');
-                                       }
-                               },
-                               false
-                       );
-                       
-               }
-       );
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.xul b/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture.xul
deleted file mode 100755 (executable)
index 932b5d9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/hold_capture.dtd">
-
-<page id="hold_capture_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="try {
-               params.w = window; 
-               params.app = 'HoldCapture'; 
-               params.clamshell_node = document.getElementById('ClamShell_main');
-               params.hold_capture_items_node = document.getElementById('HoldCaptureItems_main');
-               params.commandset_node = document.getElementById('universal_cmds');
-               mw.focus_widget( document, 'hold_capture_barcode_entry_textbox' );
-               mw.OpenILS_init(params);
-               } catch(E) {
-                       alert('onload: ' + E);
-               }"
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading hold_capture.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/hold_capture.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/circ/hold_capture_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="HoldCapture_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="HoldCapture_main" />
-
-       <popupset id="universal_popupset" />
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_items.js b/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_items.js
deleted file mode 100644 (file)
index 74b5a0f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-sdump('D_TRACE','Loading hold_capture_items.js\n');
-
-function hold_capture_items_init(p) {
-       sdump('D_HOLD_CAPTURE_ITEMS',"TESTING: hold_capture_items.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.hold_capture_items_cols = checkin_cols();
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.hold_capture_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
-       p.add_hold_capture_items = p.paged_tree.add_rows;
-       p.clear_hold_capture_items = p.paged_tree.clear_tree;
-
-       p.register_hold_capture_items_select_callback = function (f) {
-               sdump('D_HOLD_CAPTURE_ITEMS','p.register_hold_capture_items_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_hold_capture_items_function = function (f) {
-               sdump('D_HOLD_CAPTURE_ITEMS','p.register_flesh_hold_capture_items_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_context_builder = function (f) {
-               sdump('D_HOLD_CAPTURE_ITEMS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_hold_capture_items_to_cols = function (hold_capture_items, treeitem) {
-               sdump('D_HOLD_CAPTURE_ITEMS','p.map_hold_capture_items_to_cols( ' + hold_capture_items + ',' + treeitem + ')\n');
-               hold_capture_items_tree_map_hold_capture_items_to_cols(p, hold_capture_items, treeitem);        
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function hold_capture_items_tree_map_hold_capture_items_to_cols(p, hold_capture_items, treeitem) {
-       sdump('D_HOLD_CAPTURE_ITEMS',arg_dump(arguments,{1:true}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var cols = new Array();
-       for (var i = 0; i < p.hold_capture_items_cols.length; i++) {
-               var hash = p.hold_capture_items_cols[i];
-               sdump('D_HOLD_CAPTURE_ITEMS','Considering ' + js2JSON(hash) + '\n');
-               var obj_string = 'hold_capture_items';
-               switch( hash.fm_class ) {
-                       case 'acp' : obj_string = 'hold_capture_items.copy'; break;
-                       case 'circ' : obj_string = 'hold_capture_items.circ'; break;
-                       case 'mvr' : obj_string = 'hold_capture_items.record'; break;
-               }
-               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-               sdump('D_HOLD_CAPTURE_ITEMS','cmd = ' + cmd + '\n');
-               var col = '';
-               try {
-                       col = eval( cmd );
-                       sdump('D_HOLD_CAPTURE_ITEMS','eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-               cols.push( col );
-       }
-       sdump('D_HOLD_CAPTURE_ITEMS','cols = ' + js2JSON(cols) + '\n');
-       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/circ/hold_capture_overlay.xul
deleted file mode 100755 (executable)
index 30ef321..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/hold_capture.dtd">
-<overlay id="hold_capture_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading hold_capture_overlay.xul\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/circ/hold_capture_items_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-
-</commandset>
-
-<!-- main widget for hold_capture -->
-<box id="HoldCapture_main" flex="1" orient="vertical">
-       <groupbox id="HoldCapture_groupbox" orient="vertical" flex="1">
-               <box id="ClamShell_main" />
-       </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck">
-       <box id="PatronDisplayStatus_main" />
-       <spacer id="csfds" flex="1" />
-</deck>
-
-<deck id="ClamShell_second_deck">
-       <groupbox id="cssdgb">
-               <caption id="cssdgbc" label="&circ.hold_capture.caption;"/>
-               <box id="HoldCaptureItems_main"/>
-       </groupbox>
-</deck>
-
-<hbox id="HoldCaptureItems_insert1">
-       <label id="hold_capture_scan_barcode_label" value="&circ.hold_capture.scan_label;" accesskey="&circ.hold_capture.scan_label.accesskey;" control="hold_capture_barcode_entry_textbox"/>
-        <textbox id="hold_capture_barcode_entry_textbox"/>
-        <button id="hold_capture_submit_barcode_button" label="&circ.hold_capture.submit_label;" accesskey="&circ.hold_capture.submit_label.accesskey;"/>
-</hbox>
-
-<hbox id="HoldCaptureItems_insert2" />
-<hbox id="HoldCaptureItems_insert3" />
-<hbox id="HoldCaptureItems_insert4" />
-
-<hbox id="PatronDisplayStatus_insert2">
-       <label id="PatronSearch_patron_name" class="patronNameMedium"
-               tooltiptext="&hold_capture_patron.name.label;"
-               value=" "
-               render="true" fm_class="au" 
-               render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
-       <button id="PatronSearch_retrieve_button" 
-               disabled="true"
-               label="&hold_capture_patron.retrieve;" 
-               accesskey="&hold_capture_patron.retrieve.accesskey;"/>
-</hbox>
-
-<hbox id="HoldCaptureItems_insert3">
-       <button id="hold_capture_print" label="&hold_capture.print_receipt_label;" accesskey="&hold_capture.print_receipt_label.accesskey;" command="cmd_broken"/>
-       <button id="hold_capture_reprint" label="&hold_capture.reprint_receipt_label;" accesskey="&hold_capture.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
-       <spacer id="cii3s" flex="1"/>
-       <checkbox id="hold_capture_auto" label="&hold_capture.auto_print_label;" accesskey="&hold_capture.auto_print_label.accesskey;"/> 
-       <button id="hold_capture_done" label="&hold_capture.done_label;" accesskey="&hold_capture.done_label.accesskey;" command="cmd_broken"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="HoldCapture_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/circ/receipt_template_editor.xul b/Evergreen/staff_client/chrome/content/evergreen/circ/receipt_template_editor.xul
deleted file mode 100644 (file)
index a7bbe86..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="itemsout_receipt_template_win" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading itemsout_receipt_template.xul\n');</script>
-
-       <script>
-       <![CDATA[
-               var test_patron = mw.JSON2js('/*--S au --*/[null,null,null,[/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/],[/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/],[{"circ":/*--S aoc --*/[null,null,null,"212","2005-07-05 04:58:02-04","14 days","2wk_default","1 day","134","50.00","books","0.10","books","1","1",null,"11","18",null,"2005-07-19 10:38:25.211964-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"31041005404709","11",null,"212",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","11","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Albrand, Martha.",[],null,"3",null,null,"",[],"1959","Random House",null,[],[],null,"PIN01000004 ","A  day in Monte Carlo",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"12","2005-08-04 11:31:02-04","14 days","2wk_default","1 day","171","50.00","books","0.10","books","0","2",null,"2139800","18",null,"2005-07-21 17:11:44.203345-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"33207000838641","1938753",null,"10",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-07-21 17:08:53.504341-04","1","2","1","2139800","2","1","1","10.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Sproule, Anna.",[],null,"330278",null,null,"0531182150 (lib. bdg.)",[],"1988","Bookwright Press",null,["Know your pet"],[["Dogs"],["Dog breeds"]],"Discusses how to choose and care for a pet dog and provides information on various breeds.","PIN03092988 ","Dogs",["text"]]/*--E mvr --*/},{"circ":/*--S aoc --*/[null,null,null,"1","2005-08-05 14:36:02-04","14 days","2wk_default","1 day","173","50.00","books","0.10","books","0","2",null,"1329873","18",null,"2005-07-22 20:17:07.199888-04"]/*--E aoc --*/,"copy":/*--S acp --*/[null,null,null,null,"34520000676111","1187974",null,"182",null,"1","1","2005-05-06 11:13:05.063398-04","1","0","0.00","2005-05-06 11:13:05.063398-04","1","2","1","1329873","2","1","1","0.00","0","1"]/*--E acp --*/,"record":/*--S mvr --*/[null,null,null,"Margolis, Matthew.",[],null,"97448",null,"1st Vintage Books ed.","0394711742 (pbk.) :",[],"1982, c1979","Vintage Books",null,[],[["Dogs"]],null,"PIN02040633 ","The  dog in your life a complete guide to choosing, raising, feeding, training, and caring for your dog plus sections on show dogs, hunting dogs, coursing dogs, herd dogs, sled dogs, guard dogs, guide dogs, and a discussion of common canine illnesses",["text"]]/*--E mvr --*/}],[/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"3601016","email2@somewheres.info",null,null,"T",null,"45","800.555.0000","12","2005-07-24 15:47:42.091479-04","2005-07-21 16:35:16.026892-04","18","0","847314","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Copy found, waiting for capture",null,"1386122","email2@somewheres.info",null,null,"T",null,"46","800.555.0000","12","2005-07-24 15:47:45.240195-04","2005-07-21 16:40:12.783469-04","18","0","152833","18"]/*--E ahr --*/,/*--S ahr --*/[null,null,null,"Available","2005-07-21 17:04:11.853992-04","548582","email2@somewheres.info",null,null,"T",null,"47","800.555.0000","12","2005-07-21 17:03:49.248665-04","2005-07-21 17:03:10.523049-04","18","0","23932","18"]/*--E ahr --*/],null,[/*--S actscecm --*/[null,null,null,"40","17","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"14","2","Yes","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"46","18","test2","18"]/*--E actscecm --*/,/*--S actscecm --*/[null,null,null,"42","16","","18"]/*--E actscecm --*/],null,"1",null,/*--S aua --*/[null,null,null,"Vacation","PC Beach","USA","PC County","42","01010","FL","111 A Street","Unit #12A","18","1"]/*--E aua --*/,/*--S ac --*/[null,null,null,"1","21099000006699","14","18"]/*--E ac --*/,"0","2005-05-13","0.00","800.555.0000","1900-01-02","email2@somewheres.info",null,"2008-05-13","Erickson","Bill","10","18","5","2","345","365","1122211188.708583190.17503114108",/*--S aua --*/[null,null,null,"work","CITY","USA","Fulton","13","30043","GA","123 street road","#AR54","18","1"]/*--E aua --*/,"0","1",null,null,null,"Councilperson","3",null,"1","Jr","0","18","erickson"]/*--E au --*/');
-
-               function my_init() {
-                       document.getElementById('itemsout_header_tb').value = mw.G.itemsout_header;
-                       document.getElementById('itemsout_line_item_tb').value = mw.G.itemsout_line_item;
-                       document.getElementById('itemsout_footer_tb').value = mw.G.itemsout_footer;
-                       document.getElementById('checkout_header_tb').value = mw.G.checkout_header;
-                       document.getElementById('checkout_line_item_tb').value = mw.G.checkout_line_item;
-                       document.getElementById('checkout_footer_tb').value = mw.G.checkout_footer;
-                       document.getElementById('checkin_header_tb').value = mw.G.checkin_header;
-                       document.getElementById('checkin_line_item_tb').value = mw.G.checkin_line_item;
-                       document.getElementById('checkin_footer_tb').value = mw.G.checkin_footer;
-                       document.getElementById('holds_header_tb').value = mw.G.holds_header;
-                       document.getElementById('holds_line_item_tb').value = mw.G.holds_line_item;
-                       document.getElementById('holds_footer_tb').value = mw.G.holds_footer;
-                       test_itemsout(document.getElementById('sample_view'));
-                       test_patron._current_checkouts = test_patron.checkouts();
-               }
-
-               function test_itemsout(sample_view) {
-                       var params = { 
-                               'au' : test_patron, 
-                               'lib' : mw.G.user_ou,
-                               'staff' : mw.G.user,
-                               'header' : document.getElementById('itemsout_header_tb').value,
-                               'line_item' : document.getElementById('itemsout_line_item_tb').value,
-                               'footer' : document.getElementById('itemsout_footer_tb').value
-                       };
-                       mw.print_itemsout_receipt( params, sample_view );
-               }
-
-               function save_itemsout() {
-                       mw.G.itemsout_header = document.getElementById('itemsout_header_tb').value;
-                       mw.G.itemsout_line_item = document.getElementById('itemsout_line_item_tb').value;
-                       mw.G.itemsout_footer = document.getElementById('itemsout_footer_tb').value;
-               }
-
-               function test_checkout(sample_view) {
-                       var params = { 
-                               'au' : test_patron, 
-                               'lib' : mw.G.user_ou,
-                               'staff' : mw.G.user,
-                               'header' : document.getElementById('checkout_header_tb').value,
-                               'line_item' : document.getElementById('checkout_line_item_tb').value,
-                               'footer' : document.getElementById('checkout_footer_tb').value
-                       };
-                       mw.print_checkout_receipt( params, sample_view );
-               }
-
-               function save_checkout() {
-                       mw.G.checkout_header = document.getElementById('checkout_header_tb').value;
-                       mw.G.checkout_line_item = document.getElementById('checkout_line_item_tb').value;
-                       mw.G.checkout_footer = document.getElementById('checkout_footer_tb').value;
-               }
-
-               function test_checkin(sample_view) {
-                       var params = { 
-                               'au' : test_patron, 
-                               'lib' : mw.G.user_ou,
-                               'staff' : mw.G.user,
-                               'header' : document.getElementById('checkin_header_tb').value,
-                               'line_item' : document.getElementById('checkin_line_item_tb').value,
-                               'footer' : document.getElementById('checkin_footer_tb').value
-                       };
-                       mw.print_checkin_receipt( params, sample_view );
-               }
-
-               function save_checkin() {
-                       mw.G.checkin_header = document.getElementById('checkin_header_tb').value;
-                       mw.G.checkin_line_item = document.getElementById('checkin_line_item_tb').value;
-                       mw.G.checkin_footer = document.getElementById('checkin_footer_tb').value;
-               }
-
-               function test_holds(sample_view) {
-                       var params = { 
-                               'au' : test_patron, 
-                               'lib' : mw.G.user_ou,
-                               'staff' : mw.G.user,
-                               'header' : document.getElementById('holds_header_tb').value,
-                               'line_item' : document.getElementById('holds_line_item_tb').value,
-                               'footer' : document.getElementById('holds_footer_tb').value
-                       };
-                       mw.print_holds_receipt( params, sample_view );
-               }
-
-               function save_holds() {
-                       mw.G.holds_header = document.getElementById('holds_header_tb').value;
-                       mw.G.holds_line_item = document.getElementById('holds_line_item_tb').value;
-                       mw.G.holds_footer = document.getElementById('holds_footer_tb').value;
-               }
-
-               function switch_sample_view() {
-                       try {
-                               var sv = document.getElementById('sample_view');
-                               switch( document.getElementById('tps').selectedPanel.id ) {
-                                       case 'itemsout' : test_itemsout(sv); break;
-                                       case 'checkout' : test_checkout(sv); break;
-                                       case 'checkin' : test_checkin(sv); break;
-                                       case 'holds' : test_holds(sv); break;
-                               }
-                       } catch(E) {
-                               mw.sdump('D_ERROR',mw.js2JSON(E));
-                       }
-               }
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow">
-               <groupbox orient="vertical" flex="1">
-                       <caption label="Receipt Template Editor"/>
-                       <hbox flex="1">
-                               <groupbox orient="vertical" flex="1">
-                                       <caption label="HELP" />
-                                       <tabbox flex="1">
-                                               <tabs>
-                                                       <tab label="Description"/>
-                                                       <tab label="Sample View"/>
-                                               </tabs>
-                                               <tabpanels flex="1">
-                                                       <tabpanel flex="1">
-                                                               <hbox flex="1">
-                                                                       <iframe flex="1" src="data:text/html,&lt;html&gt;&lt;p&gt;Please note that this interface is for testing purposes, and that modifications you make here will not persist between different invocations of the staff client.  In future versions of the software, you will be able to save and share named templates.  Also note that the Sample View is not intended to be a print preview of the receipt.  You should print the test receipt to determine how your template will actually look.&lt;/p&gt;&lt;p&gt;The following macros get evaluated and substituted for each receipt printed: %LIBRARY% %PINES_CODE% %PATRON_LASTNAME% %PATRON_FIRSTNAME% %PATRON_MIDDLENAME% %PATRON_BARCODE% %TODAY% %OUT% %DUE% %DURATION% %COPY_BARCODE% %TITLE% %AUTHOR% %PUBLISHER% %PUBDATE% %NUMBER% %STAFF_LASTNAME% %STAFF_FIRSTNAME% %STAFF_MIDDLENAME% %STAFF BARCODE%&lt;/p&gt;&lt;p&gt;If there's a specific macro you would like to see, please let us know.  There will be variations on these for handling truncation and date formats.  You may also include HTML markup in your template, but how that renders will depend on your printer and print driver.  Please see the examples:&lt;/p&gt;&lt;/html&gt;" />;
-                                                               </hbox>
-                                                       </tabpanel>
-                                                       <tabpanel flex="1">
-                                                               <hbox flex="1">
-                                                                       <iframe flex="1" id="sample_view" />
-                                                               </hbox>
-                                                       </tabpanel>
-                                               </tabpanels>
-                                       </tabbox>
-                               </groupbox>
-                               <groupbox orient="vertical" flex="1">
-                                       <caption label="TEMPLATES" />
-                               <tabbox flex="1">
-                                       <tabs>
-                                               <tab label="Items Out"/>
-                                               <tab label="Check Out"/>
-                                               <tab label="Check In"/>
-                                               <tab label="Holds"/>
-                                       </tabs>
-                                       <tabpanels id="tps" flex="1" onselect="switch_sample_view();">
-                                               <tabpanel id="itemsout">
-                                                       <vbox flex="1">
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Header"/>
-                                                                       <textbox id="itemsout_header_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Line Item"/>
-                                                                       <textbox id="itemsout_line_item_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Footer"/>
-                                                                       <textbox id="itemsout_footer_tb" multiline="true" flex="1" onchange="test_itemsout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <hbox>
-                                                                       <spacer flex="1"/>
-                                                                       <button label="Update Sample View" accesskey="V" />
-                                                                       <button label="Test Print" accesskey="T" oncommand="test_itemsout();"/>
-                                                                       <button label="Save" accesskey="S" oncommand="save_itemsout();"/>
-                                                               </hbox>
-                                                       </vbox>
-                                               </tabpanel>
-                                               <tabpanel id="checkout">
-                                                       <vbox flex="1">
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Header"/>
-                                                                       <textbox id="checkout_header_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Line Item"/>
-                                                                       <textbox id="checkout_line_item_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Footer"/>
-                                                                       <textbox id="checkout_footer_tb" multiline="true" flex="1" onchange="test_checkout(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <hbox>
-                                                                       <spacer flex="1"/>
-                                                                       <button label="Update Sample View" accesskey="V" />
-                                                                       <button label="Test Print" accesskey="T" oncommand="test_checkout();"/>
-                                                                       <button label="Save" accesskey="S" oncommand="save_checkout();"/>
-                                                               </hbox>
-                                                       </vbox>
-                                               </tabpanel>
-                                               <tabpanel id="checkin">
-                                                       <vbox flex="1">
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Header"/>
-                                                                       <textbox id="checkin_header_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Line Item"/>
-                                                                       <textbox id="checkin_line_item_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Footer"/>
-                                                                       <textbox id="checkin_footer_tb" multiline="true" flex="1" onchange="test_checkin(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <hbox>
-                                                                       <spacer flex="1"/>
-                                                                       <button label="Update Sample View" accesskey="V" />
-                                                                       <button label="Test Print" accesskey="T" oncommand="test_checkin();"/>
-                                                                       <button label="Save" accesskey="S" oncommand="save_checkin();"/>
-                                                               </hbox>
-                                                       </vbox>
-                                               </tabpanel>
-                                               <tabpanel id="holds">
-                                                       <vbox flex="1">
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Header"/>
-                                                                       <textbox id="holds_header_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Line Item"/>
-                                                                       <textbox id="holds_line_item_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <groupbox orient="vertical" flex="1">
-                                                                       <caption label="Footer"/>
-                                                                       <textbox id="holds_footer_tb" multiline="true" flex="1" onchange="test_holds(document.getElementById('sample_view'));"/>
-                                                               </groupbox>
-                                                               <hbox>
-                                                                       <spacer flex="1"/>
-                                                                       <button label="Update Sample View" accesskey="V" />
-                                                                       <button label="Test Print" accesskey="T" oncommand="test_holds();"/>
-                                                                       <button label="Save" accesskey="S" oncommand="save_holds();"/>
-                                                               </hbox>
-                                                       </vbox>
-                                               </tabpanel>
-                                       </tabpanels>
-                               </tabbox>
-                               </groupbox>
-                       </hbox>
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/contents.rdf b/Evergreen/staff_client/chrome/content/evergreen/contents.rdf
deleted file mode 100644 (file)
index 9738cec..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-       <!-- modified by Jason for Evergreen -->
-
-       <RDF:Seq about="urn:mozilla:package:root">
-               <RDF:li resource="urn:mozilla:package:evergreen"/>
-       </RDF:Seq>
-
-       <RDF:Seq RDF:about="urn:mozilla:overlays">
-               <RDF:li RDF:resource="chrome://browser/content/browser.xul"/>
-               <RDF:li RDF:resource="chrome://navigator/content/navigator.xul"/>
-       </RDF:Seq>
-
-       <RDF:Seq RDF:about="chrome://browser/content/browser.xul">
-               <RDF:li>chrome://evergreen/content/util/browser_overlay.xul</RDF:li>
-       </RDF:Seq>
-
-       <RDF:Seq about="chrome://navigator/content/navigator.xul">
-               <RDF:li>chrome://evergreen/content/util/browser_overlay.xul</RDF:li>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:package:evergreen"
-               chrome:displayName="Evergreen"
-               chrome:author="PINES"
-               chrome:name="evergreen"
-               chrome:extension="true"/>
-
-</RDF:RDF>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/about.xul b/Evergreen/staff_client/chrome/content/evergreen/main/about.xul
deleted file mode 100644 (file)
index db879be..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="about_win" 
-       onload="document.getElementById('about_image').focus();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading about.xul\n');</script>
-
-       <vbox id="about_vbox" flex="1" pack="center" align="center">
-               <groupbox id="about_groupbox">
-                       <image id="about_image" src="chrome://evergreen/skin/media/images/main_logo.jpg"/>
-                       <!--<image id="about_image" src="chrome://evergreen/skin/media/images/cooltext001.png"/>-->
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/app_shell.js b/Evergreen/staff_client/chrome/content/evergreen/main/app_shell.js
deleted file mode 100644 (file)
index 857c0ad..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-sdump('D_TRACE','Loading app_shell.js\n');
-
-function app_shell_init(p) {
-       sdump('D_TAB',"TESTING: app_shell.js: " + mw.G['main_test_variable'] + '\n');
-
-       p.w.close_tab = function (t1,t2) { return close_tab(p.w.document,t1,t2); };
-       p.w.find_free_tab = function (tabs) { return find_free_tab(tabs); };
-       p.w.new_tab = function () { return new_tab(p.w.document,p.tabbox); };
-       p.w.replace_tab = function (label,chrome,params) { return replace_tab(p.w.document,p.tabbox,label,chrome,params); };
-       p.w.get_frame_in_tab = function (idx, all_or_vis) { return get_frame_in_tab( p.w.document, p.tabbox, idx, all_or_vis ); }; 
-       
-       p.w.replace_tab('Tab','chrome://evergreen/content/main/about.xul');
-       /*
-       setTimeout( 
-               function () { 
-                       spawn_javascript_console(p.w.document,'replace_tab','main_tabbox',{}); 
-                       setTimeout(
-                               function () {
-                                       spawn_javascript_shell(p.w.document,'new_tab','main_tabbox',{});
-                               }, 2
-                       );
-               }, 2
-       );
-       */
-       return;
-}
-
-function close_tab( d, t1, t2 ) {
-       // t1 = tabbox or tab, if t1 = tabbox, t2 = tab index, otherwise close current tab
-       sdump('D_TAB',arg_dump(arguments,{1:true,2:true}));
-       if (typeof(t1)!='object')
-               t1 = d.getElementById(t1);
-       if (typeof(t1)!='object')
-               throw('Could not find tab or tabbox. d = ' + d + ' tabbox = ' + t1 + '\n');
-       try {
-               var tabbox;
-
-               if (t1.tagName == 'tabbox')
-                       tabbox = t1;
-               else
-                       tabbox = t1.parentNode.parentNode;
-
-               var idx = tabbox.selectedIndex;
-               if (t2)
-                       idx = t2;
-
-               sdump('D_TAB','tabbox.selectedIndex = ' + tabbox.selectedIndex + '\n');
-               var tabs = tabbox.firstChild; 
-               var panels = tabbox.lastChild;
-
-               if (idx == 0) {
-                       try {
-                               tabs.advanceSelectedTab(+1);
-                       } catch(E) {
-                               sdump('D_TAB','failed tabs.advanceSelectedTab(+1):'+js2JSON(E) + '\n');
-                               try {
-                                       tabs.advanceSelectedTab(-1);
-                               } catch(E) {
-                                       sdump('D_TAB','failed again tabs.advanceSelectedTab(-1):'+js2JSON(E) + '\n');
-                               }
-                       }
-               } else {
-                       try {
-                               tabs.advanceSelectedTab(-1);
-                       } catch(E) {
-                               sdump('D_TAB','failed tabs.advanceSelectedTab(-1):'+js2JSON(E) + '\n');
-                               try {
-                                       tabs.advanceSelectedTab(+1);
-                               } catch(E) {
-                                       sdump('D_TAB','failed again tabs.advanceSelectedTab(+1):'+js2JSON(E) + '\n');
-                               }
-                       }
-
-               }
-               
-               sdump('D_TAB','\tnew tabbox.selectedIndex = ' + tabbox.selectedIndex + '\n');
-
-               tabs.childNodes[ idx ].hidden = true;
-               sdump('D_TAB','tabs.childNodes[ ' + idx + ' ].hidden = true;\n');
-
-               // Make sure we keep at least one tab open.
-               var tab_flag = true;
-               for (var i = 0; i < tabs.childNodes.length; i++) {
-                       var tab = tabs.childNodes[i];
-                       if (!tab.hidden)
-                               tab_flag = false;
-               }
-               if (tab_flag)
-                       new_tab(d,tabbox);
-
-       } catch(E) {
-               sdump('D_ERROR',E+'\n');
-               throw(E);
-       }
-}
-
-function find_free_tab(tabs) {
-       var last_not_hidden = -1;
-       for (var i = 0; i<tabs.childNodes.length; i++) {
-               var tab = tabs.childNodes[i];
-               if (!tab.hidden)
-                       last_not_hidden = i;
-       }
-       if (last_not_hidden == tabs.childNodes.length - 1)
-               last_not_hidden = -1;
-       // If the one next to last_not_hidden is hidden, we want it.
-       // Basically, we fill in tabs after existing tabs for as 
-       // long as possible.
-       var idx = last_not_hidden + 1;
-       var candidate = tabs.childNodes[ idx ];
-       if (candidate.hidden)
-               return idx;
-       // Alright, find the first hidden then
-       for (var i = 0; i<tabs.childNodes.length; i++) {
-               var tab = tabs.childNodes[i];
-               if (tab.hidden)
-                       return i;
-       }
-       return -1;
-}
-
-function get_frame_in_tab( d, tabbox, idx, all_or_visible ) {
-       sdump('D_TAB',arg_dump(arguments));
-       if (typeof(tabbox)!='object')
-               tabbox = d.getElementById(tabbox);
-       if (typeof(tabbox)!='object')
-               throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
-       var tabs = tabbox.firstChild;
-       var panels = tabbox.lastChild;
-       try {
-               if (all_or_visible == 'visible') {
-                       var count = 0;
-                       for (var i = 0; i < tabs.childNodes.length; i++) {
-                               if (!tabs.childNodes[i].hidden) count++;
-                               if (count==idx) return panels.childNodes[i].getElementsByTagName('iframe')[0];
-                       }
-               } else {
-                       return panels.childNodes[ idx ].getElementsByTagName('iframe')[0];
-               }
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E) + '\n');
-       }
-       return null;
-}
-
-function new_tab( d, tabbox ) {
-       sdump('D_TAB',arg_dump(arguments,{1:true}));
-       if (typeof(tabbox)!='object')
-               tabbox = d.getElementById(tabbox);
-       if (typeof(tabbox)!='object')
-               throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
-       var tabs = tabbox.firstChild;
-       var panels = tabbox.lastChild;
-       var tc = find_free_tab(tabs);
-       sdump('D_TAB','find_free_tab returned ' + tc + '\n');
-       if (tc == -1) { return; } // let's only have up to 10 tabs
-       var tab = tabs.childNodes[ tc ];
-               tab.setAttribute('label','Tab ' + (tc + 1) );
-               tab.hidden = false;
-       try {
-               tabs.selectedIndex = tc;
-               replace_tab(d,tabbox,'Tab','chrome://evergreen/content/main/about.xul');
-       } catch(E) {
-               sdump('D_ERROR','+++++++++++++++++++++++++++++' + E + ' : ' + js2JSON(E)+'\n');
-       }
-}
-
-function replace_tab( d, tabbox, label, chrome, params ) {
-       sdump('D_TAB',arg_dump(arguments,{2:true,3:true,4:true}));
-       if (typeof(tabbox)!='object')
-               tabbox = d.getElementById(tabbox);
-       if (typeof(tabbox)!='object')
-               throw('Could not find tabbox. d = ' + d + ' tabbox = ' + tabbox + '\n');
-       var tabs = tabbox.firstChild;
-       var panels = tabbox.lastChild;
-       try {
-               var idx = tabs.selectedIndex;
-               var tab = tabs.childNodes[ idx ];
-               var panel = panels.childNodes[ idx ];
-
-               tab.hidden = false;
-               tab.setAttribute('label',label + ' ' + (idx+1));
-
-               var frame = d.createElement('iframe');
-               frame.setAttribute('flex','1');
-               frame.setAttribute('src',chrome);
-               panel.appendChild(frame);
-               panel.replaceChild(panel.lastChild,panel.firstChild);
-               frame.setAttribute('id','frame_'+idx);
-               
-               sdump('D_TAB','Created frame : ' + frame.id + ' for index : ' + idx + ' with src=' + frame.getAttribute('src') + '\n');
-               //frame.contentWindow.parentWindow = parentWindow;
-               //frame.contentWindow.tabWindow = this;
-               //dump('replace_tab.tabWindow = ' + this + '\n');
-               frame.contentWindow.mw = mw;
-               //frame.contentWindow.am_i_a_top_level_tab = true;
-               if (params) {
-                       frame.contentWindow.params = params;
-               }
-               return frame.contentWindow;
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E)+'\n');
-       }
-       //debug_tabs(d,tabbox);
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/app_shell.xul b/Evergreen/staff_client/chrome/content/evergreen/main/app_shell.xul
deleted file mode 100644 (file)
index 8870cf6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-
-<window id="app_shell_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="
-               params.tabbox = 'main_tabbox'; 
-               params.w = window; 
-               params.app = 'AppShell'; 
-               mw.OpenILS_init(params); 
-               window.document.title = mw.G.user.usrname() + '@' + mw.G.user_ou.name() + ' : ' + (++mw.G.appshell_name_increment);
-       "
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading app_shell.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/app_shell.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/main/app_shell_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="AppShell_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="AppShell_main" />
-
-       <popupset id="universal_popupset" />
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/app_shell_menus_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/app_shell_menus_overlay.xul
deleted file mode 100644 (file)
index 8d71a30..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-<overlay id="app_shell_menus_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading app_shell_menus_overlay.xul\n');</script>
-
-<!-- The File menu on the main menu -->
-<menu id="main.menu.file" label="&main.menu.file.label;" accesskey="&main.menu.file.key;" >
-       <menupopup id="main.menu.file.popup">
-               <menuitem label="&main.menu.file.new.label;" accesskey="&main.menu.file.new.key;" key="file-new-key" observes="cmd_new_window"/>
-               <menuitem label="&main.menu.file.new_tab.label;" accesskey="&main.menu.file.new_tab.key;" key="file-new-tab-key" observes="cmd_new_tab"/>
-               <menuseparator />
-       <!--
-               <menuitem label="&main.menu.file.open.label;" accesskey="&main.menu.file.open.key;" key="file-open-key" observes="cmd_broken" disabled="true"/>
-               <menuitem label="&main.menu.file.save.label;" accesskey="&main.menu.file.save.key;" key="file-save-key" observes="cmd_broken"/>
-               <menuseparator />
-       -->
-               <menuitem label="&main.menu.file.close_tab.label;" accesskey="&main.menu.file.close_tab.key;" key="file-close-tab-key" observes="cmd_close_tab"/>
-               <menuitem label="&main.menu.file.close.label;" accesskey="&main.menu.file.close.key;" key="file-close-key" observes="cmd_close_window"/>
-       </menupopup>
-</menu>
-
-<!-- The Edit menu on the main menu -->
-<menu id="main.menu.edit" label="&main.menu.edit.label;" accesskey="&main.menu.edit.key;">
-       <menupopup id="main.menu.edit.popup">
-               <menuitem label="stub"/>
-       <!--
-               <menuitem label="&main.menu.edit.undo.label;" accesskey="&main.menu.edit.undo.key;" key="edit-undo-key" observes="cmd_broken"/>
-               <menuitem label="&main.menu.edit.redo.label;" accesskey="&main.menu.edit.redo.key;" key="edit-redo-key" observes="cmd_broken"/>
-               <menuseparator />
-               <menuitem label="&main.menu.edit.cut.label;" accesskey="&main.menu.edit.cut.key;" key="edit-cut-key" observes="cmd_broken"/>
-               <menuitem label="&main.menu.edit.copy.label;" accesskey="&main.menu.edit.copy.key;" key="edit-copy-key" observes="cmd_broken"/>
-               <menuitem label="&main.menu.edit.paste.label;" accesskey="&main.menu.edit.paste.key;" key="edit-paste-key" observes="cmd_broken"/>
-               <menuitem label="&main.menu.edit.delete.label;" accesskey="&main.menu.edit.delete.key;" key="edit-delete-key" observes="cmd_broken"/>
-               <menuseparator />
-               <menuitem label="&main.menu.edit.buckets.label;" accesskey="&main.menu.edit.buckets.key;" observes="cmd_broken"/>
-               <menuseparator />
-               <menuitem label="&main.menu.edit.select_all.label;" accesskey="&main.menu.edit.select_all.key;" key="edit-select-all-key" observes="cmd_broken"/>
-               <menuseparator />
-               <menuitem label="&main.menu.edit.find.label;" accesskey="&main.menu.edit.find.key;" key="edit-find-key" observes="cmd_broken"/>
-               <menuitem label="&main.menu.edit.find_again.label;" accesskey="&main.menu.edit.find_again.key;" key="edit-find-again-key" observes="cmd_broken"/>
-       -->
-       </menupopup>
-</menu>
-
-<!-- The Circulation menu on the main menu -->
-<menu id="main.menu.circ" label="&main.menu.circ.label;" accesskey="&main.menu.circ.key;">
-       <menupopup id="main.menu.circ.popup">
-               <menuitem label="&main.menu.circ.checkout.label;" accesskey="&main.menu.circ.checkout.key;" observes="cmd_circ_checkout"/>
-               <menuitem label="&main.menu.circ.checkin.label;" accesskey="&main.menu.circ.checkin.key;" observes="cmd_circ_checkin"/>
-               <menuitem label="&main.menu.circ.hold_capture.label;" accesskey="&main.menu.circ.hold_capture.key;" observes="cmd_circ_hold_capture"/>
-       <!--
-               <menu id="special-circ-menu" label="&main.menu.circ.special.label;" accesskey="&main.menu.circ.special.key;" observes="cmd_broken"/>
-               <menuseparator />
-               <menuitem label="&main.menu.circ.place_hold.label;" accesskey="&main.menu.circ.place_hold.key;" key="circ-place-hold-key" observes="cmd_broken"/>
-       -->
-               <menuseparator />
-               <menuitem label="&main.menu.circ.copy_status.label;" accesskey="&main.menu.circ.copy_status.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.patron_status.label;" accesskey="&main.menu.circ.patron_status.key;" observes="cmd_circ_checkout"/>
-               <menuseparator />
-               <menuitem label="&main.menu.circ.patron_registration.label;" accesskey="&main.menu.circ.patron_registration.key;" observes="cmd_patron_register"/>
-       </menupopup>
-</menu>
-
-<!-- The Special Circulation submenu in the Circulation menu -->
-<menu id="special-circ-menu">
-       <menupopup id="special-circ-popup">
-               <menuitem label="&main.menu.circ.mark_used.label;" accesskey="&main.menu.circ.mark_used.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.lost.label;" accesskey="&main.menu.circ.lost.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.missing.label;" accesskey="&main.menu.circ.missing.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.found.label;" accesskey="&main.menu.circ.found.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.claimed_returned.label;" accesskey="&main.menu.circ.claimed_returned.key;" observes="cmd_broken"/>
-               <menuitem label="&main.menu.circ.quick_add.label;" accesskey="&main.menu.circ.quick_add.key;" observes="cmd_broken"/>
-       </menupopup>
-</menu>
-
-<!-- The Cataloging menu on the main menu -->
-<menu id="main.menu.cat" label="&main.menu.cat.label;" accesskey="&main.menu.cat.key;">
-       <menupopup id="main.menu.cat.popup">
-               <menuitem label="&main.menu.cat.bib_search.label;" accesskey="&main.menu.cat.bib_search.key;" observes="cmd_search_opac"/>
-               <menuseparator />
-               <menuitem disabled="true" label="&main.menu.cat.dedup.label;" accesskey="&main.menu.cat.dedup.key;" observes="cmd_broken"/>
-               <menuitem label="Create New Marc Record" accesskey="n" observes="cmd_create_new_marc_book"/>
-               <menuitem label="Z39.50 Import" accesskey="Z" observes="cmd_z39_50_import"/>
-       </menupopup>
-</menu>
-
-<!-- The Search menu on the main menu -->
-<menu id="main.menu.search" label="&main.menu.search.label;" accesskey="&main.menu.search.key;">
-       <menupopup id="main.menu.search.popup">
-               <menuitem label="Catalog" accesskey="C" observes="cmd_search_opac" />
-               <menuitem label="Patrons" accesskey="P" observes="cmd_patron_search" />
-       </menupopup>
-</menu>
-
-<!-- The Serials menu on the main menu -->
-<menu id="main.menu.serials" label="&main.menu.serials.label;" accesskey="&main.menu.serials.key;">
-       <menupopup id="main.menu.serials.popup">
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
-
-<!-- The Acquisitions menu on the main menu -->
-<menu id="main.menu.acquisitions" label="&main.menu.acquisitions.label;" accesskey="&main.menu.acquisitions.key;">
-       <menupopup id="main.menu.acquisitions.popup">
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
-
-<!-- The Reports menu on the main menu -->
-<menu id="main.menu.reports" label="&main.menu.reports.label;" accesskey="&main.menu.reports.key;">
-       <menupopup id="main.menu.reports.popup">
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
-
-<!-- The Help menu on the main menu -->
-<menu id="main.menu.help" label="&main.menu.help.label;" accesskey="&main.menu.help.key;">
-       <menupopup id="main.menu.help.popup">
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
-
-<!-- The Help menu on the main menu -->
-<menu id="main.menu.admin" label="&main.menu.admin.label;" accesskey="&main.menu.admin.key;">
-       <menupopup id="main.menu.admin.popup">
-               <menuitem label="Receipt Template Editor" accesskey="R" observes="cmd_receipt_template_editor"/>
-               <menuitem label="Survey Wizard" accesskey="S" observes="cmd_survey_wizard"/>
-               <menuitem label="Copy Stat-Cat Editor" accesskey="C" observes="cmd_copy_stat_cat_edit"/>
-               <menuitem label="Patron Stat-Cat Editor" accesskey="P" observes="cmd_patron_stat_cat_edit"/>
-               <menuseparator />
-               <menuitem label="Test Module" accesskey="T" observes="cmd_test"/>
-               <menuitem label="XUL Test" accesskey="X" observes="cmd_xuleditor"/>
-               <menuitem label="Fieldmapper" accesskey="m" observes="cmd_fieldmapper"/>
-               <menuitem label="Filterable Console" accesskey="F" observes="cmd_filter_console"/>
-               <menuitem label="Javscript Console" accesskey="J" observes="cmd_console"/>
-               <menuitem label="Javscript Shell" accesskey="H" observes="cmd_shell"/>
-       </menupopup>
-</menu>
-
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/app_shell_overlay.xul
deleted file mode 100644 (file)
index e12687f..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/app_shell.dtd">
-<overlay id="app_shell_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading app_shell_overlay.xul\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/main/app_shell_menus_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_close_window" key="close-window-key" oncommand="
-               window.close();" />
-
-       <command id="cmd_new_window" key="new-window-key" oncommand="
-               mw.spawn_main();" />
-
-       <command id="cmd_new_tab" key="new-tab-key" oncommand="
-               mw.new_tab(document,'main_tabbox');" />
-
-       <command id="cmd_close_tab" key="close-tab-key" oncommand="
-               mw.close_tab(document,'main_tabbox');" />
-
-       <command id="cmd_cat_main" key="cat-main-key" oncommand="
-               mw.spawn_opac_navigator(document,'replace_tab','main_tabbox',{}); "/>   
-
-       <command id="cmd_circ_checkout" key="circ-checkout-key" oncommand="
-               mw.spawn_patron_barcode_entry(document,'replace_tab','main_tabbox',{}); "/>     
-
-       <command id="cmd_patron_search" key="patron-search-key" oncommand="
-               mw.spawn_patron_search(document,'replace_tab','main_tabbox',{}); "/>    
-
-       <command id="cmd_circ_checkin" key="circ-checkin-key" oncommand="
-               mw.spawn_checkin(document,'replace_tab','main_tabbox',{}); "/>  
-
-       <command id="cmd_circ_hold_capture" key="circ-hold-capture-key" oncommand="
-               mw.spawn_hold_capture(document,'replace_tab','main_tabbox',{}); "/>     
-
-       <command id="cmd_search_opac" key="search-opac-key" oncommand="
-               mw.spawn_opac_navigator(document,'replace_tab','main_tabbox',{}); "/>   
-
-       <command id="cmd_patron_register" key="patron-register-key" oncommand="
-               mw.spawn_patron_register(document,'replace_tab','main_tabbox',{}); "/>  
-
-       <command id="cmd_survey_wizard" oncommand="
-               mw.spawn_survey_admin_wizard(document,'new_window','',{}); "/>  
-
-       <command id="cmd_copy_stat_cat_edit" oncommand="
-               mw.spawn_copy_stat_cat_edit(document,'replace_tab','main_tabbox',{}); "/>       
-
-       <command id="cmd_patron_stat_cat_edit" oncommand="
-               mw.spawn_patron_stat_cat_edit(document,'replace_tab','main_tabbox',{}); "/>     
-
-       <command id="cmd_receipt_template_editor" oncommand="
-               mw.spawn_receipt_template_editor(document,'replace_tab','main_tabbox',{}); "/>  
-
-       <command id="cmd_z39_50_import" oncommand="
-               mw.spawn_z3950_import(document,'replace_tab','main_tabbox',{}); "/>     
-
-       <command id="cmd_create_new_marc_book" oncommand="
-               mw.spawn_new_marc_creation(document,'replace_tab','main_tabbox',{}); "/>        
-
-       <command id="cmd_console" oncommand="
-               mw.spawn_javascript_console(document,'new_tab','main_tabbox',{}); "/>
-
-       <command id="cmd_shell" oncommand="
-               mw.spawn_javascript_shell(document,'new_tab','main_tabbox',{}); "/>
-
-       <command id="cmd_xuleditor" oncommand="
-               mw.spawn_xuleditor(document,'new_tab','main_tabbox',{}); "/>
-
-       <command id="cmd_filter_console" oncommand="
-               mw.spawn_filter_console(document,'new_tab','main_tabbox',{}); "/>
-
-       <command id="cmd_fieldmapper" oncommand="
-               mw.spawn_fieldmapper(document,'new_tab','main_tabbox',{}); "/>
-
-       <command id="cmd_test" disabled="true" oncommand="
-               mw.spawn_interface(document,'new_tab','main_tabbox','chrome://evergreen/content/util/fm_view.xul','Fieldmapper',{}); "/>
-
-       <command id="cmd_broken" disabled="true" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- The top level widget for the staff client -->
-<box id="AppShell_main" flex="1" orient="vertical">
-       <toolbox id="main_toolbox"/>
-       <tabbox id="main_tabbox" flex="1" eventnode="window" handleCtrlTab="true">
-               <tabs id="main_tabs" closebutton="true">
-                       <tab id="tab_1" accesskey="1" label="Tab 1" hidden="true" />
-                       <tab id="tab_2" accesskey="2" label="Tab 2" hidden="true" />
-                       <tab id="tab_3" accesskey="3" label="Tab 3" hidden="true" />
-                       <tab id="tab_4" accesskey="4" label="Tab 4" hidden="true" />
-                       <tab id="tab_5" accesskey="5" label="Tab 5" hidden="true" />
-                       <tab id="tab_6" accesskey="6" label="Tab 6" hidden="true" />
-                       <tab id="tab_7" accesskey="7" label="Tab 7" hidden="true" />
-                       <tab id="tab_8" accesskey="8" label="Tab 8" hidden="true" />
-                       <tab id="tab_9" accesskey="9" label="Tab 9" hidden="true" />
-               </tabs>
-               <tabpanels id="main_panels" flex="1">
-                       <tabpanel id="panel_1"><label value="panel_1"/></tabpanel>
-                       <tabpanel id="panel_2"><label value="panel_2"/></tabpanel>
-                       <tabpanel id="panel_3"><label value="panel_3"/></tabpanel>
-                       <tabpanel id="panel_4"><label value="panel_4"/></tabpanel>
-                       <tabpanel id="panel_5"><label value="panel_5"/></tabpanel>
-                       <tabpanel id="panel_6"><label value="panel_6"/></tabpanel>
-                       <tabpanel id="panel_7"><label value="panel_7"/></tabpanel>
-                       <tabpanel id="panel_8"><label value="panel_8"/></tabpanel>
-                       <tabpanel id="panel_9"><label value="panel_9"/></tabpanel>
-               </tabpanels>
-       </tabbox>
-       <toolbox id="entity_toolbox"/>
-</box>
-
-<!-- The main top level menubar -->
-<toolbox id="main_toolbox">
-       <menubar id="main_menubar">
-               <menu id="main.menu.file" />
-               <menu id="main.menu.edit" />
-               <menu id="main.menu.search" />
-               <menu id="main.menu.circ" />
-               <menu id="main.menu.cat" />
-               <menu id="main.menu.serials" />
-               <menu id="main.menu.acquisitions" />
-               <menu id="main.menu.reports" />
-               <spacer flex="1" />
-               <menu id="main.menu.admin" />
-               <menu id="main.menu.help" />
-       </menubar>
-</toolbox>
-
-<!-- The Entity top level menubar -->
-<!--
-<toolbox id="entity_toolbox">
-       <menubar id="entity_menubar">
-               <menu id="patron-menu" label="&main.menu.entity.patron.label;" accesskey="&main.menu.entity.patron.key;" command="cmd_broken"/>
-               <menu id="copy-menu" label="&main.menu.entity.copy.label;" accesskey="&main.menu.entity.copy.key;" command="cmd_broken"/>
-               <menu id="volume-menu" label="&main.menu.entity.volume.label;" accesskey="&main.menu.entity.volume.key;" command="cmd_broken"/>
-               <menu id="bib-menu" label="&main.menu.entity.bib.label;" accesskey="&main.menu.entity.bib.key;" command="cmd_broken"/>
-       </menubar>
-</toolbox>
--->
-
-<!-- The Patron menu on the Entity menubar -->
-<!--
-<menu id="patron-menu">
-       <menupopup id="patron-popup">
-               <menuitem label="&main.menu.circ.patron_registration.label;" accesskey="&main.menu.entity.patron.register.key;" command="cmd_patron_register"/>
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
--->
-
-<!-- The Items menu on the Entity menubar -->
-<!--
-<menu id="copy-menu">
-       <menupopup id="copy-popup">
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
--->
-
-<!-- The Volumes menu on the Entity menubar -->
-<!--
-<menu id="volume-menu">
-       <menupopup id="volume-popup">
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
--->
-
-<!-- The Bib Records menu on the Entity menubar -->
-<!--
-<menu id="bib-menu">
-       <menupopup id="bib-popup">
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-               <menuitem label="stub" />
-       </menupopup>
-</menu>
--->
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="AppShell_keys">
-       <key id="new-window-key" modifiers="accel" key="N" command="cmd_new_window"/>
-       <key id="new-tab-key" modifiers="accel" key="T" command="cmd_new_tab"/>
-       <key id="open-key" modifiers="accel" key="O" command=""/>
-       <key id="save-key" modifiers="accel" key="S" command=""/>
-       <key id="close-tab-key" modifiers="accel" key="W" command="cmd_close_tab"/>
-       <key id="close-window-key" modifiers="accel" key="Q" command="cmd_close_window"/>
-       <!--
-       <key id="edit-undo-key" modifiers="accel" key="Z" command=""/>
-       <key id="edit-redo-key" modifiers="accel" key="Y" command=""/>
-       <key id="edit-cut-key" modifiers="accel" key="X" command=""/>
-       <key id="edit-copy-key" modifiers="accel" key="C" command=""/>
-       <key id="edit-paste-key" modifiers="accel" key="V" command=""/>
-       <key id="edit-delete-key" modifiers="" keycode="VK_DELETE" command=""/>
-       <key id="edit-select-all-key" modifiers="accel" key="A" command=""/>
-       <key id="edit-find-key" modifiers="accel" key="F" command=""/>
-       <key id="edit-find-again-key" modifiers="accel" key="G" command=""/>
-
-       <key id="circ-patron-status-key" keycode="VK_F11" command="cmd_circ_display"/>
-       <key id="circ-copy-status-key" keycode="VK_F9" command=""/>
-       <key id="circ-check-in-key" keycode="VK_F2" command="cmd_circ_checkin"/>
-       <key id="circ-renew-key" keycode="VK_F3" command=""/>
-       <key id="circ-mark-used-key" keycode="VK_F4" command=""/>
-       <key id="circ-place-hold-key" keycode="VK_F5" command=""/>
-       <key id="circ-patron-registration-key" keycode="VK_F12" command=""/>
-       -->
-       <key id="circ-checkout-key" keycode="VK_F1" command="cmd_circ_checkout"/>
-       <key id="circ-checkin-key" keycode="VK_F2" command="cmd_circ_checkin"/>
-       <key id="search-opac-key" keycode="VK_F3" command="cmd_search_opac"/>
-       <key id="patron-search-key" keycode="VK_F4" command="cmd_patron_search"/>
-       <key id="circ-hold-capture-key" keycode="VK_F5" command="cmd_circ_hold_capture"/>
-       <key id="patron-register-key" keycode="VK_F12" command="cmd_patron_registration"/>
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.js b/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.js
deleted file mode 100644 (file)
index 6ca1063..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-sdump('D_TRACE','Loading clam_shell.js\n');
-
-function clam_shell_init(p) {
-       sdump('D_CLAM',"TESTING: clam_shell.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       if (p) {
-               // This code breaks the splitter, so don't use
-               if (p.horizontal) {
-                       sdump('D_CLAM','Setting horizontal\n');
-                       p.node.orient = 'horizontal';
-               } else if (p.vertical) {
-                       sdump('D_CLAM','Setting vertical\n');
-                       p.node.orient = 'vertical';
-               }
-
-               p.splitter_node = p.node.childNodes[1];
-               if (p.hide_splitter) {
-                       sdump('D_CLAM','Hiding splitter\n');
-                       p.splitter_node.hidden = true;
-               } else {
-                       sdump('D_CLAM','Showing splitter\n');
-                       p.splitter_node.hidden = false;
-               }
-                       
-       }
-
-       p.first_deck = p.node.firstChild;
-       p.second_deck = p.node.lastChild;
-
-       p.get_card_in_first_deck = function (idx) {
-               if (idx)
-                       return first_deck.childNodes[ idx ];
-               else
-                       return first_deck.selectedPanel;
-       }
-
-       p.get_card_in_second_deck = function (idx) {
-               if (idx)
-                       return second_deck.childNodes[ idx ];
-               else
-                       return second_deck.selectedPanel;
-       }
-
-       p.set_first_deck = function (idx) { return p.first_deck.selectedIndex = idx; };
-
-       p.set_second_deck = function (idx) { return p.second_deck.selectedIndex = idx; };
-
-       p.replace_card_in_first_deck = function (idx,chrome,params) {
-               return replace_card_in_deck(p.first_deck,idx,chrome,params);
-       };
-
-       p.replace_card_in_second_deck = function (idx,chrome,params) {
-               return replace_card_in_deck(p.second_deck,idx,chrome,params);
-       };
-
-       p.new_card_in_first_deck = function (chrome,params) {
-               return new_card_in_deck(p.first_deck,chrome,params);
-       };
-       p.new_card_in_second_deck = function (chrome,params) {
-               return new_card_in_deck(p.second_deck,chrome,params);
-       };
-
-       return p;
-}
-
-function new_card_in_deck(deck,chrome,params) {
-       sdump('D_CLAM',arg_dump(arguments));
-       var new_card = deck.ownerDocument.createElement('iframe');
-       deck.appendChild(new_card);
-       new_card.setAttribute('flex','1');
-       new_card.setAttribute('src',chrome);
-       new_card.setAttribute('id','card_'+(deck.childNodes.length-1));
-       new_card.contentWindow.mw = mw;
-       return new_card.contentWindow;
-}
-
-function replace_card_in_deck(deck,idx,chrome,params) {
-       sdump('D_CLAM',arg_dump(arguments));
-       var old_card = deck.childNodes[ idx ];
-       var new_card = deck.ownerDocument.createElement('iframe');
-       new_card.setAttribute('flex','1');
-       new_card.setAttribute('src',chrome);
-       deck.appendChild(new_card);
-       deck.replaceChild(new_card,old_card);
-       new_card.setAttribute('id','card_'+idx);
-       new_card.contentWindow.mw = mw;
-       if (params)
-               new_card.contentWindow.params = params;
-       return new_card.contentWindow;
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.xul b/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.xul
deleted file mode 100644 (file)
index 1745ff0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-
-<page id="clam_shell_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="params.node = document.getElementById('ClamShell_main'); 
-               params.w = window; 
-               params.app = 'ClamShell'; 
-               mw.OpenILS_init(params);"
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading clam_shell.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/clam_shell.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="ClamShell_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="ClamShell_main" />
-
-       <popupset id="universal_popupset" />
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_overlay.xul
deleted file mode 100644 (file)
index 05ad21e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-<overlay id="clam_shell_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading clam_shell_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for clam_shell -->
-<box id="ClamShell_main" flex="1" orient="horizontal">
-       <deck id="ClamShell_first_deck" flex="1"/>
-       <splitter id="ClamShell_splitter" />
-       <deck id="ClamShell_second_deck" flex="4"/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="ClamShell_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical.xul b/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical.xul
deleted file mode 100755 (executable)
index 4d5c2b2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-
-<page id="clam_shell_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="params.clamshell = 'ClamShell_main'; 
-               params.splitter = 'ClamShell_splitter';
-               params.w = window; 
-               params.app = 'ClamShell'; 
-               mw.OpenILS_init(params);"
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading clam_shell_vertical.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/clam_shell.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_vertical_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="ClamShell_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="ClamShell_main" />
-
-       <popupset id="universal_popupset" />
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/clam_shell_vertical_overlay.xul
deleted file mode 100644 (file)
index a55b9d6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/clam_shell.dtd">
-<overlay id="clam_shell_vertical_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading clam_shell_vertical_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for clam_shell -->
-<box id="ClamShell_main" flex="1" orient="vertical">
-       <deck id="ClamShell_first_deck" flex="1"/>
-       <splitter id="ClamShell_splitter" />
-       <deck id="ClamShell_second_deck" flex="4"/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="ClamShell_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/grid_list.js b/Evergreen/staff_client/chrome/content/evergreen/main/grid_list.js
deleted file mode 100644 (file)
index 4d18a2d..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-sdump('D_TRACE','Loading grid_list.js\n');
-
-function grid_list_init(p) {
-       sdump('D_GRID_LIST',"TESTING: grid_list.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.grid = p.node.getElementsByAttribute('name','grid')[0];
-       //p.popup = p.node.getElementsByTagName('popup')[0];
-       p.grid_columns = p.grid.firstChild;
-       p.grid_rows = p.grid.lastChild;
-
-       p._context_function = function (ev) { alert('default _context_function'); };
-       //p.popup.addEventListener('popupshowing',function (ev) { return p._context_function(ev); },false);
-
-       grid_list_make_columns( p, p.cols )
-
-       p.clear_grid = function () {
-               sdump('D_GRID_LIST','p.clear_grid()\n');
-               while( p.grid_rows.childNodes.length > 1 ) {
-                       p.grid_rows.removeChild( p.grid_rows.lastChild );
-               }
-       }
-
-       p.add_rows = function (new_rows) { 
-               sdump('D_GRID_LIST','p.add_rows()\n');
-               return grid_list_add_rows(p,new_rows); 
-       }
-
-       p.remove_row_by_id = function (id) {
-               sdump('D_GRID_LIST','p.remove_row_by_id()\n');
-               return grid_list_remove_row_by_id(p,id); 
-       }
-
-       p.register_context_builder = function (f) {
-               sdump('D_GRID_LIST','p.register_context_builder(' + f + ')\n');
-               return p._context_function = f;
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function grid_list_make_columns( p, cols ) {
-       sdump('D_GRID_LIST',arg_dump(arguments,{2:'.length'}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var d = p.w.document;
-       // cols[ idx ] = { 'id':???, 'label':???, 'primary':???, 'flex':??? }
-       var header = p.w.document.createElement('row');
-       p.grid_rows.appendChild( header );
-       for (var i = 0; i < cols.length; i++) {
-               var col = cols[i];
-               sdump('D_GRID_LIST','Col ' + i + ' : ' + js2JSON( col ) + '\n');
-               var gridcol = d.createElement( 'column' );
-               p.grid_columns.appendChild( gridcol );
-               for (var j in col) {
-                       gridcol.setAttribute( j, col[j] );
-               }
-               var th = p.w.document.createElement('label');
-               header.appendChild( th );
-               th.setAttribute('value', col.label);
-               th.setAttribute('style','font-weight: bold;');
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function grid_list_add_rows( p, new_rows ) {
-       sdump('D_GRID_LIST',arg_dump(arguments,{2:'.length'}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       for (var i = 0; i < new_rows.length; i++) {
-               var new_row = new_rows[i];
-
-               p.grid_rows.appendChild( new_row );
-
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function grid_list_remove_row_by_id( p, id ) {
-       sdump('D_GRID_LIST',arg_dump(arguments));
-       var row = p.grid_rows.getElementsByAttribute('id',id)[0];
-       p.grid_rows.removeChild( row );
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/grid_list_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/grid_list_overlay.xul
deleted file mode 100644 (file)
index 4e0d03a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<overlay id="grid_list_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading grid_list_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for grid_list -->
-<box id="GridList_main" flex="1" orient="vertical">
-       <popupset>
-               <popup id="GridList_popup"/>
-       </popupset>
-       <hbox id="GridList_insert1" />
-       <hbox id="GridList_nav" name="nav"/>
-       <hbox id="GridList_insert2" />
-       <grid id="GridList_grid" flex="1" name="grid">
-               <columns id="GridList_columns" />
-               <rows id="GridList_rows" />
-       </grid>
-       <hbox id="GridList_insert3" />
-</box>
-
-<!-- Context menus -->
-<popupset id="universal_popupset">
-</popupset>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="GridList_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/list_box.js b/Evergreen/staff_client/chrome/content/evergreen/main/list_box.js
deleted file mode 100644 (file)
index 4492f9a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-sdump('D_TRACE','Loading list_box.js\n');
-
-function list_box_init( p ) {
-       sdump('D_LIST_BOX',"TESTING: list_box.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.listbox = p.w.document.createElement('listbox');
-       p.node.appendChild( p.listbox );
-       p.listbox.setAttribute('flex','1');
-       p.listbox.setAttribute('seltype','multiple');
-
-               var listhead = p.w.document.createElement('listhead');
-               p.listbox.appendChild( listhead );
-
-               var listcols = p.w.document.createElement('listcols');
-               p.listbox.appendChild( listcols );
-
-                       /*if (window.navigator.userAgent.match( /Firefox/ ))*/  {
-                               //sdump('D_FIREFOX','Kludge: Adding extra listheader and listcol\n');
-                               var listheader = p.w.document.createElement('listheader');
-                               listhead.appendChild( listheader );
-                               listheader.setAttribute('label', '');
-                               var listcol = p.w.document.createElement('listcol');
-                               listcols.appendChild( listcol );
-                       }
-
-                       for (var i = 0; i < p.cols.length; i++ ) {
-
-                               var listheader = p.w.document.createElement('listheader');
-                               listhead.appendChild( listheader );
-                               listheader.setAttribute('label', p.cols[i].label);
-
-                               var listcol = p.w.document.createElement('listcol');
-                               listcols.appendChild( listcol );
-                               listcol.setAttribute('flex', p.cols[i].flex);
-                       }
-
-       p.add_row = function (cols, params) {
-
-               var listitem = p.w.document.createElement('listitem');
-               p.listbox.appendChild( listitem );
-               listitem.setAttribute('allowevents','true');
-               listitem.setAttribute('style','border-bottom: black solid thin');
-               for (var i in params) {
-                       listitem.setAttribute( i, params[i] );
-               }
-
-               /* if (window.navigator.userAgent.match( /Firefox/ )) */ {
-                       //sdump('D_FIREFOX','Kludge: Setting label on listitem\n');
-                       listitem.setAttribute('label',' ');
-               }
-
-               for (var i = 0; i < cols.length; i++) {
-
-                       try {
-                               listitem.appendChild( cols[i] );
-                       } catch(E) {
-                               sdump('D_ERROR', cols[i] + '\n' + E + '\n');
-                       }
-               }
-               
-               return listitem;
-       }
-
-       p.clear_rows = function () {
-               var count = p.listbox.getRowCount();
-               for (var i = 0; i < count; i++) {
-                       p.listbox.removeChild( p.listbox.lastChild );
-               }
-       }
-
-       return p;
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/paged_tree.js b/Evergreen/staff_client/chrome/content/evergreen/main/paged_tree.js
deleted file mode 100644 (file)
index d17d7dc..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-sdump('D_TRACE','Loading paged_tree.js\n');
-
-function paged_tree_init(p) {
-       sdump('D_PAGED_TREE',"TESTING: paged_tree.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.current_idx = 0;
-
-       p.tree = p.node.getElementsByAttribute('name','tree')[0];
-       p.popup = p.node.getElementsByTagName('popup')[0];
-       p.treecols = p.tree.firstChild;
-       p.tc = p.tree.lastChild;
-
-       p._context_function = function (ev) { alert('default _context_function'); };
-       p.popup.addEventListener('popupshowing',function (ev) { return p._context_function(ev); },false);
-
-       p._select_callback = function (ev) { alert('default _select_callback'); };
-       p.tree.addEventListener('select',function (ev) { return p._select_callback(ev); },false);
-
-       paged_tree_make_columns( p, p.treecols, p.cols )
-
-       p.clear_tree = function () {
-               sdump('D_PAGED_TREE','p.clear_tree()\n');
-               empty_widget( p.w.document, p.tc );
-               p.current_idx = 0;
-               return paged_tree_update_nav(p);
-       }
-
-       p.add_rows = function (ids) { 
-               sdump('D_PAGED_TREE','p.add_rows()\n');
-               return paged_tree_add_rows(p,p.tc,ids); 
-       }
-
-       p.register_flesh_row_function = function (f) { 
-               sdump('D_PAGED_TREE','p.register_flesh_row_function(' + f + ')\n');
-               return p._flesh_row_function = f; 
-       }
-
-       p.register_select_callback = function (f) { 
-               sdump('D_PAGED_TREE','p.register_select_callback(' + f + ')\n');
-               return p._select_callback = f; 
-       }
-
-       p.register_context_builder = function (f) {
-               sdump('D_PAGED_TREE','p.register_context_builder(' + f + ')\n');
-               return p._context_function = f;
-       }
-
-       p.map_cols_to_treeitem = map_array_to_treecells_via_treeitem;
-
-       p.nav_bar = p.node.getElementsByAttribute('name','nav')[0];
-       if (p.hide_nav) p.nav_bar.hidden = p.hide_nav;
-
-       p.results_label = p.nav_bar.getElementsByAttribute('name','label_results')[0];
-       p.range_label = p.nav_bar.getElementsByAttribute('name','label_range')[0];
-
-       p.hits_per_page_menu = p.nav_bar.getElementsByAttribute('name','hits_per_page')[0];
-       if (p.hits_per_page) {
-               p.display_count = parseInt( p.hits_per_page );
-       } else {
-               p.display_count = parseInt( p.hits_per_page_menu.getAttribute('value') );
-       }
-
-       p.set_hits_per_page = function (ev) {
-               try {
-                       p.display_count = parseInt( p.hits_per_page_menu.getAttribute('value') );
-                       paged_tree_update_visibility( p );
-                       paged_tree_update_nav( p );
-                       paged_tree_flesh_records( p );
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E)+'\n');
-               }
-       }
-       p.hits_per_page_menu.addEventListener(
-               'command',
-               p.set_hits_per_page,
-               false
-       );
-
-
-       p.next_button = p.nav_bar.getElementsByAttribute('name','button_next')[0];
-       p.next_button.addEventListener(
-               'command',
-               function (ev) {
-                       var backup_select_callback = p._select_callback;
-                       p._select_callback = function (ev) {};
-                       var result = paged_tree_nav_next(p);
-                       p._select_callback = backup_select_callback;
-                       return result;
-               },
-               false
-       );
-
-       p.prev_button = p.nav_bar.getElementsByAttribute('name','button_prev')[0];
-       p.prev_button.addEventListener(
-               'command',
-               function (ev) {
-                       var backup_select_callback = p._select_callback;
-                       p._select_callback = function (ev) {};
-                       var result = paged_tree_nav_prev(p);
-                       p._select_callback = backup_select_callback;
-                       return result;
-               },
-               false
-       );
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function paged_tree_make_columns( p, treecols, cols ) {
-       sdump('D_PAGED_TREE',arg_dump(arguments,{2:'.length'}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var d = p.w.document;
-       // cols[ idx ] = { 'id':???, 'label':???, 'primary':???, 'flex':??? }
-       for (var i = 0; i < cols.length; i++) {
-               var col = cols[i];
-               sdump('D_PAGED_TREE','Col ' + i + ' : ' + js2JSON( col ) + '\n');
-               var treecol = d.createElement( 'treecol' );
-               treecols.appendChild( treecol );
-               for (var j in col) {
-                       treecol.setAttribute( j, col[j] );
-               }
-               var splitter = d.createElement( 'splitter' );
-               treecols.appendChild(splitter);
-               splitter.setAttribute('class','tree-splitter');
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return treecols;
-}
-
-function paged_tree_add_rows( p, tc, ids ) {
-       sdump('D_PAGED_TREE',arg_dump(arguments,{2:'.length'}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var d = p.w.document;
-       var offset = 0;
-       if (tc.childNodes.length > 0) { offset = tc.lastChild.id; }
-       for (var i = 0; i < ids.length; i++) {
-               var id = ids[i];
-
-               var treeitem = d.createElement( 'treeitem' );
-               treeitem.setAttribute( 'id', i+offset+1 );
-               treeitem.setAttribute( 'record_id', id );
-               treeitem.setAttribute( 'retrieved', 'false' );
-               if ( (i+offset) < (p.display_count + p.current_idx) ) {
-                       treeitem.setAttribute( 'hidden', 'false' );
-               } else {
-                       treeitem.setAttribute( 'hidden', 'true' );
-               }
-               tc.appendChild( treeitem );
-
-               var treerow = d.createElement( 'treerow' );
-               treeitem.appendChild( treerow );
-
-               for (var j = 0; j < p.treecols.childNodes.length; j++) {
-                       var treecell = d.createElement( 'treecell' );
-                       if (j == 0)
-                               treecell.setAttribute('label', getString('retrieving.record') );
-                       else
-                               treecell.setAttribute('label', '' );
-                       treerow.appendChild( treecell );
-               }
-       }
-       paged_tree_update_visibility( p );
-       paged_tree_update_nav( p );
-       paged_tree_flesh_records( p );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_flesh_record(p,treeitem) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       treeitem.setAttribute('retrieved','true');
-       if (p._flesh_row_function) {
-               p._flesh_row_function( treeitem );
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_flesh_records(p) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       for (var i = 0; i < p.tc.childNodes.length; i++) {
-               var treeitem = p.tc.childNodes[i];
-               if ( (treeitem.hidden == false) && (treeitem.getAttribute('retrieved')=='false') ) {
-                       paged_tree_flesh_record(p,treeitem);
-               }
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_update_nav(p) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       if (p.results_label)
-               p.results_label.setAttribute('value', p.tc.childNodes.length );
-
-       var min = p.current_idx + 1;
-       var max = p.current_idx + p.display_count;
-       if (max > p.tc.childNodes.length)
-               max = p.tc.childNodes.length;
-       if (p.range_label) {
-               if (max > 0)
-                       p.range_label.setAttribute('value', min + ' - ' + max );
-               else
-                       p.range_label.setAttribute('value', '0 - 0' );
-       }
-
-       if (p.next_button) {
-               if (max < p.tc.childNodes.length)
-                       p.next_button.disabled = false;
-               else
-                       p.next_button.disabled = true;
-       }
-
-       if (p.prev_button) {
-               if (min == 1)
-                       p.prev_button.disabled = true;
-               else
-                       p.prev_button.disabled = false;
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_update_visibility(p) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       for (var i = 0; i < p.tc.childNodes.length; i++) {
-               var treeitem = p.tc.childNodes[i];
-               if ( (i >= p.current_idx) && (i < (p.current_idx+p.display_count)) )
-                       treeitem.hidden = false;
-               else
-                       treeitem.hidden = true;
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_nav_next(p) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var proposed_idx = p.current_idx + p.display_count;
-       if (proposed_idx >= p.tc.childNodes.length)
-               proposed_idx = p.tc.childNodes.length - 1;
-       p.current_idx = proposed_idx;
-       paged_tree_update_visibility(p);
-       paged_tree_update_nav(p);
-       paged_tree_flesh_records(p);
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function paged_tree_nav_prev(p) {
-       sdump('D_PAGED_TREE',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var proposed_idx = p.current_idx - p.display_count;
-       if (proposed_idx < 0)
-               proposed_idx = 0;
-       p.current_idx = proposed_idx;
-       paged_tree_update_visibility(p);
-       paged_tree_update_nav(p);
-       paged_tree_flesh_records(p);
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/main/paged_tree_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/main/paged_tree_overlay.xul
deleted file mode 100644 (file)
index 89cb7d5..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/paged_tree.dtd">
-<overlay id="paged_tree_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading paged_tree_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for paged_tree -->
-<box id="PagedTree_main" flex="1" orient="vertical">
-       <popupset>
-               <popup id="PagedTree_popup"/>
-       </popupset>
-       <hbox id="PagedTree_insert1" />
-       <hbox id="PagedTree_nav" name="nav"/>
-       <hbox id="PagedTree_insert2" />
-       <tree id="PagedTree_tree" flex="1" enableColumnDrag="true" name="tree">
-               <treecols id="PagedTree_columns"/>
-               <treechildren id="PagedTree_children" context="PagedTree_popup"/>
-       </tree>
-       <hbox id="PagedTree_insert3" />
-</box>
-
-<hbox id="PagedTree_nav">
-       <label value="&displaying.results;"/>
-       <label id="PagedTree_label_range" value="??? - ???" name="label_range"/>
-       <label value="&displaying.of;"/>
-       <label id="PagedTree_label_results" value="???" name="label_results"/>
-       <spacer flex="1"/>
-       <label id="ptnl1" value="&displaying.hits_per_page;"/>
-       <menulist id="PagedTree_menulist_hits_per_page" name="hits_per_page">
-               <menupopup id="ptnmp">
-                       <menuitem id="ptnm0" label="10" value="10"  />
-                       <menuitem id="ptnm1" label="20" value="20" selected="true" />
-                       <menuitem id="ptnm2" label="30" value="30" />
-                       <menuitem id="ptnm3" label="40" value="40" />
-                       <menuitem id="ptnm4" label="50" value="50" />
-                       <menuitem id="ptnm5" label="60" value="60" />
-                       <menuitem id="ptnm6" label="70" value="70" />
-                       <menuitem id="ptnm7" label="80" value="80" />
-                       <menuitem id="ptnm8" label="90" value="90" />
-                       <menuitem id="ptnm9" label="100" value="100" />
-               </menupopup>
-       </menulist>
-       <button id="PagedTree_button_prev" label="&previous.range;" accesskey="&previous.range.key;" disabled="true" name="button_prev"/>
-       <button id="PagedTree_button_next" label="&next.range;" accesskey="&next.range.key;" disabled="true" name="button_next"/>
-</hbox>
-
-<!-- Context menus -->
-<popupset id="universal_popupset">
-</popupset>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PagedTree_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/opac/opac.js b/Evergreen/staff_client/chrome/content/evergreen/opac/opac.js
deleted file mode 100644 (file)
index 5121985..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-sdump('D_OPAC','Loading opac.js\n');
-
-var OPAC_URL = "http://dev.gapines.org/"
-
-/* listen for page changes */
-
-function buildProgressListener(p) {
-       sdump('D_OPAC',arg_dump(arguments));
-       var progressListener = {
-               onProgressChange        : function(){},
-               onLocationChange        : function(){},
-               onStatusChange          : function(){},
-               onSecurityChange        : function(){},
-               onStateChange           : function ( webProgress, request, stateFlags, status) {
-                       const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
-                       const nsIChannel = Components.interfaces.nsIChannel;
-                       if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
-                       dump('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
-                       if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
-                               dump('\tSTATE_IS_REQUEST\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) {
-                               dump('\tSTATE_IS_DOCUMENT\n');
-                               if( stateFlags & nsIWebProgressListener.STATE_STOP ) set_opac_vars(p); 
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
-                               dump('\tSTATE_IS_NETWORK\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_IS_WINDOW) {
-                               dump('\tSTATE_IS_WINDOW\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_START) {
-                               dump('\tSTATE_START\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_REDIRECTING) {
-                               dump('\tSTATE_REDIRECTING\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_TRANSFERING) {
-                               dump('\tSTATE_TRANSFERING\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_NEGOTIATING) {
-                               dump('\tSTATE_NEGOTIATING\n');
-                       }
-                       if (stateFlags & nsIWebProgressListener.STATE_STOP) {
-                               dump('\tSTATE_STOP\n');
-                       }
-               }
-       }
-       progressListener.QueryInterface = function(){return this;};
-       return progressListener;
-}
-
-/* init the opac */
-function opac_init(p) {
-       sdump('D_OPAC',"Initing OPAC\n");
-
-       p.opac_progressListener = buildProgressListener(p);
-
-       p.opac_iframe = p.w.document.getElementById('opac_opac_iframe');
-       p.opac_iframe.addProgressListener(p.opac_progressListener, 
-               Components.interfaces.nsIWebProgress.NOTIFY_ALL );
-       p.opac_iframe.setAttribute("src", OPAC_URL + '?location=' + mw.G.user.home_ou()) 
-}
-
-/* shoves data into the OPAC's space */
-function set_opac_vars(p) {
-       sdump('D_OPAC',arg_dump(arguments));
-       p.opac_iframe.contentWindow.IAMXUL = true;
-       p.opac_iframe.contentWindow.xulG = mw.G;
-       p.opac_iframe.contentWindow.attachEvt("rdetail", "recordRetrieved", 
-               function(id){opac_make_details_page(p,id)});
-       p.opac_iframe.removeProgressListener(p.opac_progressListener);
-       p.opac_iframe.addProgressListener(p.opac_progressListener, 
-               Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT );
-
-}
-
-function opac_make_details_page(p, id) {
-       sdump('D_OPAC',arg_dump(arguments));
-       dump("OPAC doc id is " + id +'\n');
-       spawn_record_details(
-               p.w.app_shell, 'new_tab', 'main_tabbox', {
-                       'find_this_id' : id
-               }
-       ).find_this_id = id;
-}
-
-/* -------------------------------------------------------------------------- 
-       back-forward
-       -------------------------------------------------------------------------- */
-function opac_build_navigation(p) {
-       p.webForward = function webForward() {
-               try {
-                       if(p.opac_iframe.webNavigation.canGoForward)
-                               p.opac_iframe.webNavigation.goForward();
-               } catch(E) {
-                       sdump('D_OPAC','goForward error: ' + js2JSON(E) + '\n');
-               }
-       }
-
-       p.webBack = function webBack() {
-               try {
-                       if(p.opac_iframe.webNavigation.canGoBack)
-                               p.opac_iframe.webNavigation.goBack();
-               } catch(E) {
-                       sdump('D_OPAC','goBack error: ' + js2JSON(E) + '\n');
-               }
-       }
-}
-
-
-
-
-
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/opac/opac.xul b/Evergreen/staff_client/chrome/content/evergreen/opac/opac.xul
deleted file mode 100644 (file)
index 73b768f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<page id="opac_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="try {
-                       params.w = window; 
-                       params.app = 'Opac'; 
-                       mw.OpenILS_init(params);
-               } catch(E) {
-                       alert(E);
-               }" 
-       onunload="try { mw.OpenILS_exit(params); } catch(E) { alert(E); }" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/opac.css" type="text/css"?>
-
-       <vbox id="opac_vbox" flex="1">
-               <browser id="opac_opac_iframe" flex="1"/>
-       </vbox>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_barcode_entry.xul
deleted file mode 100644 (file)
index c1992d1..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="patron_barcode_entry_win" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_barcode_entry.xul\n');</script>
-
-       <script>
-       <![CDATA[
-
-               function my_init() {
-                       var tb = document.getElementById('barcode_tb');
-                       tb.addEventListener(
-                               'keypress',
-                               function(ev) {
-                                       if (ev.keyCode == 13 || ev.keyCode == 77) {
-                                               spawn();
-                                       }
-                               },
-                               false
-                       );
-                       tb.focus();
-               }
-
-               function spawn() {
-                       var tb = document.getElementById('barcode_tb');
-                       var barcode = tb.value;
-                       var patron = mw.retrieve_patron_by_barcode( barcode );
-                       if (mw.instanceOf(patron,mw.au)) {
-                               mw.spawn_patron_display(
-                                       parent.document, 
-                                       'replace_tab', 'main_tabbox', { 'patron' : patron }
-                               );
-                       } else {
-                               mw.snd_bad();
-                               var label = document.getElementById('status');
-                               label.value = 'Patron not found.';
-                               tb.select(); tb.focus();
-                       }
-               }
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow">
-               <groupbox orient="vertical" flex="1">
-                       <caption label="Enter Patron Barcode" />
-                       <hbox>
-                               <label value="Patron Barcode:" accesskey="B" control="barcode_tb"/>
-                               <textbox id="barcode_tb" />
-                               <button label="Submit" accesskey="S" oncommand="spawn();"/>
-                       </hbox>
-                       <hbox>
-                               <label id="status"/>
-                       </hbox>
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_details.xul
deleted file mode 100644 (file)
index 5923460..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/patron.dtd">
-<window id="patron_bill_details" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-       <script src="patron_utils.js" />
-
-       <script>
-       <![CDATA[
-
-               function my_init() {
-                       try {
-
-                               var mb_list = user_request(
-                                       'open-ils.circ',
-                                       'open-ils.circ.money.billing.retrieve.all',
-                                       [ mw.G.auth_ses[0], params.mbts.id() ]
-                               )[0];
-
-                               var rows = document.getElementById('g_rows');
-                               for (var i = 0; i < mb_list.length; i++) {
-
-                                       var row = document.createElement('row');
-                                       rows.appendChild(row);
-
-                                               var c1 = document.createElement('label');
-                                               row.appendChild(c1);
-                                               c1.setAttribute('value', yesno( mb_list[0].voided() ));
-
-                                               var c2 = document.createElement('label');
-                                               row.appendChild(c2);
-                                               c2.setAttribute('value', formatted_date( mb_list[0].billing_ts(),'%F' ));
-
-                                               var c3 = document.createElement('label');
-                                               row.appendChild(c3);
-                                               c3.setAttribute('value', mb_list[0].billing_type());
-
-                                               var c4 = document.createElement('label');
-                                               row.appendChild(c4);
-                                               c4.setAttribute('value', mb_list[0].amount());
-
-                                               var c5 = document.createElement('label');
-                                               row.appendChild(c5);
-                                               c5.setAttribute('value', mb_list[0].note());
-                               }
-
-                       } catch(E) {
-                               handle_error(E);
-                       }
-               }
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow">
-               <groupbox orient="vertical" flex="1">
-                       <caption label="Full Details"/>
-                       <grid>
-                               <columns> <column /> <column /> <column /> <column /> </columns>
-                               <rows id="g_rows">
-                                       <row><label value="Voided" /><label value="When"/><label value="Type" /><label value="Amount" /><label value="Note"/></row>
-                               </rows>
-                       </grid>
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bill_wizard.xul
deleted file mode 100644 (file)
index 870e4d9..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/patron.dtd">
-<wizard id="patron_bill" title="Bill Patron Wizard"
-       orient="vertical" style="overflow: auto"
-       onload="patron_bill_init()" width="800" height="600"
-       onwizardfinish="patron_bill_finish()"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-       <script src="patron_utils.js" />
-
-       <script>
-       <![CDATA[
-
-               function patron_bill_init() {
-                       document.getElementById('patron_name').setAttribute('value',
-                               patron_get_full_name(params.patron) + ' : ' + patron_get_barcode(params.patron) );
-                       document.getElementById('billing_location').setAttribute('value',
-                               mw.G.user_ou.name() );
-               }
-
-               function patron_bill_finish() {
-                       try {
-                               var grocery = new mg();
-                                       grocery.isnew('1');
-                                       grocery.billing_location( mw.G.user_ou.id() );
-                                       grocery.usr( params.patron.id() );
-                                       grocery.note( document.getElementById('bill_note').value );
-                               var mg_id = user_request(
-                                       'open-ils.circ',
-                                       'open-ils.circ.money.grocery.create',
-                                       [ mw.G.auth_ses[0], grocery ]
-                               )[0];
-                               if (mg_id) {
-                                       var billing = new mb();
-                                               billing.isnew('1');
-                                               billing.note( document.getElementById('bill_note').value );
-                                               billing.xact( mg_id );
-                                               billing.amount( document.getElementById('bill_amount').value );
-                                               billing.billing_type( document.getElementById('billing_type').value );
-                                       var mb_id = user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.money.billing.create',
-                                               [ mw.G.auth_ses[0], billing ]
-                                       )[0];
-                                       if (mb_id) {
-                                       } else {
-                                               throw('mb_id = ' + mb_id);
-                                       }
-                               } else {
-                                       throw('mg_id = ' + mg_id);
-                               }
-                       } catch(E) {
-                               handle_error(E);
-                       }
-               }
-
-       ]]>
-       </script>
-
-
-       <wizardpage id="page1" description="Billing Patron" onpageadvanced="">
-               <label id="patron_name"/>
-               <grid>
-                       <columns> <column flex="0" /> <column flex="0" /> </columns>
-                       <rows id="page1_rows">
-                               <row><label value="Location"/><textbox id="billing_location" disabled="true" /></row>
-                               <row><label value="Transaction Type"/>
-                                       <menulist id="xact_type">
-                                               <menupopup>
-                                                       <menuitem label="Grocery" value="grocery" selected="true"/>
-                                               </menupopup>
-                                       </menulist>
-                               </row>
-                               <row><label value="Billing Type"/>
-                                       <menulist id="billing_type">
-                                               <menupopup>
-                                                       <menuitem value="Miscellaneous" label="Miscellaneous" />
-                                                       <menuitem value="Overdue materials" label="Overdue materials" />
-                                                       <menuitem value="Fee for placing a hold" label="Fee for placing a hold" />
-                                                       <menuitem value="Fee for checking out a book" label="Fee for checking out a book" />
-                                                       <menuitem value="Fee for library card" label="Fee for library card" />
-                                                       <menuitem value="Miscellaneous charges" label="Miscellaneous charges" />
-                                                       <menuitem value="Lost materials" label="Lost materials" />
-                                                       <menuitem value="Damaged material" label="Damaged material" />
-                                                       <menuitem value="Overdue Reserves charge" label="Overdue Reserves charge" />
-                                                       <menuitem value="Recall overdue" label="Recall overdue" />
-                                                       <menuitem value="Fee for processing lost library materials" label="Fee for processing lost library materials" />
-                                                       <menuitem value="Fee for sending patron bills to collection agency" label="Fee for sending patron bills to collection agency" />
-                                                       <menuitem value="Fee for interlibrary loan" label="Fee for interlibrary loan" />
-                                                       <menuitem value="Fee for copies" label="Fee for copies" />
-                                                       <menuitem value="Money advanced to pay for telephone use" label="Money advanced to pay for telephone use" />
-                                                       <menuitem value="Deposit fee" label="Deposit fee" />
-                                                       <menuitem value="Fee for disk" label="Fee for disk" />
-                                                       <menuitem value="Fee for faxing" label="Fee for faxing" />
-                                                       <menuitem value="Fee for laminating" label="Fee for laminating" />
-                                                       <menuitem value="Fee for room cleaning" label="Fee for room cleaning" />
-                                                       <menuitem value="Deposit returned; fee refund" label="Deposit returned; fee refund" />
-                                                       <menuitem value="Sale items" label="Sale items" />
-                                                       <menuitem value="Fee for lost card" label="Fee for lost card" />
-                                                       <menuitem value="Long overdue items" label="Long overdue items" />
-                                                       <menuitem value="Lost/Replacement Cassette" label="Lost/Replacement Cassette" />
-                                                       <menuitem value="Returned Check" label="Returned Check" />
-                                               </menupopup>
-                                       </menulist>
-                               </row>
-                               <row><label value="Amount"/><textbox id="bill_amount" /></row>
-                               <row><label value="Note"/><textbox id="bill_note" multiline="true" rows="5" /></row>
-                       </rows>
-               </grid>
-       </wizardpage>
-
-</wizard>
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js
deleted file mode 100644 (file)
index ccdb4dc..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-sdump('D_TRACE','Loading patron_bills.js\n');
-
-function patron_bills_init(p) {
-       sdump('D_PATRON_BILLS',"TESTING: patron_bills.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       patron_bills_list_box_init( p );
-
-       patron_bills_control_box_init( p );
-
-       p.current_payments = [];
-
-       p.update_payment_applied = function () {
-               sdump('D_PATRON_BILLS','p.update_payment_applied()\n');
-               var total_applied = 0;
-               for (var i = 0; i < p.current_payments.length; i++) {
-                       total_applied += dollars_float_to_cents_integer( p.current_payments[ i ].textbox.value );
-               }
-               var total_payment = 0;
-               if (p.control_box.bill_payment_amount.value) {
-                       try {
-                               total_payment = dollars_float_to_cents_integer( p.control_box.bill_payment_amount.value );
-                       } catch(E) {
-                               sdump('D_ERROR',E + '\n');
-                       }
-               }
-               if ( total_applied > total_payment ) {
-                       total_payment = total_applied;
-                       p.control_box.bill_payment_amount.value = cents_as_dollars( total_applied );
-               }
-               p.control_box.bill_payment_applied.setAttribute('value', cents_as_dollars( total_applied ));
-               p.control_box.bill_payment_applied.value = cents_as_dollars( total_applied );
-               p.control_box.bill_credit_amount.value = '';
-               if (total_payment > total_applied ) {
-                       p.control_box.bill_change_amount.value = cents_as_dollars( total_payment - total_applied);
-                       p.control_box.bill_credit_amount.value = '0.00';
-               } else {
-                       p.control_box.bill_change_amount.value = '0.00';
-                       p.control_box.bill_credit_amount.value = '0.00';
-               }
-               var total_owed = dollars_float_to_cents_integer( p.control_box.bill_total_owed.value );
-               p.control_box.bill_new_balance.value = cents_as_dollars( total_owed - total_applied );
-       }
-
-       p.list_box.apply_to_each_listitem = function (idx, listitem) {
-               sdump('D_PATRON_BILLS','p.list_box.apply_to_each_listitem()\n');
-               p.current_payments[ idx ] = {};
-               p.current_payments[ idx ].listitem = listitem;
-               p.current_payments[ idx ].checkbox = listitem.getElementsByTagName('checkbox')[0];
-               p.current_payments[ idx ].textbox = listitem.getElementsByTagName('textbox')[0];
-               p.current_payments[ idx ].mbts_id = listitem.getAttribute('record_id');
-               p.current_payments[ idx ].balance_owed = listitem.getAttribute('balance_owed');
-
-               p.current_payments[ idx ].textbox.addEventListener(
-                       'change',
-                       function () {
-                               sdump('D_PATRON_BILLS','listitem textbox onchange handler()\n');
-                               var tb = p.current_payments[ idx ].textbox;
-                               var bo = p.current_payments[ idx ].balance_owed;
-                               tb.value = cents_as_dollars( dollars_float_to_cents_integer( tb.value ) ); // show user what we think the number is
-                               sdump('D_PATRON_BILLS','bo = ' + bo + '\ntb.value = ' + tb.value + '\n');
-                               if ( dollars_float_to_cents_integer( tb.value ) > dollars_float_to_cents_integer( bo ) ) {
-                                       sdump('D_PATRON_BILLS','Tried to overpay bill\n');
-                                       tb.value = bo;
-                               }
-                               p.update_payment_applied();
-                       },
-                       false
-               );
-       }
-
-       p.control_box.bill_payment_amount.addEventListener(
-               'change',
-               function () {
-                       var tb = p.control_box.bill_payment_amount;
-                       tb.value = cents_as_dollars( dollars_float_to_cents_integer( tb.value ) );
-                       var total = dollars_float_to_cents_integer( tb.value );
-                       for (var i = 0; i < p.current_payments.length; i++) {
-                               var bill = p.current_payments[i];
-                               if (bill.checkbox.checked) {
-                                       var bo = dollars_float_to_cents_integer( bill.balance_owed );
-                                       if ( bo > total ) {
-                                               bill.textbox.value = cents_as_dollars( total );
-                                               total = 0;
-                                       } else {
-                                               bill.textbox.value = cents_as_dollars( bo );
-                                               total = total - bo;
-                                       }
-                               } else {
-                                       bill.textbox.value = '0.00';
-                               }
-                       }
-                       p.update_payment_applied();
-               },
-               false
-       );
-
-       p.control_box.bill_change_amount.addEventListener(
-               'change',
-               function() {
-                       var tb = p.control_box.bill_change_amount;
-                       var proposed_change = dollars_float_to_cents_integer( tb.value );
-                       var proposed_credit = 0;
-                       p.update_payment_applied();
-                       var real_change = dollars_float_to_cents_integer( tb.value );
-                       if ( proposed_change > real_change ) {
-                               sdump('D_ERROR','Someone wanted more money than they deserved\n');
-                               proposed_change = real_change;
-                       } else if ( real_change > proposed_change ) {
-                               proposed_credit = real_change - proposed_change;
-                       }
-                       tb.value = cents_as_dollars( proposed_change );
-                       p.control_box.bill_credit_amount.value = cents_as_dollars( proposed_credit );
-               },
-               false
-       );
-
-       p.control_box.change_to_credit.addEventListener(
-               'command',
-               function() {
-                       var tb = p.control_box.bill_change_amount;
-                       var proposed_change = 0;
-                       var proposed_credit = dollars_float_to_cents_integer( tb.value );
-                       p.update_payment_applied();
-                       var real_change = dollars_float_to_cents_integer( tb.value );
-                       if ( proposed_change > real_change ) {
-                               sdump('D_ERROR','Someone wanted more money than they deserved\n');
-                               proposed_change = real_change;
-                       } else if ( real_change > proposed_change ) {
-                               proposed_credit = real_change - proposed_change;
-                       }
-                       tb.value = cents_as_dollars( proposed_change );
-                       p.control_box.bill_credit_amount.value = cents_as_dollars( proposed_credit );
-
-               },
-               false
-       );
-
-       p.control_box.bill_apply_payment.addEventListener(
-               'command',
-               function() { 
-                       var payment_blob = {};
-                       payment_blob.userid = p._patron.id();
-                       payment_blob.note = '';
-                       payment_blob.cash_drawer = 1; // FIXME: get new Config() to work
-                       payment_blob.payment_type = p.control_box.payment_type.value;
-                       payment_blob.payments = [];
-                       payment_blob.patron_credit = p.control_box.bill_credit_amount.value;
-                       for (var i = 0; i < p.current_payments.length; i++) {
-                               var tb = p.current_payments[ i ].textbox;
-                               if ( !(tb.value == '0.00' || tb.value == '') ) {
-                                       payment_blob.payments.push( 
-                                               [
-                                                       p.current_payments[ i ].mbts_id,
-                                                       tb.value
-                                               ]
-                                       );
-                               }
-                       }
-                       try {
-                               if ( patron_pay_bills( payment_blob ) ) {
-
-                                       if (p.refresh) p.refresh();
-
-                               }
-
-                       } catch(E) {
-
-                               handle_error(E);
-                       }
-               },
-               false
-       );
-
-       p.control_box.bill_wizard.addEventListener(
-               'command',
-               function() {
-                       spawn_patron_bill_wizard(
-                               p.w.document, 'new_window', '', { 'patron' : p._patron }
-                       );
-               },
-               false
-       );
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_bills_control_box_init( p ) {
-       p.control_box = {};
-       p.control_box.node = p.node.previousSibling;
-       p.control_box.node2 = p.node.nextSibling;
-       p.control_box.bill_wizard = p.control_box.node.getElementsByAttribute('id','bill_wizard')[0];
-       p.control_box.bill_total_owed = p.control_box.node.getElementsByAttribute('id','bill_total_owed')[0];
-       p.control_box.payment_type = p.control_box.node.getElementsByAttribute('id','payment_type_menulist')[0];
-       p.control_box.bill_payment_amount = p.control_box.node.getElementsByAttribute('id','bill_payment_amount_textbox')[0];
-       p.control_box.bill_payment_applied = p.control_box.node.getElementsByAttribute('id','bill_payment_applied_textbox')[0];
-       p.control_box.bill_change_amount = p.control_box.node.getElementsByAttribute('id','bill_change_amount_textbox')[0];
-       p.control_box.bill_credit_amount = p.control_box.node.getElementsByAttribute('id','bill_credit_amount_textbox')[0];
-       p.control_box.change_to_credit = p.control_box.node.getElementsByAttribute('id','change_to_credit')[0];
-       p.control_box.bill_apply_payment = p.control_box.node.getElementsByAttribute('id','bill_apply_payment')[0];
-       p.control_box.bill_new_balance = p.control_box.node.getElementsByAttribute('id','bill_new_balance_textbox')[0];
-}
-
-function patron_bills_list_box_init( p ) {
-       p.patron_bills_cols = [
-               {
-                       'id' : 'checkbox', 'label' : '', 'flex' : 0, 'primary' : false, 'hidden' : false,
-                       'render_xul' : 'checkbox'
-               },
-               {
-                       'id' : 'xact_dates', 'label' : getString('bills_xact_dates_label'), 'flex' : 0,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mbts', 
-                       'fm_field_render' : 'xact_dates_box($$)'
-               },
-               {
-                       'id' : 'notes', 'label' : getString('bills_information'), 'flex' : 0,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mbts',
-                       'fm_field_render' : 'info_box($$)'
-               },
-               {
-                       'id' : 'money', 'label' : getString('bills_money_label'), 'flex' : 0,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'mbts', 
-                       'fm_field_render' : 'money_box($$)'
-               },
-               {
-                       'id' : 'current_pay', 'label' : getString('bills_current_payment_label'), 'flex' : 0, 
-                       'render_xul' : 'textbox'
-               }
-       ];
-
-       p.list_box = list_box_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_bills_cols, 'debug' : p.app } );
-       p.clear_patron_bills = function () { 
-               p.current_payments = []; 
-               p.control_box.bill_total_owed.setAttribute('value', 'Calculating...');
-               p.control_box.bill_total_owed.value = 'Calculating...';
-               p.control_box.bill_payment_amount.setAttribute('value', '');
-               p.control_box.bill_payment_amount.value = '';
-               p.control_box.bill_payment_applied.setAttribute('value', '0.00');
-               p.control_box.bill_payment_applied.value = '0.00';
-               p.control_box.bill_change_amount.setAttribute('value', '0.00');
-               p.control_box.bill_change_amount.value = '0.00';
-               p.control_box.bill_credit_amount.setAttribute('value', '0.00');
-               p.control_box.bill_credit_amount.value = '0.00';
-               p.control_box.bill_new_balance.setAttribute('value', 'Calculating...');
-               p.control_box.bill_new_balance.value = 'Calculating...';
-               p.list_box.clear_rows(); 
-       };
-       p.add_patron_bills = function (bills) {
-               sdump('D_PATRON_BILLS','p.add_patron_bills(' + bills + ')\n');
-               return patron_bills_add_patron_bills(p,bills);
-       }
-}
-
-function patron_bills_add_patron_bills(p, bills) {
-       sdump('D_PATRON_BILLS',arg_dump(arguments,{1:true}));
-
-       p.control_box.bill_total_owed.setAttribute('value',get_bills_total( bills ));
-       p.control_box.bill_total_owed.value = get_bills_total( bills );
-       p.control_box.bill_new_balance.setAttribute('value',get_bills_total( bills ));
-       p.control_box.bill_new_balance.value = get_bills_total( bills );
-
-       function xact_dates_box( mbts ) {
-               var grid = p.w.document.createElement('grid');
-                       var cols = p.w.document.createElement('columns');
-                       grid.appendChild( cols );
-                               cols.appendChild( p.w.document.createElement('column') );
-                               cols.appendChild( p.w.document.createElement('column') );
-                       var rows = p.w.document.createElement('rows');
-                       grid.appendChild( rows );
-                               var row0 = p.w.document.createElement('row');
-                               rows.appendChild( row0 );
-                                       var label_r0_1 = p.w.document.createElement('label');
-                                       row0.appendChild( label_r0_1 );
-                                       label_r0_1.setAttribute('value',getString('mbts_id_label'));
-                                       var label_r0_2 = p.w.document.createElement('label');
-                                       row0.appendChild( label_r0_2 );
-                                       label_r0_2.setAttribute('value',mbts.id());
-                               var row1 = p.w.document.createElement('row');
-                               rows.appendChild( row1 );
-                                       var label_r1_1 = p.w.document.createElement('label');
-                                       row1.appendChild( label_r1_1 );
-                                       label_r1_1.setAttribute('value',getString('mbts_xact_start_label'));
-                                       var label_r1_2 = p.w.document.createElement('label');
-                                       row1.appendChild( label_r1_2 );
-                                       label_r1_2.setAttribute('value',mbts.xact_start().toString().substr(0,10));
-                               var row2 = p.w.document.createElement('row');
-                               rows.appendChild( row2 );
-                                       var label_r2_1 = p.w.document.createElement('label');
-                                       row2.appendChild( label_r2_1 );
-                                       label_r2_1.setAttribute('value',getString('mbts_xact_finish_label'));
-                                       var label_r2_2 = p.w.document.createElement('label');
-                                       row2.appendChild( label_r2_2 );
-                                       try { label_r2_2.setAttribute('value',mbts.xact_finish().toString().substr(0,10));
-                                       } catch(E) {}
-
-               return grid;
-       }
-
-       function money_box( mbts ) {
-               var grid = p.w.document.createElement('grid');
-                       var cols = p.w.document.createElement('columns');
-                       grid.appendChild( cols );
-                               cols.appendChild( p.w.document.createElement('column') );
-                               cols.appendChild( p.w.document.createElement('column') );
-                       var rows = p.w.document.createElement('rows');
-                       grid.appendChild( rows );
-                               var row1 = p.w.document.createElement('row');
-                               rows.appendChild( row1 );
-                                       var label_r1_1 = p.w.document.createElement('label');
-                                       row1.appendChild( label_r1_1 );
-                                       label_r1_1.setAttribute('value',getString('mbts_total_owed_label'));
-                                       var label_r1_2 = p.w.document.createElement('label');
-                                       row1.appendChild( label_r1_2 );
-                                       label_r1_2.setAttribute('value',mbts.total_owed());
-                               var row2 = p.w.document.createElement('row');
-                               rows.appendChild( row2 );
-                                       var label_r2_1 = p.w.document.createElement('label');
-                                       row2.appendChild( label_r2_1 );
-                                       label_r2_1.setAttribute('value',getString('mbts_total_paid_label'));
-                                       var label_r2_2 = p.w.document.createElement('label');
-                                       row2.appendChild( label_r2_2 );
-                                       label_r2_2.setAttribute('value',mbts.total_paid());
-                               var row3 = p.w.document.createElement('row');
-                               rows.appendChild( row3 );
-                                       var label_r3_1 = p.w.document.createElement('label');
-                                       row3.appendChild( label_r3_1 );
-                                       label_r3_1.setAttribute('value',getString('mbts_balance_owed_label'));
-                                       label_r3_1.setAttribute('style','font-weight: bold');
-                                       var label_r3_2 = p.w.document.createElement('label');
-                                       row3.appendChild( label_r3_2 );
-                                       label_r3_2.setAttribute('value',mbts.balance_owed());
-                                       label_r3_2.setAttribute('style','font-weight: bold');
-
-               return grid;
-       }
-
-       function info_box( mbts ) {
-               var vbox = p.w.document.createElement('vbox');
-                       var grid = p.w.document.createElement('grid');
-                               vbox.appendChild( grid );
-
-                               var cols = p.w.document.createElement('columns');
-                                       grid.appendChild( cols );
-                                       cols.appendChild( p.w.document.createElement('column') );
-                                       cols.appendChild( p.w.document.createElement('column') );
-                               var rows = p.w.document.createElement('rows');
-                                       grid.appendChild( rows );
-
-                       var xact_type = p.w.document.createElement('row');
-                       rows.appendChild( xact_type );
-
-                               var xt_label = p.w.document.createElement('label');
-                                       xact_type.appendChild( xt_label );
-                                       xt_label.setAttribute( 'value', 'Type' );
-                               var xt_value = p.w.document.createElement('label');
-                                       xact_type.appendChild( xt_value );
-                                       xt_value.setAttribute( 'value', mbts.xact_type() );
-
-                       var last_billing = p.w.document.createElement('row');
-                       rows.appendChild( last_billing );
-
-                               var lb_label = p.w.document.createElement('label');
-                                       last_billing.appendChild( lb_label );
-                                       lb_label.setAttribute( 'value', 'Last Billing:' );
-
-                               var lb_value = p.w.document.createElement('label');
-                                       last_billing.appendChild( lb_value );
-                                       if (mbts.last_billing_type()) 
-                                               lb_value.setAttribute( 'value', mbts.last_billing_type() );
-
-                       var last_payment = p.w.document.createElement('row');
-                       rows.appendChild( last_payment );
-
-                               var lp_label = p.w.document.createElement('label');
-                                       last_payment.appendChild( lp_label );
-                                       lp_label.setAttribute( 'value', 'Last Payment:' );
-
-                               var lp_value = p.w.document.createElement('label');
-                                       last_payment.appendChild( lp_value );
-                                       if (mbts.last_payment_type()) 
-                                               lp_value.setAttribute( 'value', mbts.last_payment_type() );
-
-                       var btn = p.w.document.createElement('button');
-                               vbox.appendChild( btn );
-                               btn.setAttribute( 'label', 'Full Details' );
-                               btn.setAttribute( 'name', 'full_details' );
-                               btn.setAttribute( 'mbts_id', mbts.id() );       
-                               btn.addEventListener(
-                                       'command',
-                                       function(ev) {
-                                               spawn_patron_bill_details(
-                                                       p.w.document, 'new_window', '', { 'mbts' : mbts }
-                                               );
-                                       },
-                                       false
-                               );
-
-               return vbox;
-       }
-
-       var obj_string ='mbts';
-
-       setTimeout(
-               function() {
-                       //p.list_box.clear_rows();
-
-                       for (var i = 0; i < bills.length; i++) {
-
-                               var mbts = bills[i];
-
-                               var cols = [];
-
-                               for (var j = 0; j < p.patron_bills_cols.length; j++) {
-                                       var hash = p.patron_bills_cols[j];
-                                       sdump('D_PATRON_BILLS','Considering ' + js2JSON(hash) + '\n');
-                                       var listcell = p.w.document.createElement('listcell');
-                                       listcell.setAttribute('pack','start');
-                                       listcell.setAttribute('align','start');
-                                       listcell.setAttribute('style','border-left: black solid thin');
-                                       var col = '';
-                                       if (hash.fm_field_render) {
-
-                                               var obj = 'mbts';
-                                               switch( hash.fm_class ) {
-                                                       case 'mvr' : obj_string = 'mvr'; break;
-                                               }
-                                               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-                                               sdump('D_PATRON_BILLS','cmd = ' + cmd + '\n');
-                                               try {
-                                                       col = eval( cmd );
-                                                       sdump('D_PATRON_BILLS','eval = ' + col + '\n');
-                                               } catch(E) {
-                                                       sdump('D_ERROR',E + '\n');
-                                               }
-                                               if (typeof(col) == 'string') {
-                                                       listcell.setAttribute('label',col);
-                                               } else {
-                                                       listcell.appendChild( col );
-                                               }
-                                       }
-                                       if (hash.render_xul) {
-                                               var xul = p.w.document.createElement( hash.render_xul );
-                                               listcell.appendChild( xul );
-                                               if (hash.render_xul == 'checkbox') xul.setAttribute('checked', 'true');
-                                       }
-                                       cols.push( listcell );
-                               }
-
-                               var listitem = p.list_box.add_row( 
-                                       cols, { 
-                                               'record_id' : mbts.id(),
-                                               'balance_owed' : mbts.balance_owed()
-                                       } 
-                               ); 
-                               if (p.list_box.apply_to_each_listitem) {
-                                       p.list_box.apply_to_each_listitem( i, listitem );
-                               }
-                       }
-               }, 0
-       );
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_checkout_items.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_checkout_items.js
deleted file mode 100644 (file)
index 56a02e8..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-sdump('D_TRACE','Loading patron_checkout_items.js\n');
-
-function patron_checkout_items_init(p) {
-       sdump('D_PATRON_CHECKOUT_ITEMS',"TESTING: patron_checkout_items.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.patron_checkout_items_cols = circ_cols();
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_checkout_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
-       p.add_checkout_items = p.paged_tree.add_rows;
-       p.clear_checkout_items = p.paged_tree.clear_tree;
-
-       p.register_patron_checkout_items_select_callback = function (f) {
-               sdump('D_PATRON_CHECKOUT_ITEMS','p.register_patron_checkout_items_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_patron_checkout_items_function = function (f) {
-               sdump('D_PATRON_CHECKOUT_ITEMS','p.register_flesh_patron_checkout_items_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_checkout_context_builder = function (f) {
-               sdump('D_PATRON_CHECKOUT_ITEMS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_patron_checkout_items_to_cols = function (patron_checkout_items, treeitem) {
-               sdump('D_PATRON_CHECKOUT_ITEMS','p.map_patron_checkout_items_to_cols( ' + patron_checkout_items + ',' + treeitem + ')\n');
-               patron_checkout_items_tree_map_patron_checkout_items_to_cols(p, patron_checkout_items, treeitem);       
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_checkout_items_tree_map_patron_checkout_items_to_cols(p, patron_checkout_items, treeitem) {
-       sdump('D_PATRON_CHECKOUT_ITEMS',arg_dump(arguments,{1:true}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var cols = new Array();
-       for (var i = 0; i < p.patron_checkout_items_cols.length; i++) {
-               var hash = p.patron_checkout_items_cols[i];
-               sdump('D_PATRON_CHECKOUT_ITEMS','Considering ' + js2JSON(hash) + '\n');
-               var obj_string;
-               switch( hash.fm_class ) {
-                       case 'acp' : obj_string = 'patron_checkout_items.copy'; break;
-                       case 'circ' : obj_string = 'patron_checkout_items.circ'; break;
-                       case 'mvr' : obj_string = 'patron_checkout_items.record'; break;
-               }
-               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-               sdump('D_PATRON_CHECKOUT_ITEMS','cmd = ' + cmd + '\n');
-               var col = '';
-               try {
-                       col = eval( cmd );
-                       sdump('D_PATRON_CHECKOUT_ITEMS','eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-               cols.push( col );
-       }
-       sdump('D_PATRON_CHECKOUT_ITEMS','cols = ' + js2JSON(cols) + '\n');
-       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js
deleted file mode 100755 (executable)
index 8c598b7..0000000
+++ /dev/null
@@ -1,719 +0,0 @@
-sdump('D_TRACE','Loading patron_display.js\n');
-
-function patron_display_init(p) {
-       sdump('D_PATRON_DISPLAY',"TESTING: patron_display.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       // gives: p.clamshell, p.right_panel, p.left_panel
-       patron_display_clamshell_init(p);
-
-       // gives: p.patron_items, p.redraw_patron_items
-       patron_display_patron_items_init(p);
-
-       // gives: p.patron_checkout_items, p.redraw_patron_checkout_items
-       patron_display_patron_checkout_items_init(p);
-
-       // gives: p.patron_holds, p.redraw_patron_holds
-       patron_display_patron_holds_init(p);
-
-       // gives: p.patron_bills, p.redraw_patron_bills
-       patron_display_patron_bills_init(p);
-
-       // gives: p.patron_edit, p.redraw_patron_edit
-       patron_display_patron_edit_init(p);
-
-       //patron_display_survey_init(p);
-
-       p.set_patron = function (au) {
-               p.patron_edit._patron = au;
-               p.patron_bills._patron = au;
-               return p._patron = au;
-       }
-
-       p.display_patron = function (exceptions) {
-               if (!exceptions) exceptions = {};
-               if (!exceptions.all) {
-                       if (!exceptions.patron_checkout_items) p.redraw_patron_checkout_items();
-                       if (!exceptions.patron_items) p.redraw_patron_items();
-                       if (!exceptions.patron_holds) p.redraw_patron_holds();
-                       if (!exceptions.patron_bills) p.redraw_patron_bills();
-                       if (!exceptions.patron_display_survey) patron_display_survey_init(p);
-                       //if (!exceptions.patron_edit) p.redraw_patron_edit();
-               }
-               return render_fm(p.w.document, { 'au' : p._patron });
-       }
-       p.redraw = p.display_patron;
-
-       p.retrieve_patron_via_barcode = function (barcode) {
-               if (!barcode) barcode = patron_get_barcode( p._patron );
-               p.set_patron( retrieve_patron_by_barcode( barcode ) );
-               return p.display_patron( {} );
-       }
-
-       p.retrieve_patron_via_id = function (id, exceptions) {
-               p.set_patron( retrieve_patron_by_id( id ) );
-               return p.display_patron(exceptions);
-       }
-
-       p.refresh = function(exceptions) {
-               if (p._patron) p.retrieve_patron_via_id( p._patron.id(), exceptions );
-       }
-
-       set_patron_display_widgets(p);
-
-       if (p.patron) {
-               if (typeof(p.patron) == 'object') {
-                       //p._patron = p.patron;
-                       p.set_patron( p.patron );
-                       p.display_patron();
-               } else
-                       p.retrieve_patron_via_barcode( p.patron );
-       }
-
-       if (p._patron && p._patron.alert_message()) {
-               //snd_bad(); snd_bad();
-               s_alert(
-                       'PATRON ALERT MESSAGE\n\n\n\n' +
-                       p._patron.alert_message() +
-                       '\n\n\n\nTo remove this alert permanently, Edit the patron and erase the message in "Alert Message".\n\n'
-               );
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function set_patron_display_widgets(p) {
-       p.commandset_node.getElementsByAttribute('id','cmd_patron_refresh')[0].addEventListener(
-               'command',
-               function (ev) {
-                       p.refresh();
-               },
-               false
-       );
-
-       function gen_func(i) {
-               // because otherwise i would be 5 for each closure
-               return function(ev) {
-                       p.clamshell.set_second_deck(i);
-               };
-       }
-       var cmds = [ 'cmd_patron_checkout', 'cmd_patron_items', 'cmd_patron_holds', 
-               'cmd_patron_bills', 'cmd_patron_edit', 'cmd_patron_info' ]
-       for (var i in cmds) {
-               p.commandset_node.getElementsByAttribute('id',cmds[i])[0].addEventListener(
-                       'command',
-                       gen_func(i),
-                       false
-               );
-       }
-       p.commandset_node.getElementsByAttribute('id','cmd_patron_checkout')[0].addEventListener(
-               'command',
-               function () {
-                       focus_widget( p.w.document, 'patron_checkout_barcode_entry_textbox' );
-               },
-               false
-       );
-       p.commandset_node.getElementsByAttribute('id','cmd_patron_bills')[0].addEventListener(
-               'command',
-               function () {
-                       focus_widget( p.w.document, 'bill_payment_amount_textbox' );
-               },
-               false
-       );
-       p.commandset_node.getElementsByAttribute('id','cmd_patron_edit')[0].addEventListener(
-               'command',
-               function () {
-                       p.redraw_patron_edit();
-               },
-               false
-       );
-
-
-
-
-}
-
-
-function patron_display_clamshell_init(p) {
-       p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
-       p.left_panel = p.clamshell.first_deck;
-       p.right_panel = p.clamshell.second_deck;
-}
-
-function patron_display_patron_items_init(p) {
-       p.patron_items = patron_items_init( { 'w' : p.w, 'node' : p.patron_items_node, 'debug' : p.app } );
-
-       p.w.document.getElementById('item_print').addEventListener(
-               'command',
-               function(ev) {
-                       var params = { 
-                               'au' : p._patron, 
-                               'lib' : mw.G.user_ou,
-                               'staff' : mw.G.user,
-                               'header' : mw.G.itemsout_header,
-                               'line_item' : mw.G.itemsout_line_item,
-                               'footer' : mw.G.itemsout_footer
-                       };
-                       mw.print_itemsout_receipt( params );
-               }, false
-       );
-
-       p.redraw_patron_items = function() {
-               p.patron_items.clear_patron_items();
-               if (!p._patron.checkouts()) patron_get_checkouts( p._patron );
-               for (var i = 0; i < p._patron.checkouts().length; i++) {
-                       p.patron_items.add_patron_items( [ i ] );
-               }
-       }
-
-       p.patron_items.register_patron_items_select_callback(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing patron_items_select_callback\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
-                       var patron_items = get_list_from_tree_selection( p.patron_items.paged_tree.tree );
-                       /* grab cover art for selected item? */
-               }
-       );
-       p.patron_items.register_flesh_patron_items_function(
-               function (treeitem) {
-                       sdump('D_PATRON_DISPLAY','Firing flesh_patron_items_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       p.patron_items.map_patron_items_to_cols( p._patron.checkouts()[ record_id ], treeitem );
-               }
-       );
-       p.patron_items.register_item_context_builder(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing context_builder for patron_items\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_items.paged_tree.popup = ' + p.patron_items.paged_tree.popup + '\n');
-                       empty_widget(p.patron_items.paged_tree.popup);
-                       var patron_items = get_list_from_tree_selection( p.patron_items.paged_tree.tree );
-                       sdump('D_PATRON_DISPLAY','patron_items.length = ' + patron_items.length + '\n');
-
-                       /*** RENEW ***/
-                       var menuitem_pi_r = p.patron_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_r );
-                       menuitem_pi_r.setAttribute('label',getString('circ.context_renew'));
-                       menuitem_pi_r.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing renew context for patron_items\n');
-                                       for (var i = 0; i < patron_items.length; i++) {
-                                               try {
-                                                       var idx = patron_items[i].getAttribute('record_id'); 
-                                                       var circ = p._patron.checkouts()[ idx ].circ;
-                                                       renew_by_circ_id( circ.id() );
-                                                       p.refresh();
-                                               } catch(E) {
-                                                       alert(E);
-                                               }
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** CHECKIN ***/
-                       var menuitem_pi_c = p.patron_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_c );
-                       menuitem_pi_c.setAttribute('label',getString('circ.context_checkin'));
-                       menuitem_pi_c.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing checkin context for patron_items\n');
-                                       for (var i = 0; i < patron_items.length; i++) {
-                                               try {
-                                                       var idx = patron_items[i].getAttribute('record_id'); 
-                                                       var copy = p._patron.checkouts()[ idx ].copy;
-                                                       var check = checkin_by_copy_barcode( copy.barcode(), null );
-                                                       if (check != null && check.status == 0) {
-                                                               check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
-                                                               alert('Check In: ' + check.text + '  Route To: ' + check.route_to);
-                                                       }
-                                                       p.refresh();
-                                               } catch(E) {
-                                                       alert(E);
-                                               }
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** LOST ***/
-                       var menuitem_pi_r = p.patron_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_r );
-                       menuitem_pi_r.setAttribute('label',getString('circ.context_lost'));
-                       menuitem_pi_r.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing lost context for patron_items\n');
-                                       for (var i = 0; i < patron_items.length; i++) {
-                                               try {
-                                                       var idx = patron_items[i].getAttribute('record_id'); 
-                                                       var circ = p._patron.checkouts()[ idx ].circ;
-                                                       mark_circ_as_lost( circ ) ;
-                                                       p.refresh();
-                                               } catch(E) {
-                                                       alert(E);
-                                               }
-                                       }
-                               },
-                               false
-                       );
-
-                       /* separator */
-                       var menuitem_pi_s = p.patron_items.paged_tree.w.document.createElement('menuseparator');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_s );
-                       
-
-                       /*** COPY EDITOR ***/
-                       var menuitem_pi_ce = p.patron_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_ce );
-                       menuitem_pi_ce.setAttribute('label',getString('circ.context_edit'));
-                       menuitem_pi_ce.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_items\n');
-                                       for (var i = 0; i < patron_items.length; i++) {
-                                               sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
-                                               var idx = patron_items[i].getAttribute('record_id'); 
-                                               var copy = p._patron.checkouts()[ idx ].copy;
-                                               spawn_batch_copy_editor(
-                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
-                                                               'copy_ids' : [ copy.id() ]
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** OPAC ***/
-                       var menuitem_pi_o = p.patron_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_items.paged_tree.popup.appendChild( menuitem_pi_o );
-                       menuitem_pi_o.setAttribute('label',getString('circ.context_opac'));
-                       menuitem_pi_o.addEventListener(
-                               'command',
-                               function (ev) {
-                                       alert('Not Yet Implemented');
-                                       sdump('D_PATRON_DISPLAY','Firing opac context for patron_items\n');
-                                       for (var i = 0; i < patron_items.length; i++) {
-                                               sdump('D_PATRON_DISPLAY','Firing opac context\n');
-                                       }
-                               },
-                               false
-                       );
-                       
-               }
-       );
-}
-
-function patron_display_patron_checkout_items_init(p) {
-       p.patron_checkout_items = patron_checkout_items_init( { 'w' : p.w, 'node' : p.patron_checkout_items_node, 'debug' : p.app } );
-       var tb = p.patron_checkout_items_node.getElementsByAttribute('id','patron_checkout_barcode_entry_textbox')[0];
-       var submit_button = p.patron_checkout_items_node.getElementsByAttribute('id','patron_checkout_submit_barcode_button')[0];
-
-       var checkouts = [];
-
-       function print_receipt() {
-               p._patron._current_checkouts = checkouts;
-               var params = { 
-                       'au' : p._patron, 
-                       'lib' : mw.G.user_ou,
-                       'staff' : mw.G.user,
-                       'header' : mw.G.checkout_header,
-                       'line_item' : mw.G.checkout_line_item,
-                       'footer' : mw.G.checkout_footer
-               };
-               mw.print_checkout_receipt( params );
-       }
-
-       p.w.document.getElementById('checkout_print').addEventListener( 'command',print_receipt, false);
-
-       p.w.document.getElementById('checkout_done').addEventListener(
-               'command',
-               function () {
-                       if (p.w.document.getElementById('checkout_auto').checked) print_receipt(); 
-                       checkouts = []; p.display_patron(); tb.focus();
-               },
-               false
-       );
-       p.attempt_checkout = function(barcode) {
-               try {
-                       //if (! is_barcode_valid(barcode) ) throw('Invalid Barcode');
-                       var permit_check = checkout_permit( barcode, p._patron.id(), 0 );
-                       if (permit_check.status == 0) {
-                               var check = checkout_by_copy_barcode( barcode, p._patron.id() );
-                               if (check) {
-                                       checkouts.push( check );
-                                       p.patron_checkout_items.add_checkout_items( [ checkouts.length - 1 ] );
-                                       var temp = p._patron.checkouts();
-                                       temp.push( check );
-                                       p._patron.checkouts( temp );
-                                       render_fm(p.w.document, { 'au' : p._patron }); // p.display_patron();
-                                       p.redraw_patron_items();
-                                       tb.value = '';
-                               }
-                       } else {
-                               throw(permit_check.text);
-                       }
-               } catch(E) {
-                       tb.select();
-                       if (typeof(E) == 'object') {
-                               handle_error(E,true);
-                       } else {
-                               s_alert(E);
-                       }
-               }
-               tb.focus();
-       }
-
-       tb.addEventListener(
-               'keypress',
-               function(ev) {
-                       if (ev.keyCode == 13 || ev.keyCode == 77 ) { p.attempt_checkout( tb.value ); }
-               },
-               false
-       );
-       submit_button.addEventListener(
-               'command',
-               function(ev) {
-                       p.attempt_checkout( tb.value );
-               },
-               false
-       );
-
-       p.redraw_patron_checkout_items = function() {
-               p.patron_checkout_items.clear_checkout_items();
-               for (var i = 0; i < checkouts.length; i++) {
-                       p.patron_checkout_items.add_checkout_items( [ i ] );
-               }
-       }
-
-       p.patron_checkout_items.register_patron_checkout_items_select_callback(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing patron_checkout_items_select_callback\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
-                       var patron_checkout_items = get_list_from_tree_selection( p.patron_checkout_items.paged_tree.tree );
-                       /* grab cover art for selected item? */
-               }
-       );
-       p.patron_checkout_items.register_flesh_patron_checkout_items_function(
-               function (treeitem) {
-                       sdump('D_PATRON_DISPLAY','Firing flesh_patron_checkout_items_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       p.patron_checkout_items.map_patron_checkout_items_to_cols( checkouts[ record_id ], treeitem );
-               }
-       );
-       p.patron_checkout_items.register_checkout_context_builder(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing context_builder for patron_checkout_items\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_checkout_items.paged_tree.popup = ' + p.patron_checkout_items.paged_tree.popup + '\n');
-                       empty_widget(p.patron_checkout_items.paged_tree.popup);
-                       var patron_checkout_items = get_list_from_tree_selection( p.patron_checkout_items.paged_tree.tree );
-
-                       /*** CHECKIN ***/
-                       var menuitem_pci_c = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_c );
-                       menuitem_pci_c.setAttribute('label',getString('circ.context_checkin'));
-                       menuitem_pci_c.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing checkin context for patron_checkout_items\n');
-                                       var keep_these = [];
-                                       for (var i = 0; i < patron_checkout_items.length; i++) {
-                                               try {
-                                                       var idx = patron_checkout_items[i].getAttribute('record_id'); 
-                                                       var copy = checkouts[ idx ].copy;
-                                                       var check = checkin_by_copy_barcode( copy.barcode(), null );
-                                                       if (check == null) { // change this to whatever it takes
-                                                               keep_these.push( checkouts[ idx ] );    
-                                                       }
-                                                       if (check != null && check.status == 0) {
-                                                               //check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
-                                                               alert('Check In: ' + check.text + '  Route To: ' + check.route_to);
-                                                       }
-                                                       checkouts = keep_these;
-                                                       p.refresh();
-                                               } catch(E) {
-                                                       alert(E);
-                                               }
-                                       }
-                               },
-                               false
-                       );
-
-                       /* separator */
-                       var menuitem_pci_s = p.patron_checkout_items.paged_tree.w.document.createElement('menuseparator');
-                       p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_s );
-                       
-
-                       /*** COPY EDITOR ***/
-                       var menuitem_pci_ce = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_ce );
-                       menuitem_pci_ce.setAttribute('label',getString('circ.context_edit'));
-                       menuitem_pci_ce.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_checkout_items\n');
-                                       for (var i = 0; i < patron_checkout_items.length; i++) {
-                                               var idx = patron_checkout_items[i].getAttribute('record_id');
-                                               var copy = checkouts[ idx ].copy;
-                                               sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
-                                               spawn_batch_copy_editor(
-                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
-                                                               'copy_ids' : [ copy.id() ]
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** OPAC ***/
-                       var menuitem_pci_o = p.patron_checkout_items.paged_tree.w.document.createElement('menuitem');
-                       p.patron_checkout_items.paged_tree.popup.appendChild( menuitem_pci_o );
-                       menuitem_pci_o.setAttribute('label',getString('circ.context_opac'));
-                       menuitem_pci_o.addEventListener(
-                               'command',
-                               function (ev) {
-                                       alert('Not Yet Implemented');
-                                       sdump('D_PATRON_DISPLAY','Firing opac context for patron_checkout_items\n');
-                                       for (var i = 0; i < patron_checkout_items.length; i++) {
-                                               var idx = patron_checkout_items[i].getAttribute('record_id');
-                                               sdump('D_PATRON_DISPLAY','Firing opac context\n');
-                                       }
-                               },
-                               false
-                       );
-                       
-               }
-       );
-}
-
-function patron_display_patron_holds_init(p) {
-       p.patron_holds = patron_holds_init( { 'w' : p.w, 'node' : p.patron_holds_node, 'debug' : p.app } );
-
-       p.redraw_patron_holds = function() {
-               p.patron_holds.clear_patron_holds();
-               if (!p._patron.hold_requests()) patron_get_holds( p._patron );
-               for (var i = 0; i < p._patron.hold_requests().length; i++) {
-                       p.patron_holds.add_patron_holds( [ i ] );
-               }
-       }
-
-       p.patron_holds.register_patron_holds_select_callback(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing patron_holds_select_callback\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\n');
-                       var patron_holds = get_list_from_tree_selection( p.patron_holds.paged_tree.tree );
-                       /* grab cover art for selected item? */
-               }
-       );
-       p.patron_holds.register_flesh_patron_holds_function(
-               function (treeitem) {
-                       sdump('D_PATRON_DISPLAY','Firing flesh_patron_holds_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       var hold = p._patron.hold_requests()[ record_id ];
-                       patron_get_hold_status(
-                               hold,
-                               function (request) {
-                                       var result = request.getResultObject();
-                                       hold.status( hold_status_as_text( result ) );
-                                       p.patron_holds.map_patron_holds_to_cols( hold, treeitem );
-                               }
-                       );
-               }
-       );
-       p.patron_holds.register_item_context_builder(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing context_builder for patron_holds\n');
-                       sdump('D_PATRON_DISPLAY','ev.target = ' + ev.target + '\np.patron_holds.paged_tree.popup = ' + p.patron_holds.paged_tree.popup + '\n');
-                       empty_widget(p.patron_holds.paged_tree.popup);
-                       var patron_holds = get_list_from_tree_selection( p.patron_holds.paged_tree.tree );
-                       sdump('D_PATRON_DISPLAY','patron_holds.length = ' + patron_holds.length + '\n');
-
-                       /*** CANCEL HOLD ***/
-                       var menuitem_ph_ce = p.patron_holds.paged_tree.w.document.createElement('menuitem');
-                       p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_ce );
-                       menuitem_ph_ce.setAttribute('label',getString('circ.context_cancel_hold'));
-                       menuitem_ph_ce.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing cancel hold context for patron_holds\n');
-                                       for (var i = 0; i < patron_holds.length; i++) {
-                                               sdump('D_PATRON_DISPLAY','Firing cancel edit context\n');
-                                               var record_id = patron_holds[i].getAttribute('record_id');
-                                               var hold = p._patron.hold_requests()[ record_id ];
-                                               cancel_hold( hold );
-                                       }
-                                       p.refresh();
-                               },
-                               false
-                       );
-
-                       /* separator */
-                       var menuitem_ph_s = p.patron_holds.paged_tree.w.document.createElement('menuseparator');
-                       p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_s );
-                       
-                       /*** COPY EDITOR ***/
-                       var menuitem_ph_ce = p.patron_holds.paged_tree.w.document.createElement('menuitem');
-                       p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_ce );
-                       menuitem_ph_ce.setAttribute('label',getString('circ.context_edit'));
-                       menuitem_ph_ce.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing copy editor context for patron_holds\n');
-                                       for (var i = 0; i < patron_holds.length; i++) {
-                                               sdump('D_PATRON_DISPLAY','Firing copy edit context\n');
-                                               var idx = patron_holds[i].getAttribute('record_id'); 
-                                               var copy = p._patron.hold_requests()[ idx ].copy;
-                                               spawn_batch_copy_editor(
-                                                       p.w.app_shell,'new_tab','main_tabbox',{ 
-                                                               'copy_ids' : [ copy.id() ]
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-
-                       /*** OPAC ***/
-                       var menuitem_ph_o = p.patron_holds.paged_tree.w.document.createElement('menuitem');
-                       p.patron_holds.paged_tree.popup.appendChild( menuitem_ph_o );
-                       menuitem_ph_o.setAttribute('label',getString('circ.context_opac'));
-                       menuitem_ph_o.addEventListener(
-                               'command',
-                               function (ev) {
-                                       alert('Not Yet Implemented');
-                                       sdump('D_PATRON_DISPLAY','Firing opac context for patron_holds\n');
-                                       for (var i = 0; i < patron_holds.length; i++) {
-                                               sdump('D_PATRON_DISPLAY','Firing opac context\n');
-                                       }
-                               },
-                               false
-                       );
-                       
-               }
-       );
-}
-
-function patron_display_patron_bills_init(p) {
-       p.patron_bills = patron_bills_init( { 
-               'w' : p.w, 
-               'node' : p.patron_bills_node, 
-               'debug' : p.app 
-       } );
-
-       p.patron_bills.refresh = function() { p.refresh(); }
-
-       p.redraw_patron_bills = function() {
-               try {
-                       p.patron_bills.clear_patron_bills();
-                       if (!p._patron.bills) patron_get_bills( p._patron );
-                       p.patron_bills.add_patron_bills( p._patron.bills );
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-       }
-}
-
-function patron_display_patron_edit_init(p) {
-       /*
-       p.patron_edit = patron_edit_init( { 
-               'w' : p.w, 
-               'node' : p.patron_edit_node, 
-               'debug' : p.app
-       } );
-
-       p.patron_edit.redisplay = function() { p.display_patron( {'patron_edit':true} ); }
-       p.patron_edit.refresh = function() { p.refresh( {'patron_edit':true} ); }
-
-       p.redraw_patron_edit = function() {
-               try {
-                       p.patron_edit.clear_patron_edit();
-                       p.patron_edit.add_rows( p._patron );
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-       }
-       */
-       /* shoehorn in the old legacy stuff */
-       p.patron_edit = {};
-       p.redraw_patron_edit = function() { 
-               empty_widget( p.patron_edit_node );
-               setTimeout(
-                       function() {
-                               var frame = p.w.document.createElement('iframe');
-                               p.patron_edit_node.appendChild( frame );
-                               frame.setAttribute('flex','1');
-                               frame.setAttribute('src','chrome://evergreen/content/patron/patron_edit_legacy.xul');
-                               frame.contentWindow.mw = mw;
-                               frame.contentWindow.params = {};
-                               var barcode = patron_get_barcode( p._patron );
-                               frame.contentWindow.params.barcode = barcode;
-                               frame.contentWindow.params._patron = p._patron;
-                               frame.contentWindow.patron_save_callback = function ( params ) {
-                                       p._patron = params.au;
-                                       p.display_patron();
-                               }
-                               p.patron_edit.frame = frame;
-                       }, 0
-               );
-       }
-}
-
-function patron_display_survey_init(p) {
-       var gb = p.w.document.getElementById('PatronDisplaySurvey_groupbox');
-       var count = gb.childNodes.length; for (var i = 1; i < count; i++) { gb.removeChild( gb.lastChild ); } // all but caption
-       mw.user_request(
-               'open-ils.circ', 'open-ils.circ.survey.retrieve.required', [ mw.G.auth_ses[0] ],
-               function (request) {
-                       var surveys = request.getResultObject();
-                       for (var i = 0; i < surveys.length; i++) {
-
-                               var survey = a_get(surveys, i);
-                       
-                               var hbox = document.createElement('hbox');
-                               gb.appendChild(hbox);
-
-                               var name_label = document.createElement('label');
-                               name_label.setAttribute('value',survey.name());
-                               hbox.appendChild(name_label);
-
-                               var answer_label = document.createElement('label');
-                               answer_label.setAttribute('value','');
-                               hbox.appendChild(answer_label);
-
-                               var taken_label = document.createElement('label');
-                               taken_label.setAttribute('value','Not Taken');
-                               hbox.appendChild(taken_label);
-
-                               mw.user_request(
-                                       'open-ils.circ', 'open-ils.circ.survey.response.retrieve',
-                                       [ mw.G.auth_ses[0], survey.id(), p._patron.id() ],
-                                       function (request) {
-                                               var responses = request.getResultObject();
-                                               if (responses.length > 0) {
-                                                       var response = responses.pop(); // last response
-                                                       var date;
-                                                       if (response.effective_date()) {
-                                                               date = formatted_date( response.effective_date(), '%D' );
-                                                       } else {
-                                                               date = formatted_date( response.answer_date(), '%D' );
-                                                       }
-                                                       taken_label.setAttribute('value',date);
-                                                       var answer = find_id_object_in_list( // first answer
-                                                               find_id_object_in_list(
-                                                                       survey.questions(),
-                                                                       response.question()
-                                                               ).answers(),
-                                                               response.answer()
-                                                       ).answer();
-                                                       answer_label.setAttribute('value',answer);
-                                               }
-                                       }
-                               );
-                       }
-               }
-       );
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.xul
deleted file mode 100755 (executable)
index 164fc1b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-
-<page id="patron_display_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="try {
-                       params.w = window; 
-                       params.app = 'PatronDisplay'; 
-                       params.clamshell_node = document.getElementById('ClamShell_main');
-                       params.patron_items_node = document.getElementById('PatronItems_main');
-                       params.patron_checkout_items_node = document.getElementById('PatronCheckoutItems_main');
-                       params.patron_holds_node = document.getElementById('PatronHolds_main');
-                       params.patron_bills_node = document.getElementById('PatronBills_main');
-                       params.patron_edit_node = document.getElementById('PatronEdit_main');
-                       params.commandset_node = document.getElementById('universal_cmds');
-                       mw.focus_widget( document, 'patron_checkout_barcode_entry_textbox' );
-                       mw.OpenILS_init(params);
-               } catch(E) {
-                       alert(E);
-               }"
-       onunload="try { mw.OpenILS_exit(params); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_display.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/patron_display.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="PatronDisplay_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="PatronDisplay_main" class="my_overflow" />
-
-       <popupset id="universal_popupset" />
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_contact_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_contact_overlay.xul
deleted file mode 100755 (executable)
index 2e23e04..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_contact_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_display_contact_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_display_contact -->
-<box id="PatronDisplayContact_main" flex="1" orient="vertical" style="overflow: auto;">
-       <groupbox id="PatronDisplayContact_groupbox" flex="1"/>
-</box>
-
-<groupbox id="PatronDisplayContact_groupbox" orient="vertical">
-       <caption label="&patron_display.contact.caption;"/>
-       <hbox id="pdcgbhb1">
-               <grid id="PatronDisplayContact_grid" />
-               <spacer id="pdcgbhbs1" flex="1"/>
-               <image id="PatronDisplay_photo" 
-                       render="true" fm_class="au" render_value=".photo_url()" />
-       </hbox>
-       <grid id="PatronDisplayContact_grid_phone" />
-       <groupbox id="PatronDisplayContact_mailing_address" />
-       <groupbox id="PatronDisplayContact_physical_address" />
-</groupbox>
-
-<grid id="PatronDisplayContact_grid">
-       <columns id="pdsgc">
-               <column id="pdsgc1" />
-               <column id="pdsgc2" />
-       </columns>
-       <rows id="pdsgr" flex="1">
-               <row id="pdsgr0">
-                       <label id="PatronDisplayContact_library_card_label" class="text_right"
-                               value="&patron_display.library_card.label;"/>
-                       <label id="PatronDisplayContact_library_card"
-                               render="true" fm_class="au" render_value="patron_get_barcode($$)"/>
-               </row>
-               <row id="pdsgr1">
-                       <label id="PatronDisplayContact_ident_label" class="text_right"
-                               value="&patron_display.ident1.label;"/>
-                       <hbox id="pdsgr0h">
-                               <label id="PatronDisplayContact_ident_type"
-                                       render="true" fm_class="au" render_value="patron_get_ident1_type_as_text($$)" />
-                               <label id="PatronDisplayContact_ident_value"
-                                       render="true" fm_class="au" render_value=".ident_value()" />
-                       </hbox>
-               </row>
-               <row id="pdsgr2">
-                       <label id="PatronDisplayContact_ident_label2" class="text_right"
-                               value="&patron_display.ident2.label;"/>
-                       <hbox id="pdsgr0ah">
-                               <label id="PatronDisplayContact_ident_type2"
-                                       render="true" fm_class="au" render_value="patron_get_ident2_type_as_text($$)" />
-                               <label id="PatronDisplayContact_ident_value2"
-                                       render="true" fm_class="au" render_value=".ident_value2()" />
-                       </hbox>
-               </row>
-               <row id="pdsgr3">
-                       <label id="PatronDisplayContact_date_of_birth_label" class="text_right"
-                               value="&patron_display.date_of_birth.label;"/>
-                       <label id="PatronDisplayContact_date_of_birth"
-                               render="true" fm_class="au" render_value=".dob()"/>
-               </row>
-               <row id="pdsgr4"><label id="pdsgr4l" value=" "/></row>
-       </rows>
-</grid>
-
-<grid id="PatronDisplayContact_grid_phone">
-       <columns id="pdcgpc">
-               <column id="pdcgpc1" />
-               <column id="pdcgpc2" />
-       </columns>
-       <rows id="pdcgpr" flex="1">
-               <row id="pdcgpr1">
-                       <label id="PatronDisplayContact_day_phone_label" class="text_right"
-                               value="&patron_display.day_phone.label;" />
-                       <label id="PatronDisplayContact_day_phone" 
-                               render="true" fm_class="au" 
-                               render_value=".day_phone()" />
-               </row>
-               <row id="pdcgpr2">
-                       <label id="PatronDisplayContact_evening_phone_label" class="text_right"
-                               value="&patron_display.evening_phone.label;" />
-                       <label id="PatronDisplayContact_evening_phone" 
-                               render="true" fm_class="au" 
-                               render_value=".evening_phone()" />
-               </row>
-               <row id="pdcgpr3">
-                       <label id="PatronDisplayContact_other_phone_label" class="text_right"
-                               value="&patron_display.other_phone.label;" />
-                       <label id="PatronDisplayContact_other_phone" 
-                               render="true" fm_class="au" 
-                               render_value=".other_phone()" />
-               </row>
-               <row id="pdsgpr4"><label id="pdsgpr4l" value=" "/></row>
-               <row id="pdcgpr5">
-                       <label id="PatronDisplayContact_email_label" class="text_right"
-                               value="&patron_display.email.label;" />
-                       <label id="PatronDisplayContact_email" 
-                               render="true" fm_class="au" 
-                               render_value=".email()" />
-               </row>
-               <row id="pdsgpr6"><label id="pdsgpr6l" value=" "/></row>
-
-       </rows>
-</grid>
-
-<groupbox id="PatronDisplayContact_mailing_address" orient="vertical">
-       <caption id="pdcmac" label="&patron_display.mailing_address;"/>
-       <label id="pdcmal1" 
-               tooltiptext="&patron_display.mailing.street1.label;" 
-               render="true" fm_class="au" render_value=".mailing_address().street1()" />
-       <label id="pdcmal2" 
-               tooltiptext="&patron_display.mailing.street2.label;" 
-               render="true" fm_class="au" render_value=".mailing_address().street2()" />
-       <hbox id="pdcmah">
-               <label id="pdcmal3" 
-                       tooltiptext="&patron_display.mailing.city.label;" 
-                       render="true" fm_class="au" render_value=".mailing_address().city()" />
-               <label id="pdcmal4" 
-                       tooltiptext="&patron_display.mailing.state.label;" 
-                       render="true" fm_class="au" render_value=".mailing_address().state()" />
-               <label id="pdcmal5" 
-                       tooltiptext="&patron_display.mailing.post_code.label;" 
-                       render="true" fm_class="au" render_value=".mailing_address().post_code()" />
-       </hbox>
-</groupbox>
-
-<groupbox id="PatronDisplayContact_physical_address" orient="vertical">
-       <caption id="pdcpac" label="&patron_display.physical_address;"/>
-       <label id="pdcpal1" 
-               tooltiptext="&patron_display.physical.street1.label;" 
-               render="true" fm_class="au" render_value=".billing_address().street1()" />
-       <label id="pdcpal2" 
-               tooltiptext="&patron_display.physical.street2.label;" 
-               render="true" fm_class="au" render_value=".billing_address().street2()" />
-       <hbox id="pdcpah">
-               <label id="pdcpal3" 
-                       tooltiptext="&patron_display.physical.city.label;" 
-                       render="true" fm_class="au" render_value=".billing_address().city()" />
-               <label id="pdcpal4" 
-                       tooltiptext="&patron_display.physical.state.label;" 
-                       render="true" fm_class="au" render_value=".billing_address().state()" />
-               <label id="pdcpal5" 
-                       tooltiptext="&patron_display.physical.post_code.label;" 
-                       render="true" fm_class="au" render_value=".billing_address().post_code()" />
-       </hbox>
-</groupbox>
-
-
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplayContact_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul
deleted file mode 100755 (executable)
index e631deb..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_display_overlay.xul\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_items_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_checkout_items_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_contact_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_holds_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-       <command id="cmd_patron_refresh" />
-       <command id="cmd_patron_checkout" />
-       <command id="cmd_patron_items" />
-       <command id="cmd_patron_holds" />
-       <command id="cmd_patron_bills" />
-       <command id="cmd_patron_edit" />
-       <command id="cmd_patron_info" />
-
-</commandset>
-
-<!-- main widget for patron_display -->
-<box id="PatronDisplay_main" flex="1" orient="vertical">
-       <hbox id="PatronNavBar" flex="0"/>
-       <groupbox id="PatronDisplay_groupbox" orient="vertical" flex="1">
-               <box id="ClamShell_main" />
-       </groupbox>
-</box>
-
-<deck id="ClamShell_first_deck" flex="0">
-       <vbox id="csfdvb1" flex="1">
-               <groupbox id="PatronDisplayStatus_groupbox" flex="0"/>
-               <groupbox id="PatronDisplaySurvey_groupbox" flex="0">
-                       <caption id="pdsgbc" label="Surveys" />
-               </groupbox>
-               <groupbox id="PatronDisplayContact_groupbox" flex="1"/>
-       </vbox>
-</deck>
-
-<deck id="ClamShell_second_deck" flex="1">
-       <groupbox id="cssdgb1">
-               <caption id="cssdgb1c" label="&patron_navbar.checkout;"/>
-               <box id="PatronCheckoutItems_main"/>
-       </groupbox>
-       <groupbox id="cssdgb2">
-               <caption id="cssdgb2c" label="&patron_navbar.items;"/>
-               <box id="PatronItems_main" />
-       </groupbox>
-       <groupbox id="cssdgb3">
-               <caption id="cssdgb3c" label="&patron_navbar.holds;"/>
-               <box id="PatronHolds_main" />
-       </groupbox>
-       <groupbox id="cssdgb4">
-               <caption id="cssdgb4c" label="&patron_navbar.bills;"/>
-               <box name="insert1" id="PatronBills_insert1" flex="0" />
-               <box id="PatronBills_main" flex="1" />
-               <box name="insert2" id="PatronBills_insert2" flex="0" />
-       </groupbox>
-       <groupbox id="cssdgb5">
-               <caption id="cssdgb5c" label="&patron_navbar.edit;"/>
-               <box name="insert1" id="PatronEdit_insert1" flex="0" />
-               <box id="PatronEdit_main" flex="1"/>
-               <box name="insert2" id="PatronEdit_insert2" flex="0" />
-       </groupbox>
-       <box id="PatronInfo_main"><label value="info" /></box>
-</deck>
-
-<hbox id="PatronNavBar">
-       <label id="PatronNavBar_patron_name" class="patronNameLarge"
-               tooltiptext="&patron_display.name.label;"
-               value="&patron_display.name.label;"
-               render="true" fm_class="au" 
-               render_value="patron_get_full_name($$)" />
-       <spacer id="PatronNavBar_spacer" flex="1" />
-       <button id="PatronNavBar_refresh" command="cmd_patron_refresh"
-               label="&patron_navbar.refresh;" accesskey="&patron_navbar.refresh.accesskey;"/>
-       <button id="PatronNavBar_checkout" command="cmd_patron_checkout"
-               label="&patron_navbar.checkout;" accesskey="&patron_navbar.checkout.accesskey;"/>
-       <button id="PatronNavBar_items" command="cmd_patron_items"
-               label="&patron_navbar.items;" accesskey="&patron_navbar.items.accesskey;"/>
-       <button id="PatronNavBar_holds" command="cmd_patron_holds"
-               label="&patron_navbar.holds;" accesskey="&patron_navbar.holds.accesskey;"/>
-       <button id="PatronNavBar_bills" command="cmd_patron_bills"
-               label="&patron_navbar.bills;" accesskey="&patron_navbar.bills.accesskey;"/>
-       <button id="PatronNavBar_edit" command="cmd_patron_edit"
-               label="&patron_navbar.edit;" accesskey="&patron_navbar.edit.accesskey;"/>
-       <button id="PatronNavBar_info" command="cmd_patron_info"
-               label="&patron_navbar.info;" accesskey="&patron_navbar.info.accesskey;"/>
-</hbox>
-
-<hbox id="PatronCheckoutItems_insert1">
-       <label id="patron_checkout_scan_barcode_label" value="&patron_display.checkout.scan_label;" accesskey="&patron_display.checkout.scan_label.accesskey;" control="patron_checkout_barcode_entry_textbox"/>
-       <textbox id="patron_checkout_barcode_entry_textbox"/>
-       <button id="patron_checkout_submit_barcode_button" label="&patron_display.checkout.submit_label;" accesskey="&patron_display.checkout.submit_label.accesskey;"/>
-</hbox>
-
-<hbox id="PatronCheckoutItems_insert3">
-       <button id="checkout_print" label="&patron_display.checkout.print_receipt_label;" accesskey="&patron_display.checkout.print_receipt_label.accesskey;"/>
-       <button id="checkout_reprint" label="&patron_display.checkout.reprint_receipt_label;" accesskey="&patron_display.checkout.reprint_receipt_label.accesskey;" oncommand="mw.last_sPrint();"/>
-       <spacer id="pcii3s" flex="1"/>
-       <checkbox id="checkout_auto" label="&patron_display.checkout.auto_print_label;" accesskey="&patron_display.checkout.auto_print_label.accesskey;"/> 
-       <button id="checkout_done" label="&patron_display.checkout.done_label;" accesskey="&patron_display.checkout.done_label.accesskey;"/>
-</hbox>
-
-<hbox id="PatronItems_insert3">
-       <button id="item_print" label="&patron_display.items.print_receipt_label;" accesskey="&patron_display.items.print_receipt_label.accesskey;"/>
-</hbox>
-
-<box id="PatronBills_insert2" orient="vertical">
-</box>
-
-<box id="PatronBills_insert1" orient="vertical">
-       <hbox>
-               <groupbox>
-                       <caption label="Summary"/>
-                       <grid>
-                               <columns><column /><column /></columns>                                 
-                               <rows>
-                                       <row>
-                                               <label value="Total Owed" />
-       
-                                               <textbox id="bill_total_owed" value="" readonly="true" />
-                                       </row>
-                                       <row>
-                                               <label value="- Payment applied" />
-                       
-                                               <textbox id="bill_payment_applied_textbox" readonly="true"/>
-                                       </row>
-                                       <row>
-                                               <label value="= New Balance" 
-                                                       style="font-family: bold" />
-       
-                                               <textbox id="bill_new_balance_textbox" readonly="true"/>
-                                       </row>
-                               </rows>
-                       </grid>
-               </groupbox>
-               <spacer flex="2"/>
-               <groupbox>
-                       <caption label="Pay Bill"/>
-                       <grid>
-                               <columns><column /><column /></columns>                                 
-                               <rows>
-                                       <row>
-                                               <label value="Payment Type" 
-                                                       accesskey="t" control="payment_type_menulist" />
-                                               <menulist id="payment_type_menulist">
-                                                       <menupopup id="payment_type_menupopup">
-                                                               <menuitem id="payment_type_menuitem1" label="Cash" value="cash_payment"/>
-                                                               <menuitem id="payment_type_menuitem2" label="Check" value="check_payment"/>
-                                                               <menuitem id="payment_type_menuitem3" label="Credit Card" value="credit_card_payment"/>
-                                                               <menuitem id="payment_type_menuitem4" label="Patron Credit" value="credit_payment" />
-                                                               <menuitem id="payment_type_menuitem5" label="Work" value="work_payment"/>
-                                                               <menuitem id="payment_type_menuitem6" label="Forgive" value="forgive_payment"/>
-                                                       </menupopup>
-                                               </menulist>
-                                       </row>
-                                       <row>
-                                               <label value="Payment received" style="font-weight: bold"
-                                                       accesskey="a" control="bill_payment_amount_textbox" />
-                       
-                                               <textbox id="bill_payment_amount_textbox" style="border: solid thick black"/>
-                                       </row>
-                                       <row>
-                                               <label value="- Payment applied" />
-                       
-                                               <textbox id="bpato" observes="bill_payment_applied_textbox" />
-                                       </row>
-                                       <row>
-                                               <label value="= Change" control="bill_change_amount_textbox" />
-       
-                                               <hbox>
-                                                       <textbox id="bill_change_amount_textbox" />
-                                               </hbox>
-                                       </row>
-                                       <row>
-                                               <label value="or Patron Credit" 
-                                                       style="font-family: bold" />
-       
-                                               <textbox id="bill_credit_amount_textbox" readonly="true"/>
-                                       </row>
-                               </rows>
-                       </grid>
-               </groupbox>
-       </hbox>
-       <hbox>
-               <button id="bill_wizard" label="Bill Patron" accesskey="B"/>
-               <spacer flex="2"/>
-               <button id="change_to_credit" label="Convert Change to Patron Credit"/>
-               <button id="bill_apply_payment" label="Go!" accesskey="G"/>
-       </hbox>
-       <label value=" "/>
-</box>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplay_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_status_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_status_overlay.xul
deleted file mode 100755 (executable)
index d8182f4..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_display_status_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_display_status_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_display_status -->
-<box id="PatronDisplayStatus_main" flex="1" orient="vertical">
-       <hbox id="PatronDisplayStatus_insert1"/>
-       <groupbox id="PatronDisplayStatus_groupbox" />
-       <hbox id="PatronDisplayStatus_insert5"/>
-</box>
-
-<groupbox id="PatronDisplayStatus_groupbox" orient="vertical">
-       <caption label="&patron_display.status.caption;"/>
-       <hbox id="PatronDisplayStatus_insert2"/>
-       <label id="PatronDisplayStatus_home_ou"
-               tooltiptext="&patron_display.home_ou.label;"
-               value=" "
-               render="true" fm_class="au" 
-               render_value="patron_get_home_ou_name($$)" />
-       <hbox id="PatronDisplayStatus_insert3"/>
-       <grid id="PatronDisplayStatus_grid" flex="1"/>
-       <hbox id="PatronDisplayStatus_insert4"/>
-       <label bug="without this here, the label and grid get swapped in the display"/>
-</groupbox>
-
-<grid id="PatronDisplayStatus_grid">
-       <columns id="pdsgc">
-               <column id="pdsgc1" />
-               <column id="pdsgc2" />
-               <column id="pdsgc3" />
-               <column id="pdsgc4" />
-       </columns>
-       <rows id="pdsgr" flex="1">
-               <row id="pdsgr1" render="true" fm_class="au" render_css_style="patron_get_standing_css_style($$.standing())">
-                       <label id="PatronDisplayStatus_profile_label" class="text_right"
-                               value="&patron_display.profile.label;" />
-                       <label id="PatronDisplayStatus_profile" 
-                               render="true" fm_class="au" 
-                               render_value="patron_get_profile_as_text($$)" />
-                       <label id="PatronDisplayStatus_standing_label" class="text_right"
-                               value="&patron_display.standing.label;" />
-                       <label id="PatronDisplayStatus_standing" 
-                               render="true" fm_class="au" 
-                               render_value="patron_get_standing_as_text($$)" />
-               </row>
-               <row id="pdsgr2">
-                       <label id="PatronDisplayStatus_credit_label" class="text_right"
-                               value="&patron_display.credit.label;" />
-                       <label id="PatronDisplayStatus_credit" 
-                               render="true" fm_class="au" 
-                               render_value="patron_get_credit_total($$)" />
-                       <label id="PatronDisplayStatus_bills_label" class="text_right"
-                               value="&patron_display.bills.label;" />
-                       <label id="PatronDisplayStatus_bill" 
-                               render="true" fm_class="au" 
-                               render_value="patron_get_bills_total($$)" />
-               </row>
-               <row id="pdsgr3">
-                       <label id="PatronDisplayStatus_checkouts_label" class="text_right"
-                               value="&patron_display.checkouts.label;" />
-                       <label id="PatronDisplayStatus_checkouts"
-                               render="true" fm_class="au" 
-                               render_value="patron_get_checkouts_total($$)" />
-                       <label id="PatronDisplayStatus_checkouts_overdue_label" class="text_right"
-                               value="&patron_display.checkouts_overdue.label;" />
-                       <label id="PatronDisplayStatus_checkouts_overdue"
-                               render="true" fm_class="au" 
-                               render_value="patron_get_checkouts_overdue_total($$)" />
-               </row>
-               <row id="pdsgr4">
-                       <label id="PatronDisplayStatus_holds_label" class="text_right"
-                               value="&patron_display.holds.label;" />
-                       <label id="PatronDisplayStatus_holds"
-                               render="true" fm_class="au" 
-                               render_value="patron_get_holds_total($$)" />
-                       <label id="PatronDisplayStatus_holds_available_label" class="text_right"
-                               value="&patron_display.holds_available.label;" />
-                       <label id="PatronDisplayStatus_holds_available"
-                               render="true" fm_class="au" 
-                               render_value="patron_get_holds_available_total($$)" />
-               </row>
-       </rows>
-</grid>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronDisplayStatus_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit.js
deleted file mode 100644 (file)
index 770cd20..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-sdump('D_TRACE','Loading patron_edit.js\n');
-
-function patron_edit_init(p) {
-       sdump('D_PATRON_EDIT',"TESTING: patron_edit.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       patron_edit_list_box_init( p );
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_edit_list_box_init( p ) {
-       p.patron_edit_cols = [
-               {
-                       'id' : 'fieldname', 'label' : getString('patron_edit_fieldname'), 'flex' : 0,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'row',
-                       'fm_field_render' : '.label.toString()'
-               },
-               {
-                       'id' : 'current_value', 'label' : getString('patron_edit_current_value'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'row', 
-                       'fm_field_render' : 'evil_eval(row.fm_class,row.fm_field_render)'
-               },
-               {
-                       'id' : 'new_value', 'label' : getString('patron_edit_new_value'), 'flex' : 0, 
-                       'fm_class' : 'row', 'fm_field_render' : 'create_entry_widget($$)'
-               }
-       ];
-
-       p.list_box = list_box_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_edit_cols, 'debug' : p.app } );
-       p.clear_patron_edit = function () { 
-               p.list_box.clear_rows(); 
-       };
-
-       p.add_rows = function (au) {
-               sdump('D_PATRON_EDIT','p.add_row(' + au + ')\n');
-               return patron_edit_add_rows(p,au);
-       }
-}
-
-function patron_edit_add_rows(p, au) {
-       sdump('D_PATRON_EDIT',arg_dump(arguments,{1:true}));
-
-       var obj_string ='au';
-
-       var edit = patron_edit_rows();
-
-       function evil_eval( hint, render_code ) {
-               sdump('D_PATRON_EDIT',arg_dump(arguments));
-               var cmd = parse_render_string( hint, render_code );
-               var col = '';
-               sdump('D_PATRON_EDIT','evil_cmd = ' + cmd + '\n');
-               try {
-                       col = eval( cmd );
-                       sdump('D_PATRON_EDIT','evil_eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',E + '\n');
-               }
-               return col;
-       }
-
-       function create_entry_widget(row) {
-               var obj;
-               try {
-                       sdump('D_PATRON_EDIT',arg_dump(arguments));
-                       if (row.rdefault) {
-                               row.rdefault = evil_eval( row.fm_class, row.rdefault );
-                       }
-                       if (row.entry_widget) {
-                               obj = p.w.document.createElement( row.entry_widget );
-                               obj.setAttribute('flex','1');
-                               if (row.entry_widget_attributes) {
-                                       for (var i in row.entry_widget_attributes) {
-                                               obj.setAttribute( i, row.entry_widget_attributes[i] );
-                                       }
-                               }
-                               switch(row.entry_widget) {
-                                       case 'menulist':
-                                               if (row.populate_with) {
-                                                       var menupopup = p.w.document.createElement('menupopup');
-                                                       obj.appendChild( menupopup );
-
-                                                       for (var i in row.populate_with) {
-
-                                                               var menuitem = p.w.document.createElement('menuitem');
-                                                               menupopup.appendChild( menuitem );
-                                                               menuitem.setAttribute('label', i );
-                                                               menuitem.setAttribute('value', row.populate_with[ i ] );
-                                                               if (row.rdefault) {
-                                                                       if ( (row.rdefault == i) || (row.rdefault == row.populate_with[ i ]) ) {
-                                                                               sdump('D_PATRON_EDIT','Selected ' + i + '\n');
-                                                                               menuitem.setAttribute('selected','true');
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                               break;
-                                       default:
-                                               if (row.rdefault) obj.setAttribute('value', row.rdefault);
-                                               break;
-                               }
-                       }
-                       if (row.entry_event && row.entry_code) {
-                               obj.addEventListener( row.entry_event, new Function('ev',row.entry_code), false);
-                       }
-               } catch(E) {
-                       alert(E + '\n' + js2JSON(E) + '\n');
-                       sdump('D_ERROR',E + '\n');
-                       obj = 'error';
-               }
-               return obj;
-       }
-
-       setTimeout(
-               function() {
-
-                       for (var i = 0; i < edit.length; i++) {
-
-                               var row = edit[i];
-
-                               var cols = [];
-
-                               for (var j = 0; j < p.patron_edit_cols.length; j++) {
-                                       var hash = p.patron_edit_cols[j];
-                                       sdump('D_PATRON_EDIT','Considering ' + js2JSON(hash) + '\n');
-                                       var listcell = p.w.document.createElement('listcell');
-                                       listcell.setAttribute('pack','start');
-                                       listcell.setAttribute('align','start');
-                                       listcell.setAttribute('style','border-left: black solid thin');
-                                       var col = '';
-                                       if (hash.fm_field_render) {
-
-                                               switch( hash.fm_class ) {
-                                                       case 'row' : obj_string = 'row'; break;
-                                                       case 'au' : obj_string = 'au'; break;
-                                               }
-                                               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-                                               sdump('D_PATRON_EDIT','cmd = ' + cmd + '\n');
-                                               try {
-                                                       col = eval( cmd );
-                                                       sdump('D_PATRON_EDIT','eval = ' + col + '\n');
-                                               } catch(E) {
-                                                       sdump('D_ERROR',E + '\n');
-                                               }
-                                               if (typeof(col) == 'string') {
-                                                       listcell.setAttribute('label',col);
-                                               } else {
-                                                       if (col==null) {
-                                                               listcell.setAttribute('label','');
-                                                       } else {
-                                                               listcell.appendChild( col );
-                                                       }
-                                               }
-                                       }
-                                       cols.push( listcell );
-                               }
-
-                               if (!row['style']) row['style'] = '';
-                               if (!row['class']) row['class'] = '';
-                               var listitem = p.list_box.add_row(
-                                       cols, { 'style' : row['style'], 'class' : row['class'] }
-                               );
-
-                               if (p.list_box.apply_to_each_listitem) {
-                                       p.list_box.apply_to_each_listitem( i, listitem );
-                               }
-                       }
-               }, 0
-       );
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.js
deleted file mode 100644 (file)
index 24fae24..0000000
+++ /dev/null
@@ -1,1754 +0,0 @@
-mw.sdump('D_LEGACY','Loading patron.js\n');
-//var newdoctype = document.implementation.createDocumentType("HTML", "-//W3C//DTD HTML 4.01 Transitional//EN","");
-var HTMLdoc;// = document.implementation.createDocument("", "", newdoctype);
-try {
-       if (typeof(PATRON)=='object') { 
-               mw.sdump('D_LEGACY','Already loaded\n');
-               exit; 
-       }
-} catch(E) {
-}
-var PATRON = {};
-PATRON['search'] = {};
-PATRON['search_results'] = [];
-PATRON['checkouts'] = [];
-var hash_aua = {};
-var hash_au = {};
-var hash_ac = {};
-var backup_au = {};
-//var hash_ap = {};
-var response_list = [];
-var local_stat_cats = [];
-var local_stat_cat_entries = {};
-var patron_hits_per_page = 20;
-
-var new_id = -1;
-
-var patron_list_columns = [ 
-       { 'f' : 'prefix', 'v' : 'Prefix', 'hidden' : true },
-       { 'f' : 'family_name', 'v' : 'Family Name', 'primary' : true },
-       { 'f' : 'first_given_name', 'v' : 'First Name' },
-       { 'f' : 'second_given_name', 'v' : 'Middle Name' },
-       { 'f' : 'suffix', 'v' : 'Suffix', 'hidden' : false },
-       { 'f' : 'email', 'v' : 'Email', 'hidden' : true  },
-       { 'f' : 'day_phone', 'v' : 'Day Phone', 'hidden' : false },
-       { 'f' : 'evening_phone', 'v' : 'Evening Phone', 'hidden' : true },
-       { 'f' : 'other_phone', 'v' : 'Other Phone', 'hidden' : true },
-       { 'f' : 'ident_value', 'v' : 'Ident Value', 'hidden' : false },
-       { 'f' : 'ident_type', 'v' : 'Ident Type', 'hidden' : true },
-       { 'f' : 'ident_value2', 'v' : 'Ident Value 2', 'hidden' : true },
-       { 'f' : 'ident_type2', 'v' : 'Ident Type 2', 'hidden' : true},
-       { 'f' : 'dob', 'v' : 'Date of Birth', 'hidden' : true},
-       { 'f' : 'active', 'v' : 'Active', 'hidden' : true},
-       { 'f' : 'expire_date', 'v' : 'Expire Date', 'hidden' : true},
-       { 's' : 'home_ou', 'f' : 'shortname', 'v' : 'Home Lib', 'hidden' : true},
-       { 'f' : 'usrname', 'v' : 'Login Name', 'hidden' : true},
-       { 'f' : 'usrgroup', 'v' : 'Group', 'hidden' : true},
-       { 's' : 'mailing_address', 'f' : 'street1', 'v' : 'Mailing Address - Street 1', 'hidden' : true},
-       { 's' : 'mailing_address', 'f' : 'street2', 'v' : 'Mailing Address - Street 2', 'hidden' : true},
-       { 's' : 'mailing_address', 'f' : 'city', 'v' : 'Mailing Address - City', 'hidden' : true},
-       { 's' : 'mailing_address', 'f' : 'state', 'v' : 'Mailing Address - State', 'hidden' : true},
-       { 's' : 'mailing_address', 'f' : 'post_code', 'v' : 'Mailing Address - ZIP', 'hidden' : false},
-       { 's' : 'billing_address', 'f' : 'street1', 'v' : 'Physical Address - Street 1', 'hidden' : true},
-       { 's' : 'billing_address', 'f' : 'street2', 'v' : 'Physical Address - Street 2', 'hidden' : true},
-       { 's' : 'billing_address', 'f' : 'city', 'v' : 'Physical Address - City', 'hidden' : true},
-       { 's' : 'billing_address', 'f' : 'state', 'v' : 'Physical Address - State', 'hidden' : true},
-       { 's' : 'billing_address', 'f' : 'post_code', 'v' : 'Physical Address - ZIP', 'hidden' : false}
-];
-
-
-function patron_init() {
-       mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_init(): ' + mw.G.main_test_variable + '\n');
-       mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
-       var textbox = document.getElementById('patron_scan_textbox');
-       if (textbox) textbox.addEventListener("keypress",patron_handle_keypress,false);
-       /* 
-       Originally, the idea here was to setup the PATRON object based on barcode if the bundle loader
-       set a params.barcode.  This would also switch the barcode scan prompt to the patron summary
-       sidebar.
-       */
-       patron_init_if_barcode();
-       document.getElementById('patron_new_card_button').addEventListener(
-               'command',
-               function(ev) { 
-                       var a = yns_alert('Activate a new PINES card?','PINES Card','Yes - Previous card lost/stolen','No',null,'Check here to confirm'); 
-                       if (a == 0) {
-                               var card = new ac(); card.id( new_id-- ); card.isnew( '1' ); 
-                               card.barcode( 'REQUIRED' ); //PATRON.barcode = 'REQUIRED'; 
-                               card.usr( PATRON.au.id() ); 
-                               hash_ac[ card.id() ] =  card; 
-                               PATRON.au.card( card ); 
-                               var cards = PATRON.au.cards(); 
-                               for (var i = 0; i < cards.length; i++) { cards[i].active('0'); cards[i].ischanged('1'); }
-                               cards.push( card ); PATRON.au.cards( cards );
-                               var barcode_e = document.getElementById('patron_edit_system_barcode_textbox');
-                               barcode_e.disabled = false; barcode_e.value = 'REQUIRED';
-                       }
-               },
-               false
-       );
-}
-
-function patron_handle_keypress(ev) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       if (ev.keyCode && ev.keyCode == 13) {
-               switch(this) {
-                       case document.getElementById('patron_scan_textbox') :
-                               ev.preventDefault();
-                               PATRON.scan_submit(ev);
-                       break;
-                       default:
-                       break;
-               }
-       }
-}
-
-function patron_new_init() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_new_init(): ' + mw.G.main_test_variable + '\n');
-       mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
-       PATRON.au = new au();
-       PATRON.au.id( new_id-- );
-       PATRON.au.isnew( '1' );
-       PATRON.au.profile( mw.G.ap_list[0].id() );
-       PATRON.au.ident_type( mw.G.cit_list[0].id() );
-       PATRON.au.home_ou( mw.G.user_ou.id() );
-       PATRON.au.addresses( [] );
-       PATRON.au.stat_cat_entries( [] );
-
-               var card = new ac();
-               card.id( new_id-- );
-               card.isnew( '1' );
-               card.barcode( 'REQUIRED' );
-               //PATRON.barcode = 'REQUIRED';
-               card.usr( PATRON.au.id() );
-               hash_ac[ card.id() ] =  card;
-
-       PATRON.au.card( card );
-       PATRON.au.cards( [ card ] );
-       PATRON.related_refresh(PATRON.au.id());
-
-       var passwd = document.getElementById( 'patron_edit_system_new_passwd_textbox' );
-       passwd.value = Math.floor( (Math.random() * 9000) + 1000 );
-       PATRON.au.passwd( passwd.value );
-
-       var textbox = document.getElementById( 'patron_edit_system_barcode_textbox' );
-       textbox.select(); textbox.focus();
-}
-
-function patron_edit_init() {
-       mw.sdump('D_LEGACY','**** TESTING: patron.js: patron_edit_init(): ' + mw.G.main_test_variable + '\n');
-       mw.sdump('D_LEGACY','PATRON = ' + js2JSON(PATRON) + '\n');
-       //mw.sdump('D_LEGACY','PATRON.au.array.length = ' + PATRON.au.array.length + '\n');
-       populate_patron_edit_library_menu();
-       populate_patron_edit_prefix_menu();
-       populate_patron_edit_suffix_menu();
-       populate_patron_edit_profile_menu();
-       populate_patron_edit_ident_type_menu();
-       populate_patron_edit_ident_type_menu2();
-       PATRON.summary_refresh();
-       local_stat_cats = mw.G.actsc_list;
-       populate_rows_with_local_stat_cats(
-               local_stat_cats,
-               local_stat_cat_entries,
-               'pescg_rows',
-               true
-       );
-       PATRON.summary_refresh();
-}
-
-function patron_init_if_barcode() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               if ( params.barcode ) {
-                       mw.sdump('D_LEGACY','patron_init(): patron.refresh()\n');
-                       PATRON.retrieve_patron(params.barcode);
-                       var deck = document.getElementById('patron_scan_deck');
-                       if (deck) { deck.setAttribute('selectedIndex','1'); }
-               }
-       } catch(E) {
-               //mw.sdump('D_LEGACY','patron_init_if_barcode ERROR: ' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','patron_init_if_barcode failed\n');
-       }
-}
-
-function populate_patron_edit_library_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               //populate_lib_list(
-               populate_lib_list_with_branch(
-                       'patron_edit_system_library_menulist',
-                       'patron_edit_system_library_menupopup',
-                       mw.G.user_ou,
-                       mw.G.org_tree,
-                       true
-               );
-       } catch(E) {
-               mw.sdump('D_LEGACY','populate_patron_edit_library_menu ERROR: ' + js2JSON(E) + '\n');
-               //mw.sdump('D_LEGACY','populate_patron_edit_library_menu failed\n');
-       }
-}
-
-function set_patron_edit_library_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var menuitem_id = 
-               'libitem' +
-               find_ou(
-                       mw.G.org_tree,
-                       PATRON.au.home_ou()
-               ).id();
-       var menuitem = document.getElementById(
-               menuitem_id
-       );
-       var homelib_e = document.getElementById('patron_edit_system_library_menulist');
-       if (homelib_e) { 
-               homelib_e.selectedItem = menuitem; 
-               mw.sdump('D_LEGACY','\tShould be set\n');
-       }
-}
-
-function populate_patron_edit_prefix_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               populate_name_prefix(
-                       'patron_edit_system_prefix_menulist',
-                       'patron_edit_system_prefix_menupopup'   
-               );
-       } catch(E) {
-               //mw.sdump('D_LEGACY','populate_patron_edit_prefix_menu ERROR: ' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','populate_patron_edit_prefix_menu failed\n');
-       }
-}
-
-function populate_patron_edit_suffix_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               populate_name_suffix(
-                       'patron_edit_system_suffix_menulist',   
-                       'patron_edit_system_suffix_menupopup'   
-               );
-       } catch(E) {
-               //mw.sdump('D_LEGACY','populate_patron_edit_suffix_menu ERROR: ' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','populate_patron_edit_suffix_menu failed\n');
-       }
-}
-
-function populate_patron_edit_profile_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               populate_user_profile(
-                       'patron_edit_system_profile_menulist',  
-                       'patron_edit_system_profile_menupopup'
-               );
-       } catch(E) {
-               //mw.sdump('D_LEGACY','populate_patron_edit_profile_menu ERROR: ' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','populate_patron_edit_profile_menu failed\n');
-       }
-}
-
-function set_patron_edit_profile_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var menuitem_id = 'apitem' + PATRON.au.profile();
-       var menuitem = document.getElementById(
-               menuitem_id
-       );
-       var profile_e = document.getElementById('patron_edit_system_profile_menulist');
-       if (profile_e) { profile_e.selectedItem = menuitem; }
-}
-
-function populate_patron_edit_ident_type_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               populate_ident_types(
-                       'patron_edit_system_id1type_menulist',  
-                       'patron_edit_system_id1type_menupopup',
-                       '1'
-               );
-       } catch(E) {
-               mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu ERROR: ' + js2JSON(E) + '\n');
-               //mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu failed\n');
-       }
-}
-
-function set_patron_edit_ident_type_menu() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var menuitem_id = 'cit1item' + PATRON.au.ident_type();
-       var menuitem = document.getElementById(
-               menuitem_id
-       );
-       var id1 = document.getElementById('patron_edit_system_id1type_menulist');
-       if (id1) { id1.selectedItem = menuitem; }
-}
-
-function populate_patron_edit_ident_type_menu2() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               populate_ident_types(
-                       'patron_edit_system_id2type_menulist',  
-                       'patron_edit_system_id2type_menupopup',
-                       '2'
-               );
-       } catch(E) {
-               //mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu2 ERROR: ' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','populate_patron_edit_ident_type_menu2 failed\n');
-       }
-}
-
-function set_patron_edit_ident_type_menu2() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var menuitem_id = 'cit2item' + PATRON.au.ident_type2();
-       var menuitem = document.getElementById(
-               menuitem_id
-       );
-       var id2_e = document.getElementById('patron_edit_system_id2type_menulist');
-       if (id2_e) { id2_e.selectedItem = menuitem; }
-}
-
-function populate_patron_survey_grid(grid) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       if (typeof(grid) != 'object') {
-               grid = document.getElementById(grid);
-       }
-       if (!grid) { return; }
-       var rows = grid.lastChild; if (!rows) { return; }
-       try {
-               empty_widget( rows );
-               // 'open-ils.circ.survey.required.retrieve',
-               // 'open-ils.circ.survey.retrieve.all',
-               var result = mw.user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.survey.retrieve.required',
-                       [ mw.G.auth_ses[0] ]
-               )[0];
-               if (typeof(result) != 'object') { throw('survey.retrieve.all did not return an object'); }
-               var desc_1 = new Object();
-               var desc_3 = new Object();
-               var survey_hash = new Object();
-               for (var i in result) {
-                       var survey = result[i];
-                       survey_hash[ survey.id() ] = survey; 
-                       if ( (survey.required() == '0') && (survey.usr_summary() == '0') ) { continue; }
-                       mw.sdump('D_LEGACY','Survey: ' + survey.id() + ' : ' + survey.name() + '\n');
-                       var row = document.createElement('row');
-                       rows.appendChild(row);
-                       desc_1[ survey.id() ] = document.createElement('description');
-                               desc_1[ survey.id() ].setAttribute('value', 'Not Taken');
-                       row.appendChild(desc_1[ survey.id() ]);
-                       var desc_2 = document.createElement('label');
-                               desc_2.setAttribute('class','link');
-                               desc_2.setAttribute('onclick','survey_test(event,' + survey.id() + ');');
-                       row.appendChild(desc_2);
-                       desc_2.setAttribute('value', survey.name() );
-                       desc_3[ survey.id() ] = document.createElement('description');
-                       row.appendChild(desc_3[ survey.id() ]);
-
-                       if (survey.required() == '1') {
-                               row.setAttribute('hidden','false');
-                       } else {
-                               row.setAttribute('hidden','true');
-                       }
-                       mw.sdump('D_LEGACY','creating desc_1: ' + desc_1 + '\n');
-                       var result2 = mw.user_async_request(
-                               'open-ils.circ',
-                               'open-ils.circ.survey.response.retrieve',
-                               [ mw.G.auth_ses[0], survey.id(), PATRON.au.id() ],
-                               function (request) {
-                                       var result2 = request.getResultObject();
-                                       mw.sdump('D_LEGACY','result2 = ' + js2JSON(result2) + '\n');
-                                       if (result2.length > 0) {
-                                               var last_response = result2.pop();
-                                               mw.sdump('D_LEGACY','desc_1 = ' + desc_1[ last_response.survey() ] + '\n');
-                                               mw.sdump('D_LEGACY','effective_date = [' + last_response.effective_date() + ']  answer_date = [' + last_response.answer_date() + ']\n');
-                                               var date = last_response.effective_date().substr(0,10);
-                                               if (!date) { date = last_response.answer_date().substr(0,10); }
-                                               var first_answer = '';
-                                               try {
-                                                       first_answer = find_id_object_in_list(
-                                                               find_id_object_in_list(
-                                                                       survey_hash[ last_response.survey() ].questions(),
-                                                                       last_response.question()
-                                                               ).answers(),
-                                                               last_response.answer()
-                                                       ).answer();
-                                               } catch(E) {
-                                                       mw.sdump('D_LEGACY',js2JSON(E) + '\n');
-                                               }
-                                               desc_1[ last_response.survey() ].setAttribute('value', date);
-                                               desc_3[ last_response.survey() ].setAttribute('value', first_answer);
-                                               mw.sdump('D_LEGACY','desc_1 = ' + date + '\n');
-                                       }
-                               }
-                       );
-               }
-       } catch(E) {
-               mw.sdump('D_LEGACY','populate_patron_edit_survey_grid ERROR: ' + js2JSON(E) + '\n');
-               mw.handle_error(E);
-       }
-}
-
-function toggle_patron_survey_grid_rows(e,grid) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var label = e.target.getAttribute('label');
-       var alt_label = e.target.getAttribute('alt_label');
-       e.target.setAttribute('label',alt_label);
-       e.target.setAttribute('alt_label',label);
-       toggle_hidden_grid_rows(grid);  
-}
-
-function retrieve_patron_by_barcode(barcode,method) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       if (!barcode) { barcode = PATRON.barcode(); }
-       mw.sdump('D_LEGACY','Entering PATRON.retrieve_patron() with barcode: ' + barcode + '\n');
-       //unregister_patron_window(this);
-       var result;
-       if (!method) method = 'open-ils.actor.user.fleshed.retrieve_by_barcode';
-       try {
-               if (params._patron) {
-                       result = [ params._patron ];
-               } else {
-                       result = mw.user_request(
-                               'open-ils.actor',
-                               method,
-                               [ mw.G.auth_ses[0], barcode ]
-                       );
-               }
-               if (typeof(result[0]) != 'object') {
-                       mw.sdump('D_LEGACY','unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
-                       throw('unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
-               }
-       } catch(E) {
-               mw.sdump('D_LEGACY','error in search.actor.user.barcode\n' + js2JSON(E) + '\n');
-               mw.handle_error(E);
-               return false;
-       }
-       /*for (var i in result[0]) {
-               var element = result[0][i];
-               if (typeof(element) != 'function') {
-                       mw.sdump('D_LEGACY','Copying ' + i + ' to PATRON\n');
-                       PATRON[i] = element;
-               }
-       }*/
-       PATRON.au = result[0];
-       //register_patron_window(this);
-       //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
-       patron_callback('retrieve_patron');
-       return PATRON.related_refresh(PATRON.au.id());
-}
-PATRON.retrieve_patron_by_barcode = retrieve_patron_by_barcode;
-PATRON.retrieve_patron = retrieve_patron_by_barcode;
-PATRON.retrieve_via_method = retrieve_patron_by_barcode;
-PATRON.refresh = retrieve_patron_by_barcode;
-
-function get_barcode() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               //mw.sdump('D_LEGACY','PATRON.au.array.length = ' + PATRON.au.array.length + '\n');
-               //mw.sdump('D_LEGACY','get_barcode: PATRON.au = ' + js2JSON(PATRON.au) + '\n.cards() = ' + js2JSON(PATRON.au.cards()) + '\n.card() = ' + js2JSON(PATRON.au.card()) + '\n');
-               //return find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
-               return PATRON.au.card().barcode();
-       } catch(E) {
-               mw.sdump('D_LEGACY','get_barcode() error == ' + js2JSON(E) + '\n');
-               return '';
-       }
-}
-PATRON.barcode = get_barcode;
-
-function validate_patron() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       //mw.sdump('D_LEGACY','validate_patron: PATRON.au = ' + js2JSON(PATRON.au) + '\nPATRON.au.array.length = ' + PATRON.au.array.length + '\n');
-       var s = '';
-       if ( PATRON.barcode() == 'REQUIRED') {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_barcode_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('Barcode required\n');
-       }
-       if ( ! PATRON.au.usrname() ) {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_usrname_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('Login Name required\n');
-       }
-
-       if ( ! PATRON.au.family_name() ) {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_family_name_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('Family Name required\n');
-       }
-       if ( ! PATRON.au.first_given_name() ) {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_first_given_name_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('First Given Name required\n');
-       }
-       if ( ! PATRON.au.ident_value() ) {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_id1value_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('Identification required\n');
-       }
-       if ( ! PATRON.au.dob() ) {
-               if (!s) {
-                       var textbox = document.getElementById( 'patron_edit_system_dob_textbox' );
-                       textbox.select(); textbox.focus();
-               }
-               s += ('Date of Birth required\n');
-       } else {
-               var date = PATRON.au.dob();
-               var flag = false;
-               var darray = date.split('-');
-               var year = darray[0]; if ( (!year) || (year.length != 4) || (!parseInt(year)) ) flag = true;
-               var month = darray[1]; if ( (!month) || (month.length !=2) || (!parseInt(month)) ) flag = true;
-               var day = darray[2]; if ( (!day) || (day.length !=2) || (!parseInt(day)) ) flag = true;
-               if (flag) {
-                       s += ('Date Format is YYYY-MM-DD\n');
-               }
-               if (!valid_year_month_day(year,month,day)) {
-                       s += ('Invalid Date\n');
-               }
-       }
-       if ( ! PATRON.au.mailing_address() ) {
-               s += ('Mailing Address required\n');
-       }
-       if ( ! PATRON.au.billing_address() ) {
-               s += ('Billing Address required\n');
-       }
-       if (s) {
-               mw.sdump('D_LEGACY',s); alert(s); return false;
-       }
-       return true;
-}
-
-function backup_patron(P) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       backup_au = P.au.clone();
-}
-
-function restore_patron(P) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       P.au = backup_au.clone();
-       //hash_ac[ P.au.card() ] = find_id_object_in_list( P.au.cards(), P.au.card() );
-       hash_ac[ P.au.card().id() ] = P.au.card();
-       hash_au[ P.au.id() ] = P.au;
-}
-
-function save_patron() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','Entering PATRON.save()\n\n=-=-=-=-=-=-=-=\n\n');
-       mw.sdump('D_LEGACY','PATRON.au = ' + js2JSON(PATRON.au) + '\n');
-       mw.sdump('D_LEGACY','PATRON.au.a.length = ' + PATRON.au.a.length + '\n\n');
-       //var backup_json = js2JSON(PATRON.au);
-       //mw.sdump('D_LEGACY','backup_json = ' + backup_json + '\n\n');
-       backup_patron(PATRON);
-       mw.sdump('D_LEGACY','\n\n=-=-=-=-=-=-=-=-=-=-\n\n');
-       check_for_new_addresses();
-       check_for_new_stat_cats();
-       if (! validate_patron() ) { 
-               mw.sdump('D_LEGACY','restoring backup\n');
-               restore_patron(PATRON);
-               return false; 
-       }
-       if (! PATRON.au.usrname() ) { 
-               PATRON.au.usrname( 
-                       PATRON.barcode()
-               );
-       }
-       PATRON.au.survey_responses( response_list );
-       mw.sdump('D_LEGACY','before PATRON.au = ' + js2JSON(PATRON.au) + '\n');
-       var result;
-       try {
-               result = mw.user_request(
-                               'open-ils.actor',
-                               'open-ils.actor.patron.update',
-                               [ mw.G.auth_ses[0], PATRON.au ]
-                       );
-               if (typeof(result[0]) != 'object') {
-                       mw.sdump('D_LEGACY','unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
-                       throw('unexpected result1 : ' + typeof(result[0]) + ' : ' + js2JSON(result) + '\n');
-               }
-       } catch(E) {
-               mw.sdump('D_LEGACY','error in \n' + js2JSON(E) + '\n');
-               mw.sdump('D_LEGACY','restoring backup 2\n');
-               restore_patron(PATRON);
-               mw.handle_error(E);
-               //mw.sdump('D_LEGACY','PATRON.au = ' + js2JSON(PATRON.au) + '\nPATRON.au.a.length = ' + PATRON.au.a.length + '\n');
-               //PATRON.summary_refresh();
-               return false;
-       }
-       PATRON.au = result[0];
-       if (! PATRON.au) { 
-               mw.sdump('D_LEGACY','Restoring backup\n'); 
-               restore_patron(PATRON);
-               mw.handle_error('Save Failed'); 
-               return; 
-       }
-       hash_aua = {};
-       response_list = [];
-       mw.sdump('D_LEGACY','after  PATRON.au = ' + js2JSON(PATRON.au) + '\n');
-       //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
-       PATRON.summary_refresh();
-       patron_callback('save', { 'au' : PATRON.au });
-       var refresh_result = PATRON.related_refresh(PATRON.au.id());
-       alert('Patron successfully updated.');
-       return refresh_result;
-}
-PATRON.save = save_patron;
-
-function check_for_new_addresses() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       for (var id in hash_aua) {
-               if ( (id < 0) && ( hash_aua[id].ischanged() ) ) {
-                       mw.sdump('D_LEGACY','Pushing new address\n');
-                       if (!PATRON.au.addresses()) { PATRON.au.addresses( [] ); }
-                       PATRON.au.addresses().push( hash_aua[id] );
-               }
-       }
-}
-
-function check_for_new_stat_cats() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var entries = new Array();
-       var grid = document.getElementById('patron_edit_stat_cat_grid');
-       var nl = grid.getElementsByTagName('menulist');
-       for (var i = 0; i < nl.length; i++) {
-               var menulist = nl[i];
-               if (menulist.getAttribute('original') != menulist.value) {
-                       var n_actscecm = new actscecm();
-                       var id = menulist.getAttribute('entry_id')
-                       //alert('check_for_new_stat_cats: id = ' + id );
-                       if (id) {
-                               n_actscecm.ischanged('1');
-                               n_actscecm.id( id );
-                       } else {
-                               n_actscecm.isnew('1');
-                               n_actscecm.id( new_id-- );
-                       }
-                       n_actscecm.stat_cat( menulist.getAttribute('stat_cat_id') );
-                       n_actscecm.stat_cat_entry( menulist.value );
-                       n_actscecm.target_usr( PATRON.au.id() );
-                       entries.push( n_actscecm );
-               }
-
-       }
-       //alert( 'entries = ' + js2JSON( entries ) );
-       PATRON.au.stat_cat_entries( entries );
-}
-
-function retrieve_patron_related_info(id) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       if (!id) { id = PATRON.au.id(); }
-       mw.sdump('D_LEGACY','Entering PATRON.related_refresh() with id: ' + id + '\n');
-       /*
-       var checkouts = [];
-       if (id > 0) {
-               try {
-                       checkouts = mw.user_request(
-                               'open-ils.circ',
-                               'open-ils.circ.actor.user.checked_out',
-                               [ mw.G.auth_ses[0], id ]
-                       )[0];
-               } catch(E) {
-                       mw.handle_error(E);
-               }
-       }
-       PATRON.checkouts = checkouts;
-       PATRON.nearest_due = '';
-       for (var i in checkouts) {
-               var checkout = checkouts[i];
-               mw.sdump('D_LEGACY','checkout = ' + js2JSON(checkout) + '\n');
-       }
-       PATRON.holds = [];
-       PATRON.bills = [];
-       PATRON.summary_refresh();
-       try {
-               //circ_init_list();
-       } catch(E) {
-               mw.sdump('D_LEGACY',js2JSON(E) + '\n');
-       }
-       patron_callback('related_refresh');
-       */
-       return true;
-}
-PATRON.related_refresh = retrieve_patron_related_info;
-
-/* patron_scan_overlay functions */
-
-function patron_callback(s,params) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       try {
-               switch(s) {
-                       case 'scan_submit' : return patron_scan_submit_callback(params); break;
-                       case 'related_refresh' : return patron_related_refresh_callback(params); break;
-                       case 'retrieve_patron' : return patron_retrieve_patron_callback(params); break;
-                       case 'save' : return patron_save_callback(params); break;
-                       default : return patron_default_callback(s,params); break;
-               }
-       } catch(E) {
-               /* assume no callback defined */
-               return true;
-       }
-}
-
-function patron_advanced_button(ev) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var deck = document.getElementById('patron_scan_deck');
-       if (deck) { deck.setAttribute('selectedIndex','2'); }
-       focus_widget( 'patron_search_family_name_textbox' );
-       deck = document.getElementById('circ_deck_deck');
-       if (deck) { deck.setAttribute('selectedIndex','6'); }
-       //PATRON.search = {};
-}
-PATRON.advanced_search = patron_advanced_button;
-
-function patron_scan_submit(ev) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','Entering PATRON.scan_submit() with target: ' + ev.target + '\n');
-       try {
-               var rc = PATRON.retrieve_patron( document.getElementById('patron_scan_textbox').value );
-               if (rc) {
-                       /* the PATRON object should already be updated.  Switch deck if there is one */
-                       var deck = document.getElementById('patron_scan_deck');
-                       if (deck) { deck.setAttribute('selectedIndex','1'); }
-                       patron_callback('scan_submit');
-                       /* enable the scan item widgets if there are some */
-                       enable_widgets(
-                               'circ_checkout_scan_search_button',
-                               'circ_checkout_scan_textbox',
-                               'circ_checkout_scan_submit_button'
-                       );
-                       focus_widget( 'circ_checkout_scan_textbox' );
-               } else {
-                       throw('retrieve_patron return code == false');
-               }
-       } catch(E) {
-               mw.sdump('D_LEGACY','Could not retrieve patron.  Invalid barcode?\n' + js2JSON(E) + '\n');
-               alert('Could not retrieve patron.  Invalid barcode?\n' + js2JSON(E) + '\n');
-       }
-}
-PATRON.scan_submit = patron_scan_submit;
-
-function patron_scan_search(ev) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','Entering PATRON.scan_search() with target: ' + ev.target + '\n');
-       //mw.sdump('D_LEGACY','PATRON.search = ' + pretty_print(js2JSON(PATRON.search)) + '\n');
-       try {
-               var result = mw.user_request(
-                       'open-ils.actor',
-                       'open-ils.actor.patron.search.advanced',
-                       [ mw.G.auth_ses[0], PATRON.search ]
-               )[0];
-               mw.sdump('D_LEGACY','result = ' + js2JSON(result) + '\n');
-               PATRON['search_results'] = result;
-               build_patron_search_result_deck();
-       } catch(E) {
-               mw.handle_error(E);
-       }
-}
-PATRON.scan_search = patron_scan_search;
-
-/* patron_summary_overlay functions */
-
-function make_barcode_handler(card_id,user_id) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       return function (ev) {
-               magic_field_edit(ev,'ac',card_id,'barcode');
-               PATRON.au.ischanged('1');
-               magic_field_edit(ev,'au',user_id,'usrname');
-               var usr_e = document.getElementById('patron_edit_system_usrname_textbox');
-               if (usr_e) {
-                       usr_e.value = ev.target.value;
-               }
-               /*ev.target.removeEventListener(
-                       "change",
-                       this,
-                       false
-               );*/
-       }
-}
-
-function patron_summary_refresh(ev) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       //alert( mw.arg_dump(arguments) );
-       // This function needs to be broken up.. it sets the patron edit section as well
-       if (!PATRON.au) { return; }
-       mw.sdump('D_LEGACY','Entering PATRON.summary_refresh()\n');
-       hash_au[PATRON.au.id()] = PATRON.au;
-       //PATRON.barcode = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card()).barcode();
-       /* just redraw the display with the PATRON object as is */
-       var barcode_e = document.getElementById('patron_edit_system_barcode_textbox');
-       var newcard_e = document.getElementById('patron_new_card_button');
-       if (barcode_e) {
-               //var barcode_v = find_id_object_in_list(PATRON.au.cards(),PATRON.au.card());
-               var barcode_v = PATRON.au.card();
-               if (barcode_v) {
-                       barcode_e.value = barcode_v.barcode();
-                       if (barcode_e.value != 'REQUIRED') {
-                               barcode_e.disabled = true;
-                               newcard_e.hidden = false;       
-                               barcode_e.addEventListener(
-                                       'change',
-                                       function (ev) {
-                                               PATRON.au.card().barcode( ev.target.value );
-                                       },
-                                       false
-                               );
-                       } else {
-                               barcode_e.addEventListener(
-                                       "change",
-                                       make_barcode_handler(barcode_v.id(),PATRON.au.id()),
-                                       false
-                               );
-                       }
-               }
-       }
-       var usrname_e = document.getElementById('patron_edit_system_usrname_textbox');
-       if (usrname_e) {
-               if (PATRON.au.usrname()) usrname_e.value = PATRON.au.usrname();
-               usrname_e.setAttribute("onchange",
-                       "magic_field_edit(event,'au'," + PATRON.au.id() + ",'usrname');");
-       }
-       var passwd_e = document.getElementById('patron_edit_system_new_passwd_textbox');
-       if (passwd_e) {
-               passwd_e.setAttribute("onchange",
-                       "magic_field_edit(event,'au'," + PATRON.au.id() + ",'passwd');");
-       }
-       var name_e = document.getElementById('patron_status_caption');
-       if (name_e) {
-               var name = '';
-               if (PATRON.au.prefix()) { name += PATRON.au.prefix() + ' '; }
-               if (PATRON.au.family_name()) { name += PATRON.au.family_name() + ', '; }
-               if (PATRON.au.first_given_name()) { name += PATRON.au.first_given_name() + ' '; }
-               if (PATRON.au.second_given_name()) { name += PATRON.au.second_given_name() + ' '; }
-               if (PATRON.au.suffix()) { name += PATRON.au.suffix(); }
-
-               name_e.setAttribute('label',name);
-       }
-       name_e = document.getElementById('patron_edit_system_family_name_textbox');
-       if (name_e) {
-               if (PATRON.au.family_name()) { name_e.value = PATRON.au.family_name(); }
-               name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'family_name');");
-       }
-       name_e = document.getElementById('patron_edit_system_first_given_name_textbox');
-       if (name_e) {
-               if (PATRON.au.first_given_name()) { name_e.value = PATRON.au.first_given_name(); }
-               name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'first_given_name');");
-       }
-       name_e = document.getElementById('patron_edit_system_second_given_name_textbox');
-       if (name_e) {
-               if (PATRON.au.second_given_name()) { name_e.value = PATRON.au.second_given_name(); }
-               name_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'second_given_name');");
-       }
-       name_e = document.getElementById('patron_edit_system_prefix_menulist');
-       if (name_e) {
-               if (PATRON.au.prefix()) { name_e.value = PATRON.au.prefix(); }
-               name_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'prefix');");
-       }
-       name_e = document.getElementById('patron_edit_system_suffix_menulist');
-       if (name_e) {
-               if (PATRON.au.suffix()) { name_e.value = PATRON.au.suffix(); }
-               name_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'suffix');");
-       }
-       var disable_e = document.getElementById('patron_edit_system_disable_checkbox');
-       if (disable_e) {
-               disable_e.checked = (PATRON.au.active() != 1);
-               disable_e.setAttribute("oncommand","try{PATRON.au.ischanged('1'); if (PATRON.au.active() == 1) {PATRON.au.active('0');} else {PATRON.au.active('1');}}catch(E){alert(E);}");
-       }
-       var profile_e = document.getElementById('patron_status_data_profile');
-       if (profile_e) {
-               //profile_e.setAttribute('value',find_id_object_in_list(mw.G.ap_list, PATRON.au.profile() ).name() );
-               profile_e.setAttribute('value',mw.G.ap_hash[ PATRON.au.profile() ].name() );
-       }
-       profile_e = document.getElementById('patron_edit_system_profile_menulist');
-       if (profile_e) {
-               //hash_ap[PATRON.au.profile().id()] = PATRON.au.profile();
-               profile_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'profile');");
-               set_patron_edit_profile_menu();
-       }
-       var email_e = document.getElementById('patron_edit_contact_email_textbox');
-       if (email_e) {
-               if (PATRON.au.email()) email_e.value = PATRON.au.email();
-               email_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'email');");
-       }
-       var dayphone_e = document.getElementById('patron_contact_dayphone_data');
-       if (dayphone_e) {
-               if (PATRON.au.day_phone()) dayphone_e.setAttribute('value', PATRON.au.day_phone() );
-       }
-       dayphone_e = document.getElementById('patron_edit_contact_dayphone_textbox');
-       if (dayphone_e) {
-               if (PATRON.au.day_phone()) dayphone_e.value = PATRON.au.day_phone();
-               dayphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'day_phone');");
-       }
-       var eveningphone_e = document.getElementById('patron_contact_eveningphone_data');
-       if (eveningphone_e) {
-               if (PATRON.au.evening_phone()) eveningphone_e.setAttribute('value', PATRON.au.evening_phone() );
-       }
-       eveningphone_e = document.getElementById('patron_edit_contact_eveningphone_textbox');
-       if (eveningphone_e) {
-               if (PATRON.au.evening_phone()) eveningphone_e.value = PATRON.au.evening_phone();
-               eveningphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'evening_phone');");
-       }
-       var otherphone_e = document.getElementById('patron_contact_otherphone_data');
-       if (otherphone_e) {
-               if (PATRON.au.other_phone()) otherphone_e.setAttribute('value', PATRON.au.other_phone() );
-       }
-       otherphone_e = document.getElementById('patron_edit_contact_otherphone_textbox');
-       if (otherphone_e) {
-               if (PATRON.au.other_phone()) otherphone_e.value = PATRON.au.other_phone();
-               otherphone_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'other_phone');");
-       }
-       var standing_e = document.getElementById('patron_status_data_standing');
-       if (standing_e) {
-               /*var standing = find_id_object_in_list( 
-                               mw.G.cst_list,
-                               PATRON.au.standing() 
-                       );*/
-               var standing = mw.G.cst_hash[ PATRON.au.standing() ];
-               mw.sdump('D_LEGACY','standing = ' + js2JSON(standing) + '\n');
-               standing_e.setAttribute( 'value', standing.value() );
-               if (standing.value() == 'Good') {
-                       addCSSClass(standing_e,'good');
-               } else {
-                       removeCSSClass(standing_e,'good');      
-               }
-       }
-       var claims_returned_e = document.getElementById('patron_status_data_claims_returned');
-       if (claims_returned_e) {
-               claims_returned_e.setAttribute('value',PATRON.au.claims_returned_count());
-       }
-       var credit_e = document.getElementById('patron_status_data_credit');
-       if (credit_e) {
-               credit_e.setAttribute('value',PATRON.au.credit_forward_balance());
-       }
-       var homelib_e = document.getElementById('patron_status_data_homelib');
-       if (homelib_e) {
-               homelib_e.setAttribute('value', 
-                       find_ou(
-                               mw.G.org_tree,
-                               PATRON.au.home_ou()
-                       ).name()
-               );
-       }
-       homelib_e = document.getElementById('patron_edit_system_library_menulist');
-       if (homelib_e) {
-               homelib_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'home_ou',false);");
-               set_patron_edit_library_menu();
-       }
-       var fees_e = document.getElementById('patron_status_data_fees');
-       if (fees_e) {
-               fees_e.setAttribute('value',PATRON.bills.length);
-       }
-       var checkouts_e = document.getElementById('patron_status_data_checkouts');
-       if (checkouts_e) {
-               checkouts_e.setAttribute('value',PATRON.checkouts.length);
-       }
-       var holds_e = document.getElementById('patron_status_data_holds');
-       if (holds_e) {
-               holds_e.setAttribute('value',PATRON.holds.length);
-       }
-       var nearest_due_e = document.getElementById('patron_status_data_nearest_due');
-       if (nearest_due_e) {
-               nearest_due_e.setAttribute('value',PATRON.nearest_due);
-       }
-       var id1value_e = document.getElementById('patron_edit_system_id1value_textbox');
-       if (id1value_e) {
-               if (PATRON.au.ident_value()) id1value_e.setAttribute('value',PATRON.au.ident_value());
-               id1value_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_value');");
-       }
-       var id2value_e = document.getElementById('patron_edit_system_id2value_textbox');
-       if (id2value_e) {
-               if (PATRON.au.ident_value2()) id2value_e.setAttribute('value',PATRON.au.ident_value2());
-               id2value_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_value2');");
-       }
-       var id1type_e = document.getElementById('patron_edit_system_id1type_menulist');
-       if (id1type_e) {
-               id1type_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_type');");
-               set_patron_edit_ident_type_menu(); 
-       }
-       var id2type_e = document.getElementById('patron_edit_system_id2type_menulist');
-       if (id2type_e) {
-               id2type_e.setAttribute("oncommand","magic_field_edit(event,'au'," + PATRON.au.id() + ",'ident_type2');");
-               set_patron_edit_ident_type_menu2();
-       }
-       var dob_e = document.getElementById('patron_edit_system_dob_textbox');
-       if (dob_e) {
-               if (PATRON.au.dob()) dob_e.setAttribute('value',PATRON.au.dob());
-               dob_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'dob',false);");
-       }
-       //populate_patron_survey_grid('patron_survey_grid');
-       populate_patron_survey_grid('patron_edit_survey_grid');
-       populate_patron_edit_surveys();
-
-       var address_rows = document.getElementById('patron_contact_address_rows');
-       if (address_rows) {
-               empty_widget(address_rows);
-               var addresses = PATRON.au.addresses();
-               for (var i in addresses) { 
-                       if (typeof(addresses[i])=='object') {
-                               var address = addresses[i];
-                               if (
-                                       (address.id() == PATRON.au.mailing_address()) ||
-                                       (address.id() == PATRON.au.billing_address())
-                               ) {
-                                       //mw.sdump('D_LEGACY','address dump: ' + i + ' : ' + addresses[i] + '\n');
-                                       rows_append_address( address_rows, address, false );
-                               }
-                       }
-               }
-       }
-       address_rows = document.getElementById('patron_edit_address_rows');
-       if (address_rows) {
-               empty_widget(address_rows);
-               var addresses = PATRON.au.addresses();
-               for (var i in addresses) { 
-                       if (typeof(addresses[i])=='object') {
-                               //mw.sdump('D_LEGACY','address dump: ' + i + ' : ' + js2JSON(addresses[i]) + '\n');
-                               rows_append_address( address_rows, addresses[i], true );
-                       }
-               }
-               var blank = new aua();
-               blank.id( new_id-- );
-               blank.isnew("1");
-               blank.usr( PATRON.au.id() );
-               /*if ( addresses.length == 0 ) {*/
-               if (hash_aua.length == 0) {
-                       blank.address_type( 'REQUIRED' );
-                       blank.ischanged( "1" );
-                       PATRON.au.mailing_address( blank.id() );
-                       PATRON.au.billing_address( blank.id() );
-               } else {
-                       blank.address_type( 'NEW' );
-               }
-               blank.city( 'CITY' );
-               blank.country( 'USA' );
-               blank.county( 'COUNTY' );
-               blank.post_code( 'ZIP' );
-               blank.state( 'GA' );
-               blank.street1( 'STREET1' );
-               blank.street2( 'STREET2' );
-               rows_append_address( address_rows, blank , true );
-       }
-
-       var alert_message_e = document.getElementById('patron_edit_system_alert_message_textbox');
-       if (alert_message_e) {
-               if (PATRON.au.alert_message()) alert_message_e.setAttribute('value',PATRON.au.alert_message());
-               alert_message_e.setAttribute("onchange","magic_field_edit(event,'au'," + PATRON.au.id() + ",'alert_message',false);");
-       }
-       var stat_cats_e = document.getElementById('patron_statcat_rows');
-       if (stat_cats_e) {
-               try {
-                       empty_widget( stat_cats_e );
-                       for (var i = 0; i < PATRON.au.stat_cat_entries().length; i++) {
-
-                               // fieldmapper
-                               var entry = PATRON.au.stat_cat_entries()[i];
-                               var stat_cat = mw.G.actsc_hash[ entry.stat_cat() ];
-
-                               // build XUL
-                               var row = document.createElement('row');
-                               stat_cats_e.appendChild(row);
-                               var sc_label = document.createElement('label');
-                               row.appendChild(sc_label);
-                               var sce_label = document.createElement('label');
-                               row.appendChild(sce_label);
-
-                               // set values
-                               sc_label.setAttribute('value', stat_cat.name() );
-                               sce_label.setAttribute('value', entry.stat_cat_entry() );
-                       }
-               } catch(E) {
-                       mw.handle_error(E);
-               }
-       }
-       stat_cats_e = document.getElementById('patron_edit_stat_cat_grid');
-       if (stat_cats_e) {
-               //alert('stat_cats_e');
-               try {
-                       //alert('in try');
-                       for (var i = 0; i < PATRON.au.stat_cat_entries().length; i++) {
-                               var entry = PATRON.au.stat_cat_entries()[i];
-                               //alert('entry = ' + js2JSON(entry) );
-                               var stat_cat = entry.stat_cat();
-                               if (typeof stat_cat == 'object') stat_cat = stat_cat.id();
-                               var menulist = document.getElementById('menulist_stat_cat_' + stat_cat);
-                               if (menulist) {
-
-                                       //alert('menulist');
-
-                                       menulist.value = entry.stat_cat_entry();
-                                       menulist.setAttribute( 'original', menulist.value );
-                                       menulist.setAttribute( 'entry_id', entry.id() );
-                                       //alert('summary_refresh: entry.id() = ' + entry.id() );
-
-                               }
-                       }
-               } catch(E) {
-                       mw.handle_error(E);
-               }
-       }
-       /*
-       if (PATRON.au.alert_message()) {
-               snd_bad(); snd_bad();
-               s_alert(
-                       'PATRON ALERT MESSAGE\n\n\n\n' +
-                       PATRON.au.alert_message() +
-                       '\n\n\n\nTo remove this alert permanently, Edit the patron and erase the message in "Alert Message".\n\n'
-               );
-       }
-       */
-}
-PATRON.summary_refresh = patron_summary_refresh;
-
-function rows_append_address( rows, address, edit ) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-
-
-       // patron_summary
-
-       //mw.sdump('D_LEGACY','Entering rows_append_address()\n');
-       if (typeof(rows) != 'object') {
-               rows = document.getElementById(box);
-       }
-       if (typeof(rows) != 'object') {
-               mw.sdump('D_LEGACY','rows_append_address: could not find ' + rows + '\n');
-               alert('rows_append_address: could not find ' + rows + '\n');
-               return false;
-       }
-       var row = document.createElement('row');
-               //row.setAttribute('id','row_address_'+yesno(edit)+address.id());
-               hash_aua[ address.id() ] = address;
-       rows.appendChild(row);
-       var groupbox = document.createElement('groupbox');
-               if (edit) {
-                       groupbox.setAttribute('id','groupbox_address_'+address.id());
-               } else {
-                       groupbox.setAttribute('id','groupbox_summary_address_'+address.id());
-               }
-               groupbox.setAttribute('flex','1');
-       row.appendChild(groupbox);
-       var caption = document.createElement('caption');
-               var caption_string = address.address_type();
-               if ( PATRON.au.mailing_address() == address.id() ) {
-                       caption_string = '(MAILING) ' + caption_string;
-               }
-               if ( PATRON.au.billing_address() == address.id() ) {
-                       caption_string = '(PHYSICAL) ' + caption_string;
-               }
-               caption.setAttribute( 'label',caption_string );
-       groupbox.appendChild(caption);
-
-       // patron_edit
-
-       if (edit) {
-               var hbox = document.createElement('hbox');
-               groupbox.appendChild(hbox);
-                       var label = document.createElement('label');
-                               label.setAttribute('value','Type:');
-                       hbox.appendChild(label);
-                       var textbox = document.createElement('textbox');
-                       textbox.setAttribute('size','20');
-                       textbox.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'address_type');");
-                       hbox.appendChild(textbox);
-                               textbox.value = address.address_type();
-                       var label2 = document.createElement('label');
-                               label2.setAttribute('value','Physical:');
-                       hbox.appendChild(label2);
-                       var checkbox_billing = document.createElement('checkbox');
-                               checkbox_billing.setAttribute('group','billing');
-                               checkbox_billing.setAttribute('oncommand','radio_checkbox(event); PATRON.au.billing_address(' + address.id() + '); PATRON.au.ischanged("1");');
-                       hbox.appendChild(checkbox_billing);
-                       if ( PATRON.au.billing_address() == address.id() ) {
-                               checkbox_billing.checked = true;
-                       }
-                       var label3 = document.createElement('label');
-                               label3.setAttribute('value','Mailing:');
-                       hbox.appendChild(label3);
-                       var checkbox_mailing = document.createElement('checkbox');
-                               checkbox_mailing.setAttribute('group','mailing');
-                               checkbox_mailing.setAttribute('oncommand','radio_checkbox(event); PATRON.au.mailing_address(' + address.id() + '); PATRON.au.ischanged("1");');
-                       hbox.appendChild(checkbox_mailing);
-                       if ( PATRON.au.mailing_address() == address.id() ) {
-                               checkbox_mailing.checked = true;
-                       }
-                       var label4 = document.createElement('label');
-                               label4.setAttribute('value','Invalid:');
-                       hbox.appendChild(label4);
-                       var checkbox_invalid = document.createElement('checkbox');
-                               checkbox_invalid.setAttribute('oncommand','invalid_checkbox(event,' + address.id() + ');');
-                       hbox.appendChild(checkbox_invalid);
-                       mw.sdump('D_LEGACY','address ' + address.id() + ' valid = ' + address.valid() + '\n');
-                       if ( address.valid() == '1' || address.valid() == 't' ) {
-                               checkbox_invalid.checked = false;
-                       } else {
-                               checkbox_invalid.checked = true;
-                       }
-                       var label5 = document.createElement('spacer');
-                               label5.setAttribute('flex','1');
-                       hbox.appendChild(label5);
-                       if (address.id()>-1) {
-                               var label6 = document.createElement('button');
-                                       label6.setAttribute('label','Delete');
-                                       label6.setAttribute('alt_label','Un-Delete');
-                                       label6.setAttribute('toggle','0');
-                                       label6.setAttribute('oncommand','toggle_address(event,' + address.id() + ');');
-                               hbox.appendChild(label6);
-                       }
-       }
-       var street1;
-               if (edit) {
-                       street1 = document.createElement('textbox');
-                       street1.setAttribute('size','40');
-                       street1.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'street1');");
-               } else {
-                       street1 = document.createElement('label');
-               }
-               street1.setAttribute( 'value',address.street1() );
-       groupbox.appendChild(street1);
-       var street2;
-               if (edit) {
-                       street2 = document.createElement('textbox');
-                       street2.setAttribute('size','40');
-                       street2.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'street2');");
-               } else {
-                       street2 = document.createElement('label');
-               }
-               street2.setAttribute( 'value',address.street2() );
-       groupbox.appendChild(street2);
-       var hbox = document.createElement('hbox');
-       groupbox.appendChild(hbox);
-               var city;
-                       if (edit) {
-                               city = document.createElement('textbox');
-                               city.setAttribute('size','20');
-                               city.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'city');");
-                       } else {
-                               city = document.createElement('label');
-                       }
-                       city.setAttribute( 'value',address.city() );
-               hbox.appendChild(city);
-               var county;
-                       if (edit) {
-                               county = document.createElement('textbox');
-                               county.setAttribute('size','20');
-                               county.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'county');");
-                               county.setAttribute( 'value',address.county() );
-                       } else {
-                               county = document.createElement('label');
-                               county.setAttribute( 'value','(' + address.county() + '),');
-                       }
-               hbox.appendChild(county);
-               if (!address.county()) {
-                       if (!edit) {
-                               county.setAttribute( 'display', 'none' );
-                               city.setAttribute( 'value',address.city() + ',' );
-                       }
-               }
-               var state;
-                       if (edit) {
-                               state = document.createElement('textbox');
-                               state.setAttribute('size','2');
-                               state.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'state');");
-                       } else {
-                               state = document.createElement('label');
-                       }
-                       state.setAttribute( 'value',address.state() );
-               hbox.appendChild(state);
-               var country;
-                       if (edit) {
-                               country = document.createElement('textbox');
-                               country.setAttribute('size','3');
-                               country.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'country');");
-                               country.setAttribute( 'value',address.country() );
-                       } else {
-                               country = document.createElement('label');
-                               country.setAttribute( 'value','(' + address.country() + '),');
-                       }
-               hbox.appendChild(country);
-               var zip;
-                       if (edit) {
-                               zip = document.createElement('textbox');
-                               zip.setAttribute('size','10');
-                               zip.setAttribute("onchange","magic_field_edit(event,'aua'," + address.id() + ",'post_code');");
-                       } else {
-                               zip = document.createElement('label');
-                       }
-                       zip.setAttribute( 'value',address.post_code() );
-               hbox.appendChild(zip);
-}
-
-function invalid_checkbox(e,id) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       if (e.target.checked) {
-               mw.sdump('D_LEGACY','Marking address ' + id + ' invalid\n');
-               mw.sdump('D_LEGACY','\tbefore address: ' + js2JSON(hash_aua[id]) + '\n');
-               //hash_aua[id].valid( '0' );
-               hash_aua[id].valid( 'f' );
-               hash_aua[id].ischanged( '1' );
-               mw.sdump('D_LEGACY','\tafter  address: ' + js2JSON(hash_aua[id]) + '\n');
-       } else {
-               mw.sdump('D_LEGACY','Marking address ' + id + ' valid\n');
-               mw.sdump('D_LEGACY','\tbefore address: ' + js2JSON(hash_aua[id]) + '\n');
-               //hash_aua[id].valid( '1' );
-               hash_aua[id].valid( 't' );
-               hash_aua[id].ischanged( '1' );
-               mw.sdump('D_LEGACY','\tafter  address: ' + js2JSON(hash_aua[id]) + '\n');
-       }
-}
-
-function toggle_address(e,id) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var groupbox = document.getElementById('groupbox_address_' + id);
-       //var address = find_id_object_in_list( hash_aua, id );
-       var address = hash_aua[id];
-       var button = e.target;
-       var label = button.getAttribute('label');
-       var alt_label = button.getAttribute('alt_label');
-       button.setAttribute('label',alt_label);
-       button.setAttribute('alt_label',label);
-       var toggle = button.getAttribute('toggle');
-       if (toggle == '0') {
-               button.setAttribute('toggle','1');
-               mw.sdump('D_LEGACY','original node = ' + js2JSON(address) + '\n');
-               addCSSClass(groupbox,'deleted_address');
-               address.isdeleted('1');
-               mw.sdump('D_LEGACY','updated  node = ' + js2JSON(address) + '\n');
-               mw.sdump('D_LEGACY','PATRON.au.mailing_address() = ' + PATRON.au.mailing_address() + ' address.id() = ' + address.id() + '\n');
-               if (PATRON.au.mailing_address() == address.id() ) {
-                       find_available_address_for('mailing_address');
-               }
-               mw.sdump('D_LEGACY','PATRON.au.billing_address() = ' + PATRON.au.billing_address() + ' address.id() = ' + address.id() + '\n');
-               if (PATRON.au.billing_address() == address.id() ) {
-                       find_available_address_for('billing_address');
-               }
-       } else {
-               button.setAttribute('toggle','0');
-               mw.sdump('D_LEGACY','original node = ' + js2JSON(address) + '\n');
-               removeCSSClass(groupbox,'deleted_address');
-               address.isdeleted('0');
-               mw.sdump('D_LEGACY','updated  node = ' + js2JSON(address) + '\n');
-       }
-       var nl = groupbox.getElementsByTagName('textbox');
-               for (var i in nl) {
-                       if (typeof(nl[i])=='object') {
-                               var t = nl[i];
-                               t.disabled = ! t.disabled;
-                       }
-               }
-}
-
-function find_available_address_for(which) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','entering find_avialable_address_for(' + which + ')\n');
-       var addresses = PATRON.au.addresses();
-       mw.sdump('D_LEGACY','considering existing addresses...\n');
-       for (var i in addresses) {
-               var address = addresses[i];
-               mw.sdump('D_LEGACY','i = ' + i + ' addresses[i] = ' + js2JSON(address) + '\n');
-               if ( address.isdeleted() == '1') { continue; }
-               if ( (address.address_type() == 'NEW') && (address.id() < 0) ) {
-                       address.address_type('REQUIRED');
-                       address.ischanged( '1' );
-               }
-               mw.sdump('D_LEGACY','PATRON.au before = ' + js2JSON(PATRON.au) + '\n');
-               var command = 'PATRON.au.' + which + "( '" + address.id() + "' );";
-               mw.sdump('D_LEGACY', command + '\n' );
-               eval( command );
-               mw.sdump('D_LEGACY','PATRON.au after  = ' + js2JSON(PATRON.au) + '\n');
-               return true;
-       }
-       mw.sdump('D_LEGACY','considering old and new addresses...\n');
-       for (var i in hash_aua) {
-               var address = hash_aua[i];
-               mw.sdump('D_LEGACY','i = ' + i + ' addresses[i] = ' + js2JSON(address) + '\n');
-               if ( address.isdeleted() == '1') { continue; }
-               if ( (address.address_type() == 'NEW') && (address.id() < 0) ) {
-                       address.address_type('REQUIRED');
-                       address.ischanged( '1' );
-               }
-               mw.sdump('D_LEGACY','PATRON.au before = ' + js2JSON(PATRON.au) + '\n');
-               var command = 'PATRON.au.' + which + "( '" + address.id() + "' );";
-               mw.sdump('D_LEGACY', command + '\n' );
-               eval( command );
-               mw.sdump('D_LEGACY','PATRON.au after  = ' + js2JSON(PATRON.au) + '\n');
-               return true;
-       }
-}
-
-function survey_test(ev,survey_id) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-
-       document.getElementById('circ_deck_deck').setAttribute('selectedIndex','5');
-       var vbox = document.getElementById('patron_survey_vbox');
-       empty_widget( vbox ); 
-       survey_render_with_results(
-               vbox,
-               survey_id,
-               function (survey) {
-                       return PATRON.refresh();
-               }
-       );
-}
-
-function populate_patron_edit_surveys() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var vbox = document.getElementById('patron_edit_survey_vbox');
-       if (!vbox) return;
-
-       mw.sdump('D_LEGACY','populate_patron_edit_surveys()\n');
-
-       empty_widget( vbox ); 
-
-       var surveys = [];
-       try {
-               surveys = mw.user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.survey.retrieve.required',
-                       [ mw.G.auth_ses[0] ]
-               )[0];
-       } catch(E) {
-               mw.handle_error(E);
-       }
-
-       for (var i = 0; i < surveys.length; i++) {
-               var survey = surveys[i];
-               survey_render(
-                       vbox,
-                       survey.id(),
-                       populate_patron_edit_surveys_build_callback( survey ),
-                       null
-               );
-       }
-}
-
-function populate_patron_edit_surveys_build_callback( survey ) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       return function (responses) {
-               for (var i in responses) {
-                       response_list.push( responses[i] );
-               }
-               var nframe = document.getElementById('patron_survey_frame_'+survey.id());
-               nframe.hidden = true;
-               var complete = document.createElement('description');
-               complete.setAttribute('value',survey.name() + ' Complete');
-               nframe.parentNode.insertBefore( complete, nframe );
-               //nframe.contentWindow.document.body.innerHTML = '<h1>' + survey.name() + ' Complete</h1>';
-               return true;
-       };
-}
-
-
-function survey_render(vbox,survey_id,commit_callback,submit_callback) {
-       sdump('D_LEGACY',arg_dump(arguments));
-       if (typeof(vbox) != 'object') { vbox = document.getElementById(vbox); }
-       var frame = document.createElement('vbox');
-       vbox.appendChild(frame);
-       //frame.setAttribute('flex','1'); frame.setAttribute('src','data:text/html,<html><head><LINK href="http://spacely.georgialibraries.org/css/box.css" rel="stylesheet" type="text/css"><LINK href="http://spacely.georgialibraries.org/css/survey.css" rel="stylesheet" type="text/css"></head><body></body></html>');
-       
-       setTimeout(function(){
-       /*var doc = frame.contentWindow.document;*/
-       var doc = document;
-       window.createAppElement = function (name) { return doc.createElementNS('http://www.w3.org/1999/xhtml','html:'+name); }
-       window.createTextNode = function (value) { return doc.createTextNode(value); }
-       Survey.retrieveById( 
-               mw.G.auth_ses[0] , 
-               survey_id,
-               function(sur) { 
-                       sur.setUser( PATRON.au.id() ); 
-                       if (submit_callback) sur.setSubmitCallback( submit_callback );
-                       if (commit_callback) sur.commitCallback = commit_callback;
-                       mw.sdump('D_LEGACY','survey id: ' + sur.survey.id() + '\n');
-
-                       var node = sur.getNode();
-
-                       try {
-                               dump( super_dump( node ) );
-                       } catch(E) {
-                               dump( js2JSON(E) );
-                       }
-
-                       frame.appendChild( node ); 
-                       /*frame.setAttribute('style','height: ' + (30+doc.height) + 'px;');*/
-                       frame.setAttribute('id','patron_survey_frame_' + sur.survey.id());
-               } 
-       );
-       },0);
-}
-
-function survey_render_with_results(vbox,survey_id,callback) {
-       sdump('D_LEGACY',arg_dump(arguments));
-       if (typeof(vbox) != 'object') { vbox = document.getElementById(vbox); }
-       var frame = document.createElement('vbox');
-       vbox.appendChild(frame);
-       //frame.setAttribute('id','patron_survey_frame'); 
-       //frame.setAttribute('flex','1'); frame.setAttribute('src','data:text/html,<html><head><LINK href="http://spacely.georgialibraries.org/css/box.css" rel="stylesheet" type="text/css"><LINK href="http://spacely.georgialibraries.org/css/survey.css" rel="stylesheet" type="text/css"></head><body></body></html>');
-       //var doc = frame.contentWindow.document;
-       var doc = document;
-       //HTMLdoc = doc;
-       window.createAppElement = function (name) { return doc.createElementNS('http://www.w3.org/1999/xhtml','html:'+name); }
-       window.createTextNode = function (value) { return doc.createTextNode(value); }
-       Survey.retrieveById( 
-               mw.G.auth_ses[0] , 
-               survey_id,
-               function(sur) { 
-                       sur.setUser( PATRON.au.id() ); 
-                       sur.setSubmitCallback( callback );
-                       mw.sdump('D_LEGACY','survey id: ' + sur.survey.id() + '\n');
-                       frame.appendChild( sur.getNode() ); 
-                       var span = doc.createElement('html:blockquote');
-                       span.setAttribute('id','survey_response_' + sur.survey.id());
-                       span.setAttribute('class','survey');
-                       var warning = doc.createTextNode('Retrieving Responses...');
-                       span.appendChild(warning);
-                       frame.appendChild(span);
-                       mw.user_async_request(
-                               'open-ils.circ',
-                               'open-ils.circ.survey.response.retrieve',
-                               [ mw.G.auth_ses[0], sur.survey.id(), PATRON.au.id() ],
-                               function (request) {
-                                       result = request.getResultObject().reverse();
-                                       span.removeChild( warning );
-                                       if (result.length == 0) { return; }
-                                       //span.appendChild( doc.createTextNode('Previous Responses:') );
-                                       //span.appendChild( doc.createElement('html:br') );
-                                       //span.setAttribute('style','border: black solid thin;');
-                                       var num_of_q = sur.survey.questions().length;
-                                       var current_q = 0;
-                                       span.appendChild( doc.createTextNode(
-                                               'Previous Responses:'
-                                       ) );
-                                       span.appendChild( doc.createElement('html:br') );
-                                       span.appendChild( doc.createElement('html:br') );
-                                       var block;
-                                       for (var i = 0; i < result.length; i++) {
-                                               if (++current_q > num_of_q) { current_q = 1; }
-                                               mw.sdump('D_LEGACY','current_q = ' + current_q + '  num_of_q = ' + num_of_q + '\n');
-                                               if (current_q == 1) {
-                                                       block = doc.createElement('html:blockquote');
-                                                       span.appendChild( doc.createTextNode(
-                                                               'Answer Date: ' + 
-                                                               result[i].answer_date() +
-                                                               ', Effective Date: ' + 
-                                                               result[i].effective_date()
-                                                       ) );
-                                                       span.appendChild( doc.createElement('html:br') );
-                                                       span.appendChild(block);
-                                               }
-                                               block.appendChild(
-                                                       doc.createTextNode(
-                                                               current_q + ') ' + 
-                                                               find_id_object_in_list(
-                                                                       find_id_object_in_list(
-                                                                               sur.survey.questions(),
-                                                                               result[i].question()
-                                                                       ).answers(),
-                                                                       result[i].answer()
-                                                               ).answer() + ' '
-                                                       )
-                                               );
-                                       }
-                                       span.appendChild( doc.createElement('html:br') );
-                                       /*frame.setAttribute('style','height: ' + (30+doc.height) + 'px;');*/
-                               }
-                       );
-               } 
-       );
-}
-
-
-function handle_patron_search_textbox(ev,group) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var id = ev.target.getAttribute('id');
-       var field = id.split(/_/).slice(2,-1).join('_');
-       mw.sdump('D_LEGACY','field = ' + field + ' value = ' + ev.target.value + '\n');
-       PATRON.search[field] = { 'value' : ev.target.value, 'group' : group };
-}
-
-function build_patron_search_result_deck() {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       var label = document.getElementById('patron_search_results_label');
-       if (label) {
-               var s = 'Found ' + PATRON.search_results.length + ' matches.  ';
-               if (PATRON.search_results.length > patron_hits_per_page) {
-                       s += 'Displaying ' + patron_hits_per_page + ' per page:';
-               }
-               label.setAttribute('value',s);
-       }
-       var deck = document.getElementById('patron_search_results_deck');       
-       if (!deck) return;
-
-       empty_widget(deck);
-
-       var patron_ids = PATRON.search_results.slice(0,patron_hits_per_page);
-       PATRON.search_results = PATRON.search_results.slice(patron_hits_per_page);
-       build_patron_search_result_page(deck,patron_ids,PATRON.search_results.length);
-}
-
-function build_patron_search_result_page(deck,patron_ids,remaining) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       mw.sdump('D_LEGACY','build_patron_search_result_page()\n');
-       if (typeof(deck)!='object') deck = document.getElementById(deck);
-       if (!deck) return;
-
-       if (patron_ids.length == 0) return;
-
-       var vbox = document.createElement('vbox');
-       deck.appendChild(vbox);
-       vbox.setAttribute('flex','1');
-
-       var idx = deck.childNodes.length - 1;
-       deck.selectedIndex = idx;
-
-       var button_box = document.createElement('hbox');
-       vbox.appendChild(button_box);
-
-       var back_button = document.createElement('button');
-       button_box.appendChild(back_button);
-       back_button.setAttribute('label','Previous');
-       back_button.disabled = true;
-       if (idx > 0) {
-               back_button.disabled = false;
-               back_button.setAttribute('oncommand',"var deck = document.getElementById('patron_search_results_deck'); deck.selectedIndex = deck.selectedIndex -1;");
-       }
-       var forward_button = document.createElement('button');
-       button_box.appendChild(forward_button);
-       forward_button.setAttribute('label','Next');
-       forward_button.disabled = true;
-       if (remaining > 0) {
-               forward_button.disabled = false;
-               forward_button.addEventListener(
-                       'command',
-                       function (ev) {
-                               var fired = ev.target.getAttribute('fired');
-
-                               if (fired) {
-                                       deck.selectedIndex = idx + 1;
-                               } else {
-                                       var next_ids = PATRON.search_results.slice(0,patron_hits_per_page);
-                                       PATRON.search_results = PATRON.search_results.slice(patron_hits_per_page);
-                                       build_patron_search_result_page(deck,next_ids,PATRON.search_results.length);
-                                       ev.target.setAttribute('fired',true);
-                               }
-                       },
-                       false
-               );
-       }
-       var tree = document.createElement('tree');
-       vbox.appendChild(tree);
-       tree.setAttribute('flex','1');
-       tree.setAttribute('enableColumnDrag','true');
-       tree.addEventListener(
-               'select',
-               function (ev) {
-                       var row = get_list_from_tree_selection(ev.target)[0];
-                       if (row) {
-                               var patron_id = row.getAttribute('patron_id');
-                               if (patron_id) {
-                                       PATRON.retrieve_via_method( patron_id, 'open-ils.actor.user.fleshed.retrieve' );
-                                       circ_init();
-                                       set_decks( { 'patron_scan_deck' : '1' } );
-                                       focus_widget( row.parentNode );
-                               }
-                       }
-               },
-               false
-       );
-
-       var t_columns = document.createElement('treecols');
-       tree.appendChild(t_columns);
-
-       for (var i = 0; i < patron_list_columns.length; i++) {
-               var column = patron_list_columns[i];
-               var t_column = document.createElement('treecol');
-               t_columns.appendChild( t_column );
-               t_column.setAttribute('label', column.v);
-               if (column.s) {
-                       t_column.setAttribute('id', 'tc_' + column.s + '_' + column.f);
-               } else {
-                       t_column.setAttribute('id', 'tc_' + column.f);
-               }
-               t_column.setAttribute('flex', '0');
-               try {
-                       if (column.primary) {
-                               t_column.setAttribute('primary','true');
-                               t_column.setAttribute('flex','1');
-                       }
-                       if (column.hidden) t_column.setAttribute('hidden','true');
-               } catch(E) {
-                       mw.sdump('D_LEGACY',js2JSON(E) + '\n');
-               }
-               t_column.setAttribute('field',column.f);
-               if (i != (patron_list_columns.length - 1) ) {
-                       var t_splitter = document.createElement('splitter');
-                       t_columns.appendChild( t_splitter );
-                       t_splitter.setAttribute('class','tree-splitter');
-               }
-       }
-       var t_children = document.createElement('treechildren');
-       tree.appendChild(t_children);
-
-       for (var i = 0; i < patron_ids.length; i++) {
-               var t_item = document.createElement('treeitem');
-               t_children.appendChild( t_item );
-               t_item.setAttribute('patron_id',patron_ids[i]);
-
-               var t_row = document.createElement('treerow');
-               t_item.appendChild( t_row );
-               t_row.setAttribute('patron_id',patron_ids[i]);
-
-               //var t_cell = document.createElement('treecell');
-               //t_row.appendChild( t_cell );
-               //t_cell.setAttribute('label',patron_ids[i]);
-
-               mw.user_async_request(
-                       'open-ils.actor',
-                       'open-ils.actor.user.fleshed.retrieve', 
-                       [ mw.G.auth_ses[0], patron_ids[i] ],
-                       build_patron_retrieve_for_search_callback( t_row )
-               );
-               mw.sdump('D_LEGACY','Making call... count = ' + counter_incr('patron_call') + '\n');
-       }
-       
-}
-
-function build_patron_retrieve_for_search_callback(treerow) {
-       mw.sdump('D_LEGACY',arg_dump(arguments));
-       return function (request) {
-               mw.sdump('D_LEGACY','Running callback... count = ' + counter_incr('patron_callback') + '\n');
-               var result = request.getResultObject();
-               mw.sdump('D_LEGACY','Result = ' + js2JSON(result) + '\n');
-
-               for (var i = 0; i < patron_list_columns.length; i++) {
-                       var column = patron_list_columns[i];
-                       var t_cell = document.createElement('treecell');
-                       treerow.appendChild(t_cell);
-                       var expression;
-                       if (column.s) {
-                               switch(column.s) {
-                                       case 'home_ou':
-expression = 'mw.G.org_tree_hash[ result.home_ou() ].' + column.f + '()';
-                                       break;
-                                       case 'mailing_address':
-expression = 'find_id_object_in_list( result.addresses() , result.mailing_address() ).' + column.f + '()';
-                                       break;
-                                       case 'billing_address':
-expression = 'find_id_object_in_list( result.addresses() , result.billing_address() ).' + column.f + '()';
-                                       break;
-                               }
-                       } else {
-                               expression = 'result.' + column.f + '()';
-                       }
-                       //mw.sdump('D_LEGACY','Trying to eval: ' + expression + '\n');
-                       t_cell.setAttribute(
-                               'label',
-                               eval( expression )
-                       );
-               }
-       };
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_legacy.xul
deleted file mode 100644 (file)
index fdf6e1d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
-
-<page id="patron_new_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="patron_init(); patron_edit_init();"
-       xmlns:html="http://www.w3.org/1999/xhtml"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>
-               dump('patron_new_win\n');
-       </script>
-
-       <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
-       <!-- Initial Overlays for this XUL file -->
-       <!--
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_bundle.xul"?>
-       -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_edit_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <script src="chrome://evergreen/content/patron/patron_edit_legacy.js"/>
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="patron_edit_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_edit_overlay.xul
deleted file mode 100755 (executable)
index b04ddf8..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-<?xml version="1.0"?>
-<overlay id="patron_edit_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('patron_edit_overlay\n');</script>
-
-       <vbox id="patron_edit_vbox" flex="1">
-               <commandset id="patron_edit_cmds"/>
-               <vbox id="patron_edit_vbox2" flex="1"/>
-               <hbox id="patron_edit_hbox2" pack="end" flex="0">
-                       <button id="patron_edit_print" label='Print' accesskey="P" oncommand='window.print()'/>
-                       <button id="patron_edit_save" label='Save Changes' accesskey="S" command='cmd_patron_save'/>
-               </hbox>
-       </vbox>
-
-       <commandset id="patron_edit_cmds">
-               <command id="cmd_broken" oncommand=" 
-                       alert('Not Yet Implemented');
-               "/>
-               <command id="cmd_patron_save" oncommand="
-                       PATRON.save();
-               "/>
-               <command id="cmd_apply" oncommand="
-                       alert('cmd_apply');
-               "/>
-       </commandset>
-
-       <vbox id="patron_edit_vbox2" align="stretch" style="overflow: auto;" flex="1">
-               <vbox id="patron_edit_vbox2a" style="" flex="0">
-                       <groupbox id="patron_edit_system_groupbox" flex="0"/>
-               </vbox>
-               <vbox id="patron_edit_vbox2b" style="" flex="0">
-                       <groupbox id="patron_edit_contact_groupbox" flex="0"/>
-               </vbox>
-               <vbox id="patron_edit_vbox2c" style="" flex="0">
-                       <groupbox id="patron_edit_survey_groupbox" flex="0"/>
-               </vbox>
-               <vbox id="patron_edit_vbox2d" style="" flex="0">
-                       <groupbox id="patron_edit_stat_cat_groupbox" flex="0"/>
-               </vbox>
-       </vbox>
-       
-       <groupbox id="patron_edit_system_groupbox">
-               <caption id="patron_edit_system_caption" label="User Info" />
-               <hbox id="patron_edit_system_groupbox_hbox">
-                       <menulist id="patron_edit_system_library_menulist"/>
-               </hbox>
-               <grid id="patron_edit_system_grid"/>
-       </groupbox>
-
-       <groupbox id="patron_edit_contact_groupbox">
-               <caption id="patron_edit_contact_caption" label="Contact Info" />
-               <grid id="patron_edit_contact_phone_grid" />
-               <grid id="patron_edit_contact_address_grid" />
-       </groupbox>
-
-       <groupbox id="patron_edit_survey_groupbox">
-               <caption id="patron_edit_survey_caption" label="Required Surveys" />
-               <vbox id="patron_edit_survey_vbox" />
-       </groupbox>
-
-       <groupbox id="patron_edit_stat_cat_groupbox">
-               <caption id="patron_edit_stat_cat_caption" label="Statistical Categories" />
-               <grid id="patron_edit_stat_cat_grid">
-                       <columns id="pescg_columns">
-                               <column id="pescg_c1"/>
-                               <column id="pescg_c2" flex="1"/>
-                       </columns>
-                       <rows id="pescg_rows"/>
-               </grid>
-       </groupbox>
-
-       <grid id="patron_edit_system_grid" flex="1">
-               <columns id="patron_edit_system_columns">
-                       <column id="patron_edit_system_column1"/>
-                       <column id="patron_edit_system_column2"/>
-                       <column id="patron_edit_system_column3"/>
-                       <column id="patron_edit_system_column4"/>
-                       <column id="patron_edit_system_column5"/>
-                       <column id="patron_edit_system_column6"/>
-               </columns>
-               <rows id="patron_edit_system_rows">
-                       <row id="patron_edit_system_row0"/>
-                       <row id="patron_edit_system_row0b"/>
-                       <row id="patron_edit_system_row0a"/>
-                       <row id="patron_edit_system_row1"/>
-                       <row id="patron_edit_system_row2"/>
-                       <row id="patron_edit_system_row2a"/>
-                       <row id="patron_edit_system_row3"/>
-                       <row id="patron_edit_system_row4"/>
-                       <row id="patron_edit_system_row5"/>
-                       <row id="patron_edit_system_row5a"/>
-                       <row id="patron_edit_system_row6"/>
-                       <row id="patron_edit_system_row7"/>
-                       <row id="patron_edit_system_row8"/>
-               </rows>
-       </grid>
-
-       <row id="patron_edit_system_row0">
-               <label id="patron_edit_system_barcode_label" value="Barcode"/>  
-               <hbox id="patron_edit_system_barcode_box">
-                       <textbox id="patron_edit_system_barcode_textbox" size="20"/>    
-                       <button id="patron_new_card_button" label="New" hidden="true"/>
-               </hbox>
-               <label id="patron_edit_system_profile_label" value="Profile"/>  
-               <menulist id="patron_edit_system_profile_menulist"/>    
-       </row>
-
-       <row id="patron_edit_system_row0b">
-               <label id="patron_edit_system_usrname_label" value="Login Name"/>       
-               <hbox id="patron_edit_system_usrname_box">
-                       <textbox id="patron_edit_system_usrname_textbox" size="20"/>    
-               </hbox>
-               <label id="patron_edit_system_disable_label" value="Disable"/>  
-               <checkbox id="patron_edit_system_disable_checkbox"/>    
-       </row>
-
-       <row id="patron_edit_system_row0a">
-               <separator id="patron_edit_system_row0a_separator"/>
-       </row>
-
-       <row id="patron_edit_system_row1">
-               <label id="patron_edit_system_family_name_label" value="Last Name"/>    
-               <textbox id="patron_edit_system_family_name_textbox" size="20"/>        
-               <label id="patron_edit_system_first_given_name_label" value="First"/>   
-               <textbox id="patron_edit_system_first_given_name_textbox" size="10"/>   
-               <label id="patron_edit_system_second_given_name_label" value="Middle"/> 
-               <textbox id="patron_edit_system_second_given_name_textbox" size="5"/>   
-       </row>
-
-       <row id="patron_edit_system_row2">
-               <label id="patron_edit_system_prefix_label" value="Prefix"/>    
-               <menulist id="patron_edit_system_prefix_menulist"/>
-               <label id="patron_edit_system_suffix_label" value="Suffix"/>    
-               <menulist id="patron_edit_system_suffix_menulist"/>
-       </row>
-
-       <row id="patron_edit_system_row2a">
-               <separator id="patron_edit_system_row2a_separator"/>
-       </row>
-
-       <row id="patron_edit_system_row3">
-               <label id="patron_edit_system_id1value_label" value="ID #1:"/>  
-               <textbox id="patron_edit_system_id1value_textbox" size="20"/>
-               <label id="patron_edit_system_id1type_label" value="Type"/>     
-               <menulist id="patron_edit_system_id1type_menulist"/>
-       </row>
-
-       <row id="patron_edit_system_row4">
-               <label id="patron_edit_system_id2value_label" value="ID #2:"/>  
-               <textbox id="patron_edit_system_id2value_textbox" size="20"/>
-               <label id="patron_edit_system_id2type_label" value="Type"/>     
-               <menulist id="patron_edit_system_id2type_menulist"/>
-       </row>
-
-       <row id="patron_edit_system_row5">
-               <label id="patron_edit_system_dob_label" value="DOB:"/> 
-               <textbox id="patron_edit_system_dob_textbox" size="20"/>
-       </row>
-
-       <row id="patron_edit_system_row5a">
-               <separator id="patron_edit_system_row5a_separator"/>
-       </row>
-
-       <row id="patron_edit_system_row6">
-               <label id="patron_edit_system_new_passwd_label" value="New Password:"/> 
-               <textbox id="patron_edit_system_new_passwd_textbox" value="UNCHANGED" size="20"/>
-       </row>
-
-       <row id="patron_edit_system_row7">
-               <separator id="patron_edit_system_row7_separator"/>
-       </row>
-
-       <row id="patron_edit_system_row8">
-               <label id="patron_edit_system_alert_message_label" value="Alert Message:"/>     
-               <textbox id="patron_edit_system_alert_message_textbox" value="" multiline="true" rows="5"/>
-       </row>
-
-       <menulist id="patron_edit_system_id1type_menulist">
-               <menupopup id="patron_edit_system_id1type_menupopup">
-               </menupopup>
-       </menulist>
-
-       <menulist id="patron_edit_system_id2type_menulist">
-               <menupopup id="patron_edit_system_id2type_menupopup">
-               </menupopup>
-       </menulist>
-
-       <menulist id="patron_edit_system_prefix_menulist">
-               <menupopup id="patron_edit_system_prefix_menupopup">
-               </menupopup>
-       </menulist>
-
-       <menulist id="patron_edit_system_suffix_menulist">
-               <menupopup id="patron_edit_system_suffix_menupopup">
-               </menupopup>
-       </menulist>
-       
-       <menulist id="patron_edit_system_profile_menulist">
-               <menupopup id="patron_edit_system_profile_menupopup">
-               </menupopup>
-       </menulist>
-       
-       <menulist id="patron_edit_system_library_menulist">
-               <menupopup id="patron_edit_system_library_menupopup">
-               </menupopup>
-       </menulist>
-
-       <grid id="patron_edit_contact_phone_grid" flex="0">
-               <columns id="patron_edit_contact_phone_columns">
-                       <column id="patron_edit_contact_phone_column1"/>
-                       <column id="patron_edit_contact_phone_column2"/>
-                       <column id="patron_edit_contact_phone_column3"/>
-                       <column id="patron_edit_contact_phone_column4"/>
-               </columns>
-               <rows id="patron_edit_phone_rows">
-                       <row id="patron_edit_phone_row0a"/>
-                       <row id="patron_edit_phone_row0"/>
-                       <row id="patron_edit_phone_row1"/>
-                       <row id="patron_edit_phone_row2"/>
-               </rows>
-
-       </grid>
-
-       <row id="patron_edit_phone_row0a">
-               <label id="patron_edit_contact_email_label" value="Email"/>
-               <textbox id="patron_edit_contact_email_textbox"  size="20"/>
-               <label id="patron_edit_contact_email_invalid_label" value="Invalid" command="cmd_broken"/>
-               <checkbox id="patron_edit_contact_email_invalid_checkbox" />
-       </row>
-       <row id="patron_edit_phone_row0">
-               <label id="patron_edit_contact_dayphone_label" value="Day Phone"/>
-               <textbox id="patron_edit_contact_dayphone_textbox"  size="20"/>
-               <label id="patron_edit_contact_dayphone_invalid_label" value="Invalid" command="cmd_broken"/>
-               <checkbox id="patron_edit_contact_dayphone_invalid_checkbox" />
-       </row>
-       <row id="patron_edit_phone_row1">
-               <label id="patron_edit_contact_eveningphone_label" value="Evening Phone"/>
-               <textbox id="patron_edit_contact_eveningphone_textbox"  size="20"/>
-               <label id="patron_edit_contact_eveningphone_invalid_label" value="Invalid" command="cmd_broken"/>
-               <checkbox id="patron_edit_contact_eveningphone_invalid_checkbox" />
-       </row>
-       <row id="patron_edit_phone_row2">
-               <label id="patron_edit_contact_otherphone_label" value="Other Phone"/>
-               <textbox id="patron_edit_contact_otherphone_textbox" size="20"/>
-               <label id="patron_edit_contact_otherphone_invalid_label" value="Invalid" command="cmd_broken"/>
-               <checkbox id="patron_edit_contact_otherphone_invalid_checkbox" />
-       </row>
-       
-       <grid id="patron_edit_contact_address_grid" flex="0">
-               <columns id="patron_edit_contact_address_columns">
-                       <column id="patron_edit_contact_address_column1"/>
-                       <column id="patron_edit_contact_address_column2"/>
-               </columns>
-               <rows id="patron_edit_address_rows"/>
-       </grid>
-
-</overlay>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_holds.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_holds.js
deleted file mode 100644 (file)
index c6b84ee..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-sdump('D_TRACE','Loading patron_holds.js\n');
-
-function patron_holds_init(p) {
-       sdump('D_PATRON_HOLDS',"TESTING: patron_holds.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.patron_holds_cols = hold_cols();
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_holds_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
-       p.add_patron_holds = p.paged_tree.add_rows;
-       p.clear_patron_holds = p.paged_tree.clear_tree;
-
-       p.register_patron_holds_select_callback = function (f) {
-               sdump('D_PATRON_HOLDS','p.register_patron_holds_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_patron_holds_function = function (f) {
-               sdump('D_PATRON_HOLDS','p.register_flesh_patron_holds_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_item_context_builder = function (f) {
-               sdump('D_PATRON_HOLDS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_patron_holds_to_cols = function (patron_holds, treeitem) {
-               sdump('D_PATRON_HOLDS','p.map_patron_holds_to_cols( ' + patron_holds + ',' + treeitem + ')\n');
-               patron_holds_tree_map_patron_holds_to_cols(p, patron_holds, treeitem);  
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_holds_tree_map_patron_holds_to_cols(p, patron_hold, treeitem) {
-       sdump('D_PATRON_HOLDS',arg_dump(arguments,{1:true}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-
-       var app; var method;
-       switch(patron_hold.hold_type()) {
-               case 'M': app = 'open-ils.search'; method = 'open-ils.search.biblio.metarecord.mods_slim.retrieve'; break;
-               default : app = 'open-ils.search'; method = 'open-ils.search.biblio.record.mods_slim.retrieve'; break;
-       }
-
-       user_request(
-               app,
-               method,
-               [ patron_hold.target() ],
-               function (request) {                    
-                       var mvr = request.getResultObject();
-                       var cols = new Array();
-                       for (var i = 0; i < p.patron_holds_cols.length; i++) {
-                               var hash = p.patron_holds_cols[i];
-                               sdump('D_PATRON_HOLDS','Considering ' + js2JSON(hash) + '\n');
-                               var obj_string = 'patron_hold';
-                               switch( hash.fm_class ) {
-                                       case 'mvr' : obj_string = 'mvr'; break;
-                               }
-                               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-                               sdump('D_PATRON_HOLDS','cmd = ' + cmd + '\n');
-                               var col = '';
-                               try {
-                                       col = eval( cmd );
-                                       sdump('D_PATRON_HOLDS','eval = ' + col + '\n');
-                               } catch(E) {
-                                       sdump('D_ERROR',js2JSON(E) + '\n');
-                               }
-                               cols.push( col );
-                       }
-                       sdump('D_PATRON_HOLDS','cols = ' + js2JSON(cols) + '\n');
-                       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-               }
-       );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_items.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_items.js
deleted file mode 100644 (file)
index 51d81ea..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-sdump('D_TRACE','Loading patron_items.js\n');
-
-function patron_items_init(p) {
-       sdump('D_PATRON_ITEMS',"TESTING: patron_items.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.patron_items_cols = circ_cols();
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_items_cols, 'hide_nav' : true, 'hits_per_page' : '9999', 'debug' : p.app } );
-       p.add_patron_items = p.paged_tree.add_rows;
-       p.clear_patron_items = p.paged_tree.clear_tree;
-
-       p.register_patron_items_select_callback = function (f) {
-               sdump('D_PATRON_ITEMS','p.register_patron_items_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_patron_items_function = function (f) {
-               sdump('D_PATRON_ITEMS','p.register_flesh_patron_items_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_item_context_builder = function (f) {
-               sdump('D_PATRON_ITEMS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_patron_items_to_cols = function (patron_items, treeitem) {
-               sdump('D_PATRON_ITEMS','p.map_patron_items_to_cols( ' + patron_items + ',' + treeitem + ')\n');
-               patron_items_tree_map_patron_items_to_cols(p, patron_items, treeitem);  
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_items_tree_map_patron_items_to_cols(p, patron_items, treeitem) {
-       sdump('D_PATRON_ITEMS',arg_dump(arguments,{1:true}));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var cols = new Array();
-       for (var i = 0; i < p.patron_items_cols.length; i++) {
-               var hash = p.patron_items_cols[i];
-               sdump('D_PATRON_ITEMS','Considering ' + js2JSON(hash) + '\n');
-               var obj_string;
-               switch( hash.fm_class ) {
-                       case 'acp' : obj_string = 'patron_items.copy'; break;
-                       case 'circ' : obj_string = 'patron_items.circ'; break;
-                       case 'mvr' : obj_string = 'patron_items.record'; break;
-               }
-               var cmd = parse_render_string( obj_string, hash.fm_field_render );
-               sdump('D_PATRON_ITEMS','cmd = ' + cmd + '\n');
-               var col = '';
-               try {
-                       col = eval( cmd );
-                       sdump('D_PATRON_ITEMS','eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-               cols.push( col );
-       }
-       sdump('D_PATRON_ITEMS','cols = ' + js2JSON(cols) + '\n');
-       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_new_legacy.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_new_legacy.xul
deleted file mode 100644 (file)
index 7542866..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/patron.css" type="text/css"?>
-
-<page id="patron_new_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="try {
-                       window.patron_save_callback = function patron_save_callback(p) { 
-                               mw.spawn_patron_display(parent.document, 'replace_tab', 'main_tabbox', { 'patron' : p.au });
-                       };
-                       patron_init(); patron_new_init(); patron_edit_init();
-               } catch(E) {
-                       alert('onload patron_new_win: ' + E);
-               }
-       "
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>
-               dump('patron_new_win\n');
-       </script>
-
-       <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
-       <!-- Initial Overlays for this XUL file -->
-       <!--
-       <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_bundle.xul"?>
-       -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_edit_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <script src="chrome://evergreen/content/patron/patron_edit_legacy.js"/>
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="patron_edit_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.js
deleted file mode 100644 (file)
index b2f3845..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-sdump('D_TRACE','Loading patron_search.js\n');
-
-var test_variable = false;
-
-function patron_search_init(p) {
-       sdump('D_PATRON_SEARCH',"TESTING: patron_search.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       /* gives: p.clamshell, p.right_panel, p.left_panel */
-       patron_search_clamshell_init(p);
-
-       /* gives: p.search_form */
-       patron_search_patron_search_form_init(p);
-
-       /* gives: p.search_results */
-       patron_search_patron_search_results_init(p);
-
-       p.crazy_search = function (crazy_search_hash) {
-               return patron_search( crazy_search_hash );
-       };
-
-       p.retrieve_button = p.w.document.getElementById('PatronSearch_retrieve_button');
-       p.retrieve_button.addEventListener(
-               'command',
-               function (ev) {
-                       spawn_patron_display(
-                               p.w.app_shell,'new_tab','main_tabbox',
-                               {
-                                       'patron' : retrieve_patron_by_id(
-                                               p._patron.id()
-                                       )
-                               }
-                       );
-               }
-               ,false
-       );
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return;
-}
-
-function patron_search_clamshell_init(p) {
-       p.clamshell = clam_shell_init( { 'w' : p.w, 'node' : p.clamshell_node, 'debug' : p.app } );
-       p.left_panel = p.clamshell.first_deck;
-       p.right_panel = p.clamshell.second_deck;
-}
-
-function patron_search_patron_search_form_init(p) {
-       p.search_form = patron_search_form_init( { 'w' : p.w, 'node' : p.patron_search_form_node, 'debug' : p.ap } );
-       p.search_form.register_search_callback(
-               function (ev) {
-                       sdump('D_PATRON_SEARCH','Submitted: ' + js2JSON(p.search_form.crazy_search_hash) + '\n');
-                       if (p.crazy_search) {
-                               p.search_results.clear_patrons();
-                               p.search_results.add_patrons(
-                                       p.crazy_search( p.search_form.crazy_search_hash )
-                               );
-                               p.search_results.paged_tree.tree.view.selection.select( 0 );
-                               p.search_results.paged_tree.tree.focus();
-                       }
-               }
-       );
-}
-
-function patron_search_patron_search_results_init(p) {
-       p.search_results = patron_search_results_init( { 'w' : p.w, 'node' : p.patron_search_results_node, 'popupset_node' : p.popupset_node, 'debug' : p.app } );
-
-       p.redraw_search_results = function() {
-               p.search_results.clear_search_results();
-               if (!p._patron.checkouts()) patron_get_checkouts( p._patron );
-               for (var i = 0; i < p._patron.checkouts().length; i++) {
-                       p.search_results.add_search_results( [ i ] );
-               }
-       }
-
-       var patron_select_async_count = 0;
-
-       function gen_patron_select_async_function(count) {
-               return function (request) {
-                       /* Set new patron */
-                       if (count == patron_select_async_count) {
-
-                               p._patron = request.getResultObject();
-
-                               patron_get_checkouts( p._patron, function(req) {
-       
-                                       if (count == patron_select_async_count) {
-
-                                               p._patron.checkouts( req.getResultObject() );
-
-                                               patron_get_holds( p._patron, function(req) {
-
-                                                       if (count == patron_select_async_count) {
-
-                                                               p._patron.hold_requests( req.getResultObject() );
-                                                               
-                                                               patron_get_bills( p._patron, function(req) {
-
-                                                                       if (count == patron_select_async_count) {
-
-                                                                               p._patron.bills = req.getResultObject();
-                                                                               render_fm(p.w.document,{'au':p._patron});
-                                                                               p.retrieve_button.disabled = false;
-                                                                       }
-                                                               });
-                                                       }
-                                               });
-                                       }
-                               });     
-                       };
-               };
-       }
-
-       p.search_results.register_patron_select_callback(
-               function (ev) {
-                       sdump('D_PATRON_SEARCH','Firing patron_select_callback\n');
-                       p.retrieve_button.disabled = true; 
-                       try {
-                               /* Get selection */
-                               var patrons = get_list_from_tree_selection( p.search_results.paged_tree.tree );
-                               /* Clear Current Patron */
-                               p._patron = fake_patron();
-                               render_fm( p.w.document, { 'au' : p._patron } );
-                               /* Get patron and render status */
-                               retrieve_patron_by_id( 
-                                       patrons[ patrons.length - 1 ].getAttribute('record_id'),
-                                       gen_patron_select_async_function( ++patron_select_async_count )
-                               );
-                       } catch(E) {
-                               sdump('D_ERROR_EXPECTED',js2JSON(E) + '\n');
-                       }
-               }
-       );
-       p.search_results.register_flesh_patron_function(
-               function (treeitem) {
-                       sdump('D_PATRON_SEARCH','Firing flesh_patron_function\n');
-                       var record_id = treeitem.getAttribute('record_id'); 
-                       retrieve_patron_by_id( 
-                               record_id, 
-                               function (request) {
-                                       sdump('D_PATRON_SEARCH','flesh_patron callback\n');
-                                       try {
-                                               var patron = request.getResultObject();
-                                               sdump('D_PATRON_SEARCH','patron = ' + js2JSON( patron ) + '\n');
-                                               try {
-                                                       p.search_results.map_patron_to_cols( patron, treeitem );
-                                               } catch(E) {
-                                                       sdump('D_ERROR','map in flesh_patron callback\n' + E+ '\n');
-                                               }
-                                       } catch(E) {
-                                               sdump('D_ERROR','flesh_patron callback\n' + E+ '\n');
-                                       }
-                                       sdump('D_PATRON_SEARCH','leaving flesh_patron callback\n');
-                               }
-                       );
-               }
-       );
-       p.search_results.register_context_builder(
-               function (ev) {
-                       sdump('D_PATRON_DISPLAY','Firing context_builder\n');
-                       empty_widget(p.search_results.paged_tree.popup);
-                       var search_results = get_list_from_tree_selection( p.search_results.paged_tree.tree );
-                       var menuitem;
-
-                       /*** PATRON DISPLAY ***/
-                       menuitem = p.search_results.paged_tree.w.document.createElement('menuitem');
-                       p.search_results.paged_tree.popup.appendChild( menuitem );
-                       menuitem.setAttribute('label',getString('patron.context_display'));
-                       menuitem.addEventListener(
-                               'command',
-                               function (ev) {
-                                       sdump('D_PATRON_DISPLAY','Firing renew context\n');
-                                       for (var i = 0; i < search_results.length; i++) {
-                                               spawn_patron_display(
-                                                       p.w.app_shell,'new_tab','main_tabbox',
-                                                       {
-                                                               'patron' : retrieve_patron_by_id(
-                                                                       search_results[i].getAttribute('record_id')
-                                                               )
-                                                       }
-                                               );
-                                       }
-                               },
-                               false
-                       );
-               }
-       );
-}
-
-function patron_search(crazy_search_hash) {
-       sdump('D_PATRON_SEARCH',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var result = [];
-       try {
-               result = user_request(
-                       'open-ils.actor',
-                       'open-ils.actor.patron.search.advanced',
-                       [ G.auth_ses[0], crazy_search_hash ]
-               )[0];
-               sdump('D_PATRON_SEARCH','result.length = ' + result.length + '\n');
-       } catch(E) {
-               handle_error(E);
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return result;
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search.xul
deleted file mode 100644 (file)
index 4625fb9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!-- Clamlication: Evergreen Staff Client -->
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/patron_search.dtd">
-
-<page id="patron_search_win"
-       orient="vertical" style="overflow: auto" width="800" height="500"
-       sizemode="maximized" persist="width height" 
-       onload="params.w = window;
-               params.app = 'PatronSearch'; 
-               params.clamshell_node = document.getElementById('ClamShell_main'); 
-               params.patron_search_form_node = document.getElementById('PatronSearchForm_main');
-               params.patron_search_results_node = document.getElementById('PatronSearchResults_main');
-               mw.focus_widget( document, 'pst1' );
-               mw.OpenILS_init(params);"
-       onunload="mw.OpenILS_exit(params);"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_search.xul\n');</script>
-
-       <!-- Stylesheets -->
-       <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-       <?xml-stylesheet href="chrome://evergreen/skin/patron_search.css" type="text/css"?>
-       
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_search_overlay.xul"?>
-
-       <!-- XUL'ified abstraction for logic to attach to widgets -->
-       <commandset id="universal_cmds" />
-
-       <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-       <keyset id="PatronSearch_keys" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <box id="PatronSearch_main" class="my_overflow" />
-
-       <popupset id="universal_popupset" />
-
-</page>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form.js
deleted file mode 100644 (file)
index 6b1fdf5..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-sdump('D_TRACE','Loading patron_search_form.js\n');
-
-function patron_search_form_init(p) {
-       sdump('D_PATRON_SEARCH_FORM',"TESTING: patron_search_form.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_CONSTRUCTOR',arg_dump(arguments));
-
-       p.crazy_search_hash = {}; // hash[ field ] = { 'value' : ???, 'group' : ??? }
-
-       var search_button = p.node.getElementsByAttribute('name','button_search')[0];
-       var clear_button = p.node.getElementsByAttribute('name','button_clear')[0];
-
-       var nl = p.node.getElementsByTagName('textbox');
-       for (var i = 0; i < nl.length; i++) {
-               nl[i].addEventListener(
-                       'change',
-                       function (ev) {
-                               return patron_search_form_textbox_handler(
-                                       ev.target,
-                                       p.crazy_search_hash
-                               ); 
-                       },false
-               );
-               nl[i].addEventListener(
-                       'keypress',
-                       function (ev) {
-                               patron_search_form_textbox_handler( ev.target, p.crazy_search_hash );
-                               if ((ev.keyCode == 13)||(ev.keyCode == 77)) search_button.doCommand();
-                       }, false
-               );
-       }
-
-       p.register_search_callback = function (f) { search_button.addEventListener( 'command',f,false ); };
-
-       if (clear_button) {
-               clear_button.addEventListener(
-                       'command',
-                       function (ev) {
-                               var nl = p.node.getElementsByTagName('textbox');
-                               for (var i = 0; i < nl.length; i++) 
-                                       nl[i].value = '';
-                               p.crazy_search_hash = {}; 
-                       },false
-               );
-       } else {
-               sdump('D_PATRON_SEARCH_FORM',"No name=button_clear element.\n");
-       }
-
-       return p;
-}
-
-function patron_search_form_textbox_handler(textbox,search_hash) {
-       sdump('D_PATRON_SEARCH_FORM',arg_dump(arguments));
-       var field = textbox.getAttribute('field');
-       var group = textbox.getAttribute('group');
-       var value = textbox.value;
-       search_hash[ field ] = { 'value' : value, 'group' : group };
-       try {
-               if (value==''||value==null||value==undefined) delete(search_hash[ field ]);
-       } catch(E) {
-               sdump('D_ERROR',E);
-       }
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_form_overlay.xul
deleted file mode 100644 (file)
index 99065fe..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_search_form.dtd">
-<overlay id="patron_search_form_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_search_form_overlay.xul\n');</script>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_search_form -->
-<box id="PatronSearchForm_main" orient="vertical">
-       <box id="PatronSearchForm_insert1"/>
-       <groupbox id="psgf_gb">
-               <caption id="psgf_gbc" label='&patron_search_form.caption;' />
-               <box id="PatronSearchForm_insert2"/>
-               <grid id="psg" />
-               <box id="PatronSearchForm_insert3"/>
-       </groupbox>
-       <box id="PatronSearchForm_insert4"/>
-</box>
-
-<!-- group 0 = user  group 1 = address  group 2 = phone, ident -->
-
-<grid id="psg">
-       <columns id="psc">
-               <column id="psc1"/>
-               <column id="psc2" flex="1"/>
-       </columns>
-       <rows id="psr">
-               <row id="psr1">
-                       <label id="psl1" control="pst1" value="&patron_search_form.family_name.label;" accesskey="&patron_search_form.family_name.accesskey;"/>
-                       <textbox id="pst1" field="family_name" group="0"/>
-               </row>
-               <row id="psr2">
-                       <label id="psl2" control="pst2" value="&patron_search_form.first_given_name.label;" accesskey="&patron_search_form.first_given_name.accesskey;"/>
-                       <textbox id="pst2" field="first_given_name" group="0"/>
-               </row>
-               <row id="psr3">
-                       <label id="psl3" control="pst3" value="&patron_search_form.second_given_name.label;" accesskey="&patron_search_form.second_given_name.accesskey;"/>
-                       <textbox id="pst3" field="second_given_name" group="0"/>
-               </row>
-               <row id="psr4">
-                       <label id="psl4" control="pst4" value="&patron_search_form.email.label;" accesskey="&patron_search_form.email.accesskey;"/>
-                       <textbox id="pst4" field="email" group="0"/>
-               </row>
-               <row id="psr5">
-                       <label id="psl5" control="pst5" value="&patron_search_form.phone.label;" accesskey="&patron_search_form.phone.accesskey;"/>
-                       <textbox id="pst5" field="phone" group="2"/>
-               </row>
-               <row id="psr6">
-                       <label id="psl6" control="pst6" value="&patron_search_form.ident.label;" accesskey="&patron_search_form.ident.accesskey;"/>
-                       <textbox id="pst6" field="ident" group="2"/>
-               </row>
-               <row id="psr6a">
-                       <label id="psl6a" value=" "/>
-               </row>
-               <row id="psr7">
-                       <label id="psl7" control="pst7" value="&patron_search_form.street1.label;" accesskey="&patron_search_form.street1.accesskey;"/>
-                       <textbox id="pst7" field="street1" group="1"/>
-               </row>
-               <row id="psr8">
-                       <label id="psl8" control="pst8" value="&patron_search_form.street2.label;" accesskey="&patron_search_form.street2.accesskey;"/>
-                       <textbox id="pst8" field="street2" group="1"/>
-               </row>
-               <row id="psr9">
-                       <label id="psl9" control="pst9" value="&patron_search_form.city.label;" accesskey="&patron_search_form.city.accesskey;"/>
-                       <textbox id="pst9" field="city" group="1"/>
-               </row>
-               <row id="psr10">
-                       <label id="psl10" control="pst10" value="&patron_search_form.state.label;" accesskey="&patron_search_form.state.accesskey;"/>
-                       <textbox id="pst10" field="state" group="1"/>
-               </row>
-               <row id="psr11">
-                       <label id="psl11" control="pst11" value="&patron_search_form.post_code.label;" accesskey="&patron_search_form.post_code.accesskey;"/>
-                       <textbox id="pst11" field="post_code" group="1"/>
-               </row>
-               <row id="psr12">
-                       <spacer id="pss12"/>
-                       <button id="psb12" label="&patron_search_form.search.label;" accesskey="&patron_search_form.search.accesskey;" name="button_search"/>
-               </row>
-               <row id="psr13">
-                       <spacer id="pss13"/>
-                       <button id="psb13" label="&patron_search_form.clear.label;" accesskey="&patron_search_form.clear.accesskey;" name="button_clear"/>
-               </row>
-       </rows>
-</grid>
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronSearchForm_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_overlay.xul
deleted file mode 100644 (file)
index d361521..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/patron_display.dtd">
-<overlay id="patron_search_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading patron_search_overlay.xul\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/main/clam_shell_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_display_status_overlay.xul"?> 
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_search_form_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/patron/patron_search_results_overlay.xul"?>
-
-<commandset id="universal_cmds">
-
-       <command id="cmd_broken" oncommand="
-               alert('Not Yet Implemented'); "/>
-
-</commandset>
-
-<!-- main widget for patron_search -->
-<box id="PatronSearch_main" flex="1" orient="vertical">
-       <box id="ClamShell_main" />
-</box>
-
-<deck id="ClamShell_first_deck" flex="0">
-       <vbox id="psm_left" flex="1">
-               <box id="PatronSearchForm_main" flex="0"/>
-               <box id="PatronDisplayStatus_main" flex="0"/>
-               <spacer id="psm_left_s1" flex="1"/>
-       </vbox>
-</deck>
-
-<deck id="ClamShell_second_deck" flex="1">
-       <box id="PatronSearchResults_main"/>
-</deck>
-
-<hbox id="PatronDisplayStatus_insert2">
-       <label id="PatronSearch_patron_name" class="patronNameMedium"
-               tooltiptext="&patron_display.name.label;"
-               value=" "
-               render="true" fm_class="au" 
-               render_value="patron_get_full_name($$)" />
-</hbox>
-<hbox id="PatronDisplayStatus_insert4">
-       <button id="PatronSearch_retrieve_button" 
-               disabled="true"
-               label="&patron_navbar.retrieve;" 
-               accesskey="&patron_navbar.retrieve.accesskey;"/>
-</hbox>
-
-
-<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
-<keyset id="PatronSearch_keys">
-</keyset>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_results.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_search_results.js
deleted file mode 100644 (file)
index b36515d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-sdump('D_TRACE','Loading patron_search_results.js\n');
-
-function patron_search_results_init(p) {
-       sdump('D_PATRON_SEARCH_RESULTS',"TESTING: patron_search_results.js: " + mw.G['main_test_variable'] + '\n');
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-
-       p.patron_cols = [
-               { 
-                       'active' : 'id_col', 'label' : getString('au_label_active'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : 'yesno( $$.active() )'
-               },
-               { 
-                       'id' : 'id_col', 'label' : getString('au_label_id'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.id()'
-               },
-               { 
-                       'id' : 'prefix_col', 'label' : getString('au_label_prefix'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.prefix()'
-               },
-               { 
-                       'id' : 'family_name_col', 'label' : getString('au_label_family_name'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.family_name()'
-               },
-               { 
-                       'id' : 'first_given_name_col', 'label' : getString('au_label_first_given_name'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.first_given_name()'
-               },
-               { 
-                       'id' : 'second_given_name_col', 'label' : getString('au_label_second_given_name'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.second_given_name()'
-               },
-               { 
-                       'id' : 'suffix_col', 'label' : getString('au_label_suffix'), 'flex' : 1, 
-                       'primary' : false, 'hidden' : false, 'fm_field_render' : '.suffix()'
-               }
-       ];
-
-       p.paged_tree = paged_tree_init( { 'w' : p.w, 'node' : p.node, 'cols' : p.patron_cols, 'debug' : p.app } );
-       p.add_patrons = p.paged_tree.add_rows;
-       p.clear_patrons = p.paged_tree.clear_tree;
-
-       p.register_patron_select_callback = function (f) {
-               sdump('D_PATRON_SEARCH_RESULTS','p.register_patron_select_callback(' + f + ')\n');
-               p.paged_tree.register_select_callback( f );
-       }
-
-       p.register_flesh_patron_function = function (f) {
-               sdump('D_PATRON_SEARCH_RESULTS','p.register_flesh_patron_function(' + f + ')\n');
-               p.paged_tree.register_flesh_row_function( f );
-       }
-
-       p.register_context_builder = function (f) {
-               sdump('D_PATRON_SEARCH_RESULTS','p.register_context_builder(' + f + ')\n');
-               p.paged_tree.register_context_builder( f );
-       }
-
-       p.map_patron_to_cols = function (patron, treeitem) {
-               sdump('D_PATRON_SEARCH_RESULTS','p.map_patron_to_cols(' + patron + ',' + treeitem + ')\n');
-               patron_search_results_map_patron_to_cols(p, patron, treeitem);  
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-       return p;
-}
-
-function patron_search_results_map_patron_to_cols(p, patron, treeitem) {
-       sdump('D_PATRON_SEARCH_RESULTS',arg_dump(arguments));
-       sdump('D_TRACE_ENTER',arg_dump(arguments));
-       var cols = new Array();
-       for (var i = 0; i < p.patron_cols.length; i++) {
-               var hash = p.patron_cols[i];
-               sdump('D_PATRON_SEARCH_RESULTS','Considering ' + js2JSON(hash) + '\n');
-               var cmd = parse_render_string('patron',hash.fm_field_render);
-               sdump('D_PATRON_SEARCH_RESULTS','cmd = ' + cmd + '\n');
-               var col = '';
-               try {
-                       col = eval( cmd );
-                       sdump('D_PATRON_SEARCH_RESULTS','eval = ' + col + '\n');
-               } catch(E) {
-                       sdump('D_ERROR',js2JSON(E) + '\n');
-               }
-               cols.push( col );
-       }
-       sdump('D_PATRON_SEARCH_RESULTS','cols = ' + js2JSON(cols) + '\n');
-       p.paged_tree.map_cols_to_treeitem( cols, treeitem );
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_utils.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_utils.js
deleted file mode 100755 (executable)
index 7c0d7e9..0000000
+++ /dev/null
@@ -1,547 +0,0 @@
-sdump('D_TRACE','Loading patron_utils.js\n');
-
-function fake_patron() {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       var p = new au(); 
-       p.family_name( 'Retrieving' ); 
-       p.checkouts( [] ); 
-       p.hold_requests( [] ); 
-       p.credit_forward_balance('0.00');
-       p.bills = [];
-       return p;
-}
-
-function hold_status_as_text( status ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (typeof(status) == 'object') status = status.status();
-       var text;
-       switch(status) {
-               case "1" : text = getString('holds_status_waiting_for_copy'); break;
-               case "2" : text = getString('holds_status_waiting_for_capture'); break;
-               case "3" : text = getString('holds_status_in_transit'); break;
-               case "4" : text = getString('holds_status_available'); break;
-               default : text = "Eh?"; break;
-       }
-       return text;
-}
-
-function patron_get_full_name( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       var name = '';
-       if (au.prefix()) name += au.prefix() + ' ';     
-       if (au.family_name()) name += au.family_name() + ', ';  
-       if (au.first_given_name()) name += au.first_given_name() + ' '; 
-       if (au.second_given_name()) name += au.second_given_name() + ' ';       
-       if (au.suffix()) name += au.suffix() + ' ';     
-       return name;
-}
-
-function patron_get_barcode( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               if (au && au.card && au.card() ) {
-                       if ( (au.card()!='null') && (typeof(au.card())=='object') ) {
-                               return au.card().barcode();
-                       } else {
-                               return find_id_object_in_list( au.cards(), au.card() ).barcode();
-                       }
-               }
-       } catch(E) {
-               sdump('D_ERROR',E);
-       }
-       return '???';
-}
-
-function patron_get_bills( au, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               var bills = user_request(
-                       'open-ils.actor',
-                       'open-ils.actor.user.transactions.have_balance',
-                       [ mw.G.auth_ses[0], au.id() ],
-                       f
-               )[0];
-
-               if (!f) {
-                       sdump('D_PATRON_UTILS','bills = ' + js2JSON(bills) + '\n');
-                       au.bills = bills;   // FIXME: make bills a virtual field of au
-                       return bills;
-               }
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E) + '\n');
-               return null;
-       }
-
-}
-
-function patron_get_bills_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au.bills == null || au.bills == undefined)
-               return '???';
-       else {
-               return get_bills_total( au.bills );
-       }
-}
-
-function get_bills_total( bills ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       var total = 0;
-       for (var i = 0; i < bills.length; i++) {
-               total += dollars_float_to_cents_integer( bills[i].balance_owed() );
-       }
-       sdump('D_PATRON_UTILS','bills_total $$$ = ' + cents_as_dollars( total ) + '\n');
-       return cents_as_dollars( total );
-}
-
-function patron_get_credit_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       /* FIXME: I can use CSS to style this number as money. */
-       return '$' + au.credit_forward_balance();
-}
-
-function patron_get_checkouts( au, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               var checkouts = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.actor.user.checked_out',
-                       [ mw.G.auth_ses[0], au.id() ],
-                       f
-               )[0];
-
-               if (!f) {
-                       sdump('D_PATRON_UTILS','checkouts = ' + js2JSON(checkouts) + '\n');
-                       if (!checkouts) checkouts = [];
-                       au.checkouts( checkouts );
-                       return checkouts;
-               }
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E) + '\n');
-               return null;
-       }
-}
-
-function patron_get_checkouts_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au.checkouts() == null)
-               return '???';
-       else
-               return au.checkouts().length;
-}
-
-// Need an API call or virtual field to determine this
-function patron_get_checkouts_overdue_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (! au.checkouts()) patron_get_checkouts( au );
-       var total = 0;
-       if ( (au.checkouts() != null) && (typeof(au.checkouts())=='object') ) {
-               for (var i = 0; i < au.checkouts().length; i++) {
-                       var item = au.checkouts()[i];
-                       var due_date = item.circ.due_date();
-                       due_date = due_date.substr(0,4) + due_date.substr(5,2) + due_date.substr(8,2);
-                       var today = formatted_date( new Date() , '%Y%m%d' );
-                       if (today > due_date) total++;
-               }
-       }
-       sdump('D_PATRON_UTILS','\toverdue = ' + total + '\n');
-       return total;
-}
-
-function patron_get_holds( au, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               var hold_requests = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.holds.retrieve',
-                       [ mw.G.auth_ses[0], au.id() ],
-                       f
-               )[0];
-
-               if (!f) {
-                       sdump('D_PATRON_UTILS','holds = ' + js2JSON(au.hold_requests()) + '\n');
-                       au.hold_requests( hold_requests );
-                       return hold_requests;
-               }
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E) + '\n');
-               return null;
-       }
-}
-
-function patron_get_holds_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au.hold_requests() == null)
-               return '???';
-       else
-               return au.hold_requests().length;
-}
-
-function patron_get_hold_status( hold, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               var status = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.hold.status.retrieve',
-                       [ mw.G.auth_ses[0], hold.id() ],
-                       f
-               )[0];
-
-               if (!f) {
-                       sdump('D_PATRON_UTILS','status = ' + status + '\n');
-                       hold.status( status );
-                       return status;
-               }
-       } catch(E) {
-               sdump('D_ERROR',js2JSON(E) + '\n');
-               return null;
-       }
-}
-
-function patron_get_holds_available_total( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       var total = 0;
-       if ( (au.hold_requests() != null) && (typeof(au.hold_requests()) == 'object') ) {
-               for (var i = 0; i < au.hold_requests().length; i++) {
-                       var hold = au.hold_requests()[i];
-                       if (hold.capture_time()) total++;
-               }
-       }
-       sdump('D_PATRON_UTILS','\tavailable = ' + total + '\n');
-       return total;
-}
-
-function patron_get_home_ou_name( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au && 
-               au.home_ou && 
-               au.home_ou() && 
-               mw.G.org_tree_hash &&
-               mw.G.org_tree_hash[ au.home_ou() ] && 
-               mw.G.org_tree_hash[ au.home_ou() ].name &&
-               mw.G.org_tree_hash[ au.home_ou() ].name()
-       ) {
-               return mw.G.org_tree_hash[ au.home_ou() ].name();
-       } else {
-               return null;
-       }
-}
-
-function patron_get_ident1_type_as_text( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au && 
-               au.ident_type && 
-               au.ident_type() && 
-               mw.G.cit_hash &&
-               mw.G.cit_hash[ au.ident_type() ] && 
-               mw.G.cit_hash[ au.ident_type() ].name &&
-               mw.G.cit_hash[ au.ident_type() ].name()
-       ) {
-               return mw.G.cit_hash[ au.ident_type() ].name();
-       } else {
-               return null;
-       }
-}
-
-function patron_get_ident2_type_as_text( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au && 
-               au.ident_type2 && 
-               au.ident_type2() && 
-               mw.G.cit_hash &&
-               mw.G.cit_hash[ au.ident_type2() ] && 
-               mw.G.cit_hash[ au.ident_type2() ].name &&
-               mw.G.cit_hash[ au.ident_type2() ].name()
-       ) {
-               return mw.G.cit_hash[ au.ident_type2() ].name();
-       } else {
-               return null;
-       }
-}
-
-function patron_get_profile_as_text( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au && 
-               au.profile && 
-               au.profile() && 
-               mw.G.ap_hash &&
-               mw.G.ap_hash[ au.profile() ] && 
-               mw.G.ap_hash[ au.profile() ].name &&
-               mw.G.ap_hash[ au.profile() ].name()
-       ) {
-               return mw.G.ap_hash[ au.profile() ].name();
-       } else {
-               return null;
-       }
-}
-
-function patron_get_standing_as_text( au ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (au && 
-               au.standing && 
-               au.standing() && 
-               mw.G.cst_hash &&
-               mw.G.cst_hash[ au.standing() ] && 
-               mw.G.cst_hash[ au.standing() ].value &&
-               mw.G.cst_hash[ au.standing() ].value()
-       ) {
-               return mw.G.cst_hash[ au.standing() ].value();
-       } else {
-               return null;
-       }
-}
-
-function patron_get_standing_css_style( value ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments,{0:true}));
-       switch(value) {
-               case 'Good' : case '1' : return 'background-color: lightgreen;'; break;
-               case 'Barred' : case '2' : return 'background-color: yellow;'; break;
-               case 'Blocked' : case '3' : return 'background-color: red;'; break;
-               default: return 'background-color: white;'; break;
-       }
-}
-
-function patron_pay_bills( payment_blob ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments,{0:true}));
-       try {
-               //alert("Bill's API call goes here.  payment_blob = \n" + pretty_print( js2JSON( payment_blob ) ) + '\n');
-               //alert( 'payment_blob\n' + js2JSON( payment_blob ) );
-               var result = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.money.payment',
-                       [ mw.G.auth_ses[0], payment_blob ]
-               )[0];
-               return true;
-       } catch(E) {
-               handle_error(E);
-               return false;
-       }
-}
-
-function retrieve_patron_by_barcode( barcode, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (!barcode) return null;
-       return user_request( 'open-ils.actor', 'open-ils.actor.user.fleshed.retrieve_by_barcode', [ mw.G.auth_ses[0], barcode ], f )[0];
-}
-
-function retrieve_patron_by_id( id, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       if (!id) return null;
-       return user_request( 'open-ils.actor', 'open-ils.actor.user.fleshed.retrieve', [ mw.G.auth_ses[0], id ], f )[0];
-}
-
-function save_patron( au, f ) {
-       sdump('D_PATRON_UTILS',arg_dump(arguments));
-       try {
-               var result = user_request(
-                       'open-ils.actor',
-                       'open-ils.actor.patron.update',
-                       [ mw.G.auth_ses[0], au ],
-                       f
-               )[0];
-               if (!f) sdump('D_PATRON_UTILS','result = ' + js2JSON(result) + '\n');
-               return result;
-       } catch(E) {
-               handle_error(E);
-               return null;
-       }
-}
-
-function patron_edit_rows() {
-       var rows = [
-{
-       'id' : 'standing', 'label' : getString('au_standing_label'), 'flex' : 1, 'class' : 'pale_violet_red',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cst_hash[ $$.standing() ].value()',
-       'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cst_hash,function(key,value){return [value.value(), key];}),
-       'entry_event' : 'command', 'entry_code' : '{ au.standing( ev.target.value ); }',
-       'rdefault' : '.standing()'
-},
-{
-       'id' : 'alert_message', 'label' : getString('au_alert_message_label'), 'flex' : 1, 'class' : 'pale_violet_red',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.alert_message()',
-       'entry_widget' : 'textbox', 'rdefault' : '.alert_message()',
-       'entry_event' : 'change', 'entry_code' : '{ alert(js2JSON(au)); au.alert_message( ev.target.value ); }'
-},
-{
-       'id' : 'create_date', 'label' : getString('au_create_date_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.create_date()',
-       'entry_widget' : 'textbox', 'entry_widget_attributes' : { 'readonly' : 'true' }, 'rdefault' : '.create_date()',
-       'entry_event' : 'change', 'entry_code' : '{ au.create_date( ev.target.value ); }'
-},
-{
-       'id' : 'expire_date', 'label' : getString('au_expire_date_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.expire_date()',
-       'entry_widget' : 'textbox', 'rdefault' : '.expire_date()',
-       'entry_event' : 'change', 'entry_code' : '{ au.expire_date( ev.target.value ); }'
-},
-{
-       'id' : 'active', 'label' : getString('au_active_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'yesno($$.active())',
-       'entry_widget' : 'menulist', 'populate_with' : { 'Yes' : 1 , 'No' : 0 }, 'rdefault' : '.active()',
-       'entry_event' : 'command', 'entry_code' : '{ au.active( ev.target.value ); }'
-},
-{
-       'id' : 'card', 'label' : getString('au_card_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.card().barcode()',
-       'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'New Card', 'oncommand' : 'alert("test");' },
-       'entry_event' : 'command', 'entry_code' : '{ new_card(au); }'
-},
-{
-       'id' : 'home_ou', 'label' : getString('au_home_ou_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.org_tree_hash[ $$.home_ou() ].shortname()',
-       'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.org_tree_hash,function(key,value){return [value.shortname(), key];}),
-       'entry_event' : 'command', 'entry_code' : '{ au.home_ou( ev.target.value ); }',
-       'rdefault' : '.home_ou()'
-},
-{
-       'id' : 'profile', 'label' : getString('au_profile_label'), 'flex' : 1, 'class' : 'peach_puff',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'ap_hash[ $$.profile() ].name()',
-       'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.ap_hash,function(key,value){return [value.name(), key];}),
-       'entry_event' : 'command', 'entry_code' : '{ au.profile( ev.target.value ); }',
-       'rdefault' : '.profile()'
-},
-{
-       'id' : 'prefix', 'label' : getString('au_prefix_label'), 'flex' : 1, 'class' : 'dark_salmon',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.prefix()',
-       'entry_widget' : 'menulist', 'entry_widget_attributes' : { 'editable' : 'true' },
-       'entry_event' : 'command', 'entry_code' : '{ au.prefix( ev.target.value ); }',
-       'populate_with' : { 'Mr.' : 'Mr.' , 'Mrs.' : 'Mrs.' }, 'rdefault' : '.prefix()'
-},
-{
-       'id' : 'family_name', 'label' : getString('au_family_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.family_name()',
-       'entry_widget' : 'textbox', 'rdefault' : '.family_name()',
-       'entry_event' : 'change', 'entry_code' : '{ au.family_name( ev.target.value ); }'
-},
-{
-       'id' : 'first_given_name', 'label' : getString('au_first_given_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.first_given_name()',
-       'entry_widget' : 'textbox', 'rdefault' : '.first_given_name()',
-       'entry_event' : 'change', 'entry_code' : '{ au.frist_given_name( ev.target.value ); }'
-},
-{
-       'id' : 'second_given_name', 'label' : getString('au_second_given_name_label'), 'flex' : 1, 'class' : 'dark_salmon',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.second_given_name()',
-       'entry_widget' : 'textbox', 'rdefault' : '.second_given_name()',
-       'entry_event' : 'change', 'entry_code' : '{ au.second_given_name( ev.target.value ); }'
-},
-{
-       'id' : 'suffix', 'label' : getString('au_suffix_label'), 'flex' : 1, 'class' : 'dark_salmon',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.suffix()',
-       'entry_widget' : 'menulist', 'entry_widget_attributes' : { 'editable' : 'true' },
-       'populate_with' : { 'Sr.' : 'Sr.' , 'Jr.' : 'Jr.' }, 'rdefault' : '.suffix()',
-       'entry_event' : 'command', 'entry_code' : '{ au.suffix( ev.target.value ); }'
-},
-{
-       'id' : 'dob', 'label' : getString('au_dob_label'), 'flex' : 1, 'class' : 'cadet_blue',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.dob()',
-       'entry_widget' : 'textbox', 'rdefault' : '.dob()',
-       'entry_event' : 'change', 'entry_code' : '{ au.dob( ev.target.value ); }'
-},
-{
-       'id' : 'ident_type', 'label' : getString('au_ident_type_label'), 'flex' : 1, 'class' : 'cadet_blue',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cit_hash[ $$.ident_type() ].name()',
-       'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cit_hash,function(key,value){return [value.name(), key];}), 
-       'rdefault' : '.ident_type()',
-       'entry_event' : 'command', 'entry_code' : '{ au.ident_type( ev.target.value ); }'
-},
-{
-       'id' : 'ident_value', 'label' : getString('au_ident_value_label'), 'flex' : 1, 'class' : 'cadet_blue',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.ident_value()',
-       'entry_widget' : 'textbox', 'rdefault' : '.ident_value()',
-       'entry_event' : 'change', 'entry_code' : '{ au.ident_value( ev.target.value ); }'
-},
-{
-       'id' : 'ident_type2', 'label' : getString('au_ident_type2_label'), 'flex' : 1, 'class' : 'cadet_blue',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : 'mw.G.cit_hash[ $$.ident_type2() ].name()',
-       'entry_widget' : 'menulist', 'populate_with' : map_object(mw.G.cit_hash,function(key,value){return [value.name(), key];}), 
-       'rdefault' : '.ident_type2()',
-       'entry_event' : 'command', 'entry_code' : '{ au.ident_type2( ev.target.value ); }'
-},
-{
-       'id' : 'ident_value2', 'label' : getString('au_ident_value2_label'), 'flex' : 1, 'class' : 'cadet_blue',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.ident_value2()',
-       'entry_widget' : 'textbox', 'rdefault' : '.ident_value2()',
-       'entry_event' : 'change', 'entry_code' : '{ au.ident_value2( ev.target.value ); }'
-},
-{
-       'id' : 'addresses', 'label' : getString('au_addresses_label'), 'flex' : 1, 'class' : 'coral',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.addresses().length + " addresses"',
-       'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/Edit/New' },
-       'entry_event' : 'command', 'entry_code' : '{ edit_addresses(au); }'
-},
-{
-       'id' : 'day_phone', 'label' : getString('au_day_phone_label'), 'flex' : 1, 'class' : 'coral',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.day_phone()',
-       'entry_widget' : 'textbox', 'rdefault' : '.day_phone()',
-       'entry_event' : 'change', 'entry_code' : '{ au.day_phone( ev.target.value ); }'
-},
-{
-       'id' : 'evening_phone', 'label' : getString('au_evening_phone_label'), 'flex' : 1, 'class' : 'coral',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.evening_phone()',
-       'entry_widget' : 'textbox', 'rdefault' : '.evening_phone()',
-       'entry_event' : 'change', 'entry_code' : '{ au.evening_phone( ev.target.value ); }'
-},
-{
-       'id' : 'other_phone', 'label' : getString('au_other_phone_label'), 'flex' : 1, 'class' : 'coral',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.other_phone()',
-       'entry_widget' : 'textbox', 'rdefault' : '.other_phone()',
-       'entry_event' : 'change', 'entry_code' : '{ au.other_phone( ev.target.value ); }'
-},
-{
-       'id' : 'email', 'label' : getString('au_email_label'), 'flex' : 1, 'class' : 'coral',
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.email()',
-       'entry_widget' : 'textbox', 'rdefault' : '.email()',
-       'entry_event' : 'change', 'entry_code' : '{ au.email( ev.target.value ); }'
-},
-{
-       'id' : 'master_account', 'label' : getString('au_master_account_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.master_account()',
-       'entry_widget' : 'textbox', 'rdefault' : '.master_account()',
-       'entry_event' : 'change', 'entry_code' : '{ au.master_account( ev.target.value ); }'
-},
-{
-       'id' : 'net_access_level', 'label' : getString('au_net_access_level_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.net_access_level()',
-       'entry_widget' : 'textbox', 'rdefault' : '.net_access_level()',
-       'entry_event' : 'change', 'entry_code' : '{ au.net_access_level( ev.target.value ); }'
-},
-{
-       'id' : 'passwd', 'label' : getString('au_passwd_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.passwd()',
-       'entry_widget' : 'textbox', 'rdefault' : '.passwd()',
-       'entry_event' : 'change', 'entry_code' : '{ au.passwd( ev.target.value ); }'
-},
-{
-       'id' : 'photo_url', 'label' : getString('au_photo_url_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.photo_url()',
-       'entry_widget' : 'textbox', 'rdefault' : '.photo_url()',
-       'entry_event' : 'change', 'entry_code' : '{ au.photo_url( ev.target.value ); }'
-},
-{
-       'id' : 'stat_cat_entries', 'label' : getString('au_stat_cat_entries_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.stat_cat_entries().length + " entries"',
-       'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/Edit' },
-       'entry_event' : 'command', 'entry_code' : '{ edit_stat_cat_entries(au); }'
-},
-{
-       'id' : 'survey_responses', 'label' : getString('au_survey_responses_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.survey_responses().length + " responses"',
-       'entry_widget' : 'button', 'entry_widget_attributes' : { 'label' : 'View/New' },
-       'entry_event' : 'command', 'entry_code' : '{ new_survey_responses(au); }'
-},
-{
-       'id' : 'usrgroup', 'label' : getString('au_usrgroup_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.usrgroup()',
-       'entry_widget' : 'textbox', 'rdefault' : '.usrgroup()',
-       'entry_event' : 'change', 'entry_code' : '{ au.usrgroup( ev.target.value ); }'
-},
-{
-       'id' : 'usrname', 'label' : getString('au_usrname_label'), 'flex' : 1,
-       'primary' : false, 'hidden' : false, 'fm_class' : 'au', 'fm_field_render' : '.usrname()',
-       'entry_widget' : 'textbox', 'rdefault' : '.usrname()',
-       'entry_event' : 'change', 'entry_code' : '{ au.usrname( ev.target.value ); }'
-},
-];
-
-       return rows;
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/stat_cat/copy_stat_cat_editor.xul b/Evergreen/staff_client/chrome/content/evergreen/stat_cat/copy_stat_cat_editor.xul
deleted file mode 100644 (file)
index a1b90e5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/stat_cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-
-<page id="stat_cat_win" title="Copy Stat-Cat Editor" 
-       orient="vertical" style="overflow: auto;"  persist="width height"
-       onload="copy_stat_cat_editor_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
-       <!-- Overlays for this XUL file -->
-       <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?> -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_bundle.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <vbox id="copy_stat_cat_editor" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/stat_cat/patron_stat_cat_editor.xul b/Evergreen/staff_client/chrome/content/evergreen/stat_cat/patron_stat_cat_editor.xul
deleted file mode 100644 (file)
index 4c27e54..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/stat_cat.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-
-<window id="stat_cat_win" title="Patron Stat-Cat Editor" 
-       orient="vertical" style="overflow: auto"  persist="width height"
-       onload="patron_stat_cat_editor_init();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
-       <!-- Overlays for this XUL file -->
-       <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF_overlay.xul"?> -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_bundle.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <vbox id="patron_stat_cat_editor" class="test_class"/>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat.js b/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat.js
deleted file mode 100644 (file)
index fc88f03..0000000
+++ /dev/null
@@ -1,945 +0,0 @@
-var local_copy_stat_cats = [];
-var local_copy_stat_cats_hash = {};
-var local_copy_stat_cat_entries = {};
-var local_patron_stat_cats = [];
-var local_patron_stat_cats_hash = {};
-var local_patron_stat_cat_entries = {};
-var local_generic_stat_cats = [];
-var local_generic_stat_cats_hash = {};
-var local_generic_stat_cat_entries = {};
-var new_id = -1;
-
-function copy_stat_cat_editor_init() {
-       sdump('D_LEGACY','entering copy_stat_cat_editor_init for copy_stat_cat.js\n');
-       sdump('D_LEGACY','TESTING: stat_cat.js: ' + mw.G['main_test_variable'] + '\n');
-       populate_local_copy_stat_cats(
-               'copy_stat_cat_grid',
-               map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
-       );
-}
-
-function patron_stat_cat_editor_init() {
-       sdump('D_LEGACY','entering patron_stat_cat_editor_init for patron_stat_cat.js\n');
-       sdump('D_LEGACY','TESTING: stat_cat.js: ' + mw.G['main_test_variable'] + '\n');
-       populate_local_patron_stat_cats(
-               'patron_stat_cat_grid',
-               map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
-       );
-}
-
-function new_entry_listener(ev) {
-       if (ev.target.tagName != 'textbox') return;
-       var row = ev.target.parentNode;
-       var rows = row.parentNode;
-       var clone = row.cloneNode(true);
-       if (row.nextSibling) {
-               rows.insertBefore(clone,row.nextSibling);
-       } else {
-               rows.appendChild(clone);
-       }
-       clone.getElementsByTagName('textbox')[0].addEventListener('change',new_entry_listener,false);
-       ev.target.removeEventListener('change',new_entry_listener,false);
-} 
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// COPY
-
-function populate_local_copy_stat_cats(grid,libs) {
-       sdump('D_LEGACY','populate_local_copy_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-       sdump('D_LEGACY','populate_local_copy_stat_cats: pertinent libs = ' + mw.js2JSON(libs) + '\n');
-       sdump('D_LEGACY','libs.constructor = ' + libs.constructor + '\n');
-
-       try {
-               local_copy_stat_cats = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.stat_cat.asset.multirange.union.retrieve',
-                       [ mw.G.auth_ses[0], libs ]
-               );
-               //sdump('D_LEGACY','1: local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
-               local_copy_stat_cats = local_copy_stat_cats[0];
-               //sdump('D_LEGACY','2: local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
-               local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
-       } catch(E) {
-               mw.handle_error(E);
-       }
-       populate_local_copy_stat_cats_grid(grid);
-}
-
-function populate_local_copy_stat_cats_grid(grid) {
-
-       sdump('D_LEGACY','local_copy_stat_cats = ' + pretty_print( js2JSON( local_copy_stat_cats ) ) + '\n');
-
-       if (typeof(grid) != 'object') { grid = document.getElementById(grid); }
-       var rows = grid.getElementsByTagName('rows')[0];
-       empty_widget(rows);
-
-       var row0 = document.createElement('row');
-       rows.appendChild(row0);
-       row0.appendChild( document.createElement('label') );
-       row0.appendChild( document.createElement('label') );
-       var delete_label = document.createElement('label');
-       row0.appendChild( delete_label );
-               delete_label.setAttribute('value','Delete');
-       var owner_label = document.createElement('label');
-       row0.appendChild( owner_label );
-               owner_label.setAttribute('value','Owner');
-
-       for (var i in local_copy_stat_cats) {
-
-               var copy_stat_cat = local_copy_stat_cats[i];
-
-               var row1 = document.createElement('row'); 
-               rows.appendChild(row1);
-               row1.setAttribute('asc_id',copy_stat_cat.id());
-               row1.setAttribute('object_type','asc');
-               addCSSClass(row1,'row' + i % 2);
-
-                       var label1 = document.createElement('label'); 
-                       row1.appendChild(label1);
-                       label1.setAttribute('value','Statistical Category:');
-
-                       if ( find_ou( mw.G.user_ou,copy_stat_cat.owner() ) ) {
-                               var textbox1 = document.createElement('textbox');
-                               row1.appendChild(textbox1);
-                               textbox1.value = copy_stat_cat.name();
-                               textbox1.setAttribute('original',textbox1.value);
-       
-                               var checkbox1 = document.createElement('checkbox');
-                               row1.appendChild(checkbox1);
-                               checkbox1.setAttribute('delete','true');
-
-                               var menulist1 = document.createElement('menulist');
-                               row1.appendChild(menulist1);
-                               menulist1.setAttribute('original',copy_stat_cat.owner());
-       
-                                       var menupopup1 = document.createElement('menupopup');
-                                       menulist1.appendChild(menupopup1);
-                                       //sdump('D_LEGACY','About to populate with copy_stat_cat.owner() = ' + copy_stat_cat.owner() + '\n');
-                                       populate_lib_list_with_branch(menulist1,menupopup1,copy_stat_cat.owner(),mw.G.user_ou);
-                       } else {
-
-                               var label1a = document.createElement('label');
-                               row1.appendChild(label1a);
-                               label1a.setAttribute('value',copy_stat_cat.name() );
-
-                               row1.appendChild( document.createElement('label') );
-
-                               var label1c = document.createElement('label');
-                               row1.appendChild(label1c);
-                               label1c.setAttribute( 'value',mw.G.org_tree_hash[copy_stat_cat.owner()].name() );
-                       }
-
-               var row2 = document.createElement('row'); 
-               rows.appendChild(row2);
-               row2.setAttribute('asc_id',copy_stat_cat.id());
-               row2.setAttribute('object_type','asc');
-               addCSSClass(row2,'row' + i % 2);
-
-                       var label2 = document.createElement('label');
-                       row2.appendChild(label2);
-                       label2.setAttribute('value','OPAC Visible');
-
-                       if ( find_ou( mw.G.user_ou,copy_stat_cat.owner() ) ) {
-                               var checkbox2 = document.createElement('checkbox');
-                               row2.appendChild(checkbox2);
-                               checkbox2.checked = (copy_stat_cat.opac_visible() == '1')
-                               checkbox2.setAttribute('original',checkbox2.checked);
-                       } else {
-                               var label2a = document.createElement('label');
-                               row2.appendChild(label2a);
-                               label2a.setAttribute('value',yesno( copy_stat_cat.opac_visible() ));
-                       }
-
-               for (var j in copy_stat_cat.entries() ) {
-
-                       var stat_entry = copy_stat_cat.entries()[j];
-                       local_copy_stat_cat_entries[stat_entry.id()] = stat_entry;
-
-                       var row = document.createElement('row');
-                       rows.appendChild(row);
-                       row.setAttribute('asc_id',copy_stat_cat.id());
-                       row.setAttribute('asce_id',stat_entry.id());
-                       row.setAttribute('object_type','asce');
-                       addCSSClass(row,'row' + i % 2);
-
-                               var label = document.createElement('label');
-                               row.appendChild(label);
-                               label.setAttribute('value','Entry:');
-
-                               if ( find_ou( mw.G.user_ou,stat_entry.owner() ) ) {
-                                       var textbox = document.createElement('textbox');
-                                       row.appendChild(textbox);
-                                       textbox.value = stat_entry.value();
-                                       textbox.setAttribute('original',textbox.value);
-
-                                       var checkbox = document.createElement('checkbox');
-                                       row.appendChild(checkbox);
-                                       checkbox.setAttribute('delete','true');
-
-                                       var menulist = document.createElement('menulist');
-                                       row.appendChild(menulist);
-                                       menulist.setAttribute('original',stat_entry.owner());
-
-                                               var menupopup = document.createElement('menupopup');
-                                               menulist.appendChild(menupopup);
-                                               //sdump('D_LEGACY','About to populate with stat_entry.owner() = ' + stat_entry.owner() + '\n');
-                                               populate_lib_list_with_branch(menulist,menupopup,stat_entry.owner(),mw.G.user_ou);
-                               } else {
-
-                                       var labela = document.createElement('label');
-                                       row.appendChild(labela);
-                                       labela.setAttribute('value',stat_entry.value());
-
-                                       row.appendChild( document.createElement('label') );
-
-                                       var labelc = document.createElement('label');
-                                       row.appendChild(labelc);
-                                       labelc.setAttribute( 'value',mw.G.org_tree_hash[stat_entry.owner()].name() );
-                               }
-               }
-
-               var row3 = document.createElement('row');
-               rows.appendChild(row3);
-               row3.setAttribute('asc_id',copy_stat_cat.id());
-               row3.setAttribute('object_type','asce');
-               row3.setAttribute('new','true');
-               addCSSClass(row3,'row' + i % 2);
-
-                       var label3 = document.createElement('label');
-                       row3.appendChild(label3);
-                       label3.setAttribute('value','New Entry:');
-
-                       var textbox3 = document.createElement('textbox');
-                       row3.appendChild(textbox3);
-                       textbox3.setAttribute('original','');
-                       textbox3.addEventListener(
-                               'change',
-                               new_entry_listener,
-                               false
-                       );
-
-                       var checkbox3 = document.createElement('checkbox');
-                       row3.appendChild(checkbox3);
-                       checkbox3.setAttribute('delete','true');
-
-                       var menulist3 = document.createElement('menulist');
-                       row3.appendChild(menulist3);
-                       menulist3.setAttribute('original',mw.G.user_ou.id());
-
-                               var menupopup3 = document.createElement('menupopup');
-                               menulist3.appendChild(menupopup3);
-                               //sdump('D_LEGACY','About to populate with mw.G.user_ou\n');
-                               populate_lib_list_with_branch(menulist3,menupopup3,mw.G.user_ou,mw.G.user_ou);
-
-               var row4 = document.createElement('row');
-               rows.appendChild(row4);
-               addCSSClass(row4,'row' + i % 2);
-
-                       var label4 = document.createElement('label');
-                       row4.appendChild(label4);
-                       label4.setAttribute('value',' ');
-                       
-               var row5 = document.createElement('row');
-               rows.appendChild(row5);
-
-                       var label5 = document.createElement('label');
-                       row5.appendChild(label5);
-                       label5.setAttribute('value',' ');
-
-       }
-
-       var row6 = document.createElement('row');
-       rows.appendChild(row6);
-
-               var label6 = document.createElement('label');
-               row6.appendChild(label6);
-               label6.setAttribute('value',' ');
-       
-       sdump('D_LEGACY','local_copy_stat_cat_entries = ' + pretty_print( js2JSON( local_copy_stat_cat_entries ) ) + '\n');
-}
-function save_copy_changes() {
-
-       // XUL
-
-       var nl = document.getElementsByTagName('textbox');
-       for (var i = 0; i < nl.length; i++) {
-               var t = nl[i];
-               var row = t.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var asc_id = row.getAttribute('asc_id');
-               var asce_id = row.getAttribute('asce_id');
-               var new_flag = row.getAttribute('new');
-               var original = t.getAttribute('original');
-               sdump('D_LEGACY','Considering textbox: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' value = ' + t.value + '\n');
-
-               if ( (original != t.value) && (t.value != null) && (t.value != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'asc': 
-                                       local_copy_stat_cats_hash[asc_id].ischanged('1');
-                                       local_copy_stat_cats_hash[asc_id].name( t.value );
-                               break;
-                               case 'asce': 
-                                       if (!asce_id) { 
-                                               asce_id = new_id--;
-                                               row.setAttribute('asce_id', asce_id);
-                                               local_copy_stat_cats_hash[ asc_id ].entries().push( new asce() );
-                                               local_copy_stat_cat_entries[asce_id] = 
-                                                       local_copy_stat_cats_hash[ asc_id].entries()[ local_copy_stat_cats_hash[ asc_id].entries().length -1 ];
-                                               local_copy_stat_cat_entries[asce_id].id( asce_id );
-                                               local_copy_stat_cat_entries[asce_id].isnew('1');
-                                               local_copy_stat_cat_entries[asce_id].stat_cat( asc_id );
-                                               local_copy_stat_cat_entries[asce_id].owner(
-                                                       mw.G.user_ou.id()
-                                               );
-                                               local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
-                                       }
-                                       local_copy_stat_cat_entries[asce_id].ischanged('1');
-                                       local_copy_stat_cat_entries[asce_id].value( t.value );
-                               break;
-                       }
-               }
-       }
-       var nl = document.getElementsByTagName('menulist');
-       for (var i = 0; i < nl.length; i++) {
-               var m = nl[i];
-               var row = m.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var asc_id = row.getAttribute('asc_id');
-               var asce_id = row.getAttribute('asce_id');
-               var new_flag = row.getAttribute('new');
-               var original = m.getAttribute('original');
-
-               sdump('D_LEGACY','Considering menulist: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' value = ' + m.value + '\n');
-
-               if ( (original != m.value) && (m.value != null) && (m.value != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'asc': 
-                                       local_copy_stat_cats_hash[asc_id].ischanged('1');
-                                       local_copy_stat_cats_hash[asc_id].owner( m.value );
-                               break;
-                               case 'asce': 
-                                       if (asce_id) { 
-                                               local_copy_stat_cat_entries[asce_id].ischanged('1');
-                                               local_copy_stat_cat_entries[asce_id].owner( m.value );
-                                       } else {
-                                               sdump('D_LEGACY','\tbut nothing to do.\n');
-                                       }
-                               break;
-                       }
-               }
-       }
-
-       var nl = document.getElementsByTagName('checkbox');
-       for (var i = 0; i < nl.length; i++) {
-               var c = nl[i];
-               var row = c.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var asc_id = row.getAttribute('asc_id');
-               var asce_id = row.getAttribute('asce_id');
-               var new_flag = row.getAttribute('new');
-               var delete_flag = c.getAttribute('delete');
-               if (delete_flag == 'true') { delete_flag = true; }
-               else if (delete_flag == 'false') { delete_flag = false; }
-               var original = c.getAttribute('original');
-               if (original == 'true') { original = true; }
-               else if (original == 'false' ) { original = false; }
-
-               sdump('D_LEGACY','Considering checkbox: object_type = ' + object_type + ' asc_id = ' + asc_id + ' asce_id = ' + asce_id + ' original = ' + original + ' checked = ' + m.checked + ' delete_flag = ' + delete_flag + '\n');
-
-               if ( (original != c.checked) && (c.checked != null) && (c.checked != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'asc': 
-                                       local_copy_stat_cats_hash[asc_id].ischanged('1');
-                                       if (delete_flag) {
-                                               local_copy_stat_cats_hash[asc_id].isdeleted('1');
-                                       } else {
-                                               local_copy_stat_cats_hash[asc_id].opac_visible( c.checked );
-                                       }
-                               break;
-                               case 'asce': 
-                                       if (asce_id) {
-                                               local_copy_stat_cat_entries[asce_id].ischanged('1');
-                                               if (delete_flag) {
-                                                       local_copy_stat_cat_entries[asce_id].isdeleted('1');
-                                               } else {
-                                                       // This actually doesn't exist on the asce object
-                                                       //local_copy_stat_cat_entries[asce_id].opac_visible( c.checked );
-                                               }
-                                       } else {
-                                               sdump('D_LEGACY',"\tBut nothing to do.\n");
-                                       }
-                               break;
-                       }
-               }
-       }
-
-       sdump('D_LEGACY','local_copy_stat_cats = ' + js2JSON(local_copy_stat_cats) + '\n');
-
-       // fieldmapper
-       sdump('D_LEGACY','Creating, Updating, Deleting, Oh My...\n');
-       for (var i = 0; i < local_copy_stat_cats.length; i++) {
-               var copy_stat_cat = local_copy_stat_cats[i];
-               sdump('D_LEGACY','Considering copy_stat_cat = ' + js2JSON(copy_stat_cat) + '\n');
-
-               if ( (copy_stat_cat.name() == undefined) || (copy_stat_cat.name() == null) 
-                       || (copy_stat_cat.name() == '') ) continue; 
-               if ( copy_stat_cat.isnew() == '1' ) {
-               // This will handle copy_stat_cat and and it's entries
-                       try {
-                               if ( copy_stat_cat.isdeleted() != '1') {
-                                       var r1 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.asset.create',
-                                               [ mw.G.auth_ses[0], copy_stat_cat ]
-                                       )[0];
-                                       sdump('D_LEGACY','r1 = ' + js2JSON(r1) + '\n');
-                               }
-                       } catch(E) {
-                               mw.handle_error(E);
-                       }
-
-               } else {
-               // We will also need to loop through the entries
-
-                       if ( (copy_stat_cat.ischanged() == '1') || (copy_stat_cat.isdeleted() == '1') ) {
-                               try {
-                                       if (copy_stat_cat.isdeleted() == '1') {
-                                               var r2 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.asset.delete',
-                                                       [ mw.G.auth_ses[0], copy_stat_cat ]
-                                               )[0];
-                                               sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
-                                       } else {
-                                               var r2 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.asset.update',
-                                                       [ mw.G.auth_ses[0], copy_stat_cat ]
-                                               )[0];
-                                               sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
-                                       }
-                               } catch(E) {
-                                       mw.handle_error(E);
-                               }
-                       }
-                       if (copy_stat_cat.isdeleted() != '1')
-                       for (var j = 0; j < copy_stat_cat.entries().length; j++) {
-                               var stat_entry = copy_stat_cat.entries()[j];
-                               sdump('D_LEGACY','\tConsidering stat_entry = ' + js2JSON(stat_entry) + '\n');
-
-                               if (stat_entry.isnew() == '1') {
-                                       if (stat_entry.isdeleted() != '1') {                    
-                                               var r3 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.asset.entry.create',
-                                                       [ mw.G.auth_ses[0], stat_entry ]
-                                               );
-                                               sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-                                       }
-                               } else if (stat_entry.isdeleted() == '1') {
-
-                                       var r3 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.asset.entry.delete',
-                                               [ mw.G.auth_ses[0], stat_entry ]
-                                       );
-                                       sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
-                               } else {
-
-                                       var r3 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.asset.entry.update',
-                                               [ mw.G.auth_ses[0], stat_entry ]
-                                       );
-                                       sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
-                               }
-
-                       }
-
-               }
-       }
-
-       sdump('D_LEGACY','\n\n\n=-=-=-=-=-=-=-=-=\n\n\n');
-
-       local_copy_stat_cat_entries = {};
-       local_copy_stat_cats = [];
-       local_copy_stat_cats_hash = {};
-       sdump('D_LEGACY','Successfully updated the Stat Cats\n');
-       alert('Successfully updated the Stat Cats\n');
-       populate_local_copy_stat_cats(
-               'copy_stat_cat_grid',
-               map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
-       );
-       document.getElementById('copy_stat_cat_new').disabled = false;
-}
-
-function new_copy_stat_cat(ev) {
-       ev.target.disabled = true;
-       var n_asc = new asc();
-       n_asc.isnew( '1' );
-       n_asc.id( new_id-- );
-       n_asc.owner( mw.G.user_ou.id() );
-       n_asc.entries( [] );
-       local_copy_stat_cats.push( n_asc );
-       local_copy_stat_cats_hash = convert_object_list_to_hash( local_copy_stat_cats );
-       populate_local_copy_stat_cats_grid('copy_stat_cat_grid');
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// PATRON
-
-function populate_local_patron_stat_cats(grid,libs) {
-       sdump('D_LEGACY','populate_local_patron_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
-       try {
-               local_patron_stat_cats = mw.user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.stat_cat.actor.retrieve.all',
-                       [ mw.G.auth_ses[0] ]
-               );
-               //sdump('D_LEGACY','1: local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
-               local_patron_stat_cats = local_patron_stat_cats[0];
-               //sdump('D_LEGACY','2: local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
-               local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
-       } catch(E) {
-               mw.handle_error(E);
-       }
-       populate_local_patron_stat_cats_grid(grid);
-}
-
-function populate_local_patron_stat_cats_grid(grid) {
-
-       sdump('D_LEGACY','local_patron_stat_cats = ' + pretty_print( js2JSON( local_patron_stat_cats ) ) + '\n');
-
-       if (typeof(grid) != 'object') { grid = document.getElementById(grid); }
-       var rows = grid.getElementsByTagName('rows')[0];
-       empty_widget(rows);
-
-       var row0 = document.createElement('row');
-       rows.appendChild(row0);
-       row0.appendChild( document.createElement('label') );
-       row0.appendChild( document.createElement('label') );
-       var delete_label = document.createElement('label');
-       row0.appendChild( delete_label );
-               delete_label.setAttribute('value','Delete');
-       var owner_label = document.createElement('label');
-       row0.appendChild( owner_label );
-               owner_label.setAttribute('value','Owner');
-
-       for (var i in local_patron_stat_cats) {
-               //sdump('D_LEGACY','local_patron_stat_cats['+i+'] = '+local_patron_stat_cats[i]+' ; typeof = '+typeof(local_patron_stat_cats[i]) + '\n');
-
-               var patron_stat_cat = local_patron_stat_cats[i];
-
-               var row1 = document.createElement('row'); 
-               rows.appendChild(row1);
-               row1.setAttribute('actsc_id',patron_stat_cat.id());
-               row1.setAttribute('object_type','actsc');
-               addCSSClass(row1,'row' + i % 2);
-
-                       var label1 = document.createElement('label'); 
-                       row1.appendChild(label1);
-                       label1.setAttribute('value','Statistical Category:');
-
-                       if ( find_ou( mw.G.user_ou,patron_stat_cat.owner() ) ) {
-                               var textbox1 = document.createElement('textbox');
-                               row1.appendChild(textbox1);
-                               textbox1.value = patron_stat_cat.name();
-                               textbox1.setAttribute('original',textbox1.value);
-       
-                               var checkbox1 = document.createElement('checkbox');
-                               row1.appendChild(checkbox1);
-                               checkbox1.setAttribute('delete','true');
-
-                               var menulist1 = document.createElement('menulist');
-                               row1.appendChild(menulist1);
-                               menulist1.setAttribute('original',patron_stat_cat.owner());
-       
-                                       var menupopup1 = document.createElement('menupopup');
-                                       menulist1.appendChild(menupopup1);
-                                       //sdump('D_LEGACY','About to populate with patron_stat_cat.owner() = ' + patron_stat_cat.owner() + '\n');
-                                       populate_lib_list_with_branch(menulist1,menupopup1,patron_stat_cat.owner(),mw.G.user_ou);
-                       } else {
-
-                               var label1a = document.createElement('label');
-                               row1.appendChild(label1a);
-                               label1a.setAttribute('value',patron_stat_cat.name() );
-
-                               row1.appendChild( document.createElement('label') );
-
-                               var label1c = document.createElement('label');
-                               row1.appendChild(label1c);
-                               label1c.setAttribute( 'value',mw.G.org_tree_hash[patron_stat_cat.owner()].name() );
-                       }
-
-               var row2 = document.createElement('row'); 
-               rows.appendChild(row2);
-               row2.setAttribute('actsc_id',patron_stat_cat.id());
-               row2.setAttribute('object_type','actsc');
-               addCSSClass(row2,'row' + i % 2);
-
-                       var label2 = document.createElement('label');
-                       row2.appendChild(label2);
-                       label2.setAttribute('value','OPAC Visible');
-
-                       if ( find_ou( mw.G.user_ou,patron_stat_cat.owner() ) ) {
-                               var checkbox2 = document.createElement('checkbox');
-                               row2.appendChild(checkbox2);
-                               checkbox2.checked = (patron_stat_cat.opac_visible() == '1')
-                               checkbox2.setAttribute('original',checkbox2.checked);
-                       } else {
-                               var label2a = document.createElement('label');
-                               row2.appendChild(label2a);
-                               label2a.setAttribute('value',yesno( patron_stat_cat.opac_visible() ));
-                       }
-
-               for (var j in patron_stat_cat.entries() ) {
-
-                       var stat_entry = patron_stat_cat.entries()[j];
-                       local_patron_stat_cat_entries[stat_entry.id()] = stat_entry;
-
-                       var row = document.createElement('row');
-                       rows.appendChild(row);
-                       row.setAttribute('actsc_id',patron_stat_cat.id());
-                       row.setAttribute('actsce_id',stat_entry.id());
-                       row.setAttribute('object_type','actsce');
-                       addCSSClass(row,'row' + i % 2);
-
-                               var label = document.createElement('label');
-                               row.appendChild(label);
-                               label.setAttribute('value','Entry:');
-
-                               if ( find_ou( mw.G.user_ou,stat_entry.owner() ) ) {
-                                       var textbox = document.createElement('textbox');
-                                       row.appendChild(textbox);
-                                       textbox.value = stat_entry.value();
-                                       textbox.setAttribute('original',textbox.value);
-
-                                       var checkbox = document.createElement('checkbox');
-                                       row.appendChild(checkbox);
-                                       checkbox.setAttribute('delete','true');
-
-                                       var menulist = document.createElement('menulist');
-                                       row.appendChild(menulist);
-                                       menulist.setAttribute('original',stat_entry.owner());
-
-                                               var menupopup = document.createElement('menupopup');
-                                               menulist.appendChild(menupopup);
-                                               //sdump('D_LEGACY','About to populate with stat_entry.owner() = ' + stat_entry.owner() + '\n');
-                                               populate_lib_list_with_branch(menulist,menupopup,stat_entry.owner(),mw.G.user_ou);
-                               } else {
-
-                                       var labela = document.createElement('label');
-                                       row.appendChild(labela);
-                                       labela.setAttribute('value',stat_entry.value());
-
-                                       row.appendChild( document.createElement('label') );
-
-                                       var labelc = document.createElement('label');
-                                       row.appendChild(labelc);
-                                       labelc.setAttribute( 'value',mw.G.org_tree_hash[stat_entry.owner()].name() );
-                               }
-               }
-
-               var row3 = document.createElement('row');
-               rows.appendChild(row3);
-               row3.setAttribute('actsc_id',patron_stat_cat.id());
-               row3.setAttribute('object_type','actsce');
-               row3.setAttribute('new','true');
-               addCSSClass(row3,'row' + i % 2);
-
-                       var label3 = document.createElement('label');
-                       row3.appendChild(label3);
-                       label3.setAttribute('value','New Entry:');
-
-                       var textbox3 = document.createElement('textbox');
-                       row3.appendChild(textbox3);
-                       textbox3.setAttribute('original','');
-                       textbox3.addEventListener(
-                               'change',
-                               new_entry_listener,
-                               false
-                       );
-
-                       var checkbox3 = document.createElement('checkbox');
-                       row3.appendChild(checkbox3);
-                       checkbox3.setAttribute('delete','true');
-
-                       var menulist3 = document.createElement('menulist');
-                       row3.appendChild(menulist3);
-                       menulist3.setAttribute('original',mw.G.user_ou.id());
-
-                               var menupopup3 = document.createElement('menupopup');
-                               menulist3.appendChild(menupopup3);
-                               //sdump('D_LEGACY','About to populate with mw.G.user_ou\n');
-                               populate_lib_list_with_branch(menulist3,menupopup3,mw.G.user_ou,mw.G.user_ou);
-
-               var row4 = document.createElement('row');
-               rows.appendChild(row4);
-               addCSSClass(row4,'row' + i % 2);
-
-                       var label4 = document.createElement('label');
-                       row4.appendChild(label4);
-                       label4.setAttribute('value',' ');
-                       
-               var row5 = document.createElement('row');
-               rows.appendChild(row5);
-
-                       var label5 = document.createElement('label');
-                       row5.appendChild(label5);
-                       label5.setAttribute('value',' ');
-
-       }
-
-       var row6 = document.createElement('row');
-       rows.appendChild(row6);
-
-               var label6 = document.createElement('label');
-               row6.appendChild(label6);
-               label6.setAttribute('value',' ');
-       
-       sdump('D_LEGACY','local_patron_stat_cat_entries = ' + pretty_print( js2JSON( local_patron_stat_cat_entries ) ) + '\n');
-}
-
-function save_patron_changes() {
-
-       // XUL
-
-       var nl = document.getElementsByTagName('textbox');
-       for (var i = 0; i < nl.length; i++) {
-               var t = nl[i];
-               var row = t.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var actsc_id = row.getAttribute('actsc_id');
-               var actsce_id = row.getAttribute('actsce_id');
-               var new_flag = row.getAttribute('new');
-               var original = t.getAttribute('original');
-               sdump('D_LEGACY','Considering textbox: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' value = ' + t.value + '\n');
-
-               if ( (original != t.value) && (t.value != null) && (t.value != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'actsc': 
-                                       local_patron_stat_cats_hash[actsc_id].ischanged('1');
-                                       local_patron_stat_cats_hash[actsc_id].name( t.value );
-                               break;
-                               case 'actsce': 
-                                       if (!actsce_id) { 
-                                               actsce_id = new_id--;
-                                               row.setAttribute('actsce_id', actsce_id);
-                                               local_patron_stat_cats_hash[ actsc_id ].entries().push( new actsce() );
-                                               local_patron_stat_cat_entries[actsce_id] = 
-                                                       local_patron_stat_cats_hash[ actsc_id].entries()[ local_patron_stat_cats_hash[ actsc_id].entries().length -1 ];
-                                               local_patron_stat_cat_entries[actsce_id].id( actsce_id );
-                                               local_patron_stat_cat_entries[actsce_id].isnew('1');
-                                               local_patron_stat_cat_entries[actsce_id].stat_cat( actsc_id );
-                                               local_patron_stat_cat_entries[actsce_id].owner(
-                                                       mw.G.user_ou.id()
-                                               );
-                                               local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
-                                       }
-                                       local_patron_stat_cat_entries[actsce_id].ischanged('1');
-                                       local_patron_stat_cat_entries[actsce_id].value( t.value );
-                               break;
-                       }
-               }
-       }
-       var nl = document.getElementsByTagName('menulist');
-       for (var i = 0; i < nl.length; i++) {
-               var m = nl[i];
-               var row = m.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var actsc_id = row.getAttribute('actsc_id');
-               var actsce_id = row.getAttribute('actsce_id');
-               var new_flag = row.getAttribute('new');
-               var original = m.getAttribute('original');
-
-               sdump('D_LEGACY','Considering menulist: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' value = ' + m.value + '\n');
-
-               if ( (original != m.value) && (m.value != null) && (m.value != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'actsc': 
-                                       local_patron_stat_cats_hash[actsc_id].ischanged('1');
-                                       local_patron_stat_cats_hash[actsc_id].owner( m.value );
-                               break;
-                               case 'actsce': 
-                                       if (actsce_id) { 
-                                               local_patron_stat_cat_entries[actsce_id].ischanged('1');
-                                               local_patron_stat_cat_entries[actsce_id].owner( m.value );
-                                       } else {
-                                               sdump('D_LEGACY','\tbut nothing to do.\n');
-                                       }
-                               break;
-                       }
-               }
-       }
-
-       var nl = document.getElementsByTagName('checkbox');
-       for (var i = 0; i < nl.length; i++) {
-               var c = nl[i];
-               var row = c.parentNode;
-               var object_type = row.getAttribute('object_type');
-               var actsc_id = row.getAttribute('actsc_id');
-               var actsce_id = row.getAttribute('actsce_id');
-               var new_flag = row.getAttribute('new');
-               var delete_flag = c.getAttribute('delete');
-               if (delete_flag == 'true') { delete_flag = true; }
-               else if (delete_flag == 'false') { delete_flag = false; }
-               var original = c.getAttribute('original');
-               if (original == 'true') { original = true; }
-               else if (original == 'false' ) { original = false; }
-
-               sdump('D_LEGACY','Considering checkbox: object_type = ' + object_type + ' actsc_id = ' + actsc_id + ' actsce_id = ' + actsce_id + ' original = ' + original + ' checked = ' + m.checked + ' delete_flag = ' + delete_flag + '\n');
-
-               if ( (original != c.checked) && (c.checked != null) && (c.checked != undefined) ) {
-                       sdump('D_LEGACY',"\tWe're in...\n");
-                       switch(object_type) {
-                               case 'actsc': 
-                                       local_patron_stat_cats_hash[actsc_id].ischanged('1');
-                                       if (delete_flag) {
-                                               local_patron_stat_cats_hash[actsc_id].isdeleted('1');
-                                       } else {
-                                               local_patron_stat_cats_hash[actsc_id].opac_visible( c.checked );
-                                       }
-                               break;
-                               case 'actsce': 
-                                       if (actsce_id) {
-                                               local_patron_stat_cat_entries[actsce_id].ischanged('1');
-                                               if (delete_flag) {
-                                                       local_patron_stat_cat_entries[actsce_id].isdeleted('1');
-                                               } else {
-                                                       // This actually doesn't exist on the actsce object
-                                                       //local_patron_stat_cat_entries[actsce_id].opac_visible( c.checked );
-                                               }
-                                       } else {
-                                               sdump('D_LEGACY',"\tBut nothing to do.\n");
-                                       }
-                               break;
-                       }
-               }
-       }
-
-       sdump('D_LEGACY','local_patron_stat_cats = ' + js2JSON(local_patron_stat_cats) + '\n');
-
-       // fieldmapper
-       sdump('D_LEGACY','Creating, Updating, Deleting, Oh My...\n');
-       for (var i = 0; i < local_patron_stat_cats.length; i++) {
-               var patron_stat_cat = local_patron_stat_cats[i];
-               sdump('D_LEGACY','Considering patron_stat_cat = ' + js2JSON(patron_stat_cat) + '\n');
-
-               if ( (patron_stat_cat.name() == undefined) || (patron_stat_cat.name() == null) 
-                       || (patron_stat_cat.name() == '') ) continue; 
-               if ( patron_stat_cat.isnew() == '1' ) {
-               // This will handle patron_stat_cat and and it's entries
-                       try {
-                               if ( patron_stat_cat.isdeleted() != '1' ) {
-                                       var r1 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.actor.create',
-                                               [ mw.G.auth_ses[0], patron_stat_cat ]
-                                       )[0];
-                                       sdump('D_LEGACY','r1 = ' + js2JSON(r1) + '\n');
-                               }
-                       } catch(E) {
-                               mw.handle_error(E);
-                       }
-
-               } else {
-               // We will also need to loop through the entries
-
-                       if ( (patron_stat_cat.ischanged() == '1') || (patron_stat_cat.isdeleted() == '1') ) {
-                               try {
-                                       if (patron_stat_cat.isdeleted() == '1') {
-                                               var r2 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.actor.delete',
-                                                       [ mw.G.auth_ses[0], patron_stat_cat ]
-                                               )[0];
-                                               sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
-                                       } else {
-                                               var r2 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.actor.update',
-                                                       [ mw.G.auth_ses[0], patron_stat_cat ]
-                                               )[0];
-                                               sdump('D_LEGACY','r2 = ' + js2JSON(r2) + '\n');
-
-                                       }
-                               } catch(E) {
-                                       mw.handle_error(E);
-                               }
-                       }
-                       if (patron_stat_cat.isdeleted() != '1')
-                       for (var j = 0; j < patron_stat_cat.entries().length; j++) {
-                               var stat_entry = patron_stat_cat.entries()[j];
-                               sdump('D_LEGACY','\tConsidering stat_entry = ' + js2JSON(stat_entry) + '\n');
-
-                               if (stat_entry.isnew() == '1') {
-                                       if (stat_entry.isdeleted() != '1') {                    
-                                               var r3 = mw.user_request(
-                                                       'open-ils.circ',
-                                                       'open-ils.circ.stat_cat.actor.entry.create',
-                                                       [ mw.G.auth_ses[0], stat_entry ]
-                                               );
-                                               sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-                                       }
-                               } else if (stat_entry.isdeleted() == '1') {
-
-                                       var r3 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.actor.entry.delete',
-                                               [ mw.G.auth_ses[0], stat_entry ]
-                                       );
-                                       sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-                       
-                               } else {
-
-                                       var r3 = mw.user_request(
-                                               'open-ils.circ',
-                                               'open-ils.circ.stat_cat.actor.entry.update',
-                                               [ mw.G.auth_ses[0], stat_entry ]
-                                       );
-                                       sdump('D_LEGACY','r3 = ' + js2JSON(r3) + '\n');
-
-                               }
-
-                       }
-
-               }
-       }
-
-       sdump('D_LEGACY','\n\n\n=-=-=-=-=-=-=-=-=\n\n\n');
-
-       local_patron_stat_cat_entries = {};
-       local_patron_stat_cats = [];
-       local_patron_stat_cats_hash = {};
-       sdump('D_LEGACY','Successfully updated the Stat Cats\n');
-       alert('Successfully updated the Stat Cats\n');
-       populate_local_patron_stat_cats(
-               'patron_stat_cat_grid',
-               map_list(mw.G.my_orgs, function (obj) { return obj.id(); })
-       );
-       document.getElementById('patron_stat_cat_new').disabled = false;
-}
-
-function new_patron_stat_cat(ev) {
-       ev.target.disabled = true;
-       var n_actsc = new actsc();
-       n_actsc.isnew( '1' );
-       n_actsc.id( new_id-- );
-       n_actsc.owner( mw.G.user_ou.id() );
-       n_actsc.entries( [] );
-       local_patron_stat_cats.push( n_actsc );
-       local_patron_stat_cats_hash = convert_object_list_to_hash( local_patron_stat_cats );
-       populate_local_patron_stat_cats_grid('patron_stat_cat_grid');
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// GENERIC
diff --git a/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_bundle.xul b/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_bundle.xul
deleted file mode 100644 (file)
index 5b96161..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-<overlay id="stat_cat_bundle" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('stat_cat_bundle\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/stat_cat/stat_cat_overlay.xul"?>
-
-       <script src="stat_cat.js" />
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/stat_cat/stat_cat_overlay.xul
deleted file mode 100644 (file)
index ffda4b1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/stat_cat.dtd">
-<overlay id="stat_cat_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <vbox id="copy_stat_cat_editor" class="test_class" flex="1">
-               <grid id="copy_stat_cat_grid" flex="1" style="overflow: auto;"/>
-               <hbox id="copy_stat_cat_hbox2" flex="0">
-                       <button id="copy_stat_cat_new" label="New Stat Cat" oncommand="new_copy_stat_cat(event);"/>
-                       <spacer id="copy_stat_cat_spacer1" flex="1"/>
-                       <button id="copy_stat_cat_save" label="Save Changes" oncommand="save_copy_changes(event);"/>    
-               </hbox>
-       </vbox>
-       
-       <grid id="copy_stat_cat_grid">
-               <columns id="cscg_columns">
-                       <column id="cscg_label_column"/>
-                       <column id="cscg_textbox_column"/>
-                       <column id="cscg_checkbox_column"/>
-                       <column id="cscg_menulist_column"/>
-               </columns>
-               <rows id="cscg_rows"/>
-       </grid>
-
-       <vbox id="patron_stat_cat_editor" class="test_class" flex="1">
-               <grid id="patron_stat_cat_grid" flex="1" style="overflow: auto;"/>
-               <hbox id="patron_stat_cat_hbox2" flex="0">
-                       <button id="patron_stat_cat_new" label="New Stat Cat" oncommand="new_patron_stat_cat(event);"/>
-                       <spacer id="patron_stat_cat_spacer1" flex="1"/>
-                       <button id="patron_stat_cat_save" label="Save Changes" oncommand="save_patron_changes(event);"/>        
-               </hbox>
-       </vbox>
-       
-       <grid id="patron_stat_cat_grid">
-               <columns id="pscg_columns">
-                       <column id="pscg_label_column"/>
-                       <column id="pscg_textbox_column"/>
-                       <column id="pscg_checkbox_column"/>
-                       <column id="pscg_menulist_column"/>
-               </columns>
-               <rows id="pscg_rows"/>
-       </grid>
-       
-</overlay>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/survey/survey.js b/Evergreen/staff_client/chrome/content/evergreen/survey/survey.js
deleted file mode 100644 (file)
index 9af3461..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-dump('Loading survey.js\n');
-
-var SURVEY = {};
-
-function survey_init() {
-        dump('TESTING: survey.js: ' + mw.G.main_test_variable + '\n');
-       populate_lib_list_with_branch('lib_menulist','lib_menupopup',mw.G.user_ou,mw.G.user_ou); 
-       SURVEY['asv'] = new asv(); SURVEY['asv'].isnew('1');
-       SURVEY['num_of_questions'] = 0;
-       document.getElementById('survey_name').focus();
-}
-
-function save_survey() {
-       SURVEY.asv.description(
-               document.getElementById('survey_description').value
-       );
-       SURVEY.asv.name(
-               document.getElementById('survey_name').value
-       );
-       SURVEY.asv.owner(
-               document.getElementById('lib_menulist').value
-       );
-       var survey_start = document.getElementById('survey_start').value;
-       if (survey_start) {
-               SURVEY.asv.start_date(
-                       survey_start
-               );
-       } else {
-               SURVEY.asv.start_date(
-                       null
-               );
-       }
-       var survey_end = document.getElementById('survey_end').value;
-       if (survey_end) {
-               SURVEY.asv.end_date(
-                       survey_end
-               );
-       } else {
-               SURVEY.asv.end_date(
-                       null
-               );
-       }
-       if ( document.getElementById('required_checkbox').checked ) {
-               SURVEY.asv.required('1');
-       } else {
-               SURVEY.asv.required('0');
-       }
-       if ( document.getElementById('opac_checkbox').checked ) {
-               SURVEY.asv.opac('1');
-       } else {
-               SURVEY.asv.opac('0');
-       }
-       if ( document.getElementById('poll_checkbox').checked ) {
-               SURVEY.asv.poll('1');
-       } else {
-               SURVEY.asv.poll('0');
-       }
-
-       if ( document.getElementById('patron_summary_checkbox').checked ) {
-               SURVEY.asv.usr_summary('1');
-       } else {
-               SURVEY.asv.usr_summary('0');
-       }
-       dump('before survey = ' + js2JSON( SURVEY.asv ) + '\n');
-       try {
-               var result = user_request(
-                       'open-ils.circ',
-                       'open-ils.circ.survey.create',
-                       [ mw.G.auth_ses[0], SURVEY.asv ]
-               )[0];
-               dump('result = ' + js2JSON( result ) + '\n');
-               if (! (result instanceof asv) ) {
-                       throw('save_survey: result not an asv');
-               }
-       } catch(E) {
-               dump('Survey failed: ' + js2JSON(E) + '\n');
-               alert('Survey failed: ' + js2JSON(E) + '\n');
-               throw(E);
-       }
-       dump('after  survey = ' + js2JSON( SURVEY.asv ) + '\n');
-}
-
-function setDescription(e,t) {
-       var page = document.getElementById(e);
-       var desc = page.getAttribute('description');
-       var value = document.getElementById(t).value;
-       page.setAttribute('description',desc + ' ' + value); 
-}
-
-var new_id = -1;
-function add_answer(e, my_asvq_id) {
-       var row = e.target.parentNode;
-       var rows = row.parentNode;
-       var answer = e.target.previousSibling; answer.select();
-
-       if (! answer.value ) { return; }
-       
-       /* XUL */
-       var n_row = document.createElement('row');
-       rows.insertBefore( n_row, row );
-       var label_1 = document.createElement('label');
-       n_row.appendChild( label_1 );
-       var label_2 = document.createElement('label');
-               label_2.setAttribute('value', answer.value );
-       n_row.appendChild( label_2 );
-
-       /* OBJECT */
-
-       var my_asva = new asva(); my_asva.isnew('1'); my_asva.id( new_id-- );
-       my_asva.answer( answer.value );
-
-       var my_asvq = find_id_object_in_list( SURVEY.asv.questions(), my_asvq_id );
-       if (my_asvq.answers() == null) {
-               my_asvq.answers( [] );
-       }
-
-       my_asvq.answers().push( my_asva );
-
-       var num_of_answers = my_asvq.answers().length;
-       var last_number = 96 + num_of_answers;
-       var next_number = 97 + num_of_answers;
-       var last_letter = String.fromCharCode( last_number );
-       var next_letter = String.fromCharCode( next_number );
-       label_1.setAttribute('value', last_letter + ')' );
-       row.firstChild.setAttribute('value', next_letter + ')' );
-
-       if (num_of_answers == 26) {
-               rows.removeChild(row);
-       }
-}
-
-function add_question() {
-       SURVEY.num_of_questions++;
-       var question = document.getElementById('new_question');
-
-       if (! question.value ) { return; }
-
-       document.getElementById('survey_add').canAdvance = true;
-
-       var my_asvq = new asvq(); my_asvq.isnew('1'); my_asvq.id( new_id-- );
-       my_asvq.question( question.value );
-
-       if ( SURVEY.asv.questions() == null ) {
-               SURVEY.asv.questions( [] );
-       }
-
-       SURVEY.asv.questions().push( my_asvq );
-
-       add_question_row(my_asvq);
-
-       document.getElementById('new_question_label').setAttribute('value', '#' + (SURVEY.num_of_questions + 1) );
-       question.select();
-}
-
-function add_question_row(my_asvq) {
-       var rows = document.getElementById('page2_grid1_rows');
-       var row = document.createElement('row');
-       rows.insertBefore(row, document.getElementById('page2_grid1_row1'));
-
-       var label_number = document.createElement('label');
-               label_number.setAttribute('value','#' + SURVEY['num_of_questions']);
-       row.appendChild(label_number);
-
-       var grid = document.createElement('grid');
-       row.appendChild(grid);
-       var g_cols = document.createElement('columns');
-       grid.appendChild(g_cols);
-       var g_col_1 = document.createElement('column');
-       g_cols.appendChild(g_col_1);
-       var g_col_2 = document.createElement('column');
-               g_col_2.setAttribute('flex','1');
-       g_cols.appendChild(g_col_2);
-       var g_col_3 = document.createElement('column');
-       g_cols.appendChild(g_col_3);
-       var g_rows = document.createElement('rows');
-       grid.appendChild(g_rows);
-       var g_row_1 = document.createElement('row');
-       g_rows.appendChild(g_row_1);
-       var g_label_1 = document.createElement('label');
-       g_row_1.appendChild(g_label_1);
-       var g_label_2 = document.createElement('label');
-               g_label_2.setAttribute('value', my_asvq.question() );
-       g_row_1.appendChild(g_label_2);
-       var g_row_2 = document.createElement('row');
-       g_rows.appendChild(g_row_2);
-       var g_label2_1 = document.createElement('label');
-               g_label2_1.setAttribute('value', 'a)' );
-       g_row_2.appendChild(g_label2_1);
-       var g_tb = document.createElement('textbox');
-               g_tb.setAttribute('flex','1');
-       g_row_2.appendChild(g_tb);
-       var g_b = document.createElement('button');
-               g_b.setAttribute('label','Save this Response');
-               g_b.setAttribute('oncommand','add_answer(event,' + my_asvq.id() + ');');
-       g_row_2.appendChild(g_b);
-
-       var blank = document.createElement('row');
-       rows.insertBefore( blank , document.getElementById('page2_grid1_row1') );
-       var blank2 = document.createElement('label');
-               blank2.setAttribute('value', ' ');
-       blank.appendChild( blank2 );
-}
-
-function page1_check_advance() {
-       if ( document.getElementById('survey_name').value ) {
-               document.getElementById('survey_add').canAdvance = true;
-       } else {
-               document.getElementById('survey_add').canAdvance = false;
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/survey/survey_bundle.xul b/Evergreen/staff_client/chrome/content/evergreen/survey/survey_bundle.xul
deleted file mode 100644 (file)
index 1419b59..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/survey.dtd">
-<overlay id="survey_bundle" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('survey_bundle\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/survey/survey_overlay.xul"?>
-
-       <script src="survey.js" />
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/survey/survey_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/survey/survey_overlay.xul
deleted file mode 100644 (file)
index aa4e813..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/survey.dtd">
-<overlay id="survey_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <wizardpage id="page1" 
-               description="&survey.wizard.page1;" 
-               onpageadvanced="setDescription('page2','survey_name');"
-               onpageshow="document.getElementById('survey_add').canAdvance = false; document.getElementById('survey_name').focus();"
-       >
-               <grid id="page1_grid1"/>
-       </wizardpage>
-
-       <grid id="page1_grid1">
-               <columns id="page1_grid1_columns">
-                       <column id="page1_grid1_column1"/>
-                       <column id="page1_grid1_column2"/>
-                       <column id="page1_grid1_column3"/>
-                       <column id="page1_grid1_column4"/>
-               </columns>
-               <rows id="page1_grid1_rows">
-                       <row id ="page1_grid1_row1"/>
-                       <row id ="page1_grid1_row1c"/>
-                       <row id ="page1_grid1_row1a"/>
-                       <row id ="page1_grid1_row1b"/>
-                       <row id ="page1_grid1_row2"/>
-                       <row id ="page1_grid1_row3"/>
-               </rows>
-       </grid>
-
-       <row id="page1_grid1_row1">
-               <label id="page1_row1_label1" value="Available to:" class="wizard_label"/>
-               <menulist id="lib_menulist">
-                       <menupopup id="lib_menupopup"/>
-               </menulist>
-               <label id="page1_row1_label2" value="Required:" class="wizard_label"/>
-               <checkbox id="required_checkbox"/>
-       </row>
-       
-       <row id="page1_grid1_row1c">
-               <label id="page1_row1c_label1"/>
-               <label id="page1_row1c_label2"/>
-               <label id="page1_row1c_label3" value="Poll Format:" class="wizard_label"/>
-               <checkbox id="poll_checkbox"/>
-       </row>
-
-
-       <row id="page1_grid1_row1a">
-               <label id="page1_row1a_label1"/>
-               <label id="page1_row1a_label2"/>
-               <label id="page1_row1a_label3" value="OPAC Visible:" class="wizard_label"/>
-               <checkbox id="opac_checkbox"/>
-       </row>
-
-       <row id="page1_grid1_row1b">
-               <label id="page1_row1b_label1"/>
-               <label id="page1_row1b_label2"/>
-               <label id="page1_row1b_label3" value="Staff Client:" class="wizard_label"/>
-               <checkbox id="patron_summary_checkbox"/>
-       </row>
-
-       <row id="page1_grid1_row2">
-               <label id="page1_row2_label1" value="Name:" class="wizard_label"/>
-               <textbox id="survey_name" onchange="page1_check_advance();" onkeyup="page1_check_advance();" />
-               <label id="page1_row2_label2" value="Start:" class="wizard_label"/>
-               <textbox id="survey_start"/>
-       </row>
-
-       <row id="page1_grid1_row3">
-               <label id="page1_row3_label1" value="Description:" class="wizard_label"/>
-               <textbox id="survey_description" multiline="true" rows="4"/>
-               <label id="page1_row3_label2" value="End:" class="wizard_label"/>
-               <vbox id="page1_row3_vbox1">
-               <textbox id="survey_end"/>
-               </vbox>
-       </row>
-
-       <wizardpage id="page2" 
-               description="&survey.wizard.page2;" 
-               onpageshow="document.getElementById('survey_add').canAdvance = false; document.getElementById('new_question').focus();"
-       >
-               <separator id="page2_separator1"/>
-               <grid id="page2_grid1"/>
-       </wizardpage>
-
-       <grid id='page2_grid1'>
-               <columns id="page2_grid1_columns">
-                       <column id="page2_grid1_column1"/>
-                       <column id="page2_grid1_column2" flex="1"/>
-                       <column id="page2_grid1_column3"/>
-               </columns>
-               <rows id="page2_grid1_rows"/>
-       </grid>
-
-
-       <rows id="page2_grid1_rows">
-               <row id="page2_grid1_row1">
-                       <label id="new_question_label" value="#1"/>
-                       <textbox id="new_question" flex="1"/>
-                       <button id="page2_button1" label="Save this Question" oncommand="add_question(event);"/>
-               </row>
-       </rows>
-
-</overlay>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/survey/survey_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/survey/survey_wizard.xul
deleted file mode 100644 (file)
index 04a4463..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/survey.css" type="text/css"?>
-<!-- This DTD declaration needs to be fixed for Mozilla locales -->
-<!DOCTYPE wizard SYSTEM "chrome://evergreen/locale/survey.dtd">
-<wizard id="survey_add" title="&survey.wizard.title;" 
-       orient="vertical" style="overflow: auto"
-       onload="survey_init();" width="800" height="600"
-       onwizardfinish="save_survey();"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script src="chrome://evergreen/content/OpenSRF/JSON.js" />
-
-       <!-- Overlays for this XUL file -->
-       <!-- <?xul-overlay href="chrome://evergreen/content/OpenSRF/OpenSRF.xul"?> -->
-       <?xul-overlay href="chrome://evergreen/content/util/util_overlay.xul"?>
-       <?xul-overlay href="chrome://evergreen/content/survey/survey_bundle.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "evergreen";</script>
-       <OpenSRF id="OpenSRF_js" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <wizardpage id="page1"/>
-       <wizardpage id="page2"/>
-
-</wizard>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.js b/Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.js
deleted file mode 100644 (file)
index 1cba53f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Modified by Jason for Evergreen
-
-function startEvergreenStaffClient() {
-       if (! window.open('chrome://evergreen/content/auth/auth.xul','auth_win','chrome') )
-               alert('Could not start Evergreen');
-}
-
-function startEvergreenOPAC() {
-       var text = evergreenGetSelectedText();
-       var url = 'http://dev.gapines.org/';
-       if (text) {
-               url = 'http://dev.gapines.org/opac/'
-               + '?target=mr_result'
-               + '&mr_search_type=keyword'
-               + '&mr_search_query=' + encodeURIComponent( text )
-               + '&mr_search_location=1'
-               + '&mr_search_depth=0'
-               + '&page=0'
-               + '&sub_frame=1';
-       }
-       if (! window.open(url,'dev.gapines.org') )
-               alert('Could not load http://dev.gapines.org/');
-}
-
-function evergreenGetSelectedText() {
-       var node = document.popupNode;
-       var selection = "";
-       var nodeLocalName = node.localName.toUpperCase();
-       if ((nodeLocalName == "TEXTAREA") || (nodeLocalName == "INPUT" && node.type == "text")) {
-               selection = node.value.substring(node.selectionStart, node.selectionEnd);
-       } 
-       else {
-               var focusedWindow = new XPCNativeWrapper(document.commandDispatcher.focusedWindow, 'document', 'getSelection()');
-               selection = focusedWindow.getSelection().toString();
-       }
-       selection = selection.replace(/(^\s+)|(\s+$)/g, "");
-
-       return selection;
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/util/browser_overlay.xul
deleted file mode 100644 (file)
index 156b7ec..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="util"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script src="chrome://evergreen/content/util/browser_overlay.js"/>
-
-       <popup id="contentAreaContextMenu">
-               <menuitem id="evergreen_right_click_menu" 
-                       label="Search Evergreen OPAC" 
-                       accesskey=""
-                       insertafter="context-stop" 
-                       oncommand="startEvergreenOPAC();"/>
-       </popup>
-
-       <menupopup id="menu_ToolsPopup">
-               <menuitem id="evergreen_tools_menu"
-                       insertafter="devToolsSeparator" 
-                       label="Evergreen Staff Client"
-                       accesskey="g" 
-                       oncommand="startEvergreenStaffClient();" />
-       </menupopup>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/datetime.js b/Evergreen/staff_client/chrome/content/evergreen/util/datetime.js
deleted file mode 100644 (file)
index a8ae14e..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-var timer = {};
-
-function timer_init(id) {
-       timer[id] = (new Date).getTime();
-}
-
-function timer_elapsed(id) {
-       if (! timer[id]) { timer_init(id); }
-       var ms = (new Date).getTime() - timer[id];
-       return( ms + 'ms (' + ms/1000 + 's)' );
-}
-
-function db_date2Date(date) {
-       var y  = date.substr(0,4);
-       var mo = date.substr(5,2);
-       var d  = date.substr(8,2);
-       var h  = date.substr(11,2);
-       var mi = date.substr(14,2);
-       var s  = date.substr(17,2);
-       return new Date(y,mo,d,h,mi,s);
-}
-
-function formatted_date(date,format) {
-       // pass in a Date object or epoch seconds or a postgres style date string (2005-07-19 10:38:25.211964-04)
-       if (typeof(date) == 'string') {
-               if (date.match(/:/) || date.match(/-/)) {
-                       date = db_date2Date(date);
-               } else {
-                       date = new Date( parseInt( date + '000' ) );
-               }
-       } else if (typeof(date) == 'undefined') {
-               date = new Date( parseInt( date + '000' ) );
-       }
-       var mm = date.getMonth() + 1; mm = mm.toString(); if (mm.length == 1) mm = '0' +mm;
-       var dd = date.getDate().toString(); if (dd.length == 1) dd = '0' +dd;
-       var yyyy = date.getFullYear().toString();
-       var yy = yyyy.substr(2);
-       var H = date.getHours(); H = H.toString(); if (H.length == 1) H = '0' + H;
-       var I = date.getHours(); if (I > 12) I -= 12; I = I.toString();
-       var M = date.getMinutes(); M = M.toString(); if (M.length == 1) M = '0' + M;
-       var s = format;
-       s = s.replace( /%m/g, mm );
-       s = s.replace( /%d/g, dd );
-       s = s.replace( /%Y/g, yyyy );
-       s = s.replace( /%D/g, mm + '/' + dd + '/' + yy );
-       s = s.replace( /%F/g, yyyy + '-' + mm + '-' + dd );
-       s = s.replace( /%H/g, H );
-       s = s.replace( /%I/g, I );
-       s = s.replace( /%M/g, M );
-       return s;
-}
-
-function interval_to_seconds ( $interval ) {
-
-        $interval = $interval.replace( /and/, ',' );
-        $interval = $interval.replace( /,/, ' ' );
-
-        var $amount = 0;
-       var results = $interval.match( /\s*\+?\s*(\d+)\s*(\w{1})\w*\s*/g);  
-       for (var i in results) {
-               var result = results[i].match( /\s*\+?\s*(\d+)\s*(\w{1})\w*\s*/ );
-               if (result[2] == 's') $amount += result[1] ;
-               if (result[2] == 'm') $amount += 60 * result[1] ;
-               if (result[2] == 'h') $amount += 60 * 60 * result[1] ;
-               if (result[2] == 'd') $amount += 60 * 60 * 24 * result[1] ;
-               if (result[2] == 'w') $amount += 60 * 60 * 24 * 7 * result[1] ;
-               if (result[2] == 'M') $amount += ((60 * 60 * 24 * 365)/12) * result[1] ;
-               if (result[2] == 'y') $amount += 60 * 60 * 24 * 365 * result[1] ;
-        }
-        return $amount;
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/error.js b/Evergreen/staff_client/chrome/content/evergreen/util/error.js
deleted file mode 100644 (file)
index c9b3ab1..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-sdump('D_TRACE',"Loading error.js\n");
-
-var consoleService = Components.classes['@mozilla.org/consoleservice;1']
-       .getService(Components.interfaces.nsIConsoleService);
-
-var printDebug = false;
-var consoleDump = true;
-var debugDump = true;
-var arg_dump_full = false;
-
-var sdump_levels = {
-       'D_NONE' : false,
-       'D_ALL' : false,
-       'D_ERROR' : true,
-       'D_DEBUG' : true,
-       'D_TRACE' :  false,
-       'D_TRACE_ENTER' :  false,
-       'D_TRACE_EXIT' :  false,
-       'D_TIMEOUT' :  false,
-       'D_FILTER' : false,
-       'D_CONSTRUCTOR' : false,
-       'D_FIREFOX' : false,
-       'D_LEGACY' : false,
-
-       'D_CLAM' : false,
-       'D_PAGED_TREE' : false,
-       'D_GRID_LIST' : false,
-       'D_HTML_TABLE' : false,
-       'D_TAB' : false,
-
-       'D_AUTH' : true,
-
-       'D_OPAC' : true,
-
-       'D_PATRON_SEARCH' : false,
-       'D_PATRON_SEARCH_FORM' : false,
-       'D_PATRON_SEARCH_RESULTS' : false,
-
-       'D_PATRON_DISPLAY' : false,
-       'D_PATRON_DISPLAY_STATUS' : false,
-       'D_PATRON_DISPLAY_CONTACT' : false,
-
-       'D_PATRON_ITEMS' : false,
-       'D_PATRON_CHECKOUT_ITEMS' : false,
-       'D_PATRON_HOLDS' : false,
-       'D_PATRON_BILLS' : false,
-       'D_PATRON_EDIT' : false,
-
-       'D_CHECKIN' : false,
-       'D_CHECKIN_ITEMS' : false,
-
-       'D_HOLD_CAPTURE' : false,
-       'D_HOLD_CAPTURE_ITEMS' : false,
-
-       'D_CAT' : false,
-
-       'D_PATRON_UTILS' : false,
-       'D_CIRC_UTILS' : false,
-
-       'D_FILE' : true,
-       'D_EXPLODE' : false,
-       'D_FM_UTILS' : false,
-       'D_PRINT' : true,
-       'D_SES' : true,
-       'D_SES_FUNC' : false,
-       'D_SES_RESULT' : true,
-       'D_SPAWN' : false,
-       'D_STRING' : false,
-       'D_UTIL' : false,
-       'D_WIN' : false,
-       'D_WIDGETS' : false
-
-};
-
-var sdump_last_time = new Date();
-
-function filter_console_init(p) {
-       sdump('D_FILTER',arg_dump(arguments,{0:true}));
-
-       var filterConsoleListener = {
-               observe: function( msg ) {
-                       try {
-                               p.observe_msg( msg );
-                       } catch(E) {
-                               alert(E);
-                       }
-               },
-               QueryInterface: function (iid) {
-                       if (!iid.equals(Components.interfaces.nsIConsoleListener) &&
-                               !iid.equals(Components.interfaces.nsISupports)) {
-                                       throw Components.results.NS_ERROR_NO_INTERFACE;
-                       }
-                       return this;
-               }
-       };
-       try {
-               consoleService.registerListener(filterConsoleListener); 
-       } catch(E) {
-               alert(E);
-       }
-
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function sdump(level,msg) {
-       try {
-               var now = new Date();
-               var message = now.valueOf() + '\tdelta = ' + (now.valueOf() - sdump_last_time.valueOf()) + '\n' + level + '\n' + msg;
-               if (sdump_levels['D_NONE']) return null;
-               if (sdump_levels[level]||sdump_levels['D_ALL']) {
-                       sdump_last_time = now;
-                       if (debugDump)
-                               debug(message);
-                       if (consoleDump)
-                               consoleService.logStringMessage(message);
-               }
-       } catch(E) {
-               dump('Calling sdump but ' + E + '\n');
-       }
-}
-
-function arg_dump(args,dump_these) {
-       var s = '*>*>*> Called function ';
-       try {
-               if (!dump_these)
-                       dump_these = {};
-               s += args.callee.toString().match(/\w+/g)[1] + ' : ';
-               for (var i = 0; i < args.length; i++)
-                       s += typeof(args[i]) + ' ';
-               s += '\n';
-               for (var i = 0; i < args.length; i++)
-                       if (dump_these[i]) {
-
-                               var arg = args[i];
-                               //dump('dump_these[i] = ' + dump_these[i] + '  arg = ' + arg + '\n');
-
-                               if (typeof(dump_these[i])=='string') {
-
-                                       if (dump_these[i].slice(0,1) == '.') {
-                                               var cmd = 'arg' + dump_these[i];
-                                               var result;
-                                               try {
-                                                       result = eval( cmd );
-                                               } catch(E) {
-                                                       result = cmd + ' ==> ' + E;
-                                               }
-                                               s += '\targ #' + i + ': ' + cmd + ' = ' + result;
-                                       } else {
-                                               var result;
-                                               try {
-                                                       result = eval( dump_these[i] );
-                                               } catch(E) {
-                                                       result = dump_these[i] + ' ==> ' + E;
-                                               }
-                                               s += '\targ #' + i + ': ' + result;
-                                       }
-
-                               } else {
-                                       s += '\targ #' + i + ' = ';
-                                       try {
-                                               //s += js2JSON( arg );
-                                               s += arg;
-                                       } catch(E) {
-                                               s += arg;
-                                       }
-                               }
-
-                               s += '\n';
-                               if (arg_dump_full)
-                                       s += 'Definition: ' + args.callee.toString() + '\n';
-
-                       }
-               return s;
-       } catch(E) {
-               return s + '\nDEBUG ME: ' + js2JSON(E) + '\n';
-       }
-}
-
-function handle_error(E,annoy) {
-       var s = '';
-       if (instanceOf(E,ex)) {
-               s += E.err_msg();
-               //s += '\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n';
-               //s += 'This error was anticipated.\n\n';
-               //s += js2JSON(E).substr(0,200) + '...\n\n';
-               if (snd_bad) snd_bad();
-       } else {
-               s += '\n\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n';
-               s += 'This is a bug that we will fix later.\n\n';
-               try {
-                       s += mw.js2JSON(E).substr(0,1024) + '\n\n';
-               } catch(E2) {
-                       try {
-                               s += E.substr(0,1024) + '\n\n';
-                       } catch(E3) {
-                               s += E + '\n\n';
-                       }
-               }
-               if (snd_really_bad) snd_really_bad();
-       }
-       sdump('D_ERROR',s);
-       if (annoy)
-               s_alert(s);
-       else
-               alert(s);
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/explode.js b/Evergreen/staff_client/chrome/content/evergreen/util/explode.js
deleted file mode 100644 (file)
index 594f770..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-sdump('D_TRACE','Loading explode.js\n');
-var EXPLODE = {};
-
-function explode_aou(id) {
-       return find_ou( mw.G.org_tree, id );
-}
-EXPLODE.aou = explode_aou;
-EXPLODE.au_homelib = explode_aou;
-
-function explode_ap(id) {
-       //return find_id_object_in_list( mw.G.ap_list, id );
-       return mw.G.ap_hash[ id ];
-}
-EXPLODE.ap = explode_ap;
-EXPLODE.au_profile = explode_ap;
-
-function magic_field_edit( ev, otype, o_id, field, explode ) {
-       sdump('D_TRACE','\nIn magic_field_edit\n')
-       var target = ev.target;
-       sdump('D_EXPLODE','\ttarget = ' + target + '\n');
-       sdump('D_EXPLODE','\totype = ' + otype + '\n');
-       sdump('D_EXPLODE','\tfield = ' + field + '\n');
-       var value = target.value;
-       sdump('D_EXPLODE','\tvalue = ' + value + '\n');
-       sdump('D_EXPLODE','\texplode = ' + explode + '\n');
-       try {
-               if (explode) {
-                       var command = ( 'value = EXPLODE.' + otype + '_' + field + '(' + value + ');' );
-                       sdump('D_EXPLODE','\tcommand = ' + command + '\n');
-                       eval( command );
-               }
-       } catch(E) {
-               sdump('D_EXPLODE', '\tNo EXPLODE.' + otype + '_' + field + '() defined\n' );
-       }
-       sdump('D_EXPLODE','\tvalue = ' + value + '\n');
-       sdump('D_EXPLODE','\t' + otype + '_id = ' + o_id + '\n');
-       // ######## method 1, node in element
-       var row = document.getElementById( otype + o_id );
-       if (row) {
-               var node = JSON2js(row.getAttribute('node'));
-               sdump('D_EXPLODE','\telem: original node = ' + js2JSON(node) + '\n');
-               var command = ( 'node.' + field + '(' + js2JSON(value) + ');');
-               eval(command);
-               var command2 = ( 'node.ischanged("1");');
-               eval(command2);
-               sdump('D_EXPLODE','\telem:    after edit = ' + js2JSON(node) + '\n');
-               row.setAttribute('node',js2JSON(node));
-       } else {
-               sdump('D_EXPLODE','\tCould not find containing element with id = ' + otype + o_id + '\n');
-       }
-       // ######## method 2, node in hash
-       try {
-               var myhash = eval('hash_'+otype);
-               if (typeof(myhash) == 'object') {
-                       if (! myhash[o_id] ) { myhash[o_id] = eval('new ' + otype + '();'); }
-                       sdump('D_EXPLODE','\thash: original node = ' + js2JSON(myhash[o_id]) + '\n');
-                       var command = ('myhash[o_id].' + field + '(' + js2JSON(value) + ');');
-                       eval(command);
-                       var command2 = ( 'myhash[o_id].ischanged("1");');
-                       eval(command2);
-                       sdump('D_EXPLODE','\thash:    after edit = ' + js2JSON(myhash[o_id]) + '\n');
-               }
-       } catch(E) {
-               sdump('D_EXPLODE','magic_field_edit: ' + js2JSON(E) + '\n');
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/file.js b/Evergreen/staff_client/chrome/content/evergreen/util/file.js
deleted file mode 100644 (file)
index 47bb3c5..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-sdump('D_TRACE','Loading file.js\n');
-
-var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
-       getService( Components.interfaces.nsIProperties );
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////
-
-function set_object_in_file(file,obj) {
-       try {
-               if (obj) {
-                       if (typeof(file)=='string') file = get_file( file );
-                       var f = create_output_stream(file);
-                       var obj_json = js2JSON( obj );
-                       f.write( obj_json, String( obj_json ).length ); f.close();
-               } else {
-                       throw('Tried setting obj = ' + obj + '\n');
-               }
-       } catch(E) {
-               sdump('D_FILE', 'set_object_in_file: ' + js2JSON(E) + '\n');
-               throw(E);
-       }
-}
-
-function get_object_in_file(file) {
-       try {
-               if (typeof(file)=='string') file = get_file( file );
-               if (file.exists()) {
-                       var f = create_input_stream(file);
-                       var data = f.read(-1);
-                       var obj = JSON2js( data );
-                       f.close();
-                       return obj;
-               } else {
-                       throw('File does not exist. ');
-               }
-       } catch(E) {
-               sdump('D_FILE', 'get_object_in_file: ' + js2JSON(E) + '\n');
-               throw(E);
-       }
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////
-
-function create_input_stream(file) {
-       try {
-               if (typeof(file)=='string') file = get_file( file );
-               var f = Components.classes["@mozilla.org/network/file-input-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileInputStream);
-               if (file && file.exists()) {
-                       f.init(file, 0x01, 0, 0);
-                       var s = Components.classes["@mozilla.org/scriptableinputstream;1"]
-                               .createInstance(Components.interfaces.nsIScriptableInputStream);
-                       if (f) {
-                               s.init(f);
-                               return s;
-                       }
-               }
-       } catch(E) {
-               sdump('D_ERROR', E);
-       }
-       return null;
-}
-
-function create_output_stream(file) {
-       try {
-               if (typeof(file)=='string') file = get_file( file );
-               var f = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileOutputStream);
-               if (file) {
-                       if (! file.exists()) file.create( 0, 0640 );
-                       f.init(file, 0x02 | 0x08 | 0x20, 0644, 0);
-                       return f;
-               }
-       } catch(E) {
-               sdump('D_ERROR', E);
-       }
-       return null;
-}
-
-function get_file( fname ) {
-       try {
-               file = dirService.get( "AChrom",  Components.interfaces.nsIFile );
-               file.append(mw.myPackageDir); file.append("content"); file.append("conf"); file.append(fname);
-               sdump('D_FILE','get_file( ' + fname + ').path = ' + file.path + '\n');
-               return file;
-       } catch(E) {
-               sdump('D_ERROR', E);
-               return null;
-       }
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/filter_console.xul b/Evergreen/staff_client/chrome/content/evergreen/util/filter_console.xul
deleted file mode 100644 (file)
index 2b8b9c3..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="filter_console_win" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading filter_console.xul\n');</script>
-
-       <script>
-       <![CDATA[
-
-               var rows; var containing; var not_containing;
-
-               function my_init() {
-
-                       rows = document.getElementById('filter_console_grid_rows');
-                       containing = document.getElementById('filter_console_containing');
-                       not_containing = document.getElementById('filter_console_not_containing');
-                       
-                       mw.filter_console_init( {'observe_msg':observe_msg} );
-                       build_sdump_menu();
-               }
-
-               function build_sdump_menu() {
-                       try {
-                               var mp = document.getElementById('fcmp');
-                               for (var i in mw.sdump_levels) {
-                                       var m = document.createElement( 'menuitem' );
-                                       mp.appendChild(m);
-                                       m.setAttribute('type','checkbox');
-                                       m.setAttribute('label',i);
-                                       m.setAttribute('checked',mw.sdump_levels[i]);
-                                       m.setAttribute('oncommand',
-                                               "mw.sdump_levels."+i+"=!mw.sdump_levels."+i+
-                                               "; this.setAttribute('checked',mw.sdump_levels."+i+");");
-                               }
-                       } catch(E) {
-                               alert(E);
-                       }
-               }
-
-               function observe_msg(msg) {
-
-                       try {
-                               var row = document.createElement('row');
-                               rows.appendChild(row);
-
-                               var hbox = document.createElement('hbox');
-                               row.appendChild(hbox);
-                               hbox.flex = 1;
-
-                               var tb = document.createElement('textbox');
-                               hbox.appendChild(tb);
-                               tb.setAttribute('multiline','true');
-                               tb.setAttribute('readonly','true');
-                               tb.setAttribute('rows','5');
-                               tb.setAttribute('flex','1');
-                               tb.setAttribute('value',msg.message);
-
-                       } catch(E) { dump(E) }
-               }
-
-               function test_filter(msg) {
-                       var pass = true;
-                       var c_array = containing.value.split(' ');
-                       var nc_array = not_containing.value.split(' ');
-                       for (var i = 0; i < c_array.length; i++) {
-                               var term = c_array[i];
-                               if (term != '' && term != null && term != undefined)
-                                       if (! msg.match( term ) )
-                                               pass = false;
-                       }
-                       for (var i = 0; i < nc_array.length; i++) {
-                               var term = nc_array[i];
-                               if (term != '' && term != null && term != undefined)
-                                       if (msg.match( term ) )
-                                               pass = false;
-                       }
-                       return pass;
-               }
-
-               function clear_rows(prune) {
-                       var delete_these = [];
-                       for (var i = 0; i < rows.childNodes.length; i++) {
-                               var row = rows.childNodes[i];
-                               var tb = row.firstChild.firstChild;
-                               var delete_me = ! test_filter(tb.value);
-                               if (!prune) delete_me = true;
-                               if (delete_me) delete_these.push( row ); 
-                       }
-                       var row; while (row = delete_these.pop()) { rows.removeChild(row); }
-               }
-
-               function hide_rows() {
-                       for (var i = 0; i < rows.childNodes.length; i++) {
-                               var row = rows.childNodes[i];
-                               var tb = row.firstChild.firstChild;
-                               row.hidden = ! test_filter(tb.value);
-                       }
-               }
-
-               function calc_delta() {
-                       var first;
-                       var last;
-                       for (var i = 0; i < rows.childNodes.length; i++) {
-                               var row = rows.childNodes[i];
-                               if (! row.hidden ) {
-                                       var tb = row.firstChild.firstChild;
-                                       if (!first) first = parseInt( tb.value.split(' ')[0] );
-                                       last = parseInt( tb.value.split(' ')[0] );
-                               }
-                       }
-                       document.getElementById('fc_calc_delta_label').setAttribute('value',last-first);
-               }
-
-       ]]>
-       </script>
-
-       <popupset>
-               <menupopup id="fcmp" position="after_start">
-               </menupopup>
-       </popupset>
-
-       <vbox id="filter_console_vbox" flex="1">
-               <groupbox id="filter_console_groupbox" orient="vertical" flex="1">
-                       <caption id="fcgbc" label="Filterable Javascript Console"/>
-                       <grid id="filter_console_nav_grid">
-                               <columns id="fcnvc"><column id="fcnvc1"/><column id="fcnvc2" flex="1"/></columns>
-                               <rows id="fcnvr">
-                                       <row id="fcnvr1">
-                                               <label id="fcgbhb1l" value="Containing:" class="text_right" accesskey="o" control="filter_console_containing"/>
-                                               <textbox id="filter_console_containing" flex="1"/>
-                                       </row>
-                                       <row id="fcnvr2">
-                                               <label id="fcgbhb1l" value="Not Containing:" class="text_right" accesskey="N" control="filter_console_not_containing"/>
-                                               <textbox id="filter_console_not_containing" flex="1"/>
-                                       </row>
-                                       <row id="fcnvr3">
-                                               <spacer id="fcnvr3s1"/>
-                                               <hbox id="fcnvr3hb1" flex="1">
-                                                       <button id="fc_sdump_levels" popup="fcmp" label="Set SDUMP Logging" accesskey="S"/>
-                                                       <button id="fc_filter_view" label="View with Filters" accesskey="V" oncommand="hide_rows();"/>
-                                                       <button id="fc_calc_delta" label="Delta (Last-1st sdump)" accesskey="D" oncommand="calc_delta();"/>
-                                                       <label id="fc_calc_delta_label" />
-                                                       <spacer id="fcnvr3hb1s1" flex="1"/>
-                                                       <button id="fc_filter_prune" label="Prune Hidden" accesskey="P" oncommand="clear_rows(true);"/>
-                                                       <button id="fc_clear" label="Clear" accesskey="C" oncommand="clear_rows(false);"/>
-                                               </hbox>
-                                       </row>
-                               </rows>
-                       </grid>
-                       <grid id="filter_console_grid" flex="1" style="overflow: auto;">
-                               <columns id="fcgc"><column id="fcgc1" flex="1"/></columns>
-                               <rows id="filter_console_grid_rows"/>
-                       </grid>
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/fm_utils.js b/Evergreen/staff_client/chrome/content/evergreen/util/fm_utils.js
deleted file mode 100644 (file)
index 7936453..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-sdump('D_TRACE','Loading fm_utils.js\n');
-
-function get_my_orgs(user_ou) {
-
-       // self and ancestors
-       var current_item_id = user_ou.id();
-       //sdump('D_FM_UTILS','mw.G[user_ou] = ' + js2JSON(mw.G['user_ou']) + '\n');
-       //sdump('D_FM_UTILS','current_item_id = ' + current_item_id + '\n');
-       var item_ou; var my_orgs = {}; var other_orgs = {};
-       while( item_ou = find_ou(mw.G['org_tree'],current_item_id) ) {
-               //sdump('D_FM_UTILS','\titem_ou = ' + js2JSON(item_ou) + '\n');
-               my_orgs[ item_ou.id() ] = item_ou;
-               current_item_id = item_ou.parent_ou();
-               if (!current_item_id) { break; }
-       }
-
-        current_item_id = user_ou.id();
-       //sdump('D_FM_UTILS','self & ancestors : my_orgs = <<<'+js2JSON(my_orgs)+'>>>\n');
-       // descendants
-       var my_children;
-        var find_ou_result = find_ou(mw.G['org_tree'],current_item_id);
-       if (find_ou_result) { 
-               my_children = find_ou_result.children() } 
-       else {
-               sdump('D_FM_UTILS','ERROR: find_ou(org_tree,'+current_item_id+') returned with no properties\n');
-       };
-       //sdump('D_FM_UTILS','my_children: ' + my_children + ' : ' + js2JSON(my_children) + '\n');
-        if (my_children) {
-                for (var i = 0; i < my_children.length; i++) {
-                        var my_child = my_children[i];
-                        my_orgs[ my_child.id() ] = my_child;
-                       //sdump('D_FM_UTILS','my_child.children(): ' + my_child.children() + ' : ' + js2JSON(my_child.children()) + '\n');
-                       if (my_child.children() != null) {
-                               for (var j = 0; j < my_child.children().length; j++) {
-                                       var my_gchild = my_child.children()[j];
-                                       my_orgs[ my_gchild.id() ] = my_gchild;
-                               }
-                       }
-                }
-        }
-       //sdump('D_FM_UTILS','& descendants : my_orgs = <<<'+js2JSON(my_orgs)+'>>>\n');
-       return my_orgs;
-}
-
-function get_other_orgs(org,other_orgs) {
-}
-
-function flatten_ou_branch(branch) {
-       //sdump('D_FM_UTILS','flatten: branch = ' + js2JSON(branch) + '\n');
-       var my_array = new Array();
-       my_array.push( branch );
-       for (var i in branch.children() ) {
-               var child = branch.children()[i];
-               if (child != null) {
-                       var temp_array = flatten_ou_branch(child);
-                       for (var j in temp_array) {
-                               my_array.push( temp_array[j] );
-                       }
-               }
-       }
-       return my_array;
-}
-
-/*
-function findOrgUnit(id) {
-       return find_ou(globalOrgTree, id);
-}
-*/
-
-function find_ou(tree,id) {
-       if (typeof(id)=='object') { id = id.id(); }
-       if (tree.id()==id) {
-               return tree;
-       }
-       for (var i in tree.children()) {
-               var child = tree.children()[i];
-               ou = find_ou( child, id );
-               if (ou) { return ou; }
-       }
-       return null;
-}
-
-function find_ou_by_shortname(tree,sn) {
-       var ou = new aou();
-       if (tree.shortname()==sn) {
-               return tree;
-       }
-       for (var i in tree.children()) {
-               var child = tree.children()[i];
-               ou = find_ou_by_shortname( child, sn );
-               if (ou) { return ou; }
-       }
-       return null;
-}
-
-function render_fm(d,obj) {
-       sdump('D_FM_UTILS',arg_dump(arguments,{1:true}));
-       var nl = d.getElementsByAttribute('render','true');
-       for (var i = 0; i < nl.length; i++) {
-               var node = nl[i];
-               var fm_class = node.getAttribute('fm_class');
-               var render_value = node.getAttribute('render_value');
-               var render_css_style = node.getAttribute('render_css_style');
-               var render_css_class = node.getAttribute('render_css_class');
-               if ( !fm_class ) continue;
-               if ( obj[ fm_class ] ) {
-                       sdump('D_FM_UTILS',"We're in:\n\trender_value = " + render_value + "\n\trender_css_style = " + render_css_style + "\n\trender_css_class = " + render_css_class + "\n");
-                       if (render_value) {
-                               var result = ''; var cmd = '';
-                               cmd = parse_render_string( 'obj[ fm_class ]', render_value );
-                               try { result = eval( cmd ); } catch(E) { sdump('D_ERROR',E); }
-                               set_widget_value_for_display( node, result );
-                               sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
-                       }
-                       if (render_css_style) {
-                               var result = ''; var cmd = '';
-                               cmd = parse_render_string( 'obj[ fm_class ]', render_css_style );
-                               cmd = parse_render_string( 'result', cmd, /\%\%/g );
-                               try { result = eval(cmd); } catch(E) { sdump('D_ERROR',E); }
-                               node.setAttribute('style',result);
-                               sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
-                       }
-                       if (render_css_class) {
-                               var result = ''; var cmd = '';
-                               cmd = parse_render_string( 'obj[ fm_class ]', render_css_class );
-                               cmd = cmd.replace( /\%\%/g, 'result' );
-                               try { result = eval(cmd); } catch(E) { sdump('D_ERROR',E); }
-                               node.setAttribute('class',result);
-                               sdump('D_FM_UTILS','\t<'+cmd+'> renders <'+result+'>\n');
-                       }
-               }
-       }
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/fm_view.xul b/Evergreen/staff_client/chrome/content/evergreen/util/fm_view.xul
deleted file mode 100644 (file)
index ddbd561..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-<!-- Screen: About -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-
-<window id="fm_view_win" 
-       onload="try { my_init(); } catch(E) { alert(E); }"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>mw.sdump('D_TRACE','Loading fm_view.xul\n');</script>
-
-       <script>
-       <![CDATA[
-               var tree;
-
-               function my_init() {
-                       var treechildren = window.document.getElementById('tc');
-                       var fm = mw.user_request('open-ils.actor','opensrf.open-ils.system.fieldmapper',[])[0];
-                       var fma = []; var fmh = {} ; 
-                       for (var i in fm) { fmh[ fm[i].hint ] = fm[i]; fma.push( [ fm[i].hint, i ] ); }
-                       fma.sort();
-                       for (var i = 0; i < fma.length; i++) {
-                               var hint = fma[i][0]; var name = fma[i][1]; var o = fmh[ hint ];
-                               var ti = window.document.createElement('treeitem');
-                               treechildren.appendChild( ti );
-                               ti.setAttribute( 'container', 'true' );
-                               var tr = window.document.createElement('treerow');
-                               ti.appendChild( tr );
-                               var tc = window.document.createElement('treecell');
-                               tr.appendChild( tc );
-                               tc.setAttribute('label',hint);
-                               tc = window.document.createElement('treecell');
-                               tr.appendChild( tc );
-                               tc.setAttribute('label', name );
-                               var _treechildren = window.document.createElement( 'treechildren' );
-                               ti.appendChild( _treechildren );
-                               for (var j in o.fields) {
-                                       var _ti = window.document.createElement( 'treeitem' );
-                                       _treechildren.appendChild( _ti );
-                                       _ti.setAttribute('fm_class',hint);
-                                       _ti.setAttribute('fm_field',j);
-                                       _ti.setAttribute('fm_virtual',o.fields[j].virtual);
-                                       _ti.setAttribute('fm_position',o.fields[j].position);
-                                       var _tr = window.document.createElement( 'treerow' );
-                                       _ti.appendChild( _tr );
-                                       var _tc = window.document.createElement( 'treecell' );
-                                       _tr.appendChild( _tc );
-                                       _tc.setAttribute('label',j);
-                                       _tc = window.document.createElement( 'treecell' );
-                                       _tr.appendChild( _tc );
-                                       _tc.setAttribute('label','\t         Position: ' + o.fields[j].position + '  Virtual: ' + o.fields[j].virtual);
-                               }
-                       }
-                       tree = window.document.getElementById('t');
-                       tree.view.selection.select( 0 ); tree.focus();
-               }
-
-               function gen_cols() {
-                       var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
-                       var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
-                       var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
-                       var treeitems = mw.get_list_from_tree_selection( tree );
-                       setTimeout(
-                               function() {
-                                       var tb = w.document.getElementById('desc');
-                                       for (var i = 0; i < treeitems.length; i++) {
-                                               var hint = treeitems[i].getAttribute('fm_class');
-                                               var field = treeitems[i].getAttribute('fm_field');
-                                               var text = (
-                                                       "{\n\t'id' : '" + field + "', 'label' : getString('" + hint + "_" + 
-                                                       field + "_label'), 'flex' : 1,\n" + 
-                                                       "\t'primary' : false, 'hidden' : false, 'fm_class' : '" + hint + 
-                                                       "', 'fm_field_render' : '." + field + "()'\n},\n"
-                                               );
-                                               tb.value += text;
-                                       }
-                                       dump(tb.value + '\n');
-                               }, 0
-                       );
-               }
-
-               function gen_properties() {
-                       var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
-                       var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
-                       var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
-                       var treeitems = mw.get_list_from_tree_selection( tree );
-                       setTimeout(
-                               function() {
-                                       var tb = w.document.getElementById('desc');
-                                       for (var i = 0; i < treeitems.length; i++) {
-                                               var hint = treeitems[i].getAttribute('fm_class');
-                                               var field = treeitems[i].getAttribute('fm_field');
-                                               var pretty = mw.map_list(
-                                                       field.split('_'),
-                                                       function (s) {
-                                                               return s.substr(0,1).toUpperCase() + s.substr(1);
-                                                       }
-                                               ).join(' ');
-                                               var text = (
-                                                       hint + '_' + field + '_label=' + pretty + '\n'
-                                               );
-                                               tb.value += text;
-                                       }
-                                       dump(tb.value + '\n');
-                               }, 0
-                       );
-               }
-
-               function gen_wikitable() {
-                       var data_url = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><?xml-stylesheet href="chrome://global/skin" type="text/css"?><vbox flex="1"><textbox id="desc" multiline="true" flex="1"/></vbox></window>';
-                       var w = mw.SafeWindowOpen(data_url,'paged_tree cols','chrome,resizable,width=800,height=600');
-                       var css = '<?xml-stylesheet href="data:text/css,#a{-moz-box-flex:1;}"?>';
-                       var treeitems = mw.get_list_from_tree_selection( tree );
-                       setTimeout(
-                               function() {
-                                       var tb = w.document.getElementById('desc');
-                                       for (var i = 0; i < treeitems.length; i++) {
-                                               var hint = treeitems[i].getAttribute('fm_class');
-                                               var field = treeitems[i].getAttribute('fm_field');
-                                               var text = (
-                                                       '|' + hint + '|' + field
-                                               );
-                                       
-                                               if (treeitems[i].getAttribute('fm_virtual') == '1') text += ' * ';
-                                               text += '|\n'
-                                               tb.value += text;
-                                       }
-                                       dump(tb.value + '\n');
-                               }, 0
-                       );
-               }
-
-
-       ]]>
-       </script>
-
-       <vbox flex="1" class="my_overflow">
-               <groupbox orient="vertical" flex="1">
-                       <caption label="Fieldmapper Class Viewer"/>
-                       <hbox>
-                               <button label="Generate paged_tree cols for selected fields" accesskey="G" oncommand="gen_cols();"/>
-                               <button label="Generate string bundle properties for selected fields" accesskey="P" oncommand="gen_properties();"/>
-                               <button label="Generate dokuwiki table for selected fields" accesskey="P" oncommand="gen_wikitable();"/>
-                       </hbox>
-                       <tree id="t" flex="1">
-                               <treecols>
-                                       <treecol id="tcol1" label="opensrf.open-ils.system.fieldmapper" primary="true" flex="0"/>
-                                       <treecol id="tcol2" label="" flex="1"/>
-                               </treecols>
-                               <treechildren id="tc"/>
-                       </tree>
-               </groupbox>
-       </vbox>
-
-</window>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/functional.js b/Evergreen/staff_client/chrome/content/evergreen/util/functional.js
deleted file mode 100644 (file)
index 84f6e01..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-sdump('D_FUNCTIONAL',"Loading functional.js\n");
-
-function filter_list(list,f) {
-       var new_list = [];
-       for (var i in list) {
-               var t = f( list[i] );
-               if (t) new_list.push( list[i] );
-       }
-       return new_list;
-}
-
-function filter_object(obj,f) {
-       var new_obj = {};
-       for (var i in obj) {
-               var t = f( i, obj[i] );
-               if (t) new_obj[i] = obj[i];
-       }
-       return new_obj;
-}
-
-function find_list(list,f) {
-       for (var i in list) {
-               var t = f( list[i] );
-               if (t) return list[i];
-       }
-       return null;
-}
-
-function find_object(obj,f) {
-       for (var i in obj) {
-               var t = f( i, obj[i] );
-               if (t) return obj[i];
-       }
-       return null;
-}
-
-function map_list(list,f) {
-       var new_list = [];
-       for (var i in list) {
-               new_list.push( f( list[i] ) );
-       }
-       return new_list;
-}
-
-function map_flat_list(list,f) {
-       var new_list = [];
-       for (var i in list) {
-               new_list = new_list.concat( f( list[i] ) );
-       }
-       return new_list;
-}
-
-function map_object(obj,f) {
-       var new_obj = {};
-       for (var i in obj) {
-               new_obj[ f( i, obj[i] )[0] ] = f( i, obj[i] )[1];
-       }
-       return new_obj;
-}
-
-function map_object_to_list(obj,f) {
-       var new_list = [];
-       for (var i in obj) {
-               new_list.push( f( obj, i ) );
-       }
-       return new_list;
-}
-
-function convert_object_list_to_hash(list) {
-       var my_hash = new Object();
-       if (list) {
-               for (var i = 0; i < list.length; i++) {
-                       my_hash[ list[i].id() ] = list[i];
-               }
-       }
-       return my_hash;
-}
-
-function find_id_object_in_list(list,id) {
-       //sdump('D_FUNCTIONAL','find_id_object_in_list(' + js2JSON(list).substr(0,20) + '... ,' + id + ')\n');
-       if (list) {
-               for (var i = 0; i < list.length; i++ ) {
-                       try {
-                               if ( list[i].id() == id ) {
-                                       return list[i];
-                               }
-                       } catch(E) {
-                               sdump('D_FUNCTIONAL','find_id_object_in_list error, i = ' + i + '  typeof(list[i]) = ' + typeof(list[i]) + '  list[i] = ' + js2JSON(list[i]) + ' : ' + js2JSON(E) + '\n');
-                       }
-               }
-       }
-       //sdump('D_FUNCTIONAL','not found\n');
-       return null;
-}
-
-function find_attr_object_in_list(list,attr,value) {
-       if (list) {
-               for (var i = 0; i < list.length; i++ ) {
-                       sdump('D_FUNCTIONAL','find_attr_object_in_list: i = ' + i + '  id = ' + list[i].id() + '\n');
-                       try {
-                               var command = 'list[' + i + '].'+attr+'() == ' + value;
-                               if ( eval(command) ) {
-                                       return list[i];
-                               }
-                       } catch(E) {
-                               sdump('D_FUNCTIONAL','find_attr_object_in_list error, i = ' + i + '  typeof(list[i]) = ' + typeof(list[i]) + '  list[i] = ' + js2JSON(list[i]) + ' :   list = ' + js2JSON(list) + ' : ' + js2JSON(E) + '\n');
-                       }
-               }
-       }
-       return null;
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/make_wiki_table.pl b/Evergreen/staff_client/chrome/content/evergreen/util/make_wiki_table.pl
deleted file mode 100755 (executable)
index 03d9608..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-
-print "^ file ^ functions ^\n";
-while ($f = pop @ARGV) {
-       print("|" . $f . "|");
-       open FILE, $f;
-       while ($line = <FILE>) {
-               if ($line =~ /^function\s+(\w+)\s*(\(.*\))/) {
-                       print $1 . $2 . '\\' . '\\' . ' ';
-               }
-       }
-       print "|\n";
-       close FILE;
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/populate.js b/Evergreen/staff_client/chrome/content/evergreen/util/populate.js
deleted file mode 100644 (file)
index 86e48b4..0000000
+++ /dev/null
@@ -1,525 +0,0 @@
-sdump('D_TRACE','Loading populate.js\n');
-
-function populate_listbox_with_local_stat_cats_myself(local_stat_cats,local_cat_entries,listbox,libs,app,method,editable) {
-       sdump('D_TRACE','populate_local_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
-       local_stat_cats = user_request(
-               app,
-               method,
-               [ mw.G.auth_ses[0], libs ]
-       )[0];
-       //sdump('D_POPULATE','local_stat_cats = ' + pretty_print( js2JSON( local_stat_cats ) ) + '\n');
-
-       var list = listbox;
-       if (typeof list != 'object') list = document.getElementById(list);
-
-       for (var i in local_stat_cats) {
-
-               var stat_cat = local_stat_cats[i];
-
-               var listitem = document.createElement('listitem'); 
-               list.appendChild(listitem);
-               listitem.setAttribute('allowevents','true');
-               sdump('D_POPULATE','listitem = ' + listitem + '\n');
-
-                       var label = document.createElement('listcell'); 
-                       listitem.appendChild(label);
-                       label.setAttribute('label',stat_cat.name() );
-                       sdump('D_POPULATE','\tlistcell = ' + label + '\n');
-
-                       var menucell = document.createElement('listcell'); 
-                       listitem.appendChild(menucell);
-                       sdump('D_POPULATE','\tlistcell = ' + menucell + '\n');
-
-                               var menulist = document.createElement('menulist');
-                               menucell.appendChild(menulist);
-                               if (editable) { menulist.setAttribute('editable','true'); }
-                               menulist.setAttribute('id','menulist_stat_cat_'+stat_cat.id());
-                               sdump('D_POPULATE','\tmenulist = ' + menulist + '\n');
-
-                                       var menupopup = document.createElement('menupopup');
-                                       menulist.appendChild(menupopup);
-                                       menupopup.setAttribute('stat_cat',stat_cat.id());
-                                       menupopup.setAttribute('oncommand','apply_attribute(event);');
-                                       sdump('D_POPULATE','\t\tmenupopup = ' + menupopup + '\n');
-
-               for (var j in stat_cat.entries() ) {
-
-                       var stat_entry = stat_cat.entries()[j];
-                       local_stat_cat_entries[stat_entry.id()] = stat_entry;
-
-                       var menuitem = document.createElement('menuitem');
-                       menupopup.appendChild(menuitem);
-                       menuitem.setAttribute('label',stat_entry.value());
-                       if (editable) {
-                               menuitem.setAttribute('value',stat_entry.value());
-                       } else {
-                               menuitem.setAttribute('value',stat_entry.id());
-                       }
-                       menuitem.setAttribute('stat_cat',stat_cat.id());
-                       menuitem.setAttribute('id','menuitem_stat_cat_entry_' + stat_entry.id());
-                       sdump('D_POPULATE','\t\t\tmenuitem = ' + menuitem + '\n');
-
-               }
-
-       }
-
-       //sdump('D_POPULATE','local_stat_cat_entries = ' + pretty_print( js2JSON( local_stat_cat_entries ) ) + '\n');
-
-}
-
-function populate_rows_with_local_stat_cats(local_stat_cats,local_stat_cat_entries,rows,editable) {
-       //sdump('D_TRACE','populate_local_stat_cats: pertinent libs = ' + js2JSON(libs) + '\n');
-
-       /*local_stat_cats = user_request(
-               app,
-               method,
-               [ mw.G.auth_ses[0], libs ]
-       )[0];*/
-       //sdump('D_POPULATE','local_stat_cats = ' + pretty_print( js2JSON( local_stat_cats ) ) + '\n');
-
-       if (typeof rows != 'object') rows = document.getElementById(rows);
-
-       for (var i in local_stat_cats) {
-
-               var stat_cat = local_stat_cats[i];
-
-               //alert('local stat_cat = ' + js2JSON(stat_cat) );
-
-               var row = document.createElement('row');
-               rows.appendChild(row);
-
-               var label = document.createElement('label');
-               label.setAttribute('value',stat_cat.name());
-               row.appendChild(label);
-
-               var menulist = document.createElement('menulist');
-               row.appendChild(menulist);
-               if (editable) { menulist.setAttribute('editable','true'); }
-               menulist.setAttribute('id','menulist_stat_cat_'+stat_cat.id());
-               //alert('menulist_stat_cat_'+stat_cat.id());
-               menulist.setAttribute('stat_cat_id',stat_cat.id());
-               sdump('D_POPULATE','\tmenulist = ' + menulist + '\n');
-
-                       var menupopup = document.createElement('menupopup');
-                       menulist.appendChild(menupopup);
-                       menupopup.setAttribute('stat_cat',stat_cat.id());
-                       menupopup.setAttribute('command','cmd_apply');
-                       sdump('D_POPULATE','\t\tmenupopup = ' + menupopup + '\n');
-
-               for (var j in stat_cat.entries() ) {
-
-                       var stat_entry = stat_cat.entries()[j];
-                       local_stat_cat_entries[stat_entry.id()] = stat_entry;
-
-                       var menuitem = document.createElement('menuitem');
-                       menupopup.appendChild(menuitem);
-                       menuitem.setAttribute('label',stat_entry.value());
-                       if (editable) {
-                               menuitem.setAttribute('value',stat_entry.value());
-                       } else {
-                               menuitem.setAttribute('value',stat_entry.id());
-                       }
-                       menuitem.setAttribute('stat_cat',stat_cat.id());
-                       menuitem.setAttribute('id','menuitem_stat_cat_entry_' + stat_entry.id());
-                       sdump('D_POPULATE','\t\t\tmenuitem = ' + menuitem + '\n');
-
-               }
-
-       }
-
-       sdump('D_POPULATE','local_stat_cat_entries = ' + pretty_print( js2JSON( local_stat_cat_entries ) ) + '\n');
-
-}
-
-function populate_copy_status_list(menulist,menupopup,defaultccs) {
-       sdump('D_TRACE','populate_copy_status_list\n');
-       var popup = document.getElementById(menupopup);
-
-       if (popup) {
-               empty_widget(popup);
-               for (var i in mw.G.ccs_list) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', mw.G.ccs_list[i].name()); 
-                       menuitem.setAttribute('value', mw.G.ccs_list[i].id()); 
-                       menuitem.setAttribute('id', 'ccsitem' + mw.G.ccs_list[i].id()); 
-                       //sdump('D_POPULATE','pop_ccs_list: i = ' + i + ' ccs = ' + mw.G.ccs_list[i] + ' = ' + js2JSON(mw.G.ccs_list[i]) + '\n');
-                       popup.appendChild(menuitem);
-               }
-               var list = document.getElementById(menulist);
-               if (list && defaultccs) {
-                       if (typeof defaultccs == 'object') {
-                               defaultccs = defaultccs.id();   
-                       }
-                       var menuitem_id = 'ccsitem' + defaultccs;
-                       var menuitem = document.getElementById(
-                               menuitem_id
-                       );
-                       var  menulist_e = document.getElementById(menulist);
-                       if (menulist_e && menuitem) { 
-                               sdump('D_POPULATE','Setting default ccs\n');
-                               menulist_e.selectedItem = menuitem; 
-                       } else {
-                               sdump('D_POPULATE','Not Setting default ccs\n');
-                       }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_copy_status_list: Could not find menupopup: ' + menupopup + '\n');
-                       throw('populate_copy_status_list: Could not find menupopup: ' + menupopup + '\n');
-       }
-
-}
-
-function populate_copy_location_list(menulist,menupopup,defaultacpl) {
-       sdump('D_TRACE','populate_copy_location_list\n');
-       var popup = document.getElementById(menupopup);
-
-       if (popup) {
-               empty_widget(popup);
-               for (var i in mw.G.acpl_my_orgs) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', mw.G.acpl_my_orgs[i].name()); 
-                       menuitem.setAttribute('value', mw.G.acpl_my_orgs[i].id()); 
-                       menuitem.setAttribute('id', 'acplitem' + mw.G.acpl_my_orgs[i].id()); 
-                       //sdump('D_POPULATE','populate_copy_location_list: i = ' + i + ' acpl_my_orgs = ' + mw.G.acpl_my_orgs[i] + ' = ' + js2JSON(mw.G.acpl_my_orgs[i]) + '\n');
-                       popup.appendChild(menuitem);
-               }
-               var list = document.getElementById(menulist);
-               if (list && defaultacpl) {
-                       if (typeof defaultacpl == 'object') {
-                               defaultacpl = defaultacpl.id(); 
-                       }
-                       var menuitem_id = 'acplitem' + defaultacpl;
-                       var menuitem = document.getElementById(
-                               menuitem_id
-                       );
-                       var menulist_e = document.getElementById(menulist);
-                       if (menulist_e && menuitem) { menulist_e.selectedItem = menuitem; }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_copy_location_list: Could not find menupopup: ' + menupopup + '\n');
-                       throw('populate_copy_location_list: Could not find menupopup: ' + menupopup + '\n');
-       }
-
-}
-
-function populate_lib_list(menulist,menupopup,defaultlib,id_flag) {
-       sdump('D_TRACE','populate_lib_list\n');
-       var default_menuitem;
-       if (typeof defaultlib == 'object') {
-               defaultlib = defaultlib.id();   
-       }
-       var popup = menupopup;
-       if (typeof(popup)!='object') { popup = document.getElementById(menupopup); }
-       if (popup) {
-               //sdump('D_POPULATE','found popup\n');
-               empty_widget(popup);
-               var padding_flag = false;
-               for (var ou in mw.G.my_orgs) {
-                       //sdump('D_POPULATE','\tlooping on my_orgs:  ' + js2JSON(mw.G.my_orgs[ou]) + '\n');
-                       //sdump('D_POPULATE','\tlooping on my_orgs:  ou = ' + ou + '\n');
-                       var menuitem = document.createElement('menuitem');
-                       popup.appendChild(menuitem);
-                       //sdump('D_POPULATE','\t\tmenuitem = ' + menuitem + '\n');
-                       var padding = '';
-                       //var depth = find_id_object_in_list( mw.G.aout_list, mw.G.my_orgs[ou].ou_type() ).depth();
-                       var depth = mw.G.aout_hash[ mw.G.my_orgs[ou].ou_type() ].depth();
-                       if (depth == '0') { padding_flag = true; }
-                       if (padding_flag) {
-                               for (var i = 0; i < depth; i++) { 
-                                       padding = padding + '  '; 
-                               }
-                       }
-                       menuitem.setAttribute('label', padding + mw.G.my_orgs[ou].name() );
-                       menuitem.setAttribute('value', mw.G.my_orgs[ou].id() );
-                       if (id_flag) menuitem.setAttribute('id', 'libitem' + mw.G.my_orgs[ou].id() );
-                       //sdump('D_POPULATE','\tname = ' + mw.G.my_orgs[ou].name() + '  id = ' + mw.G.my_orgs[ou].id() + '\n');
-                       if (defaultlib == mw.G.my_orgs[ou].id()) {
-                               default_menuitem = menuitem;
-                               sdump('D_POPULATE','Setting defaultlib = ' + defaultlib + '\n');
-                       }
-               }
-               var list = menulist;
-               if (typeof(list)!='object') { list = document.getElementById(menulist); }
-               if (list && defaultlib && default_menuitem) {
-                       //sdump('D_POPULATE','default_menuitem = ' + default_menuitem + '\n');
-                       if (list) { list.selectedItem = default_menuitem; }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_lib_list: Could not find ' + menupopup + '\n');
-                       throw('populate_lib_list: Could not find ' + menupopup + '\n');
-       }
-}
-
-function populate_lib_list_with_branch(menulist,menupopup,defaultlib,branch,id_flag) {
-       sdump('D_TRACE','populate_lib_list_with_branch\n');
-       var default_menuitem;
-       if (typeof defaultlib == 'object') {
-               defaultlib = defaultlib.id();   
-       }
-       var popup = menupopup;
-       if (typeof(popup)!='object') popup = document.getElementById(menupopup);
-       if (popup) {
-               empty_widget(popup);
-               var padding_flag = true;
-               var flat_branch = flatten_ou_branch( branch );
-               //sdump('D_POPULATE','\n\nflat_branch = ' + js2JSON(flat_branch) + '\n');
-               for (var i in flat_branch) {
-                       //sdump('D_POPULATE','i = ' + js2JSON(i) + ' flat_branch[i] = ' + js2JSON(flat_branch[i]) + '\n');
-                       var menuitem = document.createElement('menuitem');
-                       var padding = '';
-                       //if (flat_branch[i].ou_type().depth() == '0') { padding_flag = true; }
-                       var depth = mw.G.aout_hash[ flat_branch[i].ou_type() ].depth();
-                       if (padding_flag) {
-                               for (var j = 0; j < depth; j++) { 
-                                       padding = padding + '  '; 
-                               }
-                       }
-                       menuitem.setAttribute('label', padding + flat_branch[i].name() );
-                       menuitem.setAttribute('value', flat_branch[i].id() );
-                       if (id_flag) menuitem.setAttribute('id', 'libitem' + flat_branch[i].id() );
-                       if (defaultlib == flat_branch[i].id()) {
-                               default_menuitem = menuitem;
-                               sdump('D_POPULATE','i = ' + i + ' Setting defaultlib = ' + defaultlib + '   menuitem = ' + default_menuitem + '  value = ' + default_menuitem.getAttribute('value') + '\n');
-                       }
-                       popup.appendChild(menuitem);
-               }
-               var list = menulist;
-               if (typeof(list)!='object') { list = document.getElementById(menulist); }
-               if (list && defaultlib && default_menuitem) {
-                       //sdump('D_POPULATE','default_menuitem = ' + default_menuitem + ' value = ' + default_menuitem.getAttribute('value') + '\n');
-                       if (list) { list.selectedItem = default_menuitem; }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_lib_list_with_branch: Could not find ' + menupopup + '\n');
-                       throw('populate_lib_list_with_branch: Could not find ' + menupopup + '\n');
-       }
-       sdump('D_POPULATE','\tleaving populate_lib_list_with_branch\n');
-}
-
-function populate_user_profile(menulist,menupopup,defaultap) {
-       sdump('D_TRACE','Entering populate_user_profile\n');
-       var popup = document.getElementById(menupopup);
-       if (popup) {
-               empty_widget(popup);
-               for (var i in mw.G.ap_list) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', mw.G.ap_list[i].name()); 
-                       menuitem.setAttribute('value', mw.G.ap_list[i].id()); 
-                       menuitem.setAttribute('id', 'apitem' + mw.G.ap_list[i].id()); 
-                       //sdump('D_POPULATE','pop_ap_list: i = ' + i + ' ap = ' + mw.G.ap_list[i] + ' = ' + js2JSON(mw.G.ap_list[i]) + '\n');
-                       popup.appendChild(menuitem);
-               }
-               var list = document.getElementById(menulist);
-               if (list && defaultap) {
-                       if (typeof defaultap == 'object') {
-                               defaultap = defaultap.id();     
-                       }
-                       var menuitem_id = 'apitem' + defaultap;
-                       var menuitem = document.getElementById(
-                               menuitem_id
-                       );
-                       var  menulist_e = document.getElementById(menulist);
-                       if (menulist_e) { menulist_e.selectedItem = menuitem; }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_user_profile: Could not find menupopup: ' + menupopup + '\n');
-                       throw('populate_user_profile: Could not find menupopup: ' + menupopup + '\n');
-       }
-}
-
-function populate_ident_types(menulist,menupopup,repeatid,defaultcit) {
-       sdump('D_TRACE','Entering populate_ident_types\n');
-       var popup = document.getElementById(menupopup);
-       if (popup) {
-               empty_widget(popup);
-               for (var i in mw.G.cit_list) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', mw.G.cit_list[i].name()); 
-                       menuitem.setAttribute('value', mw.G.cit_list[i].id()); 
-                       menuitem.setAttribute('id', 'cit' + repeatid + 'item' + mw.G.cit_list[i].id()); 
-                       //sdump('D_POPULATE','pop_cit_list: i = ' + i + ' cit = ' + mw.G.cit_list[i] + ' = ' + js2JSON(mw.G.cit_list[i]) + '\n');
-                       popup.appendChild(menuitem);
-               }
-               if (menulist && defaultcit) {
-                       if (typeof defaultcit == 'object') {
-                               defaultcit = defaultcit.id();   
-                       }
-                       var menuitem_id = 'cit' + repeatid + 'item' + defaultcit;
-                       var menuitem = document.getElementById(
-                               menuitem_id
-                       );
-                       var  menulist_e = document.getElementById(menulist);
-                       if (menulist_e) { menulist_e.selectedItem = menuitem; }
-               }
-       } else {
-                       sdump('D_POPULATE','populate_ident_types: Could not find menupopup: ' + menupopup + '\n');
-                       throw('populate_ident_types: Could not find menupopup: ' + menupopup + '\n');
-       }
-}
-
-
-
-function populate_name_prefix(menulist,menupopup,defaultvalue) {
-       var popup = document.getElementById(menupopup);
-       if (popup) {
-               empty_widget(popup);
-               var prefix_list = [
-                       'Mr','Mrs','Ms','Miss', 'Dr',
-                       '',
-                       'Advisor',
-                       'Airman',
-                       'Admiral',
-                       'Agent',
-                       'Ambassador',
-                       'Baron',
-                       'Baroness',
-                       'Bishop',
-                       'Brother',
-                       'Cadet',
-                       'Captain',
-                       'Cardinal',
-                       'Chairperson',
-                       'Chancellor',
-                       'Chief',
-                       'Colonel', 
-                       'Commander',
-                       'Commodore',
-                       'Congressman',
-                       'Congresswoman',
-                       'Constable',
-                       'Consul',
-                       'Corporal',
-                       'Councilperson',
-                       'Counselor',
-                       'Dean',
-                       'Duchess',
-                       'Duke',
-                       'Elder',
-                       'Ensign',
-                       'Father',
-                       'General',
-                       'Governor',
-                       'Judge',
-                       'Justice',
-                       'King',
-                       'Lady',
-                       'Lieutenant',
-                       'Lord',
-                       'Major',
-                       'Marshal',
-                       'Mayor',
-                       'Midshipman',
-                       'Minister',
-                       'Monsignor',
-                       'Officer',
-                       'Pastor',
-                       'Petty Officer',
-                       'Pope',
-                       'Prince',
-                       'Princess',
-                       'President',
-                       'Private',
-                       'Prof',
-                       'Queen',
-                       'Rabbi',
-                       'Representative',
-                       'Reverend',
-                       'Seaman',
-                       'Secretary',
-                       'Senator',
-                       'Sergeant',
-                       'Sheriff',
-                       'Sir',
-                       'Sister',
-                       'Speaker',
-                       'Specialist',
-                       'Treasurer',
-                       'Vice President',
-                       'Warrant Officer'
-               ];
-               for (var i in prefix_list) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', prefix_list[i]); 
-                       menuitem.setAttribute('value', prefix_list[i]); 
-                       popup.appendChild(menuitem);
-               }
-               var list = document.getElementById(menulist);
-               if (list) {
-                       if (defaultvalue) { 
-                               list.value = defaultvalue;
-                       }
-               } else {
-                       sdump('D_POPULATE','populate_name_prefix: Could not find menulist: ' + menulist + '\n');
-                       throw('populate_name_prefix: Could not find menulist: ' + menulist + '\n');
-               }
-       } else {
-                       sdump('D_POPULATE','populate_name_prefix: Could not find menupopup: ' + menupopup + '\n');
-                       throw('populate_name_prefix: Could not find menupopup: ' + menupopup + '\n');
-       }
-
-}
-
-function populate_name_suffix(menulist,menupopup,defaultvalue) {
-       var popup = document.getElementById(menupopup);
-       if (popup) {
-               empty_widget(popup);
-               var suffix_list = [
-                       'Jr','Sr','II','III',
-                       '',
-                       'AA',
-                       'AS',
-                       'AAS',
-                       'BA',
-                       'BS',
-                       'CFPIM',
-                       'CPA',
-                       'CPIM',
-                       'CPM',
-                       'CXE',
-                       'DC',
-                       'DDS',
-                       'DO', 
-                       'DPM',
-                       'DVM',
-                       'Esq',
-                       'FACAAI',
-                       'FACP',
-                       'FACS',
-                       'FACEP',
-                       'FCP',
-                       'FICS',
-                       'GYN',
-                       'JD',
-                       'LPN',
-                       'MA',
-                       'MCSE',
-                       'MD', 
-                       'MS',
-                       'NMD',
-                       'OB',
-                       'PhD',
-                       'RN'
-               ];
-               for (var i in suffix_list) {
-                       var menuitem = document.createElement('menuitem');
-                       menuitem.setAttribute('label', suffix_list[i]); 
-                       menuitem.setAttribute('value', suffix_list[i]); 
-                       popup.appendChild(menuitem);
-               }
-               var list = document.getElementById(menulist);
-               if (list) { 
-                       if (defaultvalue) { 
-                               list.value = defaultvalue;
-                       }
-               } else {
-                       sdump('D_POPULATE','populate_name_suffix: Could not find ' + menulist + '\n');
-                       throw('populate_name_suffix: Could not find ' + menulist + '\n');
-               }
-       } else {
-                       sdump('D_POPULATE','populate_name_suffix: Could not find ' + menupopup + '\n');
-                       throw('populate_name_suffix: Could not find ' + menupopup + '\n');
-       }
-
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/print.js b/Evergreen/staff_client/chrome/content/evergreen/util/print.js
deleted file mode 100644 (file)
index 1ddb342..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-sdump('D_TRACE','Loading print.js\n');
-
-var print_crlf = '<br />\r\n';
-
-// Higher-level
-
-function print_itemsout_receipt(params,sample_view) {
-       print_circ_receipt('itemsout',params,sample_view);
-}
-
-function print_checkout_receipt(params,sample_view) {
-       print_circ_receipt('checkout',params,sample_view);
-}
-
-function print_circ_receipt(circ_type,params,sample_view) {
-       sdump('D_PRINT',arg_dump(arguments));
-       var s = ''; params.current_circ = new circ(); params.current_copy = new acp(); params.current_mvr = new mvr();
-       if (params.header) { s += print_template_replace(params.header, params); }
-       var circs;
-       switch(circ_type) {
-               case 'itemsout' : circs = params.au.checkouts(); break;
-               case 'checkout' : circs = params.au._current_checkouts; break;
-               default: alert('bad!'); break;
-       }
-       for (var i = 0; i < circs.length; i++) {
-               params.current_circ = circs[i].circ;
-               params.current_copy = circs[i].copy;
-               params.current_mvr = circs[i].record;
-               params.current_index = i;
-               s += print_template_replace(params.line_item, params); 
-       }
-       if (params.footer) { s += print_template_replace(params.footer, params); }
-       s = s.replace( /\n/g, print_crlf );
-       if (sample_view) {
-               sample_view.setAttribute( 'src', 'data:text/html,<html>' + s + '</html>\r\n' );
-       } else {
-               sPrint( s, true );
-       }
-}
-
-function print_template_replace(s,params) {
-
-               function trunc(t) {
-                       if (params.truncate) {
-                               try {
-                                       return t.toString().substr(0,params.truncate);
-                               } catch(E) {
-                                       return t;
-                               }
-                       } else {
-                               return t;
-                       }
-               }
-               function ttrunc(t) {
-                       if (params.title_truncate) {
-                               try {
-                                       return t.toString().substr(0,params.title_truncate);
-                               } catch(E) {
-                                       return t;
-                               }
-                       } else {
-                               return t;
-                       }
-               }
-               function atrunc(t) {
-                       if (params.author_truncate) {
-                               try {
-                                       return t.toString().substr(0,params.author_truncate);
-                               } catch(E) {
-                                       return t;
-                               }
-                       } else {
-                               return t;
-                       }
-               }
-
-
-
-               var b = s.match( /%TRUNC.{0,3}:\s*(\d+)%/ );
-               if (b) params.truncate = b[1];
-
-               try{s=s.replace(/%TRUNC.{0,3}:\s*\d+%/g,'');}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%LIBRARY%/g,trunc(params.lib.name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PINES_CODE%/g,trunc(params.lib.shortname()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%PATRON_LASTNAME%/g,trunc(params.au.family_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PATRON_FIRSTNAME%/g,trunc(params.au.first_given_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PATRON_MIDDLENAME%/g,trunc(params.au.second_given_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PATRON_BARCODE%/g,trunc(params.au.card().barcode()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%STAFF_LASTNAME%/g,trunc(params.staff.family_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%STAFF_FIRSTNAME%/g,trunc(params.staff.first_given_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%STAFF_MIDDLENAME%/g,trunc(params.staff.second_given_name()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               //try{s=s.replace(/%STAFF_BARCODE%/g,trunc(params.staff.card().barcode()));}
-               //      catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%TODAY%/g,trunc(new Date()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_m%/g,trunc(formatted_date(new Date(),'%m')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_d%/g,trunc(formatted_date(new Date(),'%d')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_Y%/g,trunc(formatted_date(new Date(),'%Y')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_H%/g,trunc(formatted_date(new Date(),'%H')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_I%/g,trunc(formatted_date(new Date(),'%I')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_M%/g,trunc(formatted_date(new Date(),'%M')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_D%/g,trunc(formatted_date(new Date(),'%D')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%TODAY_F%/g,trunc(formatted_date(new Date(),'%F')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               
-               try{s=s.replace(/%OUT%/g,trunc(params.current_circ.xact_start()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_m%/g,trunc(formatted_date(params.current_circ.xact_start(),'%m')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_d%/g,trunc(formatted_date(params.current_circ.xact_start(),'%d')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_Y%/g,trunc(formatted_date(params.current_circ.xact_start(),'%Y')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_H%/g,trunc(formatted_date(params.current_circ.xact_start(),'%H')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_I%/g,trunc(formatted_date(params.current_circ.xact_start(),'%I')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_M%/g,trunc(formatted_date(params.current_circ.xact_start(),'%M')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_D%/g,trunc(formatted_date(params.current_circ.xact_start(),'%D')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%OUT_F%/g,trunc(formatted_date(params.current_circ.xact_start(),'%F')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%DUE%/g,trunc(params.current_circ.due_date()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_m%/g,trunc(formatted_date(params.current_circ.due_date(),'%m')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_d%/g,trunc(formatted_date(params.current_circ.due_date(),'%d')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_Y%/g,trunc(formatted_date(params.current_circ.due_date(),'%Y')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_H%/g,trunc(formatted_date(params.current_circ.due_date(),'%H')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_I%/g,trunc(formatted_date(params.current_circ.due_date(),'%I')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_M%/g,trunc(formatted_date(params.current_circ.due_date(),'%M')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_D%/g,trunc(formatted_date(params.current_circ.due_date(),'%D')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%DUE_F%/g,trunc(formatted_date(params.current_circ.due_date(),'%F')));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%DURATION%/g,trunc(params.current_circ.duration()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               
-               try{s=s.replace(/%COPY_BARCODE%/g,trunc(params.current_copy.barcode()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               
-               var tb = s.match( /%TITLE:?\s*(\d*)%/ );
-               if (tb) params.title_truncate = tb[1];
-
-               try{s=s.replace(/%TITLE:?\s*\d*%/g,ttrunc(params.current_mvr.title()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               var ab = s.match( /%AUTHOR:?\s*(\d*)%/ );
-               if (ab) params.author_truncate = ab[1];
-
-               try{s=s.replace(/%AUTHOR%/g,atrunc(params.current_mvr.author()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PUBLISHER%/g,trunc(params.current_mvr.publisher()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-               try{s=s.replace(/%PUBDATE%/g,trunc(params.current_mvr.pubdate()));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               try{s=s.replace(/%NUMBER%/g,(params.current_index+1));}
-                       catch(E){sdump('D_ERROR','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-
-               return s;
-}
-
-// Lower-level
-
-function last_sPrint() {
-       if (mw.G.last_receipt) sPrint( mw.G.last_receipt, false );
-}
-
-function sPrint(s,silent,params) {
-       sdump('D_PRINT',arg_dump(arguments));
-       mw.G.last_receipt = s;
-       var w = new_window('data:text/html,<html>' + s + '</html>\r\n', { 'window_name':'LastPrint' });
-       w.minimize(); mw.minimize();
-       setTimeout(
-               function() {
-                       if (!mw.printDebug) {
-                               NSPrint(w,silent,params); w.minimize(); w.close(); mw.minimize();
-                       } else {
-                               sdump('D_PRINT','Not printing due to printDebug flag.');
-                       }
-               },0
-       );
-}
-
-function NSPrint(w,silent,params)
-{
-       sdump('D_PRINT',arg_dump(arguments));
-       if (!w) { w = this; }
-       try {
-               var webBrowserPrint = w
-                       .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIWebBrowserPrint);
-               sdump('D_PRINT','webBrowserPrint = ' + webBrowserPrint);
-               if (webBrowserPrint) {
-                       var gPrintSettings = GetPrintSettings();
-                       if (silent) gPrintSettings.printSilent = true;
-                       else gPrintSettings.printSilent = false;
-                       if (params) {
-                               gPrintSettings.marginTop = 0;
-                               gPrintSettings.marginLeft = 0;
-                               gPrintSettings.marginBottom = 0;
-                               gPrintSettings.marginRight = 0;
-                               if (params.marginLeft) gPrintSettings.marginLeft = params.marginLeft;
-                       }
-                        gPrintSettings.headerStrLeft = '';
-                        gPrintSettings.headerStrCenter = '';
-                        gPrintSettings.headerStrRight = '';
-                        gPrintSettings.footerStrLeft = '';
-                        gPrintSettings.footerStrCenter = '';
-                        gPrintSettings.footerStrRight = '';
-                       sdump('D_PRINT','gPrintSettings = ' + js2JSON(gPrintSettings));
-                       alert('gPrintSettings = ' + js2JSON(gPrintSettings));
-                       webBrowserPrint.print(gPrintSettings, null);
-                       //alert('Should be printing\n');
-                       sdump('D_PRINT','Should be printing\n');
-               } else {
-                       //alert('Should not be printing\n');
-                       sdump('D_PRINT','Should not be printing\n');
-               }
-       } catch (e) {
-               //alert('Probably not printing: ' + e);
-       // Pressing cancel is expressed as an NS_ERROR_ABORT return value,
-       // causing an exception to be thrown which we catch here.
-       // Unfortunately this will also consume helpful failures, so add a
-               sdump('D_PRINT','PRINT EXCEPTION: ' + js2JSON(e) + '\n');
-       // if you need to debug
-       }
-}
-
-var gPrintSettings = null;
-
-function GetPrintSettings()
- {
-       sdump('D_PRINT',arg_dump(arguments));
-   try {
-     if (gPrintSettings == null) {
-       var pref = Components.classes["@mozilla.org/preferences-service;1"]
-                            .getService(Components.interfaces.nsIPrefBranch);
-       if (pref) {
-         gPrintSettingsAreGlobal = pref.getBoolPref("print.use_global_printsettings", false);
-         gSavePrintSettings = pref.getBoolPref("print.save_print_settings", false);
-       }
-       var printService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
-                                         .getService(Components.interfaces.nsIPrintSettingsService);
-       if (gPrintSettingsAreGlobal) {
-         gPrintSettings = printService.globalPrintSettings;
-         setPrinterDefaultsForSelectedPrinter(printService);
-       } else {
-         gPrintSettings = printService.newPrintSettings;
-       }
-     }
-   } catch (e) {
-     sdump('D_PRINT',"GetPrintSettings() "+e+"\n");
-     alert("GetPrintSettings() "+e+"\n");
-   }
-   return gPrintSettings;
- }
-
-function setPrinterDefaultsForSelectedPrinter(aPrintService)
- {
-       sdump('D_PRINT',arg_dump(arguments));
-   if (gPrintSettings.printerName == "") {
-     gPrintSettings.printerName = aPrintService.defaultPrinterName;
-   }
-   // First get any defaults from the printer 
-   aPrintService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings);
-   // now augment them with any values from last time
-   aPrintService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSettings.kInitSaveAll);
- }
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/ses.js b/Evergreen/staff_client/chrome/content/evergreen/util/ses.js
deleted file mode 100644 (file)
index 4dd5aef..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-sdump('D_TRACE','Loading ses.js\n');
-
-//////////////////////////////////////////////////////////////////////////////
-// Sessions, Requests, Methods, Oh My
-
-// These wrap Bill's RemoteRequest.js
-
-function user_request(app,name,params,f) {
-       if (f) {
-
-               user_async_request(app,name,params,f);
-               return [];
-
-       } else {
-               try {
-                       sdump('D_SES','=-=-=-=-= user_request("'+app+'","'+name+'",'+js2JSON(params)+')\n');
-                       var request = new RemoteRequest( app, name );
-                       for(var index in params) {
-                               request.addParam(params[index]);
-                       }
-                       request.send(true);
-                       var result = [];
-                       result.push( request.getResultObject() );
-                       sdump('D_SES_RESULT','=-=-= result = ' + js2JSON(result[0]) + '\n');
-                       return result;
-               } catch(E) {
-                       if (instanceOf(E,perm_ex)) {
-                               alert('permission exception: ' + js2JSON(E));
-                       }
-                       throw(E);
-               }
-       }
-}
-
-function user_async_request(app,name,params,func) {
-       sdump('D_SES','=-=-=-=-= user_async_request("'+app+'","'+name+'",'+js2JSON(params)+',func)\n');
-       sdump('D_SES_FUNC','func = ' + func + '\n');
-       var request = new RemoteRequest( app, name );
-       for(var index in params) {
-               request.addParam(params[index]);
-       }
-       request.setCompleteCallback(func);
-       request.send();
-}
-
-function sample_func(request) {
-       var result = [];
-       result.push( request.getResultObject() );
-       /* This callback would be called within the code for the Request object, so you would never see
-       a return value.  Instead, you should _do_ something with the data. */
-       return result;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// The functions below were wrappers for the old jabber way of doing things
-
-function handle_session(app) {
-       //if( ses == null || ! AppSession.transport_handle.connected() ) {
-       sdump('D_TRACE','Calling new AppSession : ' + timer_elapsed('cat') + '\n');
-               ses = new AppSession( app );
-               sdump('D_SES', 'after AppSession ses = ' + (ses.state) + '\n' );
-               if( ! ses.connect() ) { 
-                       sdump('D_SES', 'after ses.connect ses = ' + js2JSON(ses.state) + '\n' );
-                       throw( "Connect timed out!" ); 
-               }
-               sdump('D_SES', 'after ses.connect ses = ' + js2JSON(ses.state) + '\n' );
-       sdump('D_TRACE','Finished new AppSession : ' + timer_elapsed('cat') + '\n');
-       //}
-}
-
-function handle_request(ses,meth) {
-
-
-       sdump('D_TRACE','Entering handle_request : ' + timer_elapsed('cat') + '\n');
-       sdump('D_SES','Calling new AppRequest : ' + timer_elapsed('cat') + '\n');
-
-       var req = new AppRequest( ses, meth );
-
-       sdump('D_SES','Finished new AppRequest : ' + timer_elapsed('cat') + '\n');
-       sdump('D_SES','Calling new req.make_request() : ' + timer_elapsed('cat') + '\n');
-
-       req.make_request();
-
-       sdump('D_SES', 'after req.make_request ses = ' + js2JSON(ses.state) + '\n' );
-       sdump('D_SES','Finished new req.make_request() : ' + timer_elapsed('cat') + '\n');
-
-       var result = new Array(); var resp;
-
-       sdump('D_SES','Looping on req.recv and resp.getContent(): ' + timer_elapsed('cat') + '\n');
-
-       while (resp = req.recv( 30000 ) ) {
-               sdump('D_SES', '\tafter req.recv ses = ' + js2JSON(ses.state) + ' : req.is_complete = ' + req.is_complete + '\n' );
-               var r = resp.getContent();
-               if (r != 'keepalive') {
-                       result.push( r );
-               }
-       }
-
-       sdump('D_SES','Finished with req.recv and resp.getContent(): ' + timer_elapsed('cat') + '\n');
-
-       if (result.length == 0) {
-               if ( req.is_complete ) {
-                       result.push("NO RESPONSE, REQUEST COMPLETE");
-                       sdump('D_SES',"NO RESPONSE, REQUEST COMPLETE\n");
-               } else {
-                       result.push("NO RESPONSE, REQUEST TIMEOUT");
-                       sdump('D_SES',"NO RESPONSE, REQUEST TIMEOUT\n");
-               }
-       }
-       req.finish();
-       sdump('D_SES', 'after req.finish() ses = ' + js2JSON(ses.state) + '\n' );
-       sdump('D_SES','Exiting handle_request : ' + timer_elapsed('cat') + '\n');
-       return result;  
-}
-
-function _user_request(app,name,params) {
-
-       sdump('D_SES','Entering user_request : ' + timer_elapsed('cat') + '\n');
-       sdump('D_SES','app='+app+' name='+name+'\n');
-       try {
-
-               handle_session(app);
-
-               var meth;
-               if (name) {
-                       meth = new oilsMethod( name, params );
-               } else {
-                       throw('No method name to execute.');
-               }
-
-               var result = handle_request(ses,meth);
-               
-               if (ses) { 
-                       sdump('D_SES','ses.disconnect\n'); 
-                       ses.disconnect(); 
-                       sdump('D_SES', 'after ses.disconnect() ses = ' + js2JSON(ses.state) + '\n' );
-                       ses.destroy();
-                       sdump('D_SES', 'after ses.destroy() ses = ' + js2JSON(ses.state) + '\n' );
-               }
-
-               sdump('D_SES','Exiting user_request : ' + timer_elapsed('cat') + '\n');
-               return result;
-
-       } catch( E ) { 
-               sdump('D_SES','Exiting user_request : ' + timer_elapsed('cat') + '\n');
-               alert( pretty_print( js2JSON(E) ) ); 
-               return null;
-       }
-
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/shell.html b/Evergreen/staff_client/chrome/content/evergreen/util/shell.html
deleted file mode 100644 (file)
index ca5a215..0000000
+++ /dev/null
@@ -1,690 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<html onclick="keepFocusInTextbox(event)">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>JavaScript Shell 1.3.1</title>
-
-<script type="text/javascript">
-// Modified by Jason for Evergreen
-var 
-histList = [""], 
-histPos = 0, 
-_scope = {}, 
-_win, // a top-level context
-question,
-_in,
-_out,
-tooManyMatches = null,
-lastError = null;
-
-function refocus()
-{
-  _in.blur(); // Needed for Mozilla to scroll correctly.
-  _in.focus();
-}
-
-function init()
-{
-  _in = document.getElementById("input");
-  _out = document.getElementById("output");
-
-  _win = window;
-
-  if (opener && !opener.closed)
-  {
-    println("Using bookmarklet version of shell: commands will run in opener's context.", "message");
-    _win = opener;
-  }
-
-  initTarget();
-
-  recalculateInputHeight();
-  refocus();
-}
-
-function initTarget()
-{
-  _win.Shell = window;
-  _win.print = shellCommands.print;
-}
-
-
-// Unless the user is selected something, refocus the textbox.
-// (requested by caillon, brendan, asa)
-function keepFocusInTextbox(e) 
-{
-  var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard
-  
-  while (!g.tagName)
-    g = g.parentNode;
-  var t = g.tagName.toUpperCase();
-  if (t=="A" || t=="INPUT")
-    return;
-    
-  if (window.getSelection) {
-    // Mozilla
-    if (String(window.getSelection()))
-      return;
-  }
-  else if (document.getSelection) {
-    // Opera? Netscape 4?
-    if (document.getSelection())
-      return;
-  }
-  else {
-    // IE
-    if ( document.selection.createRange().text )
-      return;
-  }
-  
-  refocus();
-}
-
-function inputKeydown(e) {
-  // Use onkeydown because IE doesn't support onkeypress for arrow keys
-
-  //alert(e.keyCode + " ^ " + e.keycode);
-
-  if (e.shiftKey && e.keyCode == 13) { // shift-enter
-    // don't do anything; allow the shift-enter to insert a line break as normal
-  } else if (e.keyCode == 13) { // enter
-    // execute the input on enter
-    try { go(); } catch(er) { alert(er); };
-    setTimeout(function() { _in.value = ""; }, 0); // can't preventDefault on input, so clear it later
-  } else if (e.keyCode == 38) { // up
-    // go up in history if at top or ctrl-up
-    if (e.ctrlKey || _in.selectionStart == null || _in.selectionStart == 0)
-      hist(true);
-  } else if (e.keyCode == 40) { // down
-    // go down in history if at end or ctrl-down
-    if (e.ctrlKey || _in.selectionStart == null || _in.selectionEnd == _in.textLength)
-      hist(false);
-  } else if (e.keyCode == 9) { // tab
-    tabcomplete();
-    setTimeout(function() { refocus(); }, 0); // refocus because tab was hit
-  } else { }
-
-  setTimeout(recalculateInputHeight, 0);
-  
-  //return true;
-};
-
-function recalculateInputHeight()
-{
-  var rows = _in.value.split(/\n/).length
-    + 1 // prevent scrollbar flickering in Mozilla
-    + (window.opera ? 1 : 0); // leave room for scrollbar in Opera
-  
-  if (_in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.
-    _in.rows = rows;
-}
-
-function println(s, type)
-{
-  if((s=String(s)))
-  {
-    var newdiv = document.createElement("div");
-    newdiv.appendChild(document.createTextNode(s));
-    newdiv.className = type;
-    _out.appendChild(newdiv);
-    return newdiv;
-  }
-}
-
-function printWithRunin(h, s, type)
-{
-  var div = println(s, type);
-  var head = document.createElement("strong");
-  head.appendChild(document.createTextNode(h + ": "));
-  div.insertBefore(head, div.firstChild);
-}
-
-
-var shellCommands = 
-{
-load : function load(url)
-{
-  var s = _win.document.createElement("script");
-  s.type = "text/javascript";
-  s.src = url;
-  _win.document.getElementsByTagName("head")[0].appendChild(s);
-  println("Loading " + url + "...", "message");
-},
-
-print : function print(s) { println(s, "print"); },
-
-// the normal function, "print", shouldn't return a value
-// (suggested by brendan; later noticed it was a problem when showing others)
-pr : function pr(s) 
-{ 
-  shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!
-  return s;
-},
-
-props : function props(e)
-{
-  var ns = ["Methods", "Fields", "Unreachables"];
-  var as = [[], [], []]; // array of (empty) arrays of arrays!
-  var p, j, i; // loop variables, several used multiple times
-
-  var protoLevels = 0;
-
-  for (p = e; p; p = p.__proto__)
-  {
-    for (i=0; i<ns.length; ++i)
-      as[i][protoLevels] = [];
-    ++protoLevels;
-  }
-
-  for(var a in e)
-  {
-    // Shortcoming: doesn't check that VALUES are the same in object and prototype.
-
-    var protoLevel = -1;
-    try
-    {
-      for (p = e; p && (a in p); p = p.__proto__)
-        ++protoLevel;
-    }
-    catch(er) { protoLevel = 0; } // "in" operator throws when param to props() is a string
-
-    var type = 1;
-    try
-    {
-      if ((typeof e[a]) == "function")
-        type = 0;
-    }
-    catch (er) { type = 2; }
-
-    as[type][protoLevel].push(a);
-  }
-
-  function times(s, n) { return n ? s + times(s, n-1) : ""; }
-
-  for (j=0; j<protoLevels; ++j)
-    for (i=0;i<ns.length;++i)
-      if (as[i][j].length) 
-        printWithRunin(ns[i] + times(" of prototype", j), as[i][j].join(", "), "propList");
-},
-
-blink : function blink(node)
-{
-  if (!node)                     throw("blink: argument is null or undefined.");
-  if (node.nodeType == null)     throw("blink: argument must be a node.");
-  if (node.nodeType == 3)        throw("blink: argument must not be a text node");
-  if (node.documentElement)      throw("blink: argument must not be the document object");
-
-  function setOutline(o) { 
-    return function() {
-      if (node.style.outline != node.style.bogusProperty) {
-        // browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).
-        node.style.outline = o;
-      }
-      else if (node.style.MozOutline != node.style.bogusProperty) {
-        // browser supports MozOutline (Firefox 1.0.x and older)
-        node.style.MozOutline = o;
-      }
-      else {
-        // browser only supports border (IE). border is a fallback because it moves things around.
-        node.style.border = o;
-      }
-    }
-  } 
-  
-  function focusIt(a) {
-    return function() {
-      a.focus(); 
-    }
-  }
-
-  if (node.ownerDocument) {
-    var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE
-    if (windowToFocusNow)
-      setTimeout(focusIt(windowToFocusNow.top), 0);
-  }
-
-  for(var i=1;i<7;++i)
-    setTimeout(setOutline((i%2)?'3px solid red':'none'), i*100);
-
-  setTimeout(focusIt(window), 800);
-  setTimeout(focusIt(_in), 810);
-},
-
-scope : function scope(sc)
-{
-  if (!sc) sc = {};
-  _scope = sc;
-  println("Scope is now " + sc + ".  If a variable is not found in this scope, window will also be searched.  New variables will still go on window.", "message");
-},
-
-mathHelp : function mathHelp()
-{
-  printWithRunin("Math constants", "E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2", "propList");
-  printWithRunin("Math methods", "abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan", "propList");
-},
-
-ans : undefined,
-
-cls : function cls()
-{
-       while (_out.lastChild) { _out.removeChild( _out.lastChild ); }
-}
-};
-
-
-function hist(up)
-{
-  // histList[0] = first command entered, [1] = second, etc.
-  // type something, press up --> thing typed is now in "limbo"
-  // (last item in histList) and should be reachable by pressing 
-  // down again.
-
-  var L = histList.length;
-
-  if (L == 1)
-    return;
-
-  if (up)
-  {
-    if (histPos == L-1)
-    {
-      // Save this entry in case the user hits the down key.
-      histList[histPos] = _in.value;
-    }
-
-    if (histPos > 0)
-    {
-      histPos--;
-      // Use a timeout to prevent up from moving cursor within new text
-      // Set to nothing first for the same reason
-      setTimeout(
-        function() {
-          _in.value = ''; 
-          _in.value = histList[histPos]; 
-          if (_in.setSelectionRange) 
-            _in.setSelectionRange(0, 0);
-        },
-        0
-      );
-    }
-  } 
-  else // down
-  {
-    if (histPos < L-1)
-    {
-      histPos++;
-      _in.value = histList[histPos];
-    }
-    else if (histPos == L-1)
-    {
-      // Already on the current entry: clear but save
-      if (_in.value)
-      {
-        histList[histPos] = _in.value;
-        ++histPos;
-        _in.value = "";
-      }
-    }
-  }
-}
-
-function tabcomplete()
-{
-  /*
-   * Working backwards from s[from], find the spot
-   * where this expression starts.  It will scan
-   * until it hits a mismatched ( or a space,
-   * but it skips over quoted strings.
-   * If stopAtDot is true, stop at a '.'
-   */
-  function findbeginning(s, from, stopAtDot)
-  {
-    /*
-     *  Complicated function.
-     *
-     *  Return true if s[i] == q BUT ONLY IF
-     *  s[i-1] is not a backslash.
-     */
-    function equalButNotEscaped(s,i,q)
-    {
-      if(s.charAt(i) != q) // not equal go no further
-        return false;
-
-      if(i==0) // beginning of string
-        return true;
-
-      if(s.charAt(i-1) == '\\') // escaped?
-        return false;
-
-      return true;
-    }
-
-    var nparens = 0;
-    var i;
-    for(i=from; i>=0; i--)
-    {
-      if(s.charAt(i) == ' ')
-        break;
-
-      if(stopAtDot && s.charAt(i) == '.')
-        break;
-        
-      if(s.charAt(i) == ')')
-        nparens++;
-      else if(s.charAt(i) == '(')
-        nparens--;
-
-      if(nparens < 0)
-        break;
-
-      // skip quoted strings
-      if(s.charAt(i) == '\'' || s.charAt(i) == '\"')
-      {
-        //dump("skipping quoted chars: ");
-        var quot = s.charAt(i);
-        i--;
-        while(i >= 0 && !equalButNotEscaped(s,i,quot)) {
-          //dump(s.charAt(i));
-          i--;
-        }
-        //dump("\n");
-      }
-    }
-    return i;
-  }
-
-  function getcaretpos(inp)
-  {
-    if(inp.selectionEnd)
-      return inp.selectionEnd;
-
-    if(inp.createTextRange)
-    {
-      //dump('using createTextRange\n');
-      var docrange = _win.Shell.document.selection.createRange();
-      var inprange = inp.createTextRange();
-      inprange.setEndPoint('EndToStart', docrange);
-      return inprange.text.length;
-    }
-
-    return inp.value.length; // sucks, punt
-  }
-
-  function setselectionto(inp,pos)
-  {
-    if(inp.selectionStart) {
-      inp.selectionStart = inp.selectionEnd = pos;
-    }
-    else if(inp.createTextRange) {
-      var docrange = _win.Shell.document.selection.createRange();
-      var inprange = inp.createTextRange();
-      inprange.move('character',pos);
-      inprange.select();
-    }
-    else { // err...
-    /*
-      inp.select();
-      if(_win.Shell.document.getSelection())
-        _win.Shell.document.getSelection() = "";
-        */
-    }
-  }
-    // get position of cursor within the input box
-    var caret = getcaretpos(_in);
-
-    if(caret) {
-      //dump("----\n");
-      var dotpos, spacepos, complete, obj;
-      //dump("caret pos: " + caret + "\n");
-      // see if there's a dot before here
-      dotpos = findbeginning(_in.value, caret-1, true);
-      //dump("dot pos: " + dotpos + "\n");
-      if(dotpos == -1 || _in.value.charAt(dotpos) != '.') {
-        dotpos = caret;
-//dump("changed dot pos: " + dotpos + "\n");
-      }
-
-      // look backwards for a non-variable-name character
-      spacepos = findbeginning(_in.value, dotpos-1, false);
-      //dump("space pos: " + spacepos + "\n");
-      // get the object we're trying to complete on
-      if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)
-      {
-        // try completing function args
-        if(_in.value.charAt(dotpos) == '(' ||
- (_in.value.charAt(spacepos) == '(' && (spacepos+1) == dotpos))
-        {
-          var fn,fname;
-  var from = (_in.value.charAt(dotpos) == '(') ? dotpos : spacepos;
-          spacepos = findbeginning(_in.value, from-1, false);
-
-          fname = _in.value.substr(spacepos+1,from-(spacepos+1));
-  //dump("fname: " + fname + "\n");
-          try {
-            with(_win.Shell._scope)
-              with(_win)
-                with(Shell.shellCommands)
-                  fn = eval(fname);
-          }
-          catch(er) {
-            //dump('fn is not a valid object\n');
-            return;
-          }
-          if(fn == undefined) {
-             //dump('fn is undefined');
-             return;
-          }
-          if(fn instanceof Function)
-          {
-            // Print function definition, including argument names, but not function body
-            if(!fn.toString().match(/function .+?\(\) +\{\n +\[native code\]\n\}/))
-              println(fn.toString().match(/function .+?\(.*?\)/), "tabcomplete");
-          }
-
-          return;
-        }
-        else
-          obj = _win;
-      }
-      else
-      {
-        var objname = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
-        //dump("objname: |" + objname + "|\n");
-        try {
-          with(_win.Shell._scope)
-            with(_win)
-                obj = eval(objname);
-        }
-        catch(er) {
-          printError(er); 
-          return;
-        }
-        if(obj == undefined) {
-          // sometimes this is tabcomplete's fault, so don't print it :(
-          // e.g. completing from "print(document.getElements"
-          // println("Can't complete from null or undefined expression " + objname, "error");
-          return;
-        }
-      }
-      //dump("obj: " + obj + "\n");
-      // get the thing we're trying to complete
-      if(dotpos == caret)
-      {
-        if(spacepos+1 == dotpos || spacepos == dotpos)
-        {
-          // nothing to complete
-          //dump("nothing to complete\n");
-          return;
-        }
-
-        complete = _in.value.substr(spacepos+1,dotpos-(spacepos+1));
-      }
-      else {
-        complete = _in.value.substr(dotpos+1,caret-(dotpos+1));
-      }
-      //dump("complete: " + complete + "\n");
-      // ok, now look at all the props/methods of this obj
-      // and find ones starting with 'complete'
-      var matches = [];
-      var bestmatch = null;
-      for(var a in obj)
-      {
-        //a = a.toString();
-        //XXX: making it lowercase could help some cases,
-        // but screws up my general logic.
-        if(a.substr(0,complete.length) == complete) {
-          matches.push(a);
-          ////dump("match: " + a + "\n");
-          // if no best match, this is the best match
-          if(bestmatch == null)
-          {
-            bestmatch = a;
-          }
-          else {
-            // the best match is the longest common string
-            function min(a,b){ return ((a<b)?a:b); }
-            var i;
-            for(i=0; i< min(bestmatch.length, a.length); i++)
-            {
-              if(bestmatch.charAt(i) != a.charAt(i))
-                break;
-            }
-            bestmatch = bestmatch.substr(0,i);
-            ////dump("bestmatch len: " + i + "\n");
-          }
-          ////dump("bestmatch: " + bestmatch + "\n");
-        }
-      }
-      bestmatch = (bestmatch || "");
-      ////dump("matches: " + matches + "\n");
-      var objAndComplete = (objname || obj) + "." + bestmatch;
-      //dump("matches.length: " + matches.length + ", tooManyMatches: " + tooManyMatches + ", objAndComplete: " + objAndComplete + "\n");
-      if(matches.length > 1 && (tooManyMatches == objAndComplete || matches.length <= 10)) {
-
-        printWithRunin("Matches: ", matches.join(', '), "tabcomplete");
-        tooManyMatches = null;
-      }
-      else if(matches.length > 10)
-      {
-        println(matches.length + " matches.  Press tab again to see them all", "tabcomplete");
-        tooManyMatches = objAndComplete;
-      }
-      else {
-        tooManyMatches = null;
-      }
-      if(bestmatch != "")
-      {
-        var sstart;
-        if(dotpos == caret) {
-          sstart = spacepos+1;
-        }
-        else {
-          sstart = dotpos+1;
-        }
-        _in.value = _in.value.substr(0, sstart)
-                  + bestmatch
-                  + _in.value.substr(caret);
-        setselectionto(_in,caret + (bestmatch.length - complete.length));
-      }
-    }
-}
-
-function printQuestion(q)
-{
-  println(q, "input");
-}
-
-function printAnswer(a)
-{
-  if (a !== undefined) {
-    println(a, "normalOutput");
-    shellCommands.ans = a;
-  }
-}
-
-function printError(er)
-{ 
-  var lineNumberString;
-
-  lastError = er; // for debugging the shell
-  if (er.name)
-  {
-    // lineNumberString should not be "", to avoid a very wacky bug in IE 6.
-    lineNumberString = (er.lineNumber != undefined) ? (" on line " + er.lineNumber + ": ") : ": ";
-    println(er.name + lineNumberString + er.message, "error"); // Because IE doesn't have error.toString.
-  }
-  else
-    println(er, "error"); // Because security errors in Moz /only/ have toString.
-}
-
-function go(s)
-{
-  _in.value = question = s ? s : _in.value;
-
-  if (question == "")
-    return;
-
-  histList[histList.length-1] = question;
-  histList[histList.length] = "";
-  histPos = histList.length - 1;
-  
-  // Unfortunately, this has to happen *before* the JavaScript is run, so that 
-  // print() output will go in the right place.
-  _in.value='';
-  recalculateInputHeight();
-  printQuestion(question);
-
-  if (_win.closed) {
-    printError("Target window has been closed.");
-    return;
-  }
-  
-  try { ("Shell" in _win) }
-  catch(er) {
-    printError("The JavaScript Shell cannot access variables in the target window.  The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.");
-    return;
-  }
-
-  if (!("Shell" in _win))
-    initTarget(); // silent
-
-  // Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).
-  _win.location.href = "javascript:try{ Shell.printAnswer(eval('with(Shell._scope) with(Shell.shellCommands) {' + Shell.question + String.fromCharCode(10) + '}')); } catch(er) { Shell.printError(er); }; setTimeout(Shell.refocus, 0); void 0";
-}
-
-</script>
-
-<!-- for http://ted.mielczarek.org/code/mozilla/extensiondev/ -->
-<script type="text/javascript" src="chrome://extensiondev/content/rdfhistory.js"></script>
-<script type="text/javascript" src="chrome://extensiondev/content/chromeShellExtras.js"></script>
-
-<style type="text/css">
-body { background: white; color: black; }
-
-#output { white-space: pre; white-space: -moz-pre-wrap; } /* Preserve line breaks, but wrap too if browser supports it */
-h3 { margin-top: 0; margin-bottom: 0em; }
-h3 + div { margin: 0; }
-
-form { margin: 0; padding: 0; }
-#input { width: 100%; border: none; padding: 0; }
-
-.input { color: blue; background: white; font: inherit; font-weight: bold; margin-top: .5em; /* background: #E6E6FF; */ }
-.normalOutput { color: black; background: white; }
-.print { color: brown; background: white; }
-.error { color: red; background: white; }
-.propList { color: green; background: white; }
-.message { color: green; background: white; }
-.tabcomplete { color: purple; background: white; }
-</style>
-</head>
-
-<body onload="params.w = window; params.app = 'Shell'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
-
- <div id="output"><h3>JavaScript Shell 1.3.1</h3><div>Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down, <a accesskey=M href="javascript:go('scope(Math); mathHelp();');">Math</a>, <a accesskey=H href="http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.3.1">help</a></div><div>Values and functions: ans, print(string), <a accesskey=P href="javascript:go('props(ans)')">props(object)</a>, <a accesskey=B href="javascript:go('blink(ans)')">blink(node)</a>, load(scriptURL), scope(object), cls()</div></div>
-
-<div><textarea id="input" class="input" wrap="off" onkeydown="inputKeydown(event)" rows="1"></textarea></div>
-
-</body>
-
-</html>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/sound.js b/Evergreen/staff_client/chrome/content/evergreen/util/sound.js
deleted file mode 100644 (file)
index 0bbe09b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-sdump('D_TRACE','Loading sound.js\n');
-
-function xp_sound_init() {
-       var SOUNDContractID = "@mozilla.org/sound;1";
-       var SOUNDIID        = Components.interfaces.nsISound;
-       var SOUND           = Components.classes[SOUNDContractID].createInstance(SOUNDIID);
-       return SOUND;
-}
-
-function snd_bad() {
-       mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/redalert.wav') );
-}
-
-function snd_really_bad() {
-       mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/gong.wav') );
-}
-
-function snd_good() {
-       mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/turn.wav') );
-}
-
-function snd_circ_good() {
-       mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/clicked.wav') );
-}
-
-function snd_circ_bad() {
-       mw.G.sound.play( xp_url_init('chrome://evergreen/skin/media/sounds/cow.wav') );
-}
-
-function snd_logon() {
-
-}
-
-function snd_logoff() {
-
-}
-
-function snd_exit() {
-
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js b/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js
deleted file mode 100644 (file)
index 4303c8d..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-function spawn_interface(d,placement,place,chrome,label,passthru_params,clone) {
-       sdump('D_SPAWN',arg_dump(arguments,{0:true,1:true,2:true,3:true,4:true,5:true}));
-       var w;
-       switch(placement) {
-               case 'new_tab' : 
-                       mw.new_tab(d,place); 
-                       w = spawn_interface(d,'replace_tab',place,chrome,label,passthru_params,clone); break;
-
-               case 'replace_tab' : 
-                       w = mw.replace_tab(d,place,label,chrome); break;
-
-               case 'new_window' : 
-                       w = new_window( chrome, { 'window_name' : label } ); break;
-
-
-               case 'replace_iframe' :
-               case 'replace_browser' :
-               case 'replace_editor' :
-                       var el = placement.slice(8);
-                       var container = get_widget( d, place );
-                       empty_widget( d, container );
-                       w = spawn_interface(d,'new_' + el,place,chrome,label,passthru_params,clone); 
-                       break;
-
-               case 'new_iframe' :
-               case 'new_browser' :
-               case 'new_editor' :
-                       var el = placement.slice(4);
-                       var frame = d.createElement( el );
-                       frame.setAttribute('flex','1');
-                       get_widget( d, place ).appendChild( frame );
-                       w = spawn_interface(d,'set_frame',frame,chrome,label,passthru_params,clone); 
-                       break;
-
-               case 'set_frame' :
-                       var frame = get_widget( d, place );
-                       if (clone) {
-                               frame.contentWindow.document = mw.G.test_win.document.cloneNode(true);
-                       } else {
-                               frame.setAttribute('src',chrome); 
-                       }
-                       w = frame.contentWindow;
-                       break;
-       }
-       w.params = passthru_params;
-       w.mw = mw;
-       if (placement == 'new_tab' || placement == 'replace_tab') {
-               w.app_shell = d;
-       } else {
-               if (typeof app_shell != 'undefined') w.app_shell = app_shell;
-       }
-       return w;
-}
-
-/* developer utilities */
-
-function spawn_javascript_console(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://global/content/console.xul';
-       return spawn_interface(d,placement,place,chrome,getString('javascript_console_label'),passthru_params,clone);
-}
-
-function spawn_xuleditor(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/util/xuledit.xul';
-       return spawn_interface(d,placement,place,chrome,getString('xuleditor_label'),passthru_params,clone);
-}
-
-function spawn_javascript_shell(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/util/shell.html';
-       return spawn_interface(d,placement,place,chrome,getString('javascript_shell_label'),passthru_params,clone);
-}
-
-function spawn_filter_console(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/util/filter_console.xul';
-       return spawn_interface(d,placement,place,chrome,getString('filter_console_label'),passthru_params,clone);
-}
-
-function spawn_fieldmapper(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/util/fm_view.xul';
-       return spawn_interface(d,placement,place,chrome,getString('fieldmapper_label'),passthru_params,clone);
-}
-
-/* current */
-
-function spawn_main() {
-       sdump('D_SPAWN','trying to spawn app_shell\n');
-       try {
-               var w = new_window('chrome://evergreen/content/main/app_shell.xul', {});
-               if (!w) { throw('window ref == null'); }
-               try {
-                       w.params = {};
-                       return w;
-               } catch(E) {
-                       alert('Hrmm. ' + pretty_print( js2JSON(E) ) );
-               }
-       } catch(E) {
-               dump(js2JSON(E)+'\n');
-       }
-}
-
-function spawn_checkin(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/circ/checkin.xul';
-       return spawn_interface(d,placement,place,chrome,getString('checkin_interface_label'),passthru_params,clone);
-}
-
-function spawn_record_details(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/details.xul';
-       return spawn_interface(d,placement,place,chrome,'DETAILS',passthru_params,clone);
-}
-
-function spawn_hold_capture(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/circ/hold_capture.xul';
-       return spawn_interface(d,placement,place,chrome,getString('hold_capture_interface_label'),passthru_params,clone);
-}
-
-function spawn_opac_navigator(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/opac/opac.xul';
-       //var chrome = 'http://google.com/';
-       return spawn_interface(d,placement,place,chrome,getString('opac_navigator_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_barcode_entry(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_barcode_entry.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_barcode_entry_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_display(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_display.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_display_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_search(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_search.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_search_interface_label'),passthru_params,clone);
-}
-
-function spawn_receipt_template_editor(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/circ/receipt_template_editor.xul';
-       return spawn_interface(d,placement,place,chrome,getString('receipt_template_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_spine_label_wizard(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/spine_label_wizard.xul';
-       return spawn_interface(d,placement,place,chrome,getString('spine_label_wizard'),passthru_params,clone);
-}
-
-/* legacy code, may be removed or refactored */
-
-function spawn_batch_copy_editor(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/copy_edit.xul';
-       return spawn_interface(d,placement,place,chrome,getString('copies_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_bill_wizard(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_bill_wizard.xul';
-       return spawn_interface(d,placement,place,chrome,getString('bills_wizard_label'),passthru_params,clone);
-}
-
-function spawn_patron_bill_details(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_bill_details.xul';
-       return spawn_interface(d,placement,place,chrome,getString('bill_details_label'),passthru_params,clone);
-}
-
-function spawn_copy_browser(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
-       return spawn_interface(d,placement,place,chrome,getString('copy_browser_interface_label'),passthru_params,clone);
-}
-
-function spawn_brief_view(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/brief.xul';
-       return spawn_interface(d,placement,place,chrome,'BRIEF VIEW',passthru_params,clone);
-}
-
-function spawn_marc_editor(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/cat/marc.xul';
-       return spawn_interface(d,placement,place,chrome,getString('marc_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_oclc_import(d,placement,place,passthru_params,clone) {
-       sdump('D_SPAWN','trying to spawn_oclc_import('+js2JSON(passthru_params)+')\n');
-       // sample TCN: 03715963 
-       try {
-               if (passthru_params.tcn.length < 6) {
-                       throw("Too short.  At the moment, we're really doing a search rather than a retrieve, and it's a substring search at that.  We grab the result that matches exactly.  But sending a short query would just be mean. :)");
-               }
-               var result = user_request(
-                       'open-ils.search',
-                       'open-ils.search.z3950.import',
-                       [ mw.G.auth_ses[0], passthru_params.tcn ]
-               )[0];
-               if (result) {
-                       if (typeof result == 'object') {
-                               if (result.records && result.records.length > 0) {      
-                                       passthru_params['import_tree'] = result.records[0];
-                               } else {
-                                       throw('no records. result = ' + js2JSON(result) + '\n');
-                               }
-                       } else {
-                               throw('result: ' + js2JSON(result) + '\n');
-                       }
-                       spawn_marc_editor(d,placement,place,passthru_params);
-               }
-       } catch(E) {
-               mw.handle_error(E);
-       }
-}
-
-function spawn_new_marc_creation(d,placement,place,passthru_params,clone) {
-       sdump('D_SPAWN','trying to spawn_new_marc_creation('+js2JSON(passthru_params)+')\n');
-       if (! passthru_params.type) passthru_params.type = 'book';
-       try {
-               var record = user_request(
-                       'open-ils.cat',
-                       'open-ils.cat.biblio.marc_template.retrieve',
-                       [ passthru_params.type ]
-               )[0];
-               passthru_params['import_tree'] = record;
-               passthru_params['new_tree'] = true;
-               spawn_marc_editor(d,placement,place,passthru_params);
-       } catch(E) {
-               mw.handle_error(E);
-       }
-}
-
-function marc_view(app_shell,record_id) {
-       try {
-               var html = user_request(
-                       "open-ils.search",
-                       "open-ils.search.biblio.record.html",
-                       [ record_id ]
-               )[0];
-               html = html.replace( /<table/, '<div id="this_div"><input id="copy_btn" type="submit" value="Copy Browser" /><input id="marc_btn" type="submit" value="MARC Editor" /></div><table' );
-               var id = record_id;
-               var win = new_window("data:text/html," + html);
-               setTimeout(
-                       function() {
-                               win.document.title = "View MARC";
-                               win.focus();
-                               win.document.getElementById('marc_btn').addEventListener(
-                                       'click',
-                                       function(ev) {
-                                               spawn_marc_editor( 
-                                                       app_shell, 'new_tab', 'main_tabbox', { 
-                                                               'find_this_id' : record_id 
-                                                       } 
-                                               ).find_this_id = record_id;
-                                       },
-                                       false
-                               );
-                               win.document.getElementById('copy_btn').addEventListener(
-                                       'click',
-                                       function(ev) {
-                                               spawn_copy_browser( 
-                                                       app_shell, 'new_tab', 'main_tabbox', { 
-                                                               'find_this_id' : record_id 
-                                                       } 
-                                               ).find_this_id = record_id;
-                                       },
-                                       false
-                               );
-                       }, 0
-               );
-       } catch(E) {
-               handle_error(E);
-       }
-}
-
-function spawn_patron_edit(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_editor_interface_label'),passthru_params,clone);
-}
-
-function spawn_patron_register(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/patron/patron_new_legacy.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_register_interface_label'),passthru_params,clone);
-}
-
-function spawn_copy_stat_cat_edit(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/stat_cat/copy_stat_cat_editor.xul';
-       return spawn_interface(d,placement,place,chrome,getString('copy_stat_cat_editor_interface'),passthru_params,clone);
-}
-
-function spawn_patron_stat_cat_edit(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/stat_cat/patron_stat_cat_editor.xul';
-       return spawn_interface(d,placement,place,chrome,getString('patron_stat_cat_editor_interface'),passthru_params,clone);
-}
-
-function spawn_survey_admin_wizard(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/survey/survey_wizard.xul';
-       return spawn_interface(d,placement,place,chrome,getString('survey_admin_interface_label'),passthru_params,clone);
-}
-
-function spawn_z3950_import(d,placement,place,passthru_params,clone) {
-       var chrome = 'chrome://evergreen/content/z39_50/z39_50.xul';
-       return spawn_interface(d,placement,place,chrome,getString('z39_50_import_interface_label'),passthru_params,clone);
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/util.js b/Evergreen/staff_client/chrome/content/evergreen/util/util.js
deleted file mode 100644 (file)
index 52754e6..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-sdump('D_TRACE','Loading util.js\n');
-
-var counter = {};
-var consider_Timeout_default = false;
-
-function a_get( obj, i ) { return obj[i]; } // for use in closures inside loops
-
-// This executes a series of functions, but tries to give other events/functions a chance to
-// execute between each one.
-function chain_exec() {
-       sdump('D_UTIL',arg_dump(arguments));
-       var args = [];
-       for (var i = 0; i < arguments.length; i++) {
-               var arg = arguments[i];
-               if (typeof(arg)=='function') args.push( arg );
-               else for (var j = 0; j < arg.length; j++) {
-                       if (typeof(arg[j])=='function') args.push( arg[j] );
-               }
-       }
-       if (args.length > 0) setTimeout(
-               function() {
-                       args[0]();
-                       if (args.length > 1 ) chain_exec( args.slice(1) );
-               }, 0
-       );
-}
-
-function consider_Timeout( f, t, b) {
-       sdump('D_TIMEOUT', arg_dump(arguments,{0:true,1:true,2:true}));
-       if (b) {
-               setTimeout(f,t);
-       } else {
-               if (consider_Timeout_default)
-                       setTimeout(f,t);
-               else
-                       f();
-       }
-}
-
-function parse_render_string( obj_string, render_string, regexp ) {
-       sdump('D_UTIL', arg_dump(arguments,{0:true,1:true}));
-       var cmd;
-       try {
-               if (!regexp) regexp = /\$\$/g;
-               if (render_string.slice(0,1) == '.') {
-                       cmd = obj_string + render_string;
-               } else {
-                       cmd = render_string.replace( regexp, obj_string );
-               }
-
-       } catch(E) {
-
-               sdump('D_ERROR',E);
-       }
-       sdump('D_UTIL', 'cmd = ' + cmd + '\n');
-       return cmd;
-}
-
-function getString( key ) {
-       var s = '';
-       var bundles = mw.document.getElementById('string_bundles');
-       sdump('D_STRING','bundles = ' + bundles + ' bundles.childNodes.length = ' + bundles.childNodes.length + '\n');
-       for (var i = 0; i < bundles.childNodes.length; i++) {
-               var bundle = bundles.childNodes[i];
-               sdump('D_STRING','\ttrying bundle = ' + bundle + '\n');
-               try {
-
-                       var string = bundle.getString( key );
-                       if (string) {
-                               s = string;
-                               sdump('D_STRING','\tfound\n');
-                       } else {
-                               sdump('D_STRING','\tnot found\n');
-                       }
-
-               } catch(E) {
-                       sdump('D_ERROR','string: ' + key + ' not found\n');
-                       s = key;
-               }
-       }
-       sdump('D_STRING',key + '=' + s + '\n');
-       return s;
-}
-
-function getFormattedString( key, strArray ) {
-       var s = '';
-       var bundles = mw.document.getElementById('string_bundles');
-       for (var i = i; i < bundles.childNodes.length; i++) {
-               var bundle = bundles[i];
-               try {
-
-                       var string = bundle.getFormattedString( key, strArray );
-                       if (string)
-                               s = string;
-
-               } catch(E) {
-                       sdump('D_ERROR','string: ' + key + ' not found\n');
-                       s = key;
-               }
-       }
-       sdump('D_STRING',key + '(' + strArray + ')=' + s + '\n');
-       return s;
-}
-
-function string_to_array(s) {
-       var my_array = [];
-       for (var i = 0; i < s.length; i++ ) {
-               my_array.push( s.charAt(i) );
-       }
-       return my_array;
-}
-
-function yesno(value) {
-       switch(value) {
-               case true: case 'true': case '1': case 'on':
-                       return 'Yes';
-               default: 
-                       return 'No';
-       }
-}
-
-function dollars_float_to_cents_integer( money ) {
-       // careful to avoid fractions of pennies
-       var money_s = money.toString();
-       // FIXME: strip miscellaneous characters
-       var marray = money_s.split(".");
-       var dollars = marray[0];
-       var cents = marray[1];
-       try {
-               if (cents.length < 2) {
-                       cents = cents + '0';
-               }
-       } catch(E) {
-               // I'm not sure why these are getting thrown, especially with the code still working
-               sdump('D_ERROR',"cents.length? " + E + "\n");
-       }
-       try {
-               if (cents.length > 2) {
-                       sdump('D_ERROR',"We don't round money\n");
-                       cents = cents.substr(0,2);
-               }
-       } catch(E) {
-               sdump('D_ERROR',"cents.length? " + E + "\n");
-       }
-       var total = 0;
-       try {
-               if (parseInt(cents)) total += parseInt(cents);
-       } catch(E) {
-               sdump('D_ERROR',"parseInt(cents)? " + E + "\n");
-       }
-       try {
-               if (parseInt(dollars)) total += (parseInt(dollars) * 100);
-       } catch(E) {
-               sdump('D_ERROR',"parseInt(dollars)? " + E + "\n");
-       }
-       return total;   
-}
-
-function cents_as_dollars( cents ) {
-       cents = cents.toString(); 
-       // FIXME: strip miscellaneous characters
-       try {
-               switch( cents.length ) {
-                       case 0: cents = '000'; break;
-                       case 1: cents = '00' + cents; break;
-               }
-       } catch(E) {
-               sdump('D_ERROR',"cents_as_dollars: cents.length? " + E + "\n");
-       }
-       return cents.substr(0,cents.length-2) + '.' + cents.substr(cents.length - 2);
-}
-
-function debug() {
-       var s = '';
-       for (var i = 0; i < arguments.length; i++) {
-               s = s + arguments[i];
-       }
-       //sdump('D_UTIL','debug:' + s + '\n');
-       dump('debug:' + s + '\n');
-}
-
-function counter_init(id) {
-       counter[id] = 0;
-}
-
-function counter_incr(id) {
-       if (! counter[id]) { counter_init(id); }
-       return ++counter[id];
-}
-
-function counter_peek(id) {
-       if (! counter[id]) { return 0; }
-       return counter[id];
-}
-
-function dump_ns_node( node ) {
-       return (
-       'id=<' + 
-       node[fieldmap["Fieldmapper::biblio::record_node"].fields.id.position] 
-       + '>  intra-id=<' + 
-       node[fieldmap["Fieldmapper::biblio::record_node"].fields.intra_doc_id.position]
-       + '>  name=<' + 
-       node[fieldmap["Fieldmapper::biblio::record_node"].fields.name.position]
-       + '>  node_type=<' + 
-       node[fieldmap["Fieldmapper::biblio::record_node"].fields.type.position]
-       + '>  parent_node=<' + 
-       node[fieldmap["Fieldmapper::biblio::record_node"].fields.parent_node.position]
-       + '>  '
-       );
-}
-
-function nodeset2tree(ns) {
-       for (var i in ns) {
-               if (ns[i].parent_node) {
-                       ns_addChild( 
-                               ns, 
-                               ns[i].parent_node, 
-                               ns[i].intra_doc_id 
-                       );
-               }
-       }
-       return ns;
-}
-
-function ns_addChild(ns,p,c) {
-       if (! ns[p].children ) { ns[p].children = []; }
-       ns[p].children.push(ns[c]);
-}
-
-function print_tabs(t) {
-       var r = '';
-       for (var j = 0; j < t; j++ ) { r = r + "\t"; }
-       return r;
-}
-
-function pretty_print(s) {
-       var r = ''; var t = 0;
-       for (var i in s) {
-               if (s[i] == '{') {
-                       r = r + "\n" + print_tabs(t) + s[i]; t++;
-                       r = r + "\n" + print_tabs(t);
-               } else if (s[i] == '[') {
-                       r = r + "\n" + print_tabs(t) + s[i]; t++;
-                       r = r + "\n" + print_tabs(t);
-               } else if (s[i] == '}') {
-                       t--; r = r + "\n" + print_tabs(t) + s[i]; 
-                       r = r + "\n" + print_tabs(t);
-               } else if (s[i] == ']') { 
-                       t--; r = r + "\n" + print_tabs(t) + s[i];
-                       r = r + "\n" + print_tabs(t);
-               } else if (s[i] == ',') {
-                       r = r + s[i]; 
-                       r = r + "\n" + print_tabs(t);
-               } else {
-                       r = r + s[i];
-               }
-       }
-       return r;
-}
-
-function super_dump(o,t) {
-       var s = "\n";
-       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-       s = s + "=-=-=\n";
-       s = s + 'o.constructor == Array = ' + (o.constructor == Array) + '\n';
-       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-       s = s + "typeof = " + typeof(o) + "\n";
-       try {
-               var string = new XMLSerializer().serializeToString(o);
-               return( string + "\n" );
-       } catch( E ) {
-               var i;
-               var c = 0;
-               for (i in o) {
-                       switch(typeof(i)) {
-                               case 'object':
-                                       s = s + super_dump(i,t+1);
-                                       break;
-                               default :
-                                       var value = o[i];
-                                       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-                                       s = s + "\tMember#" + c++ + "\tType:" + typeof(value);
-                                       if (typeof(value) == 'object') {
-                                               value = super_dump(value,t+1);
-                                       }
-                                       s = s + "\ttoString:" + i.toString() + "\tvalue:" + value + "\n";
-                                       break;
-                       }
-               }
-               return( s + "\n" );
-       }
-}
-
-function super_dump_norecurse(o,t) {
-       var s = "\n";
-       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-       s = s + "=-=-=\n";
-       s = s + 'o.constructor == Array = ' + (o.constructor == Array) + '\n';
-       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-       s = s + "typeof = " + typeof(o) + "\n";
-       try {
-               var string = new XMLSerializer().serializeToString(o);
-               return( string + "\n" );
-       } catch( E ) {
-               var i;
-               var c = 0;
-               for (i in o) {
-                       switch(typeof(i)) {
-                               default :
-                                       var value = o[i];
-                                       for (var ii = 0; ii < t; ii++) { s = s + '\t'; }
-                                       s = s + "\tMember#" + c++ + "\tType:" + typeof(value);
-                                       s = s + "\ttoString:" + i.toString() + "\n";
-                                       break;
-                       }
-               }
-               return( s + "\n" );
-       }
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/util_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/util/util_overlay.xul
deleted file mode 100644 (file)
index 66e075a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<!-- Modified by Jason for Evergreen -->
-
-<overlay id="util"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<util id="util_js">
-
-       <script>
-               var IAMXUL = true;
-               dump('Loading all the js in the util overlay...\n');
-       </script>
-
-       <script src="error.js" />       <!-- more like output handling -->
-       <script src="util.js" />        <!-- miscellaneous scripts.  want to make this empty -->
-       <script src="file.js" />        <!-- file IO -->
-       <script src="datetime.js" />    <!-- date & time related functions -->
-       <script src="functional.js" />  <!-- neat use of first-class functions, and some predecessors -->
-       <script src="fm_utils.js" />    <!-- some convenience functions for fieldmapper objects -->
-       <script src="validate.js" />    <!-- some validation functions -->
-       <script src="widgets.js" />     <!-- some convenience functions for XUL/HTML elements.  want to eliminate overlap with webutils -->
-       <script src="populate.js" />    <!-- populate widgets (like menus) with values -->
-
-       <script src="chrome://evergreen/content/Open-ILS/util/utils.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/md5.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/JSON.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/fmall.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/fmgen.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/RemoteRequest.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/OrgTree.js" />
-       <script src="chrome://evergreen/content/Open-ILS/util/org_utils.js" />
-       <script>IAMXUL = true;</script>
-
-       <script src="ses.js" />         <!-- my wrapper over the OpenSRF communication layer.. Jabber and XMLHttpRequest -->
-       <script src="explode.js" />     <!-- original attempt at linking widgets to data.  Want to use something more OO -->
-       <script src="win.js" />         <!-- window and tab handling -->
-       <script src="spawn_win.js" />   <!-- spawning various interfaces in tabs -->
-       <script src="xpcom.js" />       <!-- misc xpcom -->
-       <script src="print.js" />       <!-- some xpcom for printing -->
-       <script src="sound.js" />       <!-- some xpcom for sound -->
-
-       <script>
-               dump('Finished all the js in the util overlay...\n');
-       </script>
-</util>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/validate.js b/Evergreen/staff_client/chrome/content/evergreen/util/validate.js
deleted file mode 100644 (file)
index 9db5af4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-sdump('D_TRACE',"Loading validate.js\n");
-
-function valid_year_month_day(year,month,day) {
-       var date = new Date(year,month-1,day);
-       return (
-               (date.getFullYear() == year) &&
-               (date.getMonth()+1 == month) &&
-               (date.getDate() == day)
-       );
-}
-
-function textbox_checkdigit(ev) {
-       if ( check_checkdigit( ev.target.value ) ) {
-               sdump('D_VALIDATE', 'success\n');
-               return true;
-       } else {
-               sdump('D_VALIDATE', 'failure\n');
-               ev.preventDefault();
-               ev.stopPropagation();
-               return false;
-       }
-}
-
-function check_checkdigit(barcode) {
-
-       var stripped_barcode = barcode.slice(0,-1);
-       var checkdigit = barcode.slice(-1);
-
-       sdump('D_VALIDATE', '\n\n=-=***=-=\n\ncheck_checkdigit: barcode = ' + barcode + ' barcode stripped = ' + stripped_barcode + ' checkdigit = ' + checkdigit + '\n');
-
-       var sum = 0; var mul = 2;
-
-       var b_array = string_to_array( stripped_barcode ).reverse();
-       sdump('D_VALIDATE', '\tb_array = ' + b_array + '\n');
-
-       for (var i in b_array) {
-               var digit = parseInt( b_array[i] );
-               sdump('D_VALIDATE', '\t\tdigit = ' + digit + '\n');
-
-               var product = digit * mul;
-               if (mul == 2) { mul = 1; } else { mul = 2; }
-
-               var p_array = string_to_array( product.toString() );
-               sdump('D_VALIDATE', '\t\tp_array = ' + p_array + '\n');
-
-               for (var j in p_array) { 
-                       var n = parseInt( p_array[j] );
-                       sdump('D_VALIDATE', '\t\t\tn = ' + n + '\n');
-                       sum += n;
-               }
-       }
-
-       sdump('D_VALIDATE', '\tsum = ' + sum + '\n');
-
-       var s_array = string_to_array( sum.toString() );
-       var calculated_checkdigit = s_array.pop();
-       if (calculated_checkdigit > 0) calculated_checkdigit = 10 - calculated_checkdigit;
-       sdump('D_VALIDATE', '\tcalculated checkdigit = ' + calculated_checkdigit + '\n\n=-=***=-=\n\n');
-
-       return ( calculated_checkdigit == checkdigit );
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/widgets.js b/Evergreen/staff_client/chrome/content/evergreen/util/widgets.js
deleted file mode 100644 (file)
index 7bb64f9..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-sdump('D_WIDGETS',"Loading widgets.js\n");
-
-// This was originally used in circ.js for checkin and checkout lists.
-// The first argument is the treechildren element for the tree.
-// Subsequent arguments are treated as textual values for treecells in that treeitem.
-var treeitem_id = 0;
-function append_treeitem() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var e;
-       if (arguments.length == 1) {
-               e = arguments[0];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-               if (typeof(e) != 'object') { e = d.getElementById(e); }
-       }
-       if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
-       var treechildren = e;
-
-       if (!treechildren) { sdump('D_WIDGETS','No ' + id + ' to append to\n'); return null; }
-
-       var treeitem = elem('treeitem'); treechildren.appendChild(treeitem);
-       var treerow = elem('treerow'); treeitem.appendChild(treerow);
-       for (var i = 2; i < arguments.length ; i++ ) {
-               var treecell = elem(
-                       'treecell',
-                       { 'label': arguments[i], 'id' : 'treeitem_' + treeitem_id + '_' + i }
-               );
-               treerow.appendChild(treecell);
-               //sdump('D_WIDGETS','treecell.label = ' + arguments[i] + '\n');
-       }
-       return treeitem_id++;
-}
-
-// This was used in browse_list.js as a more flexible alternative to swap_attribute.
-// The first argument is the element, the second argument is the pertinant attribute,
-// and the third argument is an array of values to cycle through for setting the
-// element's attribute.  Ex: var toggle = cycle_attribute( target,'toggle',['1','2','3'] );
-function cycle_attribute() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var e; var a; var v;
-       if (arguments.length == 3) {
-               e = arguments[0];
-               a = arguments[1];
-               v = arguments[2];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-               a = arguments[2];
-               v = arguments[3];
-               if (typeof(e) != 'object') { e = d.getElementById(e); }
-       }
-       try {
-               if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
-               if (!a) { throw('!a : a = ' + a); }
-               if (! e.getAttribute(a) ) { throw(' ! e.getAttribute(a) : a = ' + a); }
-               if (typeof(v) != 'object') { throw('typeof v != object : typeof v = ' + typeof(v)); }
-
-               var toggle = e.getAttribute(a);
-               var next_one = false;
-               sdump('D_WIDGETS','cycling ' + a + ' on ' + e.getAttribute('id') + ' to ');
-               for (var i = 0; i < v.length; i++) {
-                       if (next_one) {
-                               e.setAttribute(a,v[i]);
-                               sdump('D_WIDGETS',v[i] + '\n');
-                               return v[i];
-                       }
-                       if (toggle == v[i]) {
-                               next_one = true;
-                       }
-               }
-               if (next_one) {
-                       e.setAttribute(a,v[0]);
-                       sdump('D_WIDGETS',v[0] + '\n');
-                       return v[0];
-               } else {
-                       throw('current value not in list');
-               }
-       } catch(E) {
-               sdump('D_WIDGETS','cycle_attribute error: ' + js2JSON(E) + '\n');
-               sdump('D_WIDGETS','null\n');
-               return null;
-       }
-}
-
-// Treats each argument as an element to disable 
-function disable_widgets() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var idx = 0;
-       if (arguments[0].nodeName == '#document') {
-               idx = 1; d = arguments[0];
-       }
-       for (var i = idx; i < arguments.length; i++) {
-               if (typeof(arguments[i]) == 'object') {
-                       sdump('D_WIDGETS',arguments[i] + '.disabled = true;\n');
-                       arguments[i].disabled = true;
-               } else {
-                       var w = d.getElementById( arguments[i] );
-                       if (w) { 
-                               sdump('D_WIDGETS',w + '.disabled = true;\n');
-                               w.disabled = true; 
-                       }
-               }
-       }
-}
-
-// removes listitems from listboxes
-function empty_listbox() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var e;
-       if (arguments.length == 1) {
-               e = arguments[0];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-               if (typeof(e) != 'object') { e = d.getElementById(e); }
-       }
-       if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_listbox\n'); return null; }
-       var nl = e.getElementsByTagName('listitem');
-       for (var i = 0; i < nl.length; i++) {
-               e.removeChild(nl[i]);
-       }
-}
-
-// removes all of an element's children
-function empty_widget() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var e;
-       if (arguments.length == 1) {
-               e = arguments[0];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-               if (typeof(e) != 'object') { e = d.getElementById(e); }
-       }
-       if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_widget\n'); return null; }
-       while (e.lastChild) { e.removeChild(e.lastChild); }
-}
-
-
-// Treats each argument as an element to enable 
-function enable_widgets() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var idx = 0;
-       if (arguments[0].nodeName == '#document') {
-               idx = 1; d = arguments[0];
-       }
-       for (var i = idx; i < arguments.length; i++) {
-               if (typeof(arguments[i]) == 'object') {
-                       sdump('D_WIDGETS',arguments[i] + '.disabled = false;\n');
-                       arguments[i].disabled = false;
-               } else {
-                       var w = d.getElementById( arguments[i] );
-                       if (w) { 
-                               sdump('D_WIDGETS',w + '.disabled = false;\n');
-                               w.disabled = false; 
-                       }
-               }
-       }
-}
-
-// Originally used in volume.js after intercepting Enter presses on the keyboard.
-// The first argument is the element to search for textboxes, and the second
-// argument is the current textbox.  This function finds the next textbox and
-// gives it focus.
-function fake_tab_for_textboxes() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var w; var current;
-       if (arguments.length == 2) {
-               w = arguments[0];
-               current = arguments[1];
-       } else {
-               d = arguments[0];
-               w = arguments[1];
-               current = arguments[2];
-               if (typeof(w)!='object') { w = d.getElementById(w); }
-       }
-       var flag = false; var next_one;
-       sdump('D_WIDGETS', 'fake_tab_for_textboxes: Current ' + current + '\n');
-       var nl = w.getElementsByTagName('textbox');
-       //var nl = d.getElementsByTagName('textbox');
-       sdump('D_WIDGETS', 'fake_tab_for_textboxes: nl.length = ' + nl.length + '\n');
-       for (var i = 0; i < nl.length; i++) {
-               sdump('D_WIDGETS', 'fake_tab_for_textboxes: Considering ' + nl[i] + '...\n');
-               if (flag && !next_one) {
-                       sdump('D_WIDGETS', 'fake_tab_for_textboxes: Setting next_one ' + nl[i] + '\n'); 
-                       next_one = nl[i];
-               }
-               if (nl[i] === current) {
-                       sdump('D_WIDGETS','fake_tab_for_textboxes: Found current\n');
-                       flag = true;
-               }
-       }
-       if (!next_one) {
-               sdump('D_WIDGETS','fake_tab_for_textboxes: Out of loop, Setting next_one ' + nl[0] + '\n');     
-               next_one = nl[0];
-       }
-       if (next_one) {
-               next_one.focus(); next_one.select();
-       } else {
-               sdump('D_WIDGETS','fake_tab_for_textboxes: next_one not set\n');
-       }
-}
-
-
-// Not actually used anywhere.  I'm not sure what this is :D
-// Ah, looks like it could handle XUL trees and fieldmapper trees
-// Ex. find( org_tree, function(o){return o.children();}, function(o){return (o.id == 'the winner');})
-function find_tree_via_children() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d; var tree; var children_func; var find_func;
-       if (arguments.length == 3) {
-               tree = arguments[0];
-               children_func = arguments[1];
-               find_func = arguments[2];
-       } else {
-               d = arguments[0];
-               tree = arguments[1];
-               children_func = arguments[2];
-               find_func = arguments[3];
-               if (typeof(tree)!='object') tree = d.getElementById(tree);
-       }
-
-       var t = find_func(tree); if (t) return t;
-
-       var c = children_func(tree);
-
-       for (var i = 0; i < c.length; i++) {
-               t = find_func( c[i] );
-               if (t) return t;
-       }
-}
-
-
-// Give this element focus
-function focus_widget() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var e;
-       if (arguments.length == 1) {
-               e = arguments[0];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-       }
-       if (typeof(e) == 'object') {
-               e.focus();
-       } else {
-               var w = d.getElementById(e);
-               if (w) { w.focus(); }
-       }
-}
-
-// Returns a list of selected treeitems from the specified tree
-function get_list_from_tree_selection() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var tree_w;
-       if (arguments.length == 1) {
-               tree_w = arguments[0];
-       } else {
-               d = arguments[0];
-               tree_w = arguments[1];
-       }
-       var hitlist;
-       if (typeof(tree_w) != 'object') {
-               hitlist = d.getElementById(tree_w);
-       } else {
-               hitlist = tree_w;
-       }
-       var list = [];
-       var start = new Object();
-       var end = new Object();
-       var numRanges = hitlist.view.selection.getRangeCount();
-       for (var t=0; t<numRanges; t++){
-               hitlist.view.selection.getRangeAt(t,start,end);
-               for (var v=start.value; v<=end.value; v++){
-                       var i = hitlist.contentView.getItemAtIndex(v);
-                       //sdump('D_WIDGETS',i.tagName + '\n');
-                       list.push( i );
-               }
-       }
-       return list;
-}
-
-// Make sure we a widget
-function get_widget() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var e;
-       if (arguments.length == 1) {
-               e = arguments[0];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-       }
-       if (typeof(e) == 'object') {
-               return e;
-       } else {
-               var w = d.getElementById(e);
-               if (w) return w;
-       }
-       return null;
-}
-
-// Increment a XUL progressmeter
-function incr_progressmeter() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var meter; var increment;
-       if (arguments.length == 2) {
-               meter = arguments[0];
-               increment = arguments[1];
-       } else {
-               d = arguments[0];
-               meter = arguments[1];
-               increment = arguments[2];
-       }
-       if (typeof(meter)!='object') 
-               meter = d.getElementById(meter);
-       if (typeof(meter)!='object')
-               return null;
-
-       var real = meter.getAttribute('_real');
-
-       if (!real)
-               real = 0;
-       real = parseFloat( real ) + parseFloat( increment );
-
-       if (real > 100)
-               real = 100;
-       else if ( real < 0)
-               real = 0;
-
-       meter.setAttribute('_real',real);
-       meter.value = Math.ceil( real );
-}
-
-// Populate a treeitem row
-function map_array_to_treecells_via_treeitem( cols, treeitem ) {
-       sdump('D_WIDGETS',arg_dump(arguments),{0:true});
-       var treerow = treeitem.firstChild;
-       for (var i = 0; i < treerow.childNodes.length; i++) {
-               var treecell = treerow.childNodes[i];
-               treecell.setAttribute('label',cols[i]);
-               sdump('D_WIDGETS','treeitem = ' + treeitem + ' treerow = ' + treerow + ' treecell = ' + treecell + ' cols[ ' + i + '] = ' + cols[i] + '\n');
-       }
-}
-
-// Simulates radio buttons with checkboxes.  Include this in command event listeners
-// for the pertinent textboxes.  For any set of checkboxes that have the same 'group'
-// attribute, only one can be checked at a time.
-function radio_checkbox() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var ev;
-       if (arguments.length == 1) {
-               ev = arguments[0];
-       } else {
-               d = arguments[0];
-               ev = arguments[1];
-       }
-       var target = ev.target;
-       var group = target.getAttribute('group');
-       if (group) {
-               var nl = d.getElementsByTagName('checkbox');
-               for (var i in nl) {
-                       if (typeof(nl[i])=='object') {
-                               var c = nl[i];
-                               var cgroup = c.getAttribute('group');
-                               if (cgroup == group) {
-                                       c.checked = false;
-                               }
-                        }
-                }
-               target.checked = true;
-       } else {
-               sdump('D_WIDGETS','radio_checkbox: Checkbox must have a group attribute to find peers');
-       }
-}
-
-// simpler version of set_decks
-function set_deck() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var deck; var idx;
-       if (arguments.length == 2) {
-               deck = arguments[0];
-               idx = arguments[1];
-               set_decks({ deck : idx });
-       } else {
-               d = arguments[0];
-               deck = arguments[1];
-               idx = arguments[2];
-               set_decks(d,{ deck : idx });
-       }
-}
-
-// Takes a hash with key:value => deck element id : page index
-// Sets each deck to the corresponding index
-function set_decks() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var params;
-       if (arguments.length == 1) {
-               params = arguments[0];
-       } else {
-               d = arguments[0];
-               params = arguments[1];
-       }
-       for (var deck_id in params) {
-               var deck = deck_id;
-               if (typeof(deck) != 'object')
-                       deck = d.getElementById( deck_id )
-               if (deck) {
-                       deck.setAttribute( 'selectedIndex', params[deck_id] );
-                       deck.selectedIndex = params[deck_id];
-               }
-       }
-}
-
-// For setting a widget's displayable text
-function set_widget_value_for_display(e,v) {
-       sdump('D_WIDGETS',arg_dump(arguments,{1:true}));
-       if (v == null || v == undefined) v = '.....';
-       sdump('D_WIDGETS','e.tagName = ' + e.tagName + '\n');
-       sdump('D_WIDGETS','e.nodeName = ' + e.nodeName + '\n');
-       switch (e.tagName) {
-               case 'textbox' : e.value = v; break;
-               case 'label' : e.setAttribute('value',v); break;
-               case 'image' : e.setAttribute('src',v); break;
-               case 'menulist' : e.value = v;
-                       var menupopup = e.firstChild;
-                       var menuitem;
-                       for (var i = 0; i < menupopup.childNodes.length; i++) {
-                               if (menupopup.childNodes[i].getAttribute('value') == v ) menuitem = menupopup.childNodes[i];
-                       }
-                       if (menuitem) e.selectedItem = menuitem;
-                       break;
-               default: try {e.setAttribute('value',v); e.value = v;} catch(E) {} break;
-       }
-}
-
-// swaps the values of two attributes for an element
-function swap_attributes() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var e; var a1; var a2;
-       if (arguments.length == 3) {
-               e = arguments[0];
-               a1 = arguments[1];
-               a2 = arguments[2];
-       } else {
-               d = arguments[0];
-               e = arguments[1];
-               a1 = arguments[2];
-               a2 = arguments[3];
-               if (typeof(e) != 'object') { e = d.getElementById(e); }
-       }
-       if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on swap_attributes\n'); return null; }
-       var a1_v = e.getAttribute(a1);
-       var a2_v = e.getAttribute(a2);
-       e.setAttribute(a1,a2_v);
-       e.setAttribute(a2, a1_v);
-       sdump('D_WIDGETS','before: a1 = ' + a1_v + ' a2 = ' + a2_v + ' and ');
-       sdump('D_WIDGETS','after: a1 = ' + a2_v + ' a2 = ' + a1_v + '\n');
-}
-
-// Flips the hidden value for each row in a grid
-function toggle_hidden_grid_rows() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       if (arguments.length == 1) {
-               grid = arguments[0];
-       } else {
-               d = arguments[0];
-               grid = arguments[1];
-       }
-       if (typeof(grid) != 'object') {
-               grid = d.getElementById(grid);
-       }
-       if (!grid) { return null; }
-       var rows = grid.lastChild; if (!rows) { return null; }
-       for (var r = 0; r < rows.childNodes.length; r++ ) {
-               var row = rows.childNodes[r];
-               if (typeof(row) == 'object') {
-                       //sdump('D_WIDGETS','toggle row = ' + row + '\n');
-                       var hidden = row.getAttribute('hidden');
-                       if (hidden == 'true') {
-                               row.setAttribute('hidden','false');
-                       } else {
-                               row.setAttribute('hidden','true');
-                       }
-               }
-       }
-}
-
-/* The first parameter is the id of the element to set, or an array of ids for elements to set in batch.  The second parameter is an object containing the attribute/value pairs to assign to the element or elements */
-function xul_setAttributes() {
-       sdump('D_WIDGETS',arg_dump(arguments));
-       var d = document; var el; var attrs;
-       if (arguments.length == 2) {
-               el = arguments[0];
-               attrs = arguments[1];
-       } else {
-               d = arguments[0];
-               el = arguments[1];
-               attrs = arguments[2];
-       }
-       if (typeof(el) == 'object') {
-               for (var e in el) {
-                       var w = d.getElementById(e);
-                       for (var a in attrs) {
-                               w.setAttribute(a,attrs[a]);
-                       }
-               }
-       } else {
-               var w = d.getElementById(el);
-               for (var a in attrs) {
-                       w.setAttribute(a,attrs[a]);
-               }
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/win.js b/Evergreen/staff_client/chrome/content/evergreen/util/win.js
deleted file mode 100644 (file)
index 059b5e0..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-sdump('D_TRACE','Loading win.js\n');
-
-function s_alert(s) {
-       sdump('D_WIN',arg_dump(arguments));
-       // alert() replacement, intended to stop barcode scanners from "scanning through" the dialog
-
-       // get a reference to the prompt service component.
-       var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-               .getService(Components.interfaces.nsIPromptService);
-
-       // set the buttons that will appear on the dialog. It should be
-       // a set of constants multiplied by button position constants. In this case,
-       // three buttons appear, Save, Cancel and a custom button.
-       //var flags=promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0 +
-       //      promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1 +
-       //      promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2;
-       var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0;
-
-       // display the dialog box. The flags set above are passed
-       // as the fourth argument. The next three arguments are custom labels used for
-       // the buttons, which are used if BUTTON_TITLE_IS_STRING is assigned to a
-       // particular button. The last two arguments are for an optional check box.
-       var check = {};
-       sdump('D_WIN','s_alert: ' + s);
-       var rv = promptService.confirmEx(window,"ALERT",
-               s,
-               flags, 
-               "Enter", null, null, 
-               "Check this box to confirm this message", 
-               check
-       );
-       if (!check.value) {
-               snd_bad();
-               return s_alert(s);
-       }
-       return rv;
-}
-
-function yns_alert(s,title,b1,b2,b3,c) {
-       sdump('D_WIN',arg_dump(arguments));
-       // alert() replacement, intended to stop barcode scanners from "scanning through" the dialog
-
-       // get a reference to the prompt service component.
-       var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-               .getService(Components.interfaces.nsIPromptService);
-
-       // set the buttons that will appear on the dialog. It should be
-       // a set of constants multiplied by button position constants. In this case,
-       // three buttons appear, Save, Cancel and a custom button.
-       //var flags=promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0 +
-       //      promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1 +
-       //      promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2;
-       var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0 +
-               promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1 +
-               promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2; 
-
-       // display the dialog box. The flags set above are passed
-       // as the fourth argument. The next three arguments are custom labels used for
-       // the buttons, which are used if BUTTON_TITLE_IS_STRING is assigned to a
-       // particular button. The last two arguments are for an optional check box.
-       var check = {};
-       sdump('D_WIN','yns_alert: ' + s);
-       var rv = promptService.confirmEx(window,title, s, flags, b1, b2, b3, c, check);
-       if (c && !check.value) {
-               snd_bad();
-               return yns_alert(s,title,b1,b2,b3,c);
-       }
-       return rv;
-}
-
-function new_window(chrome,params) {
-       sdump('D_WIN',arg_dump(arguments));
-       var name = ++mw.G['window_name_increment'];
-       var options = 'chrome,resizable=yes,scrollbars=yes,width=800,height=600,fullscreen=yes';
-       try {
-               if (params) {
-                       if (params['window_name']) { name = params.window_name; }
-                       if (params['window_options']) { options = params.window_options; }
-               }
-       } catch(E) {
-       }
-       //var w = window.open(
-       var w = SafeWindowOpen(
-               chrome,
-               name,
-               options
-       );
-       if (w) {
-               if (w != self) { 
-                       w.parentWindow = self;
-                       w.mw = mw;
-                       //register_window(w); 
-               }
-               w.am_i_a_top_level_tab = false;
-               if (params) {
-                       w.params = params;
-               }
-       }
-       return w;
-}
-
-
-// From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
-// Message-ID: <ckjh7a$18q1@ripley.netscape.com>
-// Modified to return window handler, and do errors differently
-function SafeWindowOpen(url,title,features)
-{
-       sdump('D_WIN',arg_dump(arguments));
-       var w;
-
-   netscape.security.PrivilegeManager
-     .enablePrivilege("UniversalXPConnect");    
-   const CI = Components.interfaces;
-   const PB =
-     Components.classes["@mozilla.org/preferences-service;1"]
-     .getService(CI.nsIPrefBranch);
-
-   var blocked = false;
-   try
-   {
-     // pref 'dom.disable_open_during_load' is the main popup
-     // blocker preference
-     blocked = PB.getBoolPref("dom.disable_open_during_load");
-     if(blocked)
-       PB.setBoolPref("dom.disable_open_during_load",false);
-
-     w = window.open(url,title,features);
-   }
-   catch(e)
-   {
-     //alert("SafeWindowOpen error:\n\n" + e);
-     handle_error(e);
-   }
-   if(blocked)
-     PB.setBoolPref("dom.disable_open_during_load",true);
-
-       return w;
-} 
-
-function register_AppShell(w) {
-       sdump('D_WIN',arg_dump(arguments,{0:true}));
-       mw.G.appshell_list.push(w);
-}
-
-function unregister_AppShell(w) {
-       sdump('D_WIN',arg_dump(arguments,{0:true}));
-       mw.G.appshell_list = filter_list( mw.G.appshell_list, function(e){return(e!=w);} );
-}
-
-function register_window(w) {
-       sdump('D_WIN',arg_dump(arguments,{0:false}));
-       mw.G.win_list.push(w);
-       mw.G.last_win = w;
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function unregister_window(w) {
-       sdump('D_WIN',arg_dump(arguments,{0:true}));
-       mw.G.win_list = filter_list( mw.G.win_list, function(e){return(e!=w);} );
-       mw.G.last_win = mw.G.win_list[ mw.G.win_list.length - 1 ];
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function close_all_windows() {
-       sdump('D_WIN',arg_dump(arguments));
-       var w;
-       for (var i in mw.G.appshell_list) {
-               sdump('D_WIN','\tconsidering ' + i + '...');
-               if (mw.G.appshell_list[i] != mw) {
-                       sdump('D_WIN','closing');
-                       var w = mw.G.appshell_list[i];
-                       try { w.close(); } catch (E) {}
-               }
-               sdump('D_WIN','\n');
-       }
-       sdump('D_TRACE_EXIT',arg_dump(arguments));
-}
-
-function register_document(d) {
-       sdump('D_WIN',arg_dump(arguments,{0:true}));
-       mw.G.doc_list[d.toString()] = d;
-       mw.G.last_doc = d;
-}
-
-function unregister_document(d) {
-       sdump('D_WIN',arg_dump(arguments,{0:true}));
-       try { delete mw.G.doc_list[d.toString()]; } catch(E) { mw.G.doc_list[d.toString()] = false; }   
-}
-
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/xpcom.js b/Evergreen/staff_client/chrome/content/evergreen/util/xpcom.js
deleted file mode 100644 (file)
index 2c32320..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-sdump('TRACE','Loading xpcom.js\n');
-
-function xp_url_init(aURL) {
-       var URLContractID   = "@mozilla.org/network/standard-url;1";
-       var URLIID          = Components.classes[URLContractID].createInstance( );
-       var URL             = URLIID.QueryInterface(Components.interfaces.nsIURL);
-       if (aURL) {
-               URL.spec = aURL;
-       }
-       return URL;
-}
-
-function xp_WebNavigation_init(w) {
-       if (!w) { w = this; }
-       try {
-               var webNavigation = w
-                       .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIWebNavigation);
-               return webNavigation;
-       } catch(E) {
-               sdump('TRACE','WEB NAVIGATION EXCEPTION: ' + js2JSON(e) + '\n');
-       }
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/xuledit.js b/Evergreen/staff_client/chrome/content/evergreen/util/xuledit.js
deleted file mode 100644 (file)
index ca0df4e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html 
-// Modified by Jason for Evergreen to push in the main (auth) window reference
-var old = '';
-var timeout = -1;
-var xwin = null;
-var newwin = false;
-
-function init()
-{
-  if(xwin)  // for some reason onload gets called when the browser refreshes???
-    return;
-
-  update();
-  document.getElementById('ta').select();
-}
-
-function openwin()
-{
-  toggleBrowser(false);
-  xwin = window.open('about:blank', 'xulwin', 'chrome,all,resizable=yes,width=400,height=400');
-  newwin = true;
-  update();
-}
-
-function toggleBrowser(show)
-{
-  document.getElementById("split").collapsed = !show;
-  document.getElementById("content").collapsed = !show;
-  document.getElementById("open").collapsed = !show;
-}
-
-function update()
-{
-  var textarea = document.getElementById("ta");
-
-  // either this is the first time, or
-  // they closed the window
-  if(xwin == null || (xwin instanceof Window && xwin.document == null)) {
-    toggleBrowser(true);
-    xwin = document.getElementById("content");
-    newwin = true;
-  }
-
-  if (old != textarea.value || newwin) {
-    old = textarea.value;
-    newwin = false;
-    var dataURI = "data:application/vnd.mozilla.xul+xml," + encodeURIComponent(old);
-    if(xwin instanceof Window)
-      xwin.document.location = dataURI;
-    else
-      xwin.setAttribute("src",dataURI);
-  }
-  try { xwin.contentWindow.mw = mw; } catch(E) {}
-  try { xwin.mw = mw; } catch(E) {}
-
-  timeout = window.setTimeout(update, 500);
-}
-
-function resetTimeout()
-{
-  if(timeout != -1)
-    window.clearTimeout(timeout);
-
-  timeout = window.setTimeout(update, 500);
-}
diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/xuledit.xul b/Evergreen/staff_client/chrome/content/evergreen/util/xuledit.xul
deleted file mode 100644 (file)
index 79ade3f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<!-- From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html -->
-<!-- Edited by Jason for Evergreen -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window id="xuledit" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Live XUL Editor"
-onload="params.w = window; params.app = 'Xuledit'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
-<script type="application/x-javascript" src="xuledit.js"/>
-<vbox flex="1">
-<textbox id="ta" multiline="true" wrap="true" flex="1" onkeydown="resetTimeout()"
-value='&lt;?xml version="1.0"?&gt;&#x0A;&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;&#x0A;&lt;window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;&#x0A;&lt;label value="Put your XUL here!"/&gt;&#x0A;&lt;/window&gt;'/>
-<splitter id="split"/>
-<iframe id="content" src="about:blank" flex="1"/>
-<hbox><button id="open" label="Open preview in new window" onclick="openwin()"/><spacer flex="1"/></hbox>
-</vbox>
-</window>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.js
deleted file mode 100644 (file)
index a1afe41..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-dump('Loading z39_50.js\n');
-
-function z39_50_init() {
-       mw.sdump('D_Z39_50','**** TESTING: z39_50.js: z39_50_init(): ' + mw.G.main_test_variable + '\n');
-       mw.focus_widget( 't1' );
-}
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50.xul
deleted file mode 100644 (file)
index 6ef2c23..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<!-- Application: Evergreen Staff Client -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
-<?xml-stylesheet href="chrome://evergreen/skin/z39_50.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE page SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-
-<page id="z39_50_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="z39_50_init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('z39_50_win\n');</script>
-
-       <!-- Initial Overlays for this XUL file -->
-       <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_bundle.xul"?>
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="z39_50_vbox" class="test_class"/>
-
-</page>
-
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_bundle.xul
deleted file mode 100644 (file)
index be7f1ca..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-<overlay id="z39_50_bundle" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('z39_50_bundle\n');</script>
-
-       <?xul-overlay href="chrome://evergreen/content/z39_50/z39_50_overlay.xul"?>
-
-       <script src="z39_50.js" />
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul b/Evergreen/staff_client/chrome/content/evergreen/z39_50/z39_50_overlay.xul
deleted file mode 100644 (file)
index 5b10d64..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/z39_50.dtd">
-<overlay id="z39_50_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <script>dump('z39_50_overlay\n');</script>
-
-       <vbox id="z39_50_vbox" flex="1">
-               <description id="d1">
-                       This screen will likely evolve into a federated z39.50 search interface that will allow you to search a range of z39.50 servers using all of the search operators defined by the z39.50 spec.  For now, however, you may enter an Ascession ID to pull an OCLC record into our MARC editor.
-               </description>
-               <hbox id="z39_50_hbox">
-                       <label id="l1" value="Ascession ID (or TCN): "/>
-                       <textbox id="t1" />
-                       <button id="b1" label="Retrieve" oncommand="
-                               mw.spawn_oclc_import(parent.document,'replace_tab','main_tabbox', { 'tcn' : document.getElementById('t1').value });
-                       "/>
-               </hbox>
-       </vbox>
-
-</overlay>
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/OpenILS.properties
deleted file mode 100644 (file)
index 3780b29..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-bills_interface_label=BILLS
-checkout_interface_label=CHECK OUT
-checkin_interface_label=CHECK IN
-hold_capture_interface_label=HOLD CAPTURE
-copies_editor_interface_label=COPIES EDIT
-copy_browser_interface_label=COPIES
-display_patron_interface_label=DISPLAY PATRON
-items_out_interface_label=ITEMS OUT
-marc_editor_interface_label=MARC
-opac_navigator_interface_label=CATALOG NAVIGATOR
-patron_barcode_entry_interface_label=PATRON
-patron_display_interface_label=PATRON
-patron_editor_interface_label=PATRON EDIT
-patron_search_interface_label=PATRON SEARCH
-patron_register_interface_label=NEW PATRON
-patron_interface_label=PATRON 
-receipt_template_editor_interface_label=RECEIPTS
-survey_admin_interface_label=SURVEY ADMIN
-copy_stat_cat_editor_interface_label=COPY STAT-CATS
-patron_stat_cat_editor_interface_label=PATRON STAT-CATS
-z39_50_import_interface_label=Z39.50 IMPORT
-javascript_console_label=CONSOLE
-javascript_shell_label=JS SHELL
-xuleditor_label=XUL TEST
-filter_console_label=FCONSOLE
-fieldmapper_label=FIELDMAPPER
-
-retrieving.record=Retrieving...
-circ.context_cancel_hold=Cancel Hold
-circ.context_checkin=Check In
-circ.context_renew=Renew
-circ.context_opac=Show Title in OPAC
-circ.context_edit=Edit Copy
-circ.context_lost=Mark as Lost
-circ.context_missing=Mark as Missing
-patron.context_display=Retrieve Patron
-
-checkin_label_status=Status
-checkin_label_route_to=Route To
-checkin_label_text=Message
-
-au_label_active=Active
-au_label_id=Record ID
-au_label_prefix=Prefix
-au_label_family_name=Family Name
-au_label_first_given_name=First Name
-au_label_second_given_name=Middle Name
-au_label_suffix=Suffix
-
-acp_label_id=Copy ID
-acp_label_barcode=Barcode
-acp_label_call_number=Call Number
-acp_label_copy_number=Copy Number
-acp_label_status=Status
-acp_label_location=Location
-acp_label_loan_duration=Loan Duration
-acp_label_circ_lib=Circ Lib
-acp_label_fine_level=Fine Level
-acp_label_deposit=Deposit
-acp_label_deposit_amount=Deposit Amount
-acp_label_price=Price
-acp_label_circ_as_type=Circ As Type
-acp_label_circ_modifier=Circ Modifier
-circ_label_xact_start=Checkout Date
-circ_label_xact_finish=Checkin Date
-circ_label_renewal_remaining=Remaining Renewals
-circ_label_due_date=Due Date
-circ_label_id=Circ Id
-mvr_label_doc_id=Doc Id
-mvr_label_title=Title
-mvr_label_author=Author
-
-holds_status_waiting_for_copy=Waiting for available copy
-holds_status_waiting_for_capture=Copy found, waiting for capture
-holds_status_in_transit=In Transit
-holds_status_available=Available
-
-ahr_status_label=Status
-ahr_capture_time_label=Capture Time
-ahr_current_copy_label=Current Copy
-ahr_email_notify_label=Email Notify
-ahr_expire_time_label=Expire Time
-ahr_fulfillment_time_label=Fulfillment Time
-ahr_hold_type_label=Type
-ahr_holdable_formats_label=Holdable Formats
-ahr_id_label=Hold Id
-ahr_ischanged_label=Ischanged
-ahr_isdeleted_label=Isdeleted
-ahr_isnew_label=Isnew
-ahr_phone_notify_label=Phone Notify
-ahr_pickup_lib_label=Pickup Lib
-ahr_prev_check_time_label=Prev Check Time
-ahr_request_time_label=Request Time
-ahr_requestor_label=Requestor
-ahr_selection_depth_label=Selection Depth
-ahr_target_label=Target
-ahr_usr_label=Usr
-
-bills_wizard_label=Bill Patron
-bills_total_owed_label=Total Owed
-bills_current_payment_label=Current Payment
-
-bills_xact_dates_label=Record / Dates
-bills_money_label=Money
-
-mbts_balance_owed_label=Balance Owed
-mbts_id_label=Bill # 
-mbts_total_owed_label=Total Billed
-mbts_total_paid_label=Total Paid
-mbts_xact_finish_label=Finish
-mbts_xact_start_label=Start
-bills_information=Information
-
-au_active_label=Active
-au_addresses_label=Addresses
-au_alert_message_label=Alert Message
-au_billing_address_label=Billing Address
-au_card_label=Card
-au_cards_label=Cards
-au_checkouts_label=Checkouts
-au_claims_returned_count_label=Claims Returned Count
-au_create_date_label=Create Date
-au_credit_forward_balance_label=Credit Forward Balance
-au_day_phone_label=Day Phone
-au_dob_label=Dob
-au_email_label=Email
-au_evening_phone_label=Evening Phone
-au_expire_date_label=Expire Date
-au_family_name_label=Family Name
-au_first_given_name_label=First Given Name
-au_hold_requests_label=Hold Requests
-au_home_ou_label=Home Ou
-au_id_label=User Id
-au_ident_type_label=Ident Type
-au_ident_type2_label=Ident Type2
-au_ident_value_label=Ident Value
-au_ident_value2_label=Ident Value2
-au_ischanged_label=Ischanged
-au_isdeleted_label=Isdeleted
-au_isnew_label=Isnew
-au_last_xact_id_label=Last Xact Id
-au_mailing_address_label=Mailing Address
-au_master_account_label=Master Account
-au_net_access_level_label=Net Access Level
-au_other_phone_label=Other Phone
-au_passwd_label=Passwd
-au_password_label=Password
-au_photo_url_label=Photo Url
-au_prefix_label=Prefix
-au_profile_label=Profile
-au_second_given_name_label=Second Given Name
-au_settings_label=Settings
-au_standing_label=Standing
-au_stat_cat_entries_label=Stat Cat Entries
-au_suffix_label=Suffix
-au_super_user_label=Super User
-au_survey_responses_label=Survey Responses
-au_usrgroup_label=Usrgroup
-au_usrname_label=Usrname
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.dtd
deleted file mode 100644 (file)
index 0bf1fa1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<!ENTITY main.menu.title "Evergreen Staff Client">
-
-<!-- The Main Menubar -->
-<!ENTITY main.menu.file.label "File"><!ENTITY main.menu.file.key "F">
-<!ENTITY main.menu.edit.label "Edit"><!ENTITY main.menu.edit.key "E">
-<!ENTITY main.menu.circ.label "Circulation"><!ENTITY main.menu.circ.key "C">
-<!ENTITY main.menu.cat.label "Cataloging"><!ENTITY main.menu.cat.key "a">
-<!ENTITY main.menu.serials.label "Serials"><!ENTITY main.menu.serials.key "l">
-<!ENTITY main.menu.acquisitions.label "Acquisitions"><!ENTITY main.menu.acquisitions.key "q">
-<!ENTITY main.menu.search.label "Search"><!ENTITY main.menu.search.key "r">
-<!ENTITY main.menu.reports.label "Reports"><!ENTITY main.menu.reports.key "">
-<!ENTITY main.menu.help.label "Help"><!ENTITY main.menu.help.key "H">
-<!ENTITY main.menu.admin.label "Admin"><!ENTITY main.menu.admin.key "i">
-
-<!-- The File menu on the Main Menubar -->
-<!ENTITY main.menu.file.new.label "New Window"><!ENTITY main.menu.file.new.key "N">
-<!ENTITY main.menu.file.new_tab.label "New Tab"><!ENTITY main.menu.file.new_tab.key "T">
-<!ENTITY main.menu.file.open.label "Open Session"><!ENTITY main.menu.file.open.key "O">
-<!ENTITY main.menu.file.save.label "Save Session"><!ENTITY main.menu.file.save.key "S">
-<!ENTITY main.menu.file.close_tab.label "Close Tab"><!ENTITY main.menu.file.close_tab.key "">
-<!ENTITY main.menu.file.close.label "Close Window"><!ENTITY main.menu.file.close.key "C">
-
-<!-- The Edit menu on the Main Menubar -->
-<!ENTITY main.menu.edit.undo.label "Undo"><!ENTITY main.menu.edit.undo.key "U">
-<!ENTITY main.menu.edit.redo.label "Redo"><!ENTITY main.menu.edit.redo.key "R">
-<!ENTITY main.menu.edit.cut.label "Cut"><!ENTITY main.menu.edit.cut.key "t">
-<!ENTITY main.menu.edit.copy.label "Copy"><!ENTITY main.menu.edit.copy.key "C">
-<!ENTITY main.menu.edit.paste.label "Paste"><!ENTITY main.menu.edit.paste.key "P">
-<!ENTITY main.menu.edit.delete.label "Delete"><!ENTITY main.menu.edit.delete.key "D">
-<!ENTITY main.menu.edit.select_all.label "Select All"><!ENTITY main.menu.edit.select_all.key "A">
-<!ENTITY main.menu.edit.find.label "Find"><!ENTITY main.menu.edit.find.key "F">
-<!ENTITY main.menu.edit.find_again.label "Find Again"><!ENTITY main.menu.edit.find_again.key "g">
-<!ENTITY main.menu.edit.buckets.label "Manage Buckets"><!ENTITY main.menu.edit.buckets.key "B">
-
-<!-- The Circulation menu on the Main Menubar -->
-<!ENTITY main.menu.circ.checkout.label "Check Out"><!ENTITY main.menu.circ.checkout.key "O">
-<!ENTITY main.menu.circ.checkin.label "Check In"><!ENTITY main.menu.circ.checkin.key "C">
-<!ENTITY main.menu.circ.hold_capture.label "Capture Holds"><!ENTITY main.menu.circ.hold_capture.key "H">
-<!ENTITY main.menu.circ.renew.label "Renew"><!ENTITY main.menu.circ.renew.key "n">
-<!ENTITY main.menu.circ.mark_used.label "Mark Used"><!ENTITY main.menu.circ.mark_used.key "U">
-<!ENTITY main.menu.circ.copy_status.label "Display Item"><!ENTITY main.menu.circ.copy_status.key "I">
-<!ENTITY main.menu.circ.patron_status.label "Display Patron"><!ENTITY main.menu.circ.patron_status.key "P">
-<!ENTITY main.menu.circ.patron_registration.label "Register Patron"><!ENTITY main.menu.circ.patron_registration.key "R">
-<!ENTITY main.menu.circ.place_hold.label "Place Hold"><!ENTITY main.menu.circ.place_hold.key "H">
-
-<!-- The Special Circulation submenu in the Circulation Menu -->
-<!ENTITY main.menu.circ.special.label "Special Circulation"><!ENTITY main.menu.circ.special.key "S">
-<!ENTITY main.menu.circ.lost.label "Mark Lost"><!ENTITY main.menu.circ.lost.key "L">
-<!ENTITY main.menu.circ.missing.label "Mark Missing"><!ENTITY main.menu.circ.missing.key "M">
-<!ENTITY main.menu.circ.found.label "Mark Found"><!ENTITY main.menu.circ.found.key "F">
-<!ENTITY main.menu.circ.quick_add.label "Quick Add"><!ENTITY main.menu.circ.quick_add.key "Q">
-<!ENTITY main.menu.circ.claimed_returned.label 'Mark as "Claimed Returned"'><!ENTITY main.menu.circ.claimed_returned.key "C">
-
-<!-- The Cataloging menu on the Main Menubar -->
-<!ENTITY main.menu.cat.add_copy.label "Add Item"><!ENTITY main.menu.cat.add_copy.key "I">
-<!ENTITY main.menu.cat.add_volume.label "Add Volume"><!ENTITY main.menu.cat.add_volume.key "V">
-<!ENTITY main.menu.cat.add_bib.label "Add Bib Record"><!ENTITY main.menu.cat.add_bib.key "B">
-<!ENTITY main.menu.cat.copy_status.label "Display Item"><!ENTITY main.menu.cat.copy_status.key "I">
-<!ENTITY main.menu.cat.volume_status.label "Display Volume"><!ENTITY main.menu.cat.volume_status.key "V">
-<!ENTITY main.menu.cat.bib_status.label "Display Bib Record"><!ENTITY main.menu.cat.bib_status.key "B">
-<!ENTITY main.menu.cat.bib_search.label "Search Catalog"><!ENTITY main.menu.cat.bib_search.key "S">
-<!ENTITY main.menu.cat.dedup.label "Merge/Transfer Interface"><!ENTITY main.menu.cat.dedup.key "M">
-
-<!-- The Entity Menubar -->
-<!ENTITY main.menu.entity.patron.label "Patrons"><!ENTITY main.menu.entity.patron.key "">
-<!ENTITY main.menu.entity.copy.label "Items"><!ENTITY main.menu.entity.copy.key "">
-<!ENTITY main.menu.entity.volume.label "Volumes"><!ENTITY main.menu.entity.volume.key "">
-<!ENTITY main.menu.entity.bib.label "Bib Records"><!ENTITY main.menu.entity.bib.key "">
-
-<!-- The Patron menu on the Entity Menubar -->
-<!-- Re-use main.menu.copy.patron_registration for menuitem label -->
-<!ENTITY main.menu.entity.patron.register.key "R">
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/app_shell.properties
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.dtd
deleted file mode 100644 (file)
index 1797a5a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!ENTITY auth.title "Evergreen Staff Client ">
-<!ENTITY auth.version "Evergreen 0.1.0 2005072719">
-
-<!ENTITY auth.login_header "Login">
-<!ENTITY auth.name_prompt "Name:"><!ENTITY auth.name_prompt.key "N">
-<!ENTITY auth.password_prompt "Password:"><!ENTITY auth.password_prompt.key "P">
-<!ENTITY auth.submit_prompt "Submit"><!ENTITY auth.submit_prompt.key "S">
-<!ENTITY auth.logoff_prompt "Log Off"><!ENTITY auth.logoff_prompt.key "L">
-<!ENTITY auth.quit_prompt "Exit Evergreen"><!ENTITY auth.quit_prompt.key "x">
-
-<!ENTITY about.title "About">
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/auth.properties
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd
deleted file mode 100644 (file)
index 8247e71..0000000
+++ /dev/null
@@ -1,512 +0,0 @@
-<!ENTITY cat.title "TCN goes here">
-<!ENTITY copy.title "Barcode goes here">
-<!ENTITY record_list.win_title "Cataloging">
-<!ENTITY browse_list.win_title "Cataloging">
-
-<!ENTITY cat.popup.edit_record.window "Edit Record (Window)"> <!ENTITY cat.popup.edit.record.window.key "">
-<!ENTITY cat.popup.edit_record.tab "Edit Record (Tab)"> <!ENTITY cat.popup.edit.record.tab.key "">
-<!ENTITY cat.popup.browse_record.window "View Copies (Window)"> <!ENTITY cat.popup.browse.record.window.key "">
-<!ENTITY cat.popup.browse_record.tab "View Copies (Tab)"> <!ENTITY cat.popup.browse.record.tab.key "">
-<!ENTITY cat.popup.add_to_bucket "Add to Bucket"> <!ENTITY cat.popup.add_to_bucket.key "">
-
-
-
-<!ENTITY cat.test "Test"> <!ENTITY cat.test.key "E">
-<!ENTITY cat.search_submit "Search"> <!ENTITY cat.search_submit.key "S">
-<!ENTITY cat.search_advanced "Advanced"> <!ENTITY cat.search_advanced.key "V">
-<!ENTITY cat.search_type "Type"> <!ENTITY cat.search_type.key "T">
-<!ENTITY cat.search_location "Location"> <!ENTITY cat.search_location.key "L">
-<!ENTITY cat.search_format "Format"> <!ENTITY cat.search_format.key "F">
-<!ENTITY cat.search_order "Order"> <!ENTITY cat.search_order.key "O">
-<!ENTITY cat.search_term "Terms"> <!ENTITY cat.search_term.key "e">
-<!ENTITY cat.search_criteria "Search Criteria">
-<!ENTITY cat.search_count_copy "Location"> <!ENTITY cat.search_count_copy.key "L">
-<!ENTITY cat.search_count_copy_show "Show Only These Records">
-
-<!ENTITY cat.search_tcn "TCN">
-<!ENTITY cat.search_isbn "ISBN/ISSN">
-<!ENTITY cat.search_barcode "Item Barcode">
-<!ENTITY cat.search_title "Title">
-<!ENTITY cat.search_author "Author">
-<!ENTITY cat.search_subject "Subject">
-<!ENTITY cat.search_callnumber "Call Number">
-<!ENTITY cat.search_id "System ID">
-<!ENTITY cat.search_all "Keyword">
-
-<!ENTITY cat.search_pubyear "Pub Year">
-
-<!ENTITY cat.type_of_material "All">
-<!ENTITY cat.type_of_material.a "Language Material">
-<!ENTITY cat.type_of_material.c "Notated Music">
-<!ENTITY cat.type_of_material.d "Manuscript Notated Music">
-<!ENTITY cat.type_of_material.e "Cartographic Material">
-<!ENTITY cat.type_of_material.f "Manuscript Cartographic Material">
-<!ENTITY cat.type_of_material.g "Projected Medium">
-<!ENTITY cat.type_of_material.i "Nonmusical Sound Recording">
-<!ENTITY cat.type_of_material.j "Musical Sound Recording">
-<!ENTITY cat.type_of_material.k "Two-dimensional Nonprojectable Graphic">
-<!ENTITY cat.type_of_material.m "Computer File">
-<!ENTITY cat.type_of_material.o "Kit">
-<!ENTITY cat.type_of_material.p "Mixed Material">
-<!ENTITY cat.type_of_material.r "Three-dimensional Artifact or Naturally Occuring Object">
-<!ENTITY cat.type_of_material.t "Manuscript Language Material">
-
-<!ENTITY cat.fixed.BKS "BKS"> <!ENTITY cat.fixed.BKS.key "B">
-<!ENTITY cat.fixed.SER "SER"> <!ENTITY cat.fixed.SER.key "S">
-<!ENTITY cat.fixed.VIS "VIS"> <!ENTITY cat.fixed.VIS.key "V">
-<!ENTITY cat.fixed.MIX "MIX"> <!ENTITY cat.fixed.MIX.key "M">
-<!ENTITY cat.fixed.MAP "MAP"> <!ENTITY cat.fixed.MAP.key "P">
-<!ENTITY cat.fixed.SCO "SCO"> <!ENTITY cat.fixed.SCO.key "C">
-<!ENTITY cat.fixed.REC "REC"> <!ENTITY cat.fixed.REC.key "R">
-<!ENTITY cat.fixed.COM "COM"> <!ENTITY cat.fixed.COM.key "O">
-
-<!ENTITY record_list.tcn "TCN">
-<!ENTITY record_list.isbn "ISBN">
-<!ENTITY record_list.issn "ISSN">
-<!ENTITY record_list.title "Title">
-<!ENTITY record_list.author "Author">
-<!ENTITY record_list.publisher "Publisher">
-<!ENTITY record_list.pubyear "Pub Year">
-<!ENTITY record_list.copy_count "Copies&#740;">
-
-<!ENTITY browse_list.location "Location/Barcode">
-<!ENTITY browse_list.library "Owning Lib">
-<!ENTITY browse_list.callnumber "Call Number">
-<!ENTITY browse_list.barcode "Barcode">
-<!ENTITY browse_list.shelving_loc "Shelving Location">
-<!ENTITY browse_list.status "Status">
-
-<!ENTITY browse_list.circ_as_type "Circulate As">
-<!ENTITY browse_list.circ_lib "Circulating Lib">
-<!ENTITY browse_list.circ_modifier "Circ Modifier">
-<!ENTITY browse_list.circulate "Circulate">
-<!ENTITY browse_list.copy_number "Copy Number">
-<!ENTITY browse_list.create_date "Creation Date">
-<!ENTITY browse_list.creator "Creator">
-<!ENTITY browse_list.deposit "Deposit">
-<!ENTITY browse_list.deposit_amount "Deposit Amount">
-<!ENTITY browse_list.edit_date "Edit Date">
-<!ENTITY browse_list.editor "Editor">
-<!ENTITY browse_list.fine_level "Fine Level">
-<!ENTITY browse_list.loan_duration "Loan Duration">
-<!ENTITY browse_list.location2 "Location">
-<!ENTITY browse_list.opac_visible "OPAC">
-<!ENTITY browse_list.price "Price">
-<!ENTITY browse_list.ref "Reference">
-
-
-<!ENTITY marc.close.editor.key "W">
-
-
-<!ENTITY marc.groupbox.cover "Cover Art">
-<!ENTITY marc.groupbox.meta "Meta Data (NOT YET IMPLEMENTED)">
-<!ENTITY marc.groupbox.fixed "Fixed Fields">
-<!ENTITY marc.groupbox.data "Data Fields">
-<!ENTITY marc.groupbox.control "Control Fields">
-
-<!ENTITY marc.file "MARC"> <!ENTITY marc.file.key "M">
-<!ENTITY marc.file.reload "Reload"> <!ENTITY marc.file.reload.key "R">
-<!ENTITY marc.file.validate "Validate"> <!ENTITY marc.file.validate.key "V">
-<!ENTITY marc.file.export "Export"> <!ENTITY marc.file.export.key "E">
-<!ENTITY marc.file.publish "Save (to DB)"> <!ENTITY marc.file.publish.key "S">
-<!ENTITY marc.file.close "Close Editor"> <!ENTITY marc.file.close.key "C">
-
-<!ENTITY marc.display "Display"> <!ENTITY marc.display.key "D">
-<!ENTITY marc.display.explain "Explain Errors"> <!ENTITY marc.display.explain.key "X">
-<!ENTITY marc.display.legend "Legend"> <!ENTITY marc.display.legend.key "L">
-<!ENTITY marc.display.cover_art "Toggle Cover Art"> <!ENTITY marc.display.cover_art.key "A">
-<!ENTITY marc.display.meta_data "Toggle Meta Data"> <!ENTITY marc.display.meta_data.key "E">
-<!ENTITY marc.display.control_fields "Toggle Control/Data Fields"> <!ENTITY marc.display.control_fields.key "F">
-<!ENTITY marc.display.fixed.BKS "Fixed Fields as BKS"> <!ENTITY marc.display.fixed.BKS.key "B">
-<!ENTITY marc.display.fixed.SER "Fixed Fields as SER"> <!ENTITY marc.display.fixed.SER.key "S">
-<!ENTITY marc.display.fixed.VIS "Fixed Fields as VIS"> <!ENTITY marc.display.fixed.VIS.key "V">
-<!ENTITY marc.display.fixed.MIX "Fixed Fields as MIX"> <!ENTITY marc.display.fixed.MIX.key "M">
-<!ENTITY marc.display.fixed.MAP "Fixed Fields as MAP"> <!ENTITY marc.display.fixed.MAP.key "P">
-<!ENTITY marc.display.fixed.SCO "Fixed Fields as SCO"> <!ENTITY marc.display.fixed.SCO.key "C">
-<!ENTITY marc.display.fixed.REC "Fixed Fields as REC"> <!ENTITY marc.display.fixed.REC.key "R">
-<!ENTITY marc.display.fixed.COM "Fixed Fields as COM"> <!ENTITY marc.display.fixed.COM.key "O">
-
-<!ENTITY marc.editor.keys.help "Control+D = Delimiter Symbol ; Control+Enter = Insert Row ; Control+Delete = Delete Row;">
-
-
-<!ENTITY marc.008.entered.short "Entered"> 
-<!ENTITY marc.008.entered.desc "Date Entered">
-<!ENTITY marc.008.entered.field "008">
-<!ENTITY marc.008.entered.field_start_pos "0">
-<!ENTITY marc.008.entered.field_end_pos "5">
-<!ENTITY marc.008.entered.field_size "6">
-<!ENTITY marc.008.entered.help "http://www.oclc.org/bibformats/en/fixedfield/entered.shtm">
-
-<!ENTITY marc.008.dtst.short "DtSt"> 
-<!ENTITY marc.008.dtst.desc "Type of Date/Publication Status">
-<!ENTITY marc.008.dtst.field "008">
-<!ENTITY marc.008.dtst.field_start_pos "6">
-<!ENTITY marc.008.dtst.field_end_pos "6">
-<!ENTITY marc.008.dtst.field_size "1">
-<!ENTITY marc.008.dtst.help "http://www.oclc.org/bibformats/en/fixedfield/dtst.shtm">
-
-<!ENTITY marc.008.dates "Dates">
-<!ENTITY marc.008.dates.help "http://www.oclc.org/bibformats/en/fixedfield/dates.shtm">
-
-<!ENTITY marc.008.date1.short "Date 1"> 
-<!ENTITY marc.008.date1.desc "Date 1">
-<!ENTITY marc.008.date1.field "008">
-<!ENTITY marc.008.date1.field_start_pos "7">
-<!ENTITY marc.008.date1.field_end_pos "10">
-<!ENTITY marc.008.date1.field_size "4">
-
-<!ENTITY marc.008.date2.short "Date 2">
-<!ENTITY marc.008.date2.desc "Date 2">
-<!ENTITY marc.008.date2.field "008">
-<!ENTITY marc.008.date2.field_start_pos "11">
-<!ENTITY marc.008.date2.field_end_pos "14">
-<!ENTITY marc.008.date2.field_size "4">
-
-<!ENTITY marc.008.ctry.short "Ctry">
-<!ENTITY marc.008.ctry.desc "Country of Publication, etc.">
-<!ENTITY marc.008.ctry.field "008">
-<!ENTITY marc.008.ctry.field_start_pos "15">
-<!ENTITY marc.008.ctry.field_end_pos "17">
-<!ENTITY marc.008.ctry.field_size "3">
-<!ENTITY marc.008.ctry.help "http://www.oclc.org/bibformats/en/fixedfield/ctry.shtm">
-
-<!ENTITY marc.008.lang.short "Lang"> 
-<!ENTITY marc.008.lang.desc "Language Code">
-<!ENTITY marc.008.lang.field "008">
-<!ENTITY marc.008.lang.field_start_pos "35">
-<!ENTITY marc.008.lang.field_end_pos "37">
-<!ENTITY marc.008.lang.field_size "3">
-<!ENTITY marc.008.lang.help "http://www.oclc.org/bibformats/en/fixedfield/lang.shtm">
-
-<!ENTITY marc.008.mrec.short "MRec"> 
-<!ENTITY marc.008.mrec.desc "Modified Record">
-<!ENTITY marc.008.mrec.field "008">
-<!ENTITY marc.008.mrec.field_start_pos "38">
-<!ENTITY marc.008.mrec.field_end_pos "38">
-<!ENTITY marc.008.mrec.field_size "1">
-<!ENTITY marc.008.mrec.help "http://www.oclc.org/bibformats/en/fixedfield/mrec.shtm">
-
-<!ENTITY marc.008.srce.short "Srce"> 
-<!ENTITY marc.008.srce.desc "Cataloging Source">
-<!ENTITY marc.008.srce.field "008">
-<!ENTITY marc.008.srce.field_start_pos "39">
-<!ENTITY marc.008.srce.field_end_pos "39">
-<!ENTITY marc.008.srce.field_size "1">
-<!ENTITY marc.008.srce.help "http://www.oclc.org/bibformats/en/fixedfield/srce.shtm">
-
-<!ENTITY marc.LDR.rec_stat.short "Rec stat"> 
-<!ENTITY marc.LDR.rec_stat.desc "Record Status">
-<!ENTITY marc.LDR.rec_stat.field "LDR">
-<!ENTITY marc.LDR.rec_stat.field_start_pos "5">
-<!ENTITY marc.LDR.rec_stat.field_end_pos "5">
-<!ENTITY marc.LDR.rec_stat.field_size "1">
-<!ENTITY marc.LDR.rec_stat.help "http://www.oclc.org/bibformats/en/fixedfield/rec.shtm">
-
-<!ENTITY marc.LDR.type.short "Type"> 
-<!ENTITY marc.LDR.type.desc "Type of Record">
-<!ENTITY marc.LDR.type.field "LDR">
-<!ENTITY marc.LDR.type.field_start_pos "6">
-<!ENTITY marc.LDR.type.field_end_pos "6">
-<!ENTITY marc.LDR.type.field_size "1">
-<!ENTITY marc.LDR.type.help "http://www.oclc.org/bibformats/en/fixedfield/type.shtm">
-
-<!ENTITY marc.LDR.blvl.short "BLvl"> 
-<!ENTITY marc.LDR.blvl.desc "Bibliographic Level">
-<!ENTITY marc.LDR.blvl.field "LDR">
-<!ENTITY marc.LDR.blvl.field_start_pos "7">
-<!ENTITY marc.LDR.blvl.field_end_pos "7">
-<!ENTITY marc.LDR.blvl.field_size "1">
-<!ENTITY marc.LDR.blvl.help "http://www.oclc.org/bibformats/en/fixedfield/blvl.shtm">
-
-<!ENTITY marc.LDR.ctrl.short "Ctrl"> 
-<!ENTITY marc.LDR.ctrl.desc "Type of Control">
-<!ENTITY marc.LDR.ctrl.field "LDR">
-<!ENTITY marc.LDR.ctrl.field_start_pos "8">
-<!ENTITY marc.LDR.ctrl.field_end_pos "8">
-<!ENTITY marc.LDR.ctrl.field_size "1">
-<!ENTITY marc.LDR.ctrl.help "http://www.oclc.org/bibformats/en/fixedfield/ctrl.shtm">
-
-<!ENTITY marc.LDR.elvl.short "ELvl"> 
-<!ENTITY marc.LDR.elvl.desc "Encoding Level">
-<!ENTITY marc.LDR.elvl.field "LDR">
-<!ENTITY marc.LDR.elvl.field_start_pos "17">
-<!ENTITY marc.LDR.elvl.field_end_pos "17">
-<!ENTITY marc.LDR.elvl.field_size "1">
-<!ENTITY marc.LDR.elvl.help "http://www.oclc.org/bibformats/en/fixedfield/elvl.shtm">
-
-<!ENTITY marc.LDR.desc.short "Desc"> 
-<!ENTITY marc.LDR.desc.desc "Descriptive Cataloging Form">
-<!ENTITY marc.LDR.desc.field "LDR">
-<!ENTITY marc.LDR.desc.field_start_pos "18">
-<!ENTITY marc.LDR.desc.field_end_pos "18">
-<!ENTITY marc.LDR.desc.field_size "1">
-<!ENTITY marc.LDR.desc.help "http://www.oclc.org/bibformats/en/fixedfield/desc.shtm">
-
-<!ENTITY marc.008.BKS.ills.short "Ills"> 
-<!ENTITY marc.008.BKS.ills.desc "Illustrations">
-<!ENTITY marc.008.BKS.ills.field "008">
-<!ENTITY marc.008.BKS.ills.field_start_pos "18">
-<!ENTITY marc.008.BKS.ills.field_end_pos "21">
-<!ENTITY marc.008.BKS.ills.field_size "4">
-<!ENTITY marc.008.BKS.ills.help "http://www.oclc.org/bibformats/en/fixedfield/ills.shtm">
-
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.short "Audn"> 
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.desc "Target Audience">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field "008">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_start_pos "22">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_end_pos "22">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.field_size "1">
-<!ENTITY marc.008.BKS.VIS.SCO.REC.COM.audn.help "http://www.oclc.org/bibformats/en/fixedfield/audn.shtm">
-
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.short "Form"> 
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.desc "Form of Item">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field "008">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_start_pos "23">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_end_pos "23">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.field_size "1">
-<!ENTITY marc.008.BKS.SER.MIX.SCO.REC.form.help "http://www.oclc.org/bibformats/en/fixedfield/form.shtm">
-
-<!ENTITY marc.008.MAP.VIS.form.short "Form"> 
-<!ENTITY marc.008.MAP.VIS.form.desc "Form of Item">
-<!ENTITY marc.008.MAP.VIS.form.field "008">
-<!ENTITY marc.008.MAP.VIS.form.field_start_pos "29">
-<!ENTITY marc.008.MAP.VIS.form.field_end_pos "29">
-<!ENTITY marc.008.MAP.VIS.form.field_size "1">
-<!ENTITY marc.008.MAP.VIS.form.help "http://www.oclc.org/bibformats/en/fixedfield/form.shtm">
-
-<!ENTITY marc.008.BKS.cont.short "Cont"> 
-<!ENTITY marc.008.BKS.cont.desc "Nature of Contents">
-<!ENTITY marc.008.BKS.cont.field "008">
-<!ENTITY marc.008.BKS.cont.field_start_pos "24">
-<!ENTITY marc.008.BKS.cont.field_end_pos "27">
-<!ENTITY marc.008.BKS.cont.field_size "4">
-<!ENTITY marc.008.BKS.cont.help "http://www.oclc.org/bibformats/en/fixedfield/cont.shtm">
-
-<!ENTITY marc.008.SER.cont.short "Cont"> 
-<!ENTITY marc.008.SER.cont.desc "Nature of Contents">
-<!ENTITY marc.008.SER.cont.field "008">
-<!ENTITY marc.008.SER.cont.field_start_pos "25">
-<!ENTITY marc.008.SER.cont.field_end_pos "27">
-<!ENTITY marc.008.SER.cont.field_size "3">
-<!ENTITY marc.008.SER.cont.help "http://www.oclc.org/bibformats/en/fixedfield/cont.shtm">
-
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.short "GPub"> 
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.desc "Government Publication">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field "008">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_start_pos "28">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_end_pos "28">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.field_size "1">
-<!ENTITY marc.008.BKS.SER.VIS.MAP.COM.gpub.help "http://www.oclc.org/bibformats/en/fixedfield/gpub.shtm">
-
-<!ENTITY marc.008.BKS.SER.conf.short "Conf"> 
-<!ENTITY marc.008.BKS.SER.conf.desc "Conference Publication">
-<!ENTITY marc.008.BKS.SER.conf.field "008">
-<!ENTITY marc.008.BKS.SER.conf.field_start_pos "29">
-<!ENTITY marc.008.BKS.SER.conf.field_end_pos "29">
-<!ENTITY marc.008.BKS.SER.conf.field_size "1">
-<!ENTITY marc.008.BKS.SER.conf.help "http://www.oclc.org/bibformats/en/fixedfield/conf.shtm">
-
-<!ENTITY marc.008.BKS.fest.short "Fest"> 
-<!ENTITY marc.008.BKS.fest.desc "Festschrift">
-<!ENTITY marc.008.BKS.fest.field "008">
-<!ENTITY marc.008.BKS.fest.field_start_pos "30">
-<!ENTITY marc.008.BKS.fest.field_end_pos "30">
-<!ENTITY marc.008.BKS.fest.field_size "1">
-<!ENTITY marc.008.BKS.fest.help "http://www.oclc.org/bibformats/en/fixedfield/fest.shtm">
-
-<!ENTITY marc.008.BKS.MAP.indx.short "Indx"> 
-<!ENTITY marc.008.BKS.MAP.indx.desc "Index">
-<!ENTITY marc.008.BKS.MAP.indx.field "008">
-<!ENTITY marc.008.BKS.MAP.indx.field_start_pos "31">
-<!ENTITY marc.008.BKS.MAP.indx.field_end_pos "31">
-<!ENTITY marc.008.BKS.MAP.indx.field_size "1">
-<!ENTITY marc.008.BKS.MAP.indx.help "http://www.oclc.org/bibformats/en/fixedfield/indx.shtm">
-
-<!ENTITY marc.008.BKS.litf.short "LitF"> 
-<!ENTITY marc.008.BKS.litf.desc "Literary Form">
-<!ENTITY marc.008.BKS.litf.field "008">
-<!ENTITY marc.008.BKS.litf.field_start_pos "33">
-<!ENTITY marc.008.BKS.litf.field_end_pos "33">
-<!ENTITY marc.008.BKS.litf.field_size "1">
-<!ENTITY marc.008.BKS.litf.help "http://www.oclc.org/bibformats/en/fixedfield/litf.shtm">
-
-<!ENTITY marc.008.BKS.biog.short "Biog"> 
-<!ENTITY marc.008.BKS.biog.desc "Biography">
-<!ENTITY marc.008.BKS.biog.field "008">
-<!ENTITY marc.008.BKS.biog.field_start_pos "34">
-<!ENTITY marc.008.BKS.biog.field_end_pos "34">
-<!ENTITY marc.008.BKS.biog.field_size "1">
-<!ENTITY marc.008.BKS.biog.help "http://www.oclc.org/bibformats/en/fixedfield/biog.shtm">
-
-<!ENTITY marc.008.SER.freq.short "Freq"> 
-<!ENTITY marc.008.SER.freq.desc "Frequency">
-<!ENTITY marc.008.SER.freq.field "008">
-<!ENTITY marc.008.SER.freq.field_start_pos "18">
-<!ENTITY marc.008.SER.freq.field_end_pos "18">
-<!ENTITY marc.008.SER.freq.field_size "1">
-<!ENTITY marc.008.SER.freq.help "http://www.oclc.org/bibformats/en/fixedfield/freq.shtm">
-
-<!ENTITY marc.008.SER.regl.short "Regl"> 
-<!ENTITY marc.008.SER.regl.desc "Regularity">
-<!ENTITY marc.008.SER.regl.field "008">
-<!ENTITY marc.008.SER.regl.field_start_pos "19">
-<!ENTITY marc.008.SER.regl.field_end_pos "19">
-<!ENTITY marc.008.SER.regl.field_size "1">
-<!ENTITY marc.008.SER.regl.help "http://www.oclc.org/bibformats/en/fixedfield/regl.shtm">
-
-<!ENTITY marc.008.SER.issn.short "ISSN"> 
-<!ENTITY marc.008.SER.issn.desc "ISSN Center">
-<!ENTITY marc.008.SER.issn.field "008">
-<!ENTITY marc.008.SER.issn.field_start_pos "20">
-<!ENTITY marc.008.SER.issn.field_end_pos "20">
-<!ENTITY marc.008.SER.issn.field_size "1">
-<!ENTITY marc.008.SER.issn.help "http://www.oclc.org/bibformats/en/fixedfield/issn.shtm">
-
-<!ENTITY marc.008.SER.srtp.short "SrTp"> 
-<!ENTITY marc.008.SER.srtp.desc "Type of Continuing Resource">
-<!ENTITY marc.008.SER.srtp.field "008">
-<!ENTITY marc.008.SER.srtp.field_start_pos "21">
-<!ENTITY marc.008.SER.srtp.field_end_pos "21">
-<!ENTITY marc.008.SER.srtp.field_size "1">
-<!ENTITY marc.008.SER.srtp.help "http://www.oclc.org/bibformats/en/fixedfield/srtp.shtm">
-
-<!ENTITY marc.008.SER.orig.short "Orig"> 
-<!ENTITY marc.008.SER.orig.desc "Form of Original Item">
-<!ENTITY marc.008.SER.orig.field "008">
-<!ENTITY marc.008.SER.orig.field_start_pos "22">
-<!ENTITY marc.008.SER.orig.field_end_pos "22">
-<!ENTITY marc.008.SER.orig.field_size "1">
-<!ENTITY marc.008.SER.orig.help "http://www.oclc.org/bibformats/en/fixedfield/orig.shtm">
-
-<!ENTITY marc.008.SER.entw.short "EntW"> 
-<!ENTITY marc.008.SER.entw.desc "Nature of Entire Work">
-<!ENTITY marc.008.SER.entw.field "008">
-<!ENTITY marc.008.SER.entw.field_start_pos "24">
-<!ENTITY marc.008.SER.entw.field_end_pos "24">
-<!ENTITY marc.008.SER.entw.field_size "1">
-<!ENTITY marc.008.SER.entw.help "http://www.oclc.org/bibformats/en/fixedfield/entw.shtm">
-
-<!ENTITY marc.008.SER.alph.short "Alph"> 
-<!ENTITY marc.008.SER.alph.desc "Original Alphabet or Script of Title">
-<!ENTITY marc.008.SER.alph.field "008">
-<!ENTITY marc.008.SER.alph.field_start_pos "33">
-<!ENTITY marc.008.SER.alph.field_end_pos "33">
-<!ENTITY marc.008.SER.alph.field_size "1">
-<!ENTITY marc.008.SER.alph.help "http://www.oclc.org/bibformats/en/fixedfield/alph.shtm">
-
-<!ENTITY marc.008.SER.succ.short "S/L"> 
-<!ENTITY marc.008.SER.succ.desc "Entry Convention">
-<!ENTITY marc.008.SER.succ.field "008">
-<!ENTITY marc.008.SER.succ.field_start_pos "34">
-<!ENTITY marc.008.SER.succ.field_end_pos "34">
-<!ENTITY marc.008.SER.succ.field_size "1">
-<!ENTITY marc.008.SER.succ.help "http://www.oclc.org/bibformats/en/fixedfield/succ.shtm">
-
-<!ENTITY volume.wizard.title "Batch Add Volumes/Copies Wizard">
-<!ENTITY copy.wizard.title "Batch Add Copies Wizard">
-<!ENTITY volume.wizard.page1 "Entering Volumes">
-<!ENTITY volume.wizard.page2 "Entering Copies">
-<!ENTITY volume.wizard.page3 "Entering Barcodes">
-<!ENTITY volume.wizard.page4 "Entering Copy-Level Attribute Defaults">
-
-
-<!ENTITY copy.pines.attr "PINES Attributes"> <!ENTITY copy.pines.attr.value "Value">
-<!ENTITY copy.local.attr "Local Attributes"> <!ENTITY copy.local.attr.value "Value">
-<!ENTITY copy.default.attr "Default Attributes"> <!ENTITY copy.default.attr.value "Value">
-
-<!ENTITY copy.close "Close Window"><!ENTITY copy.close.key "C">
-<!ENTITY copy.bucket "Add to Bucket"><!ENTITY copy.bucket.key "B">
-<!ENTITY copy.reload "Reload Copy"> <!ENTITY copy.reload.key "R">
-<!ENTITY copy.save "Save Copy"> <!ENTITY copy.save.key "S">
-<!ENTITY copy.delete "Delete Copy"> <!ENTITY copy.delete.key "">
-<!ENTITY copy.clone "Clone Copy"> <!ENTITY copy.clone.key "">
-<!ENTITY copy.transfer "Transfer Copy"> <!ENTITY copy.transfer.key "">
-
-<!ENTITY copy.notes "Note">
-<!ENTITY copy.notes.from "From">
-<!ENTITY copy.notes.date "Date">
-<!ENTITY copy.notes.opac "OPAC">
-<!ENTITY copy.notes.add "Add Note"> <!ENTITY copy.notes.add.key "A">
-<!ENTITY copy.notes.delete "Delete Note"> <!ENTITY copy.notes.delete.key "D">
-<!ENTITY copy.edit_entries "Edit Entries">
-<!ENTITY copy.edit_categories "Edit Categories">
-
-<!ENTITY volume.attr.owning_lib "Owning Library">
-<!ENTITY volume.attr.callnumber "Call Number">
-
-<!ENTITY copy.attr.stat.genre "Genre">
-       <!ENTITY copy.attr.stat.genre.example1 "Adventure">
-       <!ENTITY copy.attr.stat.genre.example2 "Fantasy">
-       <!ENTITY copy.attr.stat.genre.example3 "Historical">
-       <!ENTITY copy.attr.stat.genre.example4 "Holiday">
-       <!ENTITY copy.attr.stat.genre.example5 "Horror">
-       <!ENTITY copy.attr.stat.genre.example6 "Humor">
-       <!ENTITY copy.attr.stat.genre.example7 "Mystery">
-       <!ENTITY copy.attr.stat.genre.example8 "Romance">
-       <!ENTITY copy.attr.stat.genre.example9 "Sci-fi">
-       <!ENTITY copy.attr.stat.genre.example10 "Spy">
-       <!ENTITY copy.attr.stat.genre.example11 "Thriller">
-       <!ENTITY copy.attr.stat.genre.example12 "War">
-       <!ENTITY copy.attr.stat.genre.example13 "Western">
-       <!ENTITY copy.attr.stat.genre.example14 "Religious fiction">
-       <!ENTITY copy.attr.stat.genre.example15 "Shortstory">
-       <!ENTITY copy.attr.stat.genre.example16 "Biography">
-       <!ENTITY copy.attr.stat.genre.example17 "Holiday">
-       <!ENTITY copy.attr.stat.genre.example18 "Nonfiction">
-<!ENTITY copy.attr.stat.audience "Audience">
-       <!ENTITY copy.attr.stat.audience.example1 "Adult">
-       <!ENTITY copy.attr.stat.audience.example2 "Juvenile">
-       <!ENTITY copy.attr.stat.audience.example3 "Preschool">
-       <!ENTITY copy.attr.stat.audience.example4 "Primary">
-       <!ENTITY copy.attr.stat.audience.example5 "Pre-adolescent">
-       <!ENTITY copy.attr.stat.audience.example6 "Young adult">
-       <!ENTITY copy.attr.stat.audience.example7 "General">
-<!ENTITY copy.attr.loan_duration "Loan Duration">
-       <!ENTITY copy.attr.loan_duration.long "Long">
-       <!ENTITY copy.attr.loan_duration.normal "Normal">
-       <!ENTITY copy.attr.loan_duration.short "Short">
-<!ENTITY copy.attr.fine_level "Fine Level">
-       <!ENTITY copy.attr.fine_level.high "High">
-       <!ENTITY copy.attr.fine_level.normal "Normal">
-       <!ENTITY copy.attr.fine_level.low "Low">
-<!ENTITY copy.attr.notes "Copy Notes">
-       <!ENTITY copy.attr.notes_viewable "Copy Notes Patron Viewable?">
-               <!ENTITY copy.attr.notes_viewable.example1 "Yes">
-               <!ENTITY copy.attr.notes_viewable.example2 "No">
-<!ENTITY copy.attr.circulate "Circulate?">
-       <!ENTITY copy.attr.circulate.yes "Yes">
-       <!ENTITY copy.attr.circulate.no "No">
-<!ENTITY copy.attr.deposit "Deposit?">
-       <!ENTITY copy.attr.deposit.yes "Yes">
-       <!ENTITY copy.attr.deposit.no "No">
-       <!ENTITY copy.attr.deposit_notes "Deposit Notes">
-       <!ENTITY copy.attr.deposit_amount "Amount">
-<!ENTITY copy.attr.reference_material "Reference Material?">
-       <!ENTITY copy.attr.reference_material.yes "Yes">
-       <!ENTITY copy.attr.reference_material.no "No">
-<!ENTITY copy.attr.opac_visible "OPAC Visible?">
-       <!ENTITY copy.attr.opac_visible.yes "Yes">
-       <!ENTITY copy.attr.opac_visible.no "No">
-<!ENTITY copy.attr.copy_available "Copy Status: Available?">
-<!ENTITY copy.attr.copy_status "Copy Status">
-<!ENTITY copy.attr.circulating_lib "Circulating Library">
-<!ENTITY copy.attr.home_lib "Home Library">
-<!ENTITY copy.attr.shelving_location "Shelving Location">
-       <!ENTITY copy.attr.shelving_location.example1 "Stacks">
-       <!ENTITY copy.attr.shelving_location.example2 "Audio-Visual">
-       <!ENTITY copy.attr.shelving_location.example3 "Children's Room">
-       <!ENTITY copy.attr.shelving_location.example4 "Garden Room">
-       <!ENTITY copy.attr.shelving_location.example5 "Reference">
-       <!ENTITY copy.attr.shelving_location.example6 "Ready Reference">
-       <!ENTITY copy.attr.shelving_location.example7 "Behind Circulation Desk">
-       <!ENTITY copy.attr.shelving_location.example8 "Display">
-       <!ENTITY copy.attr.shelving_location.example9 "Health">
-       <!ENTITY copy.attr.shelving_location.example10 "Paperback">
-<!ENTITY copy.attr.holds_protection "Holds Protection">
-       <!ENTITY copy.attr.holds_protection.example1 "3 months (facility)">
-       <!ENTITY copy.attr.holds_protection.example2 "6 months (region)">
-       <!ENTITY copy.attr.holds_protection.example3 "No hold protection">
-       <!ENTITY copy.attr.holds_protection.example4 "Not holdable">
-<!ENTITY copy.attr.barcode "Barcode">
-<!ENTITY copy.attr.price "Price">
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/checkin.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/checkin.dtd
deleted file mode 100644 (file)
index 22bc21e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!ENTITY circ.checkin.caption 'Check In'>
-<!ENTITY circ.checkin.scan_label 'Enter Barcode:'>
-<!ENTITY circ.checkin.scan_label.accesskey 'a'>
-<!ENTITY circ.checkin.submit_label 'Submit'>
-<!ENTITY circ.checkin.submit_label.accesskey 'S'>
-
-<!ENTITY checkin_patron.retrieve 'Retrieve Patron'>
-<!ENTITY checkin_patron.retrieve.accesskey 'R'>
-<!ENTITY checkin_patron.name.label 'Patron Name'>
-
-<!ENTITY checkin.print_receipt_label 'Print List'>
-<!ENTITY checkin.print_receipt_label.accesskey ''>
-<!ENTITY checkin.reprint_receipt_label 'Re-Print Last List'>
-<!ENTITY checkin.reprint_receipt_label.accesskey 'L'>
-<!ENTITY checkin.auto_print_label 'Auto-Print'>
-<!ENTITY checkin.auto_print_label.accesskey 'A'>
-<!ENTITY checkin.done_label 'Done'>
-<!ENTITY checkin.done_label.accesskey 'D'>
-
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/circ_tree.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/circ_tree.dtd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.dtd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/clam_shell.properties
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/contents.rdf b/Evergreen/staff_client/chrome/locale/en-US/evergreen/contents.rdf
deleted file mode 100644 (file)
index c369189..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-       <!-- modified by Jason for Evergreen -->
-
-       <RDF:Seq about="urn:mozilla:locale:root">
-               <RDF:li resource="urn:mozilla:locale:en-US"/>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:locale:en-US"
-               chrome:displayName="Evergreen"
-               chrome:author="PINES"
-               chrome:name="en-US">
-               <chrome:packages>
-                       <RDF:Seq about="urn:mozilla:locale:en-US:packages">
-                               <RDF:li resource="urn:mozilla:locale:en-US:evergreen"/> 
-                       </RDF:Seq>
-               </chrome:packages>
-       </RDF:Description>
-
-</RDF:RDF>
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/hold_capture.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/hold_capture.dtd
deleted file mode 100644 (file)
index fef5dc4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!ENTITY circ.hold_capture.caption 'Capture Hold'>
-<!ENTITY circ.hold_capture.scan_label 'Enter Barcode:'>
-<!ENTITY circ.hold_capture.scan_label.accesskey 'a'>
-<!ENTITY circ.hold_capture.submit_label 'Submit'>
-<!ENTITY circ.hold_capture.submit_label.accesskey 'S'>
-
-<!ENTITY hold_capture_patron.retrieve 'Retrieve Patron'>
-<!ENTITY hold_capture_patron.retrieve.accesskey 'R'>
-<!ENTITY hold_capture_patron.name.label 'Patron Name'>
-
-<!ENTITY hold_capture.print_receipt_label 'Print List'>
-<!ENTITY hold_capture.print_receipt_label.accesskey ''>
-<!ENTITY hold_capture.reprint_receipt_label 'Re-Print Last List'>
-<!ENTITY hold_capture.reprint_receipt_label.accesskey 'L'>
-<!ENTITY hold_capture.auto_print_label 'Auto-Print'>
-<!ENTITY hold_capture.auto_print_label.accesskey 'A'>
-<!ENTITY hold_capture.done_label 'Done'>
-<!ENTITY hold_capture.done_label.accesskey 'D'>
-
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/paged_tree.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/paged_tree.dtd
deleted file mode 100644 (file)
index d331f69..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<!ENTITY displaying.results 'Displaying results'>
-<!ENTITY displaying.of 'of'>
-<!ENTITY displaying.hits_per_page 'Results per page'>
-<!ENTITY previous.range 'Previous'>
-       <!ENTITY previous.range.key 'P'>
-<!ENTITY next.range 'Next'>
-       <!ENTITY next.range.key 'N'>
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.dtd
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.properties b/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron.properties
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_display.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_display.dtd
deleted file mode 100755 (executable)
index 1eae4b4..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<!ENTITY patron_display.name.label 'Patron Name'>
-<!ENTITY patron_display.status.caption 'Status'>
-<!ENTITY patron_display.contact.caption 'Identity &amp; Contact Info'>
-
-<!ENTITY patron_display.checkout.scan_label 'Enter Barcode:'>
-<!ENTITY patron_display.checkout.scan_label.accesskey 'a'>
-<!ENTITY patron_display.checkout.submit_label 'Submit'>
-<!ENTITY patron_display.checkout.submit_label.accesskey 'S'>
-<!ENTITY patron_display.checkout.print_receipt_label 'Print Receipt'>
-<!ENTITY patron_display.checkout.print_receipt_label.accesskey ''>
-<!ENTITY patron_display.checkout.reprint_receipt_label 'Re-Print Last Receipt'>
-<!ENTITY patron_display.checkout.reprint_receipt_label.accesskey 'L'>
-<!ENTITY patron_display.checkout.auto_print_label 'Auto-Print'>
-<!ENTITY patron_display.checkout.auto_print_label.accesskey 'A'>
-<!ENTITY patron_display.checkout.done_label 'Done'>
-<!ENTITY patron_display.checkout.done_label.accesskey 'D'>
-
-<!ENTITY patron_display.items.print_receipt_label 'Print Receipt'>
-<!ENTITY patron_display.items.print_receipt_label.accesskey 'P'>
-
-<!ENTITY patron_navbar.retrieve 'Retrieve Patron'>
-<!ENTITY patron_navbar.retrieve.accesskey 'R'>
-<!ENTITY patron_navbar.refresh 'Refresh'>
-<!ENTITY patron_navbar.refresh.accesskey 'R'>
-<!ENTITY patron_navbar.checkout 'Check Out'>
-<!ENTITY patron_navbar.checkout.accesskey 'C'>
-<!ENTITY patron_navbar.items 'Items Out'>
-<!ENTITY patron_navbar.items.accesskey 'I'>
-<!ENTITY patron_navbar.holds 'Holds'>
-<!ENTITY patron_navbar.holds.accesskey 'H'>
-<!ENTITY patron_navbar.bills 'Bills'>
-<!ENTITY patron_navbar.bills.accesskey 'B'>
-<!ENTITY patron_navbar.edit 'Edit'>
-<!ENTITY patron_navbar.edit.accesskey 'E'>
-<!ENTITY patron_navbar.info 'Info'>
-<!ENTITY patron_navbar.info.accesskey 'o'>
-
-<!ENTITY patron_display.family_name.label 'Last Name:'>
-<!ENTITY patron_display.first_given_name.label 'First Name:'>
-<!ENTITY patron_display.second_given_name.label 'Middle Name:'>
-
-<!ENTITY patron_display.email.label 'Email:'>
-
-<!ENTITY patron_display.library_card.label 'PINES Card:'>
-<!ENTITY patron_display.ident1.label 'ID 1:'>
-<!ENTITY patron_display.ident2.label 'ID 2:'>
-<!ENTITY patron_display.date_of_birth.label 'DOB:'>
-
-<!ENTITY patron_display.day_phone.label 'Day Phone:'>
-<!ENTITY patron_display.evening_phone.label 'Evening Phone:'>
-<!ENTITY patron_display.other_phone.label 'Other Phone:'>
-
-<!ENTITY patron_display.mailing_address 'Mailing Address'>
-<!ENTITY patron_display.mailing.street1.label 'Mailing Address 1:'>
-<!ENTITY patron_display.mailing.street2.label 'Mailing Address 2:'>
-<!ENTITY patron_display.mailing.city.label 'Mailing City:'>
-<!ENTITY patron_display.mailing.state.label 'Mailing State:'>
-<!ENTITY patron_display.mailing.post_code.label 'Mailing ZIP:'>
-
-<!ENTITY patron_display.physical_address 'Physical Address'>
-<!ENTITY patron_display.physical.street1.label 'Physical Address 1:'>
-<!ENTITY patron_display.physical.street2.label 'Physical Address 2:'>
-<!ENTITY patron_display.physical.city.label 'Physical City:'>
-<!ENTITY patron_display.physical.state.label 'Physical State:'>
-<!ENTITY patron_display.physical.post_code.label 'Physical ZIP:'>
-
-<!ENTITY patron_display.standing.label 'Standing:'>
-<!ENTITY patron_display.profile.label 'Profile:'>
-<!ENTITY patron_display.home_ou.label 'Home Library:'>
-<!ENTITY patron_display.checkouts.label 'Check Outs:'>
-<!ENTITY patron_display.checkouts_overdue.label 'Overdue:'>
-<!ENTITY patron_display.holds.label 'Holds:'>
-<!ENTITY patron_display.holds_available.label 'Available:'>
-<!ENTITY patron_display.bills.label 'Bills:'>
-<!ENTITY patron_display.credit.label 'Credit:'>
-<!ENTITY patron_display.items_claimed_returned.label 'Items Claimed Returned:'>
-
-
-
-
-
-
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search.dtd
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search_form.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/patron_search_form.dtd
deleted file mode 100644 (file)
index bb199b3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!ENTITY patron_search_form.caption 'Search for Patron'>
-
-<!ENTITY patron_search_form.family_name.label 'Last Name:'>
-       <!ENTITY patron_search_form.family_name.accesskey 'L'>
-<!ENTITY patron_search_form.first_given_name.label 'First Name:'>
-       <!ENTITY patron_search_form.first_given_name.accesskey ''>
-<!ENTITY patron_search_form.second_given_name.label 'Middle Name:'>
-       <!ENTITY patron_search_form.second_given_name.accesskey ''>
-<!ENTITY patron_search_form.email.label 'Email:'>
-       <!ENTITY patron_search_form.email.accesskey ''>
-<!ENTITY patron_search_form.phone.label 'Phone:'>
-       <!ENTITY patron_search_form.phone.accesskey 'P'>
-<!ENTITY patron_search_form.ident.label 'ID:'>
-       <!ENTITY patron_search_form.ident.accesskey ''>
-<!ENTITY patron_search_form.street1.label 'Address 1:'>
-       <!ENTITY patron_search_form.street1.accesskey 'd'>
-<!ENTITY patron_search_form.street2.label 'Address 2:'>
-       <!ENTITY patron_search_form.street2.accesskey ''>
-<!ENTITY patron_search_form.city.label 'City:'>
-       <!ENTITY patron_search_form.city.accesskey ''>
-<!ENTITY patron_search_form.state.label 'State:'>
-       <!ENTITY patron_search_form.state.accesskey ''>
-<!ENTITY patron_search_form.post_code.label 'ZIP:'>
-       <!ENTITY patron_search_form.post_code.accesskey ''>
-
-<!ENTITY patron_search_form.search.label 'Search'>
-       <!ENTITY patron_search_form.search.accesskey 'S'>
-
-<!ENTITY patron_search_form.clear.label 'Clear Form'>
-       <!ENTITY patron_search_form.clear.accesskey 'C'>
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/stat_cat.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/stat_cat.dtd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/survey.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/survey.dtd
deleted file mode 100644 (file)
index 4d38767..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<!ENTITY survey.wizard.title "Add a Survey Wizard">
-<!ENTITY survey.wizard.page1 "Initial Settings">
-<!ENTITY survey.wizard.page2 "Add Questions for Survey:">
-
diff --git a/Evergreen/staff_client/chrome/locale/en-US/evergreen/z39_50.dtd b/Evergreen/staff_client/chrome/locale/en-US/evergreen/z39_50.dtd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/app_shell.css b/Evergreen/staff_client/chrome/skin/evergreen/app_shell.css
deleted file mode 100644 (file)
index 6fa0a42..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/auth.css b/Evergreen/staff_client/chrome/skin/evergreen/auth.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/browse_list.css b/Evergreen/staff_client/chrome/skin/evergreen/browse_list.css
deleted file mode 100644 (file)
index 1f23e7d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-/* * { font-size: x-large; } */
-.test_class { }
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/cat.css b/Evergreen/staff_client/chrome/skin/evergreen/cat.css
deleted file mode 100644 (file)
index 1f23e7d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-/* * { font-size: x-large; } */
-.test_class { }
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/checkin.css b/Evergreen/staff_client/chrome/skin/evergreen/checkin.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/circ_tree.css b/Evergreen/staff_client/chrome/skin/evergreen/circ_tree.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/clam_shell.css b/Evergreen/staff_client/chrome/skin/evergreen/clam_shell.css
deleted file mode 100644 (file)
index 6fa0a42..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/contents.rdf b/Evergreen/staff_client/chrome/skin/evergreen/contents.rdf
deleted file mode 100644 (file)
index 40d3201..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-       <!-- modified by Jason for Evergreen -->
-
-       <RDF:Seq about="urn:mozilla:skin:root">
-               <RDF:li resource="urn:mozilla:skin:evergreen/0.0.4"/>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:skin:evergreen/0.0.4"
-               chrome:displayName="Evergreen"
-               chrome:author="PINES"
-               chrome:name="evergreen/1.0">
-
-               <chrome:packages>
-                       <RDF:Seq about="urn:mozilla:skin:evergreen/0.0.4:packages">
-                               <RDF:li resource="urn:mozilla:skin:evergreen/0.0.4:evergreen"/> 
-                       </RDF:Seq>
-               </chrome:packages>
-       </RDF:Description>
-
-</RDF:RDF>
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/evergreen.css b/Evergreen/staff_client/chrome/skin/evergreen/evergreen.css
deleted file mode 100644 (file)
index 5a4646c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-tabpanel { border: 2px groove black; }
-caption { font-weight: bold; }
-
-.my_overflow { overflow: auto; }
-
-.text_left { text-align: left; }
-.text_right { text-align: right; }
-.text_center { text-align: center; }
-.text_justify { text-align: justify; }
-
-.tan { background-color: #D2B48C; }
-.sandy_brown { background-color: #F4A460; }
-.peach_puff { background-color: #FFDAB9; }
-.pale_violet_red { background-color: #D87093; }
-.cadet_blue { background-color: #5F9EA0; }
-.dark_salmon { background-color: #E9967A; }
-.coral { background-color: #FF7F50; }
-
-.deleted_address { background-color: red; }
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/hold_capture.css b/Evergreen/staff_client/chrome/skin/evergreen/hold_capture.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/marc.css b/Evergreen/staff_client/chrome/skin/evergreen/marc.css
deleted file mode 100644 (file)
index 3c420ff..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-/* * { font-size: x-large; } */
-grid { overflow: auto; }
-.field_row { border: solid thin #262; }
-.ctrl_grid { min-height: 1em; overflow: auto; }
-.ctrl_row { } 
-.data_grid { overflow: auto; }
-.data_row { }
-.fixed_grid { }
-.fixed_grid label:hover { text-decoration: underline; }
-.fixed_columns column { border-right: dotted thin #262; }
-.fixed_rows { }
-.fixed_row { }
-.fixed_label { }
-.fixed_textbox { }
-rows { }
-row { }
-columns { }
-column { }
-textbox { }
-.marc_buttons_box description { font-weight: bold; }
-.marc { 
-       -moz-appearance: none;
-       font-family: monospace;
-       border: none;
-       padding: 0px; 
-       margin: 0px; 
-}
-.marc:hover { background-color: #DDDDDD; }
-.invalid { background-color: #FF8888; }
-.invalid:hover { background-color: #FF8888; }
-*|textarea:focus { background-color: #DDFFDD; }
-.marc_wrapper { min-height: 1.2em; vertical-align: middle; }
-.marc_tag_wrapper { }
-.marc_ind_wrapper { }
-.marc_ind1_wrapper { }
-.marc_ind2_wrapper { }
-.marc_data_wrapper { }
-.marc_tag { min-width: 2.4em; vertical-align: middle; }
-.marc_ind { min-width: 1.2em; vertical-align: middle; }
-.marc_ind1 { }
-.marc_ind2 { }
-.marc_data { min-width: 500px; }
-.resizable { }
-.test_class { }
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/images/cooltext001.png b/Evergreen/staff_client/chrome/skin/evergreen/media/images/cooltext001.png
deleted file mode 100644 (file)
index c4af9c0..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/images/cooltext001.png and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/images/main_logo.jpg b/Evergreen/staff_client/chrome/skin/evergreen/media/images/main_logo.jpg
deleted file mode 100644 (file)
index 7b77a0a..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/images/main_logo.jpg and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/clicked.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/clicked.wav
deleted file mode 100644 (file)
index 5aff959..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/clicked.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/cow.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/cow.wav
deleted file mode 100644 (file)
index 7315705..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/cow.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/die.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/die.wav
deleted file mode 100644 (file)
index b8725a8..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/die.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/gong.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/gong.wav
deleted file mode 100644 (file)
index d6fd5ee..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/gong.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/redalert.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/redalert.wav
deleted file mode 100644 (file)
index 462b316..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/redalert.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/turn.wav b/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/turn.wav
deleted file mode 100644 (file)
index eae06d2..0000000
Binary files a/Evergreen/staff_client/chrome/skin/evergreen/media/sounds/turn.wav and /dev/null differ
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/opac.css b/Evergreen/staff_client/chrome/skin/evergreen/opac.css
deleted file mode 100644 (file)
index 6fa0a42..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/paged_tree.css b/Evergreen/staff_client/chrome/skin/evergreen/paged_tree.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron.css b/Evergreen/staff_client/chrome/skin/evergreen/patron.css
deleted file mode 100644 (file)
index b49771a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-.deleted_address { background-color: red; }
-.patronNameLarge { font-size: large; }
-.patronNameMedium { font-size: medium; }
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_display.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_display.css
deleted file mode 100755 (executable)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_display_contact.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_display_contact.css
deleted file mode 100755 (executable)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_display_status.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_display_status.css
deleted file mode 100755 (executable)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_search.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_search.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_search_form.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_search_form.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/patron_search_results.css b/Evergreen/staff_client/chrome/skin/evergreen/patron_search_results.css
deleted file mode 100644 (file)
index 19db78e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/stat_cat.css b/Evergreen/staff_client/chrome/skin/evergreen/stat_cat.css
deleted file mode 100644 (file)
index 3b53a33..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-/* * { font-size: x-large; } */
-.test_class { min-height: 100px; }
-
-label { text-align: right; }
-.barcode_row treerow treecell { border: solid black thin; }
-treecell { background-color: red; color: green; }
-
-.row0 { background-color: #99cccc; }
-.row1 { background-color: #99cc99; }
-
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/survey.css b/Evergreen/staff_client/chrome/skin/evergreen/survey.css
deleted file mode 100644 (file)
index 71909ff..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-/* * { font-size: x-large; } */
-.test_class { }
-
-.wizard_label { text-align: right; }
diff --git a/Evergreen/staff_client/chrome/skin/evergreen/z39_50.css b/Evergreen/staff_client/chrome/skin/evergreen/z39_50.css
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Evergreen/staff_client/defaults/preferences/evergreen.js b/Evergreen/staff_client/defaults/preferences/evergreen.js
deleted file mode 100644 (file)
index 4587a85..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Preferences that get set when the application is loaded
-
-// Modified by Jason for Evergreen
-
-// This one is required for XUL Runner
-pref("toolkit.defaultChromeURI", "chrome://evergreen/content/auth/auth.xul");
-
-// This one just makes things speedier.  We use a lot of XMLHttpRequest
-pref("network.http.max-persistent-connections-per-server",8);
-
-// This stops the unresponsive script warning, but the code is still too slow for some reason.
-// However, it's better than POEM, which I wasted a day on :)
-pref("dom.max_script_run_time",60);
-
-pref("javascript.options.strict",false);
-pref("javascript.options.showInConsole",true);
-
-// This lets remote xul access link to local chrome
-pref("security.checkloaduri", false);
-pref("signed.applets.codebase_principal_support", true);
-
diff --git a/Evergreen/staff_client/install.js b/Evergreen/staff_client/install.js
deleted file mode 100644 (file)
index 2f1acd8..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-// XpiInstaller
-// By Pike (Heavily inspired by code from Henrik Gemal and Stephen Clavering)
-// Modified by Jason for Evergreen
-
-var XpiInstaller = {
-
-       // --- Editable items begin ---
-       extFullName: 'Evergreen Staff Client Demo', // The name displayed to the user (don't include the version)
-       extShortName: 'evergreen', // The leafname of the JAR file (without the .jar part)
-       extVersion: '0.0.4',
-       extAuthor: 'GPLS',
-       extLocaleNames: ['en-US'], //null, // e.g. ['en-US', 'en-GB']
-       extSkinNames: null, // e.g. ['classic', 'modern']  I have this broken
-       extPostInstallMessage: 'Success! Please restart your browser to finish the installation.', // Set to null for no post-install message
-       // --- Editable items end ---
-
-       profileInstall: true,
-       silentInstall: true,
-
-       install: function()
-       {
-               var jarName = this.extShortName + '.jar';
-               var profileDir = Install.getFolder('Profile', 'chrome');
-
-               // Parse HTTP arguments
-               this.parseArguments();
-
-               // Check if extension is already installed in profile
-               if (File.exists(Install.getFolder(profileDir, jarName)))
-               {
-                       if (!this.silentInstall)
-                       {
-                               Install.alert('Updating existing Profile install of ' + this.extFullName + ' to version ' + this.extVersion + '.');
-                       }
-                       this.profileInstall = true;
-               }
-               else if (!this.silentInstall)
-               {
-                       // Ask user for install location, profile or browser dir?
-                       this.profileInstall = Install.confirm('Install ' + this.extFullName + ' ' + this.extVersion + ' to your Profile directory (OK) or your Browser directory (Cancel)?');
-               }
-
-               // Init install
-               var dispName = this.extFullName + ' ' + this.extVersion;
-               var regName = '/' + this.extAuthor + '/' + this.extShortName;
-               Install.initInstall(dispName, regName, this.extVersion);
-
-               // Find directory to install into
-               var installPath;
-               if (this.profileInstall) installPath = profileDir;
-               else installPath = Install.getFolder('chrome');
-
-               // Add JAR file
-               Install.addFile(null, 'chrome/' + jarName, installPath, null);
-
-               // Register chrome
-               var jarPath = Install.getFolder(installPath, jarName);
-               var installType = this.profileInstall ? Install.PROFILE_CHROME : Install.DELAYED_CHROME;
-
-               // Register content
-               Install.registerChrome(Install.CONTENT | installType, jarPath, 'content/' + this.extShortName + '/');
-
-               // Register locales
-               for (var locale in this.extLocaleNames)
-               {
-                       var regPath = 'locale/' + this.extLocaleNames[locale] + '/' + this.extShortName + '/';
-                       Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
-               }
-
-               // Register skins
-               var regPath = 'skin/' + this.extShortName + '/';
-               Install.registerChrome(Install.SKIN | installType, jarPath, regPath);
-
-               // Perform install
-               var err = Install.performInstall();
-               if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED)
-               {
-                       if (!this.silentInstall && this.extPostInstallMessage)
-                       {
-                               Install.alert(this.extPostInstallMessage);
-                       }
-               }
-               else
-               {
-                       this.handleError(err);
-                       return;
-               }
-       },
-
-       parseArguments: function()
-       {
-               // Can't use string handling in install, so use if statement instead
-               var args = Install.arguments;
-               if (args == 'p=0')
-               {
-                       this.profileInstall = false;
-                       this.silentInstall = true;
-               }
-               else if (args == 'p=1')
-               {
-                       this.profileInstall = true;
-                       this.silentInstall = true;
-               }
-       },
-
-       handleError: function(err)
-       {
-               if (!this.silentInstall)
-               {
-                       Install.alert('Error: Could not install ' + this.extFullName + ' ' + this.extVersion + ' (Error code: ' + err + ')');
-               }
-               Install.cancelInstall(err);
-       }
-};
-
-XpiInstaller.install(); 
-/* 
-Install.alert('The install.js file for Evergreen is currently broken for Mozilla browsers.  Any volunteers for fixing this?  The problem I see is with registering the skin component.  The install.rdf for Firefox should work');
-Install.cancelInstall(Install.INSTALL_CANCELLED);
-*/
diff --git a/Evergreen/staff_client/install.rdf b/Evergreen/staff_client/install.rdf
deleted file mode 100755 (executable)
index 1045503..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-       <!-- modified by Jason for Evergreen -->
-
-       <Description about="urn:mozilla:install-manifest">
-               <em:id>{c3dd711b-c9b4-4785-b8f8-6157149c8905}</em:id>
-               <em:version>0.1.0</em:version>
-               <em:type>2</em:type>
-
-               <!-- Target Application this extension can install into, 
-                       with minimum and maximum supported versions. --> 
-               <em:targetApplication>
-                       <Description>
-                               <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-                               <em:minVersion>1.0</em:minVersion>
-                               <em:maxVersion>1.0+</em:maxVersion>
-                       </Description>
-               </em:targetApplication>
-    
-               <!-- Packages, Skins and Locales that this extension registers -->
-               <em:file>
-                       <Description about="urn:mozilla:extension:file:evergreen.jar">
-                               <em:package>content/evergreen/</em:package>
-                               <em:locale>locale/en-US/evergreen/</em:locale>
-                               <em:skin>skin/evergreen/</em:skin>
-                       </Description>
-               </em:file>
-       
-               <!-- Front End MetaData -->
-               <em:name>Evergreen</em:name>
-               <em:description>Evergreen Staff Client </em:description>
-        
-               <em:homepageURL>http://open-ils.org/</em:homepageURL>
-    
-       </Description>      
-</RDF>
index e2cb510..6c3da55 100644 (file)
@@ -220,6 +220,7 @@ function uEditResetPw() {
        var pw = uEditMakeRandomPw(patron);     
        $('ue_password1').value = pw;
        $('ue_password2').value = pw;
+    $('ue_password1').onchange();
 }
 
 function uEditClone(clone) {
index 6f9cb49..00ad089 100644 (file)
@@ -1,6 +1,6 @@
-<IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistance/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1">
+<IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1">
 
-       <!-- Virutal classes -->
+       <!-- Virtual classes -->
        <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true">
                <fields>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Answers" name="answers" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field reporter:label="Responses" name="responses" oils_obj:array_position="4" oils_persist:virtual="true" />
+                       <field reporter:label="Answers" name="answers" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Responses" name="responses" oils_obj:array_position="4" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Question ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Question" name="question" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Survey" name="survey" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label="Survey" name="survey" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Balance Owed" name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" />
-                       <field reporter:label="Transaction ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Balance Owed" name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field reporter:label="Transaction ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id"/>
                        <field reporter:label="Last Billing Note" name="last_billing_note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Last Billing Timestamp" name="last_billing_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Last Billing Type" name="last_billing_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Last Payment Note" name="last_payment_note" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Last Payment Timestamp" name="last_payment_ts" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Last Payment Type" name="last_payment_type" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Total Owed" name="total_owed" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field reporter:label="Total Paid" name="total_paid" oils_obj:array_position="12" oils_persist:virtual="false" />
-                       <field reporter:label="Billed User" name="usr" oils_obj:array_position="13" oils_persist:virtual="false" />
+                       <field reporter:label="Total Owed" name="total_owed" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field reporter:label="Total Paid" name="total_paid" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field reporter:label="Billed User" name="usr" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Transaction Finish Time" name="xact_finish" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field reporter:label="Transaction Start Time" name="xact_start" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field reporter:label="Transaction Type" name="xact_type" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Creation Date/Time" name="create_date" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Creating Staff" name="creator" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Creating Staff" name="creator" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Note ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Is OPAC Visible?" name="pub" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Note Title" name="title" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="User" name="usr" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link" />
                        <field reporter:label="Note Content" name="value" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Setting ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Name" name="name" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="User" name="usr" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Value" name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field reporter:label="Use ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Item" name="item" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Using Library" name="org_unit" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit"/>
-                       <field reporter:label="Recording Staff" name="staff" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Recording Staff" name="staff" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Use Date/Time" name="use_time" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                </fields>
                <links>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Use ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Item Type" name="item_type" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Item Type" name="item_type" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Using Library" name="org_unit" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit"/>
-                       <field reporter:label="Recording Staff" name="staff" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Recording Staff" name="staff" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Use Date/Time" name="use_time" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Pretransit Copy Status" name="copy_status" oils_obj:array_position="3" oils_persist:virtual="false" />
-                       <field reporter:label="Destination" name="dest" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Pretransit Copy Status" name="copy_status" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="bool"/>
+                       <field reporter:label="Destination" name="dest" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Receive Date/Time" name="dest_recv_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transit ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Transit ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id"/>
                        <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Previous Hop (unused)" name="prev_hop" oils_obj:array_position="8" oils_persist:virtual="false" />
-                       <field reporter:label="Source" name="source" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field reporter:label="Previous Hop (unused)" name="prev_hop" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Source" name="source" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Send Date/Time" name="source_send_time" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transited Copy" name="target_copy" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field reporter:label="Hold Transit" name="hold_transit_copy" oils_obj:array_position="12" oils_persist:virtual="true" />
+                       <field reporter:label="Transited Copy" name="target_copy" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Hold Transit" name="hold_transit_copy" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Answer" name="answer" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Answer" name="answer" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Answer Date/Time" name="answer_date" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Effective Answer Date/Time" name="effective_date" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Answer ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Question" name="question" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label="Question" name="question" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Response Group ID" name="response_group_id" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label="Survey" name="survey" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field reporter:label="Responding User" name="usr" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field reporter:label="Survey" name="survey" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Responding User" name="usr" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
                        <field name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
                        <field name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="approval_code" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="cash_drawer" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="cc_number" oils_obj:array_position="8" oils_persist:virtual="false" />
-                       <field name="cc_type" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field name="approval_code" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="cash_drawer" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="cc_number" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="cc_type" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="expire_month" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="int" />
                        <field name="expire_year" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="int" />
                        <field name="id" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="note" oils_obj:array_position="13" oils_persist:virtual="false" />
+                       <field name="note" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="payment_ts" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="xact" oils_obj:array_position="15" oils_persist:virtual="false" />
-                       <field name="payment_type" oils_obj:array_position="16" oils_persist:virtual="true" />
-                       <field name="payment" oils_obj:array_position="17" oils_persist:virtual="true" />
+                       <field name="xact" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="payment_type" oils_obj:array_position="16" oils_persist:virtual="true" reporter:datatype="text"/>
+                       <field name="payment" oils_obj:array_position="17" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="field_class" oils_obj:array_position="3" oils_persist:virtual="false" />
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="name" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="xpath" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="xpath" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="weight" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field name="format" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="format" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="search_field" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool" />
                        <field name="facet_field" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="bool" />
                </fields>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Copies" name="copies" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Copies" name="copies" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Create Date/Time" name="create_date" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Creating User" name="creator" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field reporter:label="Creating User" name="creator" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Is Deleted" name="deleted" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Last Edit Date/Time" name="edit_date" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Last Editing User" name="editor" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Last Editing User" name="editor" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Call Number/Volume ID" name="id" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Call Number Label" name="label" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field reporter:label="Call Number Label" name="label" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="11" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
-                       <field reporter:label="Bib Record" name="record" oils_obj:array_position="12" oils_persist:virtual="false" />
+                       <field reporter:label="Bib Record" name="record" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="editor" reltype="has_a" key="id" map="" class="au"/>
                        <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_owed" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_paid" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links/>
        </class>
                        <field name="collector" oils_obj:array_position="3" oils_persist:virtual="false" />
                        <field name="enter_time" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="location" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="usr" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="location" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="usr" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label= "Call Numbers" name="call_numbers" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field reporter:label= "Fixed Field Entry" name="fixed_fields" oils_obj:array_position="4" oils_persist:virtual="true" />
+                       <field reporter:label= "Call Numbers" name="call_numbers" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Fixed Field Entry" name="fixed_fields" oils_obj:array_position="4" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label= "Is Active?" name="active" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label= "Record Creation Date/Time" name="create_date" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label= "Record Creator" name="creator" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label= "Record Creator" name="creator" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label= "Is Deleted?" name="deleted" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label= "Last Edit Data/Time" name="edit_date" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label= "Last Editing User" name="editor" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field reporter:label= "Last Editing User" name="editor" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label= "Fingerprint" name="fingerprint" oils_obj:array_position="11" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label= "Record ID" name="id" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label= "Last Transaction ID" name="last_xact_id" oils_obj:array_position="13" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label= "MARC21Slim" name="marc" oils_obj:array_position="14" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label= "Overall Quality" name="quality" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label= "Reocrd Source" name="source" oils_obj:array_position="16" oils_persist:virtual="false" />
+                       <field reporter:label= "Reocrd Source" name="source" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label= "TCN Source" name="tcn_source" oils_obj:array_position="17" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label= "TCN Value" name="tcn_value" oils_obj:array_position="18" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label= "Metarecord" name="metarecord" oils_obj:array_position="19" oils_persist:virtual="true" />
-                       <field reporter:label= "Language Code" name="language" oils_obj:array_position="20" oils_persist:virtual="true" />
-                       <field reporter:label= "Non-MARC Record Notes" name="notes" oils_obj:array_position="21" oils_persist:virtual="true" />
-                       <field reporter:label= "Indexed Keyword Field Entries" name="keyword_field_entries" oils_obj:array_position="22" oils_persist:virtual="true" />
-                       <field reporter:label= "Indexed Subject Field Entries" name="subject_field_entries" oils_obj:array_position="23" oils_persist:virtual="true" />
-                       <field reporter:label= "Indexed Title Field Entries" name="title_field_entries" oils_obj:array_position="24" oils_persist:virtual="true" />
-                       <field reporter:label= "Indexed Author Field Entries" name="author_field_entries" oils_obj:array_position="25" oils_persist:virtual="true" />
-                       <field reporter:label= "Indexed Series Field Entries" name="series_field_entries" oils_obj:array_position="26" oils_persist:virtual="true" />
-                       <field reporter:label= "Flattened MARC Fields " name="full_record_entries" oils_obj:array_position="27" oils_persist:virtual="true" />
-                       <field reporter:label= "Simple Record Extracts " name="simple_record" oils_obj:array_position="28" oils_persist:virtual="true" />
+                       <field reporter:label= "Metarecord" name="metarecord" oils_obj:array_position="19" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Language Code" name="language" oils_obj:array_position="20" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Non-MARC Record Notes" name="notes" oils_obj:array_position="21" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Indexed Keyword Field Entries" name="keyword_field_entries" oils_obj:array_position="22" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Indexed Subject Field Entries" name="subject_field_entries" oils_obj:array_position="23" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Indexed Title Field Entries" name="title_field_entries" oils_obj:array_position="24" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Indexed Author Field Entries" name="author_field_entries" oils_obj:array_position="25" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Indexed Series Field Entries" name="series_field_entries" oils_obj:array_position="26" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Flattened MARC Fields " name="full_record_entries" oils_obj:array_position="27" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label= "Simple Record Extracts " name="simple_record" oils_obj:array_position="28" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="editor" reltype="has_a" key="id" map="" class="au"/>
                        <field name="close_start" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="org_unit" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="org_unit"/>
-                       <field name="reason" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="reason" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="extended" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="extended" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="max_renewals" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="normal" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="shrt" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="normal" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="interval"/>
+                       <field name="shrt" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="interval"/>
                </fields>
                <links>
                </links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="last_billing_note" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="last_billing_note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="last_billing_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="last_billing_type" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="last_payment_note" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="last_billing_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="last_payment_note" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="last_payment_ts" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="last_payment_type" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field name="total_owed" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field name="total_paid" oils_obj:array_position="12" oils_persist:virtual="false" />
-                       <field name="usr" oils_obj:array_position="13" oils_persist:virtual="false" />
+                       <field name="last_payment_type" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="total_owed" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field name="total_paid" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field name="usr" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="xact_finish" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field name="xact_start" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="timestamp" />
-                       <field name="xact_type" oils_obj:array_position="16" oils_persist:virtual="false" />
-                       <field name="xact" oils_obj:array_position="17" oils_persist:virtual="true" />
-                       <field name="grocery" oils_obj:array_position="18" oils_persist:virtual="true" />
-                       <field name="circulation" oils_obj:array_position="19" oils_persist:virtual="true" />
+                       <field name="xact_type" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="xact" oils_obj:array_position="17" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="grocery" oils_obj:array_position="18" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="circulation" oils_obj:array_position="19" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="All Addresses" name="addresses" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field reporter:label="All Library Cards" name="cards" oils_obj:array_position="4" oils_persist:virtual="true" />
-                       <field reporter:label="All Circulations" name="checkouts" oils_obj:array_position="5" oils_persist:virtual="true" />
-                       <field reporter:label="All Hold Requests" name="hold_requests" oils_obj:array_position="6" oils_persist:virtual="true" />
-                       <field reporter:label="All Permissions" name="permissions" oils_obj:array_position="7" oils_persist:virtual="true" />
-                       <field reporter:label="All User Settings" name="settings" oils_obj:array_position="8" oils_persist:virtual="true" />
-                       <field reporter:label="Standing Penalties" name="standing_penalties" oils_obj:array_position="9" oils_persist:virtual="true" />
-                       <field reporter:label="Statistical Catagorie Entries" name="stat_cat_entries" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Survey Responses" name="survey_responses" oils_obj:array_position="11" oils_persist:virtual="true" />
-                       <field name="ws_ou" oils_obj:array_position="12" oils_persist:virtual="true" />
-                       <field name="wsid" oils_obj:array_position="13" oils_persist:virtual="true" />
+                       <field reporter:label="All Addresses" name="addresses" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="All Library Cards" name="cards" oils_obj:array_position="4" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="All Circulations" name="checkouts" oils_obj:array_position="5" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="All Hold Requests" name="hold_requests" oils_obj:array_position="6" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="All Permissions" name="permissions" oils_obj:array_position="7" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="All User Settings" name="settings" oils_obj:array_position="8" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Standing Penalties" name="standing_penalties" oils_obj:array_position="9" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Statistical Catagorie Entries" name="stat_cat_entries" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Survey Responses" name="survey_responses" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="ws_ou" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="wsid" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Active" name="active" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Alert Message" name="alert_message" oils_obj:array_position="15" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Barred" name="barred" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Physical Address" name="billing_address" oils_obj:array_position="17" oils_persist:virtual="false" />
-                       <field reporter:label="Current Library Card" name="card" oils_obj:array_position="18" oils_persist:virtual="false" />
+                       <field reporter:label="Physical Address" name="billing_address" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Current Library Card" name="card" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Claims-returned Count" name="claims_returned_count" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Record Creation Date/Time" name="create_date" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="User Credit Balance" name="credit_forward_balance" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Daytime Phone" name="day_phone" oils_obj:array_position="22" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Date of Birth" name="dob"  reporter:datatype="timestamp" oils_obj:array_position="23" oils_persist:virtual="false" />
+                       <field reporter:label="Date of Birth" name="dob" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Email Address" name="email" oils_obj:array_position="24" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Evening Phone" name="evening_phone" oils_obj:array_position="25" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Priviledge Expiration Date" name="expire_date" oils_obj:array_position="26" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="First Name" name="first_given_name" oils_obj:array_position="28" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Home Library" name="home_ou" oils_obj:array_position="29" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="User ID" name="id" oils_obj:array_position="30" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Primary Identifcation Type" name="ident_type" oils_obj:array_position="31" oils_persist:virtual="false" />
-                       <field reporter:label="Secondary Identification Type" name="ident_type2" oils_obj:array_position="32" oils_persist:virtual="false" />
+                       <field reporter:label="Primary Identifcation Type" name="ident_type" oils_obj:array_position="31" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Secondary Identification Type" name="ident_type2" oils_obj:array_position="32" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Primary Identification" name="ident_value" oils_obj:array_position="33" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Secondary Identification" name="ident_value2" oils_obj:array_position="34" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field name="last_xact_id" oils_obj:array_position="35" oils_persist:virtual="false" />
-                       <field reporter:label="Mailing Address" name="mailing_address" oils_obj:array_position="36" oils_persist:virtual="false" />
+                       <field name="last_xact_id" oils_obj:array_position="35" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Mailing Address" name="mailing_address" oils_obj:array_position="36" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Is Group Lead Account" name="master_account" oils_obj:array_position="37" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Internet Access Level" name="net_access_level" oils_obj:array_position="38" oils_persist:virtual="false" />
+                       <field reporter:label="Internet Access Level" name="net_access_level" oils_obj:array_position="38" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Other Phone" name="other_phone" oils_obj:array_position="39" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Password (obfuscated)" name="passwd" oils_obj:array_position="40" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Photo URL" name="photo_url" oils_obj:array_position="41" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Prefix" name="prefix" oils_obj:array_position="42" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Main (Profile) Permission Group" name="profile" oils_obj:array_position="43" oils_persist:virtual="false" />
+                       <field reporter:label="Main (Profile) Permission Group" name="profile" oils_obj:array_position="43" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Middle Name" name="second_given_name" oils_obj:array_position="44" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Standing (unused)" name="standing" oils_obj:array_position="45" oils_persist:virtual="false" />
+                       <field reporter:label="Standing (unused)" name="standing" oils_obj:array_position="45" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Suffix/Title" name="suffix" oils_obj:array_position="46" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Is Super User" name="super_user" oils_obj:array_position="47" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Family Linkage or other Group" name="usrgroup" oils_obj:array_position="48" oils_persist:virtual="false" />
+                       <field reporter:label="Family Linkage or other Group" name="usrgroup" oils_obj:array_position="48" oils_persist:virtual="false" reporter:datatype="int"/>
                        <field reporter:label="OPAC/Staff Client User Name" name="usrname" oils_obj:array_position="49" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Additional Permission Groups" name="groups" oils_obj:array_position="50" oils_persist:virtual="true" />
+                       <field reporter:label="Additional Permission Groups" name="groups" oils_obj:array_position="50" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Is Deleted" name="deleted" oils_obj:array_position="51" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="User Notes" name="notes" oils_obj:array_position="52" oils_persist:virtual="true" />
-                       <field reporter:label="Demographic Info" name="demographic" oils_obj:array_position="53" oils_persist:virtual="true" />
+                       <field reporter:label="User Notes" name="notes" oils_obj:array_position="52" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Demographic Info" name="demographic" oils_obj:array_position="53" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Note Creation Date/Time" name="create_date" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Note Creator" name="creator" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Note Creator" name="creator" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Node ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Copy" name="owning_copy" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Copy" name="owning_copy" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Is OPAC Visible?" name="pub" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Note Title" name="title" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Note Content" name="value" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Field ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Indicator 1" name="ind1" oils_obj:array_position="4" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                        <field reporter:label="Indicator 2" name="ind2" oils_obj:array_position="5" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
-                       <field reporter:label="Bib Record Entry" name="record" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Bib Record Entry" name="record" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Subfield" name="subfield" oils_obj:array_position="7" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                        <field reporter:label="Tag" name="tag" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Normalized Value" name="value" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="fingerprint" oils_obj:array_position="3" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="master_record" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="master_record" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="mods" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field name="source_records" oils_obj:array_position="7" oils_persist:virtual="true" />
+                       <field name="source_records" oils_obj:array_position="7" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="metarecord" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="metarecord" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="source" reltype="has_a" key="id" map="" class="bre"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="value" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="cash_drawer" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="cash_drawer" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="note" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field name="payment_ts" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="xact" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field name="xact" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="payment_type" oils_obj:array_position="11" oils_persist:virtual="true"  reporter:datatype="text"/>
-                       <field name="payment" oils_obj:array_position="12" oils_persist:virtual="true" />
+                       <field name="payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="note" oils_obj:array_position="7" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field name="payment_ts" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="xact" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field name="xact" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="payment_type" oils_obj:array_position="10" oils_persist:virtual="true"  reporter:datatype="text"/>
-                       <field name="payment" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field name="payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
                        <field reporter:label="Type" name="item_type" oils_obj:array_position="12" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                        <field reporter:label="LitF" name="lit_form" oils_obj:array_position="13" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                        <field reporter:label="Pub Status" name="pub_status" oils_obj:array_position="14" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
-                       <field reporter:label="Bib Record Entry" name="record" oils_obj:array_position="15" oils_persist:virtual="false" />
+                       <field reporter:label="Bib Record Entry" name="record" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="TMat" name="type_mat" oils_obj:array_position="16" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                        <field reporter:label="Video Recording Format" name="vr_format" oils_obj:array_position="17" oils_persist:virtual="false" oils_persist:primitive="string"  reporter:datatype="text"/>
                </fields>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="penalty_type" oils_obj:array_position="4" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field name="usr" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field reporter:label="Country" name="country" oils_obj:array_position="5" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="County" name="county" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Address ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Postal Code" name="post_code" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Postal Code" name="post_code" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="State" name="state" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Street (1)" name="street1" oils_obj:array_position="10" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Street (2)" name="street2" oils_obj:array_position="11" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="User" name="usr" oils_obj:array_position="12" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Valid Address?" name="valid" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Within City Limits?" name="within_city_limits" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="call_number" oils_obj:array_position="3" oils_persist:virtual="false" />
                        <field name="create_date" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="creator" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="creator" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="pub" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="title" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="create_date" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="creator" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="creator" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="edit_date" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="editor" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="editor" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="record" oils_obj:array_position="8" oils_persist:virtual="false" />
-                       <field name="value" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field name="record" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="value" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="record" reltype="has_a" key="id" map="" class="are"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Check In Library" name="checkin_lib" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="org_unit"/>
-                       <field reporter:label="Check In Staff" name="checkin_staff" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Check In Staff" name="checkin_staff" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Check In Date/Time" name="checkin_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Circulating Library" name="circ_lib" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
-                       <field reporter:label="Circulating Staff" name="circ_staff" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label="Circulating Staff" name="circ_staff" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Desk Renewal" name="desk_renewal" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Due Date/Time" name="due_date" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Circulation Duration" name="duration" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field reporter:label="Circ Duration Rule" name="duration_rule" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field reporter:label="Fine Interval" name="fine_interval" oils_obj:array_position="12" oils_persist:virtual="false" />
+                       <field reporter:label="Circulation Duration" name="duration" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="interval"/>
+                       <field reporter:label="Circ Duration Rule" name="duration_rule" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Fine Interval" name="fine_interval" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field reporter:label="Circ ID" name="id" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Max Fine Amount" name="max_fine" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field reporter:label="Max Fine Rule" name="max_fine_rule" oils_obj:array_position="15" oils_persist:virtual="false" />
+                       <field reporter:label="Max Fine Rule" name="max_fine_rule" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="OPAC Renewal" name="opac_renewal" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Phone Renewal" name="phone_renewal" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Recurring Fine Amount" name="recuring_fine" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" />
+                       <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Remaining Renewals" name="renewal_remaining" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label="Fine Stop Reason" name="stop_fines" oils_obj:array_position="21" oils_persist:virtual="false" />
+                       <field reporter:label="Fine Stop Reason" name="stop_fines" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Circulating Item" name="target_copy" oils_obj:array_position="23" oils_persist:virtual="false" />
-                       <field reporter:label="Patron" name="usr" oils_obj:array_position="24" oils_persist:virtual="false" />
+                       <field reporter:label="Circulating Item" name="target_copy" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Patron" name="usr" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Transaction Finish Date/Time" name="xact_finish" oils_obj:array_position="25" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field reporter:label="Check Out Date/Time" name="xact_start" oils_obj:array_position="26" oils_persist:virtual="false" reporter:datatype="timestamp" />
-                       <field reporter:label="Transaction Billings" name="billings" oils_obj:array_position="27" oils_persist:virtual="true" />
-                       <field reporter:label="Transaction Payments" name="payments" oils_obj:array_position="28" oils_persist:virtual="true" />
-                       <field reporter:label="Base Transaction" name="billable_transaction" oils_obj:array_position="29" oils_persist:virtual="true" />
-                       <field reporter:label="Circulation Type" name="circ_type" oils_obj:array_position="30" oils_persist:virtual="true" />
-                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="31" oils_persist:virtual="true" />
-                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="32" oils_persist:virtual="true" />
+                       <field reporter:label="Transaction Billings" name="billings" oils_obj:array_position="27" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Transaction Payments" name="payments" oils_obj:array_position="28" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Base Transaction" name="billable_transaction" oils_obj:array_position="29" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Circulation Type" name="circ_type" oils_obj:array_position="30" oils_persist:virtual="true" reporter:datatype="text"/>
+                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="31" oils_persist:virtual="true" reporter:datatype="money"/>
+                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="32" oils_persist:virtual="true" reporter:datatype="money"/>
                </fields>
                <links>
                        <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="target_call_number" oils_obj:array_position="5" oils_persist:virtual="false" />
                </fields>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="pub" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="hold" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="hold" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="target_copy" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="target_copy" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Hold" name="hold" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Hold" name="hold" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Notification ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Notification Method" name="method" oils_obj:array_position="5" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Notification Note" name="note" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Notifying Staff" name="notify_staff" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label="Notifying Staff" name="notify_staff" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Notification Date/Time" name="notify_time" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                </fields>
                <links>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="owning_copy" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="stat_cat_entry" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="owning_copy" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="stat_cat_entry" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Questions" name="questions" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field reporter:label="Responses" name="responses" oils_obj:array_position="4" oils_persist:virtual="true" />
+                       <field reporter:label="Questions" name="questions" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Responses" name="responses" oils_obj:array_position="4" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Description" name="description" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Survey End Date/Time" name="end_date" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Survey ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id"/>
                        <field reporter:label="Fulfilling Staff" name="fulfillment_staff" oils_obj:array_position="10" oils_persist:virtual="false" />
                        <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Hold Type" name="hold_type" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" oils_obj:array_position="13" oils_persist:virtual="false" />
+                       <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Hold ID" name="id" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Notifications Phone Number" name="phone_notify" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Pickup Library" name="pickup_lib" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="Last Targeting Date/Time" name="prev_check_time" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Requesting Library" name="request_lib" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="Request Date/Time" name="request_time" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Requesting User" name="requestor" oils_obj:array_position="20" oils_persist:virtual="false" />
+                       <field reporter:label="Requesting User" name="requestor" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Item Selection Depth" name="selection_depth" oils_obj:array_position="21" oils_persist:virtual="false" />
                        <field reporter:label="Selection Locus" name="selection_ou" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="org_unit"/>
-                       <field reporter:label="Target Object ID" name="target" oils_obj:array_position="23" oils_persist:virtual="false" />
-                       <field reporter:label="Hold User" name="usr" oils_obj:array_position="24" oils_persist:virtual="false" />
+                       <field reporter:label="Target Object ID" name="target" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Hold User" name="usr" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Hold Cancel Date/Time" name="cancel_time" oils_obj:array_position="25" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field name="notify_time" oils_obj:array_position="26" oils_persist:virtual="true" reporter:datatype="timestamp"/>
                        <field name="notify_count" oils_obj:array_position="27" oils_persist:virtual="true" reporter:datatype="int" />
-                       <field reporter:label="Notifications" name="notifications" oils_obj:array_position="28" oils_persist:virtual="true" />
-                       <field reporter:label="Bib Record link" name="bib_rec" oils_obj:array_position="29" oils_persist:virtual="true"/>
-                       <field reporter:label="Eligible Copies" name="eligible_copies" oils_obj:array_position="30" oils_persist:virtual="true" />
+                       <field reporter:label="Notifications" name="notifications" oils_obj:array_position="28" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Bib Record link" name="bib_rec" oils_obj:array_position="29" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Eligible Copies" name="eligible_copies" oils_obj:array_position="30" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Subordinate Organizational Units" name="children" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="org_unit"/>
-                       <field reporter:label="Billing Address" name="billing_address" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field reporter:label="Holds Recieving Address" name="holds_address" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field reporter:label="Organizational Unit ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:selector="shortname" reporter:datatype="org_unit"/>
-                       <field reporter:label="ILL Recieving Address" name="ill_address" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field reporter:label="Mailling Address" name="mailing_address" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Billing Address" name="billing_address" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Holds Recieving Address" name="holds_address" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Organizational Unit ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="org_unit"/>
+                       <field reporter:label="ILL Recieving Address" name="ill_address" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Mailling Address" name="mailing_address" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Name" name="name" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Organizational Unit Type" name="ou_type" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field reporter:label="Parent Organizational Unit" name="parent_ou" oils_obj:array_position="11" oils_persist:virtual="false" />
+                       <field reporter:label="Organizational Unit Type" name="ou_type" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Parent Organizational Unit" name="parent_ou" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Short (Policy) Name" name="shortname" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="EMail Address" name="email" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Phone Number" name="phone" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="name" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="pub" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Entries" name="entries" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Entries" name="entries" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Stat Cat ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" reporter:selector="name"/>
                        <field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="OPAC Visible" name="opac_visible" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
                </links>
        </class>
-       <class id="ac" controller="open-ils.cstore" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="">
+       <class id="ac" controller="open-ils.cstore" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
                <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field reporter:label="IsActive?" name="active" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Barcode" name="barcode" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Card ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="User" name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Entries" name="entries" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Entries" name="entries" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Stat Cat ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" reporter:selector="name"/>
                        <field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="OPAC Visible" name="opac_visible" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="value" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="name" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="pub" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Amount" name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Amount Collected" name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Pyament ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Payment Note" name="note" oils_obj:array_position="7" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Payment Timestamp" name="payment_ts" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transaction" name="xact" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field reporter:label="Transaction" name="xact" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="10" oils_persist:virtual="true"  reporter:datatype="text"/>
-                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Circulation Duration" name="circ_duration" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Circulation Duration" name="circ_duration" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field reporter:label="Non-cat Type ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
-                       <field reporter:label="InHouse?" name="in_house" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="bool"/>
+                       <field reporter:label="In House?" name="in_house" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Name" name="name" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="Owning Library" name="owning_lib" oils_obj:array_position="7" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
                </fields>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Subordinate Types" name="children" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Subordinate Types" name="children" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Can Have Users?" name="can_have_users" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Can Have Volumes?" name="can_have_vols" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Type Depth" name="depth" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Type ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
                        <field reporter:label="Type Name" name="name" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
                        <field reporter:label="OPAC Label" name="opac_label" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="Parent Type" name="parent" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field reporter:label="Parent Type" name="parent" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Org Units" name="org_units" oils_obj:array_position="11" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
                </fields>
                <links>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="create_date" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="creator" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="creator" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="edit_date" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="editor" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="editor" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="pub" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="record" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field name="record" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="value" oils_obj:array_position="10" oils_persist:virtual="false"  reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_owed" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_paid" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Billing Location" name="billing_location" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Billing Location" name="billing_location" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Transaction ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Note" name="note" oils_obj:array_position="5" oils_persist:virtual="false"  reporter:datatype="text"/>
-                       <field reporter:label="User" name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Transaction Finish Timestamp" name="xact_finish" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field reporter:label="Transaction Start Timestamp" name="xact_start" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp" />
-                       <field reporter:label="Billings" name="billings" oils_obj:array_position="9" oils_persist:virtual="true" />
-                       <field reporter:label="Payments" name="payments" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Billable Transaction link" name="billable_transaction" oils_obj:array_position="11" oils_persist:virtual="true" />
-                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="12" oils_persist:virtual="true" />
-                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="13" oils_persist:virtual="true" />
+                       <field reporter:label="Billings" name="billings" oils_obj:array_position="9" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Payments" name="payments" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Billable Transaction link" name="billable_transaction" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="money"/>
+                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="money"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Transaction ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="User" name="usr" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field reporter:label="Transaction Finish Date/Time" name="xact_finish" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field reporter:label="Transaction Start Date/Time" name="xact_start" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field reporter:label="Grocery Billing link" name="grocery" oils_obj:array_position="7" oils_persist:virtual="true" />
-                       <field reporter:label="Circulation Billing link" name="circulation" oils_obj:array_position="8" oils_persist:virtual="true" />
-                       <field reporter:label="Billing Line Items" name="billings" oils_obj:array_position="9" oils_persist:virtual="true" />
-                       <field reporter:label="Payment Line Items" name="payments" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="11" oils_persist:virtual="true" />
-                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="12" oils_persist:virtual="true" />
+                       <field reporter:label="User" name="usr" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Transaction Finish Date/Time" name="xact_finish" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="Transaction Start Date/Time" name="xact_start" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field reporter:label="Grocery Billing link" name="grocery" oils_obj:array_position="7" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Circulation Billing link" name="circulation" oils_obj:array_position="8" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Billing Line Items" name="billings" oils_obj:array_position="9" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Payment Line Items" name="payments" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="money"/>
+                       <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="money"/>
                </fields>
                <links>
                        <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Entry ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field reporter:label="Stat Cat" name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Stat Cat" name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Entry Value" name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="target_user" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="target_user" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
                        <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_owed" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_paid" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Amount" name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Amount Collected" name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Payment ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Note" name="note" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Timestamp" name="payment_ts" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transaction ID" name="xact" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="10" oils_persist:virtual="true" />
+                       <field reporter:label="Transaction ID" name="xact" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="checkin_lib" oils_obj:array_position="3" oils_persist:virtual="false" />
-                       <field name="checkin_staff" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field name="checkin_lib" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="checkin_staff" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="checkin_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field name="circ_lib" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
-                       <field name="circ_staff" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="circ_staff" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="desk_renewal" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="due_date" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="duration" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field name="duration_rule" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field name="fine_interval" oils_obj:array_position="12" oils_persist:virtual="false" />
+                       <field name="duration" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="interval"/>
+                       <field name="duration_rule" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="fine_interval" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field name="id" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="id" />
                        <field name="max_fine" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="max_fine_rule" oils_obj:array_position="15" oils_persist:virtual="false" />
+                       <field name="max_fine_rule" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="opac_renewal" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="phone_renewal" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="recuring_fine" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="recuring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" />
+                       <field name="recuring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="renewal_remaining" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field name="stop_fines" oils_obj:array_position="21" oils_persist:virtual="false" />
+                       <field name="stop_fines" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="stop_fines_time" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field name="target_copy" oils_obj:array_position="23" oils_persist:virtual="false" />
-                       <field name="usr" oils_obj:array_position="24" oils_persist:virtual="false" />
+                       <field name="target_copy" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="usr" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="xact_finish" oils_obj:array_position="25" oils_persist:virtual="false" reporter:datatype="timestamp" />
                        <field name="xact_start" oils_obj:array_position="26" oils_persist:virtual="false" reporter:datatype="timestamp" />
-                       <field name="circulation" oils_obj:array_position="27" oils_persist:virtual="true" />
+                       <field name="circulation" oils_obj:array_position="27" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="value" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="source" reltype="has_a" key="id" map="" class="bre"/>
                        <field name="high" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
                        <field name="low" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="normal" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="recurance_interval" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="recurance_interval" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="interval"/>
                </fields>
                <links/>
        </class>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Amount" name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Amount Collected" name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field reporter:label="Workstation link" name="cash_drawer" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Workstation link" name="cash_drawer" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Check Number" name="check_number" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Payment ID" name="id" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Note" name="note" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Timestamp" name="payment_ts" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transaction link" name="xact" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="12" oils_persist:virtual="true" />
+                       <field reporter:label="Transaction link" name="xact" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Payment link" name="payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Statistical Catagory Entries" name="stat_cat_entries" oils_obj:array_position="3" oils_persist:virtual="true" />
-                       <field reporter:label="Age Hold Protection" name="age_protect" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Statistical Catagory Entries" name="stat_cat_entries" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Age Hold Protection" name="age_protect" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Alert Message" name="alert_message" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Barcode" name="barcode" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Call Number/Volume" name="call_number" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field reporter:label="Call Number/Volume" name="call_number" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Circulation Type (MARC)" name="circ_as_type" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Circulating Library" name="circ_lib" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
                        <field reporter:label="Circulation Modifier" name="circ_modifier" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Can Circulate" name="circulate" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Copy Number on Volume" name="copy_number" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Creation Date/Time" name="create_date" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Creating User" name="creator" oils_obj:array_position="14" oils_persist:virtual="false" />
+                       <field reporter:label="Creating User" name="creator" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Is Deleted" name="deleted" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Is Deposit Required" name="deposit" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Deposit Amount" name="deposit_amount" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Precat Dummy Author" name="dummy_author" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Precat Dummy Title" name="dummy_title" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Last Edit Date/Time" name="edit_date" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Last Editing User" name="editor" oils_obj:array_position="21" oils_persist:virtual="false" />
-                       <field reporter:label="Fine Level" name="fine_level" oils_obj:array_position="22" oils_persist:virtual="false" />
+                       <field reporter:label="Last Editing User" name="editor" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Fine Level" name="fine_level" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="int"/>
                        <field reporter:label="Is Holdable" name="holdable" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="bool" />
                        <field reporter:label="Copy ID" name="id" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="id"/>
-                       <field reporter:label="Loan Duration" name="loan_duration" oils_obj:array_position="25" oils_persist:virtual="false" />
-                       <field reporter:label="Shelving Location" name="location" oils_obj:array_position="26" oils_persist:virtual="false" />
+                       <field reporter:label="Loan Duration" name="loan_duration" oils_obj:array_position="25" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="Shelving Location" name="location" oils_obj:array_position="26" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="OPAC Visible" name="opac_visible" oils_obj:array_position="27" oils_persist:virtual="false" reporter:datatype="bool" />
                        <field reporter:label="Price" name="price" oils_obj:array_position="28" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Is Reference" name="ref" oils_obj:array_position="29" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Copy Status" name="status" oils_obj:array_position="30" oils_persist:virtual="false" />
-                       <field reporter:label="Copy Notes" name="notes" oils_obj:array_position="31" oils_persist:virtual="true" />
-                       <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_obj:array_position="32" oils_persist:virtual="true" />
-                       <field reporter:label="Circulations" name="circulations" oils_obj:array_position="33" oils_persist:virtual="true" />
+                       <field reporter:label="Copy Status" name="status" oils_obj:array_position="30" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Copy Notes" name="notes" oils_obj:array_position="31" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_obj:array_position="32" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Circulations" name="circulations" oils_obj:array_position="33" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Item Age" name="age" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Item Age" name="age" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field reporter:label="Rule ID" name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
                        <field reporter:label="Rule Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Allowed Proximity" name="prox" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="int" />
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Child Groups" name="children" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Child Groups" name="children" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Description" name="description" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Group ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
                        <field reporter:label="Group Name" name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Parent Group" name="parent" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field reporter:label="User Expiration Interval" name="perm_interval" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Parent Group" name="parent" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="User Expiration Interval" name="perm_interval" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="interval"/>
                        <field reporter:label="Required Permission" name="application_perm" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Is User Group" name="usergroup" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Responses using this Answer" name="responses" oils_obj:array_position="3" oils_persist:virtual="true" />
+                       <field reporter:label="Responses using this Answer" name="responses" oils_obj:array_position="3" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Answer Text" name="answer" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Answer ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Question" name="question" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Question" name="question" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
                        <field reporter:label="Circulating Library" name="circ_lib" oils_obj:array_position="3" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
                        <field reporter:label="Circulation Date/Time" name="circ_time" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Non-cat Circulation ID" name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Non-cat Item Type" name="item_type" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field reporter:label="Patron" name="patron" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field reporter:label="Circulating Staff" name="staff" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Non-cat Item Type" name="item_type" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Patron" name="patron" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Circulating Staff" name="staff" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
                        <field name="balance_owed" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_owed" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
                        <field name="total_paid" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
-                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Non-fulfilling Library" name="circ_lib" oils_obj:array_position="3" oils_persist:virtual="false"  reporter:datatype="org_unit"/>
-                       <field reporter:label="Non-fulfilling Copy" name="current_copy" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Non-fulfilling Copy" name="current_copy" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Retargeting Date/Time" name="fail_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Hold" name="hold" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field reporter:label="Record ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="int" />
+                       <field reporter:label="Hold" name="hold" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Record ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
                </fields>
                <links>
                        <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="field" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="value" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field name="source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="source" reltype="has_a" key="id" map="" class="bre"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Entry ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Statistical Category" name="stat_cat" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Statistical Category" name="stat_cat" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Entry Text" name="stat_cat_entry" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="User" name="target_usr" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="User" name="target_usr" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="depth" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int" />
                        <field name="grantable" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="grp" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="grp" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="perm" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="perm" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
                        <field name="items" oils_obj:array_position="3" oils_persist:virtual="true" />
                        <field name="btype" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="owner" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="pub" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
                </fields>
                <links>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field name="usr" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="work_ou" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="usr" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="work_ou" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="depth" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="depth" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int"/>
                        <field name="grantable" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="perm" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="usr" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="perm" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="usr" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="usr" reltype="has_a" key="id" map="" class="au"/>
                        <field reporter:label="Note" name="note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Date/Time" name="payment_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Voided?" name="voided" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Cash Payment Detail" name="cash_payment" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_obj:array_position="11" oils_persist:virtual="true" />
-                       <field reporter:label="Credit Payment Detail" name="credit_payment" oils_obj:array_position="12" oils_persist:virtual="true" />
-                       <field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" />
-                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" />
-                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" />
+                       <field reporter:label="Cash Payment Detail" name="cash_payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Credit Payment Detail" name="credit_payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
                        <field reporter:label="Note" name="note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Date/Time" name="payment_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Voided?" name="voided" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Cash Payment Detail" name="cash_payment" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_obj:array_position="11" oils_persist:virtual="true" />
-                       <field reporter:label="Credit Payment Detail" name="credit_payment" oils_obj:array_position="12" oils_persist:virtual="true" />
-                       <field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" />
-                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" />
-                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" />
+                       <field reporter:label="Cash Payment Detail" name="cash_payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Credit Payment Detail" name="credit_payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
                        <field reporter:label="Note" name="note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Date/Time" name="payment_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Voided?" name="voided" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
                        <field reporter:label="Note" name="note" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Payment Date/Time" name="payment_ts" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field reporter:label="Billable Transaction" name="xact" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Accepting User" name="accepting_usr" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field reporter:label="Cash Drawer" name="cash_drawer" oils_obj:array_position="10" oils_persist:virtual="false" />
+                       <field reporter:label="Cash Drawer" name="cash_drawer" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Voided?" name="voided" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Cash Payment" name="cash_payment" oils_obj:array_position="12" oils_persist:virtual="true" />
-                       <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_obj:array_position="13" oils_persist:virtual="true" />
-                       <field reporter:label="Check Payment" name="check_payment" oils_obj:array_position="14" oils_persist:virtual="true" />
+                       <field reporter:label="Cash Payment" name="cash_payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Check Payment" name="check_payment" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field name="bucket" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="id" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="target_biblio_record_entry" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field name="target_biblio_record_entry" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Entry ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field reporter:label="Stat Cat" name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Stat Cat" name="stat_cat" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Value" name="value" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
-                       <field reporter:label="Copy Status at Transit" name="copy_status" oils_obj:array_position="3" oils_persist:virtual="false" />
+                       <field reporter:label="Copy Status at Transit" name="copy_status" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Destination Library" name="dest" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="Receive Date/Time" name="dest_recv_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Hold requiring Transit" name="hold" oils_obj:array_position="6" oils_persist:virtual="false" />
+                       <field reporter:label="Hold requiring Transit" name="hold" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Transit ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Is Persistent?" name="persistant_transfer" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Previous Stop" name="prev_hop" oils_obj:array_position="9" oils_persist:virtual="false" />
+                       <field reporter:label="Previous Stop" name="prev_hop" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Sending Library" name="source" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="Send Date/Time" name="source_send_time" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Transited Copy" name="target_copy" oils_obj:array_position="12" oils_persist:virtual="false" />
-                       <field reporter:label="Base Transit" name="transit_copy" oils_obj:array_position="13" oils_persist:virtual="true" />
+                       <field reporter:label="Transited Copy" name="target_copy" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Base Transit" name="transit_copy" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
                        <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
                </links>
        </class>
-       <class id="mb" controller="open-ils.cstore" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="">
+       <class id="mb" controller="open-ils.cstore" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
                <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Amount" name="amount" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="money" />
                        <field reporter:label="Billing Timestamp" name="billing_ts" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
-                       <field reporter:label="Billing Type" name="billing_type" oils_obj:array_position="5" oils_persist:virtual="false" />
+                       <field reporter:label="Billing Type" name="billing_type" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Billing ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Note" name="note" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Void Timestamp" name="void_time" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Voided?" name="voided" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field reporter:label="Voiding Staff Member" name="voider" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field reporter:label="Transaction" name="xact" oils_obj:array_position="11" oils_persist:virtual="false" />
+                       <field reporter:label="Voiding Staff Member" name="voider" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Transaction" name="xact" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="shared" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field name="outputs" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="outputs" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="shared" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field name="templates" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="templates" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" />
+                       <field name="parent" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="create_time" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="name" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="shared" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" />
-                       <field name="reports" oils_obj:array_position="11" oils_persist:virtual="true" />
+                       <field name="share_with" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="children" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field name="reports" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="create_time" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="data" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="folder" oils_obj:array_position="8" oils_persist:virtual="false" />
-                       <field name="description" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field name="reports" oils_obj:array_position="10" oils_persist:virtual="true" />
+                       <field name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="create_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="name" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="data" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="folder" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="description" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="reports" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="create_time" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="template" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="data" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="folder" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="create_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="tiemstamp"/>
+                       <field name="template" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="data" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="folder" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="recur" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
-                       <field name="recurance" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field name="name" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field name="description" oils_obj:array_position="12" oils_persist:virtual="false" />
-                       <field name="runs" oils_obj:array_position="13" oils_persist:virtual="true" />
+                       <field name="recurance" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="interval"/>
+                       <field name="name" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="description" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="runs" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="owner" reltype="has_a" key="id" map="" class="au"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field name="runner" oils_obj:array_position="4" oils_persist:virtual="false" />
-                       <field name="start_time" oils_obj:array_position="5" oils_persist:virtual="false" />
-                       <field name="complete_time" oils_obj:array_position="6" oils_persist:virtual="false" />
-                       <field name="run_time" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field name="email" oils_obj:array_position="8" oils_persist:virtual="false" />
+                       <field name="runner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="start_time" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="complete_time" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="run_time" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+                       <field name="email" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="excel_format" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="csv_format" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="html_format" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="error_code" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="int"/>
-                       <field name="error_text" oils_obj:array_position="13" oils_persist:virtual="false" />
-                       <field name="report" oils_obj:array_position="14" oils_persist:virtual="false" />
-                       <field name="folder" oils_obj:array_position="15" oils_persist:virtual="false" />
+                       <field name="error_text" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field name="report" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field name="folder" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field name="chart_pie" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="chart_bar" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field name="chart_line" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="bool"/>
                        <field reporter:label="Publication Year (normalized)" name="pubdate" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="int"/>
                        <field reporter:label="ISBN" name="isbn" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="ISSN" name="issn" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Full Bibliographic record" name="biblio_record" oils_obj:array_position="14" oils_persist:virtual="true" />
+                       <field reporter:label="Full Bibliographic record" name="biblio_record" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Record ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
-                       <field reporter:label="Metarecord" name="metarecord" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Metarecord" name="metarecord" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Fingerprint" name="fingerprint" oils_obj:array_position="5" oils_persist:virtual="false" />
                        <field reporter:label="Overall Record Quality" name="quality" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="int"/>
-                       <field reporter:label="TCN Source" name="tcn_source" oils_obj:array_position="7" oils_persist:virtual="false" />
-                       <field reporter:label="TCN Value" name="tcn_value" oils_obj:array_position="8" oils_persist:virtual="false" />
-                       <field reporter:label="Title Proper (normalized)" name="title" oils_obj:array_position="9" oils_persist:virtual="false" />
-                       <field reporter:label="Uniform Title (normalized)" name="uniform_title" oils_obj:array_position="10" oils_persist:virtual="false" />
-                       <field reporter:label="Author (normalized)" name="author" oils_obj:array_position="11" oils_persist:virtual="false" />
-                       <field reporter:label="Publisher (normalized)" name="publisher" oils_obj:array_position="12" oils_persist:virtual="false" />
+                       <field reporter:label="TCN Source" name="tcn_source" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="TCN Value" name="tcn_value" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Title Proper (normalized)" name="title" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Uniform Title (normalized)" name="uniform_title" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Author (normalized)" name="author" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Publisher (normalized)" name="publisher" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Publication Year (normalized)" name="pubdate" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="int"/>
-                       <field reporter:label="Series Title (normalized)" name="series_title" oils_obj:array_position="14" oils_persist:virtual="false" />
-                       <field reporter:label="Series Statement (normalized)" name="series_statement" oils_obj:array_position="15" oils_persist:virtual="false" />
-                       <field reporter:label="Summary (normalized)" name="summary" oils_obj:array_position="16" oils_persist:virtual="false" />
-                       <field reporter:label="ISBN" name="isbn" oils_obj:array_position="17" oils_persist:virtual="false" />
-                       <field reporter:label="ISSN" name="issn" oils_obj:array_position="18" oils_persist:virtual="false" />
-                       <field reporter:label="Topic Subjects (normalized)" name="topic_subject" oils_obj:array_position="19" oils_persist:virtual="false" />
-                       <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" oils_obj:array_position="20" oils_persist:virtual="false" />
-                       <field reporter:label="Genres (normalized)" name="genre" oils_obj:array_position="21" oils_persist:virtual="false" />
-                       <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" oils_obj:array_position="22" oils_persist:virtual="false" />
-                       <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" oils_obj:array_position="23" oils_persist:virtual="false" />
-                       <field reporter:label="External URI List (normalized)" name="external_uri" oils_obj:array_position="24" oils_persist:virtual="false" />
-                       <field reporter:label="Full Bibliographic record" name="biblo_record" oils_obj:array_position="25" oils_persist:virtual="true" />
+                       <field reporter:label="Series Title (normalized)" name="series_title" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Series Statement (normalized)" name="series_statement" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Summary (normalized)" name="summary" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="ISBN" name="isbn" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="ISSN" name="issn" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Topic Subjects (normalized)" name="topic_subject" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Genres (normalized)" name="genre" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="External URI List (normalized)" name="external_uri" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="text"/>
+                       <field reporter:label="Full Bibliographic record" name="biblo_record" oils_obj:array_position="25" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
                        <field reporter:label="Hold ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
                        <field reporter:label="Hold Target" name="target" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Hold Request Type" name="hold_type" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Target Bib Record" name="bib_record" oils_obj:array_position="6" oils_persist:virtual="false"/>
+                       <field reporter:label="Target Bib Record" name="bib_record" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Transaction ID" name="xact" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Unvoided Billing Amount" name="unvoided" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label="Voided Billing Amount" name="voided" oils_obj:array_position="5" oils_persist:virtual="false"/>
-                       <field reporter:label="Total Billing Amount" name="total" oils_obj:array_position="6" oils_persist:virtual="false"/>
+                       <field reporter:label="Voided Billing Amount" name="voided" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field reporter:label="Total Billing Amount" name="total" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
                </fields>
                <links>
                        <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Transaction ID" name="xact" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="int" />
                        <field reporter:label="Unvoided Paid Amount" name="unvoided" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="int" />
-                       <field reporter:label="Voided (Returned) Paid Amount" name="voided" oils_obj:array_position="5" oils_persist:virtual="false"/>
-                       <field reporter:label="Total Paid Amount" name="total" oils_obj:array_position="6" oils_persist:virtual="false"/>
+                       <field reporter:label="Voided (Returned) Paid Amount" name="voided" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money"/>
+                       <field reporter:label="Total Paid Amount" name="total" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
                </fields>
                <links>
                        <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
        </class>
 
        <!-- ********************************************************************************************************************* -->
-       <!-- What follows is a set of example extentions that are useful for PINES.  Comment out or remove if you don't want them. -->
+       <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
        <!-- ********************************************************************************************************************* -->
        <class id="rccc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_circ" oils_persist:tablename="reporter.classic_current_circ" reporter:core="true" reporter:label="Classic Circulation View">
                <fields oils_persist:primary="id">
                        <field reporter:label="Library Circulation Location Link" name="circ_lib_id" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit"/>
                        <field reporter:label="Circulation Date/Time" name="xact_start" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
                        <field reporter:label="Circulation Type" name="circ_type" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Copy Link" name="copy_id" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="Copy Link" name="copy_id" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Circ Modifier" name="circ_modifier" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Item Language" name="language" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Shelving Location" name="shelving_location" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Patron Profile Group" name="profile_group" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Patron Age Demographic" name="demographic_general_division" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Call Number Link" name="call_number" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="Call Number Link" name="call_number" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Call Number Label" name="call_number_label" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Call Number Dewey/Prefix" name="dewey" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Patron Link" name="patron_id" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="int"/>
-                       <field reporter:label="Patron Home Library Link" name="patron_home_lib" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="Patron Link" name="patron_id" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Patron Home Library Link" name="patron_home_lib" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" oils_obj:array_position="23" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Patron County" name="patron_county" oils_obj:array_position="24" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Patron City" name="patron_city" oils_obj:array_position="25" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Patron ZIP Code" name="patron_zip" oils_obj:array_position="26" oils_persist:virtual="false" reporter:datatype="text"/>
-                       <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" oils_obj:array_position="27" oils_persist:virtual="false" reporter:datatype="int"/>
-                       <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" oils_obj:array_position="28" oils_persist:virtual="false" reporter:datatype="int"/>
+                       <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" oils_obj:array_position="27" oils_persist:virtual="false" reporter:datatype="link"/>
+                       <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" oils_obj:array_position="28" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Dewey Range -- Tens" name="dewey_range_tens" oils_obj:array_position="29" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Dewey Range -- Hundreds" name="dewey_range_hundreds" oils_obj:array_position="30" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field reporter:label="Dewey Block -- Tens" name="dewey_block_tens" oils_obj:array_position="31" oils_persist:virtual="false" reporter:datatype="text"/>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Entry ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="value" reporter:datatype="id" />
-                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Entry Value" name="value" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
                        <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
                        <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
                        <field reporter:label="Entry ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="value" reporter:datatype="id" />
-                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" />
+                       <field reporter:label="Entry Owner" name="owner" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
                        <field reporter:label="Entry Value" name="value" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
                </fields>
                <links>
diff --git a/Open-ILS/examples/fm_IDL.xsd b/Open-ILS/examples/fm_IDL.xsd
new file mode 100644 (file)
index 0000000..41f9629
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+
+Copyright (C) 2007 Laurentian University
+Dan Scott <dscott@laurentian.ca>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:idl="http://opensrf.org/spec/IDL/base/v1"
+ xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1"
+ xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1"
+ xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1"
+ targetNamespace="http://opensrf.org/spec/IDL/base/v1"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+>
+
+<xs:import namespace="http://open-ils.org/spec/opensrf/IDL/persistence/v1"
+ schemaLocation="oils_persist.xsd"/>
+
+<xs:import namespace="http://open-ils.org/spec/opensrf/IDL/objects/v1"
+ schemaLocation="oils_obj.xsd"/>
+
+<xs:import namespace="http://open-ils.org/spec/opensrf/IDL/reporter/v1"
+ schemaLocation="reporter.xsd"/>
+
+<!-- define simple elements -->
+<xs:element name="field" nillable="true">
+ <xs:complexType>
+  <xs:attribute name="name"/>
+  <xs:attribute ref="oils_obj:array_position"/>
+  <xs:attribute ref="oils_persist:primitive"/>
+  <xs:attribute ref="oils_persist:virtual"/>
+  <xs:attribute ref="reporter:label"/>
+  <xs:attribute ref="reporter:datatype"/>
+  <xs:attribute ref="reporter:selector"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="link" nillable="true">
+ <xs:complexType>
+  <xs:attribute name="field" type="xs:string" use="required"/>
+  <xs:attribute name="reltype" type="xs:string" use="required"/>
+  <xs:attribute name="key" type="xs:string" use="required"/>
+  <xs:attribute name="map" type="xs:string" use="required"/>
+  <xs:attribute name="class" type="xs:string" use="required"/>
+  <xs:attribute ref="reporter:label"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="fields">
+ <xs:complexType>
+  <xs:sequence>
+   <xs:element ref="idl:field" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+  <xs:attribute ref="oils_persist:primary"/>
+  <xs:attribute ref="oils_persist:sequence"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="links">
+ <xs:complexType>
+  <xs:sequence>
+   <xs:element ref="idl:link" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="class">
+ <xs:complexType>
+  <xs:sequence>
+   <xs:element ref="idl:fields"/>
+   <xs:element ref="idl:links" minOccurs="0"/>
+  </xs:sequence>
+  <xs:attribute name="id"/>
+  <xs:attribute name="controller"/>
+  <xs:attribute ref="oils_obj:fieldmapper"/>
+  <xs:attribute ref="oils_persist:tablename"/>
+  <xs:attribute ref="oils_persist:virtual"/>
+  <xs:attribute ref="reporter:core"/>
+  <xs:attribute ref="reporter:label"/>
+ </xs:complexType>
+</xs:element>
+
+<xs:element name="IDL">
+ <xs:complexType>
+  <xs:sequence>
+   <xs:element ref="idl:class" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:complexType>
+</xs:element>
+
+</xs:schema>
diff --git a/Open-ILS/examples/oils_obj.xsd b/Open-ILS/examples/oils_obj.xsd
new file mode 100644 (file)
index 0000000..f41ce8c
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+
+Copyright (C) 2007 Laurentian University
+Dan Scott <dscott@laurentian.ca>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://open-ils.org/spec/opensrf/IDL/objects/v1"
+ targetNamespace="http://open-ils.org/spec/opensrf/IDL/objects/v1"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified"
+>
+
+<xs:attribute name="array_position" type="xs:nonNegativeInteger"/>
+<xs:attribute name="fieldmapper"/>
+
+</xs:schema>
diff --git a/Open-ILS/examples/oils_persist.xsd b/Open-ILS/examples/oils_persist.xsd
new file mode 100644 (file)
index 0000000..6ecc310
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+
+Copyright (C) 2007 Laurentian University
+Dan Scott <dscott@laurentian.ca>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://open-ils.org/spec/opensrf/IDL/persistence/v1"
+ targetNamespace="http://open-ils.org/spec/opensrf/IDL/persistence/v1"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified"
+>
+
+<xs:attribute name="primary"/>
+<xs:attribute name="primitive"/>
+<xs:attribute name="sequence"/>
+<xs:attribute name="tablename"/>
+<xs:attribute name="virtual" type="xs:boolean"/>
+
+</xs:schema>
diff --git a/Open-ILS/examples/reporter.xsd b/Open-ILS/examples/reporter.xsd
new file mode 100644 (file)
index 0000000..4ff84be
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+
+Copyright (C) 2007 Laurentian University
+Dan Scott <dscott@laurentian.ca>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://open-ils.org/spec/opensrf/IDL/reporter/v1"
+ targetNamespace="http://open-ils.org/spec/opensrf/IDL/reporter/v1"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified"
+>
+
+<xs:attribute name="core" type="xs:boolean"/>
+<xs:attribute name="datatype"/>
+<xs:attribute name="label"/>
+<xs:attribute name="selector"/>
+
+</xs:schema>
index 7c32288..56a6b32 100644 (file)
@@ -1,8 +1,7 @@
 
-export TMPDIR                  = $(TMP)/opensrf
-export LDFLAGS                 += -L $(TMPDIR) -L .
+export LDFLAGS                 += -L . -L $(OPENSRF_LIBS)
 export CFLAGS                  += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
-                                                               -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
+                                                               -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(OPENSRF_HEADERS)
 
 export INCDIR = "$(INCLUDEDIR)/openils/"
 
index b8a48c7..2c93229 100644 (file)
@@ -36,7 +36,7 @@ static void mod_ils_gateway_child_init(apr_pool_t *p, server_rec *s) {
                osrfLogError( OSRF_LOG_MARK, "Unable to load gateway config file...");
                return;
        }
-       fprintf(stderr, "Bootstrapping %d\n", getpid() );
+       fprintf(stderr, "Bootstrapping %ld\n", (long) getpid() );
        fflush(stderr);
 }
 
@@ -138,8 +138,8 @@ static int mod_ils_gateway_method_handler (request_rec *r) {
 
        }
 
-       osrfLogInfo( OSRF_LOG_MARK, "Performing(%d):  service %s | method %s | \n",
-                       getpid(), service, method );
+       osrfLogInfo( OSRF_LOG_MARK, "Performing(%ld):  service %s | method %s | \n",
+                       (long) getpid(), service, method );
 
        int k;
        for( k = 0; k!= sarray->size; k++ ) {
index ae6e1f7..45af137 100644 (file)
@@ -14,58 +14,58 @@ oils_dataloader.o:  oils_dataloader.c
 
 oils_dataloader:       oils_dataloader.o
        @echo $@
-       $(CC) $(LDLIBS) $(LDFLAGS) -loils_idl -loils_utils oils_dataloader.o -o $(TMPDIR)/$@
+       $(CC) $(LDLIBS) $(LDFLAGS) -loils_idl -loils_utils oils_dataloader.o -o $(TMP)/$@
 
 oils_cstore.so:        oils_cstore.o liboils_utils.so liboils_idl.so
        @echo $@
        $(CC) -shared -W1 -L/usr/local/lib/dbd \
-               $(LDLIBS) $(LDFLAGS) -loils_idl -ldbi -loils_utils -ldbdpgsql oils_cstore.o -o $(TMPDIR)/$@
+               $(LDLIBS) $(LDFLAGS) -loils_idl -ldbi -loils_utils -ldbdpgsql oils_cstore.o -o $(TMP)/$@
 
 oils_rstore.o: oils_cstore.c oils_utils.h
-       $(CC) $(CFLAGS) -I$(TMPDIR) -I$(TMPDIR)/opensrf/ -DRSTORE -c -o $@ oils_cstore.c 
+       $(CC) $(CFLAGS) -I$(TMP) -DRSTORE -c -o $@ oils_cstore.c 
 
 oils_rstore.so:        oils_rstore.o liboils_utils.so liboils_idl.so
        @echo $@
        $(CC) -shared -W1 -L/usr/local/lib/dbd \
-               $(LDLIBS) $(LDFLAGS) -loils_idl -ldbi -ldbdpgsql oils_rstore.o -o $(TMPDIR)/$@
+               $(LDLIBS) $(LDFLAGS) -loils_idl -ldbi -ldbdpgsql oils_rstore.o -o $(TMP)/$@
 
 oils_fetch.so: oils_fetch.o liboils_utils.so
        @echo $@
        $(CC) -shared -W1 -L/usr/local/lib/dbd \
-               $(LDLIBS) $(LDFLAGS) -ldbi -ldbdpgsql -loils_utils oils_fetch.o -o $(TMPDIR)/$@
+               $(LDLIBS) $(LDFLAGS) -ldbi -ldbdpgsql -loils_utils oils_fetch.o -o $(TMP)/$@
 
 oils_idl-core.o:       oils_idl-core.c oils_idl.h
 
 liboils_idl.so:        oils_idl-core.o
        @echo $@
        $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) oils_idl-core.o -o $@
-       cp $@ $(TMPDIR)/
-       mkdir -p $(TMPDIR)/openils/
-       cp oils_idl.h $(TMPDIR)/openils/
-       cp idl_fieldmapper.h $(TMPDIR)/openils/
+       cp $@ $(TMP)/
+       mkdir -p $(TMP)/openils/
+       cp oils_idl.h $(TMP)/openils/
+       cp idl_fieldmapper.h $(TMP)/openils/
 
 oils_auth.so:  oils_auth.o liboils_utils.so
        @echo $@
-       $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) -loils_utils -loils_idl oils_auth.o -o $(TMPDIR)/$@
+       $(CC) -shared -W1 $(CFLAGS) $(LDLIBS) $(LDFLAGS) -loils_utils -loils_idl oils_auth.o -o $(TMP)/$@
 
 liboils_utils.so:      oils_utils.o oils_event.o oils_constants.h
        @echo $@
        $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) oils_utils.o oils_event.o -o $@
-       cp $@ $(TMPDIR)/
-       mkdir -p $(TMPDIR)/openils/
-       cp oils_event.h $(TMPDIR)/openils/
-       cp oils_utils.h $(TMPDIR)/openils/
-       cp oils_constants.h $(TMPDIR)/openils/
+       cp $@ $(TMP)/
+       mkdir -p $(TMP)/openils/
+       cp oils_event.h $(TMP)/openils/
+       cp oils_utils.h $(TMP)/openils/
+       cp oils_constants.h $(TMP)/openils/
 
 install:
        @echo $@;
-       cp $(TMPDIR)/oils_auth.so $(LIBDIR)/
-       #cp $(TMPDIR)/oils_fetch.so $(LIBDIR)/
-       cp $(TMPDIR)/oils_cstore.so $(LIBDIR)/
-       cp $(TMPDIR)/oils_rstore.so $(LIBDIR)/
-       cp $(TMPDIR)/liboils_utils.so $(LIBDIR)/
-       cp $(TMPDIR)/liboils_idl.so $(LIBDIR)/
-       cp $(TMPDIR)/oils_dataloader $(BINDIR)/
+       cp $(TMP)/oils_auth.so $(LIBDIR)/
+       #cp $(TMP)/oils_fetch.so $(LIBDIR)/
+       cp $(TMP)/oils_cstore.so $(LIBDIR)/
+       cp $(TMP)/oils_rstore.so $(LIBDIR)/
+       cp $(TMP)/liboils_utils.so $(LIBDIR)/
+       cp $(TMP)/liboils_idl.so $(LIBDIR)/
+       cp $(TMP)/oils_dataloader $(BINDIR)/
        mkdir -p $(INCDIR)/
        cp oils_utils.h $(INCDIR)
        cp oils_idl.h $(INCDIR)
index f4e5b95..977a3c1 100644 (file)
@@ -101,7 +101,7 @@ int oilsAuthInit( osrfMethodContext* ctx ) {
 
                } else {
 
-                       seed = va_list_to_string( "%d.%d.%s", time(NULL), getpid(), username );
+                       seed = va_list_to_string( "%d.%ld.%s", time(NULL), (long) getpid(), username );
                        key = va_list_to_string( "%s%s", OILS_AUTH_CACHE_PRFX, username );
        
                        md5seed = md5sum(seed);
@@ -282,7 +282,7 @@ oilsEvent* oilsAuthHandleLoginOK(
        osrfLogDebug(OSRF_LOG_MARK, "Auth session timeout for %s: %f", uname, timeout );
 
        char* string = va_list_to_string( 
-                       "%d.%d.%s", getpid(), time(NULL), uname ); 
+                       "%d.%ld.%s", (long) getpid(), time(NULL), uname ); 
        char* authToken = md5sum(string); 
        char* authKey = va_list_to_string( 
                        "%s%s", OILS_AUTH_CACHE_PRFX, authToken ); 
index 18923b3..19562b5 100644 (file)
@@ -9,7 +9,7 @@
 #include <libxml/debugXML.h>
 #include <libxml/xmlmemory.h>
 
-#define PERSIST_NS "http://open-ils.org/spec/opensrf/IDL/persistance/v1"
+#define PERSIST_NS "http://open-ils.org/spec/opensrf/IDL/persistence/v1"
 #define OBJECT_NS "http://open-ils.org/spec/opensrf/IDL/objects/v1"
 #define BASE_NS "http://opensrf.org/spec/IDL/base/v1"
 
index 9c0b2c6..6e95814 100755 (executable)
@@ -20,7 +20,7 @@ die $@ if ($@);
 warn "Generating fieldmapper IDL xml...\n";
 
 print <<XML;
-<IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistance/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1">
+<IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1">
 XML
 
 
index 163acad..0e2184b 100755 (executable)
@@ -4,13 +4,7 @@ use warnings;
 
 use lib '/openils/lib/perl5/';
 
-use OpenSRF::System;
-use OpenSRF::Application;
-use OpenSRF::EX qw/:try/;
-use OpenSRF::AppSession;
-use OpenSRF::MultiSession;
-use OpenSRF::Utils::SettingsClient;
-use OpenILS::Application::AppUtils;
+use Error qw/:try/;
 use OpenILS::Utils::Fieldmapper;
 use Digest::MD5 qw/md5_hex/;
 use JSON;
@@ -27,8 +21,8 @@ use MARC::Charset;
 
 #MARC::Charset->ignore_errors(1);
 
-my ($id_field, $recid, $user, $config, $marctype, $keyfile, $dontuse_file, $enc, $force_enc, @files, @trash_fields) =
-       ('', 1, 1, '/openils/conf/bootstrap.conf', 'USMARC');
+my ($id_field, $recid, $user, $config, $idlfile, $marctype, $keyfile, $dontuse_file, $enc, $force_enc, @files, @trash_fields) =
+       ('', 1, 1, '/openils/conf/bootstrap.conf', '/openils/conf/fm_IDL.xml', 'USMARC');
 
 GetOptions(
        'marctype=s'    => \$marctype,
@@ -41,6 +35,7 @@ GetOptions(
        'config=s'      => \$config,
        'file=s'        => \@files,
        'trash=s'       => \@trash_fields,
+       'xml_idl=s'     => \$idlfile,
        'dontuse=s'     => \$dontuse_file
 );
 
@@ -72,8 +67,8 @@ my %source_map = (
 );                              
 
 
-OpenSRF::System->bootstrap_client( config_file => $config );
-Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
+
+Fieldmapper->import(IDL => $idlfile);
 
 my %keymap;
 if ($keyfile) {
index 77d3a9f..1956c06 100644 (file)
 char* script           = NULL;
 char* authtoken        = NULL;
 
-int do_request( char* request );
-char* format_response( jsonObject* o );
+static int do_request( char* request );
+static char* format_response( jsonObject* o );
 
 int main( int argc, char* argv[] ) {
        
-       char c;
+       int c;
        char* username          = NULL;
        char* password          = NULL;
        char* config            = NULL;
@@ -63,16 +63,24 @@ int main( int argc, char* argv[] ) {
                printf("Login Session: %s\n", authtoken);
        }
 
-       while((request=readline("oils# "))) 
-               if(do_request(request)) break;
+       while( (request=readline("oils# ")) ) {
+          int retcode = do_request(request);
+          free(request);
+          if( retcode ) break;
+       }
 
+       free(config);
+       free(context);
+       free(username);
+       free(password);
+       free(script);
        free(authtoken);
        free(idl_filename);
        return 1;
 }
 
 
-int do_request( char* request ) {
+static int do_request( char* request ) {
 
        if(!strcasecmp(request, "exit") || !strcasecmp(request,"quit"))
                return 1;
@@ -82,20 +90,21 @@ int do_request( char* request ) {
        char* service;
        char* method;
        char* tmp;
-       char* item;
-       growing_buffer* buffer = buffer_init(256);
        
        service = strtok_r(request, " ", &tmp);
        method = strtok_r(NULL, " ", &tmp);
-       while( (item = strtok_r(NULL, " ", &tmp)) ) 
-               buffer_fadd(buffer, "%s", item);
 
        if( service && method ) {
 
                jsonObject* params = NULL;
-               if(buffer->n_used > 0) 
-                       params = jsonParseStringFmt("[%s]", buffer->buf);
 
+               if( *tmp ) {
+                       growing_buffer* buffer = buffer_init(256);
+                       buffer_fadd( buffer, "[%s]", tmp );
+                       params = jsonParseString( buffer->buf );
+                       buffer_free(buffer);
+               }
+               
                osrfAppSession* session = osrf_app_client_session_init(service);
                int req_id = osrf_app_session_make_req( session, params, method, 1, NULL );
                osrfMessage* omsg;
@@ -112,15 +121,14 @@ int do_request( char* request ) {
                jsonObjectFree(params);
 
        } else {
-               fprintf(stderr, "STATMENT DOES NOT PARSE: %s\n", request);
+               fprintf(stderr, "STATEMENT DOES NOT PARSE: %s\n", request);
        }
 
-       buffer_free(buffer);
        return 0;
 }
 
 
-char* format_response( jsonObject* o ) {
+static char* format_response( jsonObject* o ) {
        if(!o) return NULL;
 
        int width = 20;
diff --git a/Open-ILS/src/java/Makefile b/Open-ILS/src/java/Makefile
new file mode 100644 (file)
index 0000000..2fc0387
--- /dev/null
@@ -0,0 +1,42 @@
+JAVA_LIBDIR = .lib
+JAVAC = javac -J-Xmx256m
+JAVA = java -Xmx256m 
+OSRF_HOME = ../../../OpenSRF/src/java
+OSRF_JAVA = $(OSRF_HOME)/.lib
+EXT = $(OSRF_HOME)/ext
+JAVA_LIBS = .:$(JAVA_LIBDIR):$(OSRF_JAVA):$(EXT)/json-jdk1.5-2007-05-01.jar:$(EXT)/wstx-lgpl-3.2.1.jar:$(EXT)/stax-api-1.0.1.jar:$(EXT)/java_memcached-release_1.5.1.jar
+JAVA_SRC = \
+       org/open_ils/idl/*.java\
+       org/open_ils/test/*.java
+
+all:
+       mkdir -p $(JAVA_LIBDIR)
+       $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 
+
+# only prints the first 30 lines of errors
+slim:
+       mkdir -p $(JAVA_LIBDIR)
+       $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
+       @echo -e "\nTruncating at 30 lines"
+
+check:
+       mkdir -p $(JAVA_LIBDIR)
+       $(JAVAC) -Xlint:unchecked -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
+       @echo -e "\nTruncating at 30 lines"
+
+run:
+       @$(JAVA) -cp $(JAVA_LIBS) $(JAVA_EXE) $(JAVA_ARGS)
+
+deps:
+       mkdir -p ext
+
+docs:
+       find . -name *.java > files;
+       javadoc -classpath $(JAVA_LIBS) -d doc @files;
+       rm files;
+
+clean:
+       rm -r $(JAVA_LIBDIR)
+       
+
+
diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLField.java b/Open-ILS/src/java/org/open_ils/idl/IDLField.java
new file mode 100644 (file)
index 0000000..6955bc5
--- /dev/null
@@ -0,0 +1,46 @@
+package org.open_ils.idl;
+
+public class IDLField {
+
+    /** Field name */
+    private String name;
+
+    /** Where this field resides in the array when serilized */
+    private int arrayPos;
+
+    /** True if this field does not belong in the database */
+    private boolean isVirtual;
+
+    public void setName(String name) {
+      this.name = name;
+    }
+    public void setArrayPos(int arrayPos) {
+      this.arrayPos = arrayPos;
+    }
+    public void setIsVirtual(boolean isVirtual) {
+      this.isVirtual = isVirtual;
+    }
+    public String getName() {
+      return this.name;
+    }
+    public int getArrayPos() {
+      return this.arrayPos;
+    }
+    public boolean getIsVirtual() {
+      return this.isVirtual;
+    }
+
+    public void toXML(StringBuffer sb) {
+        sb.append("\t\t\t<field name='");
+        sb.append(name);
+        sb.append("' ");
+        sb.append(IDLParser.OILS_NS_OBJ_PREFIX);
+        sb.append(":array_position='");
+        sb.append(arrayPos);
+        sb.append("' ");
+        sb.append(IDLParser.OILS_NS_PERSIST_PREFIX);
+        sb.append(":virtual='");
+        sb.append(isVirtual);
+        sb.append("'/>\n");
+    }
+}
diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLLink.java b/Open-ILS/src/java/org/open_ils/idl/IDLLink.java
new file mode 100644 (file)
index 0000000..69a5772
--- /dev/null
@@ -0,0 +1,46 @@
+package org.open_ils.idl;
+
+
+public class IDLLink {
+
+   /**The field on the IDLObject this link extends from */
+   private String field;
+   private String reltype;
+   private String key;
+   private String map;
+   /**The IDL class linked to */
+   private String IDLClass;
+
+
+   public void setField(String field) {
+      this.field = field;
+   }
+   public void setReltype(String reltype) {
+      this.reltype = reltype;
+   }
+   public void setKey(String key) {
+      this.key = key;
+   }
+   public void setMap(String map) {
+      this.map = map;
+   }
+   public void setIDLClass(String IDLClass) {
+      this.IDLClass = IDLClass;
+   }
+   public String getField() {
+      return this.field;
+   }
+   public String getReltype() {
+      return this.reltype;
+   }
+   public String getKey() {
+      return this.key;
+   }
+   public String getMap() {
+      return this.map;
+   }
+   public String getIDLClass() {
+      return this.IDLClass;
+   }
+}
+
diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLObject.java b/Open-ILS/src/java/org/open_ils/idl/IDLObject.java
new file mode 100644 (file)
index 0000000..aafde6e
--- /dev/null
@@ -0,0 +1,96 @@
+package org.open_ils.idl;
+import java.util.HashMap;
+import java.util.Iterator;
+
+
+public class IDLObject {
+
+    private String IDLClass;
+    private String fieldMapper;
+    private String controller;
+    private String rptLabel;
+    private HashMap<String, IDLField> fields;
+    private HashMap<String, IDLLink> links;
+    
+    /** true if this is a virtual object (does not live in the database) */
+    private boolean isVirtual;
+    
+    public IDLObject() {
+       fields = new HashMap<String, IDLField>();
+       links = new HashMap<String, IDLLink>();
+    }
+    
+    public String getIDLClass() {
+       return IDLClass;
+    }
+    
+    public void addLink(IDLLink link) {
+       links.put(link.getField(), link);
+    }
+    
+    public void addField(IDLField field) {
+       fields.put(field.getName(), field);
+    }
+    
+    public IDLField getField(String name) {
+        return (IDLField) fields.get(name);
+    }
+
+    public HashMap getFields() {
+        return fields;
+    }
+
+
+    /**
+     * Returns the link object found at the given field on 
+     * this IDLObject.
+     */
+    public IDLLink getLink(String fieldName) {
+        return (IDLLink) links.get(fieldName);
+    }
+    
+    public String getFieldMapper() {
+       return fieldMapper;
+    }
+    
+    public String getController() {
+       return controller;
+    }
+    
+    public String getRptLabel() {
+       return rptLabel;
+    }
+    public boolean isVirtual() {
+       return isVirtual;
+    }
+    
+    public void setIDLClass(String IDLClass) {
+       this.IDLClass = IDLClass;
+    }
+    
+    public void setFieldMapper(String fm) {
+       this.fieldMapper = fm;
+    }
+    public void setController(String controller) {
+       this.controller = controller;
+    }
+    public void setRptLabel(String label) {
+       this.rptLabel = label;
+    }
+    public void setIsVirtual(boolean isVirtual) {
+       this.isVirtual = isVirtual;
+    }
+
+
+    public void toXML(StringBuffer sb) {
+
+        sb.append("\t\t<fields>");
+        Iterator itr = fields.keySet().iterator();        
+        IDLField field;
+        while(itr.hasNext()) {
+            field = fields.get((String) itr.next()); 
+            field.toXML(sb);
+        }
+        sb.append("\t\t</fields>");
+    }
+}
diff --git a/Open-ILS/src/java/org/open_ils/idl/IDLParser.java b/Open-ILS/src/java/org/open_ils/idl/IDLParser.java
new file mode 100644 (file)
index 0000000..19b14d4
--- /dev/null
@@ -0,0 +1,178 @@
+package org.open_ils.idl;
+
+import org.opensrf.util.*;
+
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Iterator;
+
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import javax.xml.stream.*;
+import javax.xml.stream.events.* ;
+import javax.xml.namespace.QName;
+
+
+public class IDLParser {
+
+    public static final String OILS_NS_BASE="http://opensrf.org/spec/IDL/base/v1";
+    public static final String OILS_NS_OBJ="http://open-ils.org/spec/opensrf/IDL/objects/v1";
+    public static final String OILS_NS_OBJ_PREFIX="oils_obj";
+    public static final String OILS_NS_PERSIST="http://open-ils.org/spec/opensrf/IDL/persistence/v1";
+    public static final String OILS_NS_PERSIST_PREFIX="oils_persist";
+    public static final String OILS_NS_REPORTER="http://open-ils.org/spec/opensrf/IDL/reporter/v1";
+    public static final String OILS_NS_REPORTER_PREFIX="reporter";
+
+    /** The source for the IDL XML */
+    InputStream inStream;
+    HashMap<String, IDLObject> IDLObjects;
+    IDLObject current;
+
+    /** If true, we retain the full set of IDL objects in memory.  This is true by default. */
+    private boolean keepIDLObjects;
+
+    public IDLParser() {
+        IDLObjects = new HashMap<String, IDLObject>();
+        keepIDLObjects = true;
+    }
+
+    public IDLParser(String fileName) throws IOException {
+        this(new FileInputStream(fileName));
+    }
+
+    public IDLParser(InputStream inStream) {
+        this();
+        this.inStream = inStream;
+    }
+
+    /**
+    * Parses the IDL XML
+    */
+    public void parse() throws IOException {
+    
+        try {
+            XMLInputFactory factory = XMLInputFactory.newInstance();
+    
+            /** disable as many unused features as possible to speed up the parsing */
+            factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
+            factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
+            factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+            factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
+            factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
+    
+    
+        /** create the stream reader */
+            XMLStreamReader reader = factory.createXMLStreamReader(this.inStream);
+            int eventType;
+    
+            while(reader.hasNext()) {
+                /** cycle through the XML events */
+    
+                eventType = reader.next();
+    
+                switch(eventType) {
+    
+                    case XMLEvent.START_ELEMENT:
+                        handleStartElement(reader);
+                        break;
+    
+                    case XMLEvent.END_ELEMENT: 
+                        handleEndElement(reader);
+                        break;
+                }
+            }
+
+        } catch(javax.xml.stream.XMLStreamException se) {
+            /* throw local exception */
+        }
+   }
+
+   /**
+    * Returns the IDLObject with the given IDLClass 
+    */
+   public IDLObject getObject(String IDLClass) {
+      return (IDLObject) IDLObjects.get(IDLClass);
+   }
+
+    public void handleStartElement(XMLStreamReader reader) {
+
+        if(!OILS_NS_BASE.equals(reader.getNamespaceURI())) return;
+        String localpart = reader.getLocalName();
+    
+        if( "class".equals(localpart) ) {
+            current = new IDLObject();
+            current.setIDLClass(reader.getAttributeValue(null, "id"));
+            current.setController(reader.getAttributeValue(null, "controller"));
+            String persist = reader.getAttributeValue(OILS_NS_PERSIST, "virtual");
+            current.setIsVirtual("persist".equals(reader.getAttributeValue(OILS_NS_PERSIST, "virtual")));
+            return;
+        }
+    
+        if( "field".equals(localpart) ) {
+            IDLField field = new IDLField();
+            field.setName(reader.getAttributeValue(null, "name"));
+            field.setArrayPos(new Integer(reader.getAttributeValue(OILS_NS_OBJ, "array_position")));
+            field.setIsVirtual("true".equals(reader.getAttributeValue(OILS_NS_PERSIST, "virtual")));
+            current.addField(field);
+        }
+
+        if( "link".equals(localpart) ) {
+            IDLLink link = new IDLLink();
+            link.setField(reader.getAttributeValue(null, "field"));
+            link.setReltype(reader.getAttributeValue(null, "reltype"));
+            link.setKey(reader.getAttributeValue(null, "key"));
+            link.setMap(reader.getAttributeValue(null, "map"));
+            link.setIDLClass(reader.getAttributeValue(null, "class"));
+            current.addLink(link);
+        }
+    }
+
+    public void handleEndElement(XMLStreamReader reader) {
+
+        if(!OILS_NS_BASE.equals(reader.getNamespaceURI())) return;
+        String localpart = reader.getLocalName();
+
+        if("class".equals(localpart)) {
+
+            if(keepIDLObjects)
+                IDLObjects.put(current.getIDLClass(), current);
+
+            HashMap fields = current.getFields();
+            String fieldNames[] = new String[fields.size()];
+
+            for(Iterator itr = fields.keySet().iterator(); itr.hasNext(); ) {
+                String key = (String) itr.next();
+                IDLField field = (IDLField) fields.get(key);
+                fieldNames[ field.getArrayPos() ] = field.getName();
+            }
+
+            OSRFRegistry.registerObject(
+                current.getIDLClass(), OSRFRegistry.WireProtocol.ARRAY, fieldNames);
+
+            current = null;
+        }
+    }
+
+
+    public String toXML() {
+        StringBuffer sb = new StringBuffer();
+        Set keys = IDLObjects.keySet();
+        Iterator itr = IDLObjects.keySet().iterator();
+        String IDLClass;
+        IDLObject obj;
+        while(itr.hasNext()) {
+            IDLClass = (String) itr.next();
+            obj = IDLObjects.get(IDLClass);
+            obj.toXML(sb);
+        }
+        return sb.toString();
+    }
+}
+
+
+
+
+
+
diff --git a/Open-ILS/src/java/org/open_ils/test/TestIDL.java b/Open-ILS/src/java/org/open_ils/test/TestIDL.java
new file mode 100644 (file)
index 0000000..e32ba8b
--- /dev/null
@@ -0,0 +1,11 @@
+package org.open_ils.test;
+import org.open_ils.idl.*;
+
+public class TestIDL {
+    public static void main(String args[]) throws Exception {
+        String idlFile = args[0];
+        IDLParser parser = new IDLParser(idlFile);
+        parser.parse();
+        System.out.print(parser.toXML());
+    }
+}
index b7d7e46..12a3789 100644 (file)
@@ -1355,7 +1355,7 @@ sub _find_highest_perm_org {
        my ( $perm, $userid, $start_org, $org_tree ) = @_;
        my $org = $apputils->find_org($org_tree, $start_org );
 
-       my $lastid = undef;
+       my $lastid = -1;
        while( $org ) {
                last if ($apputils->check_perms( $userid, $org->id, $perm )); # perm failed
                $lastid = $org->id;
index c17c883..c57f9a6 100644 (file)
@@ -416,7 +416,8 @@ sub set_circ_claims_returned {
     my $barcode = $$args{barcode};
     my $backdate = $$args{backdate};
 
-    $logger->info("marking circ for item $barcode as claims returned");
+    $logger->info("marking circ for item $barcode as claims returned".
+        (($backdate) ? " with backdate $backdate" : ''));
 
     my $copy = $e->search_asset_copy({barcode=>$barcode, deleted=>'f'})->[0] 
         or return $e->die_event;
@@ -430,7 +431,6 @@ sub set_circ_claims_returned {
 
     $circ->stop_fines(OILS_STOP_FINES_CLAIMSRETURNED);
        $circ->stop_fines_time('now') unless $circ->stop_fines_time;
-    $e->update_action_circulation($circ) or return $e->die_event;
 
     if( $backdate ) {
         # make it look like the circ stopped at the cliams returned time
@@ -439,6 +439,7 @@ sub set_circ_claims_returned {
         return $evt if $evt;
     }
 
+    $e->update_action_circulation($circ) or return $e->die_event;
     $e->commit;
     return 1;
 }
index 89812c7..ff3ad4e 100644 (file)
@@ -317,33 +317,34 @@ __PACKAGE__->register_method(
 );
 
 
+# start_date and end_date are optional endpoints for the transit creation date
 sub transits_by_lib {
-       my( $self, $conn, $auth, $orgid ) = @_;
+       my( $self, $conn, $auth, $orgid, $start_date, $end_date ) = @_;
        my $e = new_editor(authtoken=>$auth);
        return $e->event unless $e->checkauth;
        return $e->event unless $e->allowed('VIEW_CIRCULATIONS'); # eh.. basically the same permission
 
-       my $tos = $e->search_action_transit_copy(
-               [{
-                       dest => $orgid,
-                       dest_recv_time => undef,
-               },
-               {
-                       order_by => { atc => 'source_send_time' }
-               }],
-               { idlist => 1 }
-       );
-
-       my $froms = $e->search_action_transit_copy(
-               [{
-                       source => $orgid,
-                       dest_recv_time => undef,
-               },
-               {
-                       order_by => { atc => 'source_send_time' }
-               }],
-               { idlist => 1 }
-       );
+    my $order_by = {order_by => { atc => 'source_send_time' }};
+    my $search = { dest_recv_time => undef };
+
+    if($end_date) {
+        if($start_date) {
+            $search->{source_send_time} = {between => [$start_date, $end_date]};
+        } else {
+            $search->{source_send_time} = {'<=' => $end_date};
+        }
+    } elsif($start_date) {
+        $search->{source_send_time} = {'>=' => $start_date};
+    }
+
+    $search->{dest} = $orgid;
+
+       my $tos = $e->search_action_transit_copy([ $search, $order_by ], {idlist=>1});
+
+    delete $$search{dest};
+    $search->{source} = $orgid;
+
+       my $froms = $e->search_action_transit_copy([ $search, $order_by ], {idlist=>1});
 
        return { from => $froms, to => $tos };
 }
index 06c9952..71bc3ae 100755 (executable)
@@ -2,7 +2,7 @@ package OpenILS::Application::Search::Z3950;
 use strict; use warnings;
 use base qw/OpenSRF::Application/;
 
-use Net::Z3950;
+use OpenILS::Utils::ZClient;
 use MARC::Record;
 use MARC::File::XML;
 use Unicode::Normalize;
@@ -163,7 +163,7 @@ sub do_search {
        return $editor->event unless $editor->checkauth;
        return $editor->event unless $editor->allowed('REMOTE_Z3950_QUERY');
 
-       my $connection = new Net::Z3950::Connection(
+       my $connection = OpenILS::Utils::ZClient->new(
                $host, $port,
                databaseName                            => $db, 
                user                                                    => $username,
@@ -184,7 +184,7 @@ sub do_search {
        $logger->info("z3950: query => $query");
 
        try {
-               $results = $connection->search( $query );
+               $results = $connection->search_pqf( $query );
        } catch Error with { $err = shift; };
 
        return OpenILS::Event->new(
@@ -220,11 +220,10 @@ sub process_results {
        $logger->info("z3950: search returned $count hits");
 
        my $tend = $limit + $offset;
-       $offset++; # records start at 1
 
        my $end = ($tend <= $count) ? $tend : $count;
 
-       for($offset..$end) {
+       for($offset..$end - 1) {
 
                my $err;
                my $mods;
@@ -237,7 +236,7 @@ sub process_results {
                try {
 
                        my $rec = $results->record($_);
-                       $marc           = MARC::Record->new_from_usmarc($rec->rawdata());
+                       $marc           = MARC::Record->new_from_usmarc($rec->raw());
                        $marcs  = entityize($marc->as_xml_record);
                        my $doc = XML::LibXML->new->parse_string($marcs);
                        $marcxml = entityize( $doc->documentElement->toString );
@@ -287,7 +286,7 @@ sub compile_query {
 #                      $services{$service}->{attrs}->{$_}->{code} . " \"" . $$hash{$_} . "\" ";                
         $str .= 
             '@attr 1=' . $services{$service}->{attrs}->{$_}->{code} . # add the use attribute
-            ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format} . # add teh structure attribute
+            ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format} . # add the structure attribute
             " \"" . $$hash{$_} . "\" "; # add the search term
        }
        return $str;
index 37613d0..916a23b 100644 (file)
@@ -1008,6 +1008,8 @@ sub oISBN {
        my $client = shift;
        my $isbn = shift;
 
+       $isbn =~ s/-//gso;
+
        throw OpenSRF::EX::InvalidArg ('I need an ISBN please')
                unless (length($isbn) >= 10);
 
diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/ZClient.pm b/Open-ILS/src/perlmods/OpenILS/Utils/ZClient.pm
new file mode 100644 (file)
index 0000000..137d1c5
--- /dev/null
@@ -0,0 +1,134 @@
+package OpenILS::Utils::ZClient;
+use UNIVERSAL::require;
+
+use overload 'bool' => sub { return $_[0]->{connection} ? 1 : 0 };
+
+our $conn_class = 'ZOOM::Connection';
+our $imp_class = 'ZOOM';
+our $AUTOLOAD;
+
+# Detect the installed z client, prefering ZOOM.
+if (!$imp_class->use()) {
+
+       $imp_class = 'Net::Z3950';  # Try Net::Z3950
+       if ($imp_class->use()) {
+
+               # Tell 'new' how to build the connection
+               $conn_class = 'Net::Z3950::Connection';
+               
+       } else {
+               die "Cannot load a z39.50 client implementation!  Please install either ZOOM or Net::Z3950.\n";
+       }
+}
+
+# 'new' is called thusly:
+#  my $conn = OpenILS::Utils::ZClient->new( $host, $port, databaseName => $db, user => $username )
+
+sub new {
+       my $class = shift();
+       my @args = @_;
+
+       if ($class ne __PACKAGE__) { # NOT called OO-ishly
+               # put the first param back if called like OpenILS::Utils::ZClient::new()
+               unshift @args, $class;
+       }
+
+       return bless { connection => $conn_class->new(@_) } => __PACKAGE__;
+}
+
+sub search {
+       my $self = shift;
+       my $r =  $imp_class eq 'Net::Z3950' ?
+               $self->{connection}->search( @_ ) :
+               $self->{connection}->search_pqf( @_ );
+
+       return OpenILS::Utils::ZClient::ResultSet->new( $r );
+}
+
+*{__PACKAGE__ . '::search_pqf'} = \&search; 
+
+sub AUTOLOAD {
+       my $self = shift;
+
+       my $method = $AUTOLOAD;
+       $method =~ s/.*://;   # strip fully-qualified portion
+
+       return $self->{connection}->$method( @_ );
+}
+
+#-------------------------------------------------------------------------------
+package OpenILS::Utils::ZClient::ResultSet;
+
+our $AUTOLOAD;
+
+sub new {
+       my $class = shift;
+       my @args = @_;
+
+       if ($class ne __PACKAGE__) { # NOT called OO-ishly
+               # put the first param back if called like OpenILS::Utils::ZClient::ResultSet::new()
+               unshift @args, $class;
+       }
+
+
+       return bless { result => $args[0] } => __PACKAGE__;
+}
+
+sub record {
+       my $self = shift;
+       my $offset = shift;
+       my $r = $imp_class eq 'Net::Z3950' ?
+               $self->{result}->record( ++$offset ) :
+               $self->{result}->record( $offset );
+
+       return  OpenILS::Utils::ZClient::Record->new( $r );
+}
+
+sub AUTOLOAD {
+       my $self = shift;
+
+       my $method = $AUTOLOAD;
+       $method =~ s/.*://;   # strip fully-qualified portion
+
+       return $self->{result}->$method( @_ );
+}
+
+#-------------------------------------------------------------------------------
+package OpenILS::Utils::ZClient::Record;
+
+our $AUTOLOAD;
+
+sub new {
+       my $class = shift;
+       my @args = @_;
+
+       if ($class ne __PACKAGE__) { # NOT called OO-ishly
+               # put the first param back if called like OpenILS::Utils::ZClient::ResultSet::new()
+               unshift @args, $class;
+       }
+
+
+       return bless { record => shift() } => __PACKAGE__;
+}
+
+sub rawdata {
+       my $self = shift;
+       return $OpenILS::Utils::ZClient::imp_class eq 'Net::Z3950' ?
+               $self->{record}->rawdata( @_ ) :
+               $self->{record}->raw( @_ );
+}
+
+*{__PACKAGE__ . '::raw'} = \&rawdata; 
+
+sub AUTOLOAD {
+       my $self = shift;
+
+       my $method = $AUTOLOAD;
+       $method =~ s/.*://;   # strip fully-qualified portion
+
+       return $self->{record}->$method( @_ );
+}
+
+
+1;
+
index f9d8188..c2b589d 100644 (file)
@@ -15,7 +15,7 @@
 
 
 OILS_NS_OBJ='http://open-ils.org/spec/opensrf/IDL/objects/v1'
-OILS_NS_PERSIST='http://open-ils.org/spec/opensrf/IDL/persistance/v1'
+OILS_NS_PERSIST='http://open-ils.org/spec/opensrf/IDL/persistence/v1'
 OILS_NS_REPORTER='http://open-ils.org/spec/opensrf/IDL/reporter/v1'
 
 OILS_APP_CSTORE='open-ils.cstore'
index 7a7fa1e..ce44604 100644 (file)
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from osrf.json import *
+from osrf.net_obj import osrfNetworkRegisterHint
 from osrf.log import *
 from osrf.set import osrfSettingsValue
 
-import sys, libxml2, osrf.conf, string
+import sys, string, xml.dom.minidom
 from oils.const import OILS_NS_OBJ, OILS_NS_PERSIST, OILS_NS_REPORTER
 
 __global_parser = None
 
 def oilsParseIDL():
-       global __global_parser
-       idlParser = oilsIDLParser();
-       idlParser.setIDL(osrfSettingsValue('IDL'))
-       idlParser.parseIDL()
-       __global_parser = idlParser
+    global __global_parser
+    idlParser = oilsIDLParser();
+    idlParser.setIDL(osrfSettingsValue('IDL'))
+    idlParser.parseIDL()
+    __global_parser = idlParser
 
 def oilsGetIDLParser():
-       global __global_parser
-       return __global_parser
+    global __global_parser
+    return __global_parser
 
 class oilsIDLParser(object):
 
-       def __init__(self):
-               self.IDLObject = {}
+    def __init__(self):
+        self.IDLObject = {}
 
-       def setIDL(self, file):
-               osrfLogInfo("setting IDL file to " + file)
-               self.idlFile = file
+    def setIDL(self, file):
+        osrfLogInfo("setting IDL file to " + file)
+        self.idlFile = file
 
-       def parseIDL(self):
-               """Parses the IDL file and builds class objects"""
+    def __getAttr(self, node, name, ns=None):
+        """ Find the attribute value on a given node 
+            Namespace is ignored for now.. 
+            not sure if minidom has namespace support.
+            """
+        for (k, v) in node.attributes.items():
+            if k == name:
+                return v
+        return None
 
-               doc     = libxml2.parseFile(self.idlFile)
-               root    = doc.children
-               child = root.children
+    def parseIDL(self):
+        """Parses the IDL file and builds class objects"""
 
-               while child:
-               
-                       if child.type == 'element':
-               
-                               # -----------------------------------------------------------------------
-                               # 'child' is the main class node for a fieldmapper class.
-                               # It has 'fields' and 'links' nodes as children.
-                               # -----------------------------------------------------------------------
+        doc = xml.dom.minidom.parse(self.idlFile)
+        root = doc.childNodes[0]
 
-                               id = child.prop('id')
-                               self.IDLObject[id] = {}
-                               obj = self.IDLObject[id]
-                               obj['fields'] = []
+        for child in root.childNodes:
+        
+            if child.nodeType == child.ELEMENT_NODE:
+        
+                # -----------------------------------------------------------------------
+                # 'child' is the main class node for a fieldmapper class.
+                # It has 'fields' and 'links' nodes as children.
+                # -----------------------------------------------------------------------
 
-                               obj['controller'] = child.prop('controller')
-                               obj['fieldmapper'] = child.nsProp('fieldmapper', OILS_NS_OBJ)
-                               obj['virtual'] = child.nsProp('virtual', OILS_NS_PERSIST)
-                               obj['rpt_label'] = child.nsProp('label', OILS_NS_REPORTER)
+                id = self.__getAttr(child, 'id')
+                self.IDLObject[id] = {}
+                obj = self.IDLObject[id]
+                obj['fields'] = []
 
-                               class_node = child.children
-                               #osrfLogInternal("parseIDL(): parsing class %s" % id)
-               
-                               keys = []
-                               while class_node:
-                                       if class_node.type == 'element':
-                                               if class_node.name == 'fields':
-                                                       keys = self.parseFields(id, class_node)
-                                       class_node = class_node.next
+                obj['controller'] = self.__getAttr(child, 'controller')
+                obj['fieldmapper'] = self.__getAttr(child, 'oils_obj:fieldmapper', OILS_NS_OBJ)
+                obj['virtual'] = self.__getAttr(child, 'oils_perist:virtual', OILS_NS_PERSIST)
+                obj['rpt_label'] = self.__getAttr(child, 'reporter:label', OILS_NS_REPORTER)
 
-                               #obj['fields'] = keys
-                               osrfNetworkRegisterHint(id, keys, 'array' )
+                keys = []
+                for classNode in child.childNodes:
+                    if classNode.nodeType == classNode.ELEMENT_NODE:
+                        if classNode.nodeName == 'fields':
+                            keys = self.parseFields(id, classNode)
 
-                       child = child.next
+                osrfNetworkRegisterHint(id, keys, 'array' )
 
-               doc.freeDoc()
+        doc.unlink()
 
 
-       def parseFields(self, cls, fields):
-               """Takes the fields node and parses the included field elements"""
+    def parseFields(self, cls, fields):
+        """Takes the fields node and parses the included field elements"""
 
-               field = fields.children
-               keys = []
-               idlobj = self.IDLObject[cls]
+        keys = []
+        idlobj = self.IDLObject[cls]
 
-               while field:
-                       if field.type == 'element':
-                               keys.append(None)
-                       field = field.next
-               
-               field = fields.children
-               while field:
-                       obj = {}
-                       if field.type == 'element':
-                               name                    = field.prop('name')
-                               position                = int(field.nsProp('array_position', OILS_NS_OBJ))
-                               obj['name'] = name
+        for field in fields.childNodes:
+            if field.nodeType == field.ELEMENT_NODE:
+                keys.append(None)
+        
+        for field in fields.childNodes:
+            obj = {}
+            if field.nodeType == fields.ELEMENT_NODE:
+                name            = self.__getAttr(field, 'name')
+                position        = int(self.__getAttr(field, 'oils_obj:array_position', OILS_NS_OBJ))
+                obj['name'] = name
 
-                               try:
-                                       keys[position] = name
-                               except Exception, e:
-                                       osrfLogErr("parseFields(): position out of range.  pos=%d : key-size=%d" % (position, len(keys)))
-                                       raise e
+                try:
+                    keys[position] = name
+                except Exception, e:
+                    osrfLogErr("parseFields(): position out of range.  pos=%d : key-size=%d" % (position, len(keys)))
+                    raise e
 
-                               virtual = field.nsProp('virtual', OILS_NS_PERSIST)
-                               obj['rpt_label']        = field.nsProp('label', OILS_NS_REPORTER)
-                               obj['rpt_dtype']        = field.nsProp('datatype', OILS_NS_REPORTER)
-                               obj['rpt_select']       = field.nsProp('selector', OILS_NS_REPORTER)
+                virtual = self.__getAttr(field, 'virtual', OILS_NS_PERSIST)
+                obj['rpt_label']    = self.__getAttr(field, 'reporter:label', OILS_NS_REPORTER)
+                obj['rpt_dtype']    = self.__getAttr(field, 'reporter:datatype', OILS_NS_REPORTER)
+                obj['rpt_select']   = self.__getAttr(field, 'reporter:selector', OILS_NS_REPORTER)
 
-                               if virtual == string.lower('true'):
-                                       obj['virtual']  = True
-                               else:
-                                       obj['virtual']  = False
+                if virtual == string.lower('true'):
+                    obj['virtual']  = True
+                else:
+                    obj['virtual']  = False
 
-                               idlobj['fields'].append(obj)
+                idlobj['fields'].append(obj)
 
-                       field = field.next
+        return keys
 
-               return keys
 
 
-
-       
+    
index 88934fc..2e80293 100644 (file)
@@ -1,3 +1,21 @@
+CREATE OR REPLACE FUNCTION public.non_filing_normalize ( TEXT, "char" ) RETURNS TEXT AS $$
+        SELECT  SUBSTRING(
+                        REGEXP_REPLACE(
+                                REGEXP_REPLACE(
+                                        $1,
+                                        '\\W*$',
+                                       ''
+                               ),
+                                '  ',
+                                ' '
+                        ),
+                        CASE
+                               WHEN $2::INT NOT BETWEEN 48 AND 57 THEN 1
+                               ELSE $2::TEXT::INT + 1
+                       END
+               );
+$$ LANGUAGE SQL STRICT IMMUTABLE;
+
 CREATE OR REPLACE FUNCTION public.call_number_dewey( TEXT ) RETURNS TEXT AS $$
        my $txt = shift;
        $txt =~ s/^\s+//o;
index 1db674f..809a0c3 100755 (executable)
@@ -52,8 +52,10 @@ sub containers_create {
                my $bucket = "Fieldmapper::container::" . $types{$type};
                $bucket = $bucket->new;
                $bucket->owner($user->id);
-               $bucket->name("TestBucket");
-               $bucket->btype("TestType");
+               $bucket->name("TestBucket123");
+               $bucket->btype("TestType123");
+
+        printl("creating bucket " .$bucket->owner." : " . $bucket->name . " : " . $bucket->btype);
        
                my $resp = simplereq($ACTOR, 
                        'open-ils.actor.container.create',
index 0e045b2..4f21b97 100644 (file)
@@ -1,8 +1,6 @@
 //var XML_HTTP_GATEWAY = "gateway2";
 var XML_HTTP_GATEWAY;
 var XML_HTTP_SERVER = "";
-var XML_HTTP_MAX_TRIES = 3;
-
 
 
 
@@ -20,25 +18,12 @@ NetworkFailure.prototype.toString = function() {
 
 
 
-//var IAMXUL = false;
 function isXUL() { try { if(IAMXUL) return true;}catch(e){return false;}; }
 
-
 if(isXUL())
     XML_HTTP_GATEWAY = "gateway";
 else XML_HTTP_GATEWAY = "gateway2";
 
-/* some communication exceptions */
-function EX(message) { this.init(message); }
-EX.prototype.init = function(message) { this.message = message; }
-EX.prototype.toString = function() { return "\n *** Exception Occured \n" + this.message; }  
-EXCommunication.prototype              = new EX();
-EXCommunication.prototype.constructor  = EXCommunication;
-EXCommunication.baseClass              = EX.prototype.constructor;
-function EXCommunication(message) { this.classname="EXCommunication"; this.init("EXCommunication: " + message); }                          
-/* ------------------------------------------------ */
-
-
 var _allrequests = {};
 
 function cleanRemoteRequests() {
@@ -71,6 +56,7 @@ function destroyRequest(r) {
 
 /* ----------------------------------------------------------------------- */
 /* Request object */
+var rrId = 0;
 function RemoteRequest( service, method ) {
 
 
@@ -78,11 +64,10 @@ function RemoteRequest( service, method ) {
        this.method             = method;
        this.xmlhttp    = false;
        this.name               = null;
-       this.sendCount = 0;
        this.alertEvent = true; /* only used when isXUL is false */
 
        this.type               = "POST"; /* default */
-       this.id                 = service + method + Math.random();
+       this.id                 = rrId++;
        this.cancelled = false;
 
        this.setSecure(false);
@@ -148,25 +133,20 @@ RemoteRequest.prototype.buildXMLRequest = function() {
 
 
 function buildXMLRequest() {
-       var x;
-       try { 
-               x = new ActiveXObject("Msxml2.XMLHTTP"); 
-       } catch (e) {
-               try { 
-                       x = new ActiveXObject("Microsoft.XMLHTTP"); 
-               } catch (E) {
-                       x = false;
-               }
-       }
-
-       if (!x && typeof XMLHttpRequest!='undefined') x = new XMLHttpRequest();
-
-       if(!x) {
-               alert("NEEDS NEWER JAVASCRIPT for XMLHTTPRequest()");
-               return null;
-       }
-
-       return x;
+    try {
+           return new XMLHttpRequest();
+    } catch(e) {
+           try { 
+                   return new ActiveXObject("Msxml2.XMLHTTP"); 
+           } catch (e2) {
+                   try { 
+                           return new ActiveXObject("Microsoft.XMLHTTP"); 
+                   } catch (e3) {
+                       alert("NEEDS NEWER JAVASCRIPT for XMLHTTPRequest()");
+                return null;
+                   }
+           }
+    }
 }
 
 
@@ -176,27 +156,16 @@ function _remoteRequestCallback(id) {
        if(object.cancelled) return;
 
        if( object.xmlhttp.readyState == 4 ) {
+
+        try {
+            object.duration = new Date().getTime() - object.sendTime;
+            dump('request ' + object.id + ': duration = ' + object.duration + ' ms\n');
+        } catch(ee){}
+
                try {
                        object.callback(object);
                } catch(E) {
-
-                       /* if we receive a communication error, retry the request up
-                               to XML_HTTP_MAX_TRIES attempts */
-                       if( E && E.classname == "EXCommunication" ) {
-
-                               //try { dump('Communication Error: ' + E ); } catch(e){}
-                               alert('Debug:  Communication Error: ' + E );
-
-                               if(object.sendCount >= XML_HTTP_MAX_TRIES ) {
-                                       if(isXUL()) throw object;
-                                        else alert("Arrrgghh, Matey! Error communicating:\n" + E  + "\n" + object.param_string);
-                               } else {
-                                       object.buildXMLRequest();
-                                       object.send();
-                                       return;
-                               }
-                       } else { throw E; }
-
+            throw E
                } finally { 
                        destroyRequest(object); 
                        object = null; 
@@ -278,9 +247,9 @@ RemoteRequest.prototype.send = function(blocking) {
        }
 
 
+    this.sendTime = new Date().getTime();
        try{ this.xmlhttp.send( data ); } catch(e){}
 
-       this.sendCount += 1;
        return this;
 }
 
diff --git a/Open-ILS/web/opac/images/eg_tiny_logo.jpg b/Open-ILS/web/opac/images/eg_tiny_logo.jpg
new file mode 100644 (file)
index 0000000..a570a37
Binary files /dev/null and b/Open-ILS/web/opac/images/eg_tiny_logo.jpg differ
diff --git a/Open-ILS/web/opac/locale/en-US/common.dtd b/Open-ILS/web/opac/locale/en-US/common.dtd
deleted file mode 100644 (file)
index 391cb72..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!ENTITY lang.version "remote v1">
-<!ENTITY lang.description "English">
-<!ENTITY lang.author "PINES">
-<!ENTITY common.title "Title">
-<!ENTITY common.author "Author">
-<!ENTITY common.subject "Subject">
-<!ENTITY common.series "Series">
-<!ENTITY common.keyword "Keyword">
-<!ENTITY common.type "Search Type">
-<!ENTITY common.isbn "ISBN">
-<!ENTITY common.format "Format">
-<!ENTITY common.login "Login">
-<!ENTITY common.logout "Log Out">
-<!ENTITY common.at "at">
-<!ENTITY common.of "of">
-<!ENTITY common.cancel "Cancel">
-<!ENTITY common.library "Library">
-<!ENTITY common.username "Username">
-<!ENTITY common.password "Password">
-<!ENTITY common.submit "Submit">
-<!ENTITY common.and "and">
-<!ENTITY common.user_not_found "User not found">
index e5eb88a..e5d58fa 100644 (file)
@@ -4,25 +4,40 @@
 <!ENTITY lang.version "remote v1">
 <!ENTITY lang.description "English">
 <!ENTITY lang.author "PINES">
+<!ENTITY common.currency "$">
+<!ENTITY common.name "Name">
 <!ENTITY common.title "Title">
 <!ENTITY common.author "Author">
+<!ENTITY common.authors "Authors">
+<!ENTITY common.callnumber "Call Number">
+<!ENTITY common.edition "Edition">
 <!ENTITY common.subject "Subject">
 <!ENTITY common.series "Series">
 <!ENTITY common.keyword "Keyword">
 <!ENTITY common.type "Search Type">
 <!ENTITY common.isbn "ISBN">
 <!ENTITY common.format "Format">
+<!ENTITY common.loading "Loading..."> <!-- Message displayed while search results are loading -->
 <!ENTITY common.login "Login">
 <!ENTITY common.logout "Log Out">
+<!ENTITY common.physical "Physical Description">
+<!ENTITY common.pubdate "Publication Date">
+<!ENTITY common.publisher "Publisher">
+<!ENTITY common.results "Results">
+<!ENTITY common.status "Status">
 <!ENTITY common.at "at">
 <!ENTITY common.of "of">
+<!ENTITY common.no "No">
+<!ENTITY common.yes "Yes">
 <!ENTITY common.cancel "Cancel">
 <!ENTITY common.library "Library">
 <!ENTITY common.username "Username">
 <!ENTITY common.password "Password">
 <!ENTITY common.submit "Submit">
+<!ENTITY common.close "close">
 <!ENTITY common.and "and">
-<!ENTITY common.user_not_found "User not found"><!ENTITY opac.advanced.wizard.title "Advanced Search">
+<!ENTITY common.user_not_found "User not found">
+<!ENTITY opac.advanced.wizard.title "Advanced Search">
 <!ENTITY common.nowSearching "Now searching ">
 <!ENTITY common.ofAtLeast " of at least ">
 <!ENTITY common.relevancy "Match Score: ">
@@ -36,6 +51,7 @@
 <!ENTITY common.org.note "Tip:">
 <!ENTITY common.org.notetext "Click on a location's name to select it.  Click on the folder icons to expand a section.">
 <!ENTITY opac.login.login "Login">
+<!ENTITY opac.basic "Basic Catalog (HTML only)">
 <!ENTITY common.password_criteria 
        "The password must be at least 7 characters in length, 
        contain at least one letter (a-z/A-Z), 
 <!ENTITY ilsevent.5000 "Permission Denied">
 <!ENTITY ilsperm.CREATE_HOLD "User is not allowed to create holds for other users at this location">
 
+<!--   ================================================================= 
+       common/pages
+       ================================================================= -->
+
+<!ENTITY common.cn.loading "Loading Callnumber Page...">
+<!ENTITY common.cn.browsing "You are now browsing">
+<!ENTITY common.cn.previous "&lt;&lt; Previous Page">
+<!ENTITY common.cn.shelf "Shelf Browser">
+<!ENTITY common.cn.next "Next Page &gt;&gt;">
 
+<!ENTITY common.textsize.title "Text Size: ">
+<!ENTITY common.textsize.regular "Regular">
+<!ENTITY common.textsize.separator "/"> <!-- Regular / Large -->
+<!ENTITY common.textsize.large "Large">
+
+<!ENTITY home.js.disabled "JavaScript must be enabled in order for you to use the regular Evergreen Catalog.
+However, it seems JavaScript is either disabled or not supported by your browser.
+To use the regular Evergreen Catalog, enable JavaScript by changing your browser options, then
+<a style='color: blue; text-decoration: underline;' href='/'>try again</a>.
+<br/><br/>Alternatively, you can use the basic HTML-only catalog
+<a style='color: blue; text-decoration: underline;' href='/opac/extras/slimpac/start.html'>here</a>.">
 
 <!--   ================================================================= 
-               Advanced Search Page 
-               ================================================================= -->
+        MyOPAC bookbag page
+       ================================================================= -->
+<!ENTITY myopac.delete.bookbag "This will remove the selected bookbag and all items contained within the bookbag.  
+Are you sure you wish to continue?">
+<!ENTITY myopac.no.bookbags "You have not created any bookbags">
+<!ENTITY myopac.bookbags.title "My Bookbags">
+<!ENTITY myopac.bookbag.items "# Items">
+<!ENTITY myopac.bookbag.shared "Shared">
+<!ENTITY myopac.bookbag.toggle "Share / Hide">
+<!ENTITY myopac.bookbag.delete "Delete this bookbag?">
+<!ENTITY myopac.items "Items">
+<!ENTITY myopac.view "(View)">
+<!ENTITY myopac.atom.feed "ATOM Feed">
+<!ENTITY myopac.bookbag.hide "Hide">
+<!ENTITY myopac.bookbag.share "Share">
+<!ENTITY myopac.delete "Delete">
+<!ENTITY myopac.bookbag.create "Create a new Bookbag">
+<!ENTITY myopac.bookbag.naming "Enter the name of the new Bookbag: ">
+<!ENTITY myopac.bookbag.share "Share this Bookbag">
+<!ENTITY myopac.bookbag.no.items "The selected bookbag contains no items...">
+<!ENTITY myopac.bookbag.remove "Remove this item?">
+<!ENTITY myopac.remove.link "remove">
+<!ENTITY myopac.publish.text 'Sharing a Bookbag means that the contents of the Bookbag will be visible to others.  
+To see the public view of a shared Bookbag, click the "View" link in the 
+"Shared" column of the Bookbag list at the top of this page.'>
+<!ENTITY myopac.item.confirm "Are you sure you wish to remove this bookbag item?">
+<!ENTITY myopac.publish.confirm "Sharing this bookbag will allow the contents 
+of the bookback to be seen by others.  Are you sure you wish to share this bookbag?">
+<!ENTITY myopac.unpublish.confirm "Are you sure you wish to hide this bookbag?">
+<!ENTITY myopac.update.success "The Bookbag was successfully updated.">
+<!ENTITY myopac.updated.success "Bookbag successfully updated">
+<!ENTITY myopac.create.warning "Warning: Adding items to a bookbag creates a link between you and the
+items in the database.  The contents of the bookbag are NOT publicly 
+viewable unless the bookbag is shared. However, if you prefer not to
+have any link between your patron record and a particular item or items,
+we suggest that you do not place said items in a bookbag or that you 
+avoid using bookbags all together.  Thank you.">
+<!ENTITY myopac.describe.bookbags "Bookbags are...">
+
+<!--   ================================================================= 
+       MyOPAC Fines Page 
+       ================================================================= -->
+<!ENTITY myopac.fines.title "Summary">
+<!ENTITY myopac.fines.owed "Total Owed">
+<!ENTITY myopac.fines.paid "Total Paid">
+<!ENTITY myopac.fines.balance "Balance Owed">
+<!ENTITY myopac.fines.status "Loading...">
+<!ENTITY myopac.fines.overdue "Overdue Materials">
+<!ENTITY myopac.fines.checkout "Checkout Date">
+<!ENTITY myopac.fines.due "Due Date">
+<!ENTITY myopac.fines.returned "Date Returned">
+<!ENTITY myopac.fines.accruing "(fines accruing)">
+<!ENTITY myopac.fines.other "Other Fees">
+<!ENTITY myopac.fines.time.start "Transaction Start Time">
+<!ENTITY myopac.fines.time.paid "Last Payment Time">
+<!ENTITY myopac.fines.owed.initial "Initial Amount Owed">
+<!ENTITY myopac.fines.paid.amount "Total Amount Paid">
+<!ENTITY myopac.fines.type "Billing Type">
+
+<!--   ================================================================= 
+       MyOPAC Holds Page 
+       ================================================================= -->
+<!ENTITY myopac.holds.formats "Formats">
+<!ENTITY myopac.holds.location "Pickup Location">
+<!ENTITY myopac.holds.edit.cancel "Edit/Cancel">
+<!ENTITY myopac.holds.status.none "You have no items on hold at this time">
+<!ENTITY myopac.holds.status.waiting "Waiting for copy">
+<!ENTITY myopac.holds.status.intransit "In Transit">
+<!ENTITY myopac.holds.status.available "Ready for Pickup">
+<!ENTITY myopac.holds.edit "Edit">
+<!ENTITY myopac.holds.cancel "Cancel">
+<!ENTITY myopac.holds.verify "If you wish to cancel the selected hold, click OK, otherwise click Cancel.">
+
+<!--   ================================================================= 
+       MyOPAC Preferences Page 
+       ================================================================= -->
+<!ENTITY myopac.prefs.title "Preferences">
+<!ENTITY myopac.prefs.hits "Search hits per page">
+<!ENTITY myopac.prefs.font "Default Font Size">
+<!ENTITY myopac.prefs.font.regular "Regular Font">
+<!ENTITY myopac.prefs.font.large "Large Font">
+<!ENTITY myopac.prefs.holds.notify "Default Hold Notification Method">
+<!ENTITY myopac.prefs.holds.both "Use Phone and Email">
+<!ENTITY myopac.prefs.holds.phone "Use Phone Only">
+<!ENTITY myopac.prefs.holds.email "Use Email Only">
+<!ENTITY myopac.prefs.search.location "Default Search Location">
+<!ENTITY myopac.prefs.search.home "Always search my home library by default.">
+<!ENTITY myopac.prefs.search.range "Default Search Range">
+<!ENTITY myopac.prefs.save "Save Preference Changes">
+<!ENTITY myopac.prefs.save.success "Preferences successfully updated">
+<!ENTITY myopac.prefs.save.failed "Preferences update failed!">
+<!ENTITY myopac.prefs.help "This setting defines how you will be notified of holds that are ready to be picked up from the library.
+By default, holds will use the notification style you choose here.  
+However, you will still have the option to change individual holds regardless of this setting.">
+
+<!--   ================================================================= 
+        MyOPAC Summary page
+       ================================================================= -->
+<!ENTITY myopac.summary.expired "Your account expired on <span id='myopac.expired.date'/>!  
+Please see a librarian to renew your account.">
+<!ENTITY myopac.summary.notes "* Staff Notes *">
+<!ENTITY myopac.summary.phone.day "Day Phone">
+<!ENTITY myopac.summary.phone.evening "Evening Phone">
+<!ENTITY myopac.summary.phone.other "Other Phone">
+<!ENTITY myopac.summary.change "Change">
+<!ENTITY myopac.summary.username.enter "Enter new username:">
+<!ENTITY myopac.summary.password.text "(not shown)">
+<!ENTITY myopac.summary.password.current "Enter current password:">
+<!ENTITY myopac.summary.password.new "Enter new password:">
+<!ENTITY myopac.summary.password.reenter "Re-enter new password:">
+<!ENTITY myopac.summary.email "Email Address">
+<!ENTITY myopac.summary.email.new "Enter new email address:">
+<!ENTITY myopac.summary.id.primary "Primary Identification">
+<!ENTITY myopac.summary.barcode "Active Barcode">
+<!ENTITY myopac.summary.home "Home Library">
+<!ENTITY myopac.summary.genesis "Account Creation Date">
+<!ENTITY myopac.summary.addresses "Addresses">
+<!ENTITY myopac.summary.address.type "Address Type">
+<!ENTITY myopac.summary.address.street "Street">
+<!ENTITY myopac.summary.address.city "City">
+<!ENTITY myopac.summary.address.county "County">
+<!ENTITY myopac.summary.address.state "State">
+<!ENTITY myopac.summary.address.zip "Zip">
+<!ENTITY myopac.summary.username.error "Please enter a username">
+<!ENTITY myopac.summary.username.dup "The requested username is not available.  Please choose a different username.">
+<!ENTITY myopac.summary.username.success "Username successfully updated">
+<!ENTITY myopac.summary.username.failure "Username update failed">
+<!ENTITY myopac.summary.username.invalid "Username cannot contain spaces">
+<!ENTITY myopac.summary.email.error "Please enter a valid email address">
+<!ENTITY myopac.summary.email.success "Email address successfully updated">
+<!ENTITY myopac.summary.email.failed "Email address update failed">
+<!ENTITY myopac.summary.password.error "Passwords are empty or do not match">
+<!ENTITY myopac.summary.password.success "Password successfully updated">
+<!ENTITY myopac.summary.password.failure "Password update failed">
+
+<!--   ================================================================= 
+       Advanced Search Page 
+       ================================================================= -->
 <!ENTITY opac.advanced.wizard.contains "Selected field contains the following words">
 <!ENTITY opac.advanced.wizard.nocontains "Selected field does <u>not</u> contain the following words">
 <!ENTITY opac.advanced.wizard.exact "Selected field contains the <u>exact</u> phrase">
 <!ENTITY opac.advanced.quick.title "Quick Search">
 <!ENTITY opac.advanced.quick.isbn "ISBN">
 <!ENTITY opac.advanced.quick.issn "ISSN">
+<!ENTITY opac.advanced.quick.lccn "LCCN"> 
+<!ENTITY opac.advanced.quick.tcn "TCN"> <!-- title control number -->
+<!ENTITY opac.advanced.quick.barcode "Item Barcode"> 
+<!ENTITY opac.advanced.quick.cn "Call Number"> 
+
+<!-- ==========================================================
+     MARC expert search
+     ========================================================== -->
+<!ENTITY search.marc "MARC Expert Search">
+<!ENTITY search.marc.tag "Tag:">
+<!ENTITY search.marc.subfield "Subfield:">
+<!ENTITY search.marc.value "Value:">
+<!ENTITY search.marc.add.row "Add Row">
+
+<!-- ==========================================================
+     Status bar
+     ========================================================== -->
 
+<!ENTITY status.results "Including results for">
+
+<!-- ==========================================================
+     Tips
+     ========================================================== -->
+
+<!ENTITY tips.label "Tip:">
 
 <!-- ================================================================= 
                More generic stuff 
 <!ENTITY navigate.loggedinas.title "Logged in as...">
 <!ENTITY navigate.titleGroupResults "My Search Results">
 <!ENTITY navigate.titleResults "My Title Results">
+<!ENTITY navigate.title.details "My Title Details">
+<!ENTITY navigate.record.details "Record Details">
 
+<!--   ================================================================= 
+       Footer
+       ================================================================= -->
+<!ENTITY footer.basic "Basic Catalog (HTML only)">
+<!ENTITY footer.find.library "Find a Library Near Me">
+<!ENTITY footer.find.url "http://www.georgialibraries.org/lib/directories/pineslibdir.html">
+<!ENTITY footer.help.url "http://open-ils.org/dokuwiki/doku.php?id=evergreen-user:opac_help">
+<!ENTITY footer.help "Help">
+<!ENTITY footer.library.url "http://www.georgialibraries.org/public/pines.html">
+<!ENTITY footer.library.about "About PINES">
+<!ENTITY footer.union.url "http://www.galileo.usg.edu/">
+<!ENTITY footer.union "GALILEO">
+<!ENTITY footer.copyright "Copyright &#xA9; 2006 Georgia Public Library Service">
+<!ENTITY footer.logo "Powered by"> <!-- Introduces the logo for the project -->
 
 <!--   ================================================================= 
-               Sidebar 
-               ================================================================= -->
+       My OPAC
+       ================================================================= -->
+<!ENTITY myopac.account "Account Summary">
+<!ENTITY myopac.checkouts "Items Checked Out">
+<!ENTITY myopac.holds "Items on Hold">
+<!ENTITY myopac.fines "Fines">
+<!ENTITY myopac.preferences "Account Preferences">
+<!ENTITY myopac.bookbags "My Bookbags">
+
+<!--   ================================================================= 
+       Sidebar 
+       ================================================================= -->
 <!ENTITY sidebar.relevantSubjects.headerLabel "Relevant Subjects">
 <!ENTITY sidebar.relevantAuthors.headerLabel "Relevant Authors">
 <!ENTITY sidebar.relevantSeries.headerLabel "Relevant Series">
 <!ENTITY sidebar.relevantReviews.headerLabel "Reviews">
+<!ENTITY sidebar.quick.search "Quick Search">
+<!ENTITY sidebar.copy.not.found "No copy with the requested barcode was found">
 
 <!--   ================================================================= 
                Search formats
 <!ENTITY opac.holds.recipient "Recipient">
 <!ENTITY opac.holds.placeHold "Place Hold">
 <!ENTITY opac.holds.contactPhone "Contact telephone number">
-<!ENTITY opac.holds.concactEmail "Contact email address">
+<!ENTITY opac.holds.contactEmail "Contact email address">
 <!ENTITY opac.holds.pickupLocation "Pickup location">
-<!ENTITY opac.holds.placeHold  "Place Hold">
 <!ENTITY opac.holds.success "Hold was successfully placed">
 <!ENTITY opac.holds.failure "Hold was not successfully placed">
+<!--   ================================================================= 
+       Advanced
+       ================================================================= -->
+<!ENTITY advanced.search.title "Search Input">
+<!ENTITY advanced.add.row "Add Search Row">
+<!ENTITY advanced.search.submit "Submit Search">
+<!ENTITY advanced.search.filters "Search Filters">
+<!ENTITY advanced.item.form "Item Form">
+<!ENTITY advanced.item.type "Item Type">
+<!ENTITY advanced.link "Advanced">
+<!ENTITY advanced.basic.link "Basic">
+<!ENTITY advanced.literary.form "Literary&nbsp;Form">
+<!ENTITY advanced.non.fiction "Non Fiction">
+<!ENTITY advanced.fiction "Fiction">
+<!ENTITY advanced.language "Language">
+<!ENTITY advanced.audience "Audience">
+<!ENTITY advanced.adult "Adult">
+<!ENTITY advanced.juvenile "Juvenile">
+<!ENTITY advanced.general "General">
+<!ENTITY advanced.sort.criteria "Sort Criteria">
+<!ENTITY advanced.search.library "Search Library">
+<!ENTITY advanced.relevance "Relevance">
+<!ENTITY advanced.pubdate "Publication date">
+<!ENTITY advanced.sort.asc "Ascending / A to Z">
+<!ENTITY advanced.sort.desc "Descending / Z to A">
+<!ENTITY advanced.frbrize "Group Formats and Editions">
+<!ENTITY advanced.go "Go">
 
+<!--   ================================================================= 
+       Rdetail
+       ================================================================= -->
+<!ENTITY rdetail.print "print these details">
+<!ENTITY rdetail.cn.barcode "Barcode">
+<!ENTITY rdetail.cn.location "Location">
+<!ENTITY rdetail.cn.hold.age "Age Hold Protection">
+<!ENTITY rdetail.cn.genesis "Create Date">
+<!ENTITY rdetail.cn.holdable "Holdable">
+<!ENTITY rdetail.cn.due "Due Date">
+<!ENTITY rdetail.cn.more "more info...">
+<!ENTITY rdetail.cn.less "less info">
+<!ENTITY rdetail.cn.hold "place hold">
+<!ENTITY rdetail.cn.disabled "- Disabled -">
+<!ENTITY rdetail.cn.note "Copy Note">
+<!ENTITY rdetail.cn.category "Copy Category">
+<!ENTITY rdetail.cn.print "Print Page">
+<!ENTITY rdetail.page.results "First results page">
+<!ENTITY rdetail.result "Result"> <!-- Result # &common.of; # -->
+<!ENTITY rdetail.start "Start">
+<!ENTITY rdetail.page.previous "Previous page">
+<!ENTITY rdetail.page.next "Next page">
+<!ENTITY rdetail.page.last "Last results page">
+<!ENTITY rdetail.end "End">
+<!ENTITY rdetail.more "More Actions...">
+<!ENTITY rdetail.bookbag.add "Add to bookbag">
+<!ENTITY rdetail.bookbag.create "Create a new bookbag">
+<!ENTITY rdetail.record.deleted "This record has been deleted from the database.
+We recommend that you remove this title from any bookbags it may have been added to.">
+<!ENTITY rdetail.none "(none)">
+<!ENTITY rdetail.bookbag.add.success "Item successfully added to bookbag">
+<!ENTITY rdetail.bookbag.name "Enter the name of the new bookbag">
+<!ENTITY rdetail.bookbag.create.success "Bookbag successfully created">
 <!ENTITY rdetail.detailMain.headerLabel "Record Summary">
-<!ENTITY rdetail.detailMain.title "Title">
-<!ENTITY rdetail.detailMain.author "Author">
-<!ENTITY rdetail.detailMain.isbn "ISBN">
-<!ENTITY rdetail.detailMain.edition "Edition">
-<!ENTITY rdetail.detailMain.pubdate "Publication Date">
-<!ENTITY rdetail.detailMain.publisher "Publisher">
-<!ENTITY rdetail.detailMain.tor "Format">
 <!ENTITY rdetail.detailMain.subjects "Subjects">
 <!ENTITY rdetail.detailMain.abstract "Abstract">
+<!ENTITY rdetail.detailMain.viewMarc "View MARC">
+<!ENTITY rdetail.detailMain.hideMarc "Return to title details">
+<!ENTITY rdetail.author.search "Perform an author search">
 <!ENTITY rdetail.copyInfo.headerLabel "Copy Information">
 <!ENTITY rdetail.copyInfo.library "Library">
 <!ENTITY rdetail.copyInfo.callnumber "Callnumber">
 <!ENTITY rdetail.copyInfo.local "View Copy Information for this location only">
 <!ENTITY rdetail.copyInfo.all "View copy information for all libraries">
+<!ENTITY rdetail.copyInfo.actions "Actions">
+<!ENTITY rdetail.copyInfo.print "Print Call Numbers for this library">
+<!ENTITY rdetail.copyInfo.details "details">
+<!ENTITY rdetail.copyInfo.browse "browse">
+<!ENTITY rdetail.copyInfo.hold "place hold">
+<!ENTITY rdetail.extras.summary "Copy Summary">
+<!ENTITY rdetail.extras.browser "Shelf Browser">
+<!ENTITY rdetail.extras.reviews "Reviews">
+<!ENTITY rdetail.extras.toc "Table of Contents">
+<!ENTITY rdetail.extras.excerpt "Excerpt">
+<!ENTITY rdetail.extras.author.notes "Author Notes">
+<!ENTITY rdetail.extras.annotation "Annotation">
+<!ENTITY rdetail.extras.marc "MARC Record">
+<!ENTITY rdetail.extras.call.null "There are no call numbers for this item at this location.">
+<!ENTITY rdetail.extras.call.local "Local Call Numbers:">
 <!ENTITY rdetail.loading "Loading copy infomation...">
 <!ENTITY rdetail.noneAvailable " * There are no copies in this location">
-<!ENTITY rdetail.detailMain.viewMarc "View MARC">
-<!ENTITY rdetail.detailMain.hideMarc "Return to title details">
+<!ENTITY rdetail.summary.online "Online Resources">
+
+<!ENTITY result.info.copies "Available copies / Total copies">
+<!ENTITY result.info.no.items "No items with the selected format were found in this location.">
+<!ENTITY result.info.format.items "Listed below are all items in the catalog with the chosen format.">
+<!ENTITY result.info.show "Show records for">
+
+<!ENTITY result.lowhits.few "Few hits were returned for your search.">
+<!ENTITY result.lowhits.zero "Zero hits were returned for your search.">
+<!ENTITY result.lowhits.did.you.mean "Maybe you meant:">
+<!ENTITY result.lowhits.formats "You will find more hits when searching all item formats:">
+<!ENTITY result.lowhits.formats.search "Search again with all formats?">
+<!ENTITY result.lowhits.related "You may also like to try these related searches:">
+<!ENTITY result.lowhits.expand "You may also wish to expand your search range to:">
+<!ENTITY result.lowhits.class "You can try searching the same terms by:">
+<!ENTITY result.lowhits.title "title">
+<!ENTITY result.lowhits.author "author">
+<!ENTITY result.lowhits.subject "subject">
+<!ENTITY result.lowhits.series "series">
+<!ENTITY result.lowhits.keyword "keyword">
+
+<!ENTITY result.table.keyword "View titles for this record">
+<!ENTITY result.table.author "Perform an Author Search">
+
+<!ENTITY common.call.number.label "Call Number:">
+<!ENTITY common.isbn.label "ISBN:">
+<!ENTITY common.issn.label "ISSN:">
+<!ENTITY common.copy.barcode.label "Copy Barcode:">
+<!ENTITY common.hold.place "Place hold for me">
+<!ENTITY common.hold.check "Checking for possibility of hold fulfillment...">
+<!ENTITY common.hold.create "Create / Edit a Hold">
+<!ENTITY common.hold.update "Update Hold">
+<!ENTITY common.hold.type.label "Hold Type:">
+<!ENTITY common.hold.volume "Volume Hold">
+<!ENTITY common.hold.copy "Copy Hold">
+<!ENTITY common.hold.advanced "Advanced Hold Options">
+<!ENTITY common.hold.delivery "Please select a physical location where your hold can be delivered.">
+<!ENTITY common.hold.exists "A hold already exists on the requested item.">
+<!ENTITY common.hold.exists.override "A hold already exists on the requested
+item. Would you like to create the hold anyway?">
+<!ENTITY common.hold.barred 'PATRON BARRED. Please see any notes in the
+"Staff Notes" section of your "My Account" page or contact your local library.'>
+<!ENTITY common.hold.item.invalid "This hold is no longer valid. It's likely that the
+target for the hold was deleted from the system.  Please cancel this hold and
+place a new one.">
+<!ENTITY common.hold.patron.invalid "The patron barcode entered as the hold recipient is invalid.">
+<!ENTITY common.help "(Help)"> <!-- Was (??), perhaps change to a button or icon? -->
+<!ENTITY common.phone.format.help "The phone number does not have the correct format. The expected format is XXX-YYY-ZZZZ">
+<!ENTITY common.hold.failed "No items were found that could fulfill the requested holds.
+It's possible that choosing a different format will result in a successful hold.
+It is also possible that you have exceeded the number of allowable holds.
+For further information, please consult your local librarian.">
+<!ENTITY common.control.click "(control-click to select multiple formats)">
+<!ENTITY common.format.alternatives "Acceptable Alternative Formats:">
+<!ENTITY common.phone.format "(XXX-YYY-ZZZZ)">
+<!ENTITY common.phone.enable "Enable phone notifications for this hold?">
+<!ENTITY common.email.enable "Enable email notifications for this hold?">
+<!ENTITY common.email.none "(Patron has no configured email address)">
+<!ENTITY common.email.set "(See <a class='classic_link' id='holds.no_email.my_account'>My Account</a> for setting your email address)">
+<!ENTITY common.physical.label "Physical Description:">
+<!ENTITY common.title.label "Title:">
+<!ENTITY common.author.label "Author:">
+<!ENTITY common.format.label "Format:">
+<!ENTITY library.select "Find results in">
+<!ENTITY library.select.label "Choose a different library...">
+<!ENTITY library.select.help "Choose a library to search">
+<!ENTITY login.username "Enter your username or library barcode">
+<!ENTITY login.password.change "Change Password">
+<!ENTITY login.first.time "This appears to be the first time you have logged in.
+You will need to change your password.">
+<!ENTITY login.password.current.enter "Enter your current password">
+<!ENTITY login.password.new.enter "Enter the new password">
+<!ENTITY login.password.new.reenter "Re-type the new password for verifiication">
+<!ENTITY login.password.update "Update Password">
+<!ENTITY login.password.nomatch "Passwords do not match">
+<!ENTITY login.password.success "Password successfully updated">
+<!ENTITY login.password.strength "The password provided is not strong enough.">
+<!ENTITY login.barcode.inactive "The barcode used to login is marked as inactive.  Please contact your local library.">
+<!ENTITY login.account.inactive "This account has been deactivated.  Please contact your local library.">
+<!ENTITY login.failed "Login failed. The username or password provided was not valid.
+Ensure Caps-Lock is off and try again or contact your local library.">
+<!ENTITY button.go "Go!">
diff --git a/Open-ILS/web/opac/locale/en-US/opac_advanced.dtd b/Open-ILS/web/opac/locale/en-US/opac_advanced.dtd
deleted file mode 100644 (file)
index e33384d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!ENTITY opac.advanced.wizard.title "Advanced Search">
-<!ENTITY opac.advanced.wizard.contains "Selected field contains the following words">
-<!ENTITY opac.advanced.wizard.nocontains "Selected field does <u>not</u> contain the following words">
-<!ENTITY opac.advanced.wizard.exact "Selected field contains the <u>exact</u> phrase">
-<!ENTITY opac.advanced.refined.title "Refined Advanced Search">
-<!ENTITY opac.advanced.refined.title_contains "Title contains the following words">
-<!ENTITY opac.advanced.refined.author_contains "Author contains the following words">
-<!ENTITY opac.advanced.refined.subject_contains "Subject contains the following words">
-<!ENTITY opac.advanced.refined.series_contains "Series contains the following words">
-<!ENTITY opac.advanced.refined.contains "Contains">
-<!ENTITY opac.advanced.refined.nocontains "Does not contain">
-<!ENTITY opac.advanced.refined.exact "Matches Exactly">
-<!ENTITY opac.advanced.marc.warning "For Librarians">
-<!ENTITY opac.advanced.marc.title "MARC Expert Search">
-<!ENTITY opac.advanced.marc.tag "MARC Tag">
-<!ENTITY opac.advanced.marc.ind1 "Indicator 1">
-<!ENTITY opac.advanced.marc.ind2 "Indicator 2">
-<!ENTITY opac.advanced.marc.subfield "Subfield">
-<!ENTITY opac.advanced.marc.value "Value">
-<!ENTITY opac.advanced.marc.addrow "Add a new row">
-<!ENTITY opac.advanced.quick.title "Quick Search">
-<!ENTITY opac.advanced.quick.isbn "ISBN">
-<!ENTITY opac.advanced.quick.issn "ISSN">
diff --git a/Open-ILS/web/opac/locale/en-US/opac_common.dtd b/Open-ILS/web/opac/locale/en-US/opac_common.dtd
deleted file mode 100644 (file)
index a21b7ac..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<!-- Events and Permissions -->
-<!ENTITY ilsevent.0 "Operation Succeeded">
-<!ENTITY ilsevent.1000 "Login failed.  The username or password entered was incorrect.">
-<!ENTITY ilsevent.1001 "Login session has timed out or does not exist">
-<!ENTITY ilsevent.1002 "User was not found in the database">
-<!ENTITY ilsevent.1200 "The given username already exists in the database">
-<!ENTITY ilsevent.5000 "Permission Denied">
-<!ENTITY ilsperm.CREATE_HOLD "User is not allowed to create holds for other users at this location">
-
-
-<!ENTITY opac.session_expiring 
-       "Your login session will timeout in 1 minute unless there is activity.">
-<!ENTITY opac.session_expired "Your login session has expired">
-
-<!ENTITY navigate.home "Home">
-<!ENTITY navigate.home.title "Go to the Home page">
-<!ENTITY opac.navigate.advanced "Advanced Search">
-<!ENTITY opac.navigate.advanced.title "Go to the Advanced Search Page">
-<!ENTITY navigate.myopac "My Account">
-<!ENTITY opac.navigate.myopac "My Account">
-<!ENTITY navigate.myopac.title "Go to My OPAC">
-<!ENTITY navigate.login "Log in">
-<!ENTITY navigate.login.title "Log in for personalized features">
-<!ENTITY navigate.logout "Log out">
-<!ENTITY navigate.logout.title "Log out">
-<!ENTITY opac.navigate.selectNewOrg "Choose a different library">
-<!ENTITY opac.navigate.selectOrg "Choose a library to search">
-<!ENTITY navigate.loggedinas "You are logged in as ">
-<!ENTITY navigate.loggedinas.title "Logged in as...">
-<!ENTITY navigate.titleGroupResults "My Search Results">
-<!ENTITY navigate.titleResults "My Title Results">
-
-<!ENTITY common.nowSearching "Now searching ">
-<!ENTITY common.ofAtLeast " of at least ">
-<!ENTITY common.relevancy "Match Score: ">
-<!ENTITY common.tips "Tips:">
-<!ENTITY common.tips.tip1 "Click on a folder icon in the sidebar to access related quick searches">
-<!ENTITY common.tips.tip2 "If you don't find what you want try expanding your search using the range selector at the right of the search bar">
-<!ENTITY common.org.openAll "Expand All">
-<!ENTITY common.org.closeAll "Close All">
-<!ENTITY common.org.cancel "Cancel">
-<!ENTITY common.org.loading "Loading library selector...">
-<!ENTITY common.org.note "Tip:">
-<!ENTITY common.org.notetext "Click on a location's name to select it.  Click on the folder icons to expand a section.">
-
-<!ENTITY sidebar.relevantSubjects.headerLabel "Relevant Subjects">
-<!ENTITY sidebar.relevantAuthors.headerLabel "Relevant Authors">
-<!ENTITY sidebar.relevantSeries.headerLabel "Relevant Series">
-<!ENTITY sidebar.relevantReviews.headerLabel "Reviews">
-
-<!ENTITY opac.search.books "Books">
-<!ENTITY opac.search.allFormats "All Formats">
-<!ENTITY opac.search.largePrint "Large Print Books">
-<!ENTITY opac.search.audioBooks "Audiobooks">
-<!ENTITY opac.search.videoRecordings "Video Recordings">
-<!ENTITY opac.search.music "Music">
-<!ENTITY opac.search.electronic "Electronic Resources">
-<!ENTITY opac.search.nowSearching "Now Searching">
-
-
-<!ENTITY opac.title.home "Evergreen Home">
-<!ENTITY opac.title.mresult "Evergreen Title Groups">
-<!ENTITY opac.title.rresult "Evergreen Titles">
-<!ENTITY opac.title.myopac "Evergreen My Account">
-<!ENTITY opac.title.rdetail "Evergreen Title Details">
-<!ENTITY opac.title.advanced "Evergreen Advanced Search">
-<!ENTITY opac.title.reqitems "Evergreen Request Items">
-<!ENTITY opac.title.cnbrowse "Evergreen Call Number Browse">
-<!ENTITY opac.login.login "Login">
diff --git a/Open-ILS/web/opac/locale/en-US/opac_holds.dtd b/Open-ILS/web/opac/locale/en-US/opac_holds.dtd
deleted file mode 100644 (file)
index ea54592..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!ENTITY opac.holds.forMe "Place this hold for myself">
-<!ENTITY opac.holds.xulRecipient "Enter recipient barcode">
-<!ENTITY opac.holds.recipient "Recipient">
-<!ENTITY opac.holds.placeHold "Place Hold">
-<!ENTITY opac.holds.contactPhone "Contact telephone number">
-<!ENTITY opac.holds.concactEmail "Contact email address">
-<!ENTITY opac.holds.pickupLocation "Pickup location">
-<!ENTITY opac.holds.placeHold  "Place Hold">
-<!ENTITY opac.holds.success "Hold was successfully placed">
-<!ENTITY opac.holds.failure "Hold was not successfully placed">
-
diff --git a/Open-ILS/web/opac/locale/en-US/opac_rdetail.dtd b/Open-ILS/web/opac/locale/en-US/opac_rdetail.dtd
deleted file mode 100644 (file)
index b9e4969..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<!ENTITY rdetail.detailMain.headerLabel "Title Details">
-<!ENTITY rdetail.detailMain.title "Title">
-<!ENTITY rdetail.detailMain.author "Author">
-<!ENTITY rdetail.detailMain.isbn "ISBN">
-<!ENTITY rdetail.detailMain.edition "Edition">
-<!ENTITY rdetail.detailMain.pubdate "Publication Date">
-<!ENTITY rdetail.detailMain.publisher "Publisher">
-<!ENTITY rdetail.detailMain.tor "Format">
-<!ENTITY rdetail.detailMain.subjects "Subjects">
-<!ENTITY rdetail.detailMain.abstract "Abstract">
-<!ENTITY rdetail.copyInfo.headerLabel "Copy Information">
-<!ENTITY rdetail.copyInfo.library "Library">
-<!ENTITY rdetail.copyInfo.callnumber "Callnumber">
-<!ENTITY rdetail.copyInfo.local "View Copy Information for this location only">
-<!ENTITY rdetail.copyInfo.all "View copy information for all libraries">
-<!ENTITY rdetail.loading "Loading copy infomation...">
-<!ENTITY rdetail.noneAvailable " * There are no copies in this location">
-<!ENTITY rdetail.detailMain.viewMarc "View MARC">
-<!ENTITY rdetail.detailMain.hideMarc "Return to title details">
diff --git a/Open-ILS/web/opac/locale/en-US/opac_result.dtd b/Open-ILS/web/opac/locale/en-US/opac_result.dtd
deleted file mode 100644 (file)
index e69de29..0000000
index 745df27..22d4a75 100644 (file)
@@ -741,7 +741,7 @@ function holdProcessResult( hold, res, recurse ) {
                }
 
                if( grep(res, function(e) { return (e.textcode == 'HOLD_EXISTS'); }) ) {
-                       if( fetchPermOrgs('HOLD_EXISTS.override')[0] ) {
+                       if( fetchPermOrgs('HOLD_EXISTS.override')[0] != -1 ) {
                                if( confirm($('hold_dup_exists_override').innerHTML) ) {
                                        return holdsPlaceHold(hold, true);
                                }
index 6232cb5..12941b2 100644 (file)
@@ -15,7 +15,7 @@
                        <table width='100%' id='adv_global_input_table'>
        
                                <thead>
-                                       <tr><td colspan='2' align='center'>Search Input</td></tr>
+                                       <tr><td colspan='2' align='center'>&advanced.search.title;</td></tr>
                                </thead>
                                <tbody id='adv_global_tbody'>
 
                                        <!-- add a new row -->
                                        <tr id='adv_global_addrow'>
                                                <td align='center'>
-                                                       <input type='submit' value='Add Search Row
+                                                       <input type='submit' value='&advanced.add.row;
                                                                id='myopac_new_global_row' onclick='advAddGblRow();'> </input>
                                                        <span style='padding-left: 10px;'> </span>
-                                                       <input type='submit' onclick='advSubmitGlobal();' value='Submit Search'></input>
+                                                       <input type='submit' onclick='advSubmitGlobal();' value='&advanced.search.submit;'></input>
                                                </td>
                                        </tr>
 
@@ -62,7 +62,7 @@
 
                        <table with='100%'>
                                <thead>
-                                       <tr><td colspan='2' align='center'>Search Filters</td></tr>
+                                       <tr><td colspan='2' align='center'>&advanced.search.filters;</td></tr>
                                </thead>
                                <tbody>
 
@@ -76,7 +76,7 @@
                                        -->
                                        <tr>
                                                <td align='right'>
-                                                       <span>Item Form</span>
+                                                       <span>&advanced.item.form;</span>
                                                </td>
                                                <td aligh='left'>
                                                        <select multiple='true' size='3' id='adv_global_item_form'>
 
                                        <tr>
                                                <td align='right'>
-                                                       <span>Item Type</span>
+                                                       <span>&advanced.item.type;</span>
                                                        <a id='adv_global_item_type_link_adv' class='classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                hideMe($("adv_global_item_type_basic"));
                                                                unHideMe($("adv_global_item_type"));
                                                                hideMe(this);
                                                                unHideMe($("adv_global_item_type_link_basic"));
-                                                               '>Advanced</a>
+                                                               '>&advanced.link;</a>
 
                                                        <a id='adv_global_item_type_link_basic' class='hide_me classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                hideMe($("adv_global_item_type"));
                                                                unHideMe($("adv_global_item_type_link_adv"));
                                                                hideMe(this);
-                                                               '>Basic</a>
+                                                               '>&advanced.basic.link;</a>
                                                </td>
 
                                                <td aligh='left'>
 
                                        <tr>
                                                <td align='right'>
-                                                       <span>Literary&nbsp;Form</span>
+                                                       <span>&advanced.literary.form;</span>
                                                        <a id='adv_global_lit_form_link_adv' class='classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                hideMe($("adv_global_lit_form_basic"));
                                                                unHideMe($("adv_global_lit_form"));
                                                                hideMe(this);
                                                                unHideMe($("adv_global_lit_form_link_basic"));
-                                                               '>Advanced</a>
+                                                               '>&advanced.link;</a>
 
                                                        <a id='adv_global_lit_form_link_basic' class='hide_me classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                hideMe($("adv_global_lit_form"));
                                                                unHideMe($("adv_global_lit_form_link_adv"));
                                                                hideMe(this);
-                                                               '>Basic</a>
+                                                               '>&advanced.basic.link;</a>
                                                </td>
                                                <td aligh='left'>
                                                        <select multiple='true' size='3' id='adv_global_lit_form' class='hide_me'>
                                                        </select>       
                                                        <select multiple='true' size='3' id='adv_global_lit_form_basic'>
-                                                               <option value='0 '>Non Fiction</option>
-                                                               <option value='1'>Fiction</option>
+                                                               <option value='0 '>&advanced.non.fiction;</option>
+                                                               <option value='1'>&advanced.fiction;</option>
                                                        </select>       
                                                </td>
                                        </tr>
                                        <!-- Language selector -->
                                        <tr>
                                                <td align='right'>
-                                                       <span>Language</span>
+                                                       <span>&advanced.language;</span>
                                                </td>
 
                                                <td align='left'>
                                        <!-- Audience selector -->
                                        <tr>
                                                <td align='right'>
-                                                       <span>Audience</span>
+                                                       <span>&advanced.audience;</span>
 
                                                        <a id='adv_global_audience_link_adv' class='classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                unHideMe($("adv_global_audience"));
                                                                hideMe(this);
                                                                unHideMe($("adv_global_audience_link_basic"));
-                                                               '>Advanced</a>
+                                                               '>&advanced.link;</a>
 
                                                        <a id='adv_global_audience_link_basic' class='hide_me classic_link adv_adv_link'
                                                                href='javascript:void(0);' onclick='
                                                                unHideMe($("adv_global_audience_basic"));
                                                                hideMe($("adv_global_audience"));
                                                                unHideMe($("adv_global_audience_link_adv"));
-                                                               hideMe(this);'>Basic</a>
+                                                               hideMe(this);'>&advanced.basic.link;</a>
                                                </td>
 
                                                <td align='left'>
                                                        <select multiple='true' size='3' id='adv_global_audience' class='hide_me'>
                                                        </select>
                                                        <select multiple='true' size='3' id='adv_global_audience_basic'>
-                                                               <option value='e '>Adult</option>
-                                                               <option value='abcdj'>Juvenile</option>
-                                                               <option value='fg '>General</option>
+                                                               <option value='e '>&advanced.adult;</option>
+                                                               <option value='abcdj'>&advanced.juvenile;</option>
+                                                               <option value='fg '>&advanced.general;</option>
                                                        </select>
                                                </td>
                                        </tr>
                        
                                                        <thead>
                                                                <tr>
-                                                                       <td align='center' width='50%'>Sort Criteria</td>
-                                                                       <td align='center'>Search Library</td>
+                                                                       <td align='center' width='50%'>&advanced.sort.criteria;</td>
+                                                                       <td align='center'>&advanced.search.library;</td>
                                                                </tr>
                                                        </thead>
                        
 
                                                                        <td align=''>
                                                                                <select id='adv_global_sort_by' onchange='__setsortsel();'>
-                                                                                       <option value='rel'>Relevance</option>
-                                                                                       <option value='title'>Title</option>
-                                                                                       <option value='author'>Author</option>
-                                                                                       <option value='pubdate'>Publication Date</option>
+                                                                                       <option value='rel'>&advanced.relevance;</option>
+                                                                                       <option value='title'>&common.title;</option>
+                                                                                       <option value='author'>&common.author;</option>
+                                                                                       <option value='pubdate'>&advanced.pubdate;</option>
                                                                                </select>
                                                                        </td>
 
 
                                                                        <td>
                                                                                <select id='adv_global_sort_dir' disabled='disabled'>
-                                                                                       <option value='asc'>Ascending / A to Z</option>
-                                                                                       <option value='desc'>Descending / Z to A</option>
+                                                                                       <option value='asc'>&advanced.sort.asc;</option>
+                                                                                       <option value='desc'>&advanced.sort.desc;</option>
                                                                                </select>
                                                                        </td>
 
                                                                </tr>
                                                                <tr>
                                                                        <td colspan='2' align='center'>
-                                                                               <span>Group Formats and Editions</span>
+                                                                               <span>&advanced.frbrize;</span>
                                                                                <!--
                                                                                <input id='adv_group_titles' type='checkbox' checked='checked'> </input>
                                                                                -->
        </tr>
 
        <tr style='border: 2px solid #E0F0E0;'>
-               <td colspan='2'><input type='submit' onclick='advSubmitGlobal();' value='Submit Search'></input></td>
+               <td colspan='2'><input type='submit' onclick='advSubmitGlobal();' value='&advanced.search.submit;'></input></td>
        </tr>
 
 </table>
index eadfe22..3746da1 100644 (file)
@@ -11,19 +11,19 @@ XXX Deprecate me
        <tbody>
                <tr>
                        <td>
-                               <span style='padding-right: 0px;'>Call Number:</span>
+                               <span style='padding-right: 0px;'>&common.call.number.label;</span>
                                <input id='opac.advanced.quick.cn' style='margin: 2px;' type='text' size='12'> </input>
-                               <input type='submit' onclick='advCNRun();' value='Go'> </input>
+                               <input type='submit' onclick='advCNRun();' value='&advanced.go;'> </input>
                        </td>
                        <td>
-                               <span style='padding-right: 0px;'>&opac.advanced.quick.isbn;:</span>
+                               <span style='padding-right: 0px;'>&common.isbn.label;</span>
                                <input id='opac.advanced.quick.isbn' style='margin: 2px;' type='text' size='13' maxlength='13'> </input>
-                               <input type='submit' onclick='advISBNRun();' value='Go'> </input>
+                               <input type='submit' onclick='advISBNRun();' value='&advanced.go;'> </input>
                        </td>
                        <td>
-                               <span style='padding-right: 0px;'>&opac.advanced.quick.issn;:</span>
+                               <span style='padding-right: 0px;'>&common.issn.label;</span>
                                <input id='opac.advanced.quick.issn' style='margin: 2px;' type='text' size='9' maxlength='9'> </input>
-                               <input type='submit' onclick='advISSNRun();' value='Go'> </input>
+                               <input type='submit' onclick='advISSNRun();' value='&advanced.go;'> </input>
                        </td>
                </tr>
        </tbody>
index 98ef379..363c9e0 100644 (file)
@@ -4,21 +4,21 @@
        -->
 <div id='cn_browse' class='hide_me cn_browser' 
        style='width: 95%; text-align: center; padding: 15px;'>
-       <div id='cn_browse_loading'  class='cn_browse_loading hide_me'>Loading Callnumber Page...</div>
+       <div id='cn_browse_loading'  class='cn_browse_loading hide_me'>&common.cn.loading;</div>
        <div id='cn_browse_div'> 
 
 
                <div style='width: 90%; text-align: center; margin: 10px;' class='color_4'>
-                       <span>You are now browsing</span><b style='margin-left: 6px;' id='cn_browse_where'> </b>
+                       <span>&common.cn.browsing;</span><b style='margin-left: 6px;' id='cn_browse_where'> </b>
                </div>
                <table class='data_grid bookshelf' width='100%'>
                        <thead>
                                <tr>
                                        <td><a id='cn_browse_next' class='classic_link' 
-                                               href='javascript:cnBrowsePrev();'><b>&lt;&lt; Previous Page</b></a></td>
-                                       <td colspan='1' align='center'>Shelf Browser</td>
+                                               href='javascript:cnBrowsePrev();'><b>&common.cn.previous;</b></a></td>
+                                       <td colspan='1' align='center'>&common.cn.shelf;</td>
                                        <td><a id='cn_browse_prev' class='classic_link' 
-                                               href='javascript:cnBrowseNext();'><b>Next Page&gt;&gt;</b></a></td>
+                                               href='javascript:cnBrowseNext();'><b>&common.cn.next;</b></a></td>
                                </tr>
                        </thead>
                        <tbody id='cn_tbody'>
index 9cbe544..5c19b0a 100644 (file)
@@ -1,10 +1,10 @@
 <div id='fonts_div'>
 
        <div id='text_size_div' style='position:absolute; top: 2px; right: 6px;'>
-               <span>Text Size: </span>
-               <span><a href="javascript:void(0);" onclick="setFontSize('regular');"> Regular </a></span>
-               <span> / </span>
-               <span><a href="javascript:void(0);" onclick="setFontSize('large');"> Large </a></span>
+               <span>&common.textsize.title;</span>
+               <span><a href="javascript:void(0);" onclick="setFontSize('regular');"> &common.textsize.regular; </a></span>
+               <span> &common.textsize.separator; </span>
+               <span><a href="javascript:void(0);" onclick="setFontSize('large');"> &common.textsize.large; </a></span>
        </div>
        
 </div>
index e611910..288741e 100644 (file)
@@ -9,9 +9,9 @@
                                                <td><input type='text' id='xul_recipient_barcode'> </input></td>
                                                <td><input type='submit' value='&common.submit;' 
                                                        id='xul_recipient_barcode_submit'> </input></td>
-                                               <td><input type='submit' value='Place hold for me
+                                               <td><input type='submit' value='&common.hold.place;
                                                        id='xul_recipient_me'> </input></td>
-                                               <td><input type='submit' value='Cancel' onclick='showCanvas();'></input></td>
+                                               <td><input type='submit' value='&common.cancel;' onclick='showCanvas();'></input></td>
                                        </tr>
 
                                </tbody>
@@ -22,7 +22,7 @@
        <div id='check_holds_box' class='hide_me non_canvas' 
                style='margin-top: 6px; width: 100%; text-align: center'>
                <br/><br/><br/>
-               <b>Checking for possibility of hold fulfillment...</b>
+               <b>&common.hold.check;</b>
        </div>
 
        <div id='holds_box' class='hide_me non_canvas' style='margin-top: 6px;'>
                        <tbody>
                                <tr>
                                        <td class='holds_cell color_1' 
-                                               align='center' colspan='2'>Create / Edit a Hold</td>
+                                               align='center' colspan='2'>&common.hold.create;</td>
                                </tr>
                                <tr>
                                        <td class='holds_cell'>&opac.holds.recipient;:</td>
                                        <td class='holds_cell' id='holds_recipient'> </td>
                                </tr>
                                <tr>
-                                       <td class='holds_cell'>&common.title;:</td>
+                                       <td class='holds_cell'>&common.title.label;</td>
                                        <td class='holds_cell' id='holds_title'> </td>
                                </tr>
                                <tr>
-                                       <td class='holds_cell'>&common.author;:</td>
+                                       <td class='holds_cell'>&common.author;</td>
                                        <td class='holds_cell' id='holds_author'> </td>
                                </tr>
                                <tr>
-                                       <td class='holds_cell'>&common.format;:</td>
+                                       <td class='holds_cell'>&common.format;</td>
                                        <td class='holds_cell' id='holds_format'> </td>
                                </tr>
                                <tr id='hold_physical_desc_row'>
-                                       <td class='holds_cell'>Physical Description:</td>
+                                       <td class='holds_cell'>&common.physical.label;</td>
                                        <td class='holds_cell' id='holds_physical_desc'> </td>
                                </tr>
 
                                <tr class='hide_me' id='holds_cn_row'>
-                                       <td class='holds_cell'>Call Number:</td>
+                                       <td class='holds_cell'>&common.call.number.label;</td>
                                        <td class='holds_cell'><b id='holds_cn'/> </td>
                                </tr>
 
                                <tr class='hide_me' id='holds_copy_row'>
-                                       <td class='holds_cell'>Copy Barcode:</td>
+                                       <td class='holds_cell'>&common.copy.barcode.label;</td>
                                        <td class='holds_cell'><b id='holds_copy'/> </td>
                                </tr>
 
                                <tr class='hide_me' id='holds_type_row'>
-                                       <td class='holds_cell'>Hold Type:</td>
-                                       <td class='holds_cell hide_me' id='holds_is_cn'><b>Volume Hold</b></td>
-                                       <td class='holds_cell hide_me' id='holds_is_copy'><b>Copy Hold</b></td>
+                                       <td class='holds_cell'>&common.hold.type.label;</td>
+                                       <td class='holds_cell hide_me' id='holds_is_cn'><b>&common.hold.volume;</b></td>
+                                       <td class='holds_cell hide_me' id='holds_is_copy'><b>&common.hold.copy;</b></td>
                                </tr>
 
                                <tr>
                                        <td class='holds_cell'>&opac.holds.contactPhone;:</td>
                                        <td class='holds_cell'>
                                                <input id='holds_phone' size='13' maxlength='12'/>
-                                               <span style='margin-left: 4px; font-size: 7pt;'>(XXX-YYY-ZZZZ)</span>
+                                               <span style='margin-left: 4px; font-size: 7pt;'>&common.phone.format;</span>
                                        </td>
                                </tr>
                                <tr>
-                                       <td class='holds_cell'>Enable phone notifications for this hold?</td>
+                                       <td class='holds_cell'>&common.phone.enable;</td>
                                        <td class='holds_cell'>
                                                <input type='checkbox' id='holds_enable_phone'  checked='checked'
                                                        onchange='
                                </tr>
 
                                <tr>
-                                       <td class='holds_cell'>&opac.holds.concactEmail;:</td>
+                                       <td class='holds_cell'>&opac.holds.contactEmail;:</td>
                                        <td class='holds_cell' id='holds_email'> 
                         <span class='hide_me' id='holds.no_email'>
-                            (See <a class='classic_link' 
-                                id='holds.no_email.my_account'>My Account</a> for setting your email address)
+                            
                         </span>
                         <span class='hide_me' id='holds.no_email.xul'>
-                            (Patron has no configured email address)
+                           &common.email.none; 
                         </span>
 
                     </td>
                                </tr>
                                <tr>
-                                       <td class='holds_cell'>Enable email notifications for this hold?</td>
+                                       <td class='holds_cell'>&common.email.enable;</td>
                                        <td class='holds_cell'>
                                                <input type='checkbox' id='holds_enable_email' checked='checked'/>
                                        </td>
                                        <td colspan='2' align='center'>
                                                <div style='padding: 8px;'>
                                                        <a class='classic_link' href='javascript:void(0);' style='padding: 5px;'
-                                                               onclick='unHideMe($("holds_alt_formats_row"));'>Advanced Hold Options</a>
+                                                               onclick='unHideMe($("holds_alt_formats_row"));'>&common.hold.advanced;</a>
                                                </div>
                                        </td>
                                </tr>
 
                                        <td class='holds_cell'>
                                                <div style='margin-bottom: 5px;'>
-                                                       <span>Acceptable Alternative Formats: </span>
+                                                       <span>&common.format.alternatives; </span>
                                                        <span> <a class='classic_link' style='color:red;' href='javascript:void(0);' 
-                                                               onclick='alert($("holds_explain_adv").innerHTML)'>(??)</a></span>
+                                                               onclick='alert($("holds_explain_adv").innerHTML)'>&common.help;</a></span>
                                                </div>
-                                               <div>(control-click to select multiple formats)</div>
+                                               <div>&common.control.click;</div>
                                        </td>
 
                                        <td class='holds_cell'>
                                <tr>
                                        <td class='holds_cell' align='center' colspan='2'>
                                                <button id='holds_submit'>&opac.holds.placeHold;</button>
-                                               <button class='hide_me' id='holds_update'>Update Hold</button>
+                                               <button class='hide_me' id='holds_update'>&common.hold.update;</button>
                                                <span style='padding: 20px;'> </span>
                                                <button id='holds_cancel'>&common.cancel;</button>
                                        </td>
                <div class='hide_me' id='holds_success'>&opac.holds.success;</div>
                <div class='hide_me' id='holds_failure'>&opac.holds.failure;</div>
                <span class='hide_me' id='holds_bad_phone'>
-                       The phone number does not have the correct format.
-                       The expected format is XXX-YYY-ZZZZ
+                       &common.phone.format.help;
                </span>
 
                <span class='hide_me' id='hold_not_allowed'>
-                       No items were found that could fulfill the requested holds.  
-                       It's possible that choosing a different format will result in a successful hold.
-         It is also possible that you have exceeded the number of allowable holds.
-                       For further information, please consult your local librarian.
+                       &common.hold.failed;
                </span>
 
        </div>
 
        <span class='hide_me' id='holds_explain_adv'>&holds.advanced_options;</span>
 
-       <span class='hide_me' id='holds_pick_good_org'>
-               Please select a physical location where your hold can be delivered.
-       </span>
+       <span class='hide_me' id='holds_pick_good_org'>&common.hold.delivery;</span>
 
-       <span class='hide_me' id='hold_dup_exists'>
-               A hold already exists on the requested item
-       </span>
+       <span class='hide_me' id='hold_dup_exists'>&common.hold.exists;</span>
 
-       <span class='hide_me' id='hold_dup_exists_override'>
-               A hold already exists on the requested item.  Would you like to create the hold anyway?
-       </span>
+       <span class='hide_me' id='hold_dup_exists_override'>&common.hold.exists.override;</span>
 
-       <span id='hold_failed_patron_barred' class='hide_me'>
-               PATRON BARRED.  
-               Please see any notes in the "Staff Notes" section of your "My Account" page or contact your local library.
-       </span>
+       <span id='hold_failed_patron_barred' class='hide_me'>&common.hold.barred;</span>
 
-       <span id='invalid_hold' class='hide_me'>
-               This hold is no longer valid.  
-               It's likely that the target for the hold was deleted from the system.
-               Please cancel this hold and place a new one.
-       </span>
+       <span id='invalid_hold' class='hide_me'>&common.hold.item.invalid;</span>
 
-       <span id='holds_invalid_recipient' class='hide_me'>
-               The patron barcode entered as the hold recipient is invalid. 
-       </span>
+       <span id='holds_invalid_recipient' class='hide_me'>&common.hold.patron.invalid;</span>
 
 </div>
 
index 95291f0..8859f2b 100644 (file)
@@ -2,14 +2,14 @@
        <script language='javascript' src='../js/depth_selector.js'> </script>
        <span class='hide_me' id='depth_selector_span'>
                <!--#if expr="$SHOW_DEPTHSEL_TEXT='true'"-->
-               <span>Find results in </span>
+               <span>&library.select; </span>
                <!--#endif-->
                <select id='depth_selector' >
-                       <option value='new'>Choose a different library...</option>
+                       <option value='new'>&library.select.label;</option>
                </select>
        </span>
        <span class='hide_me' id='lib_selector_span'>
-               <a id='lib_selector_link' class='classic_link' href='javascript:void(0)'>Choose a library to search</a>
+               <a id='lib_selector_link' class='classic_link' href='javascript:void(0)'>&library.select.help;</a>
        </span>
 </span>
 
index 6f7b1f0..8cef67a 100644 (file)
@@ -23,7 +23,7 @@
        <table id='login_table' class='data_grid' style='margin-left: 20px;' width='95%'>
                <tbody>
                        <tr>
-                               <td><span class='login_text'>Enter your username or library barcode</span></td>
+                               <td><span class='login_text'>&login.username;</span></td>
                                <td>
                                        <span class='login_text'>
                                                <input id='login_username' type='text' size='16'> </input>
@@ -44,7 +44,7 @@
                        <tr class='color_1'>
                                <td colspan='2' align='center'>
                                        <span class='login_text' style='margin-right: 20px;'>
-                                       <input type='submit' value='Login'  id='login_button'/>
+                                       <input type='submit' value='&common.login;'  id='login_button'/>
                                        </span>
                                        <span class='login_text' style='margin-left: 20px;'>
                                                <input type='submit' id='login_cancel_button' value='&common.cancel;'/>
 
        <table id='change_pw_table' class='data_grid hide_me' style='margin-left: 20px;' width='95%'>
                <thead>
-                       <tr><td colspan='2' align='center'><b>Change Password</b></td></tr>
+                       <tr><td colspan='2' align='center'><b>&login.password;</b></td></tr>
                </thead>
                <tbody>
 
                        <tr>
                                <td colspan='2' style='padding:10px;'>
-                                       This appears to be the first time you have logged in.  
-                                       You will need to change your password.
+                                       &login.first.time;
                                        &common.password_criteria;
                                </td>
                        </tr>
 
                        <tr>
-                               <td>Enter your current password</td>
+                               <td>&login.password.current.enter;</td>
                                <td><input type='password' id='change_pw_current'/></td>
                        </tr>
 
                        <tr>
-                               <td>Enter the new password</td>
+                               <td>&login.password.new.enter;</td>
                                <td><input type='password' id='change_pw_1'/></td>
                        </tr>
                        <tr>
-                               <td>Re-type the new password for verifiication</td>
+                               <td>&login.password.new.reenter;</td>
                                <td><input type='password' id='change_pw_2'/></td>
                        </tr>
                        <tr><td><br/></td><td/></tr>
                        <tr class='color_1'>
                                <td colspan='2' align='center'>
                                        <span class='login_text' style='margin-right: 20px;'>
-                                               <input type='submit' value='Update Password'  id='change_pw_button'/>
+                                               <input type='submit' value='&login.password.update;'  id='change_pw_button'/>
                                        </span>
                                </td>
                        </tr>
                </tbody>
        </table>
 
-       <span id='pw_no_match' class='hide_me'>Passwords do not match</span>
-       <span id='pw_update_successful' class='hide_me'>Password successfully updated</span>
+       <span id='pw_no_match' class='hide_me'>&login.password.nomatch;</span>
+       <span id='pw_update_successful' class='hide_me'>&login.password.success;</span>
 
        <span id='pw_not_strong' class='hide_me'>
-               The password provided is not strong enough.  
+               &login.password.strength;
                &common.password_criteria;
        </span>
 
-       <span id='patron_card_inactive_alert' class='hide_me'>
-               The barcode used to login is marked as inactive.  Please contact your local library.
-       </span>
+       <span id='patron_card_inactive_alert' class='hide_me'>&login.barcode.inactive;</span>
 
-       <span id='patron_inactive_alert' class='hide_me'>
-               This account has been deactivated.  Please contact your local library.
-       </span>
+       <span id='patron_inactive_alert' class='hide_me'>&login.account.inactive;</span>
 
-       <span id='patron_login_failed' class='hide_me'>
-               Login failed.  The username or password provided was not valid.  
-               Make sure Caps-Lock is off and try again or contact your local library.
-       </span>
+       <span id='patron_login_failed' class='hide_me'>&login.failed;</span>
 
 </div>
 
index 965e33e..db5b3d6 100644 (file)
@@ -30,7 +30,7 @@
 
                                        <input id='search_box' style='width: 190px;' type='text' />
                                        <span style='padding-left: 6px;'>
-                                               <input type='button' style='width: 40px;' id='search_submit' value='Go!' />
+                                               <input type='button' style='width: 40px;' id='search_submit' value='&button.go;' />
                                        </span>
                                </td>
 
index fc9789c..f0d57f0 100644 (file)
@@ -48,9 +48,9 @@
                                <a id='sidebar_title_results'>&navigate.titleResults;</a>
                        </div>
        
-                       <div title="Record Details"
+                       <div title="&navigate.record.details;"
                                id='rdetail_link_div' class="side_bar_item hide_me">
-                               <span>My Title Details</span>
+                               <span>&navigate.title.details;</span>
                        </div>
                </div>
        </div>
                style='text-align:center; margin-top: 20px;'> 
                <hr/>
                <div id='adv_quick_search'>
-                       <div class='adv_quick_search'><b>Quick Search</b></div>
+                       <div class='adv_quick_search'><b>&sidebar.quick.search;</b></div>
                        <div style='margin-top: 8px;'>
                                <table><tbody><tr>
                                        <td>
                                                <select id='adv_quick_type' style='width: 6em;'>
-                                                       <option value='isbn'>ISBN</option>
-                                                       <option value='issn'>ISSN</option>
-                                                       <option value='cn'>Call Number</option>
-                                                       <option value='lccn'>LCCN</option>
-                                                       <option value='tcn'>TCN</option>
-                            <option value='barcode'>Item Barcode</option>
+                                                       <option value='isbn'>&opac.advanced.quick.isbn;</option>
+                                                       <option value='issn'>&opac.advanced.quick.issn;</option>
+                                                       <option value='cn'>&opac.advanced.quick.cn;</option>
+                                                       <option value='lccn'>&opac.advanced.quick.lccn;</option>
+                                                       <option value='tcn'>&opac.advanced.quick.tcn;</option>
+                                                       <option value='barcode'>&opac.advanced.quick.barcode;</option>
                                                </select>
                                        </td><td>
                                                <input type='text' id='adv_quick_text' size='16'> </input>
                                </tr></tbody></table>
                        </div>
 
-            <span class='hide_me' id='myopac.copy.not.found'>No copy with the requested barcode was found</span>
+            <span class='hide_me' id='myopac.copy.not.found'>&sidebar.copy.not.found;</span>
                        <div style='margin-top: 8px;' class='adv_quick_search_submit'>
-                               <a id='adv_quick_submit' href='javascript:advGenericSearch();' class='classic_link'>Submit</a>
+                               <a id='adv_quick_submit' href='javascript:advGenericSearch();' class='classic_link'>&common.submit;</a>
                        </div>
                </div>
        </div>
        <div id='adv_marc_search_sidebar' class='sidebar_chunk hide_me' 
                style='text-align:center; margin-top: 20px;'> 
                <hr/>
-               <div class='adv_quick_search'><b>MARC Expert Search</b></div>
+               <div class='adv_quick_search'><b>&search.marc;</b></div>
                <table style='margin: 3px; border: 3px solid #E0E0E0; width: 100%;' id='adv_sdbar_table'>
                        <tbody>
                                <tr>
-                                       <td>Tag:</td>
+                                       <td>&search.marc.tag;</td>
                                        <td><input name='advanced.marc.tag' maxlength='3' size='3'> </input></td>
-                                       <td>Subfield:</td>
+                                       <td>&search.marc.subfield;</td>
                                        <td><input name='advanced.marc.subfield' maxlength='1' size='1'> </input></td>
                                </tr>
                                <tr>
-                                       <td>Value:</td>
+                                       <td>&search.marc.value;</td>
                                        <td colspan='3'><input name='advanced.marc.value' size='18'> </input></td>
                                </tr>
                                <tr name='crow' class='hide_me'>
                                                onclick='
                                                        var div = $("adv_marc_search_sidebar");
                                                        if( div.getElementsByTagName("table").length > 1 )
-                                                               div.removeChild(this.parentNode.parentNode.parentNode.parentNode);'>close</a>
+                                                               div.removeChild(this.parentNode.parentNode.parentNode.parentNode);'>&common.close;</a>
                                        </td>
                                </tr>
                                                                
                        </tbody>
                </table>
                <div id='adv_marc_submit' class='adv_quick_search_submit'>
-                       <a style='margin-right: 4px;' class='classic_link' href='javascript:advAddMARC();'>Add Row</a>
-                       <a style='margin-left: 4px;' class='classic_link' href='javascript:advMARCRun();'>Submit</a>
+                       <a style='margin-right: 4px;' class='classic_link' href='javascript:advAddMARC();'>&search.marc.add.row;</a>
+                       <a style='margin-left: 4px;' class='classic_link' href='javascript:advMARCRun();'>&common.submit;</a>
                </div>
        </div>
 
index 487bc76..a787268 100644 (file)
@@ -9,7 +9,7 @@
                                        <span style='padding: 1px; ' id='now_searching_location'>  </span>
                                        </b>
                                        <i id='including_results_for' class='hide_me'>
-                                               <span>Including results for</span> <b id='including_results_location'> </b>
+                                               <span>&status.results;</span> <b id='including_results_location'> </b>
                                        </i>
                                </td>
                        </tr>
index 644e07a..84919f5 100644 (file)
@@ -4,5 +4,5 @@
                <span>&common.tips.tip1;</span>
                <span>&common.tips.tip2;</span>
        </div>
-       <span style="font-weight: bold;">Tip:  </span>
+       <span style="font-weight: bold;">&tips.label;  </span>
 </div>
index d798533..ca3a0ad 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Needs serious DTD-ization -->
-
 <div
        style='width: 100%; text-align:center; vertical-align: bottom; margin-top: 20px;'>
        <center id='copyright_block'>
                        }
                </style>
 
-               <div 
-                       style='width: 60%; text-align:center; padding: 10px; font-size: 8pt;'>
+               <div style='width: 60%; text-align:center; padding: 10px; font-size: 8pt;'>
 
                                <span class='footer_link'>
                                        <a class='classic_link'
-                                               href='/opac/extras/slimpac/start.html'>Basic Catalog (HTML only)</a>
+                                               href='/opac/extras/slimpac/start.html'>&opac.basic;</a>
                                </span> 
                                <span> | </span>
                                <span class='footer_link'>
                                        <a target='_blank' class='classic_link'
-                                               href='http://www.georgialibraries.org/lib/directories/pineslibdir.html'>Find a Library Near Me</a>
+                                               href='&footer.find.url;'>&footer.find.library;</a>
                                </span> 
                                <span> | </span>
                                <span class='footer_link'>
                                        <a target='_blank' class='classic_link'
-                                               href='http://open-ils.org/dokuwiki/doku.php?id=evergreen-user:opac_help'>Help</a>
+                                               href='&footer.help.url;'>&footer.help;</a>
                                </span>
                                <span> | </span>
                                <span class='footer_link'>
                                        <a target='_blank' class='classic_link'
-                                               href='http://www.georgialibraries.org/public/pines.html'>About PINES</a>
+                                               href='&footer.library.url;'>&footer.library.about;</a>
                                </span>
                                <span> | </span>
                                <span class='footer_link'>
                                        <a target='' class='classic_link' id='eg_gal_link'
-                                               href='http://www.galileo.usg.edu/'>GALILEO</a>
+                                               href='&footer.union.url;'>&footer.union;</a>
                                </span>
                                <br/>
                                <div style='margin-top: 4px; font-size: 7pt;'>
-                                       <span>Copyright &#xA9; 2006 Georgia Public Library Service</span>
+                                       <span>&footer.copyright;</span>
                                </div>
                </div>
+        <div>&footer.logo;
+            <a href='http://open-ils.org'><img style='border:none;' src='../../../../images/eg_tiny_logo.jpg'/></a>
+        </div>
        </center>
 </div>
index f32f106..01037ac 100644 (file)
@@ -3,12 +3,7 @@
        <noscript>
                <style type="text/css">#toptable { display: none; }</style>
                <p style="font-size: 1.3em; padding: 3em; text-align: center;">
-                       JavaScript must be enabled in order for you to use the regular Evergreen Catalog.
-                       However, it seems JavaScript is either disabled or not supported by your browser.
-                       To use the regular Evergreen Catalog, enable JavaScript by changing your browser options, then
-                       <a style="color: blue; text-decoration: underline;" href="/">try again</a>.
-                       <br/><br/>Alternatively, you can use the basic HTML-only catalog
-                       <a style="color: blue; text-decoration: underline;" href="/opac/extras/slimpac/start.html">here</a>.
+               &home.js.disabled;
                </p>
        </noscript>
 
index 2f88b33..a5aa150 100644 (file)
@@ -4,15 +4,14 @@
        <script language='javascript' src='../js/container.js'> </script>
 
        <div id='myopac_delete_bookbag_warn' class='hide_me'>
-               This will remove the selected bookbag and all items contained within the bookbag.  
-               Are you sure you wish to continue?
+               &myopac.delete.bookbag;
        </div>
 
        <div style='text-align: center; font-weight: bold;' 
-               class='hide_me' id='myopac_bookbags_none'>You have not created any bookbags</div>
+               class='hide_me' id='myopac_bookbags_none'>&myopac.no.bookbags;</div>
 
        <div style='width: 99%; text-align: center; margin-bottom: 10px;'> 
-               <b>My Bookbags</b>
+               <b>&myopac.bookbags.title;</b>
                <!--
                <a class='classic_link' style='margin-left: 5px; font-size: 8pt;'
                        href='javascript:alert($("myopac_bb_what_are").innerHTML);'>(What are Bookbags?)</a>
 
        <table width='100%' class='data_grid data_grid_center hide_me' id='myopac_bookbag_table'>
                <thead>
-                       <tr><td>Name</td><td># Items</td><td>Shared</td><td>Share / Hide</td><td>Delete this bookbag?</td></tr>
+                       <tr><td>&common.name;</td><td>&myopac.bookbag.items;</td><td>&myopac.bookbag.shared;</td><td>&myopac.bookbag.toggle;</td><td>&myopac.bookbag.delete;</td></tr>
                </thead>
                <tbody id='myopac_bookbag_tbody'>
                        <tr id='myopac_bookbag_tr'>
                                <td>
                                        <a href='javascript:void(0);' class='classic_link' name='myopac_expand_bookbag'> </a>
                                </td>
-                               <td><span name='myopac_bookbag_item_count'> </span> <span> Items</span></td>
+                               <td><span name='myopac_bookbag_item_count'> </span> <span> &myopac.items;</span></td>
                                <td>
-                                       <span name='myopac_bb_published_no' class='hide_me'>No</span>
-                                       <span name='myopac_bb_published_yes' class='hide_me'>Yes</span>
-                                       <a name='myopac_bb_published_view' class='classic_link hide_me'>(View)</a>
+                                       <span name='myopac_bb_published_no' class='hide_me'>&common.no;</span>
+                                       <span name='myopac_bb_published_yes' class='hide_me'>&common.yes;</span>
+                                       <a name='myopac_bb_published_view' class='classic_link hide_me'>&myopac.view;</a>
                                        <a name='myopac_bb_published_atom' class='unadorned_link hide_me'>
-                                               <img border="0" src="/opac/images/small-rss.png" title="ATOM Feed" alt="ATOM Feed"/>
+                                               <img border="0" src="/opac/images/small-rss.png" title="&myopac.atom.feed;" alt="&myopac.atom.feed;"/>
                                        </a>
                                </td>
 
                                <td>
-                                       <a name='myopac_bb_make_unpublished' class='classic_link hide_me'>Hide</a>
-                                       <a name='myopac_bb_make_published' class='classic_link hide_me'>Share</a>
+                                       <a name='myopac_bb_make_unpublished' class='classic_link hide_me'>&myopac.bookbag.hide;</a>
+                                       <a name='myopac_bb_make_published' class='classic_link hide_me'>&myopac.bookbag.share;</a>
                                </td>
 
                                <td>
-                                       <a class='classic_link' href='javascript:void(0);' name='myopac_container_delete'>Delete</a>
+                                       <a class='classic_link' href='javascript:void(0);' name='myopac_container_delete'>&myopac.delete;</a>
                                </td>
                        </tr>
                </tbody>
 
        <table width='100%' class='data_grid data_grid_center' style='margin-top: 10px;'>
                <thead>
-                       <tr><td>Create a new Bookbag</td></tr>
+                       <tr><td>&myopac.bookbag.create;</td></tr>
                </thead>
                <tbody>
                        <tr>
                                <td> 
-                                       <span style='padding-right: 5px;'>Enter the name of the new Bookbag: </span>
+                                       <span style='padding-right: 5px;'>&myopac.bookbag.naming;</span>
                                        <input id='myopac_bookbag_new_name' type='text'> </input> 
                                </td>
                        </tr>
                        <tr>
                                <td>
-                                       <span style='padding: 5px;'>Share this Bookbag</span>
-                                       <a class='classic_link' href='javascript:alert($("bb_publish_text").innerHTML);'>(<b>??</b>)</a>
-                                       <span>Yes</span> <input type='radio' name='bb_public' id='bb_public_yes'/>
-                                       <span>No</span> <input type='radio' name='bb_public' id='bb_public_no' checked='checked'/>
+                                       <span style='padding: 5px;'>&myopac.bookbag.share;</span>
+                                       <a class='classic_link' href='javascript:alert($("bb_publish_text").innerHTML);'><b>&common.help;</b></a>
+                                       <span>&common.yes;</span> <input type='radio' name='bb_public' id='bb_public_yes'/>
+                                       <span>&common.no;</span> <input type='radio' name='bb_public' id='bb_public_no' checked='checked'/>
                                        <input style='padding-left: 10px;' onclick='myOPACCreateBookbag();' 
                                                type='submit' value='&common.submit;'> </input>
                                </td>
        <div style='width: 99%; text-align: center'> <b id='myopac_bookbag_items_name'> </b></div>
 
        <div class='hide_me' style='width: 100%; text-align: center; font-weight: 700; margin-top: 10px;'
-               id='myopac_bookbag_no_items'>The selected bookbag contains no items...</div>
+               id='myopac_bookbag_no_items'>&myopac.bookbag.no.items;</div>
 
        <table width='100%' class='hide_me data_grid data_grid_center' id='myopac_bookbag_items_table'>
                <thead> 
-                       <tr> <td>Title</td> <td>Authors</td> <td>Remove this item?</td> </tr> 
+                       <tr> <td>&common.title;</td> <td>&common.authors;</td> <td>&myopac.bookbag.remove;</td> </tr> 
                </thead>
                <tbody id='myopac_bookbag_items_tbody'>
                        <tr id='myopac_bookbag_items_row'>
                                <td> <a name='myopac_bookbag_items_author' class='classic_link'> </a> </td>
                                -->
                                <td name='myopac_bookbag_items_author'> </td>
-                               <td><a name='myopac_bookbag_items_remove' class='classic_link'>remove</a></td>  
+                               <td><a name='myopac_bookbag_items_remove' class='classic_link'>&myopac.remove.link;</a></td>    
                        </tr>
                </tbody>
        </table>
        <!--</div>-->
 
        <span id='bb_publish_text' class='hide_me'>
-               Sharing a Bookbag means that the contents of the Bookbag will be visible to others.  
-               To see the public view of a shared Bookbag, click the "View" link in the 
-               "Shared" column of the Bookbag list at the top of this page.
+               &myopac.publish.text;
        </span>
 
        <span id='myopac_remove_bb_item_confirm' class='hide_me'>
-               Are you sure you wish to remove this bookbag item?
+               &myopac.item.confirm;
        </span>
 
        <span id='myopac_make_published_confirm' class='hide_me'>
-               Sharing this bookbag will allow the contents 
-               of the bookback to be seen by others.
-               Are you sure you wish to share this bookbag?  
+               &myopac.publish.confirm;
        </span>
 
        <span id='myopac_make_unpublished_confirm' class='hide_me'>
-               Are you sure you wish to hide this bookbag?
+               &myopac.unpublish.confirm;
        </span>
 
        <span id='myopac_bb_update_success' class='hide_me'>
-               The Bookbag was successfully updated.
+               &myopac.update.success;
        </span>
 
        <span id='bb_create_warning' class='hide_me'>
-               Warning: Adding items to a bookbag creates a link between you and the
-               items in the database.  The contents of the bookbag are NOT publicly 
-               viewable unless the bookbag is shared. However, if you prefer not to
-               have any link between your patron record and a particular item or items,
-               we suggest that you do not place said items in a bookbag or that you 
-               avoid using bookbags all together.  Thank you.
+               &myopac.create.warning;
        </span>
 
        <span id='myopac_bb_what_are' class='hide_me'>
-               Bookbags are...
+               &myopac.describe.bookbags;
        </span>
 
        <span class='hide_me' id='bb_update_success'>
-               Bookbag successfully updated
+               &myopac.updated.success;
        </span>
 
 </div>
index de03d47..db129c0 100644 (file)
@@ -4,20 +4,20 @@
        <table width='100%' class='data_grid data_grid_center'>
 
                <thead class='color_3'>
-                       <tr><td colspan='3' style='padding: 6px'><b>Summary</b></td></tr>
+                       <tr><td colspan='3' style='padding: 6px'><b>&myopac.fines.title;</b></td></tr>
                        <tr>
-                               <td width='33%'>Total Owed</td>
-                               <td width='33%'>Total Paid</td>
-                               <td width='33%'>Balance Owed</td>
+                               <td width='33%'>&myopac.fines.owed;</td>
+                               <td width='33%'>&myopac.fines.paid;</td>
+                               <td width='33%'>&myopac.fines.balance;</td>
                        </tr>
                </thead>
 
                <tbody id='myopac_fines_summary_tbody'>
-                       <tr id='myopac_fines_summary_loading'><td>Loading...</td></tr>
+                       <tr id='myopac_fines_summary_loading'><td>&myopac.fines.status;</td></tr>
                        <tr id='myopac_fines_summary_row' class='hide_me'>
-                               <td id='myopac_fines_summary_total' >$</td>
-                               <td id='myopac_fines_summary_paid' >$</td>
-                               <td id='myopac_fines_summary_balance' style='color:red;font-weight: bold;'>$</td>
+                               <td id='myopac_fines_summary_total' >&common.currency;</td>
+                               <td id='myopac_fines_summary_paid' >&common.currency;</td>
+                               <td id='myopac_fines_summary_balance' style='color:red;font-weight: bold;'>&common.currency;</td>
                        </tr>
                </tbody>
        </table>
                <br/><hr/><br/>
                <table width='100%' class='data_grid data_grid_center' id='myopac_circ_trans_table'>
                        <thead>
-                               <tr><td colspan='10' style='padding: 6px'><b>Overdue Materials</b></td></tr>
+                               <tr><td colspan='10' style='padding: 6px'><b>&myopac.fines.overdue;</b></td></tr>
                                <tr>
-                                       <td>Title</td>
-                                       <td>Author</td>
-                                       <td>Checkout Date</td>
-                                       <td>Due Date</td>
-                                       <td>Date Returned</td>
-                                       <td>Balance Owed</td>
+                                       <td>&common.title;</td>
+                                       <td>&common.author;</td>
+                                       <td>&myopac.fines.checkout;</td>
+                                       <td>&myopac.fines.due;</td>
+                                       <td>&myopac.fines.returned;</td>
+                                       <td>&myopac.fines.balance;</td>
                                </tr>
                        </thead>
                        <tbody id='myopac_circ_trans_tbody'>
                                        <td name='myopac_circ_trans_author'> </td>
                                        <td name='myopac_circ_trans_start'> </td>
                                        <td name='myopac_circ_trans_due'> </td>
-                                       <td name='myopac_circ_trans_finished'><span style='color:red;'>(fines accruing)</span></td>
+                                       <td name='myopac_circ_trans_finished'><span style='color:red;'>&myopac.fines.accruing;</span></td>
                                        <td>
                                                <span style='color: red; font-weight: bold;' 
-                                                       name='myopac_circ_trans_balance'>$</span>
+                                                       name='myopac_circ_trans_balance'>&common.currency;</span>
                                        </td>
                                </tr>
                        </tbody>
                <br/><hr/><br/>
                <table width='100%' class='data_grid data_grid_center' id='myopac_trans_table'>
                        <thead>
-                               <tr><td colspan='8' style='padding: 6px'><b>Other Fees</b></td></tr>
+                               <tr><td colspan='8' style='padding: 6px'><b>&myopac.fines.other;</b></td></tr>
                                <tr>
-                                       <td width='12%'>Transaction Start Time</td>
-                                       <td width='12%'>Last Payment Time</td>
-                                       <td width='12%'>Initial Amount Owed</td>
-                                       <td width='12%'>Total Amount Paid</td>
-                                       <td width='12%'>Balance Owed</td>
-                                       <td width='12%'>Billing Type</td>
+                                       <td width='12%'>&myopac.fines.time.start;</td>
+                                       <td width='12%'>&myopac.fines.time.paid;</td>
+                                       <td width='12%'>&myopac.fines.owed.initial;</td>
+                                       <td width='12%'>&myopac.fines.paid.amount;</td>
+                                       <td width='12%'>&myopac.fines.balance;</td>
+                                       <td width='12%'>&myopac.fines.type;</td>
                                </tr>
                        </thead>
        
                                <tr id='myopac_trans_row'>
                                        <td name='myopac_trans_start'> </td>
                                        <td name='myopac_trans_last_payment'> </td>
-                                       <td name='myopac_trans_init_amount'>$</td>
-                                       <td name='myopac_trans_total_paid'>$</td>
+                                       <td name='myopac_trans_init_amount'>&common.currency;</td>
+                                       <td name='myopac_trans_total_paid'>&common.currency;</td>
                                        <td style='color:red; font-weight: bold;'>
                                                <span name='myopac_trans_balance_recur' class='hide_me'> * </span>
-                                               <span name='myopac_trans_balance'>$</span>
+                                               <span name='myopac_trans_balance'>&common.currency;</span>
                                        </td>
                                        <td name='myopac_trans_bill_type'> </td>
                                </tr>
index d9c39ed..df0189d 100644 (file)
@@ -7,21 +7,21 @@
 
                <thead class='color_3'>
                        <tr>
-                               <td width='30%'>Title</td>
-                               <td width='30%'>Author</td>
-                               <td>Formats</td>
-                               <td>Pickup Location</td>
-                               <td>Status</td>
-                               <td>Edit/Cancel</td>
+                               <td width='30%'>&common.title;</td>
+                               <td width='30%'>&common.author;</td>
+                               <td>&myopac.holds.formats;</td>
+                               <td>&myopac.holds.location;</td>
+                               <td>&common.status;</td>
+                               <td>&myopac.holds.edit.cancel;</td>
                        </tr>
                </thead>
 
                <tbody id='myopac_holds_tbody'>
 
                        <tr id='myopac_holds_none' class='hide_me'>
-                               <td colspan='10'><b>You have no items on hold at this time</b></td>
+                               <td colspan='10'><b>&myopac.holds.status.none;</b></td>
                        </tr>
-                       <tr id='myopac_holds_loading'><td>Loading...</td></tr>
+                       <tr id='myopac_holds_loading'><td>&myopac.loading;</td></tr>
 
                        <tr id='myopac_holds_row' class='hide_me'>
 
 
                                <td name='myopac_holds_location'></td>
                                <td>
-                                       <span class='hide_me' name='hold_status_waiting'>Waiting for copy</span>
-                                       <span class='hide_me' name='hold_status_transit'>In Transit</span>
-                                       <span class='hide_me' name='hold_status_available'><b style='color:red'>Ready for Pickup</b></span>
+                                       <span class='hide_me' name='hold_status_waiting'>&myopac.holds.status.waiting;</span>
+                                       <span class='hide_me' name='hold_status_transit'>&myopac.holds.status.intransit;</span>
+                                       <span class='hide_me' name='hold_status_available'><b style='color:red'></b></span>
                                </td>
 
                                <td name='myopac_holds_cancel' style='border-left: 3px solid #E0E0E0; border-right: 3px solid #E0E0E0;'>
                                        <a href='javascript:void(0);' 
-                                               name='myopac_holds_edit_link' class='classic_link'>Edit</a>
+                                               name='myopac_holds_edit_link' class='classic_link'>&myopac.holds.edit;</a>
                                        <a href='javascript:void(0);' 
-                                               name='myopac_holds_cancel_link' class='classic_link'>Cancel</a>
+                                               name='myopac_holds_cancel_link' class='classic_link'></a>
                                </td>
 
                        </tr>
@@ -58,7 +58,7 @@
        </table>
 
        <span class='hide_me' id='myopac_holds_cancel_verify'>
-               If you wish to cancel the selected hold, click OK, otherwise click Cancel.
+               &myopac.holds.verify;
        </span>
 
 </div>
index e86ed40..f360c8e 100644 (file)
@@ -6,15 +6,15 @@
                <thead>
                        <tr>
                                <td colspan='2' align='center'>
-                                       <b>Preferences</b>
+                                       <b>&myopac.prefs.title;</b>
                                </td>
                        </tr>
                </thead>
 
                <tbody id='myopac_prefs_tbody'>
-                       <tr id='myopac_prefs_loading'><td colspan='3'><b>Loading...</b></td></tr>
+                       <tr id='myopac_prefs_loading'><td colspan='3'><b>&myopac.loading;</b></td></tr>
                        <tr id='myopac_prefs_row'>
-                               <td width='50%'>Search hits per page</td>
+                               <td width='50%'>&myopac.prefs.hits;</td>
                                <td>
                                        <select id='prefs_hits_per'>
                                                <option value='5'>5</option>
 
                        <!-- FONT size preference -->
                        <tr>
-                               <td>Default Font Size</td>
+                               <td>&myopac.prefs.font;</td>
                                <td>
                                        <select id='prefs_def_font'>
-                                               <option value='regular'>Regular Font</option>
-                                               <option value='large'>Large Font</option>
+                                               <option value='regular'>&myopac.prefs.font.regular;</option>
+                                               <option value='large'>&myopac.prefs.font.large;</option>
                                        </select>
                                </td>
                        </tr>
                        <!-- default hold notification type -->
                        <tr>
                                <td>
-                                       <span>Default Hold Notification Method</span>
+                                       <span>&myopac.prefs.holds.notify;</span>
                                        <a class='classic_link' href='javascript:void(0);' 
-                                               onclick='alert($("myopac_pref_hold_notify_alert").textContent);' >(??)</a>
+                                               onclick='alert($("myopac_pref_hold_notify_alert").textContent);' >&common.help;</a>
                                </td>
                                <td>
                                        <select id='prefs_hold_notify'>
-                                               <option value='phone:email' selected='selected'>Use Phone and Email</option>
-                                               <option value='phone'>Use Phone Only</option>
-                                               <option value='email'>Use Email Only</option>
+                                               <option value='phone:email' selected='selected'>&myopac.prefs.holds.both;</option>
+                                               <option value='phone'>&myopac.prefs.holds.phone;</option>
+                                               <option value='email'>&myopac.prefs.holds.email;</option>
                                        </select>
                                </td>
                        </tr>
 
 
                        <tr>
-                               <td>Default Search Location</td>
+                               <td>&myopac.prefs.search.location;</td>
                                <td>
                                        <div style='margin-bottom: 5px;'>
                                                <input type='checkbox' id='myopac_pref_home_lib' 
                                                        onclick='
                                                                if( this.checked ) $("prefs_def_location").disabled = true;
                                                                else $("prefs_def_location").disabled = false;
-                                                       '> </input> Always search my home library by default.
+                                                       '> </input> &myopac.prefs.search.home; 
                                        </div>
                                        <select id='prefs_def_location'>
                                        </select>
@@ -72,7 +72,7 @@
                        </tr>
 
                        <tr>
-                               <td>Default Search Range</td>
+                               <td>&myopac.prefs.search.range;</td>
                                <td>
                                        <select id='prefs_def_range'>
                                        </select>
                        <tr>
                                <td align='center' class='color_3' colspan='2'>
                                        <button onclick='myOPACSavePrefs();' 
-                                               id='myopac_prefs_submit'>Save Preference Changes</button>
+                                               id='myopac_prefs_submit'>&myopac.prefs.save;</button>
                                </td>
                        </tr>
 
                </tbody>
        </table>
 
-       <div class='hide_me' id='prefs_update_success'>Preferences successfully updated</div>
-       <div class='hide_me' id='prefs_update_failure'>Preferences update failed!</div>
+       <div class='hide_me' id='prefs_update_success'>&myopac.prefs.save.success;</div>
+       <div class='hide_me' id='prefs_update_failure'>&myopac.prefs.save.failed;</div>
        <span class='hide_me' id='myopac_pref_hold_notify_alert'>
-               This setting defines how you will be notified of holds that are ready to be picked up from the library.
-               By default, holds will use the notification style you choose here.  
-               However, you will still have the option to change individual holds regardless of this setting.
+               &myopac.prefs.help;
        </span>
 
 </div>
index 56086e6..02235a7 100644 (file)
@@ -7,8 +7,7 @@
             <tbody>
                 <tr>
                     <td width='100%' style='color:red;'>
-                        Your account expired on <span id='myopac.expired.date'/>!  
-                        Please see a librarian to renew your account.
+                       &myopac.summary.expired;
                     </td>
                 </tr>
             </tbody>
@@ -19,7 +18,7 @@
                <table class='data_grid' width='100%'>
                        <thead>
                                <tr>
-                                       <td colspan='2'><b> * Staff Notes *</b></td>
+                                       <td colspan='2'><b> &myopac.summary.notes;</b></td>
                                </tr>
                        </thead>
                        <tbody id='myopac.notes.tbody'>
@@ -36,7 +35,7 @@
        <table width='70%' class='light_border myopac_summary_table'>
                <tbody id='myopac_summary_tbody'>
                        <tr>
-                               <td width='30%' class='color_4 light_border'>Name</td>
+                               <td width='30%' class='color_4 light_border'>&common.name;</td>
                                <td class='light_border'>
                                        <span id='myopac_summary_first' style='padding-right: 5px;'> </span> 
                                        <span id='myopac_summary_middle' style='padding-right: 5px;'> </span> 
                        </tr>
 
                        <tr>
-                               <td class='color_4 light_border'>Day Phone</td>
+                               <td class='color_4 light_border'>&myopac.summary.phone.day;</td>
                                <td class='light_border' id='myopac_summary_dayphone'> </td>
                        </tr>
                        <tr>
-                               <td class='color_4 light_border'>Evening Phone</td>
+                               <td class='color_4 light_border'>&myopac.summary.phone.evening;</td>
                                <td class='light_border' id='myopac_summary_eveningphone'> </td>
                        </tr>
                        <tr>
-                               <td class='color_4 light_border'>Other Phone</td>
+                               <td class='color_4 light_border'>&myopac.summary.phone.other;</td>
                                <td class='light_border' id='myopac_summary_otherphone'> </td>
                        </tr>
                        <tr>
-                               <td class='color_4 light_border'>Username</td>
+                               <td class='color_4 light_border'>&common.username;</td>
                                <td class='light_border' id='myopac_summary_username'> </td>
                                <td class='light_border'><a href='javascript:void(0);' 
                                        onclick='unHideMe($("myopac_update_username_row"));$("myopac_new_username").focus();'
-                                       id='myopac_summary_username_change' style='text-decoration: underline;'>Change</a></td>
+                                       id='myopac_summary_username_change' style='text-decoration: underline;'>&myopac.summary.change;</a></td>
                        </tr>
 
                        <tr id='myopac_update_username_row' class='hide_me'>
                                <td class='myopac_update_cell' colspan='3'>
-                                       <span class='myopac_update_span'>Enter new username: </span>
+                                       <span class='myopac_update_span'>&myopac.summary.username.enter; </span>
                                        <input type='text' size='24' id='myopac_new_username'
                                                onkeydown='if(userPressedEnter(event)) myOPACUpdateUsername();'> </input>
                                        <span class='myopac_update_span'>
-                                               <button onclick='myOPACUpdateUsername();'>Submit</button>
+                                               <button onclick='myOPACUpdateUsername();'>&common.submit;</button>
                                        </span>
                                        <span class='myopac_update_span'>
-                                               <button onclick='hideMe($("myopac_update_username_row"));'>Cancel</button>
+                                               <button onclick='hideMe($("myopac_update_username_row"));'>&common.cancel;</button>
                                        </span>
                                </td>
                        </tr>
 
 
                        <tr>
-                               <td class='color_4 light_border'>Password</td>
-                               <td class='light_border' id='myopac_summary_password'>(not shown)</td>
+                               <td class='color_4 light_border'>&common.password;</td>
+                               <td class='light_border' id='myopac_summary_password'>&myopac.summary.password.text;</td>
                                <td class='light_border'><a href='javascript:void(0);' 
                                        onclick='unHideMe($("myopac_update_password_row"));$("myopac_current_password").focus();'
-                                       id='myopac_summary_password_change' style='text-decoration: underline;'>Change</a></td>
+                                       id='myopac_summary_password_change' style='text-decoration: underline;'>&myopac.summary.change;</a></td>
                        </tr>
 
                        <tr id='myopac_update_password_row' class='hide_me'>
 
                                        <table><tbody>
                                                <tr>
-                                                       <td><span class='myopac_update_span'>Enter current password: </span></td>
+                                                       <td><span class='myopac_update_span'>&myopac.summary.password.current; </span></td>
                                                        <td><input type='password' size='24' id='myopac_current_password'
                                                                onkeydown='if(userPressedEnter(event)) myOPACUpdatePassword();'> </input></td>
                                                </tr>
                                                <tr>
-                                                       <td><span class='myopac_update_span'>Enter new password: </span></td>
+                                                       <td><span class='myopac_update_span'>&myopac.summary.password.new; </span></td>
                                                        <td><input type='password' size='24' id='myopac_new_password'
                                                                onkeydown='if(userPressedEnter(event)) myOPACUpdatePassword();'> </input></td>
                                                </tr>
                                                <tr>
-                                                       <td><span class='myopac_update_span'>Re-Enter new password: </span></td>
+                                                       <td><span class='myopac_update_span'>&myopac.summary.password.reenter; </span></td>
                                                        <td><input type='password' size='24' id='myopac_new_password2'
                                                                onkeydown='if(userPressedEnter(event)) myOPACUpdatePassword();'> </input></td>
                                                </tr>
                                        </tbody></table>
 
                                        <span class='myopac_update_span'>
-                                               <button onclick='myOPACUpdatePassword();'>Submit</button>
+                                               <button onclick='myOPACUpdatePassword();'>&common.submit;</button>
                                        </span>
                                        <span class='myopac_update_span'>
-                                               <button onclick='hideMe($("myopac_update_password_row"));'>Cancel</button>
+                                               <button onclick='hideMe($("myopac_update_password_row"));'>&common.cancel;</button>
                                        </span>
                                </td>
                        </tr>
 
                        <tr>
-                               <td class='color_4 light_border'>Email Address</td>
+                               <td class='color_4 light_border'>&myopac.summary.email;</td>
                                <td class='light_border' id='myopac_summary_email'> </td>
                                <td class='light_border'><a href='javascript:void(0);' 
                                        onclick='unHideMe($("myopac_update_email_row"));$("myopac_new_email").focus();'
-                                       id='myopac_summary_email_change' style='text-decoration: underline;'>Change</a></td>
+                                       id='myopac_summary_email_change' style='text-decoration: underline;'>&myopac.summary.change;</a></td>
                        </tr>
 
                        <tr id='myopac_update_email_row' class='hide_me'>
                                <td class='myopac_update_cell' colspan='3'>
-                                       <span class='myopac_update_span'>Enter new email address: </span>
+                                       <span class='myopac_update_span'>&myopac.summary.email.new; </span>
                                        <input type='text' size='24' id='myopac_new_email'
                                                onkeydown='if(userPressedEnter(event)) myOPACUpdateEmail();'> </input>
                                        <span class='myopac_update_span'>
-                                               <button onclick='myOPACUpdateEmail();'>Submit</button>
+                                               <button onclick='myOPACUpdateEmail();'>&common.submit;</button>
                                        </span>
                                        <span class='myopac_update_span'>
-                                               <button onclick='hideMe($("myopac_update_email_row"));'>Cancel</button>
+                                               <button onclick='hideMe($("myopac_update_email_row"));'>&common.cancel;</button>
                                        </span>
                                </td>
                        </tr>
 
                        <tr>
-                               <td class='color_4 light_border'>Primary Identification</td>
+                               <td class='color_4 light_border'>&myopac.summary.id.primary;</td>
                                <td class='light_border' id='myopac_summary_ident1'> </td>
                        </tr>
                        <!--
                        </tr>
                        -->
                        <tr>
-                               <td class='color_4 light_border'>Active Barcode</td>
+                               <td class='color_4 light_border'>&myopac.summary.barcode;</td>
                                <td class='light_border' id='myopac_summary_barcode'> </td>
                        </tr>
                        <tr>
-                               <td class='color_4 light_border'>Home Library</td>
+                               <td class='color_4 light_border'>&myopac.summary.home;</td>
                                <td class='light_border' id='myopac_summary_homelib'> </td>
                        </tr>
                        <tr>
-                               <td class='color_4 light_border'>Account Creation Date</td>
+                               <td class='color_4 light_border'>&myopac.summary.genesis;</td>
                                <td class='light_border' id='myopac_summary_create_date'> </td>
                        </tr>
 
        -->
        <table width='100%' class='light_border data_grid'>
                <thead class='color_4'>
-                       <tr><td style='background: none; border-bottom: none' align='center' colspan='7'><b>Addresses</b></td></tr>
+                       <tr><td style='background: none; border-bottom: none' align='center' colspan='7'><b>&myopac.summary.addresses;</b></td></tr>
                        <tr>
-                               <td width='16%'>Address Type</td>
-                               <td width='16%'>Street</td>
-                               <td width='16%'>City</td>
-                               <td width='16%'>County</td>
-                               <td width='16%'>State</td>
-                               <td width='16%'>Zip</td>
+                               <td width='16%'>&myopac.summary.address.type;</td>
+                               <td width='16%'>&myopac.summary.address.street;</td>
+                               <td width='16%'>&myopac.summary.address.city;</td>
+                               <td width='16%'>&myopac.summary.address.county;</td>
+                               <td width='16%'>&myopac.summary.address.state;</td>
+                               <td width='16%'>&myopac.summary.address.zip;</td>
                        </tr>
                </thead>
 
                </tbody>
        </table>
 
-       <div class='hide_me' id='myopac_username_error'>Please enter a username</div>
+       <div class='hide_me' id='myopac_username_error'>&myopac.summary.username.error;</div>
        <div class='hide_me' id='myopac_username_dup'>
-               The requested username is not available.  Please choose a different username.
+               &myopac.summary.username.dup;
        </div>
-       <div class='hide_me' id='myopac_username_success'>Username successfully updated</div>
-       <div class='hide_me' id='myopac_username_failure'>Username update failed</div>
+       <div class='hide_me' id='myopac_username_success'>&myopac.summary.username.success;</div>
+       <div class='hide_me' id='myopac_username_failure'>&myopac.summary.username.failure;</div>
 
-       <div class='hide_me' id='myopac_email_error'>Please enter a valid email address</div>
-       <div class='hide_me' id='myopac_email_success'>Email address successfully updated</div>
-       <div class='hide_me' id='myopac_email_failure'>Email address update failed</div>
+       <div class='hide_me' id='myopac_email_error'>&myopac.summary.email.error;</div>
+       <div class='hide_me' id='myopac_email_success'>&myopac.summary.email.success;</div>
+       <div class='hide_me' id='myopac_email_failure'>&myopac.summary.email.failed;</div>
 
-       <div class='hide_me' id='myopac_password_error'>Passwords are empty or do not match</div>
-       <div class='hide_me' id='myopac_password_success'>Password successfully updated</div>
-       <div class='hide_me' id='myopac_password_failure'>Password update failed</div>
-       <span class='hide_me' id='myopac_invalid_username'>Username cannot contain spaces</span>
+       <div class='hide_me' id='myopac_password_error'>&myopac.summary.password.error;</div>
+       <div class='hide_me' id='myopac_password_success'>&myopac.summary.password.success;</div>
+       <div class='hide_me' id='myopac_password_failure'>&myopac.summary.password.failure;</div>
+       <span class='hide_me' id='myopac_invalid_username'>&myopac.summary.username.invalid;</span>
 </div>
 
 
index 6c93feb..a8a807f 100644 (file)
@@ -4,7 +4,7 @@
     <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/DP_DateExtensions.js'/>
 
        <script> config.ids.altcanvas.myopac_reload = 'myopac_reloading'; </script>
-       <div id='myopac_reloading' class='hide_me non_canvas'> Loading... </div>
+       <div id='myopac_reloading' class='hide_me non_canvas'> &common.loading; </div>
 
        <script language='javascript'>
                config.ids.myopac = {};
 
                                <td class='myopac_link' id='myopac_summary_td' >
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("summary");'> Account Summary</a>
+                                               onclick='myOPACChangePage("summary");'>&myopac.account;</a>
                                </td>
 
                                <td class='myopac_link' id='myopac_checked_td' >
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("checked");'>Items Checked Out</a>
+                                               onclick='myOPACChangePage("checked");'>&myopac.checkouts;</a>
                                </td>
 
                                <td class='myopac_link' id='myopac_holds_td' >
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("holds");'>Items on Hold</a>
+                                               onclick='myOPACChangePage("holds");'>&myopac.holds;</a>
                                </td>
 
                                <td class='myopac_link' id='myopac_fines_td' >
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("fines");'>Fines</a>
+                                               onclick='myOPACChangePage("fines");'>&myopac.fines;</a>
                                </td>
 
                                <td class='myopac_link' id='myopac_prefs_td' >
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("prefs");'>Account Preferences</a>
+                                               onclick='myOPACChangePage("prefs");'>&myopac.preferences;</a>
                                </td>
 
                                <td class='myopac_link' id='myopac_bookbag_td' nowrap='nowrap'>
@@ -51,7 +51,7 @@
                                        <span><img src='../../../../images/bookbag.gif' style='width: 25px; height: 25px;'> </img></span>
                                        -->
                                        <a href='javascript:void(0);' 
-                                               onclick='myOPACChangePage("bookbag");'>My Bookbags</a>
+                                               onclick='myOPACChangePage("bookbag");'>&myopac.bookbags;</a>
 
                                </td>
 
index bb457c7..479a296 100644 (file)
                                <td style='vertical-align: top;'>
 
                                        <span>
-                                               Result <span id='np_offset'> </span>
+                                               &rdetail.result; <span id='np_offset'> </span>
                                                <span> &common.of; </span>
                                                <span id='np_count'> </span>
                                        </span>
        
                                        <span style='padding-left: 40px;' >
                                                <a class='np_nav_link classic_link hide_me' id='np_start'
-                                                       href='javascript:rdetailStart();' title="First results page">Start</a>
+                                                       href='javascript:rdetailStart();' title="&rdetail.page.results;">&rdetail.start;</a>
                                                <a class='np_nav_link classic_link hide_me' id='np_prev'
-                                                       href='javascript:rdetailPrev();' title='Previus page'>&lt;&lt;</a>
+                                                       href='javascript:rdetailPrev();' title='&rdetail.page.previous;'>&lt;&lt;</a>
                                                <span> </span>
                                                <a  class='np_nav_link classic_link hide_me' id='np_next'
-                                                       href='javascript:rdetailNext();' title='Next Page'>&gt;&gt;</a>
+                                                       href='javascript:rdetailNext();' title='&rdetail.page.next;'>&gt;&gt;</a>
                                                <a class='np_nav_link classic_link hide_me' id='np_end'
-                                                       href='javascript:rdetailEnd();' title="Last results page">End</a>
+                                                       href='javascript:rdetailEnd();' title="&rdetail.page.last;">&rdetail.end;</a>
                                        </span>
        
                                </td>
 
                                <td align='right' style='padding-right: 7px;' width='33%'>
                                        <span style='padding-right: 7px;'>
-                                               <a id='rdetail_place_hold' class='classic_link'>Place Hold</a>
+                                               <a id='rdetail_place_hold' class='classic_link'>&opac.holds.placeHold;</a>
                                        </span>
                                        <span style='padding-right: 7px;' class='hide_me' id='rdetail_more_actions'>
                                                <select id='rdetail_more_actions_selector' style='max-width: 11em;'>
-                                                       <option value='start'>More Actions...</option>
+                                                       <option value='start'>&rdetail.more;</option>
                                                        <option disabled='disabled'>--------------</option>
-                                                       <option disabled='disabled'>Add to Bookbag</option>
+                                                       <option disabled='disabled'>&rdetail.bookbag.add;</option>
                                                        <option disabled='disabled'>--------------</option>
-                                                       <option value='new_bookbag' onclick='rdetailNewBookbag();'>Create a new bookbag</option>
+                                                       <option value='new_bookbag' onclick='rdetailNewBookbag();'>&rdetail.bookbag.create;</option>
                                                </select>
                                        </span>
 
 
        <div style='font-weight: bold; padding: 5px; margin: 5px; background: #E0F0E0; width: 100%;' 
                class='hide_me' id='rdetail_deleted_exp'>
-                       This record has been deleted from the database.  
-                       We recommend that you remove this title from any bookbags it may have been added to.
+               &rdetail.record.deleted;
        </div>
 
        <!--#include virtual="rdetail/rdetail_summary.xml"-->
        <br/><br/>
        <!--#include virtual="rdetail/rdetail_extras.xml"-->
 
-       <div class='hide_me' id='rdetail_bb_none'>(none)</div>
-       <div class='hide_me' id='rdetail_bb_item_success'>Item successfully added to Bookbag</div>
-       <div class='hide_me' id='rdetail_bb_new'>Enter the name of the new bookbag</div>
-       <div class='hide_me' id='rdetail_bb_success'>Bookbag successfully created</div>
+       <div class='hide_me' id='rdetail_bb_none'>&rdetail.none;</div>
+       <div class='hide_me' id='rdetail_bb_item_success'>&rdetail.bookbag.add.success;</div>
+       <div class='hide_me' id='rdetail_bb_new'>&rdetail.bookbag.name;</div>
+       <div class='hide_me' id='rdetail_bb_success'>&rdetail.bookbag.create.success;</div>
 
 </div>
index 1a10718..cb21120 100644 (file)
@@ -6,17 +6,17 @@
                        <td colspan='10'>
                                <div style='text-align: center; margin-top: 6px; margin-bottom: 6px'>
                                
-                                       <a name='print' href='javascript:void(0);' class='classic_link'>print these details</a>
+                                       <a name='print' href='javascript:void(0);' class='classic_link'>&rdetail.print;</a>
                                        <table class='data_grid data_grid_center' style='width: 100%'>
                                                <thead>
                                                        <tr>
-                                                               <td width='33%'>Barcode</td>
-                                                               <td>Status</td>
-                                                               <td>Location</td>
-                                                               <td name='age_protect_label' class='hide_me'>Age Hold Protection</td>
-                                                               <td name='create_date_label' class='hide_me'>Create Date</td>
-                                                               <td name='holdable_label' class='hide_me'>Holdable</td>
-                                                               <td name='due_date_label' class='hide_me'>Due Date</td>
+                                                               <td width='33%'>&rdetail.cn.barcode;</td>
+                                                               <td>&common.status;</td>
+                                                               <td>&rdetail.cn.location;</td>
+                                                               <td name='age_protect_label' class='hide_me'>&rdetail.cn.hold.age;</td>
+                                                               <td name='create_date_label' class='hide_me'>&rdetail.cn.genesis;</td>
+                                                               <td name='holdable_label' class='hide_me'>&rdetail.cn.holdable;</td>
+                                                               <td name='due_date_label' class='hide_me'>&rdetail.cn.due;</td>
                                                        </tr>
                                                </thead>
                                                <tbody name='copies_tbody' class='copy_details_table' width='100%'>
 
                                                                <td>
                                                                        <span name='barcode'> </span>
-                                                                       <a class='hide_me classic_link copy_more_info' name='details_link'>more info...</a>
-                                                                       <a class='hide_me classic_link copy_more_info' name='less_details_link'>less info</a>
+                                                                       <a class='hide_me classic_link copy_more_info' name='details_link'>&rdetail.cn.more;</a>
+                                                                       <a class='hide_me classic_link copy_more_info' name='less_details_link'>&rdetail.cn.less;</a>
                                                                        <a class='hide_me classic_link copy_more_info' name='copy_hold_link' 
-                                                                               href='javascript:void(0);'>place hold</a>
+                                                                               href='javascript:void(0);'>&rdetail.cn.hold;</a>
                                                                </td>
 
                                                                <td name='status'> </td>
                                                                <td name='location'> </td>
-                                                               <td name='age_protect_value' class='hide_me'>- Disabled -</td>
+                                                               <td name='age_protect_value' class='hide_me'>&rdetail.cn.disabled;</td>
                                                                <td name='create_date_value' class='hide_me'> </td>
 
                                                                <td name='copy_holdable_td' class='hide_me'>
@@ -52,8 +52,8 @@
                                                                                <tbody name='extras_tbody'>
                                                                                        <tr name='extras_row' class='hide_me'>
                                                                                                <td name='type' width='20%'> 
-                                                                                                       <span name='note' class='hide_me'><b>Copy Note</b></span>
-                                                                                                       <span name='cat' class='hide_me'><b>Copy Category</b></span>
+                                                                                                       <span name='note' class='hide_me'><b>&rdetail.cn.note;</b></span>
+                                                                                                       <span name='cat' class='hide_me'><b>&rdetail.cn.category;</b></span>
                                                                                                </td>
                                                                                                <td>
                                                                                                        <span name='key'> </span> : <span name='value'> </span>
        </tbody>
 </table>
 
-<span class='hide_me' id='rdetail.yes'>Yes</span>
-<span class='hide_me' id='rdetail.no'>No</span>
+<span class='hide_me' id='rdetail.yes'>&common.yes;</span>
+<span class='hide_me' id='rdetail.no'>&common.no;</span>
 
 
 <div id='rdetail_print_details' class='hide_me'>
        <div style='text-align: center; padding: 20px; width: 100%'>
                <div style='width:100%; border: 2px solid #E0F0E0; margin-bottom: 20px;'>
-                       <input type='submit' value='Print Page' onclick='window.print();'> </input>
+                       <input type='submit' value='&rdetail.cn.print;' onclick='window.print();'> </input>
                </div>
                <div name='body'> 
                        <table>
                                <tbody name='tbody'>
-                                       <tr><td>Library</td><td colspan='2' name='lib'></td></tr>
-                                       <tr><td>Title</td><td colspan='2' name='title'></td></tr>
-                                       <tr><td>Author</td><td colspan='2' name='author'></td></tr>
-                                       <tr><td>Edition</td><td colspan='2' name='edition'></td></tr>
-                                       <tr><td>Publication Date</td><td colspan='2' name='pubdate'></td></tr>
-                                       <tr><td>Publisher</td><td colspan='2' name='publisher'></td></tr>
-                                       <tr><td>Physical Description</td><td colspan='2' name='phys'></td></tr>
+                                       <tr><td>&common.library;</td><td colspan='2' name='lib'></td></tr>
+                                       <tr><td>&common.title;</td><td colspan='2' name='title'></td></tr>
+                                       <tr><td>&common.author;</td><td colspan='2' name='author'></td></tr>
+                                       <tr><td>&common.edition;</td><td colspan='2' name='edition'></td></tr>
+                                       <tr><td>&common.pubdate;</td><td colspan='2' name='pubdate'></td></tr>
+                                       <tr><td>&common.publisher;</td><td colspan='2' name='publisher'></td></tr>
+                                       <tr><td>&common.physical;</td><td colspan='2' name='phys'></td></tr>
                                        <tr>
                                                <td colspan='3' style='background: #E0F0E0;'> </td>
                                        </tr>
-                                       <tr name='cnrow'><td><b>Call Number</b></td><td><b colspan='2' name='cn'></b></td></tr>
+                                       <tr name='cnrow'><td><b>&common.callnumber;</b></td><td><b colspan='2' name='cn'></b></td></tr>
                                </tbody>
                        </table>
                </div>
index 970a1a7..6716f0e 100644 (file)
@@ -23,7 +23,7 @@
                        <tr>
                                <td  class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.library;</td>
                                <td  class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.callnumber;</td>
-                               <td  class='rdetail_copy_info_header_cell'>Actions</td>
+                               <td  class='rdetail_copy_info_header_cell'>&rdetail.copyInfo.actions;</td>
                                <td  nowrap='nowarp' class='rdetail_copy_info_header_cell' id='rdetail_copy_info_status'> 
                                        <div name='rdetail_status_cell'> </div>
                                </td>
                        <tr id='rdetail_copy_info_row' class='hide_me'>
                                <td name='rdetail_library_cell'>
                                        <a name='lib_print_link' class='hide_me classic_link' style='font-size: 8pt; padding-left: 20px;'>
-                                               Print Call Numbers for this library
+                                               &rdetail.copyInfo.print;
                                        </a>
                                </td>
                                <td name='rdetail_callnumber_cell'> </td>
                                <td name='rdetail_actions_cell'> 
                                        <div style='padding-bottom: 1px;'>
                                                <a style='font-size: 8pt;'
-                                                       name='details' class='classic_link'>details</a>
+                                                       name='details' class='classic_link'>&rdetail.copyInfo.details;</a>
                                        </div>
                                        <div style='margin-top: 2px;'>
                                                <a name='browse' style='font-size: 8pt;'
-                                                       class='classic_link'>browse</a>
+                                                       class='classic_link'>&rdetail.copyInfo.browse;</a>
                                        </div>
                                        <div style='margin-top: 2px;' name='hold_div' class='hide_me'>
                                                <a name='hold' style='font-size: 8pt;' href='javascript:void(0);'
-                                                       class='classic_link'>place hold</a>
+                                                       class='classic_link'>&rdetail.copyInfo.hold;</a>
                                        </div>
                                </td>
                                <td nowrap='nowrap' class='rdetail_copy_count_cell vertical' 
index 4d96e71..27c7b4a 100644 (file)
@@ -7,50 +7,50 @@
                                <td id='rdetail_copy_info_link' class='rdetail_extras_td rdetail_extras_selected' 
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("copyinfo");' 
-                                               class='classic_link'>Copy Summary</a>
+                                               class='classic_link'>&rdetail.extras.summary;</a>
                                </td>
 
                                <td id='rdetail_viewcn_link' class='rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("cn");' 
-                                               class='classic_link'>Shelf Browser</a>
+                                               class='classic_link'>&rdetail.extras.browser;</a>
                                </td>
 
                                <td id='rdetail_reviews_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("reviews");' 
-                                               class='classic_link'>Reviews</a>
+                                               class='classic_link'>&rdetail.extras.reviews;</a>
                                </td>
 
                                <td id='rdetail_toc_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("toc");' 
-                                               class='classic_link'>Table of Contents</a>
+                                               class='classic_link'>&rdetail.extras.toc;</a>
                                </td>
 
                                <td id='rdetail_excerpt_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("excerpt");' 
-                                               class='classic_link'>Excerpt</a>
+                                               class='classic_link'>&rdetail.extras.excerpt;</a>
                                </td>
 
                                <td id='rdetail_anotes_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("anotes");' 
-                                               class='classic_link'>Author Notes</a>
+                                               class='classic_link'>&rdetail.extras.author.notes;</a>
                                </td>
 
 
                                <td id='rdetail_annotation_link' class='hide_me rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("annotation");' 
-                                               class='classic_link'>Annotation</a>
+                                               class='classic_link'>&rdetail.extras.annotation;</a>
                                </td>
 
                                <td id='rdetail_viewmarc_link' class='rdetail_extras_td'
                                        style='padding-right: 15px; padding-left: 15px;' >
                                        <a href='javascript:rdetailShowExtra("marc");' 
-                                               class='classic_link'>MARC Record</a>
+                                               class='classic_link'>&rdetail.extras.marc;</a>
                                </td>
 
 
@@ -60,7 +60,7 @@
 
        <div id='rdetail_extras_div' style='width: 95%;'> 
                <div id='rdetail_extras_loading' class='hide_me' 
-                       style='padding: 10px;'>Loading...</div>
+                       style='padding: 10px;'>&common.loading;</div>
                <!--#include virtual="rdetail_copyinfo.xml"-->
 
                <div id='rdetail_reviews_div' class='rdetail_extras_div hide_me'> 
                <div id='rdetail_cn_browse_div' style='text-align: center;' class='hide_me'>
 
                        <div id='cn_browse_none' class='hide_me color_4' style='width: 90%; text-align: center; margin: 10px;'>
-                               There are no call numbers for this item at this location.
+                               &rdetail.extras.call.null;
                        </div>
 
                        <div id='rdetail_cn_browse_select_div' 
                                style='width: 100%; border: 1px solid black; padding: 6px; margin-top: 5px;'>
-                               <span>Local Call Numbers: </span>
+                               <span>&rdetail.extras.call.local; </span>
                                <select id='cn_browse_selector'>
                                </select>
                        </div>
index 58df735..9a41172 100644 (file)
                                                <img style='border: none;' id='rdetail_image'> </img>
                                        </a>
                                </td>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.title;</td>                
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>            
                                <td class='rdetail_item' id='rdetail_title'> </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.author;</td>               
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>           
                                <td class='rdetail_item'>
-                                       <a title='Perform an author search' id='rdetail_author'> </a>
+                                       <a title='&rdetail.author.search;' id='rdetail_author'> </a>
                                </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.isbn;</td>                 
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.isbn;</td>                     
                                <td class='rdetail_item' id='rdetail_isbn'> </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.edition;</td>              
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.edition;</td>          
                                <td class='rdetail_item' id='rdetail_edition'> </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.pubdate;</td>              
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.pubdate;</td>          
                                <td class='rdetail_item' id='rdetail_pubdate'> </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.publisher;</td>            
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.publisher;</td>                
                                <td class='rdetail_item' id='rdetail_publisher'> </td>
                        </tr>
 
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>Physical Description</td>              
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.physical;</td>         
                                <td class='rdetail_item' id='rdetail_physical_desc'> </td>
                        </tr>
 
                        <tr>
-                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.tor;</td>                  
+                               <td nowrap='nowrap' class='rdetail_desc'>&common.format;</td>                   
                                <td class='rdetail_item'>
                                        <img id='rdetail_tor_pic' class='tor_pic'> </img>
                                        <span id='rdetail_tor' style='padding-left: 5px;'> </span>
@@ -63,7 +63,7 @@
                        </tr>
 
                        <tr class='hide_me' id='rdetail_online_row'>
-                               <td nowrap='nowrap' class='rdetail_desc'>Online Resources</td>
+                               <td nowrap='nowrap' class='rdetail_desc'>&rdetail.summary.online;</td>
                                <td class='rdetail_item' id='rdetail_online'> </td>
                        </tr>
 
index ed65f39..8b7b3de 100644 (file)
@@ -6,7 +6,7 @@
                        <td style='vertical-align: top;'  id='next_prev_links'>
 
                                <span class='hide_me' id='result_info_div' style='font-size: 9pt;'>
-                                       <span> Results </span> 
+                                       <span> &common.results; </span> 
                                        <span id='offset_start'> </span>
                                        <span> - </span>
                                        <span id='offset_end'> </span>
                                <span id='start_end_links_span' class='hide_me' 
                                                style='padding-left: 40px;' >
                                        <a class='search_page_nav_link' id='search_home_link' 
-                                               title="First results page">Start</a><a class='search_page_nav_link' 
-                                                       id='prev_link' title='Previous page'>&lt;&lt;</a>
+                                               title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link' 
+                                                       id='prev_link' title='&rdetail.page.previous;'>&lt;&lt;</a>
 
                                        <span class='search_page_nav_link' id='page_numbers'> </span>
 
                                        <a  class='search_page_nav_link' id='next_link' 
-                                               title='Next Page'>&gt;&gt;</a><a class='search_page_nav_link' 
-                                                       id='end_link' title="Last results page">End</a>
+                                               title='&rdetail.page.next;'>&gt;&gt;</a><a class='search_page_nav_link' 
+                                                       id='end_link' title="&rdetail.page.last;">&rdetail.end;</a>
                                </span>
 
                        </td>
@@ -36,7 +36,7 @@
                        <td  colspan='5' 
                                style='padding-bottom: 4px; text-align:center; vertical-align: top; border-bottom: 1px solid #E0E0E0;'>
                                        <span id='search_info_table' class='hide_me' style='font-size: 8pt;'>
-                                               <b>Available copies / Total copies </b>
+                                               <b>&result.info.copies; </b>
                                        </span>
                        </td>
                </tr>
                                <div class='hide_me' id='no_formats' style='padding: 4px;'>
                                        <b>
                                                <span style='color:red;'>*</span>
-                                               No items with the selected format were found in this location.  
-                                               <div>Listed below are all items in the catalog with the chosen format.</div>
+                                               &result.info.no.items;
+                                               <div>&result.info.format.items;</div>
                                        </b>
                                </div>
 
                                <div class='hide_me' id='rresult_show_all' style='padding: 4px;'>
                                        <a href='javascript:rresultExpandSearch();' id='rresult_show_all_link' 
-                                               class='classic_link'>Show records for </a>
+                                               class='classic_link'>&result.info.show; </a>
                                </div>
 
                                <div class='hide_me' id='rresult_show_here' style='padding: 4px;'>
                                        <a href='javascript:rresultContractSearch();' id='rresult_show_here_link' 
-                                               class='classic_link'>Show records for </a>
+                                               class='classic_link'>&result.info.show; </a>
                                </div>
 
                        </td>
index 01dd9e7..0933ed1 100644 (file)
@@ -4,47 +4,45 @@
        <br/><br/><br/>
 
        <div style='text-align: center; padding-bottom: 8px;'>
-               <div id='result_low_hits_msg' class='hide_me'>Few hits were returned for your search.</div>
-               <div id='result_zero_hits_msg' class='hide_me'>Zero hits were returned for your search.</div>
+               <div id='result_low_hits_msg' class='hide_me'>&result.lowhits.few;</div>
+               <div id='result_zero_hits_msg' class='hide_me'>&result.lowhits.zero;</div>
        </div>
 
        <!-- spell checker -->
        <div id='did_you_mean' class='lowhits_div hide_me'>
-               <span>Did you mean</span>
+               <span>&result.lowhits.did.you.mean; </span>
                <a class='classic_link' id='spell_check_link'> </a>
-               <span>?</span>
        </div>
 
        <div id='low_hits_remove_format' class='lowhits_div hide_me'>
-               <span>You will find more hits when searching all item formats: </span>
-               <a id='low_hits_remove_format_link' class='classic_link'>Search again with all formats?</a>
+               <span>&result.lowhits.formats; </span>
+               <a id='low_hits_remove_format_link' class='classic_link'>&result.lowhits.formats.search;</a>
        </div>
 
        <div id='low_hits_cross_ref' class='lowhits_div hide_me'>
-               <span>You may also like to try these related searches:</span>
+               <span>&result.lowhits.related;</span>
                <div style='padding: 5px;'>
                        <a id='low_hits_xref_link' class='classic_link' style='padding-right: 5px;'> </a>
                </div>
        </div>
 
        <div id='low_hits_expand_range' class='lowhits_div hide_me'>
-               <span>You may also wish to expand you search range to: </span>
+               <span>&result.lowhits.expand; </span>
                <a id='low_hits_expand_link' class='classic_link' style='padding-right: 5px;'> </a>
        </div>
 
        <div id='low_hits_search_type' class='lowhits_div hide_me'>
-               <span>Would you like to try searching the same terms by</span>
+               <span>&result.lowhits.class;</span>
                <a id='low_hits_title_search' class='hide_me classic_link' 
-                       style='padding-right: 5px;'>title</a>
+                       style='padding-right: 5px;'>&result.lowhits.title;</a>
                <a id='low_hits_author_search' class='hide_me classic_link' 
-                       style='padding-right: 5px;'>author</a>
+                       style='padding-right: 5px;'>&result.lowhits.author;</a>
                <a id='low_hits_subject_search' class='hide_me classic_link' 
-                       style='padding-right: 5px;'>subject</a>
+                       style='padding-right: 5px;'>&result.lowhits.subject;</a>
                <a id='low_hits_series_search' class='hide_me classic_link' 
-                               style='padding-right: 5px;'>series</a>
+                               style='padding-right: 5px;'>&result.lowhits.series;</a>
                <a id='low_hits_keyword_search' class='hide_me classic_link' 
-                       style='padding-right: 5px;'>keyword</a>
-               <span>?</span>
+                       style='padding-right: 5px;'>&result.lowhits.keyword;</a>
        </div>
 
 </div>
index 5a8ff08..eb52a11 100644 (file)
@@ -37,7 +37,7 @@
 
                                                                <td class='result_table_title_cell' name='result_table_title_cell'>
                                                                        <!-- Title goes here -->
-                                                                       <a title="View titles for this record" name='item_title' class='search_link'> 
+                                                                       <a title="&result.table.keyword;" name='item_title' class='search_link'> 
                                                                                <!-- Title goes here -->
                                                                        </a>
                                                                        <!-- Empty span used for creating unAPI links -->
@@ -54,7 +54,7 @@
                
                                                        <tr style='height: 1em' >
                                                                <td class='result_table_author_cell'>
-                                                                       <a title="Perform an Author Search" name='item_author' class='search_link'> 
+                                                                       <a title="&result.table.author;" name='item_author' class='search_link'> 
                                                                                <!-- Author goes here -->
                                                                        </a>
                                                                        <div>
 
                                                                        <span class='hide_me' name='place_hold_span'>
                                                                                <a style='padding-left: 8px;' href='javascript:void(0);' 
-                                                                                       class='classic_link' name='place_hold_link'>Place Hold</a>
+                                                                                       class='classic_link' name='place_hold_link'>&opac.holds.placeHold;</a>
                                                                        </span>
 
                                                                </td>
                 <td style='vertical-align: top;'  id='next_prev_links2'>
                         
                    <span class='hide_me' id='result_info_div2' style='font-size: 9pt;'>
-                      <span> Results </span> 
+                      <span> &common.results; </span> 
                       <b id='offset_start2'> </b>
                       <span> - </span>
                       <b id='offset_end2'> </b>
                    <span id='start_end_links_span2' class='hide_me' 
                       style='padding-left: 40px;' >
                    <a class='search_page_nav_link' id='search_home_link2' 
-                      title="First results page">Start</a><a class='search_page_nav_link' 
-                      id='prev_link2' title='Previous page'>&lt;&lt;</a>
+                      title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link' 
+                      id='prev_link2' title='&rdetail.page.previous;'>&lt;&lt;</a>
             
                    <span class='search_page_nav_link' id='page_numbers2'> </span>
                       <a  class='search_page_nav_link' id='next_link2' 
-                         title='Next Page'>&gt;&gt;</a><a class='search_page_nav_link' 
-                         id='end_link2' title="Last results page">End</a>
+                         title='&rdetail.page.next;'>&gt;&gt;</a><a class='search_page_nav_link' 
+                         id='end_link2' title="&rdetail.page.last;">&rdetail.end;</a>
                    </span>
                         
                 </td>
index 71fba14..7d06d77 100644 (file)
                Please fill in all fields.
        </span>
 
+    <span id='oils_rpt_report_exists' class='hide_me'>
+        There is already a report in this folder with the given name.
+    </span>
+
 </div>
index 83efd4c..8455217 100644 (file)
@@ -74,6 +74,7 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) {
        widgetArgs.calFormat = OILS_RPT_TRANSFORMS[transform].cal_format;
        widgetArgs.inputSize = OILS_RPT_TRANSFORMS[transform].input_size;
        widgetArgs.regex = OILS_RPT_TRANSFORMS[transform].regex;
+    widgetArgs.value = param.value;
 
        switch(transform) {
                case 'date':
@@ -182,6 +183,9 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) {
             break;
        }
 
+    if(widgetArgs.value != undefined) 
+        return new oilsRptTemplateWidget(widgetArgs);
+
 
        switch(param.op) {
                case 'in':
@@ -199,6 +203,7 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) {
                default:
                        return new atomicWidget(widgetArgs);
        }
+
 }
 
 
index 98d484c..778078a 100644 (file)
@@ -150,22 +150,33 @@ oilsRptReportEditor.prototype.save = function() {
        //return;
 
        var obj = this;
-       var req = new Request(OILS_RPT_CREATE_REPORT, SESSION, report, schedule );
-       req.callback(
-               function(r) {
-                       var res = r.getResultObject();
-                       if(checkILSEvent(res)) {
-                               alertILSEvent(res);
-                       } else {
-                               if( res && res != '0' ) {
-                                       oilsRptAlertSuccess();
-                                       oilsRptCurrentFolderManager.draw();
-                                       obj.folderWindow.draw();
-                               }
-                       }
-               }
-       );
-       req.send();
+    var folderReq = new Request(OILS_RPT_REPORT_EXISTS, SESSION, report);
+    folderReq.callback(
+        function(r1) {
+            if(r1.getResultObject() == 1) {
+                alertId('oils_rpt_report_exists');
+                return;
+            } else {
+                var req = new Request(OILS_RPT_CREATE_REPORT, SESSION, report, schedule );
+                req.callback(
+                    function(r) {
+                        var res = r.getResultObject();
+                        if(checkILSEvent(res)) {
+                            alertILSEvent(res);
+                        } else {
+                            if( res && res != '0' ) {
+                                oilsRptAlertSuccess();
+                                oilsRptCurrentFolderManager.draw();
+                                obj.folderWindow.draw();
+                            }
+                        }
+                    }
+                );
+                req.send();
+            }
+        }
+    );
+    folderReq.send();
 }
 
 
index f14a2f3..e890204 100644 (file)
@@ -42,12 +42,12 @@ var OILS_RPT_TRANSFORMS = {
    */
 
        lower : {
-               datatype : OILS_RPT_DTYPE_STRING,
+               datatype : [OILS_RPT_DTYPE_STRING, 'text'],
                label : 'Lower case'
        },
 
        upper : {
-               datatype : OILS_RPT_DTYPE_STRING,
+               datatype : [OILS_RPT_DTYPE_STRING, 'text'],
                label : 'Upper case'
        },
 
index 807361d..bf3594e 100644 (file)
@@ -55,7 +55,7 @@ var oilsPageXMid;
 var oilsPageYMid;
 
 var oilsIDLReportsNS = 'http://open-ils.org/spec/opensrf/IDL/reporter/v1';
-var oilsIDLPersistNS = 'http://open-ils.org/spec/opensrf/IDL/persistance/v1';
+var oilsIDLPersistNS = 'http://open-ils.org/spec/opensrf/IDL/persistence/v1';
 
 /* the current transform manager for the builder transform window */
 var oilsRptCurrentTform;
@@ -91,6 +91,8 @@ var OILS_RPT_FETCH_OUTPUT                     = 'open-ils.reporter:open-ils.reporter.schedule.retr
 var OILS_RPT_FETCH_REPORT                      = 'open-ils.reporter:open-ils.reporter.report.retrieve';
 var OILS_RPT_FETCH_TEMPLATE            = 'open-ils.reporter:open-ils.reporter.template.retrieve';
 var OILS_RPT_MAGIC_FETCH                       = 'open-ils.reporter:open-ils.reporter.magic_fetch';
+var OILS_RPT_REPORT_EXISTS      = 'open-ils.reporter:open-ils.reporter.report.exists';
+var OILS_RPT_TEMPLATE_EXISTS      = 'open-ils.reporter:open-ils.reporter.template.exists';
 
 var oilsRptCurrentFolderManager;
 
index 7b19f43..8c333e5 100644 (file)
@@ -400,7 +400,7 @@ oilsRptNumberWidget.prototype.getDisplayValue = function() {
 
 /* --------------------------------------------------------------------- 
        Relative dates widget
-       --------------------------------------------------------------------- */
+       -------------------------------------------------------------------- */
 
 function oilsRptNullWidget(args) {
     this.node = args.node;
@@ -411,9 +411,17 @@ oilsRptNullWidget.prototype.getValue = function() {
     return null;
 }
 
+function oilsRptTemplateWidget(args) {
+    this.node = args.node;
+    this.value = args.value;
+}
+oilsRptTemplateWidget.prototype.draw = function() {
+    this.node.appendChild(text(''+this.value));
+}
+
 /* --------------------------------------------------------------------- 
        Relative dates widget
-       --------------------------------------------------------------------- */
+       -------------------------------------------------------------------- */
 function oilsRptTruncPicker(args) {
        this.node = args.node;
        this.type = args.type;
index 4cf5222..ac88c33 100644 (file)
@@ -1,6 +1,6 @@
 
 var idlNS      = "http://opensrf.org/spec/IDL/base/v1";
-var persistNS  = "http://open-ils.org/spec/opensrf/IDL/persistance/v1";
+var persistNS  = "http://open-ils.org/spec/opensrf/IDL/persistence/v1";
 var objNS      = "http://open-ils.org/spec/opensrf/IDL/objects/v1";
 var rptNS      = "http://open-ils.org/spec/opensrf/IDL/reporter/v1";
 var gwNS       = "http://opensrf.org/-/namespaces/gateway/v1";
index c1d533d..d9e13f4 100644 (file)
@@ -840,9 +840,14 @@ function fleshFromPath ( template, rel ) {
                        current_obj.key = current_link.getAttribute('key');
 
                        if (
-                               current_link.getAttribute('reltype') != 'has_a' ||
-                               prev_type == 'left' ||
-                               rel.reltype != 'has_a'
+                               (
+                                       current_link.getAttribute('reltype') != 'has_a' ||
+                                       prev_type == 'left' ||
+                                       rel.reltype != 'has_a'
+                               ) && (
+                                       getKeys(rel.fields.filter_tab).length == 0 &&
+                                       getKeys(rel.fields.aggfitler_tab).length == 0
+                               )
                        ) current_obj.type = 'left';
 
                        prev_type = current_obj.type; 
@@ -860,12 +865,14 @@ function fleshFromPath ( template, rel ) {
 
                        if (join_link.getAttribute('reltype') != 'has_a') {
                                var fields_el = current_class.getElementsByTagName('fields')[0];
-                               join_field = fields_el.getAttributeNS(persistNS, 'primary') + '-' + join_link.getAttribute('key');
+                               join_field =
+                                       fields_el.getAttributeNS(persistNS, 'primary') +
+                                       '-' + join_link.getAttribute('class') +
+                                       '-' + join_link.getAttribute('key');
                        }
 
-                       current_obj.alias = hex_md5( current_path ) ;
+                       if (!current_obj.alias) current_obj.alias = hex_md5( current_path ) ;
                        join_field += '-' + current_obj.alias;
-                       if (table_path.length == 1) join_field += '-' + rel.alias;
 
                        if (!current_obj.join) current_obj.join = {};
                        if (!current_obj.join[join_field]) current_obj.join[join_field] = {};
@@ -908,10 +915,14 @@ function fleshTemplateField ( template, rel, tab_name, field ) {
 
        if (tab_name.match(/filter/)) {
                element.condition = {};
-               element.condition[tab[field].op] =
-                       tab[field].op_value.value ?
-                               tab[field].op_value.value :
-                               '::P' + param_count++;
+               if (tab[field].op == 'is' || tab[field].op == 'is not') {
+                       element.condition[tab[field].op] = null;
+               } else {
+                       element.condition[tab[field].op] =
+                               tab[field].op_value.value ?
+                                       tab[field].op_value.value :
+                                       '::P' + param_count++;
+               }
        }
 
        template[tab_use[tab_name]].push(element);
index 1103789..c901f34 100644 (file)
@@ -3,10 +3,30 @@ var OILS_RPT_DTYPE_MONEY = 'money';
 var OILS_RPT_DTYPE_BOOL = 'bool';
 var OILS_RPT_DTYPE_INT = 'int';
 var OILS_RPT_DTYPE_ID = 'id';
+var OILS_RPT_DTYPE_OU = 'org_unit';
 var OILS_RPT_DTYPE_FLOAT = 'float';
 var OILS_RPT_DTYPE_TIMESTAMP = 'timestamp';
-
-var OILS_RPT_DTYPE_ALL = [OILS_RPT_DTYPE_STRING,OILS_RPT_DTYPE_MONEY,OILS_RPT_DTYPE_INT,OILS_RPT_DTYPE_ID,OILS_RPT_DTYPE_FLOAT,OILS_RPT_DTYPE_TIMESTAMP,OILS_RPT_DTYPE_BOOL];
+var OILS_RPT_DTYPE_INTERVAL = 'interval';
+var OILS_RPT_DTYPE_LINK = 'link';
+var OILS_RPT_DTYPE_NONE = '';
+var OILS_RPT_DTYPE_NULL = null;
+var OILS_RPT_DTYPE_UNDEF;
+
+var OILS_RPT_DTYPE_ALL = [
+       OILS_RPT_DTYPE_STRING,
+       OILS_RPT_DTYPE_MONEY,
+       OILS_RPT_DTYPE_INT,
+       OILS_RPT_DTYPE_ID,
+       OILS_RPT_DTYPE_FLOAT,
+       OILS_RPT_DTYPE_TIMESTAMP,
+       OILS_RPT_DTYPE_BOOL,
+       OILS_RPT_DTYPE_OU,
+       OILS_RPT_DTYPE_NONE,
+       OILS_RPT_DTYPE_NULL,
+       OILS_RPT_DTYPE_UNDEF,
+       OILS_RPT_DTYPE_INTERVAL,
+       OILS_RPT_DTYPE_LINK
+];
 var OILS_RPT_DTYPE_NOT_ID = [OILS_RPT_DTYPE_STRING,OILS_RPT_DTYPE_MONEY,OILS_RPT_DTYPE_INT,OILS_RPT_DTYPE_FLOAT,OILS_RPT_DTYPE_TIMESTAMP];
 var OILS_RPT_DTYPE_NOT_BOOL = [OILS_RPT_DTYPE_STRING,OILS_RPT_DTYPE_MONEY,OILS_RPT_DTYPE_INT,OILS_RPT_DTYPE_FLOAT,OILS_RPT_DTYPE_TIMESTAMP,OILS_RPT_DTYPE_ID];
 
index 00e3d01..c6e70cd 100644 (file)
@@ -28,16 +28,16 @@ add_symlinks:
        ln -s ../../chrome/content/main/lang.js server/main/lang.js
        ln -s ../../chrome/content/main/simple_auth.xul server/main/simple_auth.xul
        ln -s ../../chrome/content/OpenILS/data.js server/OpenILS/data.js
-       (cd build/chrome/content/OpenSRF/; for x in *; do ln -s  ../../../build/chrome/content/OpenSRF/$$x ../../../../chrome/content/OpenSRF/$$x; done)
+       #(cd build/chrome/content/OpenSRF/; for x in *; do ln -s  ../../../build/chrome/content/OpenSRF/$$x ../../../../chrome/content/OpenSRF/$$x; done)
        (cd build/chrome/content/OpenILS/util/; for x in *; do if [ $$x != 'fmall.js' ]; then ln -s  ../../../../build/chrome/content/OpenILS/util/$$x ../../../../../chrome/content/OpenILS/util/$$x; fi ; done)
-       (cd build/chrome/content/legacy/; for x in [a-z]*; do ln -s  ../../../build/chrome/content/legacy/$$x ../../../../chrome/content/legacy/$$x; done)
+       #(cd build/chrome/content/legacy/; for x in [a-z]*; do ln -s  ../../../build/chrome/content/legacy/$$x ../../../../chrome/content/legacy/$$x; done)
        (cd build/chrome/locale/en-US/; for x in *; do ln -s  ../../../build/chrome/locale/en-US/$$x ../../../../chrome/locale/en-US/$$x; done)
 
 build_dir:
        @echo
        @echo '*********************************************************  Kludge, make sure these directories exists '
        mkdir -p chrome/locale/en-US/
-       mkdir -p chrome/content/OpenSRF/
+       #mkdir -p chrome/content/OpenSRF/
        @echo
        @echo '*********************************************************  Creating and populating build/ '
        mkdir -p build/
@@ -76,14 +76,14 @@ generated:
 open-ils:
        @echo
        @echo '********************************************************* Grabbing more OPAC code and legacy code and custom code'
-       cp ../../../OpenSRF/src/javascript/*.js build/chrome/content/OpenSRF/
+       #cp ../../../OpenSRF/src/javascript/*.js build/chrome/content/OpenSRF/
        cp ../../../Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
-       cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/marc* build/chrome/content/legacy/
-       cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/browse* build/chrome/content/legacy/
-       cp ../../../Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd build/chrome/locale/en-US/
-       cp -R ../../../Evergreen/xul/staff_client/server/ build/
+       #cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/marc* build/chrome/content/legacy/
+       #cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/browse* build/chrome/content/legacy/
+       #cp ../../../Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd build/chrome/locale/en-US/
+       #cp -R ../../../Evergreen/xul/staff_client/server/ build/
        external/prune_dirs.sh build/
-       find build/chrome/content/legacy/ -type f -name '*.*' -exec sed -i s/evergreen/open_ils_staff_client/g {} \;
+       #find build/chrome/content/legacy/ -type f -name '*.*' -exec sed -i s/evergreen/open_ils_staff_client/g {} \;
 
 custom:
        @echo
index 3685ce0..a9ebff4 100644 (file)
@@ -92,6 +92,19 @@ OpenILS.data.prototype = {
 
                                        // Convert soft path to object reference.  Error if any but the last node is undefined
                                        for (var i in path_list) stash = stash[ path_list[i] ];
+
+                                       /*
+
+                                       // experiment with storing only json in cache to avoid the [ ] -> { '0' : .., '1' : .. } bug
+
+                                       if (stash[observed_prop] && getKeys( obj.observers.cache[ full_path ] ).length == 0) {
+                                               stash['_' + observed_prop] = js2JSON(stash[observed_prop]);
+                                       }
+
+                                       stash.__defineSetter__(observed_prop, function(x) { this['_'+observed_prop] = js2JSON(x); });
+                                       stash.__defineGetter__(observed_prop, function() { return JSON2js(this['_'+observed_prop]); });
+                                       */
+
                                        stash.watch(
                                                observed_prop,
                                                function(p,old_value,new_value) {
@@ -596,6 +609,19 @@ OpenILS.data.prototype = {
                        function () {
                                obj.tree.aou = obj.list.aou;
                                obj.list.aou = util.fm_utils.flatten_ou_branch( obj.tree.aou );
+                               for (var i = 0; i < obj.list.aou.length; i++) {
+                                       var c = obj.list.aou[i].children();
+                                       if (!c) c = [];
+                                       c = c.sort(
+                                               function( a, b ) {
+                                                       if (a.shortname() < b.shortname()) return -1;
+                                                       if (a.shortname() > b.shortname()) return 1;
+                                                       return 0;
+                                               }
+                                       );
+                                       obj.list.aou[i].children( c );
+                               }
+                               obj.list.aou = util.fm_utils.flatten_ou_branch( obj.tree.aou );
                                obj.hash.aou = util.functional.convert_object_list_to_hash( obj.list.aou );
                        }
                );
index 9fc4d8c..aa82a3c 100644 (file)
                }
        }
 
+       function getKeys(o) {
+               var keys = [];
+               for (var k in o) keys.push(k);
+               return keys;
+       }
+
        function get_contentWindow(frame) {
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                if (frame && frame.contentWindow) {
index bc550fa..19a88cb 100644 (file)
@@ -55,39 +55,46 @@ util.date.db_date2Date = function (date) {
        return new Date(y,mo-1,d,h,mi,s);
 }
 
-util.date.formatted_date = function (date,format) {
+util.date.formatted_date = function (orig_date,format) {
+
+       var _date = orig_date;
+
+       try { 
+
        // pass in a Date object or epoch seconds or a postgres style date string (2005-07-19 10:38:25.211964-04)
-       if (typeof(date) == 'string') {
-               if (date.match(/:/) || date.match(/-/)) {
-                       date = util.date.db_date2Date(date);
+       if (typeof(_date) == 'string') {
+               if (_date.match(/:/) || _date.match(/-/)) {
+                       _date = util.date.db_date2Date(_date);
                } else {
-                       date = new Date( Number( date + '000' ) );
+                       _date = new Date( Number( _date + '000' ) );
                }
-       } else if (typeof(date) == 'undefined') {
-               date = new Date( Number( date + '000' ) );
-       } else if (date == null) {
+       } else if (typeof(_date) == 'number') {
+               _date = new Date( _date * 1000 );
+       } 
+       
+       if (_date == null) {
                return '';
        }
 
-       var mm = date.getMonth() + 1; mm = mm.toString(); if (mm.length == 1) mm = '0' +mm;
-       var dd = date.getDate().toString(); if (dd.length == 1) dd = '0' +dd;
-       var yyyy = date.getFullYear().toString();
+       var mm = _date.getMonth() + 1; mm = mm.toString(); if (mm.length == 1) mm = '0' +mm;
+       var dd = _date.getDate().toString(); if (dd.length == 1) dd = '0' +dd;
+       var yyyy = _date.getFullYear().toString();
        var yy = yyyy.substr(2);
-       var H = date.getHours(); H = H.toString(); if (H.length == 1) H = '0' + H;
-       var I = date.getHours(); if (I > 12) I -= 12; I = I.toString();
-       var M = date.getMinutes(); M = M.toString(); if (M.length == 1) M = '0' + M;
-       var sec = date.getSeconds(); sec = sec.toString(); if (sec.length == 1) sec = '0' + sec;
+       var H = _date.getHours(); H = H.toString(); if (H.length == 1) H = '0' + H;
+       var I = _date.getHours(); if (I > 12) I -= 12; I = I.toString();
+       var M = _date.getMinutes(); M = M.toString(); if (M.length == 1) M = '0' + M;
+       var sec = _date.getSeconds(); sec = sec.toString(); if (sec.length == 1) sec = '0' + sec;
 
        var s = format;
        if (s == '') { s = '%F %H:%M'; }
-       if (typeof date.iso8601Format != 'function') {
+       if (typeof _date.iso8601Format != 'function') {
                
                var js = JSAN._loadJSFromUrl( urls.isodate_lib );
                try { eval( js ); } catch(E) { alert('Problem loading ISO8601 date extension:' + E); }
 
        }
-       if (typeof date.iso8601Format == 'function') {
-               s = s.replace( /%\{iso8601\}/g, date.iso8601Format("YMDHMS") );
+       if (typeof _date.iso8601Format == 'function') {
+               s = s.replace( /%\{iso8601\}/g, _date.iso8601Format("YMDHMS") );
        }
        s = s.replace( /%m/g, mm );
        s = s.replace( /%d/g, dd );
@@ -99,6 +106,10 @@ util.date.formatted_date = function (date,format) {
        s = s.replace( /%M/g, M );
        s = s.replace( /%s/g, sec );
        return s;
+
+       } catch(E) {
+               alert('Error in util.date.formatted_date:\ntypeof orig_date = ' + typeof orig_date + ' orig_date = ' + orig_date + '\ntypeof _date = ' + typeof _date + ' _date = ' + _date + '\nformat = ' + format + '\n' + E);
+       }
 }
 
 util.date.interval_to_seconds = function ( $interval ) {
@@ -121,4 +132,39 @@ util.date.interval_to_seconds = function ( $interval ) {
         return $amount;
 }
 
+/* 
+       Lifted from /opac/common/js/util.js
+
+       builds a JS date object with the given info.  The given data
+       has to be valid (e.g. months == 30 is not valid).  Returns NULL on 
+       invalid date 
+       Months are 1-12 (unlike the JS date object)
+*/
+
+util.date.buildDate = function ( year, month, day, hours, minutes, seconds ) {
+
+       if(!year) year = 0;
+       if(!month) month = 1;
+       if(!day) day = 1;
+       if(!hours) hours = 0;
+       if(!minutes) minutes = 0;
+       if(!seconds) seconds = 0;
+
+       var d = new Date(year, month - 1, day, hours, minutes, seconds);
+       //alert('util.date.buildDate\nyear='+year+' month='+month+' day='+day+' hours='+hours+' minutes='+minutes+' seconds='+seconds+'\nd = ' + d);
+       
+       if( 
+               (d.getYear() + 1900) == year &&
+               d.getMonth()    == (month - 1) &&
+               d.getDate()             == new Number(day) &&
+               d.getHours()    == new Number(hours) &&
+               d.getMinutes() == new Number(minutes) &&
+               d.getSeconds() == new Number(seconds) ) {
+               return d;
+       }
+
+       return null;
+}
+
+
 dump('exiting util/date.js\n');
index cd5b612..79fa41d 100644 (file)
@@ -97,8 +97,8 @@ util.error.prototype = {
                'D_EXPLODE' : false, 
                'D_FM_UTILS' : false, 
                'D_PRINT' : { 'dump' : true }, 
-               'D_OBSERVERS' : { 'dump' : true, 'console' : false },
-               'D_CACHE' : { 'dump' : true, 'console' : false },
+               'D_OBSERVERS' : { 'dump' : true, 'console' : false, 'alert' : false },
+               'D_CACHE' : { 'dump' : true, 'console' : false, 'alert' : false },
                'D_SES' : { 'dump' : true, 'console' : false },
                'D_SES_FUNC' : false, 
                'D_SES_RESULT' : { 'dump' : true }, 
index acc40f9..4271a41 100644 (file)
@@ -297,13 +297,13 @@ util.list.prototype = {
                var rnode;
                var obj = this;
                switch (this.node.nodeName) {
-                       case 'tree' : rnode = this._append_to_tree(params); break;
-                       case 'listbox' : rnode = this._append_to_listbox(params); break;
+                       case 'tree' : rparams = this._append_to_tree(params); break;
+                       case 'listbox' : rparams = this._append_to_listbox(params); break;
                        default: throw('NYI: Need .append() for ' + this.node.nodeName); break;
                }
-               if (rnode && params.attributes) {
+               if (rparams && params.attributes) {
                        for (var i in params.attributes) {
-                               rnode.setAttribute(i,params.attributes[i]);
+                               rparams.my_node.setAttribute(i,params.attributes[i]);
                        }
                }
                this.row_count.total++;
@@ -312,8 +312,24 @@ util.list.prototype = {
                                setTimeout( function() { obj.on_all_fleshed(); }, 0 );
                        }
                }
-               return rnode;
+               return rparams;
        },
+       
+       'refresh_row' : function (params) {
+               var rnode;
+               var obj = this;
+               switch (this.node.nodeName) {
+                       case 'tree' : rparams = this._refresh_row_in_tree(params); break;
+                       default: throw('NYI: Need .refresh_row() for ' + this.node.nodeName); break;
+               }
+               if (rparams && params.attributes) {
+                       for (var i in params.attributes) {
+                               rparams.my_node.setAttribute(i,params.attributes[i]);
+                       }
+               }
+               return rparams;
+       },
+
 
        '_append_to_tree' : function (params) {
 
@@ -474,7 +490,157 @@ util.list.prototype = {
 
                                if (obj.trim_list && obj.row_count.total >= obj.trim_list) {
                                        // Remove oldest row
-                                       //if (typeof params.to_bottom != 'undefined') {
+                                       //if (typeof params.to_bottom != 'undefined') 
+                                       if (typeof params.to_top == 'undefined') {
+                                               treechildren_node.removeChild( treechildren_node.firstChild );
+                                       } else {
+                                               treechildren_node.removeChild( treechildren_node.lastChild );
+                                       }
+                               }
+                       } catch(E) {
+                       }
+
+               setTimeout( function() { obj.auto_retrieve(); }, 0 );
+
+               params.my_node = treeitem;
+               return params;
+       },
+
+       '_refresh_row_in_tree' : function (params) {
+
+               var obj = this;
+
+               if (typeof params.row == 'undefined') throw('util.list.refresh_row: Object must contain a row');
+               if (typeof params.my_node == 'undefined') throw('util.list.refresh_row: Object must contain a my_node');
+               if (params.my_node.nodeName != 'treeitem') throw('util.list.refresh_rwo: my_node must be a treeitem');
+
+               var s = ('util.list.refresh_row: params = ' + (params) + '\n');
+
+               var treeitem = params.my_node;
+               treeitem.setAttribute('retrieve_id',params.retrieve_id);
+               if (typeof params.to_bottom != 'undefined') {
+                       if (typeof params.no_auto_select == 'undefined') {
+                               if (!obj.auto_select_pending) {
+                                       obj.auto_select_pending = true;
+                                       setTimeout(function() {
+                                               dump('auto-selecting\n');
+                                               var idx = Number(obj.node.view.rowCount)-1;
+                                               try { obj.node.view.selection.select(idx); } catch(E) { obj.error.sdump('D_ALERT','tree auto select: ' + E + '\n'); }
+                                               try { if (typeof params.on_select == 'function') params.on_select(); } catch(E) { obj.error.sdump('D_ALERT','tree auto select, on_select: ' + E + '\n'); }
+                                               obj.auto_select_pending = false;
+                                               try { util.widgets.dispatch('flesh',obj.node.contentView.getItemAtIndex(idx).firstChild); } catch(E) { obj.error.sdump('D_ALERT','tree auto select, flesh: ' + E + '\n'); }
+                                       }, 1000);
+                               }
+                       }
+               }
+               var delete_me = [];
+               for (var i in treeitem.childNodes) if (treeitem.childNodes[i].nodeName == 'treerow') delete_me.push(treeitem.childNodes[i]);
+               for (var i = 0; i < delete_me.length; i++) treeitem.removeChild(delete_me[i]);
+               var treerow = document.createElement('treerow');
+               treeitem.appendChild( treerow );
+               treerow.setAttribute('retrieve_id',params.retrieve_id);
+
+               s += ('tree = ' + this.node + '\n');
+               s += ('treeitem = ' + treeitem + '  treerow = ' + treerow + '\n');
+
+               if (typeof params.retrieve_row == 'function' || typeof this.retrieve_row == 'function') {
+
+                       obj.put_retrieving_label(treerow);
+                       treerow.addEventListener(
+                               'flesh',
+                               function() {
+
+                                       if (treerow.getAttribute('retrieved') == 'true') return; /* already running */
+
+                                       treerow.setAttribute('retrieved','true');
+
+                                       //dump('fleshing = ' + params.retrieve_id + '\n');
+
+                                       function inc_fleshed() {
+                                               if (treerow.getAttribute('fleshed') == 'true') return; /* already fleshed */
+                                               treerow.setAttribute('fleshed','true');
+                                               obj.row_count.fleshed++;
+                                               if (obj.row_count.fleshed == obj.row_count.total) {
+                                                       if (typeof obj.on_all_fleshed == 'function') {
+                                                               setTimeout( function() { obj.on_all_fleshed(); }, 0 );
+                                                       }
+                                               }
+                                       }
+
+                                       params.row_node = treeitem;
+                                       params.on_retrieve = function(p) {
+                                               try {
+                                                       p.row = params.row;
+                                                       obj._map_row_to_treecell(p,treerow);
+                                                       inc_fleshed();
+                                                       var idx = obj.node.contentView.getIndexOfItem( params.row_node );
+                                                       dump('idx = ' + idx + '\n');
+                                                       // if current row is selected, send another select event to re-sync data that the client code fetches on selects
+                                                       if ( obj.node.view.selection.isSelected( idx ) ) {
+                                                               dump('dispatching select event for on_retrieve for idx = ' + idx + '\n');
+                                                               util.widgets.dispatch('select',params.row_node);
+                                                       }
+                                               } catch(E) {
+                                                       alert('fixme2: ' + E);
+                                               }
+                                       }
+
+                                       if (typeof params.retrieve_row == 'function') {
+
+                                               params.retrieve_row( params );
+
+                                       } else if (typeof obj.retrieve_row == 'function') {
+
+                                                       obj.retrieve_row( params );
+
+                                       } else {
+                                       
+                                                       inc_fleshed();
+                                       }
+                               },
+                               false
+                       );
+                       /*
+                       setTimeout(
+                               function() {
+                                       util.widgets.dispatch('flesh',treerow);
+                               }, 0
+                       );
+                       */
+               } else {
+                       obj.put_retrieving_label(treerow);
+                       treerow.addEventListener(
+                               'flesh',
+                               function() {
+                                       //dump('fleshing anon\n');
+                                       if (treerow.getAttribute('fleshed') == 'true') return; /* already fleshed */
+                                       obj._map_row_to_treecell(params,treerow);
+                                       treerow.setAttribute('retrieved','true');
+                                       treerow.setAttribute('fleshed','true');
+                                       obj.row_count.fleshed++;
+                                       if (obj.row_count.fleshed == obj.row_count.total) {
+                                               if (typeof obj.on_all_fleshed == 'function') {
+                                                       setTimeout( function() { obj.on_all_fleshed(); }, 0 );
+                                               }
+                                       }
+                               },
+                               false
+                       );
+                       /*
+                       setTimeout(
+                               function() {
+                                       util.widgets.dispatch('flesh',treerow);
+                               }, 0
+                       );
+                       */
+               }
+               this.error.sdump('D_LIST',s);
+
+                       try {
+
+                               if (obj.trim_list && obj.row_count.total >= obj.trim_list) {
+                                       // Remove oldest row
+                                       //if (typeof params.to_bottom != 'undefined') 
                                        if (typeof params.to_top == 'undefined') {
                                                treechildren_node.removeChild( treechildren_node.firstChild );
                                        } else {
@@ -486,7 +652,7 @@ util.list.prototype = {
 
                setTimeout( function() { obj.auto_retrieve(); }, 0 );
 
-               return treeitem;
+               return params;
        },
 
        'put_retrieving_label' : function(treerow) {
@@ -667,7 +833,8 @@ util.list.prototype = {
                }
 
                this.error.sdump('D_LIST',s);
-               return listitem;
+               params.my_node = listitem;
+               return params;
 
        },
 
index 2efad7b..ea14455 100644 (file)
Binary files a/Open-ILS/xul/staff_client/components/nsIOpenILS.xpt and b/Open-ILS/xul/staff_client/components/nsIOpenILS.xpt differ
index 0f418ff..266c0d8 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
 find $1 -type d -name CVS -exec rm -rf {} \; 2> /dev/null
+find $1 -type d -name .svn -exec rm -rf {} \; 2> /dev/null
 find $1 -type d -name OPEN_ILS_STAFF_CLIENT -exec rm -rf {} \; 2> /dev/null
 exit 0
index 33160d0..c4d166a 100644 (file)
@@ -53,7 +53,8 @@ function fetchHighestPermOrgs( session, userId, perms ) {
        req.send(true);
        var orgs = req.getResultObject();
        for( var i = 0; i != orgs.length; i++ ) 
-               PERMS[ perms[i] ] = ( orgs[i] != null ) ? orgs[i] : -1 ;
+               PERMS[perms[i]] = orgs[i];
+               //PERMS[ perms[i] ] = ( orgs[i] != null ) ? orgs[i] : -1 ;
        return orgs;
 }
 
index e44775a..9f039f8 100644 (file)
@@ -70,6 +70,7 @@ function scFetchPerms() {
        PERMS[ASSET].delete_stat_cat_entry =  orgs[11];
 }
 
+/*
 function scFetchPerm(perm) {
        var req = new RemoteRequest(
                'open-ils.actor',
@@ -78,6 +79,7 @@ function scFetchPerm(perm) {
        return req.getResultObject();
        PERMS.create_stat = req.getResultObjecdt();
 }
+*/
 
 
 function scFetchAll( session, type, orgid, callback, args ) {
index 10a6971..fc66e3a 100644 (file)
@@ -4,8 +4,8 @@ if (typeof admin == 'undefined') admin = {};
 admin.transit_list = function (params) {
 
        JSAN.use('util.error'); this.error = new util.error();
-       JSAN.use('util.network'); this.network = new util.network();
-       JSAN.use('util.date');
+       JSAN.use('util.network'); this.network = new util.network(); JSAN.use('util.file');
+       JSAN.use('util.date'); JSAN.use('util.widgets'); JSAN.use('util.fm_utils'); JSAN.use('util.functional');
        JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
 }
 
@@ -15,16 +15,109 @@ admin.transit_list.prototype = {
 
                var obj = this;
 
+               var x = document.getElementById('libmenu_placeholder');
+               util.widgets.remove_children( x );
+
+               var file; var list_data; var ml; 
+
+               file = new util.file('offline_ou_list'); 
+               if (file._file.exists()) {
+                       list_data = file.get_object(); file.close();
+                       ml = util.widgets.make_menulist( list_data[0], list_data[1] );
+                       ml.setAttribute('id','libmenu'); document.getElementById('libmenu_placeholder').appendChild(ml);
+                       ml.addEventListener(
+                               'command',
+                               function(ev) {
+                                       var file = new util.file('transit_list_prefs.'+obj.data.server_unadorned);
+                                       util.widgets.save_attributes(file, { 'libmenu' : [ 'value' ] });
+                               },
+                               false
+                       );
+               } else {
+                       throw('Missing library list.\n');
+               }
+
+               file = new util.file('transit_list_prefs.'+obj.data.server_unadorned);
+               util.widgets.load_attributes(file);
+               ml.value = ml.getAttribute('value');
+               if (! ml.value) {
+                       ml.value = obj.data.list.au[0].ws_ou();
+                       ml.setAttribute('value',ml.value);
+               }
+
+               x.appendChild( ml );
+
                obj.list_init();
                obj.controller_init();
-               obj.kick_off();
+               //obj.kick_off();
+
+       },
+
+       'sdate' : null,
+       'edate' : null,
+
+       'handle_date' : function(value,end_of_day) {
+               try {
+                       var _date = null;
+
+                       /* The Beginning */
+                       if (value.match(/The Beginning/)) {
+                               _date = new Date(); _date.setTime( 0 );
+                       }
+
+                       /* Today */
+                       if (value.match(/^Today$/i)) {
+                               _date = new Date(); _date = util.date.buildDate( _date.getFullYear(), _date.getMonth()+1, _date.getDate(), 0, 0, 0); // morning
+                       }
+
+                       /* handle YYYY-MM-DD */
+                       var _string = value.match(/(\d\d\d\d)[\-\/](\d\d?)[\-\/](\d\d?)/);
+                       if (_string) {
+                               if (util.date.check('YYYY-MM-DD',_string[1]+'-'+_string[2]+'-'+_string[3])) {
+                                       _date = util.date.buildDate( _string[1], _string[2], _string[3], 0, 0, 0);
+                               } else {
+                                       alert('Invalid Date (' + _string + '), setting to Today'); 
+                                       _date = new Date(); _date = util.date.buildDate( _date.getFullYear(), _date.getMonth()+1, _date.getDate(), 0, 0, 0); // morning
+                               }
+                       }
 
+                       /* handle relative dates */
+                       var interval = value.match(/Today \- (.+)/);
+                       if (interval) {
+                               _date = new Date(); _date = util.date.buildDate( _date.getFullYear(), _date.getMonth()+1, _date.getDate(), 0, 0, 0); // morning
+                               _date.setTime( _date.getTime() - util.date.interval_to_seconds(interval[1])*1000 );
+                       }
+
+                       if (! util.date.check('YYYY-MM-DD',util.date.formatted_date(_date,"%F")) ) { 
+                               alert('Invalid Date (' + _date + ',' + util.date.formatted_date(_date,"%F") + '), setting to Today'); 
+                               _date = new Date(); _date = util.date.buildDate( _date.getFullYear(), _date.getMonth()+1, _date.getDate(), 0, 0, 0); // morning
+                       }
+                               
+                       if (end_of_day) { // This just handles calendar days.. if we wanted to support (Today-1 month,Today-1 month), I'll need a better library, or a query to postgres
+                               _date.setTime( _date.getTime() + util.date.interval_to_seconds('1 day')*1000 - util.date.interval_to_seconds('1 second')*1000 );
+                       }
+
+                       return util.date.formatted_date(_date,'%{iso8601}');
+               } catch(E) {
+                       try { obj.error.standard_unexpected_error_alert('processing date',E); } catch(F) { alert(E); }
+                       _date = new Date(); _date = util.date.buildDate( _date.getFullYear(), _date.getMonth()+1, _date.getDate(), 0, 0, 0); // morning
+                       return util.date.formatted_date(_date,'%{iso8601}');
+               }
        },
 
        'kick_off' : function() {
                var obj = this;
                try {
-                       obj.network.simple_request('FM_ATC_RETRIEVE_VIA_AOU',[ ses(), obj.data.list.au[ 0 ].ws_ou() ], 
+                       obj.list.clear();
+                       obj.sdate = obj.handle_date( document.getElementById('sdate').value, false );
+                       obj.edate = obj.handle_date( document.getElementById('edate').value, true );
+                       var sdate; var edate;
+                       if (obj.sdate < obj.edate) {
+                               sdate = obj.sdate; edate = obj.edate;
+                       } else {
+                               sdate = obj.edate; edate = obj.sdate;
+                       }
+                       obj.network.simple_request('FM_ATC_RETRIEVE_VIA_AOU',[ ses(), /*obj.data.list.au[ 0 ].ws_ou()*/ document.getElementById('libmenu').value, sdate, edate ], 
                                function(req) {
                                        try {
                                                var robj = req.getResultObject();
@@ -38,25 +131,28 @@ admin.transit_list.prototype = {
                                                        return function() {
                                                                switch(which_list) {
                                                                        case 0: obj.list.append( { 'row' : { 'my' : { 'transit_id' : id } }, 'no_auto_select' : true } ); break;
-                                                                       case 1: obj.list2.append( { 'row' : { 'my' : { 'transit_id' : id } }, 'no_auto_select' : true } ); break;
+                                                                       case 1: obj.list.append( { 'row' : { 'my' : { 'transit_id' : id } }, 'no_auto_select' : true } ); break;
                                                                }
                                                        };
                                                }
 
-                                               var rows = []; var rows2 = [];
+                                               var rows = []; 
 
-                                               for (var i = 0; i < robj.from.length; i++) {
+                                               if (document.getElementById('transit_direction').value=='transit_from') for (var i = 0; i < robj.from.length; i++) {
                                                        //get_transit(robj.from[i], 0);
                                                        rows.push( gen_list_append(robj.from[i],0) );
                                                }
 
-                                               for (var i = 0; i < robj.to.length; i++) {
+                                               if (document.getElementById('transit_direction').value=='transit_to') for (var i = 0; i < robj.to.length; i++) {
                                                        //get_transit(robj.to[i], 1);
-                                                       rows2.push( gen_list_append(robj.to[i],1) );
+                                                       rows.push( gen_list_append(robj.to[i],1) );
                                                }
                                
-                                               exec.chain( rows );
-                                               exec2.chain( rows2 );
+                                               if (rows.length > 0) {
+                                                       exec.chain( rows );
+                                               } else {
+                                                       alert('No matching transits.');
+                                               }
 
                                        } catch(E) {
                                                try { obj.error.standard_unexpected_error_alert('retrieving transits',E); } catch(F) { alert(E); }
@@ -73,7 +169,6 @@ admin.transit_list.prototype = {
                var obj = this;
 
                obj.selection_list = [];
-               obj.selection_list2 = [];
 
                JSAN.use('circ.util'); 
                var columns = circ.util.transit_columns(
@@ -119,7 +214,7 @@ admin.transit_list.prototype = {
                );
 
                JSAN.use('util.list'); 
-               obj.list = new util.list('transit_from');
+               obj.list = new util.list('transit_list');
                obj.list.init( 
                        { 
                                'columns' : columns, 
@@ -167,55 +262,6 @@ admin.transit_list.prototype = {
                                },
                        }
                );
-               obj.list2 = new util.list('transit_to');
-               obj.list2.init( 
-                       { 
-                               'columns' : columns, 
-                               'map_row_to_columns' : circ.util.std_map_row_to_columns(), 
-                               'retrieve_row' : function(params) {
-                                       var row = params.row;
-                                       try {
-                                               obj.get_transit_and_hold_and_run_func(
-                                                       row.my.transit_id,
-                                                       function(transit,hold) { return obj.get_rest_of_row_given_transit_and_hold(params,transit,hold); }
-                                               );
-                                       } catch(E) {
-                                               try { obj.error.standard_unexpected_error_alert('retrieving row',E); } catch(F) { alert(E); }
-                                       }
-                               },
-                               'on_select' : function(ev) {
-                                       try {
-                                               JSAN.use('util.functional');
-                                               var sel = obj.list2.retrieve_selection();
-                                               obj.selection_list2 = util.functional.map_list(
-                                                       sel,
-                                                       function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
-                                               );
-                                               obj.error.sdump('D_TRACE','admin.transit_list: selection list2 = ' + js2JSON(obj.selection_list2) );
-                                               if (obj.selection_list2.length == 0) {
-                                                       obj.controller.view.sel_edit2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_opac2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_bucket2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_copy_details2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_patron2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_transit_abort2.setAttribute('disabled','true');
-                                                       obj.controller.view.sel_clip2.setAttribute('disabled','true');
-                                               } else {
-                                                       obj.controller.view.sel_edit2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_opac2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_patron2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_bucket2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_copy_details2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_transit_abort2.setAttribute('disabled','false');
-                                                       obj.controller.view.sel_clip2.setAttribute('disabled','false');
-                                               }
-                                       } catch(E) {
-                                               alert('FIXME: ' + E);
-                                       }
-                               },
-                       }
-               );
-
        },
 
        'get_transit_and_hold_and_run_func' : function (transit_id,do_this) {
@@ -234,13 +280,19 @@ admin.transit_list.prototype = {
                                                                try {
                                                                        var r_ahr = req3.getResultObject();
                                                                        if (typeof r_ahr.ilsevent != 'undefined') throw(r_ahr);
-                                                                       if (instanceOf(r_ahr[0],ahr)) {
-                                                                               do_this(r_atc,r_ahr[0]);
+                                                                       if (r_ahr.length == 0) {
+                                                                               try { obj.error.standard_unexpected_error_alert('Empty array returned by hold retrieve.  retrieving hold id = ' + r_atc.hold() + ' for transit id = ' + transit_id,E); } catch(F) { alert(E); }
+                                                                               do_this(r_atc,null);
                                                                        } else {
-                                                                               throw(r_ahr);
+                                                                               if (instanceOf(r_ahr[0],ahr)) {
+                                                                                       do_this(r_atc,r_ahr[0]);
+                                                                               } else {
+                                                                                       throw(r_ahr);
+                                                                               }
                                                                        }
                                                                } catch(E) {
                                                                        try { obj.error.standard_unexpected_error_alert('retrieving hold id = ' + r_atc.hold() + ' for transit id = ' + transit_id,E); } catch(F) { alert(E); }
+                                                                       do_this(r_atc,null);
                                                                }
                                                        }
                                                );
@@ -348,23 +400,17 @@ admin.transit_list.prototype = {
                        {
                                'control_map' : {
                                        'save_columns' : [ [ 'command' ], function() { obj.list.save_columns(); } ],
-                                       'save_columns2' : [ [ 'command' ], function() { obj.list2.save_columns(); } ],
                                        'sel_clip' : [ ['command'], function() { obj.list.clipboard(); } ],
-                                       'sel_clip2' : [ ['command'], function() { obj.list2.clipboard(); } ],
                                        'sel_edit' : [ ['command'], function() { try { obj.spawn_copy_editor(0); } catch(E) { alert(E); } } ],
-                                       'sel_edit2' : [ ['command'], function() { try { obj.spawn_copy_editor(1); } catch(E) { alert(E); } } ],
                                        'sel_opac' : [ ['command'], function() { JSAN.use('cat.util'); cat.util.show_in_opac(obj.selection_list); } ],
-                                       'sel_opac2' : [ ['command'], function() { JSAN.use('cat.util'); cat.util.show_in_opac(obj.selection_list2); } ],
                                        'sel_transit_abort' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.abort_transits(obj.selection_list); } ],
-                                       'sel_transit_abort2' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.abort_transits(obj.selection_list2); } ],
                                        'sel_patron' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.show_last_few_circs(obj.selection_list); } ],
-                                       'sel_patron2' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.show_last_few_circs(obj.selection_list2); } ],
                                        'sel_copy_details' : [ ['command'], function() { JSAN.use('circ.util'); for (var i = 0; i < obj.selection_list.length; i++) { circ.util.show_copy_details( obj.selection_list[i].copy_id ); } } ],
-                                       'sel_copy_details2' : [ ['command'], function() { JSAN.use('circ.util'); for (var i = 0; i < obj.selection_list2.length; i++) { circ.util.show_copy_details( obj.selection_list2[i].copy_id ); } } ],
                                        'sel_bucket' : [ ['command'], function() { JSAN.use('cat.util'); cat.util.add_copies_to_bucket(obj.selection_list); } ],
-                                       'sel_bucket2' : [ ['command'], function() { JSAN.use('cat.util'); cat.util.add_copies_to_bucket(obj.selection_list2); } ],
                                        'cmd_print_list' : [ ['command'], function() { obj.print_list(0); } ],
-                                       'cmd_print_list2' : [ ['command'], function() { obj.print_list(1); } ],
+                                       'cmd_kick_off' : [ ['command'], function(ev) { ev.target.disabled = true; obj.kick_off(); } ],
+                                       'sdate' : [ ['change'], function(ev) { ev.target.value = obj.handle_date(ev.target.value,false); obj.sdate = ev.target.value; /*alert('obj.sdate='+obj.sdate);*/ } ],
+                                       'edate' : [ ['change'], function(ev) { ev.target.value = obj.handle_date(ev.target.value,true); obj.edate = ev.target.value; /*alert('obj.edate='+obj.edate);*/ } ],
                                }
                        }
                );
index 5d6049d..253c76e 100644 (file)
        </script>
 
        <vbox flex="1" class="my_overflow">
+               <hbox>
+                       <groupbox id="lib_hbox" orient="horizontal">
+                               <caption label="Transit Filter" class="shrinkable_groupbox"/> 
+                               <vbox>
+                                       <label value="Transit Library" class="header"/>
+                                       <hbox>
+                                               <menulist id="transit_direction">
+                                                       <menupopup>
+                                                               <menuitem label="Transit to" value="transit_to" selected="true"/>
+                                                               <menuitem label="Transit from" value="transit_from" />
+                                                       </menupopup>
+                                               </menulist>
+                                               <hbox id="libmenu_placeholder"/>
+                                       </hbox>
+                                       <label value="Transit Date falls between" class="header"/> 
+                                       <hbox>
+                                               <menulist id="sdate" editable="true">
+                                                       <menupopup>
+                                                               <menuitem label="Today" selected="true"/>
+                                                               <menuitem label="Today - 7 days" />
+                                                               <menuitem label="Today - 14 days" />
+                                                               <menuitem label="Today - 21 days" />
+                                                               <menuitem label="Today - 30 days" />
+                                                               <menuitem label="The Beginning" />
+                                                       </menupopup>
+                                               </menulist>
+                                               <menulist id="edate" editable="true">
+                                                       <menupopup>
+                                                               <menuitem label="Today" selected="true"/>
+                                                               <menuitem label="Today - 7 days" />
+                                                               <menuitem label="Today - 14 days" />
+                                                               <menuitem label="Today - 21 days" />
+                                                               <menuitem label="Today - 30 days" />
+                                                       </menupopup>
+                                               </menulist>
+                                       </hbox>
+                               </vbox>
+                               <button label="Retrieve Transits" accesskey="T" command="cmd_kick_off"/>
+                       </groupbox>
+               </hbox>
+
                <groupbox flex="1">
-                       <caption label="Outgoing Transits" class="shrinkable_groupbox"/>
+                       <caption label="Transits" />
                        <hbox>
                                <button label="Print Transits" command="cmd_print_list" />
                                <spacer flex="1"/>
                                <menubar>
-                                       <menu label="Actions for Selected Items" accesskey="S">
+                                       <menu label="Actions for Selected Transits" accesskey="S">
                                                <menupopup>
                                                        <menuitem command="sel_clip" label="Copy to Clipboard" accesskey="C" />
                                                        <menuitem command="sel_bucket" label="Add to Item Bucket" accesskey="A"/>
                                        </menu>
                                </menubar>
                        </hbox>
-                       <tree id="transit_from" flex="1" enableColumnDrag="true" context="transit_list_actions"/>
-               </groupbox>
-               <splitter><grippy/></splitter>
-               <groupbox flex="1">
-                       <caption label="Incoming Transits" class="shrinkable_groupbox"/>
-                       <hbox>
-                               <button label="Print Transits" command="cmd_print_list2" />
-                               <spacer flex="1"/>
-                               <menubar>
-                                       <menu label="Actions for Selected Items" accesskey="S">
-                                               <menupopup>
-                                                       <menuitem command="sel_clip2" label="Copy to Clipboard" accesskey="C" />
-                                                       <menuitem command="sel_bucket2" label="Add to Item Bucket" accesskey="A"/>
-                                                       <menuitem command="sel_opac2" label="Show in Catalog" accesskey="S" />
-                                                       <menuitem command="sel_copy_details2" label="Show Item Details" accesskey="I" />
-                                                       <menuitem command="sel_patron2" label="Show Last Few Circulations" accesskey="L"/>
-                                                       <menuseparator />
-                                                       <menuitem command="sel_edit2" label="Edit Item Attributes" accesskey="E" />
-                                                       <menuseparator />
-                                                       <menuitem command="save_columns2" label="Save Columns"/>
-                                               </menupopup>
-                                       </menu>
-                               </menubar>
-                       </hbox>
-
-                       <tree id="transit_to" flex="1" enableColumnDrag="true" context="transit_list_actions2"/>
+                       <tree id="transit_list" flex="1" enableColumnDrag="true" context="transit_list_actions"/>
                </groupbox>
        </vbox>
 
                        <menuseparator/>
                        <menuitem command="save_columns" label="Save Columns"/>
                </popup>
-               <popup id="transit_list_actions2" position="at_pointer"> 
-                       <menuitem command="sel_clip2" label="Copy to Clipboard" accesskey="C" />
-                       <menuitem command="sel_bucket2" label="Add to Item Bucket" accesskey="A"/>
-                       <menuitem command="sel_opac2" label="Show in Catalog" accesskey="S" />
-                       <menuitem command="sel_copy_details2" label="Show Item Details" accesskey="I" />
-                       <menuitem command="sel_patron2" label="Show Last Few Circulations" accesskey="L"/>
-                       <menuseparator/>
-                       <menuitem command="sel_edit2" label="Edit Item Attributes" accesskey="E" />
-                       <menuseparator/>
-                       <menuitem command="save_columns2" label="Save Columns"/>
-               </popup>
-
        </popupset>
 
        <commandset id="transit_list_cmds">
-               <command id="cmd_print_list" /> <command id="cmd_print_list2" />
-               <command id="save_columns" /> <command id="save_columns2" />
-               <command id="sel_copy_details" disabled="true"/> <command id="sel_copy_details2" disabled="true"/>
-               <command id="sel_patron" disabled="true"/> <command id="sel_patron2" disabled="true"/>
-               <command id="sel_edit" disabled="true"/> <command id="sel_edit2" disabled="true"/>
-               <command id="sel_opac" disabled="true"/> <command id="sel_opac2" disabled="true"/>
-               <command id="sel_bucket" disabled="true"/> <command id="sel_bucket2" disabled="true"/>
-               <command id="sel_transit_abort" disabled="true"/> <command id="sel_transit_abort2" disabled="true"/>
-               <command id="sel_clip" disabled="true"/> <command id="sel_clip2" disabled="true"/>
+               <command id="cmd_print_list" />
+               <command id="save_columns" />
+               <command id="sel_copy_details" disabled="true"/>
+               <command id="sel_patron" disabled="true"/>
+               <command id="sel_edit" disabled="true"/>
+               <command id="sel_opac" disabled="true"/>
+               <command id="sel_bucket" disabled="true"/>
+               <command id="sel_transit_abort" disabled="true"/>
+               <command id="sel_clip" disabled="true"/>
+               <command id="cmd_kick_off"/>
        </commandset>
 
 </window>
index 70ee346..cefd92e 100644 (file)
@@ -877,6 +877,8 @@ cat.copy_browser.prototype = {
                                        'command',
                                        function(ev) {
                                                //obj.show_my_libs(ev.target.value);
+                                               //alert('lib picker, command caught - ml = ' + ml + '\nml.value = ' + ml.value + '\n');
+                                               if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus(); 
                                                JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
                                                util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] });
                                                obj.refresh_list();
@@ -1247,7 +1249,8 @@ cat.copy_browser.prototype = {
                        if (parent_org) {
                                data.node = obj.map_tree[ 'aou_' + parent_org.id() ];
                        }
-                       var node = obj.list.append(data);
+                       var nparams = obj.list.append(data);
+                       var node = nparams.my_node;
                        if (params) {
                                for (var i in params) {
                                        node.setAttribute(i,params[i]);
@@ -1314,7 +1317,8 @@ cat.copy_browser.prototype = {
                                'to_bottom' : true,
                                'no_auto_select' : true,
                        };
-                       var node = obj.list.append(data);
+                       var nparams = obj.list.append(data);
+                       var node = nparams.my_node;
                        obj.map_tree[ 'acn_' + acn_tree.id() ] =  node;
                        if (params) {
                                for (var i in params) {
@@ -1365,7 +1369,8 @@ cat.copy_browser.prototype = {
                                'to_bottom' : true,
                                'no_auto_select' : true,
                        };
-                       var node = obj.list.append(data);
+                       var nparams = obj.list.append(data);
+                       var node = nparams.my_node;
                        obj.map_tree[ 'acp_' + acp_item.id() ] =  node;
                        if (params) {
                                for (var i in params) {
index a83a535..447e328 100644 (file)
                <hbox>
                        <checkbox id="show_acns" label="Show Volumes" />
                        <checkbox id="show_acps" label="Show Items" />
-                       <button label="Refresh" command="cmd_refresh_list" />
+                       <button id="refresh_button" label="Refresh" command="cmd_refresh_list" />
                        <button label="Show Libs With Items" command="cmd_show_libs_with_copies" accesskey="L"/>
                        <!-- <button label="Show My Libs" command="cmd_show_my_libs" accesskey="M"/>-->
                        <!--
index d4604c1..e2d0cca 100644 (file)
@@ -13,6 +13,7 @@ circ.copy_status = function (params) {
 
 circ.copy_status.prototype = {
        'selection_list' : [],
+       'list_barcode_map' : {},
 
        'init' : function( params ) {
 
@@ -122,10 +123,10 @@ circ.copy_status.prototype = {
                                                                for (var i = 0; i < obj.selection_list.length; i++) {
                                                                        var barcode = obj.selection_list[i].barcode;
                                                                        var checkin = circ.util.checkin_via_barcode( ses(), { 'barcode' : barcode } );
-                                                                       funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                                       funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                                }
-                                                               alert('Action complete.');
                                                                for (var i = 0; i < funcs.length; i++) { funcs[i](); }
+                                                               alert('Action complete.');
                                                        } catch(E) {
                                                                obj.error.standard_unexpected_error_alert('Checkin did not likely happen.',E);
                                                        }
@@ -141,13 +142,13 @@ circ.copy_status.prototype = {
                                                                        try { 
                                                                                var barcode = obj.selection_list[i].barcode;
                                                                                var new_bc = cat.util.replace_barcode( barcode );
-                                                                               funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(new_bc) );
+                                                                               funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(new_bc) );
                                                                        } catch(E) {
                                                                                obj.error.standard_unexpected_error_alert('Barcode ' + barcode + ' was not likely replaced.',E);
                                                                        }
                                                                }
-                                                               alert('Action complete.');
                                                                for (var i = 0; i < funcs.length; i++) { funcs[i](); }
+                                                               alert('Action complete.');
                                                        } catch(E) {
                                                                obj.error.standard_unexpected_error_alert('Barcode replacements did not likely happen.',E);
                                                        }
@@ -161,7 +162,7 @@ circ.copy_status.prototype = {
                                                                obj.spawn_copy_editor();
                                                                for (var i = 0; i < obj.selection_list.length; i++) {
                                                                                var barcode = obj.selection_list[i].barcode;
-                                                                               funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                                               funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                                }
                                                                for (var i = 0; i < funcs.length; i++) { funcs[i](); }
                                                        } catch(E) {
@@ -191,10 +192,10 @@ circ.copy_status.prototype = {
                                                        circ.util.abort_transits(obj.selection_list);
                                                        for (var i = 0; i < obj.selection_list.length; i++) {
                                                                var barcode = obj.selection_list[i].barcode;
-                                                               funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                               funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                        }
-                                                       alert('Action complete.');
                                                        for (var i = 0; i < funcs.length; i++) { funcs[i](); }
+                                                       alert('Action complete.');
                                                }
                                        ],
                                        'sel_patron' : [
@@ -223,13 +224,13 @@ circ.copy_status.prototype = {
                                                                var barcode = obj.selection_list[i].barcode;
                                                                if (test == 't') {
                                                                        circ.util.renew_via_barcode( barcode );
-                                                                       funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                                       funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                                } else {
                                                                        alert('Item with barcode ' + barcode + ' is not circulating.');
                                                                }
                                                        }
-                                                       alert('Action complete.');
                                                        for (var i = 0; i < funcs.length; i++) { funcs[i](); }
+                                                       alert('Action complete.');
                                                }
                                        ],
 
@@ -241,7 +242,7 @@ circ.copy_status.prototype = {
                                                        cat.util.mark_item_damaged( util.functional.map_list( obj.selection_list, function(o) { return o.copy_id; } ) );
                                                        for (var i = 0; i < obj.selection_list.length; i++) {
                                                                var barcode = obj.selection_list[i].barcode;
-                                                               funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                               funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                        }
                                                        for (var i = 0; i < funcs.length; i++) { funcs[i](); }
                                                }
@@ -254,7 +255,7 @@ circ.copy_status.prototype = {
                                                        cat.util.mark_item_missing( util.functional.map_list( obj.selection_list, function(o) { return o.copy_id; } ) );
                                                        for (var i = 0; i < obj.selection_list.length; i++) {
                                                                var barcode = obj.selection_list[i].barcode;
-                                                               funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
+                                                               funcs.push( function(a) { return function() { obj.copy_status( a, true ); }; }(barcode) );
                                                        }
                                                        for (var i = 0; i < funcs.length; i++) { funcs[i](); }
                                                }
@@ -284,6 +285,52 @@ circ.copy_status.prototype = {
                                                        obj.copy_status();
                                                }
                                        ],
+                                       'cmd_copy_status_upload_file' : [
+                                               ['command'],
+                                               function() {
+                                                       function pick_file(mode) {
+                                                               netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+                                                               var nsIFilePicker = Components.interfaces.nsIFilePicker;
+                                                               var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance( nsIFilePicker );
+                                                               fp.init( 
+                                                                       window, 
+                                                                       mode == 'open' ? "Import Barcode File" : "Save Barcode File As", 
+                                                                       mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
+                                                               );
+                                                               fp.appendFilters( nsIFilePicker.filterAll );
+                                                               if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) {
+                                                                       return fp.file;
+                                                               } else {
+                                                                       return null;
+                                                               }
+                                                       }
+                                                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+                                                       JSAN.use('util.file');
+                                                       var f = pick_file('open');
+                                                       var i_file = new util.file(''); i_file._file = f;
+                                                       var content = i_file.get_content();
+                                                       i_file.close();
+                                                       var barcodes = content.split(/\s+/);
+                                       if (barcodes.length > 0) {
+                                           JSAN.use('util.exec'); var exec = new util.exec();
+                                           var funcs = [];
+                                           for (var i = 0; i < barcodes.length; i++) {
+                                               funcs.push(
+                                                   function(b){
+                                                       return function() {
+                                                           obj.copy_status(b);
+                                                       }
+                                                   }(barcodes[i])
+                                               );
+                                           }
+                                                               funcs.push( function() { alert('File uploaded.'); } );
+                                           exec.chain( funcs );
+                                       } else {
+                                                               alert('No barcodes found in file.');
+                                                       }
+
+                                               }
+                                       ],
                                        'cmd_copy_status_print' : [
                                                ['command'],
                                                function() {
@@ -899,7 +946,7 @@ circ.copy_status.prototype = {
                }
        },
 
-       'copy_status' : function(barcode) {
+       'copy_status' : function(barcode,refresh) {
                var obj = this;
                try {
                        try { document.getElementById('last_scanned').setAttribute('value',''); } catch(E) {}
@@ -944,32 +991,46 @@ circ.copy_status.prototype = {
                                                var x = document.getElementById('trim_list');
                                                if (x.checked) { obj.list.trim_list = 20; } else { obj.list.trim_list = null; }
                                        }
-                                       obj.list.append(
-                                               {
-                                                       'retrieve_id' : js2JSON( 
-                                                               { 
-                                                                       'renewable' : details.circ ? 't' : 'f', 
-                                                                       'copy_id' : details.copy.id(), 
-                                                                       'acn_id' : details.volume ? details.volume.id() : -1, 
-                                                                       'barcode' : barcode, 
-                                                                       'doc_id' : details.mvr ? details.mvr.doc_id() : null  
-                                                               } 
-                                                       ),
-                                                       'row' : {
-                                                               'my' : {
-                                                                       'mvr' : details.mvr,
-                                                                       'acp' : details.copy,
-                                                                       'acn' : details.volume,
-                                                                       'atc' : details.transit,
-                                                                       'circ' : details.circ,
-                                                                       'ahr' : details.hold,
-                                                               }
-                                                       },
-                                                       'to_top' : true,
+                                       var params = {
+                                               'retrieve_id' : js2JSON( 
+                                                       { 
+                                                               'renewable' : details.circ ? 't' : 'f', 
+                                                               'copy_id' : details.copy.id(), 
+                                                               'acn_id' : details.volume ? details.volume.id() : -1, 
+                                                               'barcode' : barcode, 
+                                                               'doc_id' : details.mvr ? details.mvr.doc_id() : null  
+                                                       } 
+                                               ),
+                                               'row' : {
+                                                       'my' : {
+                                                               'mvr' : details.mvr,
+                                                               'acp' : details.copy,
+                                                               'acn' : details.volume,
+                                                               'atc' : details.transit,
+                                                               'circ' : details.circ,
+                                                               'ahr' : details.hold,
+                                                       }
+                                               },
+                                               'to_top' : true,
+                                       };
+                                       if (!refresh) {
+                                               var nparams = obj.list.append(params);
+                                               if (!document.getElementById('trim_list').checked) {
+                                                       if (typeof obj.list_barcode_map[barcode] == 'undefined') obj.list_barcode_map[barcode] =[];
+                                                       obj.list_barcode_map[barcode].push(nparams);
+                                               }
+                                       } else {
+                                               if (!document.getElementById('trim_list').checked) {
+                                                       for (var i = 0; i < obj.list_barcode_map[barcode].length; i++) {
+                                                               params.my_node = obj.list_barcode_map[barcode][i].my_node;
+                                                               obj.list.refresh_row(params);
+                                                       }
+                                               } else {
+                                                       obj.list.append(params);
                                                }
-                                       );
+                                       }
                                } catch(E) {
-                                       obj.error.standard_unexpected_error_alert('',E);
+                                       obj.error.standard_unexpected_error_alert('barcode = ' + barcode,E);
                                }
                        }
                        var result = obj.network.simple_request('FM_ACP_DETAILS_VIA_BARCODE', [ ses(), barcode ]);
@@ -978,7 +1039,7 @@ circ.copy_status.prototype = {
                        obj.controller.view.copy_status_barcode_entry_textbox.focus();
                        
                } catch(E) {
-                       obj.error.standard_unexpected_error_alert('',E);
+                       obj.error.standard_unexpected_error_alert('barcode = ' + barcode,E);
                        obj.controller.view.copy_status_barcode_entry_textbox.select();
                        obj.controller.view.copy_status_barcode_entry_textbox.focus();
                }
index ca2ec27..bf05ed6 100644 (file)
@@ -92,6 +92,7 @@
 
        <commandset id="copy_status_cmds">
                <command id="cmd_copy_status_submit_barcode" />
+               <command id="cmd_copy_status_upload_file" />
                <command id="cmd_copy_status_print" />
                <command id="cmd_copy_status_export" />
                <command id="cmd_copy_status_print_export" />
index 16460e7..ad406a9 100644 (file)
        <textbox id="copy_status_barcode_entry_textbox"/>
        <button id="copy_status_submit_barcode_button" 
                label="Submit"
+               accesskey="t"
                command="cmd_copy_status_submit_barcode"/>
+       <button id="copy_status_upload_file_button" 
+               label="Upload From File"
+               accesskey="U"
+               command="cmd_copy_status_upload_file"/>
        <spacer flex="1"/>
        <menubar>
        <menu label="Actions for Catalogers" accesskey="f">
index 930075e..2b936c0 100644 (file)
                }
 
                function build_ou_list() {
+                       JSAN.use('util.fm_utils');
                        return [
                                util.functional.map_list( 
-                                       g.data.list.aou,
+                                       /*util.fm_utils.flatten_ou_branch(g.data.tree.aou)*/ g.data.list.aou,
                                        function(obj) { 
                                                var sname = obj.shortname(); for (i = sname.length; i < 20; i++) sname += ' ';
                                                return [ 
index c9a2e67..61abbd5 100644 (file)
                                'PERM_RETRIEVE_HIGHEST_ORG',
                                [ xulG.auth.session.key, g.user.id(), 'REGISTER_WORKSTATION']
                        );
+                       if (highest_org_id == -1) {
+                               alert('You do not have permission to register a workstation.');
+                               xulG.auth.logoff();
+                               return;
+                       }
                        var perm_depth = findOrgDepth( highest_org_id );
 
                        g.my_libs_tree = g.network.simple_request(
index 79157d9..8b8ef0d 100644 (file)
@@ -84,7 +84,7 @@ patron.bills.prototype = {
                                obj.current_payments = []; obj.list.clear();
                                //FIXME//.bills virtual field
                                for (var i = 0; i < obj.bills.length; i++) {
-                                       var rnode = obj.list.append( 
+                                       var rparams = obj.list.append( 
                                                { 'row' : 
                                                        { 'my' : 
                                                                { 'mobts' : obj.bills[i].transaction, 'circ' : obj.bills[i].circ, 'mvr' : obj.bills[i].record } 
@@ -92,6 +92,7 @@ patron.bills.prototype = {
                                                        'attributes' : { 'allowevents' : true } 
                                                } 
                                        );
+                                       var rnode = rparams.my_node;
                                        obj.bill_map[ obj.bills[i].transaction.id() ] = obj.bills[i];
                                        var cb = rnode.getElementsByTagName('checkbox')[0];
                                        var tb = rnode.getElementsByTagName('textbox')[0];
index b1c6864..59542dd 100644 (file)
@@ -397,23 +397,23 @@ patron.display.prototype = {
                                                        function(req) {
                                                                try {
                                                                        var msg = ''; obj.stop_checkouts = false;
-                                                                       if (patron.alert_message()) msg += 'Alert message: "' + patron.alert_message() + '"\n';
+                                                                       if (patron.alert_message()) msg += 'Alert message: "' + patron.alert_message() + '"<br/><br/>\n';
                                                                        //alert('obj.barcode = ' + obj.barcode);
                                                                        if (obj.barcode) {
                                                                                if (patron.cards()) for (var i = 0; i < patron.cards().length; i++) {
                                                                                        //alert('card #'+i+' == ' + js2JSON(patron.cards()[i]));
                                                                                        if ( (patron.cards()[i].barcode()==obj.barcode) && ( ! get_bool(patron.cards()[i].active()) ) ) {
-                                                                                               msg += 'Patron account retrieved with an INACTIVE card.\n';
+                                                                                               msg += 'Patron account retrieved with an INACTIVE card.<br/><br/>\n';
                                                                                                obj.stop_checkouts = true;
                                                                                        }
                                                                                }
                                                                        }
                                                                        if (get_bool(patron.barred())) {
-                                                                               msg += 'Patron account is BARRED.\n';
+                                                                               msg += 'Patron account is BARRED.<br/><br/>\n';
                                                                                obj.stop_checkouts = true;
                                                                        }
                                                                        if (!get_bool(patron.active())) {
-                                                                               msg += 'Patron account is INACTIVE.\n';
+                                                                               msg += 'Patron account is INACTIVE.<br/><br/>\n';
                                                                                obj.stop_checkouts = true;
                                                                        }
                                                                        if (patron.expire_date()) {
@@ -428,7 +428,7 @@ patron.display.prototype = {
                                                                                expire = expire.getTime()/1000
 
                                                                                if (expire < now) {
-                                                                                       msg += 'Patron account is EXPIRED.\n';
+                                                                                       msg += 'Patron account is EXPIRED.<br/><br/>\n';
                                                                                obj.stop_checkouts = true;
                                                                                }
                                                                        }
@@ -438,7 +438,7 @@ patron.display.prototype = {
                                                                                if (msg != obj.old_msg) {
                                                                                        //obj.error.yns_alert(msg,'Alert Message','OK',null,null,'Check here to confirm this message.');
                                                                                        document.documentElement.firstChild.focus();
-                                                                                       var data_url = window.escape("<img src='" + xulG.url_prefix('/xul/server/skin/media/images/stop_sign.png') + "'/>" + '<h1>Alert</h1><blockquote><pre>' + msg + '\r\n\r\nPress a navigation button above (e.g. Check Out) to clear this alert.</pre></blockquote>');
+                                                                                       var data_url = window.escape("<img src='" + xulG.url_prefix('/xul/server/skin/media/images/stop_sign.png') + "'/>" + '<h1>Alert</h1><blockquote><p>' + msg + '</p>\r\n\r\n<pre>Press a navigation button above (e.g. Check Out) to clear this alert.</pre></blockquote>');
                                                                                        obj.right_deck.set_iframe('data:text/html,'+data_url,{},{});
                                                                                        obj.old_msg = msg;
                                                                                } else {
@@ -522,7 +522,7 @@ patron.display.prototype = {
                                                                document.documentElement.setAttribute('class','');
                                                                setTimeout(
                                                                        function() {
-                                                                               var frame = obj.left_deck.set_iframe(
+                                                                               var frame = obj.left_deck.reset_iframe(
                                                                                        urls.XUL_PATRON_SUMMARY, // + '?id=' + window.escape(list[0]),
                                                                                        {},
                                                                                        {
index f2ca292..935b10a 100644 (file)
@@ -10,6 +10,8 @@ patron.items = function (params) {
 
 patron.items.prototype = {
 
+       'list_circ_map' : {},
+
        'init' : function( params ) {
 
                var obj = this;
@@ -87,21 +89,21 @@ patron.items.prototype = {
                                        'cmd_items_print2' : [ ['command'], function() { obj.items_print(2); } ],
                                        'cmd_items_export' : [ ['command'], function() { obj.items_export(1); } ],
                                        'cmd_items_export2' : [ ['command'], function() { obj.items_export(2); } ],
-                                       'cmd_items_renew' : [ ['command'], function() { obj.items_renew(1); /*alert('Action complete.'); obj.retrieve();*/ } ],
+                                       'cmd_items_renew' : [ ['command'], function() { obj.items_renew(1); /* obj.retrieve();*/ } ],
                                        'cmd_items_renew_all' : [ ['command'], function() { obj.items_renew_all(); } ],
-                                       'cmd_items_renew2' : [ ['command'], function() { obj.items_renew(2); /*alert('Action complete.'); obj.retrieve();*/ } ],
-                                       'cmd_items_edit' : [ ['command'], function() { obj.items_edit(1); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_edit2' : [ ['command'], function() { obj.items_edit(2); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_mark_lost' : [ ['command'], function() { obj.items_mark_lost(1); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_mark_lost2' : [ ['command'], function() { obj.items_mark_lost(2); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_claimed_returned' : [ ['command'], function() { obj.items_claimed_returned(1); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_claimed_returned2' : [ ['command'], function() { obj.items_claimed_returned(2); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_checkin' : [ ['command'], function() { obj.items_checkin(1); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_items_checkin2' : [ ['command'], function() { obj.items_checkin(2); alert('Action complete.'); obj.retrieve(); } ],
+                                       'cmd_items_renew2' : [ ['command'], function() { obj.items_renew(2); /* obj.retrieve();*/ } ],
+                                       'cmd_items_edit' : [ ['command'], function() { obj.items_edit(1);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_edit2' : [ ['command'], function() { obj.items_edit(2);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_mark_lost' : [ ['command'], function() { obj.items_mark_lost(1);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_mark_lost2' : [ ['command'], function() { obj.items_mark_lost(2);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_claimed_returned' : [ ['command'], function() { obj.items_claimed_returned(1);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_claimed_returned2' : [ ['command'], function() { obj.items_claimed_returned(2);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_checkin' : [ ['command'], function() { obj.items_checkin(1);  /*obj.retrieve();*/ } ],
+                                       'cmd_items_checkin2' : [ ['command'], function() { obj.items_checkin(2);  /*obj.retrieve();*/ } ],
                                        'cmd_show_catalog' : [ ['command'], function() { obj.show_catalog(1); } ],
                                        'cmd_show_catalog2' : [ ['command'], function() { obj.show_catalog(2); } ],
-                                       'cmd_add_billing' : [ ['command'], function() { obj.add_billing(1); alert('Action complete.'); obj.retrieve(); } ],
-                                       'cmd_add_billing2' : [ ['command'], function() { obj.add_billing(2); alert('Action complete.'); obj.retrieve(); } ],
+                                       'cmd_add_billing' : [ ['command'], function() { obj.add_billing(1);  /*obj.retrieve();*/ } ],
+                                       'cmd_add_billing2' : [ ['command'], function() { obj.add_billing(2);  /*obj.retrieve();*/ } ],
                                        'cmd_show_noncats' : [ ['command'], function() { obj.show_noncats(); } ],
                                }
                        }
@@ -259,7 +261,7 @@ patron.items.prototype = {
                                try {
                                        obj.list.select_all();
                                        obj.items_renew(1,true);        
-                                       setTimeout(function(){list.on_all_fleshed = null; /*alert('Action complete.'); obj.retrieve();*/ },0);
+                                       setTimeout(function(){list.on_all_fleshed = null; /* obj.retrieve();*/ },0);
                                } catch(E) {
                                        obj.error.standard_unexpected_error_alert('2 All items were not likely renewed',E);
                                }
@@ -286,7 +288,7 @@ patron.items.prototype = {
 
                        var count = 0;
 
-                       function gen_renew(bc) {
+                       function gen_renew(bc,circ_id) {
                                var x = document.getElementById('renew_msgs');
                                if (x) {
                                        var l = document.createElement('label');
@@ -302,9 +304,10 @@ patron.items.prototype = {
                                                }
                                                count--;
                                                if (count == 0) {
-                                                       if (window.confirm('Action completed. Refresh list?')) obj.retrieve();
+                                                       //if (window.confirm('Action completed. Refresh list?')) obj.retrieve();
                                                        JSAN.use('util.widgets'); util.widgets.remove_children(x);
                                                }
+                                               obj.refresh(circ_id);
                                        } 
                                );
                        }
@@ -313,8 +316,8 @@ patron.items.prototype = {
                                try {
                                        count++;
                                        var barcode = retrieve_ids[i].barcode;
-                                       gen_renew(barcode);
-
+                                       var circ_id = retrieve_ids[i].circ_id;
+                                       gen_renew(barcode,circ_id);
                                } catch(E) {
                                        obj.error.standard_unexpected_error_alert('Renew probably did not happen for barcode ' + barcode,E);
                                }
@@ -371,6 +374,9 @@ patron.items.prototype = {
                                                if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
                                        }
                                }
+                               for (var i = 0; i < obj.retrieve_ids.length; i++) {
+                                       obj.refresh(retrieve_ids[i].circ_id);
+                               }
                        } catch(E) {
                                obj.error.standard_unexpected_error_alert('The due dates were not likely modified.',E);
                        }
@@ -386,6 +392,7 @@ patron.items.prototype = {
                                dump('Mark barcode lost = ' + barcode);
                                var robj = obj.network.simple_request( 'MARK_ITEM_LOST', [ ses(), { barcode: barcode } ]);
                                if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
+                               obj.refresh(retrieve_ids[i].circ_id);
                        }
                } catch(E) {
                        obj.error.standard_unexpected_error_alert('The items were not likely marked lost.',E);
@@ -442,6 +449,7 @@ patron.items.prototype = {
                                        if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
                                }
                        }
+                       for (var i = 0; i < retrieve_ids.length; i++) obj.refresh(retrieve_ids[i].circ_id);
                } catch(E) {
                        obj.error.standard_unexpected_error_alert('The items were not likely marked Claimed Returned.',E);
                }
@@ -464,6 +472,7 @@ patron.items.prototype = {
                                        ses(), { 'copy_id' : copy_id }
                                );
                                /* circ.util.checkin_via_barcode handles errors currently */
+                               obj.refresh(retrieve_ids[i].circ_id);
                        }
                } catch(E) {
                        obj.error.standard_unexpected_error_alert('Checkin probably did not happen.',E);
@@ -641,6 +650,24 @@ patron.items.prototype = {
                );
        },
 
+       'refresh' : function(circ_id) {
+               var obj = this;
+               try {
+                       var nparams = obj.list_circ_map[circ_id];
+                       var which_list = nparams.which_list;
+                       switch(which_list) {
+                               case 1: case '1':
+                                       setTimeout(function(){try{obj.list2.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
+                                       break;
+                               default:
+                                       setTimeout(function(){try{obj.list.refresh_row(nparams);}catch(E){obj.error.standard_unexpected_error_alert('2 Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);}},1000);
+                                       break;
+                       }
+               } catch(E) {
+                       obj.error.standard_unexpected_error_alert('Error refreshing row in list\ncirc_id = ' + circ_id + '\nnparams = ' + nparams,E);
+               }
+       },
+
        'retrieve' : function(dont_show_me_the_list_change) {
                var obj = this;
                if (window.xulG && window.xulG.checkouts) {
@@ -677,14 +704,20 @@ patron.items.prototype = {
                function gen_list_append(circ_id,which_list) {
                        return function() {
                                try {
+                                       var nparams;
                                        switch(which_list) {
                                                case 1:
-                                                       obj.list2.append( { 'row' : { 'my' : { 'circ_id' : circ_id } },  'to_bottom' : true } );
+                                                       nparams = obj.list2.append( { 'row' : { 'my' : { 'circ_id' : circ_id } },  'to_bottom' : true, 'which_list' : which_list } );
                                                break;
                                                default:
-                                                       obj.list.append( { 'row' : { 'my' : { 'circ_id' : circ_id } }, 'to_bottom' : true } );
+                                                       nparams = obj.list.append( { 'row' : { 'my' : { 'circ_id' : circ_id } }, 'to_bottom' : true, 'which_list' : which_list } );
                                                break;
                                        }
+                                       if (nparams) {
+                                               obj.list_circ_map[circ_id] = nparams; // unlike item status interface, each circ should be in this list only once
+                                       } else {
+                                               alert('foo');
+                                       }
                                } catch(E) {
                                        alert(E);
                                }
index edb3724..a6c1c49 100644 (file)
@@ -212,18 +212,13 @@ patron.search_form.prototype = {
        'submit' : function() {
                window.xulG.clear_left_deck();
                var obj = this;
-               var query = '';
+               var query = {};
                for (var i = 0; i < obj.controller.render_list.length; i++) {
                var id = obj.controller.render_list[i][0];
                var node = document.getElementById(id);
                        if (node && node.value != '') {
-                               if (query == '') {
-                                       // Responsible for own ? or &
-                               } else {
-                                       query += '&';
-                               }
                                if (id == 'inactive') {
-                                       query += id + '=' + window.escape(node.getAttribute('value'));
+                                       query[id] = node.getAttribute('value');
                                        obj.error.sdump('D_DEBUG','id = ' + id + '  value = ' + node.getAttribute('value') + '\n');
                                } else {
                                        var value = node.value.replace(/^\s+/,'').replace(/[\\\s]+$/,'');
@@ -236,7 +231,7 @@ patron.search_form.prototype = {
                                                break;
                                        }
                                        if (value != '') {
-                                               query += id + '=' + window.escape(value);
+                                               query[id] = value;
                                                obj.error.sdump('D_DEBUG','id = ' + id + '  value = ' + value + '\n');
                                        }
                                }
index 1f315c3..322596a 100644 (file)
                                JSAN.use('patron.search_form'); g.search_form = new patron.search_form();
                                g.search_form.init( { 'query' : query } );
 
-                               if (g.cgi.param('doit')) {
+                               if (g.cgi.param('doit')||xulG.doit) {
                                        g.search_form.submit();
                                }
        
                        } catch(E) {
                                var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
-                                       "system administrator or software developer the following:\n" 
-                                       'patron/search_form.xul\n' + E + '\n';
+                                       "system administrator or software developer the following:\n" + 'patron/search_form.xul\n' + E + '\n';
                                try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
                                alert(err_msg);
                        }
diff --git a/OpenSRF/bin/osrf_ctl.sh b/OpenSRF/bin/osrf_ctl.sh
deleted file mode 100755 (executable)
index 89bb4a5..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/bash
-
-OPT_ACTION=""
-OPT_PERL_CONFIG=""
-OPT_C_CONFIG=""
-OPT_PID_DIR=""
-
-# ---------------------------------------------------------------------------
-# Make sure we're running as the correct user
-# ---------------------------------------------------------------------------
-[ $(whoami) != 'opensrf' ] && echo 'Must run as user "opensrf"' && exit;
-
-
-# NOTE: Eventually, there will be one OpenSRF config file format
-# When this happens, we will only need a single OPT_CONFIG variable
-
-function usage {
-       echo "";
-       echo "usage: $0 -d <pid_dir> -p <perl_config> -c <c_config> -a <action>";
-       echo "";
-       echo "Actions include:"
-       echo -e "\tstart_router"
-       echo -e "\tstop_router"
-       echo -e "\trestart_router"
-       echo -e "\tstart_perl"
-       echo -e "\tstop_perl"
-       echo -e "\trestart_perl"
-       echo -e "\tstart_c"
-       echo -e "\tstop_c"
-       echo -e "\trestart_c"
-       echo -e "\tstart_osrf"
-       echo -e "\tstop_osrf"
-       echo -e "\trestart_osrf"
-       echo -e "\tstop_all" 
-       echo -e "\tstart_all"
-       echo -e "\trestart_all"
-       echo "";
-    echo "Example:";
-    echo "  $0 -p bootstrap.conf -c opensrf_core.xml -a restart_all";
-    echo "";
-       exit;
-}
-
-
-# ---------------------------------------------------------------------------
-# Load the command line options and set the global vars
-# ---------------------------------------------------------------------------
-while getopts  "p:c:a:d:h" flag; do
-       case $flag in   
-               "a")            OPT_ACTION="$OPTARG";;
-               "c")            OPT_C_CONFIG="$OPTARG";;
-               "p")            OPT_PERL_CONFIG="$OPTARG";;
-               "d")            OPT_PID_DIR="$OPTARG";;
-               "h"|*)  usage;;
-       esac;
-done
-
-
-[ -z "$OPT_PID_DIR" ] && OPT_PID_DIR=/tmp;
-[ -z "$OPT_ACTION" ] && usage;
-
-PID_ROUTER="$OPT_PID_DIR/router.pid";
-PID_OSRF_PERL="$OPT_PID_DIR/osrf_perl.pid";
-PID_OSRF_C="$OPT_PID_DIR/osrf_c.pid";
-
-
-# ---------------------------------------------------------------------------
-# Utility code for checking the PID files
-# ---------------------------------------------------------------------------
-function do_action {
-
-       action="$1"; 
-       pidfile="$2";
-       item="$3"; 
-
-       if [ $action == "start" ]; then
-
-               if [ -e $pidfile ]; then
-                       pid=$(cat $pidfile);
-                       echo "$item already started : $pid";
-                       return 0;
-               fi;
-               echo "Starting $item";
-       fi;
-
-       if [ $action == "stop" ]; then
-
-               if [ ! -e $pidfile ]; then
-                       echo "$item not running";
-                       return 0;
-               fi;
-
-               pid=$(cat $pidfile);
-               echo "Stopping $item : $pid";
-               kill -s INT $pid 2> /dev/null;
-        sleep 1;
-               kill -9 $pid 2> /dev/null;
-               rm -f $pidfile;
-
-       fi;
-
-       return 0;
-}
-
-
-# ---------------------------------------------------------------------------
-# Start / Stop functions
-# ---------------------------------------------------------------------------
-
-
-function start_router {
-       do_action "start" $PID_ROUTER "OpenSRF Router";
-       opensrf_router $OPT_C_CONFIG router
-       pid=$(ps ax | grep "OpenSRF Router" | grep -v grep | awk '{print $1}')
-       echo $pid > $PID_ROUTER;
-       return 0;
-}
-
-function stop_router {
-       do_action "stop" $PID_ROUTER "OpenSRF Router";
-       return 0;
-}
-
-function start_perl {
-       do_action "start" $PID_OSRF_PERL "OpenSRF Perl";
-       perl -MOpenSRF::System="$OPT_PERL_CONFIG" -e 'OpenSRF::System->bootstrap()' & 
-       pid=$!;
-       echo $pid > $PID_OSRF_PERL;
-       sleep 5;
-       return 0;
-}
-
-function stop_perl {
-       do_action "stop" $PID_OSRF_PERL "OpenSRF Perl";
-       sleep 1;
-       return 0;
-}
-
-function start_c {
-       host=$(perl -MNet::Domain=hostfqdn -e 'print hostfqdn()')
-       do_action "start" $PID_OSRF_C "OpenSRF C (host=$host)";
-       opensrf-c $host $OPT_C_CONFIG opensrf;
-       pid=$(ps ax | grep "OpenSRF System-C" | grep -v grep | awk '{print $1}')
-       echo $pid > "$PID_OSRF_C";
-       return 0;
-}
-
-function stop_c {
-       do_action "stop" $PID_OSRF_C "OpenSRF C";
-       killall -9 opensrf-c  # hack for now to force kill all C services
-       sleep 1;
-       return 0;
-}
-
-
-
-# ---------------------------------------------------------------------------
-# Do the requested action
-# ---------------------------------------------------------------------------
-case $OPT_ACTION in
-       "start_router") start_router;;
-       "stop_router") stop_router;;
-       "restart_router") stop_router; start_router;;
-       "start_perl") start_perl;;
-       "stop_perl") stop_perl;;
-       "restart_perl") stop_perl; start_perl;;
-       "start_c") start_c;;
-       "stop_c") stop_c;;
-       "restart_c") stop_c; start_c;;
-       "start_osrf") start_perl; start_c;;
-       "stop_osrf") stop_perl; stop_c;;
-       "restart_osrf") stop_perl; stop_c; start_perl; start_c;;
-       "stop_all") stop_c; stop_perl; stop_router;;
-       "start_all") start_router; start_perl; start_c;;
-       "restart_all") stop_c; stop_perl; stop_router; start_router; start_perl; start_c;;
-       *) usage;;
-esac;
-
-
-
diff --git a/OpenSRF/doc/Application-HOWTO.txt b/OpenSRF/doc/Application-HOWTO.txt
deleted file mode 100644 (file)
index 41deae1..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-OpenSRF Application development API
------------------------------------
-
-OpenSRF offers a very simple Application development API to users of the
-framework.  All that is required is to create a Perl module that subclasses
-the OpenSRF::Application package and register it's methods with the
-Method Dispatcher framework.
-
-Each method executes in the OpenSRF::Application namespace as an instance of
-the custom Application.  There are some instance methods on this object which
-can be used by the method to alter the behavior or response that the method
-sends to the client:
-
-  $self->api_name  # returns the name of the method as called by the client
-
-  $self->method    # returns the actual perl name of the sub implementing the
-                   # method
-
-  my $meth = $self->method_lookup( 'api_name' )
-                   # constructs a new instance object implementing another
-                   # method in the same Application package as a subrequest
-
-  my ($subresult) = $meth->run( @params )
-                   # runs the subrequest method and returns the array of
-                  # results
-
-
-The method is also handed an OpenSRF::AppRequest object that has been
-constructed for the client request that generated the call to the method.
-This OpenSRF::AppRequest object is used to communicate back to the client,
-passing status messages or streaming response packets.
-
-All that is required to register an Application with OpenSRF is to place a
-setting in the configuration file that names the module that implements the
-new Application, and to add the new Application's symbolic name to the list of
-servers that should be started by OpenSRF.
-
-   Example Application
-   -------------------
-
-  # Perl module and package implementing an math server.
-  package MyMathServer;
-  use OpenSRF::Application;
-  use base 'OpenSRF::Application';
-
-  sub do_math {
-     my $self = shift;    # instance of MyMathServer
-     
-     my $client = shift;  # instance of OpenSRF::AppRequest connected
-                          # to the client
-     
-     my $left_side = shift;
-     my $op = shift;
-     my $right_side = shift;
-     
-     return eval "$left_side $op $right_side";
-  }
-
-  __PACKAGE__->register_method(
-     api_name => 'useless.do_math',
-     argc => 3,
-     method => 'do_math'
-  );
-
-  1;
-
-
-  
-  # Another Perl module and package implementing a square-root server on top
-  # of the previous math server
-  package MySquareRootServer;
-  use OpenSRF::Application;
-  use base 'OpenSRF::Application';
-  use MyMathServer;
-
-  sub sqrt_math {
-     my $self = shift;    # instance of MySquareRootServer
-     
-     my $client = shift;  # instance of OpenSRF::AppRequest connected
-                          # to the client
-     
-     my $math_method = $self->method_lookup('useless.do_math');
-     my ($result) = $math_method->run( @_ );
-     
-     return sqrt( $result );
-  }
-
-  __PACKAGE__->register_method(
-     api_name => 'simple.sqrt',
-     argc => 3,
-     method => 'sqrt_math'
-  );
-
-  1;
-
diff --git a/OpenSRF/doc/OpenSRF-Messaging-Protocol.html b/OpenSRF/doc/OpenSRF-Messaging-Protocol.html
deleted file mode 100644 (file)
index 1eeff04..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-<html>
-
-       <head>
-
-               <title> OILS Messaging </title>
-
-       </head>
-
-       <body>
-
-
-               <h1> Abstract </h1>
-
-               <p>
-
-               The OpenSRF messaging system works on two different primary layers: the transport layer and the
-               application layer.  The transport layer manages virtual connections between client and server,
-               while the application layer manages user/application level messages.  
-
-               All messages must declare which protocol version they are requesting.  The current protocol level
-               is 1.
-
-               <h1> Transport Layer </h1>
-
-               <p>
-               There are currently three types of messages in the transport layer: <b>CONNECT, STATUS, </b> and
-               <b>DISCONNECT</b>.    
-               
-               <p>
-               <b>STATUS</b> messages provide general information to the transport layer and are used in different 
-               ways throughout the system.  They are sent primarily by the server in response to client requests.  
-               Each message comes with 
-               a status and statusCode.  The actual status part of the STATUS message is just a helpful message 
-               (mostly for debugging).  The 
-               statusCode is an integer representing the exact status this message represents.  The status codes
-               are modeled after HTTP status codes.  Currently used codes consist of the following:
-
-               <b> <pre style="border: solid thin blue; margin: 2% 10% 2% 10%; padding-left: 50px">
-               100     STATUS_CONTINUE
-               200     STATUS_OK       
-               205     STATUS_COMPLETE
-               307     STATUS_REDIRECTED
-               400     STATUS_BADREQUEST
-               404     STATUS_NOTFOUND
-               408     STATUS_TIMEOUT
-               417     STATUS_EXPFAILED
-               </pre> </b>
-
-               <p>
-               This list is likely to change at least a little.
-
-
-               <p>
-               The <b>CONNECT</b> message initiates the virtual connection for a client and expects a <b>STATUS</b>
-               in return.  If the connection is successful, the statusCode for the <b>STATUS</b> message shall be
-               <b>STATUS_OK</b>.  
-
-               <p>
-               If at any point the client sends a non-connect message to the server when the client is not connected or the 
-               connection has timed out, the <b>STATUS</b> that is returned shall have statusCode <b>STATUS_EXPFAILED</b>.
-               
-               <p>
-               The <b>DISCONNECT</b> message is sent by the client to the server to end the virtual session.  The server
-               shall not respond to any disconnect messages.
-       
-               
-               <h1> Message Layer </h1>
-
-               <p>
-               There are currently two types of message layer messages: <b>REQUEST</b> and <b>RESULT</b>.  <b>REQUEST</b>
-               messages represent application layer requests made by a client and <b>RESULT</b> messages are the servers 
-               response to such <b>REQUEST</b>'s.
-               
-               <p>
-               By design, all <b>CONNECT</b> and <b>REQUEST</b> messages sent by a client will be acknowledged by one or 
-               more responses from the server.  This is much like the SYN-ACK philosophy of TCP, however different in many 
-               ways.  The only guarantees made by the server are 1. you will know that we received your request and 2. you 
-               will know the final outcome of your request.  It is the responsibility of the actual application to send 
-               the requested application data (e.g. RESULT messages, intermediate STATUS messages).
-               
-               
-               <p>
-               The server responses are matched to client requests by a <b>threadTrace</b>.  A threadTrace is simply a 
-               number and all application layer messages and STATUS messages are required to have one.  (Note that the 
-               threadTrace contained within a STATUS message sent in response to a CONNECT will be ignored).  Currently, 
-               there is no restriction on the number other than it shall be unique within a given virtual connection.  
-               When the server receives a <b>REQUEST</b> message, it extracts the <b>threadTrace</b> from the message 
-               and all responses to that request will contain the same <b>threadTrace</b>.
-               
-               <p>
-               As mentioned above, every <b>CONNECT</b> message will be acknowledged by a single 
-               <b>STATUS</b> message.  <b>REQUEST</b>'s are a little more complex, however.  A <b>REQUEST</b> 
-               will receive one or more <b>RESULT</b>'s if the <b>REQUEST</b> warrants such a response.  A <b>REQUEST</b>
-               may even receive one or more intermediate <b>STATUS</b>'s (e.g. <b>STATUS_CONTINUE</b>).  (Consult the 
-               documentation on the application request the client is requesting for more information on the number and 
-               type of responses to that request).  All <b>REQUEST</b>'s, however, regardless of other response types,
-               shall receieve as the last response a <b>STATUS</b> message with statusCode <b>STATUS_COMPLETE</b>.  This
-               allows the client to wait for REQUEST "completeness" as opposed to waiting on or calculating individual 
-               responses.
-
-
-               <h1> Client Pseudocode </h1>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-send CONNECT
-
-msg = recv()
-
-if ( msg.statusCode == STATUS_OK ) 
-
-       OK. continue
-
-while ( more requests ) {
-
-       /* you may send multiple requests before processing any responses.  For the sake
-               of this example, we will only walk through a single client request */
-
-       send REQUEST with threadTrace X 
-
-       while ( response = recv ) { 
-
-               if (  response.threadTrace != X ) 
-
-                       continue/ignore
-
-               if ( response.type == STATUS )
-               
-                       if (  response.statusCode == STATUS_TIMEOUT             or
-                                       response.statusCode == STATUS_REDIRECTED        or
-                                       response.statusCode == STATUS_EXPFAILED)
-
-                               resend the the request with threadTrace X because it was not honored.
-
-                       if ( response.statusCode == STATUS_COMPLETE ) 
-
-                               the request is now complete, nothing more to be done with this request
-                               break out of loop
-       
-               if ( response.typ == RESULT )
-
-                       pass result to the application layer for processing
-
-       } // receiving
-
-} // sending
-
-
-               </pre>
-
-               <br>
-               <h1> Server Pseudocode </h1>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-while( message = recv() ) {
-
-       if( message.type != CONNECT )
-
-               return a STATUS with statusCode STATUS_EXPFAILED
-               start loop over
-
-       if ( message.type == CONNECT )
-
-               return STATUS with statusCode STATUS_OK and continue
-
-       while ( msg = recv() and virtual session is active ) {
-
-
-               if ( msg.type == REQUEST )
-
-                       Record the threadTrace.  Pass the REQUEST to the application layer for processing.
-                       When the application layer has completed processing, respond to the client
-                       with a STATUS message with statusCode STATUS_COMPLETE and threadTrace matching
-                       the threadTrace of the REQUEST.  Once the final STATUS_COMPLETE message is sent,
-                       the session is over.  Return to outer server loop. 
-
-                       /* Note: during REQUEST processing by the application layer, the application may 
-                               opt to send RESULT and/or STATUS messages to the client.  The server side
-                               transport mechanism is not concerned with these messages.  The server only 
-                               needs to be notified when the REQUEST has been sucessfully completed. */
-
-               if( message.type == DISCONNECT )
-
-                       Virtual session has ended. Return to outer loop.
-
-
-       } // Sessin loop
-
-} // Main server loop
-
-
-
-               </pre>
-
-
-               <br>
-               <h1> XML Examples</h1>
-               <br>
-
-
-               <h2> Protocol Element </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObjectAttr value="1" name="protocol"/>
-
-               </pre>
-
-               <h2> threadTrace Element </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObjectAttr value="1" name="threadTrace"/>
-
-               </pre>
-
-               <h2> CONNECT Message </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObject name="oilsMessage">
-       &lt;oils:domainObjectAttr value="CONNECT" name="type"/>
-       &lt;oils:domainObjectAttr value="1" name="threadTrace"/>
-       &lt;oils:domainObjectAttr value="1" name="protocol"/>
-&lt;/oils:domainObject>
-
-               </pre>
-
-
-               <h2> DISCONNECT Message </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObject name="oilsMessage">
-       &lt;oils:domainObjectAttr value="DISCONNECT" name="type"/>
-       &lt;oils:domainObjectAttr value="0" name="threadTrace"/>
-       &lt;oils:domainObjectAttr value="1" name="protocol"/>
-&lt;/oils:domainObject>
-
-               </pre>
-
-               <h2> STATUS Message </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObject name="oilsMessage">
-       &lt;oils:domainObjectAttr value="STATUS" name="type"/>
-       &lt;oils:domainObjectAttr value="0" name="threadTrace"/>
-       &lt;oils:domainObjectAttr value="1" name="protocol"/>
-       &lt;oils:domainObject name="oilsConnectStatus">
-               &lt;oils:domainObjectAttr value="Connection Successful" name="status"/>
-               &lt;oils:domainObjectAttr value="200" name="statusCode"/>
-       &lt;/oils:domainObject>
-&lt;/oils:domainObject>
-
-               </pre>
-
-               <h2> REQUEST Message </h2>
-
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObject name="oilsMessage">
-       &lt;oils:domainObjectAttr value="REQUEST" name="type"/>
-       &lt;oils:domainObjectAttr value="4" name="threadTrace"/>
-       &lt;oils:domainObjectAttr value="1" name="protocol"/>
-       &lt;oils:domainObject name="oilsMethod">
-               &lt;oils:domainObjectAttr value="mult" name="method"/>
-               &lt;oils:params>[1, 2]&lt;/oils:params>
-       &lt;/oils:domainObject>
-&lt;/oils:domainObject>
-
-               </pre>
-
-               <h2> RESULT Message </h2>
-               
-               <pre style="border: solid thin blue; margin: 0% 10% 0% 10%; padding-left: 50px">
-
-&lt;oils:domainObject name="oilsMessage">
-       &lt;oils:domainObjectAttr value="RESULT" name="type"/>
-       &lt;oils:domainObjectAttr value="4" name="threadTrace"/>
-       &lt;oils:domainObjectAttr value="1" name="protocol"/>
-       &lt;oils:domainObject name="oilsResult">
-               &lt;oils:domainObjectAttr value="OK" name="status"/>
-               &lt;oils:domainObjectAttr value="200" name="statusCode"/>
-               &lt;oils:domainObject name="oilsScalar">2&lt;/oils:domainObject>
-       &lt;/oils:domainObject>
-&lt;/oils:domainObject>
-
-               </pre>
-               
-
-       </body>
-
-</html>
-
-
diff --git a/OpenSRF/doc/Persist-API.html b/OpenSRF/doc/Persist-API.html
deleted file mode 100644 (file)
index 657e206..0000000
+++ /dev/null
@@ -1,651 +0,0 @@
-<html>
-       <head>
-               <title>OpenSRF Persistence Application API-Namespace</title>
-               <style><!--
-
-                       * {             font-family: sans-serif;
-                                       font-size: 13pt;
-                       }
-
-                       .sectionhead {  border: solid black 1px;
-                                       background-color: #333333;
-                                       font-weight: bold;
-                                       color: white;
-                                       text-align: center;
-                                       padding: 5px;
-                                       margin: 5px;
-                       }
-
-                       .section {      border: solid black 1px;
-                                       background-color: lightgray;
-                                       color: black;
-                                       padding: 5px;
-                                       margin: 5px;
-                                       margin-bottom: 15px;
-                       }
-
-                       .listheader {   font-weight: bold;
-                                       margin-top: 15px
-                       }
-                       
-                       .value {        font-style: italic;
-                                       margin-top: 5px;
-                                       margin-left: 20px;
-                       }
-
-                       .description {  margin-top: 0px;
-                                       margin-left: 30px;
-                       }
-
-                       //-->
-               </style>
-
-       </head>
-       <body>
-               <center>
-                       <h2>OpenSRF Persistence Application API-Namespace</h2>
-                       <hr width="90%">
-               </center>
-
-               <div style="margin: 30px;">
-                       The Persistence Application provides other OpenSRF Applications with a standard API for
-                       sharing and caching data.  These data are stored in Slots, and there are three basic
-                       interfaces for interacting with Slots:  QUEUEs, STACKs and OBJECTs.
-               </div>
-
-               <ul>
-                       <li> <h3>General Persistence Slot methods</h3>
-
-                       Methods used to create, set up and destroy slots.  
-                       <br><br>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.slot.create( slot_name )</div>
-
-                               Creates a Persistence Slot.
-
-                               <div class="listheader">Parameters:</div>
-                               <div class="value">slot_name (optional)</div>
-                               <div class="description">
-                                       The name of the Persistence Slot to create.  If a name is not specified
-                                       then the Slot is given a generic, unique name.  Automatically named Slots
-                                       are destroyed as soon as they are empty.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was created.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.slot.create_expirable( slot_name, expire_interval )</div>
-
-                               Creates a Persistence Slot that is automatically destroyed after the specified interval.
-
-                               <div class="listheader">Parameters:</div>
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to create.</div>
-                               <div class="value">expire_interval</div>
-                               <div class="description">
-                                       An interval describing how long to wait after an access has
-                                       occured on the Slot before automatically destroying it.  The interval
-                                       can be specified using a fairly complex, human readable format, or as
-                                       a number of seconds.  For example:
-                                       <ul>
-                                               <li> 1 day, 2 hours and 35 minutes </li>
-                                               <li> +2h </li>
-                                               <li> 1 week </li>
-                                               <li> 300 </li>
-                                       </ul>
-
-                                       A setting of 0 (zero) disables automatic expiration for a Slot.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was created.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.slot.set_expire( slot_name, expire_interval )</div>
-
-                               Sets or disables the expiration interval on an existing Persistence Slot.
-
-                               <div class="listheader">Parameters:</div>
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to update.</div>
-                               <div class="value">expire_interval</div>
-                               <div class="description">
-                                       An interval describing how long to wait after an access has
-                                       occured on the Slot before automatically destroying it.  The interval
-                                       can be specified using a fairly complex, human readable format, or as
-                                       a number of seconds.  For example:
-                                       <ul>
-                                               <li> 1 day, 2 hours and 35 minutes </li>
-                                               <li> +2h </li>
-                                               <li> 1 week </li>
-                                               <li> 300 </li>
-                                       </ul>
-
-                                       A setting of 0 (zero) disables automatic expiration for a Slot.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The number of seconds the requested interval represents.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.slot.destroy( slot_name )</div>
-
-                               Destroys a Persistence Slot.
-
-                               <div class="listheader">Parameters:</div>
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to destroy.</div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was destroyed.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <br>
-                       </li>
-
-                       <li> <h3>QUEUE API-Namespace Slot methods</h3>
-
-                       Uses the Slot in FIFO mode, pushing values onto one end an pulling them off the other.
-                       The QUEUE API-Namespace is useful for creating an ordered message passing access point.
-
-                       <br><br>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.push( slot_name, object )</div>
-
-                               Adds an object to a Slot in FIFO order.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to use for storing the object.</div>
-
-                               <div class="value">object</div>
-                               <div class="description">The object that should be pushed onto the front of the QUEUE.</div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was used.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.pop( slot_name )</div>
-
-                               Removes and returns the next value in a QUEUE type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which an object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The next object on the QUEUE Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.peek( slot_name )</div>
-
-                               Returns the next value in a QUEUE type Slot <u>without</u> removing it.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which an object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The next object on the QUEUE Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.peek.all( slot_name )</div>
-
-                               Returns all values in a QUEUE type Slot <u>without</u> removing them.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the objects should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       A stream of all objects on the QUEUE Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.peek.all.atomic( slot_name )</div>
-
-                               Returns all values in a QUEUE type Slot <u>without</u> removing them.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the objects should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       A single array of all objects on the QUEUE Slot, or an empty
-                                       array if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.length( slot_name )</div>
-
-                               Returns the number of objects in the QUEUE type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot in question.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The number of objects in the Persistence Slot.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.queue.size( slot_name )</div>
-
-                               Returns the number bytes taken up by the JSON encoded version of
-                               the objects in the QUEUE type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot in question.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The space, in bytes, used by the JSON encoded
-                                       objects in the Persistence Slot.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <br>
-                       </li>
-
-                       <li> <h3>STACK style Slot methods</h3>
-
-                       Uses the Slot in FILO mode, pushing and pulling objects at the same end of a list.
-                       The STACK API-Namespace is useful for creating a global Application context stack.
-
-                       <br><br>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.push( slot_name, object )</div>
-
-                               Adds an object to a Slot in FILO order.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to use for storing the object.</div>
-
-                               <div class="value">object</div>
-                               <div class="description">The object that should be pushed onto the front of the STACK.</div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was used.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.pop( slot_name )</div>
-
-                               Removes and returns the next value in a STACK type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which an object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The next object on the STACK Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.peek( slot_name )</div>
-
-                               Returns the next value in a STACK type Slot <u>without</u> removing it.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which an object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The next object on the STACK Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.peek.all( slot_name )</div>
-
-                               Returns all values in a STACK type Slot <u>without</u> removing them.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the objects should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       A stream of all objects on the STACK Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.peek.all.atomic( slot_name )</div>
-
-                               Returns all values in a STACK type Slot <u>without</u> removing them.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the objects should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       A single array of all objects on the STACK Slot, or an empty
-                                       array if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.depth( slot_name )</div>
-
-                               Returns the number of objects in the STACK type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot in question.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The number of objects in the Persistence Slot.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.stack.size( slot_name )</div>
-
-                               Returns the number bytes taken up by the JSON encoded version of
-                               the objects in the STACK type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot in question.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The space, in bytes, used by the JSON encoded
-                                       objects in the Persistence Slot.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <br>
-                       </li>
-
-                       <li> <h3>OBJECT style Slot methods</h3>
-
-                       Uses the Slot in Single Object mode, storing a single object in the Slot.
-
-                       <br><br>
-
-                       The OBJECT API-Namespace is useful for globally caching unique objects.
-
-                       <br><br>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.object.set( slot_name, object )</div>
-
-                               Sets the value of a Slot.  If the Slot has been used in STACK or QUEUE
-                               mode and <b>opensrf.persist.object.set</b> is called then all objects currently
-                               in the Slot will be lost.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">The name of the Persistence Slot to use for storing the object.</div>
-
-                               <div class="value">object</div>
-                               <div class="description">The object that should be set as the one object in the Slot.</div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">The name of the Slot that was used.</div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.object.get( slot_name )</div>
-
-                               Removes and returns the value in an OBJECT type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The object in the OBJECT Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.object.peek( slot_name )</div>
-
-                               Returns the value in an OBJECT type Slot <u>without</u> removing it.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot from which the object should be retrieved.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The object on the OBJECT Slot, or an empty
-                                       (NULL) result if the Slot is empty.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       <div class="section">
-                               <div class="sectionhead">opensrf.persist.object.size( slot_name )</div>
-
-                               Returns the number bytes taken up by the JSON encoded version of
-                               the object in the OBJECT type Slot.
-
-                               <div class="listheader">Parameters:</div>
-
-                               <div class="value">slot_name</div>
-                               <div class="description">
-                                       The name of the Persistence Slot in question.
-                               </div>
-
-
-                               <div class="listheader">Returns:</div>
-                               
-                               <div class="value">Success</div>
-                               <div class="description">
-                                       The space, in bytes, used by the JSON encoded
-                                       object in the Persistence Slot.
-                               </div>
-
-                               <div class="value">Failure</div>
-                               <div class="description">An empty (NULL) result.</div>
-                       </div>
-
-                       </li>
-               </ul>
-       </body>
-</html>
diff --git a/OpenSRF/doc/Roadmap.txt b/OpenSRF/doc/Roadmap.txt
deleted file mode 100644 (file)
index f86ccd0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-Roadmap for OpenSRF === The high points as of Febuary 2005
-----------------------------------------------------------
-
-We will attempt to keep this file up to date as requirements for
-Open-ILS change over time, as they are certain to...
-
-==========
-
-# Version 0.1 (January 2005) -- Evolving CVS version ... stay tuned
-       
-       * Session failure recovery
-       * Initial specification for Application API
-       * Basic Application support
-       * Sub-requests within one Application
-
-# Version 0.2 (Febuary/March 2005) -- First full release as a package
-
-       * Centralized Application configuration management
-       * Automatic cross-server API discovery
-       * Transparent remote server sub-requests
-       * Object Persistence Application implementing Stacks, Queues
-         and Object Stores based on SQLite
-
-# Version 0.3 (March/April 2005) -- Version for use in the Alpha
-                                    release of Open-ILS
-
-       * Partial implementation of a BROADCAST mode for addressing all
-         Servers of a particular Class on one Router
-       * Distributed version of the Object Persistence Application
-
-# Version 0.5 (July/August 2005)
-
-       * Full implementation of a BROADCAST mode for addressing all
-         Servers of any number of Classes on any number of Routers
-       * Client side use of transparent API discovery; the client
-         libraries will automatically discover and use the correct
-         Server for any valid method request
-
-# Version 0.7 (October/November 2005)
-
-       * Basic inter-server session migration support in addition
-         to session failure recovery due to server failure
-
-# Version 0.9 (Some time in 2006)
-
-       * Built in distributed transaction support.
-
-# Version 1.0 (in the future)
-
-       * Who knows?
-
diff --git a/OpenSRF/doc/dokuwiki-doc-stubber.pl b/OpenSRF/doc/dokuwiki-doc-stubber.pl
deleted file mode 100755 (executable)
index fcdd03d..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/perl -w
-use OpenSRF::System qw(/pines/conf/bootstrap.conf);
-use Getopt::Long
-
-$| = 1;
-
-my $cvs_base = 'http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/src/perlmods/';
-my $nest = 0;
-my $service;
-my $filter;
-my $sort_ignore;
-
-GetOptions(    'cvs_base=s'    => \$cvs_base,
-               'nest'          => \$nest,
-               'service=s'     => \$service,
-               'ignore=s'      => \$sort_ignore,
-               'filter=s'      => \$filter,
-);
-
-unless( $service ) {
-       print "usage: $0 -s <service name> [-c <cvs repo base URL> -f <regex filter for method names> -n]\n";
-       exit;
-}
-
-OpenSRF::System->bootstrap_client();
-my $session = OpenSRF::AppSession->create( $service );
-
-my $req; 
-if ($filter) {
-       $req = $session->request('opensrf.system.method', $filter);
-} else {
-       $req = $session->request('opensrf.system.method.all');
-}
-
-my $count = 1;
-my %m;
-while( my $meth = $req->recv(60) ) {
-       $meth = $meth->content;
-
-       $api_name = $meth->{api_name};
-
-       $m{$api_name}{api_name} = $meth->{api_name};
-
-       $m{$api_name}{package} = $meth->{package};
-       $m{$api_name}{method} = $meth->{method};
-
-       $m{$api_name}{api_level} = int $meth->{api_level};
-       $m{$api_name}{server_class} = $meth->{server_class} || '**ALL**';
-       $m{$api_name}{stream} = int($meth->{stream} || 0);
-       $m{$api_name}{cachable} = int($meth->{cachable} || 0);
-
-       $m{$api_name}{note} = $meth->{note} || 'what I do';
-       ($m{$api_name}{cvs} = $m{$api_name}{package}) =~ s/::/\//go;
-
-       $m{$api_name}{stream} = $m{$api_name}{stream}?'Yes':'No';
-       $m{$api_name}{cachable} = $m{$api_name}{cachable}?'Yes':'No';
-
-       print STDERR "." unless ($count % 10);
-
-       $count++;
-}
-
-warn "\nThere are ".scalar(keys %m)." methods published by $service\n";
-
-my @m_list;
-if (!$sort_ignore) {
-       @m_list = sort keys %m;
-} else {
-       @m_list =
-               map { ($$_[0]) }
-               sort {
-                       $$a[1] cmp $$b[1]
-                               ||
-                       length($$b[0]) <=> length($$a[0])
-               } map {
-                       [$_ =>
-                       do {
-                               (my $x = $_) =~ s/^$sort_ignore//go;
-                               $x;
-                       } ]
-               } keys %m;
-}
-
-for my $meth ( @m_list ) {
-
-       my $pad = 0;
-       my $header = '=====';
-       if ($nest) {
-               no warnings;
-               (my $x = $meth) =~ s/\./$pad++;$1/eg;
-       }
-       $pad = ' 'x$pad;
-
-       print <<"       METHOD";
-$pad$header $meth $header
-
-$m{$meth}{note}
-
-  * [[osrf-devel:terms#opensrf_api-level|API Level]]: $m{$meth}{api_level}
-  * [[osrf-devel:terms#opensrf_server_class|Server Class]]: $m{$meth}{server_class}
-  * Implementation Method: [[$cvs_base/$m{$meth}{cvs}.pm|$m{$meth}{package}\::$m{$meth}{method}]]
-  * Streaming [[osrf-devel:terms#opensrf_method|Method]]: $m{$meth}{stream}
-  * Cachable [[osrf-devel:terms#opensrf_method|Method]]: $m{$meth}{cachable}
-
-  * **Parameters:**
-    * //param1//\\\\ what it is...
-  * **Returns:**
-    * //Success//\\\\ successful format
-    * //Failure//\\\\ failure format (exception, etc)
-
-
-       METHOD
-}
-
diff --git a/OpenSRF/examples/bootstrap.conf.example b/OpenSRF/examples/bootstrap.conf.example
deleted file mode 100644 (file)
index ce445f7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# ----------------------------------------------------------
-# bootstrap config file
-# ----------------------------------------------------------
-[bootstrap]
-
-# location of the opensrf.xml config file
-settings_config        = /path/to/opensrf.xml
-
-# log files directory
-log_dir                                = /path/to/log
-
-## Log file is either a file name or syslog:<facility> 
-#logfile                               = osrfysys.log
-logfile                                = syslog:local0
-
-# defines the syslog facility for the activity log
-#actlog                                = activity.log
-actlog                         = syslog:local1
-
-# log level
-debug                                  = ERROR
-#debug                         = INFO
-#debug                         = DEBUG
-#debug                         = INTERNAL
-
-# the jabber login of the router (changing this will likely cause problems)
-router_name                    = router
-
-# all jabber domains we want our app to connect to
-list:domains           = router1.domain.com, router2.domain.com
-
-# jabber login
-username                               = jabber_username
-
-# jabber password
-passwd                         = jabber_password
-
-# if port is non-numeric (e.g. /tmp/mysock.sock) then we will attempt to
-# connect to the specified string as a unix socket file 
-# This works with Chop Chop jabber only (opensrf custom jabber server)
-port                                   = 5222
-
-# --------------------------------------
-
diff --git a/OpenSRF/examples/fieldmapper2cdbi.xsl b/OpenSRF/examples/fieldmapper2cdbi.xsl
deleted file mode 100644 (file)
index f6ad904..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<xsl:stylesheet
-       version='1.0'
-       xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
-       xmlns:opensrf="http://opensrf.org/xmlns/opensrf"
-       xmlns:cdbi="http://opensrf.org/xmlns/opensrf/cdbi"
-       xmlns:database="http://opensrf.org/xmlns/opensrf/database"
-       xmlns:perl="http://opensrf.org/xmlns/opensrf/perl"
-       xmlns:javascript="http://opensrf.org/xmlns/opensrf/javascript"
-       xmlns:c="http://opensrf.org/xmlns/opensrf/c">
-       <xsl:output method="text" />
-       <xsl:strip-space elements="*"/>
-
-       <xsl:template match="/">
-               <xsl:apply-templates select="opensrf:fieldmapper/opensrf:classes"/>
-1;
-       </xsl:template>
-
-
-       <!-- sub-templates -->
-       <xsl:template match="opensrf:classes">
-               <xsl:for-each select="opensrf:class">
-                       <xsl:sort select="@id"/>
-                       <xsl:apply-templates select="."/>
-               </xsl:for-each>
-               <xsl:apply-templates select="opensrf:class/opensrf:links/opensrf:link[@type='has_a']"/>
-               <xsl:apply-templates select="opensrf:class/opensrf:links/opensrf:link[@type='has_many']"/>
-       </xsl:template>
-
-
-       
-       <xsl:template match="opensrf:class">
-               #-------------------------------------------------------------------------------
-               # <xsl:value-of select="$driver"/> Class definition for "<xsl:value-of select="@id"/>" (<xsl:value-of select="cdbi:class"/>)
-               #-------------------------------------------------------------------------------
-               package <xsl:value-of select="@cdbi:class"/>;
-               use base '<xsl:value-of select="cdbi:superclass"/>';
-
-               __PACKAGE__->table("<xsl:value-of select="database:table[@rdbms=$driver]/database:name"/>");
-               <xsl:if test="database:table[@rdbms=$driver]/database:sequence">
-                       __PACKCAGE__->sequence("<xsl:value-of select="database:table[@rdbms=$driver]/database:sequence"/>");
-               </xsl:if>
-
-               __PACKAGE__->columns(Primary => <xsl:apply-templates select="opensrf:fields/opensrf:field[@database:primary='true']"/>);
-               <xsl:if test="opensrf:fields/opensrf:field[@database:required='true' and not(@database:primary='true')]">
-                       __PACKAGE__->columns(
-                               Essential => <xsl:apply-templates
-                                               select="opensrf:fields/opensrf:field[@database:required='true' and not(@database:primary='true')]"/>
-                       );
-               </xsl:if>
-               <xsl:if test="opensrf:fields/opensrf:field[not(@database:required='true') and not(@database:primary='true')]">
-                       __PACKAGE__->columns(
-                               Others => <xsl:apply-templates
-                                               select="opensrf:fields/opensrf:field[not(@database:required='true') and not(@database:primary='true')]"/>
-                       );
-               </xsl:if>
-       </xsl:template>
-
-
-
-       <xsl:template match="database:table">
-       </xsl:template>
-
-
-
-       <xsl:template match="opensrf:field">
-               '<xsl:value-of select='@name'/>',
-       </xsl:template>
-
-
-
-       <xsl:template match="opensrf:link">
-               <xsl:variable name='source' select='@source'/>
-               <xsl:value-of select="../../@cdbi:class"/>-><xsl:value-of select="@type"/>(
-                       <xsl:value-of select="@field"/> => '<xsl:value-of select="//*[@id=$source]/@cdbi:class"/>'
-               );
-
-       </xsl:template>
-</xsl:stylesheet>
-
diff --git a/OpenSRF/examples/fieldmapper2javascript.xsl b/OpenSRF/examples/fieldmapper2javascript.xsl
deleted file mode 100644 (file)
index e2f8e1d..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-<xsl:stylesheet
-       version='1.0'
-       xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
-       xmlns:opensrf="http://opensrf.org/xmlns/opensrf"
-       xmlns:cdbi="http://opensrf.org/xmlns/opensrf/cdbi"
-       xmlns:database="http://opensrf.org/xmlns/opensrf/database"
-       xmlns:perl="http://opensrf.org/xmlns/opensrf/perl"
-       xmlns:javascript="http://opensrf.org/xmlns/opensrf/javascript"
-       xmlns:c="http://opensrf.org/xmlns/opensrf/c">
-       <xsl:output method="text" />
-       <xsl:strip-space elements="xsl:*"/>
-       <xsl:variable name="last_field_pos"/>
-
-       <xsl:template match="/">
-// support functions
-var IE = false;
-var unit_test = false;
-function instanceOf(object, constructorFunction) {
-       if(!IE) {
-               while (object != null) {
-                       if (object == constructorFunction.prototype)
-                               return true;
-                       object = object.__proto__;
-               }
-       } else {
-               while(object != null) {
-                       if( object instanceof constructorFunction )
-                               return true;
-                       object = object.__proto__;
-               }
-       }
-       return false;
-}
-// Top level superclass
-function Fieldmapper(array) {
-        this.array = [];
-        if(array) {
-                if (array.constructor == Array) {
-                        this.array = array;
-                } else if ( instanceOf( array, String ) || instanceOf( array, Number ) ) {
-
-                        var obj = null;
-                        if (this.cacheable) {
-                                try {
-                                        obj = this.baseClass.obj_cache[this.classname][array];
-                                } catch (E) {};
-                        }
-
-                        if (!obj) {
-                                obj = user_request(
-                                        'open-ils.proxy',
-                                        'open-ils.proxy.proxy',
-                                        [
-                                                mw.G.auth_ses[0],
-                                                'open-ils.storage',
-                                                'open-ils.storage.direct.' + this.db_type + '.retrieve',
-                                                array
-                                        ]
-                                )[0];
-
-                                if (this.cacheable) {
-                                        if (this.baseClass.obj_cache[this.classname] == null)
-                                                this.baseClass.obj_cache[this.classname] = {};
-
-                                        this.baseClass.obj_cache[this.classname][obj.id()] = obj;
-                                }
-                        }
-                        this.array = obj.array;
-
-                } else {
-                        throw new FieldmapperException( "Attempt to build fieldmapper object with something wierd");
-                }
-        }
-}
-Fieldmapper.prototype.baseClass = Fieldmapper;
-Fieldmapper.prototype.obj_cache = {};
-
-Fieldmapper.prototype.search function (type,field,value) {
-
-       var list = user_request(
-               'open-ils.proxy',
-               'open-ils.proxy.proxy',
-               [
-                       mw.G.auth_ses[0],
-                       'open-ils.storage',
-                       'open-ils.storage.direct.' + type.db_type + '.search.' + field,
-                       array
-               ]
-       )[0];
-       if (type.cacheable) {
-               if (type.baseClass.obj_cache[type.classname] == null)
-                       type.baseClass.obj_cache[type.classname] = {};
-               for (var i in list) {
-                       type.baseClass.obj_cache[type.classname][list[i].id()] = list[i];
-               }
-       }
-       return list;
-}
-Fieldmapper.prototype.clone = function() {
-        var obj = new this.constructor();
-
-        for( var i in this.array ) {
-                var thing = this.array[i];
-                if(thing == null) continue;
-
-                if( thing._isfieldmapper ) {
-                        obj.array[i] = thing.clone();
-                } else {
-
-                        if(instanceOf(thing, Array)) {
-                                obj.array[i] = new Array();
-
-                                for( var j in thing ) {
-
-                                        if( thing[j]._isfieldmapper )
-                                                obj.array[i][j] = thing[j].clone();
-                                        else
-                                                obj.array[i][j] = thing[j];
-                                }
-                        } else {
-                                obj.array[i] = thing;
-                        }
-                }
-        }
-        return obj;
-}
-  
-function FieldmapperException(message) {
-        this.message = message;
-}
-
-FieldmapperException.toString = function() {
-        return "FieldmapperException: " + this.message + "\n";
-
-}
-
-       
-               <xsl:apply-templates select="opensrf:fieldmapper/opensrf:classes"/>
-       </xsl:template>
-
-
-
-
-
-<!-- sub-templates -->
-       <xsl:template match="opensrf:fieldmapper/opensrf:classes">
-               <xsl:for-each select="opensrf:class">
-                       <xsl:sort select="@id"/>
-                       <xsl:apply-templates select="."/>
-               </xsl:for-each>
-       </xsl:template>
-
-
-
-
-       <xsl:template match="opensrf:class">
-               <xsl:apply-templates select="@javascript:class"/>
-               <xsl:apply-templates select="opensrf:fields"/>
-               <xsl:apply-templates select="opensrf:links/opensrf:link[@type='has_many']"/>
-       </xsl:template>
-
-
-
-
-       <xsl:template match="opensrf:fields">
-               <xsl:apply-templates select="opensrf:field"/>
-       </xsl:template>
-
-
-
-
-
-       <xsl:template match="@javascript:class">
-
-// Class definition for "<xsl:value-of select="."/>"
-
-function <xsl:value-of select="."/> (array) {
-
-       if (!instanceOf(this, <xsl:value-of select="."/>))
-               return new <xsl:value-of select="."/>(array);
-
-       this.baseClass.call(this,array);
-       this.classname = "<xsl:value-of select="."/>";
-       this._isfieldmapper = true;
-       this.uber = <xsl:value-of select="."/>.baseClass.prototype;
-}
-
-<xsl:value-of select="."/>.prototype                   = new <xsl:value-of select="../javascript:superclass"/>();
-<xsl:value-of select="."/>.prototype.constructor       = <xsl:value-of select="."/>;
-<xsl:value-of select="."/>.baseClass                   = <xsl:value-of select="../javascript:superclass"/>;
-<xsl:value-of select="."/>.prototype.cachable          = true;
-<xsl:value-of select="."/>.prototype.fields            = [];
-<xsl:value-of select="."/>.last_real_field             = 2;
-<!-- XXX This needs to come from somewhere else!!!! -->
-<xsl:value-of select="."/>.prototype.db_type           = "<xsl:value-of select="../database:table[@rdbms='Pg']/database:name"/>";
-<xsl:value-of select="."/>.prototype.isnew = function(new_value) {
-        if(arguments.length == 1) { this.array[0] = new_value; }
-        return this.array[0];
-}
-<xsl:value-of select="."/>.prototype.ischanged = function(new_value) {
-        if(arguments.length == 1) { this.array[1] = new_value; }
-        return this.array[1];
-}
-<xsl:value-of select="."/>.prototype.isdeleted = function(new_value) {
-        if(arguments.length == 1) { this.array[2] = new_value; }
-        return this.array[2];
-}
-       </xsl:template>
-
-
-
-
-
-       <!-- scalar valued fields and "has_a" relationships -->
-       <xsl:template match="opensrf:field">
-
-               <xsl:variable name="num"><xsl:number/></xsl:variable>
-               <xsl:variable name="field_pos" select="$num + 2"/>
-               <xsl:variable name="last_field_pos" select="$field_pos + 1"/>
-               <xsl:variable name="field_name" select="@name"/>
-
-// Accessor/mutator for <xsl:value-of select="../../@javascript:class"/>.<xsl:value-of select="$field_name"/>:
-<xsl:value-of select="../../@javascript:class"/>.last_real_field++;
-<xsl:value-of select="../../@javascript:class"/>.prototype.fields.push("<xsl:value-of select="$field_name"/>");
-<xsl:value-of select="../../@javascript:class"/>.prototype.<xsl:value-of select="$field_name"/> = function (new_value) {
-        if(arguments.length == 1) { this.array[<xsl:value-of select="$field_pos"/>] = new_value; }
-
-               <xsl:if test="../../opensrf:links/opensrf:link[@field=$field_name and @type='has_a']">
-                       <!-- We have a fkey on this field.  Go fetch the referenced object. -->
-                       <xsl:variable
-                               name="source"
-                               select="../../opensrf:links/opensrf:link[@field=$field_name and @type='has_a']/@source"/>
-
-        var val = this.array[<xsl:value-of select="$field_pos"/>];
-
-        if (!instanceOf(this.array[<xsl:value-of select="$field_pos"/>], <xsl:value-of select="$source"/>)) {
-               if (this.array[<xsl:value-of select="$field_pos"/>] != null) {
-                       this.array[<xsl:value-of select="$field_pos"/>] = new <xsl:value-of select="$source"/>(val);
-               }
-       }
-               </xsl:if>
-       return this.array[<xsl:value-of select="$field_pos"/>];
-}
-       </xsl:template>
-
-
-
-
-
-       <!-- "has_many" relationships -->
-       <xsl:template match="opensrf:links/opensrf:link[@type='has_many']">
-               <xsl:variable name="num"><xsl:number/></xsl:variable>
-               <xsl:variable name="source"><xsl:value-of select="@source"/></xsl:variable>
-               <xsl:variable name="classname"><xsl:value-of select="../../@javascript:class"/></xsl:variable>
-               <xsl:variable name="id"><xsl:value-of select="../../@id"/></xsl:variable>
-               <xsl:variable name="fkey" select="//*[@id=$source]/opensrf:links/opensrf:link[@type='has_a' and @source=$id]/@field"/>
-               <xsl:variable name="pkey" select="../../opensrf:fields/opensrf:field[@database:primary='true']/@name"/>
-
-// accessor for <xsl:value-of select="$classname"/>:
-<xsl:value-of select="$classname"/>.prototype.<xsl:value-of select="@field"/> = function () {
-       var _pos = <xsl:value-of select="$classname"/>.last_real_field + <xsl:value-of select="$num"/>;
-       if (!instanceOf(this.array[_pos], Array)) {
-               this.array[_pos] = [];
-       if (this.array[_pos].length == 0) {
-               /* get the real thing.
-                * search where <xsl:value-of select="$source"/>.<xsl:value-of select="$fkey"/>()
-                * equals this.<xsl:value-of select="../../opensrf:fields/opensrf:field[@database:primary='true']/@name"/>();
-                */
-               this.array[_pos] = this.uber.search(
-                       <xsl:value-of select="$source"/>,
-                       "<xsl:value-of select="$fkey"/>",
-                       this.<xsl:value-of select="$pkey"/>()
-               );
-       }
-       return this.array[_pos];
-}
-
-       </xsl:template>
-
-
-
-
-</xsl:stylesheet>
-
diff --git a/OpenSRF/examples/fieldmapper2perl.xsl b/OpenSRF/examples/fieldmapper2perl.xsl
deleted file mode 100644 (file)
index 4d3a8a5..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-<xsl:stylesheet
-       version='1.0'
-       xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
-       xmlns:opensrf="http://opensrf.org/xmlns/opensrf"
-       xmlns:cdbi="http://opensrf.org/xmlns/opensrf/cdbi"
-       xmlns:database="http://opensrf.org/xmlns/opensrf/database"
-       xmlns:perl="http://opensrf.org/xmlns/opensrf/perl"
-       xmlns:javascript="http://opensrf.org/xmlns/opensrf/javascript"
-       xmlns:c="http://opensrf.org/xmlns/opensrf/c">
-       <xsl:output method="text" />
-       <xsl:strip-space elements="xsl:*"/>
-       <xsl:variable name="last_field_pos"/>
-
-       <xsl:template match="/">
-package Fieldmapper;
-use JSON;
-use Data::Dumper;
-use base 'OpenSRF::Application';
-
-use OpenSRF::Utils::Logger;
-my $log = 'OpenSRF::Utils::Logger';
-
-sub new {                                                            
-        my $self = shift;                                            
-        my $value = shift;                                              
-       if (defined $value) {
-               if (!ref($value) or ref($value) ne 'ARRAY') {
-                       # go fetch the object by id...
-               }
-        } else {
-               $value = [];
-       }
-        return bless $value => $self->class_name;                    
-}
-
-sub decast {
-        my $self = shift;
-        return [ @$self ];
-}       
-
-sub DESTROY {} 
-
-sub class_name {
-        my $class_name = shift;
-        return ref($class_name) || $class_name;
-}
-
-sub isnew { return $_[0][0]; }
-sub ischanged { return $_[0][1]; }
-sub isdeleted { return $_[0][2]; }
-
-
-               <xsl:apply-templates select="opensrf:fieldmapper/opensrf:classes"/>
-
-1;
-       </xsl:template>
-
-
-
-
-
-<!-- sub-templates -->
-       <xsl:template match="opensrf:fieldmapper/opensrf:classes">
-               <xsl:for-each select="opensrf:class">
-                       <xsl:sort select="@id"/>
-                       <xsl:apply-templates select="."/>
-                       <xsl:apply-templates select="opensrf:links/opensrf:link[@type='has_many']"/>
-               </xsl:for-each>
-       </xsl:template>
-
-
-
-
-       <xsl:template match="opensrf:class">
-               <xsl:apply-templates select="@perl:class"/>
-               <xsl:apply-templates select="opensrf:fields"/>
-       </xsl:template>
-
-
-
-
-       <xsl:template match="opensrf:fields">
-               <xsl:apply-templates select="opensrf:field"/>
-       </xsl:template>
-
-
-
-
-
-       <xsl:template match="@perl:class">
-#-------------------------------------------------------------------------------
-# Class definition for "<xsl:value-of select="."/>"
-#-------------------------------------------------------------------------------
-package <xsl:value-of select="."/>;
-use base "<xsl:value-of select="../perl:superclass"/>";
-
-{      my @real;
-       sub real_fields {
-               push @real, @_ if (@_);
-               return @real;
-       }
-}
-
-{      my $last_real;
-       sub last_real_field : lvalue {
-               $last_real;
-       }
-}
-
-       <xsl:if test="../@cdbi:class">
-sub cdbi {
-       return "<xsl:value-of select="../@cdbi:class"/>";
-}
-       </xsl:if>
-
-sub json_hint {
-        return "<xsl:value-of select="../@id"/>";
-}
-
-
-sub is_virtual {
-       <xsl:choose>
-               <xsl:when test="../@virutal">
-       return 1;
-               </xsl:when>
-               <xsl:otherwise>
-       return 0;
-               </xsl:otherwise>
-       </xsl:choose>
-}
-
-       </xsl:template>
-
-
-
-
-
-       <!-- scalar valued fields and "has_a" relationships -->
-       <xsl:template match="opensrf:field">
-
-               <xsl:variable name="num"><xsl:number/></xsl:variable>
-               <xsl:variable name="field_pos" select="$num + 2"/>
-               <xsl:variable name="last_field_pos" select="$field_pos + 1"/>
-               <xsl:variable name="field_name" select="@name"/>
-               <xsl:variable name="classname" select="../../@perl:class"/>
-
-# Accessor/mutator for <xsl:value-of select="$classname"/>::<xsl:value-of select="$field_name"/>:
-__PACKAGE__->last_real_field()++;
-__PACKAGE__->real_fields("<xsl:value-of select="$field_name"/>");
-sub <xsl:value-of select="$field_name"/> {
-       my $self = shift;
-       my $new_val = shift;
-       $self->[<xsl:value-of select="$field_pos"/>] = $new_val if (defined $new_val);
-
-               <xsl:if test="../../opensrf:links/opensrf:link[@field=$field_name and @type='has_a']">
-                       <!-- We have a fkey on this field.  Go fetch the referenced object. -->
-                       <xsl:variable
-                               name="source"
-                               select="../../opensrf:links/opensrf:link[@field=$field_name and @type='has_a']/@source"/>
-                       <xsl:variable
-                               name="sourceclass"
-                               select="//*[@id=$source]/@perl:class"/>
-
-        my $val = $self->[<xsl:value-of select="$field_pos"/>];
-
-       if (defined $self->[<xsl:value-of select="$field_pos"/>]) {
-               if (!UNIVERSAL::isa($self->[<xsl:value-of select="$field_pos"/>], <xsl:value-of select="$sourceclass"/>)) {
-                       $self->[<xsl:value-of select="$field_pos"/>] = <xsl:value-of select="$sourceclass"/>->new($val);
-               }
-       }
-               </xsl:if>
-
-       return $self->[<xsl:value-of select="$field_pos"/>];
-}
-
-
-sub clear_<xsl:value-of select="$field_name"/> {
-       my $self = shift;
-       $self->[<xsl:value-of select="$field_pos"/>] = undef;
-       return 1;
-}
-
-       </xsl:template>
-
-
-
-
-
-
-       <!-- "has_many" relationships -->
-       <xsl:template match="opensrf:links/opensrf:link[@type='has_many']">
-               <xsl:variable name="num"><xsl:number/></xsl:variable>
-               <xsl:variable name="source"><xsl:value-of select="@source"/></xsl:variable>
-               <xsl:variable name="sourceclass"><xsl:value-of select="//*[@id=$source]/@perl:class"/></xsl:variable>
-               <xsl:variable name="classname"><xsl:value-of select="../../@perl:class"/></xsl:variable>
-               <xsl:variable name="id"><xsl:value-of select="../../@id"/></xsl:variable>
-               <xsl:variable name="fkey" select="//*[@id=$source]/opensrf:links/opensrf:link[@type='has_a' and @source=$id]/@field"/>
-               <xsl:variable name="pkey" select="../../opensrf:fields/opensrf:field[@database:primary='true']/@name"/>
-
-# accessor for <xsl:value-of select="$classname"/>::<xsl:value-of select="@field"/>:
-sub <xsl:value-of select="@field"/> {
-       my $self = shift;
-       my $_pos = <xsl:value-of select="$classname"/>->last_real_field + <xsl:value-of select="$num"/>;
-       if (!ref($self->[$_pos]) ne 'ARRAY') {
-               $self->[$_pos] = [];
-       if (@{$self->[$_pos]} == 0) {
-               # get the real thing.
-               # search where <xsl:value-of select="$sourceclass"/>-><xsl:value-of select="$fkey"/> == $self-><xsl:value-of select="$pkey"/>;
-       }
-       return $self->[$_pos];
-}
-
-       </xsl:template>
-
-
-
-
-</xsl:stylesheet>
-
diff --git a/OpenSRF/examples/gen-fieldmapper.xml b/OpenSRF/examples/gen-fieldmapper.xml
deleted file mode 100644 (file)
index 2695030..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fieldmapper
-       xmlns="http://opensrf.org/xmlns/opensrf"
-       xmlns:cdbi="http://opensrf.org/xmlns/opensrf/cdbi"
-       xmlns:database="http://opensrf.org/xmlns/opensrf/database"
-       xmlns:perl="http://opensrf.org/xmlns/opensrf/perl"
-       xmlns:javascript="http://opensrf.org/xmlns/opensrf/javascript"
-       xmlns:c="http://opensrf.org/xmlns/opensrf/c">
-
-       <classes>
-               <!-- template class definition -->
-               <!--
-               <class
-                       id=""
-                       perl:class=""
-                       cdbi:class=""
-                       javascript:class="">
-       
-                       <database:table rdbms="Pg">
-                               <database:name></database:name>
-                               <database:sequence></database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name></database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-                       
-                       <fields>
-                               <field name="" datatype="" database:primary="" database:required="" default="" database:default=""/>
-                       </fields>
-                       
-                       <links>
-                               <link field="" source="" javascript:list="" type=""/>
-                       </links>
-       
-               </class>
-               -->
-       
-               <class
-                       id="asvr"
-                       virtual="0"
-                       perl:class="Fieldmapper::action::survey_response"
-                       cdbi:class="action::survey_response"
-                       javascript:class="asvr"
-                       c:class="asvr">
-                       <database:table rdbms="Pg">
-                               <database:name>action.survey_response</database:name>
-                               <database:sequence>action.survey_response_id_seq</database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name>action_survey_response</database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-                       
-                       <fields>
-                               <field
-                                       name="id"
-                                       datatype="int"
-                                       database:primary="true" />
-                                       
-                               <field
-                                       name="survey"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="question"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="answer"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="usr"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="response_group_id"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="answser_date"
-                                       datatype="timestamp"
-                                       database:required="true" />
-
-                               <field
-                                       name="effective_date"
-                                       datatype="timestamp"
-                                       database:required="true" />
-
-                       </fields>
-
-                       <links>
-                               <link field="survey" source="asv" type="has_a"/>
-                               <link field="question" source="asvq" type="has_a"/>
-                               <link field="answer" source="asva" type="has_a"/>
-                               <!-- <link field="usr" source="au" type="has_a"/> -->
-                       </links>
-
-               </class>
-
-               <class
-                       id="asvq"
-                       perl:class="Fieldmapper::action::survey_question"
-                       cdbi:class="action::survey_question"
-                       javascript:class="asvq"
-                       c:class="asvq">
-                       <database:table rdbms="Pg">
-                               <database:name>action.survey_question</database:name>
-                               <database:sequence>action.survey_question_id_seq</database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name>action_survey_question</database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-                       
-                       <fields>
-                               <field
-                                       name="id"
-                                       datatype="int"
-                                       database:primary="true" />
-                                       
-                               <field
-                                       name="survey"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="question"
-                                       datatype="text"
-                                       database:required="true" />
-
-                       </fields>
-
-                       <links>
-                               <link field="survey" source="asv" type="has_a"/>
-                               <link field="answers" source="asva" type="has_many"/>
-                       </links>
-               </class>
-
-               <class
-                       id="asva"
-                       perl:class="Fieldmapper::action::survey_answer"
-                       cdbi:class="action::survey_answer"
-                       javascript:class="asva"
-                       c:class="asva">
-                       <database:table rdbms="Pg">
-                               <database:name>action.survey_answer</database:name>
-                               <database:sequence>action.survey_answer_id_seq</database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name>action_survey_answer</database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-                       
-                       <fields>
-                               <field
-                                       name="id"
-                                       datatype="int"
-                                       database:primary="true" />
-                                       
-                               <field
-                                       name="question"
-                                       datatype="int"
-                                       database:required="true" />
-
-                               <field
-                                       name="answer"
-                                       datatype="text"
-                                       database:required="true" />
-
-                       </fields>
-
-                       <links>
-                               <link field="question" source="asvq" type="has_a"/>
-                               <link field="responses" source="asvr" type="has_many"/>
-                       </links>
-               </class>
-
-               <class
-                       id="aou"
-                       perl:class="Fieldmapper::actor::org_unit"
-                       cdbi:class="actor::org_unit"
-                       javascript:class="aou"
-                       c:class="aou">
-                       <database:table rdbms="Pg">
-                               <database:name>actor.org_unit</database:name>
-                               <database:sequence>actor.org_unit_id_seq</database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name>actor_org_unit</database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-                       
-                       <fields>
-                               <field
-                                       name="id"
-                                       datatype="int"
-                                       database:primary="true" />
-                       </fields>
-               </class>
-       
-               <!-- Survey class definition -->
-               <class
-                       id="asv"
-                       perl:class="Fieldmapper::action::survey"
-                       cdbi:class="action::survey"
-                       javascript:class="asv"
-                       c:class="asv">
-                       <database:table rdbms="Pg">
-                               <database:name>action.survey</database:name>
-                               <database:sequence>action.survey_id_seq</database:sequence>
-                       </database:table>
-                       <database:table rdbms="MySQL">
-                               <database:name>action_survey</database:name>
-                       </database:table>
-       
-                       <javascript:superclass>Fieldmapper</javascript:superclass>
-                       <perl:superclass>Fieldmapper</perl:superclass>
-                       <cdbi:superclass>OpenILS::Storage::CDBI</cdbi:superclass>
-
-                       <methods interface='authenticated' service='open-ils.proxy'>
-                               <create method='open-ils.storage.direct.action.survey.create'/>
-                               <retrieve method='open-ils.storage.direct.action.survey.retrieve'/>
-                               <search method='open-ils.storage.direct.action.survey.search'/>
-                               <update method='open-ils.storage.direct.action.survey.update'/>
-                               <delete method='open-ils.storage.direct.action.survey.delete'/>
-                       </methods>
-                       
-                       <methods interface='trusted' service='open-ils.storage'>
-                               <create method='open-ils.storage.direct.action.survey.create'/>
-                               <retrieve method='open-ils.storage.direct.action.survey.retrieve'/>
-                               <search method='open-ils.storage.direct.action.survey.search'/>
-                               <update method='open-ils.storage.direct.action.survey.update'/>
-                               <delete method='open-ils.storage.direct.action.survey.delete'/>
-                       </methods>
-                       
-                       <fields>
-                               <field
-                                       name="id"
-                                       datatype="int"
-                                       database:primary="true" />
-                                       
-                               <field
-                                       name="name"
-                                       datatype="text"
-                                       database:required="true" />
-                                       
-                               <field
-                                       name="description"
-                                       datatype="text"
-                                       database:required="true" />
-                                       
-                               <field
-                                       name="owner"
-                                       datatype="int"
-                                       database:required="true" />
-                                       
-                               <field
-                                       name="start_date"
-                                       datatype="timestamp"
-                                       database:required="true"
-                                       database:default="now()" />
-                                       
-                               <field
-                                       name="end_date"
-                                       datatype="timestamp"
-                                       database:required="true"
-                                       database:default="now() + '1 month'" />
-                                       
-                               <field
-                                       name="usr_summary"
-                                       datatype="bool"
-                                       database:required="true"
-                                       default="t" />
-                                       
-                               <field
-                                       name="opac"
-                                       datatype="bool"
-                                       database:required="true"
-                                       default="f" />
-                                       
-                               <field
-                                       name="poll"
-                                       datatype="bool"
-                                       database:required="true"
-                                       default="f" />
-
-                               <field
-                                       name="required"
-                                       datatype="bool"
-                                       database:required="true"
-                                       default="f" />
-
-                       </fields>
-       
-                       <links>
-                               <link field="questions" source="asvq" type="has_many"/>
-                               <link field="responses" source="asvr" type="has_many"/>
-                               <link field="owner" source="aou" type="has_a"/>
-                       </links>
-       
-               </class>
-
-       </classes>
-</fieldmapper>
-
diff --git a/OpenSRF/examples/math_bench.pl b/OpenSRF/examples/math_bench.pl
deleted file mode 100755 (executable)
index c3a504c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/perl
-use strict; use warnings;
-use OpenSRF::System;
-use Time::HiRes qw/time/;
-use OpenSRF::Utils::Logger;
-my $log = "OpenSRF::Utils::Logger";
-
-# Test script which runs queries agains the opensrf.math service and reports on
-# the average round trip time of the requests.
-
-# how many batches of 4 requests do we send
-my $count = $ARGV[0];
-print "usage: $0 <num_requests>\n" and exit unless $count;
-
-# * connect to the Jabber network
-OpenSRF::System->bootstrap_client( config_file => "/openils/conf/bootstrap.conf" );
-$log->set_service('math_bench');
-
-# * create a new application session for the opensrf.math service
-my $session = OpenSRF::AppSession->create( "opensrf.math" );
-
-my @times; # "delta" times for each round trip
-
-# we're gonna call methods "add", "sub", "mult", and "div" with
-# params 1, 2.  The hash below maps the method name to the 
-# expected response value
-my %vals = ( add => 3, sub => -1, mult => 2, div => 0.5 );
-
-# print the counter grid 
-for my $x (1..100) {
-       if( $x % 10 ) { print ".";}
-       else{ print $x/10; };
-}
-print "\n";
-
-my $c = 0;
-
-for my $scale ( 1..$count ) {
-       for my $mname ( keys %vals ) { # cycle through add, sub, mult, and div
-
-               my $starttime = time();
-
-               # * Fires the request and gathers the response object, which in this case
-               # is just a string
-               my $resp = $session->request( $mname, 1, 2 )->gather(1);
-               push @times, time() - $starttime;
-
-
-               if( "$resp" eq $vals{$mname} ) { 
-                       # we got the response we expected
-                       print "+"; 
-
-               } elsif($resp) { 
-                       # we got some other response     
-                       print "\n* BAD Data:  $resp\n";
-
-               } else { 
-                       # we got no data
-                       print "Received nothing\n";     
-               }
-
-               $c++;
-
-       }
-
-       print " [$c] \n" unless $scale % 25;
-}
-
-my $total = 0;
-
-$total += $_ for (@times);
-
-$total /= scalar(@times);
-
-print "\n\n\tAverage Round Trip Time: $total Seconds\n";
-
-
diff --git a/OpenSRF/examples/math_xul_client/Makefile b/OpenSRF/examples/math_xul_client/Makefile
deleted file mode 100644 (file)
index 41ac95c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-all: clean client
-       @echo
-
-client:
-       @echo We need the OpenSRF javascript code...
-       mkdir math/content/OpenSRF/
-       cp ../../src/javascript/*.js math/content/OpenSRF/
-       @echo We need a log directory...
-       mkdir math/content/log
-       touch math/content/log/preserve.directory.when.zipping
-       @echo We also need a math/content/conf/client_config.xml pointing to a running OpenSRF Math application.
-       @echo Then we package this into a Mozilla XPI file...
-       zip -q -r math.xpi install.js math/
-       @echo After installing the XPI, use the chrome URL:
-       @echo chrome://math/content/
-
-clean:
-       @echo Removing the OpenSRF javascript code, the log directory, and math.xpi...
-       rm -rf math/content/OpenSRF/ math/content/log math.xpi
diff --git a/OpenSRF/examples/math_xul_client/install.js b/OpenSRF/examples/math_xul_client/install.js
deleted file mode 100644 (file)
index 0b10d3d..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-// ripped from Evergreen installation file
-
-/* We'll want to make this more flexible later */
-
-install();
-
-// ----------------------------------------------------------------------------
-// Performs the install
-// ----------------------------------------------------------------------------
-function install() {
-
-       // ----------------------------------------------------------------------------
-       var _authors = "PINES";
-       var _package = "math";
-       var _packg_l = "math";
-       var _version = "0.0.1";
-       // ----------------------------------------------------------------------------
-
-       var err; // track the error
-
-       err = initInstall( _package, "/"+_authors+"/"+_package, _version );
-       if( err != 0 ) { return warn( "initInstall: " + err );}
-
-       // ----------------------------------------------------------------------------
-       // Discovers the path to the install directory
-       // ----------------------------------------------------------------------------
-       install_dir = getFolder("Chrome", _packg_l );
-       logComment( "Installing to: " + install_dir );
-
-       // ----------------------------------------------------------------------------
-       // Directory where the 'content' is stored
-       // ----------------------------------------------------------------------------
-       content_dir = getFolder( install_dir, "content" );
-       if( err != 0 ) { return warn("getFolder:content_dir: " + err);}
-       
-       // ----------------------------------------------------------------------------
-       // Directory where the skins are stored
-       // ----------------------------------------------------------------------------
-       skin_dir = getFolder( install_dir, "skin" );
-       if( err != 0 ) { return warn("getFolder:skin: " + err);}
-
-       // ----------------------------------------------------------------------------
-       // Directory where the local data is stored
-       // ----------------------------------------------------------------------------
-       locale_dir = getFolder( install_dir, "locale" );
-       if( err != 0 ) { return warn("getFolder:locale: " + err);}
-
-       // ----------------------------------------------------------------------------
-       // Sets the install directory for Evergreen
-       // ----------------------------------------------------------------------------
-       err = setPackageFolder(install_dir);
-       if( err != 0 ) { return warn("setPackageFolder: " + err);}
-       
-       // ----------------------------------------------------------------------------
-       // Searches the .xpi file for the directory name stored in _packg_l and
-       // copies that directory from the .xpi into Mozilla's chrome directory.
-       // In this case, we are copying over the entire evergreen folder
-       // ----------------------------------------------------------------------------
-       err = addDirectory( _packg_l )
-       if( err != 0 ) { return warn("addDirectory: " + err);}
-       
-
-       // ----------------------------------------------------------------------------
-       // Register the content directory
-       // The final argument is where Mozilla should expect to find the contents.rdf 
-       // file *after* installation for the CONTENT portion of the package
-       // ----------------------------------------------------------------------------
-       err = registerChrome( Install.CONTENT, content_dir );
-       if( err != 0 ) { return warn("registerChrome:content  " + err );}
-       
-       // ----------------------------------------------------------------------------
-       // Register the skin directory
-       // ----------------------------------------------------------------------------
-       err = registerChrome( Install.SKIN, skin_dir );
-       if( err != 0 ) { return warn("registerChrome:skin " + err );}
-
-       // ----------------------------------------------------------------------------
-       // Register the locale directory 
-       // ----------------------------------------------------------------------------
-       //err = registerChrome( Install.LOCALE, locale_dir );
-       //if( err != 0 ) { return warn("registerChrome:locale " + err );}
-
-       err = registerChrome( Install.LOCALE, getFolder(locale_dir, "en-US") );
-       if( err != 0 ) { return warn("registerChrome:locale " + err );}
-
-       // ----------------------------------------------------------------------------
-       // Do it.
-       // ----------------------------------------------------------------------------
-       performInstall();
-       
-}
-
-function warn( message ) {
-       alert( message );
-       logComment( message );
-       return;
-}
-
diff --git a/OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml b/OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml
deleted file mode 100644 (file)
index 0dc75a9..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" ?>
-
-<oils_config>
-
-       <!-- General system settings -->
-
-       <system>
-               <hostname>myhostname</hostname>
-
-               <!-- log_level
-                       Levels run between 0 and 3.  O is no logging.  3 is full debug output -->
-               <log_level>0</log_level>
-
-               <!--  stdout_log
-                       When set to 0, no stdout logging is done, when set to 1, all logging
-                       goes to both stdout as well as their destined log file, if set to
-                       2, the messages only go to stdout.  -->
-               <stdout_log>0</stdout_log>
-       </system>
-
-
-       <!-- Log files -->
-
-       <logs>
-               <debug>debug.log</debug>
-               <transport>transport.log</transport>
-               <error>error.log</error>
-       </logs>
-
-       <!-- Remote services -->
-
-       <remote_service>
-               <math>router@localhost/math</math>
-               <mathdb>router@localhost/mathdb</mathdb>
-               <storage>router@localhost/storage</storage>
-       </remote_service>
-       
-       <!-- Transport -->
-
-       <transport>
-               <transport_impl>jabber_connection</transport_impl>
-
-               <!-- connect_timeout doubles as both the low level transport timeout
-                       as well as the app connection timeout -->
-               <connect_timeout>15</connect_timeout>
-               <username>math_user</username>
-               <password>math_user_password</password>
-               <primary>localhost</primary>
-               <port>5222</port>
-               <ssl>0</ssl>
-       </transport>
-
-</oils_config>
diff --git a/OpenSRF/examples/math_xul_client/math/content/contents.rdf b/OpenSRF/examples/math_xul_client/math/content/contents.rdf
deleted file mode 100644 (file)
index 7a8fb13..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-       <RDF:Seq about="urn:mozilla:package:root">
-               <RDF:li resource="urn:mozilla:package:math"/>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:package:math"
-               chrome:displayName="Math"
-               chrome:author="PINES"
-               chrome:name="math"
-               chrome:extension="true"/>
-
-</RDF:RDF>
-
diff --git a/OpenSRF/examples/math_xul_client/math/content/math.xul b/OpenSRF/examples/math_xul_client/math/content/math.xul
deleted file mode 100644 (file)
index 1396a0b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!-- Test Application: Math -->
-
-<!-- Stylesheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://math/skin/math.css" type="text/css"?>
-
-<!-- Localization -->
-<!DOCTYPE window SYSTEM "chrome://math/locale/math.dtd">
-
-<window id="math_win" title="&math.title;" orient="vertical" style="overflow: auto"
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-       <!-- Overlays for this XUL file -->
-       <?xul-overlay href="chrome://math/content/math_overlay.xul"?>
-
-       <!-- OpenSRF -->
-       <script>var myPackageDir = "math";</script>
-       <script src="OpenSRF/JSON.js" />
-       <script src="OpenSRF/md5.js" />
-       <script src="OpenSRF/opensrf_utils.js" />
-       <script src="OpenSRF/opensrf_config.js" />
-       <script src="OpenSRF/opensrf_dom_element.js" />
-       <script src="OpenSRF/opensrf_domain_object.js" />
-       <script src="OpenSRF/opensrf_transport.js" />
-       <script src="OpenSRF/opensrf_jabber_transport.js" />
-       <script src="OpenSRF/opensrf_msg_stack.js" />
-       <script src="OpenSRF/opensrf_app_session.js" />
-
-       <!-- The logic for this app -->
-       <script src="math_app.js" />
-
-       <!-- Layout to be filled in by overlays and javascript -->
-       <vbox id="main_vbox" class="test_class">
-       </vbox>
-
-</window>
-
diff --git a/OpenSRF/examples/math_xul_client/math/content/math_app.js b/OpenSRF/examples/math_xul_client/math/content/math_app.js
deleted file mode 100644 (file)
index 2b98694..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// connect and stup
-
-var ses;
-
-function execute( opp ) {
-
-       var a = document.getElementById("num1");
-       var b = document.getElementById("num2");
-       do_stuff( opp, a.value, b.value );
-
-}
-
-function do_stuff( opp, a, b ) {
-
-
-
-       try {
-
-               if( ses == null || ! AppSession.transport_handle.connected() ) {
-
-                       /* deprecated */
-                       ses = new AppSession( "user_name", "12345", "math" );
-                       if( ! ses.connect() ) { alert( "Connect timed out!" ); }
-               }
-
-               var meth = new oilsMethod(opp, [ a, b ] );
-
-               var req = new AppRequest( ses, meth );
-               req.make_request();
-               var resp = req.recv( 5000 );
-               if( ! resp ) {
-                       alert( "NO response from server!!!" );
-                       quit(); return;
-               }
-       
-               var scalar = resp.getContent();
-               var value = scalar.getValue();
-
-               var lab = document.getElementById( "answer" );
-               lab.value = "Answer: " + value;
-               req.finish();
-
-       } catch( E ) { alert( E.message ); }    
-
-}
-
-
-function quit() { ses.disconnect(); window.close(); }
-
-
diff --git a/OpenSRF/examples/math_xul_client/math/content/math_overlay.xul b/OpenSRF/examples/math_xul_client/math/content/math_overlay.xul
deleted file mode 100644 (file)
index 1a4b69c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://math/skin/math.css" type="text/css"?>
-<!DOCTYPE overlay SYSTEM "chrome://math/locale/math.dtd">
-<overlay id="math_overlay" 
-       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<vbox id="main_vbox" flex="1">
-       <label value="&math.title;" />
-       <textbox id="num1" />
-       <textbox id="num2" />
-       <grid flex="1" class="test_class">
-               <columns>
-                       <column />
-                       <column />
-               </columns>
-               <rows>
-                       <row>
-                               <button label="&math.add;" oncommand="execute('add');"/>
-                               <button label="&math.sub;" oncommand="execute('sub');"/>
-                       </row>
-                       <row>
-                               <button label="&math.mul;" oncommand="execute('mult');"/>
-                               <button label="&math.div;" oncommand="execute('div');"/>
-                       </row>
-               </rows>
-       </grid>
-       <label id="answer" value="" />
-       <button label="&math.quit;" oncommand="quit();"/>
-</vbox>
-
-</overlay>
diff --git a/OpenSRF/examples/math_xul_client/math/locale/en-US/contents.rdf b/OpenSRF/examples/math_xul_client/math/locale/en-US/contents.rdf
deleted file mode 100644 (file)
index 01b2e7f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-          xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-       <RDF:Seq about="urn:mozilla:locale:root">
-               <RDF:li resource="urn:mozilla:locale:en-US"/>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:locale:en-US"
-               chrome:displayName="Math"
-               chrome:author="PINES"
-               chrome:name="en-US">
-               <chrome:packages>
-                       <RDF:Seq about="urn:mozilla:locale:en-US:packages">
-                               <RDF:li resource="urn:mozilla:locale:en-US:math"/>      
-                       </RDF:Seq>
-               </chrome:packages>
-       </RDF:Description>
-</RDF:RDF>
-
diff --git a/OpenSRF/examples/math_xul_client/math/locale/en-US/math.dtd b/OpenSRF/examples/math_xul_client/math/locale/en-US/math.dtd
deleted file mode 100644 (file)
index 16917f6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<!ENTITY math.title "Math App">
-<!ENTITY math.add "Add">
-<!ENTITY math.sub "Subtract">
-<!ENTITY math.mul "Multiply">
-<!ENTITY math.div "Divide">
-<!ENTITY math.quit "Quit">
-
diff --git a/OpenSRF/examples/math_xul_client/math/skin/contents.rdf b/OpenSRF/examples/math_xul_client/math/skin/contents.rdf
deleted file mode 100644 (file)
index b27f9ca..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-       xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-       <RDF:Seq about="urn:mozilla:skin:root">
-               <RDF:li resource="urn:mozilla:skin:math/1.0"/>
-       </RDF:Seq>
-
-       <RDF:Description about="urn:mozilla:skin:math/1.0"
-               chrome:displayName="Math"
-               chrome:author="PINES"
-               chrome:name="math/1.0">
-
-               <chrome:packages>
-                       <RDF:Seq about="urn:mozilla:skin:math/1.0:packages">
-                               <RDF:li resource="urn:mozilla:skin:math/1.0:math"/>     
-                       </RDF:Seq>
-               </chrome:packages>
-       </RDF:Description>
-
-</RDF:RDF>
-
diff --git a/OpenSRF/examples/math_xul_client/math/skin/math.css b/OpenSRF/examples/math_xul_client/math/skin/math.css
deleted file mode 100644 (file)
index 106bd74..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
-@namespace html url("http://www.w3.org/TR/REC-html40"); 
-
-.test_class { border: solid thin blue; }
diff --git a/OpenSRF/examples/multisession-test.pl b/OpenSRF/examples/multisession-test.pl
deleted file mode 100755 (executable)
index bb75a46..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/perl
-use lib '/openils/lib/perl5/';
-use OpenSRF::System;
-use OpenILS::Application::AppUtils;
-use OpenILS::Event;
-use OpenSRF::EX qw/:try/;
-use JSON;
-use Data::Dumper;
-use OpenILS::Utils::Fieldmapper;
-use Digest::MD5 qw/md5_hex/;
-use OpenSRF::Utils qw/:daemon/;
-use OpenSRF::MultiSession;
-use OpenSRF::AppSession;
-use Time::HiRes qw/time/;
-use JSON;
-
-my $config = shift;
-
-unless (-e $config) {
-       die "Gimme a config file!!!";
-}
-OpenSRF::System->bootstrap_client( config_file => $config );
-
-if (!@ARGV) {
-       @ARGV = ('open-ils.storage','opensrf.system.echo');
-}
-
-my $app = shift;
-
-my $count = 100;
-
-my $overhead = time;
-
-my $mses = OpenSRF::MultiSession->new( app => $app, cap => 10, api_level => 1 );
-
-$mses->success_handler(
-       sub {
-               my $ses = shift;
-               my $req = shift;
-               print $req->{params}->[0] . "\t: " . JSON->perl2JSON($req->{response}->[0]->content)."\n";
-       }
-);
-
-$mses->failure_handler(
-       sub {
-               my $ses = shift;
-               my $req = shift;
-               warn "record $req->{params}->[0] failed: ".JSON->perl2JSON($req->{response});
-       }
-);
-
-
-$mses->connect;
-
-my $start = time;
-$overhead = $start - $overhead;
-
-for (1 .. $count) {
-       $mses->request( @ARGV,$_ );
-}
-$mses->session_wait(1);
-$mses->disconnect;
-
-my $end = time;
-
-my @c = $mses->completed;
-my @f = $mses->failed;
-
-my $x = 0;
-$x += $_->{duration} for (@c);
-
-print "\n". '-'x40 . "\n";
-print "Startup Overhead: ".sprintf('%0.3f',$overhead)."s\n";
-print "Completed Commands: ".@c."\n";
-print "Failed Commands: ".@f."\n";
-print "Serial Run Time: ".sprintf('%0.3f',$x)."s\n";
-print "Serial Avg Time: ".sprintf('%0.3f',$x/$count)."s\n";
-print "Total Run Time: ".sprintf('%0.3f',$end-$start)."s\n";
-print "Total Avg Time: ".sprintf('%0.3f',($end-$start)/$count)."s\n";
-
diff --git a/OpenSRF/examples/opensrf.xml.example b/OpenSRF/examples/opensrf.xml.example
deleted file mode 100644 (file)
index 437570a..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version='1.0'?>
-
-<opensrf version='0.0.1'>
-
-               <!-- 
-
-               There is one <host> entry for each server on the network.  Settings for the
-               'default' host are used for every setting that isn't overridden within a given 
-               host's config.  
-
-               To specify which applications a host is serving, list those applications
-               within that host's config section.  If the defaults are acceptible, then
-               that's all that needs to be added/changed.
-
-               Any valid XML may be added to the <default> block and server components will have 
-               acces to it.
-
-               -->
-
-       <default>
-       
-               <dirs>
-
-                       <!-- opensrf log files go in this directory -->
-                       <log>/path/to/log</log>
-
-                       <!-- opensrf unix domaind socket files go here -->
-                       <sock>/path/to/sock</sock>
-
-                       <!-- opensrf pids go here -->
-                       <pid>/path/to/pid</pid>
-
-                       <!-- global config directory -->
-                       <conf>/path/to/conf</conf>
-
-               </dirs>
-
-               <!-- prefork, simple. prefork is suggested -->
-               <server_type>prefork</server_type>
-
-               <!-- Default doesn't host any apps -->
-               <activeapps/> 
-
-               <cache>
-                       <global>
-                               <servers>
-                                       <!-- memcached server ip:port -->
-                                       <server>127.0.0.1:10101</server>
-                               </servers>
-                               <!-- maximun time that anything may stay in the cache -->
-                               <max_cache_time>86400</max_cache_time>
-                       </global>
-               </cache>
-
-               <!-- These are the defaults for every served app.  Each server should 
-                       duplicate the node layout for any nodes that need changing.
-                       Any settings that are overridden in the server specific section 
-                       will be used as the config values for that server.  Any settings that are
-                       not overridden will fall back on the defaults
-                       Note that overriding 'stateless' will break things -->
-
-               <apps>
-
-                       <opensrf.persist>
-
-                               <!-- How many seconds to wait between server 
-                                       requests before timing out a stateful server session. -->
-                               <keepalive>1</keepalive>
-
-                               <!-- if 1, then we support stateless sessions (no connect required), if
-                                               0 then we don't -->
-                               <stateless>1</stateless>
-
-                               <!-- Tells the servers which language this implementation is coded in 
-                                       In this case non "perl" servers will not be able to load the module -->
-                               <language>perl</language>
-
-                               <!-- Module the implements this application -->
-                               <implementation>OpenSRF::Application::Persist</implementation>
-
-                               <!-- max stateful requests before a session automatically disconnects a client -->
-                               <max_requests>97</max_requests>
-
-                               <!-- settings for the backend application drones.  These are probably sane defaults -->
-
-                               <unix_config>
-                                       <!-- unix socket file -->
-                                       <unix_sock>opensrf.persist_unix.sock</unix_sock>
-
-                                       <!-- pid file -->
-                                       <unix_pid>opensrf.persist_unix.pid</unix_pid>
-
-                                       <!-- max requests per process backend before a child is recycled -->
-                                       <max_requests>1000</max_requests>
-
-                                       <!-- log file for this application -->
-                                       <unix_log>opensrf.persist_unix.log</unix_log>
-
-                                       <!-- Number of children to pre-fork -->
-                                       <min_children>5</min_children>
-
-                                       <!-- maximun number of children to fork -->
-                                       <max_children>25</max_children>
-
-                                       <!-- minimun number of spare forked children -->
-                                       <min_spare_children>2</min_spare_children>
-
-                                       <!-- max number of spare forked children -->
-                                       <max_spare_children>5</max_spare_children>
-
-                               </unix_config>
-
-                               <!-- Any additional setting for a particular application go in the app_settings node -->
-                               <app_settings>
-
-                                       <!-- sqlite database file -->
-                                       <dbfile>/path/to/dbfile/persist.db</dbfile>
-                               </app_settings>
-
-                       </opensrf.persist>
-
-                       <opensrf.math>
-                               <keepalive>3</keepalive>
-                               <stateless>1</stateless>
-                               <language>perl</language>
-                               <implementation>OpenSRF::Application::Demo::Math</implementation>
-                               <max_requests>97</max_requests>
-                               <unix_config>
-                                       <unix_sock>opensrf.math_unix.sock</unix_sock>
-                                       <unix_pid>opensrf.math_unix.pid</unix_pid>
-                                       <max_requests>1000</max_requests>
-                                       <unix_log>opensrf.math_unix.log</unix_log>
-                                       <min_children>5</min_children>
-                                       <max_children>15</max_children>
-                                       <min_spare_children>2</min_spare_children>
-                                       <max_spare_children>5</max_spare_children>
-                               </unix_config>
-                       </opensrf.math>
-                       
-                       <opensrf.dbmath> 
-                               <keepalive>3</keepalive>
-                               <stateless>1</stateless>
-                               <language>perl</language>
-                               <implementation>OpenSRF::Application::Demo::MathDB</implementation>
-                               <max_requests>99</max_requests>
-                               <unix_config>
-                                       <max_requests>1000</max_requests>
-                                       <unix_log>opensrf.dbmath_unix.log</unix_log>
-                                       <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
-                                       <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
-                                       <min_children>5</min_children>
-                                       <max_children>15</max_children>
-                                       <min_spare_children>2</min_spare_children> <max_spare_children>5</max_spare_children>
-                               </unix_config>
-                       </opensrf.dbmath>
-
-                       <opensrf.settings>
-                               <keepalive>1</keepalive>
-                               <stateless>0</stateless>
-                               <language>perl</language>
-                               <implementation>OpenSRF::Application::Settings</implementation>
-                               <max_requests>17</max_requests>
-                               <unix_config>
-                                       <unix_sock>opensrf.settings_unix.sock</unix_sock>
-                                       <unix_pid>opoensrf.settings_unix.pid</unix_pid>
-                                       <max_requests>1000</max_requests>
-                                       <unix_log>opensrf.settings_unix.log</unix_log>
-                                       <min_children>5</min_children>
-                                       <max_children>15</max_children>
-                                       <min_spare_children>3</min_spare_children>
-                                       <max_spare_children>5</max_spare_children>
-                               </unix_config>
-                       </opensrf.settings>
-
-               </apps>
-
-       </default>
-
-       <hosts>
-
-               <myhost.mydomain.org>
-                       <!-- ^-=-
-                               must match the fully qualified domain name of the host 
-                               on Linux, this is usually the output of "hostname -f"
-                       -->
-
-
-                       <!-- List all of the apps this server will be running -->
-                       <activeapps>
-                               <appname>opensrf.persist</appname> 
-                               <appname>opensrf.settings</appname> 
-                               <appname>opensrf.math</appname> 
-                               <appname>opensrf.dbmath</appname> 
-                       </activeapps>
-
-                       <apps> <!-- Example of an app-specific setting override -->
-                               <opensrf.persist>
-                                       <app_settings>
-                                               <dbfile>/different/path/to/dbfile/persist.db</dbfile>
-                                       </app_settings>
-                               </opensrf.persist>
-                       </apps>
-
-               </myhost.mydomain.org> 
-
-       </hosts>
-
-</opensrf>
diff --git a/OpenSRF/examples/opensrf_core.xml.example b/OpenSRF/examples/opensrf_core.xml.example
deleted file mode 100644 (file)
index 98875ac..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version='1.0'?>
-
-<config>
-
-       <opensrf> <!-- bootstrap config for the C apps -->
-
-               <!--  the routers's name on the network -->
-               <!-- do not change this -->
-      <router_name>router</router_name>
-               
-      <routers> 
-                       <!-- 
-                               list of router domains we should register with. 
-                               We must at least have our default jabber domain in here
-                       -->
-         <router>localhost</router>
-      </routers>
-
-      <domains>
-                       <!-- Our jabber domain, currenlty only one domain is supported -->
-         <domain>localhost</domain>
-      </domains>
-
-      <username>client</username>
-      <passwd>mypass</passwd>
-      <port>5222</port>
-
-               <!-- log to a local file -->
-      <logfile>/openils/var/log/osrfsys.log</logfile>
-
-               <!-- 
-                       Log to syslog. You can use this same layout for 
-                       defining the logging of all services in this file 
-               -->
-
-               <!--
-               <logfile>syslog</logfile>
-               <syslog>local2</syslog>
-               <actlog>local1</actlog>
-               -->
-
-               <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
-      <loglevel>3</loglevel>
-   </opensrf>
-
-
-       <!-- Update this if you use ChopChop -->
-       <chopchop> <!-- Our jabber server -->
-               <domain>localhost</domain>
-               <port>5222</port>
-
-               <!-- used when multiple servers need to communicate -->
-               <s2sport>5269</s2sport>
-               <secret>secret</secret>
-
-               <listen_address>10.0.0.3</listen_address>
-               <loglevel>3</loglevel>
-               <logfile>/openils/var/log/osrfsys.log</logfile>
-       </chopchop>
-
-
-       <!-- The section between <gateway>...</gateway> is a standard OpenSRF C stack config file -->
-       <gateway>
-
-        <!-- we consider ourselves to be the "originating" client for requests,
-            which means we define the log XID string for log traces -->
-        <client>true</client>
-
-               <!--  the routers's name on the network -->
-               <router_name>router</router_name>
-
-               <!-- jabber domains to connect to (domain1, domain2, ...) -->
-               <domains>
-                       <domain>localhost</domain>
-               </domains>
-
-               <!-- These are the services that the gateway will serve. 
-                       Any other requests will receive an HTTP_NOT_FOUND (404) 
-                       DO NOT put any services here that you don't want the internet to have access to
-                       -->
-               <services>
-                       <service>opensrf.math</service> 
-                       <service>open-ils.cat</service> 
-                       <service>open-ils.search</service> 
-                       <service>open-ils.circ</service> 
-                       <service>open-ils.actor</service> 
-                       <service>open-ils.auth</service> 
-               </services>
-
-
-               <!-- jabber login info -->
-               <username>mylogin</username>
-               <passwd>mypassword</passwd>
-               <port>5222</port>
-       
-               <logfile>/openils/var/log/gateway.log</logfile>
-               <loglevel>3</loglevel>
-
-       </gateway>
-
-
-       <!-- ======================================================================================== -->
-
-       <router>
-
-               <!-- do not change -->
-               <component>0</component>
-       
-               <trusted_domains>
-                       <!-- Trusted servers are allowed to register apps with the router -->
-                       <server>localhost</server>
-                       <!-- Trusted clients are allowed to send packets through the router -->
-                       <client>localhost</client>
-               </trusted_domains>
-       
-               <transport>
-                       <!-- jabber server are we connecting to -->
-                       <server>localhost</server>
-                       <port>5222</port>
-
-                       <!-- if this is changed, all "router_name" settings 
-                will need to be updated to match this setting -->
-                       <username>router</username>
-
-                       <password>mypassword</password>
-
-                       <!-- router's jabber resource --> 
-                       <!-- do not change this -->
-                       <resource>router</resource>
-
-                       <connect_timeout>10</connect_timeout>
-                       <max_reconnect_attempts>5</max_reconnect_attempts>
-               </transport>
-       
-               <logfile>/openils/var/log/router.log</logfile>
-               <loglevel>3</loglevel>
-       
-       </router>
-
-       <!-- ======================================================================================== -->
-
-</config>
-
-
-
-
diff --git a/OpenSRF/examples/register.pl b/OpenSRF/examples/register.pl
deleted file mode 100755 (executable)
index dfde4a6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/perl
-# ----------------------------------------------------------------------
-# Utility script for registring users on a jabber server.  
-# ----------------------------------------------------------------------
-use Net::Jabber;
-use strict;
-
-if (@ARGV < 4) {
-    print "\nperl $0 <server> <port> <username> <password> \n\n";
-    exit(0);
-}
-
-my $server = $ARGV[0];
-my $port = $ARGV[1];
-my $username = $ARGV[2];
-my $password = $ARGV[3];
-my $resource = "test_${server}_$$";
-
-my $connection = Net::Jabber::Client->new;
-
-my $status = $connection->Connect(hostname=>$server, port=>$port);
-
-my @stat = $connection->RegisterSend(
-       $server, 
-       username => $username,
-       password => $password );
-
-
-print "Register results : @stat\n";
-
-
-if (!defined($status)) {
-    print "ERROR:  Jabber server is down or connection was not allowed.\n";
-    print "        ($!)\n";
-    exit(0);
-}
-
-my @result = $connection->AuthSend(
-       username=>$username, password=>$password, resource=>$resource);
-
-if ($result[0] ne "ok") {
-    print "ERROR: Authorization failed: $result[0] - $result[1]\n";
-    exit(0);
-}
-
-print "Logged in OK to $server:$port\nRegistration succeeded for $username\@$server!\n";
-
-$connection->Disconnect();
-
-
diff --git a/OpenSRF/examples/srfsh.xml.example b/OpenSRF/examples/srfsh.xml.example
deleted file mode 100644 (file)
index 5bc1e2d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!-- This file follows the standard C stack bootstrap config file layout -->
-<srfsh>
-       <router_name>router</router_name>
-       <domains>
-               <domain>127.0.0.1</domain> 
-       </domains>
-       <username>myusername</username>
-       <passwd>mypassword</passwd>
-       <port>5222</port>
-       <logfile>/path/to/log/srfsh.log</logfile>
-       <loglevel>4</loglevel>
-</srfsh>
diff --git a/OpenSRF/src/Makefile b/OpenSRF/src/Makefile
deleted file mode 100644 (file)
index 0ad9171..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-# TOP level 'src' makefile for OpenSRF
-
-
-export TMPDIR                  = $(TMP)/opensrf
-export OPENSRF                 = opensrf
-export BINDIR                  = $(PREFIX)/bin
-export LIBDIR                  = $(PREFIX)/lib
-export PERLDIR                 = $(LIBDIR)/perl5
-export INCLUDEDIR              = $(PREFIX)/include
-
-export LDLIBS                  += 
-export LDFLAGS                 += -L $(TMPDIR) -L . -L /opt/lib
-export CFLAGS                  += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
-                                                               -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) \
-                                                               -I$(APR_HEADERS) -I$(TMPDIR)
-
-LIBOPENSRF                             = libopensrf.so
-
-OPENSRF_TARGETS =      libtransport/transport_session.o \
-                       libtransport/transport_client.o \
-                       libtransport/transport_message.o \
-                       libstack/osrf_app_session.o \
-                       libstack/osrf_stack.o \
-                       libstack/osrfConfig.o \
-                       libstack/osrf_settings.o \
-                       libstack/osrf_message.o \
-                       libstack/osrf_prefork.o \
-                       libstack/osrf_system.o \
-                       libstack/osrf_application.o \
-                       libstack/osrf_cache.o \
-                       libstack/xml_utils.o \
-                       libstack/osrf_transgroup.o \
-                       libstack/osrf_list.o \
-                       libstack/osrf_hash.o \
-                       libstack/osrf_json_parser.o \
-                       libstack/osrf_json_object.o \
-                       libstack/osrf_json_tools.o \
-                       libstack/legacy_json.o \
-                       utils/socket_bundle.o \
-                       utils/string_array.o \
-                       utils/utils.o \
-                       utils/log.o \
-                       utils/md5.o \
-                       utils/sha.o 
-
-OPENSRF_HEADERS =      libtransport/transport_session.h \
-                       libtransport/transport_client.h \
-                       libtransport/transport_message.h \
-                       libstack/osrf_app_session.h \
-                       libstack/osrf_stack.h \
-                       libstack/osrfConfig.h \
-                       libstack/osrf_settings.h \
-                       libstack/osrf_message.h \
-                       libstack/osrf_prefork.h \
-                       libstack/osrf_system.h \
-                       libstack/osrf_application.h \
-                       libstack/osrf_cache.h \
-                       libstack/xml_utils.h \
-                       libstack/osrf_transgroup.h \
-                       libstack/osrf_list.h \
-                       libstack/osrf_hash.h \
-                       libstack/osrf_json.h \
-                       utils/socket_bundle.h \
-                       utils/string_array.h \
-                       utils/utils.h \
-                       utils/log.h \
-                       utils/md5.h \
-                       utils/sha.h 
-
-all:   prep \
-       libopensrf.so \
-       libstack/opensrf \
-       router \
-       srfsh \
-       gateway
-
-install:       install-prep \
-               opensrf-install \
-               gateway-install \
-               router-install \
-               srfsh-install \
-               perl-install 
-
-prep:
-       mkdir -p $(TMPDIR)
-
-libopensrf.so:
-       @echo utils
-       make -C utils
-       @echo transport
-       make -C libtransport
-       @echo stack
-       make -C libstack
-       @echo $@
-       $(CC) -shared -W1 $(LDFLAGS) -lxml2 -lmemcache $(OPENSRF_TARGETS) -o $(TMPDIR)/$(LIBOPENSRF)
-       @echo apps
-       make -C  c-apps
-
-
-#
-# --------------------------------------------------------------------------------
-# BINARIES
-# --------------------------------------------------------------------------------
-libstack/opensrf.o:    libstack/opensrf.c libopensrf.so
-libstack/opensrf:      libstack/opensrf.o
-       @echo $@
-       $(CC) $(CFLAGS) $(LDFLAGS) -lxml2 -lopensrf libstack/opensrf.o -o $@
-       
-
-router: libopensrf.so
-       @echo $@
-       make -C router 
-
-srfsh: libopensrf.so
-       @echo $@
-       make -C srfsh
-
-gateway:       libopensrf.so
-       @echo $@
-       make -C gateway
-
-jserver:       libopensrf.so
-       @echo $@
-       make -C jserver
-
-
-# --------------------------------------------------------------------------------
-# INSTALL
-# --------------------------------------------------------------------------------
-install-prep:  
-       @echo $@
-       mkdir -p $(LIBDIR)
-       mkdir -p $(BINDIR)
-       mkdir -p $(PERLDIR)
-       mkdir -p $(INCLUDEDIR)
-       mkdir -p $(INCLUDEDIR)/$(OPENSRF)
-       mkdir -p $(ETCDIR)
-       mkdir -p $(TEMPLATEDIR)
-
-libopensrf-install:    install-prep
-       @echo $@
-       cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)
-
-opensrf-install:
-       @echo $@
-       cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)/$(LIBOPENSRF)
-       cp $(OPENSRF_HEADERS) $(INCLUDEDIR)/opensrf/
-       cp libstack/opensrf $(BINDIR)/opensrf-c
-       make -C c-apps install
-
-gateway-install:       install-prep opensrf-install    
-       @echo $@
-       make -C gateway install
-
-router-install:        install-prep opensrf-install
-       @echo $@
-       make -C router install
-
-srfsh-install: install-prep opensrf-install 
-       @echo $@
-       make -C srfsh install
-
-jserver-install:       install-prep 
-       @echo $@
-       make -C jserver install
-
-perl-install:  install-prep
-       @echo $@
-       cp -r perlmods/* $(PERLDIR)/
-       cp ../examples/bootstrap.conf.example $(ETCDIR)
-       cp ../bin/osrf_ctl.sh $(BINDIR)
-       cp ../examples/opensrf.xml.example $(ETCDIR)
-       cp ../examples/opensrf_core.xml.example $(ETCDIR)
-       cp ../examples/srfsh.xml.example $(ETCDIR)
-
-
-# --------------------------------------------------------------------------------
-# CLEAN        
-# --------------------------------------------------------------------------------
-clean:
-       @echo $@
-       make -C libtransport clean
-       make -C libstack clean
-       make -C router clean
-       make -C gateway clean
-       make -C jserver clean
-       make -C utils clean
-       make -C srfsh clean
-       make -C c-apps clean
-       echo "Removing directory [$(TMPDIR)]"
-       /bin/rm -rf $(TMPDIR) *.o
-
-
diff --git a/OpenSRF/src/c-apps/Makefile b/OpenSRF/src/c-apps/Makefile
deleted file mode 100644 (file)
index 14b884e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-LDLIBS +=  -lopensrf
-CFLAGS += -DOSRF_LOG_PARAMS
-
-all:   osrf_math.so osrf_dbmath.so osrf_version.so
-
-osrf_math.o: osrf_math.c
-osrf_dbmath.o: osrf_dbmath.c
-osrf_version.o: osrf_version.c
-
-osrf_math.so: osrf_math.o
-       $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) osrf_math.o -o $(TMPDIR)/osrf_math.so
-
-osrf_dbmath.so: osrf_dbmath.o
-       $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) osrf_dbmath.o -o $(TMPDIR)/osrf_dbmath.so
-
-osrf_version.so: osrf_version.o
-       $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) osrf_version.o -o $(TMPDIR)/osrf_version.so
-
-install:
-       cp $(TMPDIR)/osrf_math.so $(LIBDIR)/
-       cp $(TMPDIR)/osrf_dbmath.so $(LIBDIR)/
-       cp $(TMPDIR)/osrf_version.so $(LIBDIR)/
-
-clean:
-       rm -f *.o *.so
diff --git a/OpenSRF/src/c-apps/osrf_dbmath.c b/OpenSRF/src/c-apps/osrf_dbmath.c
deleted file mode 100644 (file)
index ace60a1..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "opensrf/osrf_app_session.h"
-#include "opensrf/osrf_application.h"
-#include "opensrf/osrf_json.h"
-#include "opensrf/log.h"
-
-#define MODULENAME "opensrf.dbmath"
-
-int osrfAppInitialize();
-int osrfAppChildInit();
-int osrfMathRun( osrfMethodContext* );
-
-
-int osrfAppInitialize() {
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "add", 
-                       "osrfMathRun", 
-                       "Addss two numbers", 2, 0 );
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "sub", 
-                       "osrfMathRun", 
-                       "Subtracts two numbers", 2, 0 );
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "mult", 
-                       "osrfMathRun", 
-                       "Multiplies two numbers", 2, 0 );
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "div", 
-                       "osrfMathRun", 
-                       "Divides two numbers", 2, 0 );
-
-       return 0;
-}
-
-int osrfAppChildInit() {
-       return 0;
-}
-
-int osrfMathRun( osrfMethodContext* ctx ) {
-
-       OSRF_METHOD_VERIFY_CONTEXT(ctx);        
-
-       jsonObject* x = jsonObjectGetIndex(ctx->params, 0);
-       jsonObject* y = jsonObjectGetIndex(ctx->params, 1);
-
-       if( x && y ) {
-
-               char* a = jsonObjectToSimpleString(x);
-               char* b = jsonObjectToSimpleString(y);
-
-               if( a && b ) {
-
-                       double i = strtod(a, NULL);
-                       double j = strtod(b, NULL);
-                       double r = 0;
-
-                       if(!strcmp(ctx->method->name, "add"))   r = i + j;
-                       if(!strcmp(ctx->method->name, "sub"))   r = i - j;
-                       if(!strcmp(ctx->method->name, "mult"))  r = i * j;
-                       if(!strcmp(ctx->method->name, "div"))   r = i / j;
-
-                       jsonObject* resp = jsonNewNumberObject(r);
-                       osrfAppRespondComplete( ctx, resp );
-                       jsonObjectFree(resp);
-
-                       free(a); free(b);
-                       return 0;
-               }
-       }
-
-       return -1;
-}
-
-
-
diff --git a/OpenSRF/src/c-apps/osrf_math.c b/OpenSRF/src/c-apps/osrf_math.c
deleted file mode 100644 (file)
index 05d9a1f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "opensrf/osrf_app_session.h"
-#include "opensrf/osrf_application.h"
-#include "opensrf/osrf_json.h"
-#include "opensrf/log.h"
-
-#define MODULENAME "opensrf.math"
-
-int osrfAppInitialize();
-int osrfAppChildInit();
-void osrfAppChildExit();
-int osrfMathRun( osrfMethodContext* );
-
-
-int osrfAppInitialize() {
-
-       osrfAppRegisterMethod( 
-                       MODULENAME,                             /* which application has this method */
-                       "add",                                  /* the name of the method */
-                       "osrfMathRun",                  /* the symbol that runs the method */
-                       "Adds two numbers",     /* description of the method */
-                       2,                                                      /* the minimum number of params required to run the method */
-                       0 );                                            /* method options, 0 for not special options */
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "sub", 
-                       "osrfMathRun", 
-                       "Subtracts two numbers", 2, 0 );
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "mult", 
-                       "osrfMathRun", 
-                       "Multiplies two numbers", 2, 0 );
-
-       osrfAppRegisterMethod( 
-                       MODULENAME, 
-                       "div", 
-                       "osrfMathRun", 
-                       "Divides two numbers", 2, 0 );
-
-       return 0;
-}
-
-/* called when this process is just coming into existence */
-int osrfAppChildInit() {
-       return 0;
-}
-
-/* called when this process is about to exit */
-void osrfAppChildExit() {
-   osrfLogDebug(OSRF_LOG_MARK, "Child is exiting...");
-}
-
-
-int osrfMathRun( osrfMethodContext* ctx ) {
-
-       OSRF_METHOD_VERIFY_CONTEXT(ctx); /* see osrf_application.h */
-
-       /* collect the request params */
-       jsonObject* x = jsonObjectGetIndex(ctx->params, 0);
-       jsonObject* y = jsonObjectGetIndex(ctx->params, 1);
-
-       if( x && y ) {
-
-               /* pull out the params as strings since they may be either
-                       strings or numbers depending on the client */
-               char* a = jsonObjectToSimpleString(x);
-               char* b = jsonObjectToSimpleString(y);
-
-               if( a && b ) {
-
-                       osrfLogActivity( OSRF_LOG_MARK, "Running opensrf.math %s [ %s : %s ]", 
-                                       ctx->method->name, a, b );
-
-                       /* construct a new params object to send to dbmath */
-                       jsonObject* newParams = jsonParseStringFmt( "[ %s, %s ]", a, b );
-                       free(a); free(b);
-
-                       /* connect to db math */
-                       osrfAppSession* ses = osrfAppSessionClientInit("opensrf.dbmath");
-
-                       /* forcing an explicit connect allows us to talk to one worker backend
-                        * regardless of "stateful" config settings for the server 
-                        * This buys us nothing here since we're only sending one request...
-                        * */
-                       /*osrfAppSessionConnect(ses);*/
-
-                       /* dbmath uses the same method names that math does */
-                       int req_id = osrfAppSessionMakeRequest( ses, newParams, ctx->method->name, 1, NULL );
-                       osrfMessage* omsg = osrfAppSessionRequestRecv( ses, req_id, 60 );
-
-                       if(omsg) {
-                               /* return dbmath's response to the user */
-                               osrfAppRespondComplete( ctx, osrfMessageGetResult(omsg) ); 
-                               osrfMessageFree(omsg);
-                               osrfAppSessionFree(ses);
-                               return 0;
-                       }
-
-                       osrfAppSessionFree(ses);
-               }
-       }
-
-       return -1;
-}
-
-
-
diff --git a/OpenSRF/src/c-apps/osrf_version.c b/OpenSRF/src/c-apps/osrf_version.c
deleted file mode 100644 (file)
index 9d07874..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "opensrf/osrf_app_session.h"
-#include "opensrf/osrf_application.h"
-#include "opensrf/osrf_json.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-
-#define OSRF_VERSION_CACHE_TIME 300
-
-int osrfAppInitialize();
-int osrfAppChildInit();
-int osrfVersion( osrfMethodContext* );
-
-
-int osrfAppInitialize() {
-
-       osrfAppRegisterMethod( 
-                       "opensrf.version", 
-                       "opensrf.version.verify", 
-                       "osrfVersion", 
-                       "The data for a service/method/params combination will be retrieved "
-                       "from the necessary server and the MD5 sum of the total values received "
-                       "will be returned. PARAMS( serviceName, methodName, [param1, ...] )", 
-                       2, 0 );
-       
-       return 0;
-}
-
-int osrfAppChildInit() {
-       return 0;
-}
-
-int osrfVersion( osrfMethodContext* ctx ) {
-
-       OSRF_METHOD_VERIFY_CONTEXT(ctx); 
-
-       /* First, see if the data is in the cache */
-       char* json = jsonObjectToJSON(ctx->params);
-       char* paramsmd5 = md5sum(json);
-       char* cachedmd5 = osrfCacheGetString(paramsmd5);
-       free(json); 
-
-       if( cachedmd5 ) {
-               osrfLogDebug(OSRF_LOG_MARK,  "Found %s object in cache, returning....", cachedmd5 );
-               jsonObject* resp = jsonNewObject(cachedmd5);
-               osrfAppRespondComplete( ctx, resp  );
-               jsonObjectFree(resp);
-               free(paramsmd5);
-               free(cachedmd5);
-               return 0;
-       }
-
-       jsonObject* serv = jsonObjectGetIndex(ctx->params, 0);
-       jsonObject* meth = jsonObjectGetIndex(ctx->params, 1);
-       char* service = jsonObjectGetString(serv);
-       char* methd = jsonObjectGetString(meth);
-
-       if( service && methd ) {
-               /* shove the additional params into an array */
-               jsonObject* tmpArray = jsonNewObject(NULL);
-               int i;
-               for( i = 2; i != ctx->params->size; i++ ) 
-                       jsonObjectPush( tmpArray, jsonObjectClone(jsonObjectGetIndex(ctx->params, i)));
-
-               osrfAppSession* ses = osrfAppSessionClientInit(service);
-               int reqid = osrfAppSessionMakeRequest( ses, tmpArray, methd, 1, NULL );
-               osrfMessage* omsg = osrfAppSessionRequestRecv( ses, reqid, 60 );
-               jsonObjectFree(tmpArray);
-
-               if( omsg ) {
-
-                       jsonObject* result = osrfMessageGetResult( omsg );
-                       char* resultjson = jsonObjectToJSON(result);
-                       char* resultmd5 = md5sum(resultjson);
-                       free(resultjson);
-                       osrfMessageFree(omsg);
-
-                       if( resultmd5 ) {
-                               jsonObject* resp = jsonNewObject(resultmd5);
-                               osrfAppRespondComplete( ctx, resp );
-                               jsonObjectFree(resp);
-                               osrfAppSessionFree(ses);
-                               osrfLogDebug(OSRF_LOG_MARK, "Found version string %s, caching and returning...", resultmd5 );
-                               osrfCachePutString( paramsmd5, resultmd5, OSRF_VERSION_CACHE_TIME );
-                               free(resultmd5);
-                               free(paramsmd5);
-                               return 0;
-                       } 
-               }
-               osrfAppSessionFree(ses);
-       }
-
-       free(paramsmd5);
-
-       return -1;
-}
-
-
-
diff --git a/OpenSRF/src/extras/docgen.xsl b/OpenSRF/src/extras/docgen.xsl
deleted file mode 100644 (file)
index 1ea5398..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-<?xml-stylesheet type="text/xsl"  href="#"?> 
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:res="http://opensrf.org/-/namespaces/gateway/v1"
-  version="1.0"
-  >
-  <xsl:template match="xsl:stylesheet">
-    <html>
-      <head>
-        <style type="text/css">
-body { background-color:#F0F0F0; font: 9pt Verdana, Arial, "Arial Unicode MS", Helvetica, sans-serif;}
-input.button { font:8pt Verdana, Arail, "Arial Unicode MS", Helvetica, sans-serif;}
-input.text {}
-div.DDB { position:absolute; top:20pt; left:15pt; visibility:visible; }
-div.DLC { position:absolute; top:20pt; left:15pt; visibility:hidden; }
-div.numFound { position:absolute; top:0px; left:0pt; font-weight:bold;}
-
-table { background-color:lightgray; font-size:10pt; margin:10pt 0pt 15pt 0pt; width:90%; border-collapse: collapse; spacing:0; padding:0;}
-td { background-color:#f0f0f0; border: solid lightgray 1px; }
-td.fulltag { background-color:#f0f0f0;}
-td.fullind { background-color:#f0f0f0;  width:20pt;}
-td.fullfield{ background-color:#f0f0f0; width:100%;}
-
-table.signature { background-color:lightgray; font-size:10pt; margin:0; width:100%; border:none; padding:0;}
-table.params { background-color:lightgray; font-size:10pt; margin:3px 0px 3px 0px; width:100%; border: solid black 1px; padding:0;}
-td.params { background-color:lightgray; font-size:10pt; border: solid black 1px;}
-
-h1 { text-decoration: underline; }
-
-td.header { font-weight:bold; color:black; font-size:14pt; border-bottom: solid gray 2px}
-td.label { vertical-align:top; padding-left:10pt; width:120pt; font-weight:normal; color:darkblue;}
-td.value { vertical-align:top; text-align:left; font-weight: bold;}
-span.subcode { color:darkblue;}        </style>
-
-      </head>
-      <body>
-        <a name="top"/>
-
-<!--#if expr='$QUERY_STRING = /limit=([^&]+)/' -->
-  <!--#set var="limit" value="$1" -->
-<!--#else -->
-  <!--#set var="limit" value="25" -->
-<!--#endif -->
-
-<!--#if expr='$QUERY_STRING = /offset=([^&]+)/' -->
-  <!--#set var="offset" value="$1" -->
-<!--#else -->
-  <!--#set var="offset" value="0" -->
-<!--#endif -->
-
-<!--#if expr='$QUERY_STRING = /service=([^&]+)/' -->
-  <!--#set var="service" value="$1" -->
-<!--#else -->
-  <!--#set var="service" value="" -->
-<!--#endif -->
-
-<!--#if expr='$QUERY_STRING = /method=([^&]+)/' -->
-  <!--#set var="method" value="$1" -->
-<!--#endif -->
-
-<!--#if expr="$QUERY_STRING = /all=on/" -->
-  <!--#set var="all" value="on" -->
-  <!--#set var="method" value="opensrf.sysemt.method.all" -->
-<!--#else -->
-  <!--#set var="all" value="off" -->
-  <!--#set var="method" value="opensrf.sysemt.method" -->
-<!--#endif -->
-
-<!--#if expr='$QUERY_STRING = /param=%22(.+?)%22/' -->
-  <!--#set var="param" value="$1" -->
-<!--#else -->
-  <!--#set var="param" value="" -->
-<!--#endif -->
-
-        <xsl:if test="not(res:response)">
-         <br/><br/><br/><br/><br/><br/>
-         <br/><br/><br/><br/><br/><br/>
-       </xsl:if>
-
-        <form
-         method="GET"
-         action='<!--#echo var="DOCUMENT_URI" -->'
-         onsubmit='
-           this.param.value = "\"" + this.param.value + "\"";
-           if (this.all.checked) this.method.value = "opensrf.system.method.all";
-         '>
-          <xsl:if test="not(res:response)">
-           <xsl:attribute name="style">
-             <xsl:value-of select="'text-align:center;'"/>
-           </xsl:attribute>
-         </xsl:if>
-          Application:
-         <input name="service" type="text" value='<!--#echo var="service" -->'/>&#160;
-          API Method Name Regex:
-         <input name="param" type="text" value='<!--#echo var="param" -->'>
-            <xsl:if test="'<!--#echo var="all" -->' = 'on'">
-             <xsl:attribute name="disabled">
-               <xsl:value-of select="'true'"/>
-             </xsl:attribute>
-           </xsl:if>
-         </input>&#160;
-         All Methods (Use with care!)
-         <input
-           name="all"
-           type="checkbox"
-           value="on"
-           onclick='
-             if (this.checked) this.form.param.disabled = true;
-             else this.form.param.disabled = false;
-           '>
-           <xsl:if test="'<!--#echo var="all" -->' = 'on'">
-             <xsl:attribute name="checked">
-               <xsl:value-of select="'checked'"/>
-             </xsl:attribute>
-           </xsl:if>
-
-           </input>&#160;
-          <input type="hidden" name="offset" value="<!--#echo var="offset" -->"/>
-          <button name="limit" value="<!--#echo var="limit" -->">Find 'em</button>
-        </form>
-
-        <xsl:if test="res:response">
-         <hr/>
-
-          <xsl:apply-templates select="res:response"/>
-
-         <hr/>
-
-          <form
-           method="GET"
-           action='<!--#echo var="DOCUMENT_URI" -->'
-           onsubmit='
-             this.param.value = "\"" + this.param.value + "\"";
-             if (this.all.checked) this.method.value = "opensrf.system.method.all";
-           '>
-            <xsl:if test="not(res:response)">
-             <xsl:attribute name="style">
-               <xsl:value-of select="'text-align:center;'"/>
-             </xsl:attribute>
-           </xsl:if>
-            Application:
-           <input name="service" type="text" value='<!--#echo var="service" -->'/>&#160;
-            API Method Name Regex:
-           <input name="param" type="text" value='<!--#echo var="param" -->'>
-              <xsl:if test="'<!--#echo var="all" -->' = 'on'">
-               <xsl:attribute name="disabled">
-                 <xsl:value-of select="'true'"/>
-               </xsl:attribute>
-             </xsl:if>
-           </input>&#160;
-           All Methods (Use with care!)
-           <input
-             name="all"
-             type="checkbox"
-             value="on"
-             onclick='
-               if (this.checked) this.form.param.disabled = true;
-               else this.form.param.disabled = false;
-             '>
-             <xsl:if test="'<!--#echo var="all" -->' = 'on'">
-               <xsl:attribute name="checked">
-                 <xsl:value-of select="'checked'"/>
-               </xsl:attribute>
-             </xsl:if>
-  
-             </input>&#160;
-            <input type="hidden" name="offset" value="<!--#echo var="offset" -->"/>
-            <button name="limit" value="<!--#echo var="limit" -->">Find 'em</button>
-          </form>
-
-       </xsl:if>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template name="apiNameLink">
-    API Level: <xsl:value-of select="../res:element[@key='api_level']/res:number"/> / Method: 
-    <a>
-      <xsl:attribute name="href">#<xsl:value-of select="../res:element[@key='api_level']/res:number"/>/<xsl:value-of select="res:string"/></xsl:attribute>
-      <xsl:value-of select="res:string"/>
-    </a>
-    <br/>
-  </xsl:template>
-
-  <xsl:template match="res:response">
-    <xsl:choose>
-      <xsl:when test="count(//res:element[@key='api_name']) > 1 or <!--#echo var="offset" --> > 0">
-        <h1>Matching Methods</h1>
-
-       <xsl:if test="<!--#echo var="offset" --> &gt; 0">
-         <span>
-           <a>
-              <xsl:attribute name="href">docgen.xsl?service=<!--#echo var="service" -->&amp;all=<!--#echo var="all" -->&amp;param="<!--#echo var="param" -->"&amp;limit=<!--#echo var="limit" -->&amp;offset=<xsl:value-of select='<!--#echo var="offset" --> - <!--#echo var="limit" -->'/></xsl:attribute>
-               Previous Page</a>
-           //
-         </span>
-       </xsl:if>
-
-
-        <span>
-         <xsl:value-of select='<!--#echo var="offset" --> + 1'/>
-           -
-         <xsl:value-of select='<!--#echo var="offset" --> + count(//res:element[@key="api_name"])'/>
-       </span>
-
-       <xsl:if test="count(//res:element[@key='api_name']) = <!--#echo var="limit" -->">
-         <span>
-           //
-           <a>
-              <xsl:attribute name="href">docgen.xsl?service=<!--#echo var="service" -->&amp;all=<!--#echo var="all" -->&amp;param="<!--#echo var="param" -->"&amp;limit=<!--#echo var="limit" -->&amp;offset=<xsl:value-of select='<!--#echo var="offset" --> + <!--#echo var="limit" -->'/></xsl:attribute>
-               Next Page</a>
-         </span>
-       </xsl:if>
-
-        <br/>
-        <br/>
-
-       <xsl:for-each select="//res:element[@key='api_name']">
-          <xsl:sort select="concat(../res:element[@key='api_level']/res:number/text(), res:string/text())"/>
-          <xsl:call-template name="apiNameLink"/>
-        </xsl:for-each>
-
-        <h1>Method Definitions</h1>
-      </xsl:when>
-      <xsl:when test="count(//res:element[@key='api_name']) = 0">
-        <h1><i>No Matching Methods Found</i></h1>
-      </xsl:when>
-    </xsl:choose>
-
-    <xsl:for-each select="res:payload/res:object">
-      <xsl:sort select="concat(../res:element[@key='api_level']/res:number/text(), res:string/text())"/>
-      <xsl:call-template name="methodDefinition"/>
-    </xsl:for-each>
-  </xsl:template>
-
-
-  <xsl:template name="methodDefinition">
-    <xsl:if test="res:element[@key='remote']/res:number/text()='0'">
-
-      <xsl:if test="count(//res:element[@key='api_name']) > 1">
-        <a>
-          <xsl:attribute name="name"><xsl:value-of select="res:element[@key='api_level']/res:number"/>/<xsl:value-of select="res:element[@key='api_name']/res:string"/></xsl:attribute>
-        </a>
-        <a href="#top">Top</a>
-      </xsl:if>
-
-      <table>
-        <tr>
-          <td colspan="3" class="header"><xsl:value-of select="res:element[@key='api_name']/res:string"/></td>
-        </tr>
-        <tr>
-          <td class="label">API Level:</td>
-          <td colspan="2" class="value"><xsl:value-of select="res:element[@key='api_level']/res:number"/></td>
-        </tr>
-        <tr>
-          <td class="label">Package:</td>
-          <td colspan="2" class="value"><xsl:value-of select="res:element[@key='package']/res:string"/></td>
-        </tr>
-        <tr>
-          <td class="label">Packaged Method:</td>
-          <td colspan="2" class="value"><xsl:value-of select="res:element[@key='method']/res:string"/></td>
-        </tr>
-        <tr>
-          <td class="label">Required argument count:</td>
-          <td colspan="2" class="value"><xsl:value-of select="res:element[@key='argc']/res:number"/></td>
-        </tr>
-        <xsl:if test="normalize-space(res:element[@key='signature']/res:object/res:element[@key='desc']/res:string/text()) != normalize-space(res:element[@key='notes']/res:string/text())">
-          <tr>
-            <td class="label">
-              <xsl:attribute name='rowspan'>
-                <xsl:value-of select='
-                 count(res:element[@key="signature"]/res:object/res:element[@key="params"]/res:array/res:object) +
-                 count(res:element[@key="signature"]/res:object/res:element[@key="params"]/res:array[res:object]) +
-                 5
-               '/>
-              </xsl:attribute>
-              Signature:
-            </td>
-          </tr>
-         <xsl:for-each select="res:element[@key='signature']/res:object">
-            <xsl:call-template name="methodSignature"/>
-         </xsl:for-each>
-        </xsl:if>
-        <tr>
-          <td class="label">Streaming method:</td>
-          <td colspan="2" class="value">
-            <xsl:if test="res:element[@key='stream']/res:number/text()='1'">Yes</xsl:if>
-            <xsl:if test="res:element[@key='stream']/res:number/text()='0'">No</xsl:if>
-          </td>
-        </tr>
-        <xsl:if test="res:element[@key='notes']">
-          <tr>
-            <td class="label">Notes:</td>
-            <td colspan="2" class="value"><pre style="font-weight:normal;font-size:10px;"><xsl:value-of select="res:element[@key='notes']/res:string"/></pre></td>
-          </tr>
-        </xsl:if>
-      </table>
-    </xsl:if>
-  </xsl:template>
-
-
-  <xsl:template name="paramInfoLine">
-    <tr>
-      <td class="label params">
-        <xsl:if test="@key='name'">Name:</xsl:if>
-        <xsl:if test="@key='desc'">Description:</xsl:if>
-        <xsl:if test="@key='type'">Data type:</xsl:if>
-        <xsl:if test="@key='class'">Object class:</xsl:if>
-      </td>
-      <td class="value params"><xsl:value-of select="res:string"/></td>
-    </tr>
-  </xsl:template>
-
-
-  <xsl:template name="paramInfo">
-    <tr>
-      <td>
-        <table class="params">
-         <tr>
-           <td class="label params">Position:</td>
-           <td class="value params"><xsl:value-of select="position()"/></td>
-         </tr>
-         <xsl:for-each select="res:element">
-               <xsl:call-template name="paramInfoLine"/>
-         </xsl:for-each>
-        </table>
-      </td>
-    </tr>
-  </xsl:template>
-
-
-  <xsl:template name="methodSignature">
-      <xsl:if test="res:element[@key='desc']">
-        <tr>
-          <td class="label">Description:</td>
-          <td class="value"><xsl:value-of select="res:element[@key='desc']/res:string"/></td>
-        </tr>
-      </xsl:if>
-      <xsl:if test="res:element[@key='params']/res:array/res:object">
-        <tr>
-          <td class="label">
-            <xsl:attribute name='rowspan'>
-              <xsl:value-of select='count(res:element[@key="params"]/res:array/res:object) + 1'/>
-            </xsl:attribute>
-            Parameters:</td>
-        </tr>
-      </xsl:if>
-      <xsl:for-each select="res:element[@key='params']/res:array/res:object">
-        <xsl:sort select="position()"/>
-        <xsl:call-template name="paramInfo"/>
-      </xsl:for-each>
-      <xsl:if test="res:element[@key='return']">
-        <tr>
-          <td class="label">Returns:</td>
-          <td class="value"><xsl:value-of select="res:element[@key='return']/res:object/res:element[@key='desc']/res:string"/></td>
-        </tr>
-        <tr>
-          <td class="label">Return type:</td>
-          <td class="value"><xsl:value-of select="res:element[@key='return']/res:object/res:element[@key='type']/res:string"/></td>
-        </tr>
-        <tr>
-          <td class="label">Return type class:</td>
-          <td class="value"><xsl:value-of select="res:element[@key='return']/res:object/res:element[@key='class']/res:string"/></td>
-        </tr>
-      </xsl:if>
-  </xsl:template>
-
-
-  <!--#if expr="$QUERY_STRING = /service=[^&]+/" -->
-    <!--#if expr="$QUERY_STRING = /param=%22[^&]+%22/" -->
-      <!-- virtual="/gateway?format=xml&${QUERY_STRING}"-->
-      <!-- virtual="/restgateway?${QUERY_STRING}"-->
-      <!--#include virtual='/gateway?format=xml&service=$service&method=opensrf.system.method&param="$param"&param=$limit&param=$offset'-->
-    <!--#endif -->
-    <!--#if expr="$QUERY_STRING = /all=on/" -->
-      <!-- virtual="/gateway?format=xml&${QUERY_STRING}"-->
-      <!-- virtual="/restgateway?${QUERY_STRING}"-->
-      <!--#include virtual='/gateway?format=xml&service=$service&method=opensrf.system.method.all&param=$limit&param=$offset' -->
-    <!--#endif -->
-  <!--#endif -->
-
-
-</xsl:stylesheet>
-
diff --git a/OpenSRF/src/gateway/Makefile b/OpenSRF/src/gateway/Makefile
deleted file mode 100644 (file)
index 8da80b1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#CFLAGS        += -DASSUME_STATELESS -DOSRF_GATEWAY_NASTY_DEBUG
-CFLAGS += -DASSUME_STATELESS 
-LDLIBS +=  -lopensrf 
-
-all: osrf_json_gateway.so copy
-
-install: 
-       $(APXS2) -i -a -n osrf_json_gateway osrf_json_gateway.so
-       cp apachetools.h $(INCLUDEDIR)/opensrf/
-
-copy:
-       cp apachetools.h $(TMPDIR)
-
-apachetools.o: apachetools.h apachetools.c
-       $(CC) -c $(CFLAGS) apachetools.c -o $@
-
-osrf_json_gateway.o:   osrf_json_gateway.c
-       $(CC) -c $(CFLAGS) osrf_json_gateway.c -o $@
-
-osrf_json_gateway.so:  copy apachetools.o osrf_json_gateway.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -shared -W1 apachetools.o osrf_json_gateway.o -o osrf_json_gateway.so
-
-
-clean:
-       /bin/rm -f *.o *.so 
diff --git a/OpenSRF/src/gateway/apachetools.c b/OpenSRF/src/gateway/apachetools.c
deleted file mode 100644 (file)
index d70bfe6..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-#include "apachetools.h"
-
-string_array* apacheParseParms(request_rec* r) {
-
-       if( r == NULL ) return NULL;
-
-       char* arg = r->args;                    /* url query string */
-       apr_pool_t *p = r->pool;        /* memory pool */
-       string_array* sarray                    = init_string_array(12); /* method parameters */
-
-       growing_buffer* buffer          = NULL; /* POST data */
-       growing_buffer* tmp_buf         = NULL; /* temp buffer */
-
-       char* key                                               = NULL; /* query item name */
-       char* val                                               = NULL; /* query item value */
-
-       /* gather the post args and append them to the url query string */
-       if( !strcmp(r->method,"POST") ) {
-
-               ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK);
-               
-               osrfLogDebug(OSRF_LOG_MARK, "gateway reading post data..");
-
-               if(ap_should_client_block(r)) {
-
-                       char body[1025];
-                       memset(body,0,1025);
-                       buffer = buffer_init(1025);
-
-
-                       osrfLogDebug(OSRF_LOG_MARK, "gateway client has post data, reading...");
-       
-                       long bread;
-                       while( (bread = ap_get_client_block(r, body, 1024)) ) {
-
-                               if(bread < 0) {
-                                       osrfLogInfo(OSRF_LOG_MARK, 
-                                               "ap_get_client_block(): returned error, exiting POST reader");
-                                       break;
-                               }
-
-                               buffer_add( buffer, body );
-                               memset(body,0,1025);
-
-                               osrfLogDebug(OSRF_LOG_MARK, 
-                                       "gateway read %d bytes: %d bytes of data so far", bread, buffer->n_used);
-
-                               if(buffer->n_used == 0) break;
-
-                               if(buffer->n_used > APACHE_TOOLS_MAX_POST_SIZE) {
-                                       osrfLogError(OSRF_LOG_MARK, "gateway received POST larger "
-                                               "than %d bytes. dropping reqeust", APACHE_TOOLS_MAX_POST_SIZE);
-                                       buffer_free(buffer);
-                                       return NULL;
-                               }
-                       }
-
-                       osrfLogDebug(OSRF_LOG_MARK, "gateway done reading post data");
-       
-                       if(arg && arg[0]) {
-
-                               tmp_buf = buffer_init(1024);
-                               buffer_add(tmp_buf,arg);
-                               buffer_add(tmp_buf,buffer->buf);
-                               arg = (char*) apr_pstrdup(p, tmp_buf->buf);
-                               buffer_free(tmp_buf);
-
-                       } else if(buffer->n_used > 0){
-                                       arg = (char*) apr_pstrdup(p, buffer->buf);
-
-                       } else { 
-                               arg = NULL; 
-                       }
-
-                       buffer_free(buffer);
-               }
-       } 
-
-
-       osrfLogDebug(OSRF_LOG_MARK, "gateway done mangling post data");
-
-       if( !arg || !arg[0] ) { /* we received no request */
-               return NULL;
-       }
-
-
-       osrfLogDebug(OSRF_LOG_MARK, "parsing URL params from post/get request data: %s", arg);
-       int sanity = 0;
-       while( arg && (val = ap_getword(p, (const char**) &arg, '&'))) {
-
-               key = ap_getword(r->pool, (const char**) &val, '=');
-               if(!key || !key[0])
-                       break;
-
-               ap_unescape_url((char*)key);
-               ap_unescape_url((char*)val);
-
-               osrfLogDebug(OSRF_LOG_MARK, "parsed URL params %s=%s", key, val);
-
-               string_array_add(sarray, key);
-               string_array_add(sarray, val);
-
-               if( sanity++ > 1000 ) {
-                       osrfLogError(OSRF_LOG_MARK, 
-                               "Parsing URL params failed sanity check: 1000 iterations");
-                       string_array_destroy(sarray);
-                       return NULL;
-               }
-
-       }
-
-       if(sarray)
-               osrfLogDebug(OSRF_LOG_MARK, 
-                       "Apache tools parsed %d params key/values", sarray->size / 2 );
-
-       return sarray;
-}
-
-
-
-string_array* apacheGetParamKeys(string_array* params) {
-       if(params == NULL) return NULL; 
-       string_array* sarray    = init_string_array(12); 
-       int i;
-       osrfLogDebug(OSRF_LOG_MARK, "Fetching URL param keys");
-       for( i = 0; i < params->size; i++ ) 
-               string_array_add(sarray, string_array_get_string(params, i++)); 
-       return sarray;
-}
-
-string_array* apacheGetParamValues(string_array* params, char* key) {
-
-       if(params == NULL || key == NULL) return NULL;  
-       string_array* sarray    = init_string_array(12); 
-
-       osrfLogDebug(OSRF_LOG_MARK, "Fetching URL values for key %s", key);
-       int i;
-       for( i = 0; i < params->size; i++ ) {
-               char* nkey = string_array_get_string(params, i++);      
-               if(key && !strcmp(nkey, key)) 
-                       string_array_add(sarray, string_array_get_string(params, i));   
-       }
-       return sarray;
-}
-
-
-char* apacheGetFirstParamValue(string_array* params, char* key) {
-       if(params == NULL || key == NULL) return NULL;  
-
-       int i;
-       osrfLogDebug(OSRF_LOG_MARK, "Fetching first URL value for key %s", key);
-       for( i = 0; i < params->size; i++ ) {
-               char* nkey = string_array_get_string(params, i++);      
-               if(key && !strcmp(nkey, key)) 
-                       return strdup(string_array_get_string(params, i));
-       }
-
-       return NULL;
-}
-
-
-int apacheDebug( char* msg, ... ) {
-       VA_LIST_TO_STRING(msg);
-       fprintf(stderr, "%s\n", VA_BUF);
-       fflush(stderr);
-       return 0;
-}
-
-
-int apacheError( char* msg, ... ) {
-       VA_LIST_TO_STRING(msg);
-       fprintf(stderr, "%s\n", VA_BUF);
-       fflush(stderr);
-       return HTTP_INTERNAL_SERVER_ERROR; 
-}
-
-
-/* taken more or less directly from O'Reillly - Writing Apache Modules in Perl and C */
-/* needs updating...
-apr_table_t* apacheParseCookies(request_rec *r) {
-
-   const char *data = apr_table_get(r->headers_in, "Cookie");
-       osrfLogDebug(OSRF_LOG_MARK, "Loaded cookies: %s", data);
-
-   apr_table_t* cookies;
-   const char *pair;
-   if(!data) return NULL;
-
-   cookies = apr_make_table(r->pool, 4);
-   while(*data && (pair = ap_getword(r->pool, &data, ';'))) {
-       const char *name, *value;
-       if(*data == ' ') ++data;
-       name = ap_getword(r->pool, &pair, '=');
-       while(*pair && (value = ap_getword(r->pool, &pair, '&'))) {
-           ap_unescape_url((char *)value);
-           apr_table_add(cookies, name, value);
-       }
-   }
-
-    return cookies;
-}
-
-*/ 
-
-
diff --git a/OpenSRF/src/gateway/apachetools.h b/OpenSRF/src/gateway/apachetools.h
deleted file mode 100644 (file)
index 3f20c4f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "httpd.h"
-#include "http_config.h"
-#include "http_core.h"
-#include "http_protocol.h"
-//#include "apr_compat.h"
-#include "apr_strings.h"
-#include "apr_reslist.h"
-#include "http_log.h"
-
-
-#include "opensrf/string_array.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-
-#ifndef APACHE_TOOLS_H
-#define APACHE_TOOLS_H
-
-#define APACHE_TOOLS_MAX_POST_SIZE 10485760 /* 10 MB */
-
-
-/* parses apache URL params (GET and POST).  
-       Returns a string_array of the form [ key, val, key, val, ...]
-       Returns NULL if there are no params */
-string_array* apacheParseParms(request_rec* r);
-
-/* provide the params string array, and this will generate a 
-       string of array of param keys 
-       the returned string_array most be freed by the caller
-       */
-string_array* apacheGetParamKeys(string_array* params);
-
-/* provide the params string array and a key name, and 
-       this will provide the value found for that key 
-       the returned string_array most be freed by the caller
-       */
-string_array* apacheGetParamValues(string_array* params, char* key);
-
-/* returns the first value found for the given param.  
-       char* must be freed by the caller */
-char* apacheGetFirstParamValue(string_array* params, char* key);
-
-/* Writes msg to stderr, flushes stderr, and returns 0 */
-int apacheDebug( char* msg, ... );
-
-/* Writes to stderr, flushe stderr, and returns HTTP_INTERNAL_SERVER_ERROR; 
- */
-int apacheError( char* msg, ... );
-
-/*
- * Creates an apache table* of cookie name / value pairs 
- */
-/*
-apr_table_t* apacheParseCookies(request_rec *r);
-*/
-
-
-#endif
diff --git a/OpenSRF/src/gateway/fieldmapper-c-xml-out.pl b/OpenSRF/src/gateway/fieldmapper-c-xml-out.pl
deleted file mode 100755 (executable)
index 5d5555b..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use lib '../perlmods/';
-
-my $map = {};
-eval "
-       use lib '../../../Open-ILS/src/perlmods/';
-       use OpenILS::Utils::Fieldmapper;  
-";
-$map = $Fieldmapper::fieldmap unless ($@);
-
-
-if(!$ARGV[1]) {
-       print "usage: $0 <header_file> <source_file>\n";
-       exit;
-}
-
-warn "Generating fieldmapper-c code...\n";
-
-
-print $ARGV[0] . "\n";
-print $ARGV[1] . "\n";
-
-open(HEADER, ">$ARGV[0]");
-open(SOURCE, ">$ARGV[1]");
-
-warn "Generating fieldmapper-c code...\n";
-
-print HEADER <<C;
-#ifndef _TOXML_H_
-#define _TOXML_H_
-
-char* json_string_to_xml(char*);
-
-#endif
-C
-
-print SOURCE <<C;
-
-#include <string.h>
-
-/* and the JSON parser, so we can read the response we're XMLizing */
-#include <string.h>
-#include <stdio.h>
-#include "opensrf/osrf_json.h"
-#include "opensrf/utils.h"
-
-char* json_string_to_xml(char*);
-void _rest_xml_output(growing_buffer*, object*, char*, int, int);
-char * _lookup_fm_field(char*,int);
-char* _escape_xml (char*);
-
-char* json_string_to_xml(char* content) {
-       object * obj;
-       growing_buffer * res_xml;
-       char * output;
-       int i;
-
-       obj = json_parse_string( content );
-       res_xml = buffer_init(1024);
-
-       if (!obj)
-               return NULL;
-       
-       buffer_add(res_xml, "<response>");
-
-       if(obj->is_array) {
-               for( i = 0; i!= obj->size; i++ ) {
-                       _rest_xml_output(res_xml, obj->get_index(obj,i), NULL, 0,0);
-               }
-       } else {
-               _rest_xml_output(res_xml, obj, NULL, 0,0);
-       }
-
-       buffer_add(res_xml, "</response>");
-
-       output = buffer_data(res_xml);
-       buffer_free(res_xml);
-       free_object(obj);
-
-       return output;
-}
-
-char* _escape_xml (char* text) {
-       char* out;
-       growing_buffer* b = buffer_init(256);
-       int len = strlen(text);
-       int i;
-       for (i = 0; i < len; i++) {
-               if (text[i] == '&')
-                       buffer_add(b,"&amp;");
-               else if (text[i] == '<')
-                       buffer_add(b,"&lt;");
-               else if (text[i] == '>')
-                       buffer_add(b,"&gt;");
-               else
-                       buffer_add_char(b,text[i]);
-       }
-       out = buffer_data(b);
-       buffer_free(b);
-       return out;
-}
-
-void _rest_xml_output(growing_buffer* buf, object* obj, char * fm_class, int fm_index, int notag) {
-       char * tag;
-       int i;
-       
-       if(!obj) return;
-
-       if (obj->classname)
-               notag = 1;
-
-       if(fm_class) {
-               tag = _lookup_fm_field(fm_class,fm_index);
-       } else {
-               tag = strdup("datum");
-       }
-
-        
-   /* add class hints if we have a class name */
-   if(obj->classname) {
-       if(obj->is_null) {
-                       buffer_fadd(buf,"<%s><Object class_hint=\\\"%s\\\"/></%s>", tag, obj->classname, tag);
-                       return;
-               } else {
-                       buffer_fadd(buf,"<%s><Object class_hint=\\\"%s\\\">", tag, obj->classname);
-               }
-       }
-
-
-       /* now add the data */
-       if(obj->is_null) {
-               if (!notag)
-                       buffer_fadd(buf, "<%s/>",tag);
-       } else if(obj->is_bool && obj->bool_value) {
-               if (notag)
-                       buffer_add(buf, "true");
-               else
-                       buffer_fadd(buf, "<%s>true</%s>",tag,tag);
-                
-       } else if(obj->is_bool && ! obj->bool_value) {
-               if (notag)
-                       buffer_add(buf, "false");
-               else
-                       buffer_fadd(buf, "<%s>false</%s>",tag,tag);
-
-       } else if (obj->is_string) {
-               if (notag) {
-                       char * t = _escape_xml(obj->string_data);
-                       buffer_add(buf,t);
-                       free(t);
-               } else {
-                       char * t = _escape_xml(obj->string_data);
-                       buffer_fadd(buf,"<%s>%s</%s>",tag,t,tag);
-                       free(t);
-               }
-
-       } else if(obj->is_number) {
-
-               if (notag)
-                       buffer_fadd(buf,"%ld",obj->num_value);
-               else
-                       buffer_fadd(buf,"<%s>%ld</%s>",tag,obj->num_value,tag);
-
-
-       } else if(obj->is_double) {
-               if (notag)
-                       buffer_fadd(buf,"%f",tag,obj->double_value,tag);
-               else
-                       buffer_fadd(buf,"<%s>%f</%s>",tag,obj->double_value,tag);
-
-
-       } else if (obj->is_array) {
-               if (!notag) {
-                       if(!fm_class)
-                               buffer_add(buf,"<array>");
-                       else
-                                       buffer_fadd(buf,"<%s>",tag);
-               }
-
-               for( i = 0; i!= obj->size; i++ ) {
-                       _rest_xml_output(buf, obj->get_index(obj,i), obj->classname, i,0);
-               }
-
-               if (!notag) {
-                       if(!fm_class)
-                               buffer_add(buf,"</array>");
-                       else
-                                       buffer_fadd(buf,"</%s>",tag);
-               }
-
-        } else if (obj->is_hash) {
-
-               if (!notag) {
-                       if(!fm_class)
-                               buffer_add(buf,"<hash>");
-                       else
-                                       buffer_fadd(buf,"<%s>",tag);
-               }
-
-                object_iterator* itr = new_iterator(obj);
-                object_node* tmp;
-                while( (tmp = itr->next(itr)) ) {
-                       if (notag) {
-                               buffer_fadd(buf,"<%s>",tmp->key);
-                       } else {
-                               buffer_add(buf,"<pair>");
-                               buffer_fadd(buf,"<key>%s</key><value>",tmp->key);
-                       }
-
-                        _rest_xml_output(buf, tmp->item, NULL,0,notag);
-
-                       if (notag) {
-                               buffer_fadd(buf,"</%s>",tmp->key);
-                       } else {
-                               buffer_add(buf,"</value></pair>");
-                       }
-                }
-                free_iterator(itr);
-
-               if (!notag) {
-                       if(!fm_class)
-                               buffer_add(buf,"</hash>");
-                       else
-                                       buffer_fadd(buf,"</%s>",tag);
-               }
-
-       }
-
-       if (obj->classname)
-                buffer_fadd(buf,"</Object></%s>",tag);
-
-       free(tag);
-}
-
-char * _lookup_fm_field(char * class, int pos) {
-
-C
-
-print SOURCE " if (class == NULL) return NULL;";
-
-for my $object (keys %$map) {
-
-       my $short_name                          = $map->{$object}->{hint};
-
-       print SOURCE <<"        C";
-
-       else if (!strcmp(class, "$short_name")) {
-               switch (pos) {
-       C
-
-       for my $field (keys %{$map->{$object}->{fields}}) {
-               my $position = $map->{$object}->{fields}->{$field}->{position};
-
-               print SOURCE <<"                C";
-                       case $position:
-                               return strdup("$field");
-                               break;
-               C
-       }
-       print SOURCE "          }\n";
-       print SOURCE "  }\n";
-}
-print SOURCE ' return strdup("datum");'."\n";
-print SOURCE "}\n";
-
-close HEADER;
-close SOURCE;
-
-warn  "done\n";
-
diff --git a/OpenSRF/src/gateway/osrf_json_gateway.c b/OpenSRF/src/gateway/osrf_json_gateway.c
deleted file mode 100644 (file)
index 27ce454..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-#include "apachetools.h"
-#include "opensrf/osrf_app_session.h"
-#include "opensrf/osrf_system.h"
-#include "opensrf/osrfConfig.h"
-#include "opensrf/osrf_json.h"
-#include "../libstack/legacy_json.h"
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <unistd.h>
-
-
-#define MODULE_NAME "osrf_json_gateway_module"
-#define GATEWAY_CONFIG "OSRFGatewayConfig"
-#define JSON_PROTOCOL "OSRFGatewayJSONProtocol"
-#define CONFIG_CONTEXT "gateway"
-
-#define GATEWAY_DEFAULT_CONFIG "/openils/conf/opensrf_core.xml"
-#define GATEWAY_DEFAULT_PROTOCOL "wrapper"  // other option is "classy"
-
-
-/* our config structure */
-typedef struct { 
-       char* configfile;  /* our bootstrap config file */
-} osrf_json_gateway_config;
-
-
-typedef struct { 
-       char* JSONProtocol;
-} osrf_json_gateway_dir_config;
-
-module AP_MODULE_DECLARE_DATA osrf_json_gateway_module;
-
-char* osrf_json_gateway_config_file = NULL;
-int bootstrapped = 0;
-int numserved = 0;
-osrfStringArray* allowedServices = NULL;
-
-static const char* osrf_json_gateway_set_config(cmd_parms *parms, void *config, const char *arg) {
-       osrf_json_gateway_config  *cfg;
-       cfg = ap_get_module_config(parms->server->module_config, &osrf_json_gateway_module);
-       cfg->configfile = (char*) arg;
-       osrf_json_gateway_config_file = (char*) arg;
-       return NULL;
-}
-
-static const char* osrf_json_gateway_set_json_proto(cmd_parms *parms, void *config, const char *arg) {
-       osrf_json_gateway_dir_config* cfg = (osrf_json_gateway_dir_config*) config;
-       cfg->JSONProtocol = (char*) arg;
-       return NULL;
-}
-
-/* tell apache about our commands */
-static const command_rec osrf_json_gateway_cmds[] = {
-       AP_INIT_TAKE1( GATEWAY_CONFIG, osrf_json_gateway_set_config, 
-                       NULL, RSRC_CONF, "osrf json gateway config file"),
-       AP_INIT_TAKE1( JSON_PROTOCOL, osrf_json_gateway_set_json_proto,
-                       NULL, ACCESS_CONF, "osrf json gateway config file"),
-       {NULL}
-};
-
-/* build the config object */
-static void* osrf_json_gateway_create_config( apr_pool_t* p, server_rec* s) {
-       osrf_json_gateway_config* cfg = (osrf_json_gateway_config*) 
-                       apr_palloc(p, sizeof(osrf_json_gateway_config));
-       cfg->configfile = GATEWAY_DEFAULT_CONFIG;
-       return (void*) cfg;
-}
-
-static void* osrf_json_gateway_create_dir_config( apr_pool_t* p, char* dir) {
-       osrf_json_gateway_dir_config* cfg = (osrf_json_gateway_dir_config*) 
-                       apr_palloc(p, sizeof(osrf_json_gateway_dir_config));
-       cfg->JSONProtocol = GATEWAY_DEFAULT_PROTOCOL;
-       return (void*) cfg;
-}
-
-
-static void osrf_json_gateway_child_init(apr_pool_t *p, server_rec *s) {
-
-       char* cfg = osrf_json_gateway_config_file;
-       char buf[32];
-       memset(buf, 0x0, 32);
-       int t = time(NULL);
-       snprintf(buf, 32, "%d", t);
-
-       if( ! osrfSystemBootstrapClientResc( cfg, CONFIG_CONTEXT, buf ) ) {
-               ap_log_error( APLOG_MARK, APLOG_ERR, 0, s, 
-                       "Unable to Bootstrap OpenSRF Client with config %s..", cfg);
-               return;
-       }
-
-       bootstrapped = 1;
-       allowedServices = osrfNewStringArray(8);
-       osrfLogInfo(OSRF_LOG_MARK, "Bootstrapping gateway child for requests");
-       osrfConfigGetValueList( NULL, allowedServices, "/services/service" );
-
-       int i;
-       for( i = 0; i < allowedServices->size; i++ ) {
-               ap_log_error( APLOG_MARK, APLOG_DEBUG, 0, s, 
-                       "allowed service: %s\n", osrfStringArrayGetString(allowedServices, i));
-       }
-}
-
-static int osrf_json_gateway_method_handler (request_rec *r) {
-
-       /* make sure we're needed first thing*/
-       if (strcmp(r->handler, MODULE_NAME )) return DECLINED;
-
-    /* XXX */
-       osrf_json_gateway_dir_config* dir_conf =  
-               ap_get_module_config(r->per_dir_config, &osrf_json_gateway_module);
-
-       ap_log_rerror( APLOG_MARK, APLOG_INFO, 0, r, "JSON protocol = %s", dir_conf->JSONProtocol);
-
-       /* provide 2 different JSON parsers and serializers to support legacy JSON */
-       jsonObject* (*parseJSONFunc) (char*) = legacy_jsonParseString;
-       char* (*jsonToStringFunc) (const jsonObject*) = legacy_jsonObjectToJSON;
-
-       if(dir_conf->JSONProtocol && !strcmp(dir_conf->JSONProtocol,"wrapper") ) {
-               /* if protocol is wrapper, use the new wrapper JSON code */
-               ap_log_rerror( APLOG_MARK, APLOG_INFO, 0, r, "Using wrapper JSON");
-               parseJSONFunc = jsonParseString;
-               jsonToStringFunc = jsonObjectToJSON;
-       }
-    /* XXX */
-
-
-       osrfLogDebug(OSRF_LOG_MARK, "osrf gateway: entered request handler");
-
-       /* verify we are connected */
-       if( !bootstrapped || !osrf_system_get_transport_client()) {
-               ap_log_rerror( APLOG_MARK, APLOG_ERR, 0, r, "Cannot process request "
-                               "because the OpenSRF JSON gateway has not been bootstrapped...");
-               usleep( 100000 ); /* 100 milliseconds */
-               exit(1);
-       }
-
-       osrfLogSetAppname("osrf_json_gw");
-
-       char* service           = NULL; /* service to connect to */
-       char* method            = NULL; /* method to perform */
-       char* format            = NULL; /* method to perform */
-       char* a_l                       = NULL; /* request api level */
-       int   isXML                     = 0;
-       int   api_level = 1;
-
-       r->allowed |= (AP_METHOD_BIT << M_GET);
-       r->allowed |= (AP_METHOD_BIT << M_POST);
-
-       osrfLogDebug(OSRF_LOG_MARK, "osrf gateway: parsing URL params");
-       string_array* mparams   = NULL;
-       string_array* params            = apacheParseParms(r); /* free me */
-       service         = apacheGetFirstParamValue( params, "service" );
-       method          = apacheGetFirstParamValue( params, "method" ); 
-       format          = apacheGetFirstParamValue( params, "format" ); 
-       a_l                     = apacheGetFirstParamValue( params, "api_level" ); 
-       mparams         = apacheGetParamValues( params, "param" ); /* free me */
-
-   /* set the user defined timeout value */
-   int timeout = 60;
-   char* tout = apacheGetFirstParamValue( params, "timeout" ); /* request timeout in seconds */
-   if( tout ) {
-      timeout = atoi(tout);
-      osrfLogDebug(OSRF_LOG_MARK, "Client supplied timeout of %d", timeout);
-   }
-
-
-       if (a_l)
-               api_level = atoi(a_l);
-
-       if (format && !strcasecmp(format, "xml" )) {
-               isXML = 1;
-               ap_set_content_type(r, "application/xml");
-       } else {
-               ap_set_content_type(r, "text/plain");
-       }
-
-       int ret = OK;
-
-       if(!(service && method) || 
-               !osrfStringArrayContains(allowedServices, service)) {
-
-               osrfLogError(OSRF_LOG_MARK, 
-                       "Service [%s] not found or not allowed", service);
-               ret = HTTP_NOT_FOUND;
-
-       } else {
-
-               /* This will log all heaers to the apache error log 
-               const apr_array_header_t* arr = apr_table_elts(r->headers_in);
-               const void* ptr;
-
-               while( (ptr = apr_array_pop(arr)) ) {
-                       apr_table_entry_t* e = (apr_table_entry_t*) ptr;
-                       fprintf(stderr, "Table entry: %s : %s\n", e->key, e->val );
-               }
-               fflush(stderr);
-               */
-
-               osrfAppSession* session = osrf_app_client_session_init(service);
-
-               double starttime = get_timestamp_millis();
-               int req_id = osrf_app_session_make_req( session, NULL, method, api_level, mparams );
-
-
-               if( req_id == -1 ) {
-                       osrfLogError(OSRF_LOG_MARK, "I am unable to communcate with opensrf..going away...");
-                       /* we don't want to spawn an intense re-forking storm 
-                        * if there is no jabber server.. so give it some time before we die */
-                       usleep( 100000 ); /* 100 milliseconds */
-                       exit(1);
-               }
-
-
-               /* ----------------------------------------------------------------- */
-               /* log all requests to the activity log */
-               const char* authtoken = apr_table_get(r->headers_in, "X-OILS-Authtoken");
-               if(!authtoken) authtoken = "";
-               growing_buffer* act = buffer_init(128); 
-               buffer_fadd(act, "[%s] [%s] %s %s", r->connection->remote_ip, authtoken, service, method );
-               char* str; int i = 0;
-               while( (str = osrfStringArrayGetString(mparams, i++)) ) {
-                       if( i == 1 ) {
-                OSRF_BUFFER_ADD(act, " ");
-                               OSRF_BUFFER_ADD(act, str);
-                       } else {
-                               OSRF_BUFFER_ADD(act, ", ");
-                               OSRF_BUFFER_ADD(act, str);
-                       }
-               }
-
-               osrfLogActivity( OSRF_LOG_MARK, act->buf );
-               buffer_free(act);
-               /* ----------------------------------------------------------------- */
-
-
-               osrf_message* omsg = NULL;
-
-               int statuscode = 200;
-
-               /* kick off the object */
-               if (isXML)
-                       ap_rputs("<response xmlns=\"http://opensrf.org/-/namespaces/gateway/v1\"><payload>", r);
-               else
-                       ap_rputs("{\"payload\":[", r);
-
-               int morethan1           = 0;
-               char* statusname        = NULL;
-               char* statustext        = NULL;
-               char* output            = NULL;
-
-               while((omsg = osrfAppSessionRequestRecv( session, req_id, timeout ))) {
-       
-                       statuscode = omsg->status_code;
-                       jsonObject* res;        
-
-                       if( ( res = osrfMessageGetResult(omsg)) ) {
-
-                               if (isXML) {
-                                       output = jsonObjectToXML( res );
-                               } else {
-                                       //output = jsonObjectToJSON( res );
-                    output = jsonToStringFunc( res );
-                                       if( morethan1 ) ap_rputs(",", r); /* comma between JSON array items */
-                               }
-                               ap_rputs(output, r);
-                               free(output);
-                               morethan1 = 1;
-               
-                       } else {
-       
-                               if( statuscode > 299 ) { /* the request returned a low level error */
-                                       statusname = omsg->status_name ? strdup(omsg->status_name) : strdup("Unknown Error");
-                                       statustext = omsg->status_text ? strdup(omsg->status_text) : strdup("No Error Message");
-                                       osrfLogError( OSRF_LOG_MARK,  "Gateway received error: %s", statustext );
-                               }
-                       }
-       
-                       osrf_message_free(omsg);
-                       if(statusname) break;
-               }
-
-               double duration = get_timestamp_millis() - starttime;
-               osrfLogDebug(OSRF_LOG_MARK, "gateway request took %f seconds", duration);
-
-
-               if (isXML)
-                       ap_rputs("</payload>", r);
-               else
-                       ap_rputs("]",r); /* finish off the payload array */
-
-               if(statusname) {
-
-                       /* add a debug field if the request died */
-                       ap_log_rerror( APLOG_MARK, APLOG_INFO, 0, r, 
-                                       "OpenSRF JSON Request returned error: %s -> %s", statusname, statustext );
-                       int l = strlen(statusname) + strlen(statustext) + 32;
-                       char buf[l];
-                       bzero(buf,l);
-
-                       if (isXML)
-                               snprintf( buf, l, "<debug>\"%s : %s\"</debug>", statusname, statustext );
-
-                       else {
-                               char bb[l];
-                               bzero(bb, l);
-                               snprintf(bb, l,  "%s : %s", statusname, statustext);
-                               jsonObject* tmp = jsonNewObject(bb);
-                               //char* j = jsonObjectToJSON(tmp);
-                char* j = jsonToStringFunc(tmp);
-                               snprintf( buf, l, ",\"debug\": %s", j);
-                               free(j);
-                               jsonObjectFree(tmp);
-                       }
-
-                       ap_rputs(buf, r);
-
-                       free(statusname);
-                       free(statustext);
-               }
-
-               /* insert the status code */
-               char buf[32];
-               bzero(buf,32);
-
-               if (isXML)
-                       snprintf(buf, 32, "<status>%d</status>", statuscode );
-               else
-                       snprintf(buf, 32, ",\"status\":%d", statuscode );
-
-               ap_rputs( buf, r );
-
-               if (isXML)
-                       ap_rputs("</response>", r);
-               else
-                       ap_rputs( "}", r ); /* finish off the object */
-
-               osrf_app_session_destroy(session);
-       }
-
-       osrfLogInfo(OSRF_LOG_MARK, "Completed processing service=%s, method=%s", service, method);
-       string_array_destroy(params);
-       string_array_destroy(mparams);
-
-       osrfLogDebug(OSRF_LOG_MARK, "Gateway served %d requests", ++numserved);
-   osrfLogClearXid();
-
-       return ret;
-}
-
-
-
-static void osrf_json_gateway_register_hooks (apr_pool_t *p) {
-       ap_hook_handler(osrf_json_gateway_method_handler, NULL, NULL, APR_HOOK_MIDDLE);
-       ap_hook_child_init(osrf_json_gateway_child_init,NULL,NULL,APR_HOOK_MIDDLE);
-}
-
-
-module AP_MODULE_DECLARE_DATA osrf_json_gateway_module = {
-       STANDARD20_MODULE_STUFF,
-       osrf_json_gateway_create_dir_config,
-       /*NULL,*/
-       NULL,
-       osrf_json_gateway_create_config,
-       NULL,
-       osrf_json_gateway_cmds,
-       osrf_json_gateway_register_hooks,
-};
-
-
-
-
diff --git a/OpenSRF/src/java/Makefile b/OpenSRF/src/java/Makefile
deleted file mode 100644 (file)
index 67891e7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#JAVA_LIBS = .:lib:ext/json-jdk1.5-2007-05-01.jar:ext/wstx-asl-3.2.1.jar:ext/stax-api-1.0.1.jar:ext/xercesImpl-1.4.4-2.jar
-JAVA_LIBDIR = .lib
-JAVAC=javac -J-Xmx256m
-JAVA=java -Xmx256m 
-JAVA_LIBS = .:$(JAVA_LIBDIR):ext/json-jdk1.5-2007-05-01.jar:ext/wstx-asl-3.2.1.jar:ext/stax-api-1.0.1.jar
-JAVA_SRC = \
-       org/opensrf/net/xmpp/*.java \
-       org/opensrf/util/*.java \
-       org/opensrf/*.java \
-       org/opensrf/test/*.java 
-
-all:
-       mkdir -p $(JAVA_LIBDIR)
-       $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 
-
-# only prints the first 30 lines of errors
-slim:
-       mkdir -p $(JAVA_LIBDIR)
-       $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
-       @echo -e "\nTruncating at 30 lines"
-
-check:
-       mkdir -p $(JAVA_LIBDIR)
-       $(JAVAC) -Xlint:unchecked -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 | head -n 30
-       @echo -e "\nTruncating at 30 lines"
-
-run:
-       $(JAVA) -cp $(JAVA_LIBS) $(JAVA_EXE) $(JAVA_ARGS)
-
-docs:
-       find . -name *.java > files;
-       javadoc -classpath $(JAVA_LIBS) -d doc @files;
-       rm files;
-
-clean:
-       rm -r $(JAVA_LIBDIR)
-       
-
-
diff --git a/OpenSRF/src/java/ext/stax-api-1.0.1.jar b/OpenSRF/src/java/ext/stax-api-1.0.1.jar
deleted file mode 100644 (file)
index 162b3fb..0000000
Binary files a/OpenSRF/src/java/ext/stax-api-1.0.1.jar and /dev/null differ
diff --git a/OpenSRF/src/java/ext/wstx-asl-3.2.1.jar b/OpenSRF/src/java/ext/wstx-asl-3.2.1.jar
deleted file mode 100644 (file)
index 581f825..0000000
Binary files a/OpenSRF/src/java/ext/wstx-asl-3.2.1.jar and /dev/null differ
diff --git a/OpenSRF/src/java/org/opensrf/ClientSession.java b/OpenSRF/src/java/org/opensrf/ClientSession.java
deleted file mode 100644 (file)
index 09cfce1..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.opensrf;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.Random;
-import java.util.Arrays;
-
-import org.opensrf.util.*;
-
-
-/**
- * Models an OpenSRF client session.
- */
-public class ClientSession extends Session {
-
-    /** The remote service to communicate with */
-    private String service;
-    /** OpenSRF domain */
-    private String domain;
-    /** Router name */
-    private String router;
-
-    /** 
-     * original remote node.  The current remote node will change based 
-     * on server responses.  This is used to reset the remote node to 
-     * its original state.
-     */
-    private String origRemoteNode;
-    /** The next request id */
-    private int nextId;
-    /** The requests this session has sent */
-    private Map<Integer, Request> requests;
-
-    /**
-     * Creates a new client session.  Initializes the 
-     * @param service The remove service.
-     */
-    public ClientSession(String service) throws ConfigException {
-        this.service = service;
-
-        /** generate the remote node string */
-        domain = (String) Config.getFirst("/domains/domain");
-        router = Config.getString("/router_name");
-        setRemoteNode(router + "@" + domain + "/" + service);
-        origRemoteNode = getRemoteNode();
-
-
-        /** create a random thread */
-        long time = new Date().getTime();
-        Random rand = new Random(time);
-        setThread(rand.nextInt()+""+rand.nextInt()+""+time);
-
-        nextId = 0;
-        requests = new HashMap<Integer, Request>();
-        cacheSession();
-    }
-
-    /**
-     * Creates a new request to send to our remote service.
-     * @param method The method API name
-     * @param params The list of method parameters
-     * @return The request object.
-     */
-    public Request request(String method, List<Object> params) throws SessionException {
-        return request(new Request(this, nextId++, method, params));
-    }
-
-    /**
-     * Creates a new request to send to our remote service.
-     * @param method The method API name
-     * @param params The list of method parameters
-     * @return The request object.
-     */
-    public Request request(String method, Object[] params) throws SessionException {
-        return request(new Request(this, nextId++, method, Arrays.asList(params)));
-    }
-
-
-    /**
-     * Creates a new request to send to our remote service.
-     * @param method The method API name
-     * @return The request object.
-     */
-    public Request request(String method) throws SessionException {
-        return request(new Request(this, nextId++, method));
-    }
-
-
-    private Request request(Request req) throws SessionException {
-        if(getConnectState() != ConnectState.CONNECTED)
-            resetRemoteId();
-        requests.put(new Integer(req.getId()), req);
-        req.send();
-        return req;
-    }
-
-
-    /**
-     * Resets the remoteNode to its original state.
-     */
-    public void resetRemoteId() {
-        setRemoteNode(origRemoteNode);
-    }
-
-
-    /**
-     * Pushes a response onto the result queue of the appropriate request.
-     * @param msg The received RESULT Message
-     */
-    public void pushResponse(Message msg) {
-
-        Request req = requests.get(new Integer(msg.getId()));
-        if(req == null) {
-            /** LOG that we've received a result to a non-existant request */
-            return;
-        }
-        OSRFObject payload = (OSRFObject) msg.get("payload");
-
-        /** build a result and push it onto the request's result queue */
-        req.pushResponse(
-            new Result( 
-                payload.getString("status"), 
-                payload.getInt("statusCode"),
-                payload.get("content")
-            )
-        );
-    }
-
-    /**
-     * Removes a request for this session's request set
-     */
-    public void cleanupRequest(int reqId) {
-        requests.remove(new Integer(reqId));
-    }
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/Message.java b/OpenSRF/src/java/org/opensrf/Message.java
deleted file mode 100644 (file)
index fd8ad8c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.opensrf;
-import org.opensrf.util.*;
-
-
-public class Message implements OSRFSerializable {
-
-    /** Message types */
-    public static final String REQUEST = "REQUEST";
-    public static final String STATUS = "STATUS";
-    public static final String RESULT = "RESULT";
-    public static final String CONNECT = "CONNECT";
-    public static final String DISCONNECT = "DISCONNECT";
-
-    /** Message ID.  This number is used to relate requests to responses */
-    private int id;
-    /** type of message. */
-    private String type;
-    /** message payload */
-    private Object payload;
-
-    /** Create a registry for the osrfMessage object */
-    private static OSRFRegistry registry = 
-        OSRFRegistry.registerObject(
-            "osrfMessage", 
-            OSRFRegistry.WireProtocol.HASH, 
-            new String[] {"threadTrace", "type", "payload"});
-
-    /**
-     * @param id This message's ID
-     * @param type The type of message
-     */
-    public Message(int id, String type) {
-        setId(id);
-        setString(type);
-    }
-
-    /**
-     * @param id This message's ID
-     * @param type The type of message
-     * @param payload The message payload
-     */
-    public Message(int id, String type, Object payload) {
-        this(id, type);
-        setPayload(payload);
-    }
-
-
-    public int getId() {
-        return id;
-    }   
-    public String getType() {
-        return type;
-    }
-    public Object getPayload() {
-        return payload;
-    }
-    public void setId(int id) {
-        this.id = id;
-    }
-    public void setString(String type) {
-        this.type = type;
-    }
-    public void setPayload(Object p) {
-        payload = p;
-    }
-
-    /**
-     * Implements the generic get() API required by OSRFSerializable
-     */
-    public Object get(String field) {
-        if("threadTrace".equals(field))
-            return getId();
-        if("type".equals(field))
-            return getType().toString();
-        if("payload".equals(field))
-            return getPayload();
-        return null;
-    }
-
-    /**
-     * @return The osrfMessage registry.
-     */
-    public OSRFRegistry getRegistry() {
-        return registry;
-    }
-}
-
-
diff --git a/OpenSRF/src/java/org/opensrf/Method.java b/OpenSRF/src/java/org/opensrf/Method.java
deleted file mode 100644 (file)
index b708d4f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.opensrf;
-import java.util.List;
-import java.util.ArrayList;
-import org.opensrf.util.*;
-
-
-public class Method extends OSRFObject {
-
-    /** The method API name */
-    private String name;
-    /** The ordered list of method params */
-    private List<Object> params;
-
-    /** Create a registry for the osrfMethod object */
-    private static OSRFRegistry registry = 
-        OSRFRegistry.registerObject(
-            "osrfMethod", 
-            OSRFRegistry.WireProtocol.HASH, 
-            new String[] {"method", "params"});
-
-    /**
-     * @param name The method API name 
-     */
-    public Method(String name) {
-        this.name = name;
-        this.params = new ArrayList<Object>(8);
-    }
-
-    /**
-     * @param name The method API name
-     * @param params The ordered list of params
-     */
-    public Method(String name, List<Object> params) {
-        this.name = name;
-        this.params = params;
-    }
-
-    /**
-     * @return The method API name
-     */
-    public String getName() {
-        return name;
-    }
-    /**
-     * @return The ordered list of params
-     */
-    public List<Object> getParams() {
-       return params; 
-    }
-
-    /**
-     * Pushes a new param object onto the set of params 
-     * @param p The new param to add to the method.
-     */
-    public void addParam(Object p) {
-        this.params.add(p);
-    }
-
-    /**
-     * Implements the generic get() API required by OSRFSerializable
-     */
-    public Object get(String field) {
-        if("method".equals(field))
-            return getName();
-        if("params".equals(field))
-            return getParams();
-        return null;
-    }
-
-    /**
-     * @return The osrfMethod registry.
-     */
-    public OSRFRegistry getRegistry() {
-        return registry;
-    }
-
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/MethodException.java b/OpenSRF/src/java/org/opensrf/MethodException.java
deleted file mode 100644 (file)
index bf47313..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.opensrf;
-
-/**
- * Thrown when the server responds with a method exception.
- */
-public class MethodException extends Exception {
-    public MethodException(String info) {
-        super(info);
-    }
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/Request.java b/OpenSRF/src/java/org/opensrf/Request.java
deleted file mode 100644 (file)
index 001ce43..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.opensrf;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.List;
-import java.util.Date;
-import org.opensrf.net.xmpp.XMPPException;
-
-public class Request {
-    
-    /** This request's controlling session */
-    private ClientSession session;
-    /** The method */
-    private Method method;
-    /** The ID of this request */
-    private int id;
-    /** Queue of Results */
-    private Queue<Result> resultQueue;
-    /** If true, the receive timeout for this request should be reset */
-    private boolean resetTimeout;
-
-    /** If true, the server has indicated that this request is complete. */
-    private boolean complete;
-
-    /**
-     * @param ses The controlling session for this request.
-     * @param id This request's ID.
-     * @param method The requested method.
-     */
-    public Request(ClientSession ses, int id, Method method) {
-        this.session = ses;
-        this.id = id;
-        this.method = method;
-        resultQueue = new ConcurrentLinkedQueue<Result>();
-        complete = false;
-        resetTimeout = false;
-    }
-
-    /**
-     * @param ses The controlling session for this request.
-     * @param id This request's ID.
-     * @param methodName The requested method's API name.
-     */
-    public Request(ClientSession ses, int id, String methodName) {
-        this(ses, id, new Method(methodName));
-    }
-
-    /**
-     * @param ses The controlling session for this request.
-     * @param id This request's ID.
-     * @param methodName The requested method's API name.
-     * @param params The list of request params
-     */
-    public Request(ClientSession ses, int id, String methodName, List<Object> params) {
-        this(ses, id, new Method(methodName, params));
-    }
-
-    /**
-     * Sends the request to the server.
-     */
-    public void send() throws SessionException {
-        session.send(new Message(id, Message.REQUEST, method));
-    }
-
-    /**
-     * Receives the next result for this request.  This method
-     * will wait up to the specified number of milliseconds for 
-     * a response. 
-     * @param millis Number of milliseconds to wait for a result.  If
-     * negative, this method will wait indefinitely.
-     * @return The result or null if none arrives in time
-     */
-    public Result recv(long millis) throws SessionException {
-
-        Result result = null;
-
-        if(millis < 0) {
-            /** wait potentially forever for a result to arrive */
-            session.waitForMessage(millis);
-            if((result = resultQueue.poll()) != null)
-                return result;
-
-        } else {
-
-            while(millis >= 0) {
-
-                /** wait up to millis milliseconds for a result.  waitForMessage() 
-                 * will return if a response to any request arrives, so we keep track
-                 * of how long we've been waiting in total for a response to 
-                 * this request
-                 */
-                long start = new Date().getTime();
-                session.waitForMessage(millis);
-                millis -= new Date().getTime() - start;
-                if((result = resultQueue.poll()) != null)
-                    return result;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Pushes a result onto the result queue 
-     * @param result The result to push
-     */
-    public void pushResponse(Result result) {
-        resultQueue.offer(result);
-    }
-
-    /**
-     * @return This request's ID
-     */
-    public int getId() {
-        return id;
-    }
-
-    /**
-     * Removes this request from the controlling session's request set
-     */
-    public void cleanup() {
-        session.cleanupRequest(id);
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/Result.java b/OpenSRF/src/java/org/opensrf/Result.java
deleted file mode 100644 (file)
index 80b71dd..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.opensrf;
-import org.opensrf.util.*;
-
-
-/**
- * Models a single result from a method request.
- */
-public class Result implements OSRFSerializable {
-
-    /** Method result content */
-    private Object content;
-    /** Name of the status */
-    private String status;
-    /** Status code number */
-    private int statusCode;
-
-
-    /** Register this object */
-    private static OSRFRegistry registry = 
-        OSRFRegistry.registerObject(
-            "osrfResult", 
-            OSRFRegistry.WireProtocol.HASH, 
-            new String[] {"status", "statusCode", "content"});
-
-
-    /**
-     * @param status The status message for this result
-     * @param statusCode The status code
-     * @param content The content of the result
-     */
-    public Result(String status, int statusCode, Object content) {
-        this.status = status;
-        this.statusCode = statusCode;
-        this.content = content;
-    }
-    
-    /**
-     * Get status.
-     * @return status as String.
-     */
-    public String getStatus() {
-        return status;
-    }
-    
-    /**
-     * Set status.
-     * @param status the value to set.
-     */
-    public void setStatus(String status) {
-        this.status = status;
-    }
-    
-    /**
-     * Get statusCode.
-     * @return statusCode as int.
-     */
-    public int getStatusCode() {
-        return statusCode;
-    }
-    
-    /**
-     * Set statusCode.
-     * @param statusCode the value to set.
-     */
-    public void setStatusCode(int statusCode) {
-        this.statusCode = statusCode;
-    }
-    
-    /**
-     * Get content.
-     * @return content as Object.
-     */
-    public Object getContent() {
-        return content;
-    }
-    
-    /**
-     * Set content.
-     * @param content the value to set.
-     */
-    public void setContent(Object content) {
-        this.content = content;
-    }
-
-    /**
-     * Implements the generic get() API required by OSRFSerializable
-     */
-    public Object get(String field) {
-        if("status".equals(field))
-            return getStatus();
-        if("statusCode".equals(field))
-            return getStatusCode();
-        if("content".equals(field))
-            return getContent();
-        return null;
-    }
-
-    /**
-     * @return The osrfMethod registry.
-     */
-    public OSRFRegistry getRegistry() {
-        return registry;
-    }
-
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/ServerSession.java b/OpenSRF/src/java/org/opensrf/ServerSession.java
deleted file mode 100644 (file)
index 62e5133..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.opensrf;
-
-/**
- * Models an OpenSRF server session.
- */
-public class ServerSession extends Session {
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/Session.java b/OpenSRF/src/java/org/opensrf/Session.java
deleted file mode 100644 (file)
index 3dc81f9..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.opensrf;
-import org.opensrf.util.JSONWriter;
-import org.opensrf.net.xmpp.*;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Arrays;
-
-public abstract class Session {
-
-    /** Represents the different connection states for a session */
-    public enum ConnectState {
-        DISCONNECTED,
-        CONNECTING,
-        CONNECTED
-    };
-
-    /** local cache of existing sessions */
-    private static Map<String, Session> 
-        sessionCache = new HashMap<String, Session>();
-
-    /** the current connection state */
-    private ConnectState connectState;
-
-    /** The address of the remote party we are communicating with */
-    private String remoteNode;
-
-    /** 
-     * The thread is used to link messages to a given session. 
-     * In other words, each session has a unique thread, and all messages 
-     * in that session will carry this thread around as an indicator.
-     */
-    private String thread;
-
-    public Session() {
-        connectState = ConnectState.DISCONNECTED;
-    }
-    
-    /**
-     * Sends a Message to our remoteNode.
-     */
-    public void send(Message omsg) throws SessionException {
-
-        /** construct the XMPP message */
-        XMPPMessage xmsg = new XMPPMessage();
-        xmsg.setTo(remoteNode);
-        xmsg.setThread(thread);
-        xmsg.setBody(new JSONWriter(Arrays.asList(new Message[] {omsg})).write());
-        XMPPSession ses = XMPPSession.getGlobalSession();
-
-        try {
-            XMPPSession.getGlobalSession().send(xmsg);
-        } catch(XMPPException e) {
-            connectState = ConnectState.DISCONNECTED;
-            throw new SessionException("Error sending message to " + remoteNode, e);
-        }
-    }
-
-    /**
-     * Waits for a message to arrive over the network and passes
-     * all received messages to the stack for processing
-     * @param millis The number of milliseconds to wait for a message to arrive
-     */
-    public static void waitForMessage(long millis) throws SessionException {
-        try {
-            Stack.processXMPPMessage(
-                XMPPSession.getGlobalSession().recv(millis));
-        } catch(XMPPException e) {
-            throw new SessionException("Error waiting for message", e);
-        }
-    }
-
-    /**
-     * Removes this session from the session cache.
-     */
-    public void cleanup() {
-        sessionCache.remove(thread);
-    }
-
-    /**
-     * Searches for the cached session with the given thread.
-     * @param thread The session thread.
-     * @return The found session or null.
-     */
-    public static Session findCachedSession(String thread) {
-        return sessionCache.get(thread);
-    }
-
-    /**
-     * Puts this session into session cache.
-     */
-    protected void cacheSession() {
-        sessionCache.put(thread, this);
-    }
-
-    /**
-     * Sets the remote address
-     * @param nodeName The name of the remote node.
-     */
-    public void setRemoteNode(String nodeName) {
-        remoteNode = nodeName;
-    }
-    /**
-     * @return The remote node
-     */
-    public String getRemoteNode() {
-        return remoteNode;
-    }
-
-
-    /**
-     * Get thread.
-     * @return thread as String.
-     */
-    public String getThread() {
-        return thread;
-    }
-    
-    /**
-     * Set thread.
-     * @param thread the value to set.
-     */
-    public void setThread(String thread) {
-        this.thread = thread;
-    }
-    
-    /**
-     * Get connectState.
-     * @return connectState as ConnectState.
-     */
-    public ConnectState getConnectState() {
-        return connectState;
-    }
-    
-    /**
-     * Set connectState.
-     * @param connectState the value to set.
-     */
-    public void setConnectState(ConnectState connectState) {
-        this.connectState = connectState;
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/Stack.java b/OpenSRF/src/java/org/opensrf/Stack.java
deleted file mode 100644 (file)
index 6db285e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.opensrf;
-import org.opensrf.net.xmpp.XMPPMessage;
-import org.opensrf.util.*;
-import java.util.Date;
-import java.util.List;
-import java.util.Iterator;
-
-
-public class Stack {
-
-    public static void processXMPPMessage(XMPPMessage msg) {
-
-        if(msg == null) return;
-
-        /** fetch this session from the cache */
-        Session ses = Session.findCachedSession(msg.getThread());
-
-        if(ses == null) {
-            /** inbound client request, create a new server session */
-            return;
-        }
-
-        /** parse the JSON message body, which should result in a list of OpenSRF messages */
-        List msgList; 
-
-        try {
-            msgList = new JSONReader(msg.getBody()).readArray();
-        } catch(JSONException e) {
-            /** XXX LOG error */
-            e.printStackTrace();
-            return;
-        }
-
-        Iterator itr = msgList.iterator();
-
-        OSRFObject obj = null;
-        long start = new Date().getTime();
-
-        /** cycle through the messages and push them up the stack */
-        while(itr.hasNext()) {
-
-            /** Construct a Message object from the parsed generic OSRFObject */
-            obj = (OSRFObject) itr.next();
-
-            processOSRFMessage(
-                ses, 
-                new Message(
-                    obj.getInt("threadTrace"),
-                    obj.getString("type"),
-                    obj.get("payload")
-                )
-            );
-        }
-
-        /** LOG the duration */
-    }
-
-    private static void processOSRFMessage(Session ses, Message msg) {
-        if( ses instanceof ClientSession ) 
-            processResponse((ClientSession) ses, msg);
-        else
-            processRequest((ServerSession) ses, msg);
-    }
-
-    /** 
-     * Process a server response
-     */
-    private static void processResponse(ClientSession session, Message msg) {
-        if(msg.RESULT.equals(msg.getType())) {
-            session.pushResponse(msg);
-            return;
-        }
-    }
-
-    /**
-     * Process a client request
-     */
-    private static void processRequest(ServerSession session, Message msg) {
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPException.java b/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPException.java
deleted file mode 100644 (file)
index 8c20ab7..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.opensrf.net.xmpp;
-
-/**
- * Used for XMPP stream/authentication errors
- */
-public class XMPPException extends Exception {
-    public XMPPException(String info) {
-        super(info);
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPMessage.java b/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPMessage.java
deleted file mode 100644 (file)
index b6e2c76..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.opensrf.net.xmpp;
-
-import java.io.*;
-
-/**
- * Models a single XMPP message.
- */
-public class XMPPMessage {
-
-    /** Message body */
-    private String body;
-    /** Message recipient */
-    private String to;
-    /** Message sender */
-    private String from;
-    /** Message thread */
-    private String thread;
-    /** Message xid */
-    private String xid;
-
-    public XMPPMessage() {
-    }
-
-    public String getBody() {
-        return body;
-    }
-    public String getTo() { 
-        return to; 
-    }
-    public String getFrom() { 
-        return from;
-    }
-    public String getThread() { 
-        return thread; 
-    }
-    public String getXid() {
-        return xid;
-    }
-    public void setBody(String body) {
-        this.body = body;
-    }
-    public void setTo(String to) { 
-        this.to = to; 
-    }
-    public void setFrom(String from) { 
-        this.from = from; 
-    }
-    public void setThread(String thread) { 
-        this.thread = thread; 
-    }
-    public void setXid(String xid) {
-        this.xid = xid; 
-    }
-
-
-    /**
-     * Generates the XML representation of this message.
-     */
-    public String toXML() {
-        StringBuffer sb = new StringBuffer("<message to='");
-        escapeXML(to, sb);
-        sb.append("' osrf_xid='");
-        escapeXML(xid, sb);
-        sb.append("'><thread>");
-        escapeXML(thread, sb);
-        sb.append("</thread><body>");
-        escapeXML(body, sb);
-        sb.append("</body></message>");
-        return sb.toString();
-    }
-
-
-    /**
-     * Escapes non-valid XML characters.
-     * @param s The string to escape.
-     * @param sb The StringBuffer to append new data to.
-     */
-    private void escapeXML(String s, StringBuffer sb) {
-        if( s == null ) return;
-        char c;
-        int l = s.length();
-        for( int i = 0; i < l; i++ ) {
-            c = s.charAt(i);
-            switch(c) {
-                case '<': 
-                    sb.append("&lt;");
-                    break;
-                case '>': 
-                    sb.append("&gt;");
-                    break;
-                case '&': 
-                    sb.append("&amp;");
-                    break;
-                default:
-                    sb.append(c);
-            }
-        }
-    }
-}
-
-
diff --git a/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPReader.java b/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPReader.java
deleted file mode 100644 (file)
index 01a4f91..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-package org.opensrf.net.xmpp;
-
-import javax.xml.stream.*;
-import javax.xml.stream.events.* ;
-import javax.xml.namespace.QName;
-import java.util.Queue;
-import java.io.InputStream;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.Date;
-
-
-/**
- * Slim XMPP Stream reader.  This reader only understands enough XMPP
- * to handle logins and recv messages.  It's implemented as a StAX parser.
- * @author Bill Erickson, Georgia Public Library Systems
- */
-public class XMPPReader implements Runnable {
-
-    /** Queue of received messages. */
-    private Queue<XMPPMessage> msgQueue;
-    /** Incoming XMPP XML stream */
-    private InputStream inStream;
-    /** Current message body */
-    private StringBuffer msgBody;
-    /** Current message thread */
-    private StringBuffer msgThread;
-    /** Current message status */
-    private StringBuffer msgStatus;
-    /** Current message error type */
-    private StringBuffer msgErrType;
-    /** Current message sender */
-    private String msgFrom;
-    /** Current message recipient */
-    private String msgTo;
-    /** Current message error code */
-    private int msgErrCode;
-
-    /** Where this reader currently is in the document */
-    private XMLState xmlState;
-
-    /** The current connect state to the XMPP server */
-    private XMPPStreamState streamState;
-
-
-    /** Used to represent out connection state to the XMPP server */
-    public static enum XMPPStreamState {
-        DISCONNECTED,   /* not connected to the server */
-        CONNECT_SENT,   /* we've sent the initial connect message */
-        CONNECT_RECV,   /* we've received a response to our connect message */
-        AUTH_SENT,      /* we've sent an authentication request */
-        CONNECTED       /* authentication is complete */
-    };
-
-
-    /** Used to represents where we are in the XML document stream. */
-    public static enum XMLState {
-        IN_NOTHING,
-        IN_BODY,
-        IN_THREAD,
-        IN_STATUS
-    };
-
-
-    /**
-     * Creates a new reader. Initializes the message queue.
-     * Sets the stream state to disconnected, and the xml
-     * state to in_nothing.
-     * @param inStream the inbound XML stream
-     */
-    public XMPPReader(InputStream inStream) {
-        msgQueue = new ConcurrentLinkedQueue<XMPPMessage>();
-        this.inStream = inStream;
-        resetBuffers();
-        xmlState = XMLState.IN_NOTHING;
-        streamState = XMPPStreamState.DISCONNECTED;
-    }
-
-    /**
-     * Change the connect state and notify that a core 
-     * event has occurred.
-     */
-    protected void setXMPPStreamState(XMPPStreamState state) {
-        streamState = state;
-        notifyCoreEvent();
-    }
-
-    /**
-     * @return The current stream state of the reader 
-     */
-    public XMPPStreamState getXMPPStreamState() {
-        return streamState;
-    }
-
-
-    /**
-     * @return The next message in the queue, or null
-     */
-    public XMPPMessage popMessageQueue() {
-        return (XMPPMessage) msgQueue.poll();
-    }
-
-
-    /**
-     * Initializes the message buffers 
-     */
-    private void resetBuffers() {
-        msgBody = new StringBuffer();
-        msgThread = new StringBuffer();
-        msgStatus = new StringBuffer(); 
-        msgErrType = new StringBuffer();
-        msgFrom = "";
-        msgTo = "";
-    }
-
-
-    /**
-     * Notifies the waiting thread that a core event has occurred.
-     * Each reader should have exactly one dependent session thread. 
-     */
-    private synchronized void notifyCoreEvent() {
-        notify();
-    }
-
-
-    /**
-     * Waits up to timeout milliseconds for a core event to occur. 
-     * Also, having a message already waiting in the queue 
-     * constitutes a core event.
-     * @param timeout The number of milliseconds to wait.  If 
-     * timeout is negative, waits potentially forever.
-     * @return The number of milliseconds in wait
-     */
-    public synchronized long waitCoreEvent(long timeout) {
-
-        if(msgQueue.peek() != null || timeout == 0) return 0;
-
-        long start = new Date().getTime();
-        try{
-            if(timeout < 0) wait();
-            else wait(timeout);
-        } catch(InterruptedException ie) {}
-
-        return new Date().getTime() - start;
-    }
-
-
-
-    /** Kickoff the thread */
-    public void run() {
-        read();
-    }
-
-
-    /**
-     * Parses XML data from the provided XMPP stream.
-     */
-    public void read() {
-
-        try {
-
-            XMLInputFactory factory = XMLInputFactory.newInstance();
-
-            /** disable as many unused features as possible to speed up the parsing */
-            factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
-            factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
-            factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.FALSE);
-            factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
-            factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
-
-            /** create the stream reader */
-            XMLStreamReader reader = factory.createXMLStreamReader(inStream);
-            int eventType;
-
-            while(reader.hasNext()) {
-                /** cycle through the XML events */
-
-                eventType = reader.next();
-
-                switch(eventType) {
-
-                    case XMLEvent.START_ELEMENT:
-                        handleStartElement(reader);
-                        break;
-
-                    case XMLEvent.CHARACTERS:
-                        switch(xmlState) {
-                            case IN_BODY:
-                                msgBody.append(reader.getText());
-                                break;
-                            case IN_THREAD:
-                                msgThread.append(reader.getText());
-                                break;
-                            case IN_STATUS:
-                                msgStatus.append(reader.getText());
-                                break;
-                        }
-                        break;
-
-                    case XMLEvent.END_ELEMENT: 
-                        xmlState = XMLState.IN_NOTHING;
-                        if("message".equals(reader.getName().toString())) {
-
-                           /** build a message and add it to the message queue */
-                           XMPPMessage msg = new XMPPMessage();
-                           msg.setFrom(msgFrom);
-                           msg.setTo(msgTo);
-                           msg.setBody(msgBody.toString());
-                           msg.setThread(msgThread.toString());
-
-                           msgQueue.offer(msg);
-                           resetBuffers(); 
-                           notifyCoreEvent();
-                        }
-                        break;
-                }
-            }
-
-        } catch(javax.xml.stream.XMLStreamException se) {
-            /* XXX log an error */
-            xmlState = XMLState.IN_NOTHING;
-            streamState = XMPPStreamState.DISCONNECTED;
-            notifyCoreEvent();
-        }
-    }
-
-
-    /**
-     * Handles the start_element event.
-     */
-    private void handleStartElement(XMLStreamReader reader) {
-
-        String name = reader.getName().toString();
-
-        if("message".equals(name)) {
-            xmlState = XMLState.IN_BODY;
-
-            /** add a special case for the opensrf "router_from" attribute */
-            String rf = reader.getAttributeValue(null, "router_from");
-            if( rf != null )
-                msgFrom = rf;
-            else
-                msgFrom = reader.getAttributeValue(null, "from");
-            msgTo = reader.getAttributeValue(null, "to");
-            return;
-        }
-
-        if("body".equals(name)) {
-            xmlState = XMLState.IN_BODY;
-            return;
-        }
-
-        if("thread".equals(name)) {
-            xmlState = XMLState.IN_THREAD;
-            return;
-        }
-
-        if("stream:stream".equals(name)) {
-            setXMPPStreamState(XMPPStreamState.CONNECT_RECV);
-            return;
-        }
-
-        if("iq".equals(name)) {
-            if("result".equals(reader.getAttributeValue(null, "type")))
-                setXMPPStreamState(XMPPStreamState.CONNECTED);
-            return;
-        }
-
-        if("status".equals(name)) {
-            xmlState = XMLState.IN_STATUS;
-            return;
-        }
-
-        if("stream:error".equals(name)) {
-            setXMPPStreamState(XMPPStreamState.DISCONNECTED);
-            return;
-        }
-
-        if("error".equals(name)) {
-            msgErrType.append(reader.getAttributeValue(null, "type"));
-            msgErrCode = Integer.parseInt(reader.getAttributeValue(null, "code"));
-            setXMPPStreamState(XMPPStreamState.DISCONNECTED);
-            return;
-        }
-    }
-}
-
-
-
-
diff --git a/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPSession.java b/OpenSRF/src/java/org/opensrf/net/xmpp/XMPPSession.java
deleted file mode 100644 (file)
index ce7e36c..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.opensrf.net.xmpp;
-
-import java.io.*;
-import java.net.Socket;
-
-
-/**
- * Represents a single XMPP session.  Sessions are responsible for writing to
- * the stream and for managing a stream reader.
- */
-public class XMPPSession {
-
-    /** Initial jabber message */
-    public static final String JABBER_CONNECT = 
-        "<stream:stream to='%s' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>";
-
-    /** Basic auth message */
-    public static final String JABBER_BASIC_AUTH =  
-        "<iq id='123' type='set'><query xmlns='jabber:iq:auth'>" +
-        "<username>%s</username><password>%s</password><resource>%s</resource></query></iq>";
-
-    /** jabber domain */
-    private String host;
-    /** jabber port */
-    private int port;
-    /** jabber username */
-    private String username;
-    /** jabber password */
-    private String password;
-    /** jabber resource */
-    private String resource;
-
-    /** XMPP stream reader */
-    XMPPReader reader;
-    /** Fprint-capable socket writer */
-    PrintWriter writer;
-    /** Raw socket output stream */
-    OutputStream outStream;
-
-    /** The process-wide session.  All communication occurs
-     * accross this single connection */
-    private static XMPPSession globalSession;
-
-
-    /**
-     * Creates a new session.
-     * @param host The jabber domain
-     * @param port The jabber port
-     */
-    public XMPPSession( String host, int port ) {
-        this.host = host;
-        this.port = port;
-    }
-
-    /**
-     * Returns the global, process-wide session
-     */
-    public static XMPPSession getGlobalSession() {
-        return globalSession;
-    }
-
-    /**
-     * Sets the global, process-wide section
-     */
-    public static void setGlobalSession(XMPPSession ses) {
-        globalSession = ses;
-    }
-
-
-    /** true if this session is connected to the server */
-    public boolean connected() {
-        return (
-            reader != null && 
-            reader.getXMPPStreamState() == 
-                XMPPReader.XMPPStreamState.CONNECTED);
-    }
-
-
-    /**
-     * Connects to the network.
-     * @param username The jabber username
-     * @param password The jabber password
-     * @param resource The Jabber resource
-     */
-    public void connect(String username, String password, String resource) throws XMPPException {
-
-        this.username = username;
-        this.password = password;
-        this.resource = resource;
-
-        Socket socket;
-
-        try { 
-            /* open the socket and associated streams */
-            socket = new Socket(host, port);
-
-            /** the session maintains control over the output stream */
-            outStream = socket.getOutputStream();
-            writer = new PrintWriter(outStream, true);
-
-            /** pass the input stream to the reader */
-            reader = new XMPPReader(socket.getInputStream());
-
-        } catch(IOException ioe) {
-            throw new 
-                XMPPException("unable to communicate with host " + host + " on port " + port);
-        }
-
-        /* build the reader thread */
-        Thread thread = new Thread(reader);
-        thread.setDaemon(true);
-        thread.start();
-
-        /* send the initial jabber message */
-        sendConnect();
-        reader.waitCoreEvent(10000);
-        if( reader.getXMPPStreamState() != XMPPReader.XMPPStreamState.CONNECT_RECV ) 
-            throw new XMPPException("unable to connect to jabber server");
-
-        /* send the basic auth message */
-        sendBasicAuth(); /* XXX add support for other auth mechanisms */
-        reader.waitCoreEvent(10000);
-        if(!connected())
-            throw new XMPPException("Authentication failed");
-    }
-
-    /** Sends the initial jabber message */
-    private void sendConnect() {
-        writer.printf(JABBER_CONNECT, host);
-        reader.setXMPPStreamState(XMPPReader.XMPPStreamState.CONNECT_SENT);
-    }
-
-    /** Send the basic auth message */
-    private void sendBasicAuth() {
-        writer.printf(JABBER_BASIC_AUTH, username, password, resource);
-        reader.setXMPPStreamState(XMPPReader.XMPPStreamState.AUTH_SENT);
-    }
-
-
-    /**
-     * Sends an XMPPMessage.
-     * @param msg The message to send.
-     */
-    public synchronized void send(XMPPMessage msg) throws XMPPException {
-        checkConnected();
-        try {
-            String xml = msg.toXML();
-            outStream.write(xml.getBytes()); 
-        } catch (Exception e) {
-            throw new XMPPException(e.toString());
-        }
-    }
-
-
-    /**
-     * @throws XMPPException if we are no longer connected.
-     */
-    private void checkConnected() throws XMPPException {
-        if(!connected())
-            throw new XMPPException("Disconnected stream");
-    }
-
-
-    /**
-     * Receives messages from the network.  
-     * @param timeout Maximum number of milliseconds to wait for a message to arrive.
-     * If timeout is negative, this method will wait indefinitely.
-     * If timeout is 0, this method will not block at all, but will return a 
-     * message if there is already a message available.
-     */
-    public XMPPMessage recv(long timeout) throws XMPPException {
-
-        XMPPMessage msg;
-
-        if(timeout < 0) {
-
-            while(true) { /* wait indefinitely for a message to arrive */
-                reader.waitCoreEvent(timeout);
-                msg = reader.popMessageQueue();
-                if( msg != null ) return msg;
-                checkConnected();
-            }
-
-        } else {
-
-            while(timeout >= 0) { /* wait at most 'timeout' milleseconds for a message to arrive */
-                timeout -= reader.waitCoreEvent(timeout);
-                msg = reader.popMessageQueue();
-                if( msg != null ) return msg;
-                checkConnected();
-            }
-        }
-
-        return null;
-    }
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/test/TestClient.java b/OpenSRF/src/java/org/opensrf/test/TestClient.java
deleted file mode 100644 (file)
index 8cd7865..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.opensrf.test;
-import org.opensrf.*;
-import org.opensrf.util.*;
-import org.opensrf.net.xmpp.*;
-import java.io.PrintStream;
-import java.util.Map;
-import java.util.Date;
-
-
-public class TestClient {
-    public static void main(String args[]) throws Exception {
-        
-        PrintStream out = System.out;
-
-        try {
-
-            /** setup the config parser */
-            String configFile = args[0];
-            Config config = new Config("/config/opensrf");
-            config.parse(configFile);
-            Config.setConfig(config);
-
-            /** Connect to jabber */
-            String username = Config.getString("/username");
-            String passwd = Config.getString("/passwd");
-            String host = (String) Config.getFirst("/domains/domain");
-            int port = Config.getInt("/port");
-            XMPPSession xses = new XMPPSession(host, port);
-            xses.connect(username, passwd, "test-java-client");
-            XMPPSession.setGlobalSession(xses);
-    
-            /** build the client session and send the request */
-            ClientSession session = new ClientSession("opensrf.settings");
-            Request request = session.request(
-                "opensrf.settings.host_config.get", 
-                new String[] {args[1]}
-            );
-
-            Result result = request.recv(10000);
-            if(result == null) {
-                out.println("no result");
-                return;
-            }
-
-            out.println("status = " + result.getStatus());
-            out.println("status code = " + result.getStatusCode());
-
-            out.println("setting config memcache server(s) = " +
-                new JSONWriter(
-                    Utils.findPath( (Map) result.getContent(), 
-                    "/cache/global/servers/server")
-                ).write());
-
-
-        } catch(ArrayIndexOutOfBoundsException e) {
-            out.println("usage: org.opensrf.test.TestClient <osrfConfigFile> <domain>");
-            return;
-        }
-    }
-}
-
-
-
diff --git a/OpenSRF/src/java/org/opensrf/test/TestConfig.java b/OpenSRF/src/java/org/opensrf/test/TestConfig.java
deleted file mode 100644 (file)
index 5cd4eb3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.opensrf.test;
-import org.opensrf.*;
-import org.opensrf.util.*;
-
-public class TestConfig {
-    public static void main(String args[]) throws Exception {
-        Config config = new Config("");
-        config.parse(args[0]);
-        Config.setConfig(config);
-        System.out.println(config);
-        System.out.println("");
-
-        for(int i = 1; i < args.length; i++) 
-            System.out.println("Found config value: " + args[i] + ": " + Config.get(args[i]));
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/test/TestJSON.java b/OpenSRF/src/java/org/opensrf/test/TestJSON.java
deleted file mode 100644 (file)
index b19d408..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.opensrf.test;
-
-import org.opensrf.*;
-import org.opensrf.util.*;
-import java.util.*;
-
-public class TestJSON {
-
-    public static void main(String args[]) throws Exception {
-        
-        Map<String,Object> map = new HashMap<String,Object>();
-        map.put("key1", "value1");
-        map.put("key2", "value2");
-        map.put("key3", "value3");
-        map.put("key4", "athe\u0301s");
-        map.put("key5", null);
-
-        List<Object> list = new ArrayList<Object>(16);
-        list.add(new Integer(1));
-        list.add(new Boolean(true));
-        list.add("WATER");
-        list.add(null);
-        map.put("key6", list);
-
-        System.out.println(new JSONWriter(map).write() + "\n");
-
-        String[] fields = {"isnew", "name", "shortname", "ill_address"};
-        OSRFRegistry.registerObject("aou", OSRFRegistry.WireProtocol.ARRAY, fields);
-
-        OSRFObject obj = new OSRFObject(OSRFRegistry.getRegistry("aou"));
-        obj.put("name", "athens clarke county");
-        obj.put("ill_address", new Integer(1));
-        obj.put("shortname", "ARL-ATH");
-
-        map.put("key7", obj);
-        list.add(obj);
-        System.out.println(new JSONWriter(map).write() + "\n");
-
-
-        Message m = new Message(1, Message.REQUEST);
-        Method method = new Method("opensrf.settings.host_config.get");
-        method.addParam("app07.dev.gapines.org");
-        m.setPayload(method);
-
-        String s = new JSONWriter(m).write();
-        System.out.println(s + "\n");
-
-        Object o = new JSONReader(s).read();
-        System.out.println("Read+Wrote: " + new JSONWriter(o).write());
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/test/TestXMPP.java b/OpenSRF/src/java/org/opensrf/test/TestXMPP.java
deleted file mode 100644 (file)
index 2fba67f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.opensrf.test;
-
-import org.opensrf.net.xmpp.XMPPReader;
-import org.opensrf.net.xmpp.XMPPMessage;
-import org.opensrf.net.xmpp.XMPPSession;
-
-public class TestXMPP {
-
-    /**
-     * Connects to the jabber server and waits for inbound messages.
-     * If a recipient is provided, a small message is sent to the recipient.
-     */
-    public static void main(String args[]) throws Exception {
-
-        String host;
-        int port;
-        String username;
-        String password;
-        String resource;
-        String recipient;
-
-        try {
-            host = args[0];
-            port = Integer.parseInt(args[1]);
-            username = args[2];
-            password = args[3];
-            resource = args[4];
-
-        } catch(ArrayIndexOutOfBoundsException e) {
-            System.err.println("usage: org.opensrf.test.TestXMPP <host> <port> <username> <password> <resource> [<recipient>]");
-            return;
-        }
-
-        XMPPSession session = new XMPPSession(host, port);
-        session.connect(username, password, resource);
-
-        XMPPMessage msg;
-
-        if( args.length == 6 ) {
-
-            /** they specified a recipient */
-
-            recipient = args[5];
-            msg = new XMPPMessage();
-            msg.setTo(recipient);
-            msg.setThread("test-thread");
-            msg.setBody("Hello, from java-xmpp");
-            System.out.println("Sending message to " + recipient);
-            session.send(msg);
-        }
-
-        while(true) {
-            System.out.println("waiting for message...");
-            msg = session.recv(-1); /* wait forever for a message to arrive */
-            System.out.println("got message: " + msg.toXML());
-        }
-    }
-}
-
-
-
-
-
diff --git a/OpenSRF/src/java/org/opensrf/util/Config.java b/OpenSRF/src/java/org/opensrf/util/Config.java
deleted file mode 100644 (file)
index 7b3a0bf..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.opensrf.util;
-
-import org.json.*;
-import java.util.Map;
-import java.util.List;
-
-
-/**
- * Config reader and accesor module.  This module reads an XML config file,
- * then loads the file into an internal config, whose values may be accessed
- * by xpath-style lookup paths.
- */
-public class Config {
-
-    /** The globl config instance */
-    private static Config config;
-    /** The object form of the parsed config */
-    private Map configObject;
-    /** 
-     * The log parsing context.  This is used as a prefix to the
-     * config item search path.  This allows config XML chunks to 
-     * be inserted into arbitrary XML files.
-     */
-    private String context;
-
-    /**
-     * @param context The config context
-     */
-    public Config(String context) {
-        this.context = context;
-    }
-
-    /**
-     * Sets the global config object.
-     * @param c The config object to use.
-     */
-    public static void setConfig(Config c) {
-        config = c;
-    }
-
-    /**
-     * Parses an XML config file.
-     * @param filename The path to the file to parse.
-     */
-    public void parse(String filename) throws Exception {
-        String xml = Utils.fileToString(filename);
-        JSONObject jobj = XML.toJSONObject(xml);
-        configObject = (Map) new JSONReader(jobj.toString()).readObject();
-    }
-
-    /**
-     * Returns the configuration value found at the requested path.
-     * @param path The search path
-     * @return The config value, or null if no value exists at the given path.  
-     * @throws ConfigException thrown if nothing is found at the path
-     */
-    public static String getString(String path) throws ConfigException {
-        try {
-            return (String) get(path);
-        } catch(Exception e) {
-            throw new 
-                ConfigException("No config string found at " + path);
-        }
-    }
-
-    /**
-     * Gets the int value at the given path
-     * @param path The search path
-     */
-    public static int getInt(String path) throws ConfigException {
-        try {
-            return Integer.parseInt(getString(path));
-        } catch(Exception e) {
-            throw new
-                ConfigException("No config int found at " + path);
-        }
-    }
-
-    /**
-     * Returns the configuration object found at the requested path.
-     * @param path The search path
-     * @return The config value
-     * @throws ConfigException thrown if nothing is found at the path
-     */
-    public static Object get(String path) throws ConfigException {
-        try {
-            Object obj = Utils.findPath(config.configObject, config.context + path);
-            if(obj == null)
-                throw new ConfigException("");
-            return obj;
-        } catch(Exception e) {
-            e.printStackTrace();
-            throw new ConfigException("No config object found at " + path);
-        }
-    }
-
-    /**
-     * Returns the first item in the list found at the given path.  If
-     * no list is found, ConfigException is thrown.
-     * @param path The search path
-     */
-    public static Object getFirst(String path) throws ConfigException {
-        Object obj = get(path); 
-        if(obj instanceof List) 
-            return ((List) obj).get(0);
-        return obj;
-    }
-
-
-    /**
-     * Returns the config as a JSON string
-     */
-    public String toString() {
-        return new JSONWriter(configObject).write();
-    }
-}
-
diff --git a/OpenSRF/src/java/org/opensrf/util/ConfigException.java b/OpenSRF/src/java/org/opensrf/util/ConfigException.java
deleted file mode 100644 (file)
index be7c0cf..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.opensrf.util;
-
-/**
- * Thrown by the Config module when a user requests a configuration
- * item that does not exist
- */
-public class ConfigException extends Exception {
-    public ConfigException(String info) {
-        super(info);
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/util/JSONException.java b/OpenSRF/src/java/org/opensrf/util/JSONException.java
deleted file mode 100644 (file)
index ec28e1d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.opensrf.util;
-/**
- * Used to indicate JSON parsing errors
- */
-public class JSONException extends Exception {
-    public JSONException(String s) {
-        super(s);
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/util/JSONReader.java b/OpenSRF/src/java/org/opensrf/util/JSONReader.java
deleted file mode 100644 (file)
index b115140..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-package org.opensrf.util;
-
-import java.io.*;
-import java.util.*;
-
-import org.json.JSONTokener;
-import org.json.JSONObject;
-import org.json.JSONArray;
-
-
-/**
- * JSON utilities.
- */
-public class JSONReader {
-
-    /** Special OpenSRF serializable object netClass key */
-    public static final String JSON_CLASS_KEY = "__c";
-
-    /** Special OpenSRF serializable object payload key */
-    public static final String JSON_PAYLOAD_KEY = "__p";
-
-    /** The JSON string to parser */
-    private String json;
-
-    /**
-     * @param json The JSON to parse
-     */
-    public JSONReader(String json) {
-        this.json = json;
-    }
-
-    /**
-     * Parses JSON and creates an object.
-     * @return The resulting object which may be a List, 
-     * Map, Number, String, Boolean, or null
-     */
-    public Object read() throws JSONException {
-        JSONTokener tk = new JSONTokener(json);
-        try {
-            return readSubObject(tk.nextValue());
-        } catch(org.json.JSONException e) {
-            throw new JSONException(e.toString());
-        }
-    }
-
-    /**
-     * Assumes that a JSON array will be read.  Returns
-     * the resulting array as a list.
-     */
-    public List<?> readArray() throws JSONException {
-        Object o = read();
-        try {
-            return (List<?>) o;
-        } catch(Exception e) {
-            throw new JSONException("readArray(): JSON cast exception");
-        }
-    }
-
-    /**
-     * Assumes that a JSON object will be read.  Returns 
-     * the resulting object as a map.
-     */
-    public Map<?,?> readObject() throws JSONException {
-        Object o = read();
-        try {
-            return (Map<?,?>) o;
-        } catch(Exception e) {
-            throw new JSONException("readObject(): JSON cast exception");
-        }
-    }
-
-
-    /**
-     * Recurse through the object and turn items into maps, lists, etc.
-     */
-    private Object readSubObject(Object obj) throws JSONException {
-
-        if( obj == null || 
-            obj instanceof String || 
-            obj instanceof Number ||
-            obj instanceof Boolean)
-                return obj;
-
-        try {
-
-            if( obj instanceof JSONObject ) {
-
-                /* read objects */
-                String key;
-                JSONObject jobj = (JSONObject) obj;
-                Map<String, Object> map = new HashMap<String, Object>();
-
-                for( Iterator e = jobj.keys(); e.hasNext(); ) {
-                    key = (String) e.next();
-
-                    /* we encoutered the special class key */
-                    if( JSON_CLASS_KEY.equals(key) ) 
-                        return buildRegisteredObject(
-                            (String) jobj.get(key), jobj.get(JSON_PAYLOAD_KEY));
-
-                    /* we encountered the data key */
-                    if( JSON_PAYLOAD_KEY.equals(key) ) 
-                        return buildRegisteredObject(
-                            (String) jobj.get(JSON_CLASS_KEY), jobj.get(key));
-
-                    map.put(key, readSubObject(jobj.get(key)));
-                }
-                return map;
-            } 
-            
-            if ( obj instanceof JSONArray ) {
-
-                JSONArray jarr = (JSONArray) obj;
-                int length = jarr.length();
-                List<Object> list = new ArrayList<Object>(length);
-
-                for( int i = 0; i < length; i++ ) 
-                    list.add(readSubObject(jarr.get(i)));   
-                return list;
-                
-            }
-
-        } catch(org.json.JSONException e) {
-
-            throw new JSONException(e.toString());
-        }
-
-        return null;
-    }
-
-
-
-    /**
-     * Builds an OSRFObject map registered OSRFHash object based on the JSON object data.
-     * @param netClass The network class hint for this object.
-     * @param paylaod The actual object on the wire.
-     */
-    private OSRFObject buildRegisteredObject(
-        String netClass, Object payload) throws JSONException {
-
-        OSRFRegistry registry = OSRFRegistry.getRegistry(netClass);
-        OSRFObject obj = new OSRFObject(registry);
-
-        try {
-            if( payload instanceof JSONArray ) {
-                JSONArray jarr = (JSONArray) payload;
-
-                /* for each array item, instert the item into the hash.  the hash 
-                 * key is found by extracting the fields array from the registered 
-                 * object at the current array index */
-                String fields[] = registry.getFields();
-                for( int i = 0; i < jarr.length(); i++ ) {
-                    obj.put(fields[i], readSubObject(jarr.get(i)));   
-                }
-
-            } else if( payload instanceof JSONObject ) {
-
-                /* since this is a hash, simply copy the data over */
-                JSONObject jobj = (JSONObject) payload;
-                String key;
-                for( Iterator e = jobj.keys(); e.hasNext(); ) {
-                    key = (String) e.next();
-                    obj.put(key, readSubObject(jobj.get(key)));
-                }
-            }
-
-        } catch(org.json.JSONException e) {
-            throw new JSONException(e.toString());
-        }
-
-        return obj;
-    }
-}
-
-
-
diff --git a/OpenSRF/src/java/org/opensrf/util/JSONWriter.java b/OpenSRF/src/java/org/opensrf/util/JSONWriter.java
deleted file mode 100644 (file)
index 7cb2cca..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-package org.opensrf.util;
-
-import java.io.*;
-import java.util.*;
-
-
-/**
- * JSONWriter
- */
-public class JSONWriter {
-
-    /** The object to serialize to JSON */
-    private Object obj;
-
-    /**
-     * @param obj The object to encode
-     */
-    public JSONWriter(Object obj) {
-        this.obj = obj;
-    }
-
-
-    /**
-     * Encodes a java object to JSON.
-     */
-    public String write() {
-        StringBuffer sb = new StringBuffer();
-        write(sb);
-        return sb.toString();
-    }
-
-
-
-    /**
-     * Encodes a java object to JSON.
-     * Maps (HashMaps, etc.) are encoded as JSON objects.  
-     * Iterable's (Lists, etc.) are encoded as JSON arrays
-     */
-    public void write(StringBuffer sb) {
-        write(obj, sb);
-    }
-
-    /**
-     * Encodes the object as JSON into the provided buffer
-     */
-    public void write(Object obj, StringBuffer sb) {
-
-        /** JSON null */
-        if(obj == null) {
-            sb.append("null");
-            return;
-        }
-
-        /** JSON string */
-        if(obj instanceof String) {
-            sb.append('"');
-            Utils.escape((String) obj, sb);
-            sb.append('"');
-            return;
-        }
-
-        /** JSON number */
-        if(obj instanceof Number) {
-            sb.append(obj.toString());
-            return;
-        }
-
-        /** JSON array */
-        if(obj instanceof Iterable) {
-            encodeJSONArray((Iterable) obj, sb);
-            return;
-        }
-
-        /** OpenSRF serializable objects */
-        if(obj instanceof OSRFSerializable) {
-            encodeOSRFSerializable((OSRFSerializable) obj, sb);
-            return;
-        }
-
-        /** JSON object */
-        if(obj instanceof Map) {
-            encodeJSONObject((Map) obj, sb);
-            return;
-        }
-
-        /** JSON boolean */
-        if(obj instanceof Boolean) {
-            sb.append((((Boolean) obj).booleanValue() ? "true" : "false"));
-            return;
-        }
-    }
-
-
-    /**
-     * Encodes a List as a JSON array
-     */
-    private void encodeJSONArray(Iterable iterable, StringBuffer sb) {
-        Iterator itr = iterable.iterator();
-        sb.append("[");
-        boolean some = false;
-
-        while(itr.hasNext()) {
-            some = true;
-            write(itr.next(), sb);
-            sb.append(',');
-        }
-
-        /* remove the trailing comma if the array has any items*/
-        if(some) 
-            sb.deleteCharAt(sb.length()-1); 
-        sb.append("]");
-    }
-
-
-    /**
-     * Encodes a Map as a JSON object
-     */
-    private void encodeJSONObject(Map map, StringBuffer sb) {
-        Iterator itr = map.keySet().iterator();
-        sb.append("{");
-        Object key = null;
-
-        while(itr.hasNext()) {
-            key = itr.next();
-            write(key, sb);
-            sb.append(':');
-            write(map.get(key), sb);
-            sb.append(',');
-        }
-
-        /* remove the trailing comma if the object has any items*/
-        if(key != null) 
-            sb.deleteCharAt(sb.length()-1); 
-        sb.append("}");
-    }
-
-
-    /**
-     * Encodes a network-serializable OpenSRF object
-     */
-    private void encodeOSRFSerializable(OSRFSerializable obj, StringBuffer sb) {
-
-        OSRFRegistry reg = obj.getRegistry();
-        String[] fields = reg.getFields();
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put(JSONReader.JSON_CLASS_KEY, reg.getNetClass());
-
-        if( reg.getWireProtocol() == OSRFRegistry.WireProtocol.ARRAY ) {
-
-            /** encode arrays as lists */
-            List<Object> list = new ArrayList<Object>(fields.length);
-            for(String s : fields)
-                list.add(obj.get(s));
-            map.put(JSONReader.JSON_PAYLOAD_KEY, list);
-
-        } else {
-
-            /** encode hashes as maps */
-            Map<String, Object> subMap = new HashMap<String, Object>();
-            for(String s : fields)
-                subMap.put(s, obj.get(s));
-            map.put(JSONReader.JSON_PAYLOAD_KEY, subMap);
-                
-        }
-
-        /** now serialize the encoded object */
-        write(map, sb);
-    }
-}
-
-
-
diff --git a/OpenSRF/src/java/org/opensrf/util/OSRFObject.java b/OpenSRF/src/java/org/opensrf/util/OSRFObject.java
deleted file mode 100644 (file)
index 1050706..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.opensrf.util;
-
-import java.util.Map;
-import java.util.HashMap;
-
-
-/**
- * Generic OpenSRF network-serializable object.  This allows
- * access to object fields.  
- */
-public class OSRFObject extends HashMap<String, Object> implements OSRFSerializable {
-    
-    /** This objects registry */
-    private OSRFRegistry registry;
-
-    public OSRFObject() {
-    }
-
-    /**
-     * Creates a new object with the provided registry
-     */
-    public OSRFObject(OSRFRegistry reg) {
-        this();
-        registry = reg;
-    }
-
-    /**
-     * @return This object's registry
-     */
-    public OSRFRegistry getRegistry() {
-        return registry;
-    }
-
-    /**
-     * Implement get() to fulfill our contract with OSRFSerializable
-     */
-    public Object get(String field) {
-        return super.get(field);
-    }
-
-    /** Returns the string value found at the given field */
-    public String getString(String field) {
-        return (String) get(field);
-    }
-
-    /** Returns the int value found at the given field */
-    public int getInt(String field) {
-        Object o = get(field);
-        if(o instanceof String)
-            return Integer.parseInt((String) o);
-        return ((Integer) get(field)).intValue();
-    }
-}
diff --git a/OpenSRF/src/java/org/opensrf/util/OSRFRegistry.java b/OpenSRF/src/java/org/opensrf/util/OSRFRegistry.java
deleted file mode 100644 (file)
index f5fe7cb..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.opensrf.util;
-
-import java.util.Map;
-import java.util.HashMap;
-
-
-/**
- * Manages the registration of OpenSRF network-serializable objects.  
- * A serializable object has a class "hint" (called netClass within) which
- * describes the type of object.  Each object also has a set of field names
- * for accessing/mutating object properties.  Finally, objects have a 
- * serialization wire protocol.  Currently supported protocols are HASH
- * and ARRAY.
- */
-public class OSRFRegistry {
-
-
-    /**
-     * Global collection of registered net objects.  
-     * Maps netClass names to registries.
-     */
-    private static HashMap<String, OSRFRegistry> 
-        registry = new HashMap<String, OSRFRegistry>();
-
-
-    /** Serialization types for registered objects */
-    public enum WireProtocol {
-        ARRAY, HASH
-    };
-
-
-    /** Array of field names for this registered object */
-    String fields[];
-    /** The wire protocol for this object */
-    WireProtocol wireProtocol;
-    /** The network class for this object */
-    String netClass;
-
-    /**
-     * Returns the array of field names
-     */
-    public String[] getFields() {
-        return this.fields;
-    }
-
-
-    /**
-     * Registers a new object.
-     * @param netClass The net class for this object
-     * @param wireProtocol The object's wire protocol
-     * @param fields An array of field names.  For objects whose
-     * wire protocol is ARRAY, the positions of the field names 
-     * will be used as the array indices for the fields at serialization time
-     */
-    public static OSRFRegistry registerObject(String netClass, WireProtocol wireProtocol, String fields[]) {
-        OSRFRegistry r = new OSRFRegistry(netClass, wireProtocol, fields);
-        registry.put(netClass, r);
-        return r;
-    }
-
-    /**
-     * Returns the registry for the given netclass
-     * @param netClass The network class to lookup
-     */
-    public static OSRFRegistry getRegistry(String netClass) {
-        if( netClass == null ) return null;
-        return (OSRFRegistry) registry.get(netClass);
-    }
-
-
-    /**
-     * @param field The name of the field to lookup
-     * @return the index into the fields array of the given field name.
-     */
-    public int getFieldIndex(String field) {
-        for( int i = 0; i < fields.length; i++ )
-            if( fields[i].equals(field) ) 
-                return i;
-        return -1;
-    }
-
-    /** Returns the wire protocol of this object */
-    public WireProtocol getWireProtocol() {
-        return this.wireProtocol;
-    }
-
-    /** Returns the netClass ("hint") of this object */
-    public String getNetClass() {
-        return this.netClass;
-    }
-
-    /**
-     * Creates a new registry object.
-     * @param netClass The network class/hint
-     * @param wireProtocol The wire protocol
-     * @param fields The array of field names.  For array-based objects,
-     * the fields array must be sorted in accordance with the sorting
-     * of the objects in the array.
-     */ 
-    public OSRFRegistry(String netClass, WireProtocol wireProtocol, String fields[]) {
-        this.netClass = netClass;
-        this.wireProtocol = wireProtocol;
-        this.fields = fields;
-    }
-}
-
-
diff --git a/OpenSRF/src/java/org/opensrf/util/OSRFSerializable.java b/OpenSRF/src/java/org/opensrf/util/OSRFSerializable.java
deleted file mode 100644 (file)
index 64b5d6f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opensrf.util;
-
-/**
- * All network-serializable OpenSRF object must implement this interface.
- */
-public interface OSRFSerializable {
-
-    /**
-     * Returns the object registry object for the implementing class.
-     */
-    public abstract OSRFRegistry getRegistry();
-
-    /**
-     * Returns the object found at the given field
-     */
-    public abstract Object get(String field);
-}
-
-
diff --git a/OpenSRF/src/java/org/opensrf/util/Utils.java b/OpenSRF/src/java/org/opensrf/util/Utils.java
deleted file mode 100644 (file)
index 159d254..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.opensrf.util;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Collection of general, static utility methods
- */
-public class Utils {
-
-    /**
-     * Returns the string representation of a given file.
-     * @param filename The file to turn into a string
-     */
-    public static String fileToString(String filename) 
-            throws FileNotFoundException, IOException {
-
-        StringBuffer sb = new StringBuffer();
-        BufferedReader in = new BufferedReader(new FileReader(filename));
-        String str;
-        while ((str = in.readLine()) != null) 
-            sb.append(str);
-        in.close();
-        return sb.toString();
-    }
-
-
-    /**
-     * Escapes a string.
-     */
-    public static String escape(String string) {
-        StringBuffer sb = new StringBuffer();
-        escape(string, sb);
-        return sb.toString();
-    }
-
-    /**
-     * Escapes a string.  Turns bare newlines into \n, etc.
-     * Escapes \n, \r, \t, ", \f
-     * Encodes non-ascii characters as UTF-8: \u0000
-     * @param string The string to escape
-     * @param sb The string buffer to write the escaped string into
-     */
-    public static void escape(String string, StringBuffer sb) {
-        int len = string.length();
-        String utf;
-        char c;
-        for( int i = 0; i < len; i++ ) {
-            c = string.charAt(i);
-            switch (c) {
-                case '\\':
-                    sb.append("\\\\");
-                    break;
-                case '"':
-                    sb.append("\\\"");
-                    break;
-                case '\b':
-                    sb.append("\\b");
-                    break;
-                case '\t':
-                    sb.append("\\t");
-                    break;
-                case '\n':
-                    sb.append("\\n");
-                    break;
-                case '\f':
-                    sb.append("\\f");
-                    break;
-                case '\r':
-                    sb.append("\\r");
-                    break;
-                default:
-                    if (c < 32 || c > 126 ) { 
-                        /* escape all non-ascii or control characters as UTF-8 */
-                        utf = "000" + Integer.toHexString(c);
-                        sb.append("\\u" + utf.substring(utf.length() - 4));
-                    } else {
-                        sb.append(c);
-                    }
-            }
-        }
-    }
-
-
-    /** 
-     * Descends into the map along the given XPATH-style path 
-     * and returns the object found there.
-     * @param path The XPATH-style path to search.  Path 
-     * components are separated by '/' characters.  
-     * Example:  /opensrf/loglevel
-     * @return The found object. 
-     */
-
-    public static Object findPath(Map map, String path) {
-        String keys[] = path.split("/", -1);
-        int i = 0;
-        if(path.charAt(0) == '/') i++;
-        for(; i < keys.length - 1; i++ ) 
-            map = (Map) map.get(keys[i]);
-
-        return map.get(keys[i]);
-    }
-}
-
-
-
diff --git a/OpenSRF/src/javascript/JSON.js b/OpenSRF/src/javascript/JSON.js
deleted file mode 100644 (file)
index e52a439..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-// in case we run on an implimentation that doesn't have "undefined";
-var undefined;
-
-function Cast (obj, class_constructor) {
-       try {
-               if (eval(class_constructor + '["_isfieldmapper"]')) {
-                       obj = eval("new " + class_constructor + "(obj)");
-               }
-       } catch( E ) {
-               alert( E + "\n");
-       } finally {
-               return obj;
-       }
-}
-
-function JSON2js (json) {
-
-       json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast(');
-       json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")');
-
-       var obj;
-       if (json != '') {
-               try {
-                       eval( 'obj = ' + json );
-               } catch(E) {
-                       debug("Error building JSON object with string " + E + "\nString:\n" + json );
-                       return null;
-               }
-       }
-       return obj;
-}
-
-
-function object2Array(obj) {
-       if( obj == null ) return null;
-
-       var arr = new Array();
-       for( var i  = 0; i < obj.length; i++ ) {
-               arr[i] = obj[i];
-       }
-       return arr;
-}
-
-
-function js2JSON(arg) {
-       return _js2JSON(arg);
-}
-
-function _js2JSON(arg) {
-       var i, o, u, v;
-
-               switch (typeof arg) {
-                       case 'object':
-       
-                               if(arg) {
-       
-                                       if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
-       
-                                               if( arg.a.constructor != Array ) {
-                                                       var arr = new Array();
-                                                       for( var i  = 0; i < arg.a.length; i++ ) {
-                                                               if( arg.a[i] == null ) {
-                                                                       arr[i] = null; continue;
-                                                               }
-       
-                                                               if( typeof arg.a[i] != 'object' ) { 
-                                                                       arr[i] = arg.a[i];
-       
-                                                               } else if( typeof arg.a[i] == 'object' 
-                                                                                       && arg.a[i]._isfieldmapper) {
-       
-                                                                       arr[i] = arg.a[i];
-       
-                                                               } else {
-                                                                       arr[i] = object2Array(arg.a[i]);                
-                                                               }
-                                                       }
-                                                       arg.a = arr;
-                                               }
-       
-                                               return "/*--S " + arg.classname + " --*/" + js2JSON(arg.a) + "/*--E " + arg.classname + " --*/";
-       
-                                       } else {
-       
-                                               if (arg.constructor == Array) {
-                                                       o = '';
-                                                       for (i = 0; i < arg.length; ++i) {
-                                                               v = js2JSON(arg[i]);
-                                                               if (o) {
-                                                                       o += ',';
-                                                               }
-                                                               if (v !== u) {
-                                                                       o += v;
-                                                               } else {
-                                                                       o += 'null';
-                                                               }
-                                                       }
-                                                       return '[' + o + ']';
-       
-                                               } else if (typeof arg.toString != 'undefined') {
-                                                       o = '';
-                                                       for (i in arg) {
-                                                               v = js2JSON(arg[i]);
-                                                               if (v !== u) {
-                                                                       if (o) {
-                                                                               o += ',';
-                                                                       }
-                                                                       o += js2JSON(i) + ':' + v;
-                                                               }
-                                                       }
-       
-                                                       o = '{' + o + '}';
-                                                       return o;
-       
-                                               } else {
-                                                       return;
-                                               }
-                                       }
-                               }
-                               return 'null';
-       
-                       case 'unknown':
-                       case 'number':
-                               return arg;
-       
-                       case 'undefined':
-                       case 'function':
-                               return u;
-       
-                       case 'string':
-                       default:
-                               return '"' + String(arg).replace(/(["\\])/g, '\\$1') + '"';
-               }
-
-}
diff --git a/OpenSRF/src/javascript/md5.js b/OpenSRF/src/javascript/md5.js
deleted file mode 100644 (file)
index 46d2aab..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
- * Digest Algorithm, as defined in RFC 1321.
- * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for more info.
- */
-
-/*
- * Configurable variables. You may need to tweak these to be compatible with
- * the server-side, but the defaults work in most cases.
- */
-var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
-var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
-var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
-function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
-function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
-function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
-function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
-function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
-function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
-function md5_vm_test()
-{
-  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
-}
-
-/*
- * Calculate the MD5 of an array of little-endian words, and a bit length
- */
-function core_md5(x, len)
-{
-  /* append padding */
-  x[len >> 5] |= 0x80 << ((len) % 32);
-  x[(((len + 64) >>> 9) << 4) + 14] = len;
-
-  var a =  1732584193;
-  var b = -271733879;
-  var c = -1732584194;
-  var d =  271733878;
-
-  for(var i = 0; i < x.length; i += 16)
-  {
-    var olda = a;
-    var oldb = b;
-    var oldc = c;
-    var oldd = d;
-
-    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
-    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
-    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
-    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
-    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
-    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
-    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
-    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
-    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
-    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
-    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
-    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
-    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
-    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
-    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
-    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);
-
-    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
-    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
-    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
-    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
-    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
-    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
-    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
-    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
-    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
-    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
-    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
-    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
-    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
-    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
-    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
-    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
-
-    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
-    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
-    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
-    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
-    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
-    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
-    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
-    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
-    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
-    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
-    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
-    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
-    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
-    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
-    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
-    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
-
-    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
-    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
-    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
-    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
-    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
-    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
-    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
-    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
-    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
-    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
-    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
-    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
-    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
-    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
-    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
-    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
-
-    a = safe_add(a, olda);
-    b = safe_add(b, oldb);
-    c = safe_add(c, oldc);
-    d = safe_add(d, oldd);
-  }
-  return Array(a, b, c, d);
-
-}
-
-/*
- * These functions implement the four basic operations the algorithm uses.
- */
-function md5_cmn(q, a, b, x, s, t)
-{
-  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
-}
-function md5_ff(a, b, c, d, x, s, t)
-{
-  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
-}
-function md5_gg(a, b, c, d, x, s, t)
-{
-  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
-}
-function md5_hh(a, b, c, d, x, s, t)
-{
-  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
-}
-function md5_ii(a, b, c, d, x, s, t)
-{
-  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
-}
-
-/*
- * Calculate the HMAC-MD5, of a key and some data
- */
-function core_hmac_md5(key, data)
-{
-  var bkey = str2binl(key);
-  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
-
-  var ipad = Array(16), opad = Array(16);
-  for(var i = 0; i < 16; i++)
-  {
-    ipad[i] = bkey[i] ^ 0x36363636;
-    opad[i] = bkey[i] ^ 0x5C5C5C5C;
-  }
-
-  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
-  return core_md5(opad.concat(hash), 512 + 128);
-}
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
-function safe_add(x, y)
-{
-  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
-  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
-  return (msw << 16) | (lsw & 0xFFFF);
-}
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
-function bit_rol(num, cnt)
-{
-  return (num << cnt) | (num >>> (32 - cnt));
-}
-
-/*
- * Convert a string to an array of little-endian words
- * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
- */
-function str2binl(str)
-{
-  var bin = Array();
-  var mask = (1 << chrsz) - 1;
-  for(var i = 0; i < str.length * chrsz; i += chrsz)
-    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
-  return bin;
-}
-
-/*
- * Convert an array of little-endian words to a string
- */
-function binl2str(bin)
-{
-  var str = "";
-  var mask = (1 << chrsz) - 1;
-  for(var i = 0; i < bin.length * 32; i += chrsz)
-    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
-  return str;
-}
-
-/*
- * Convert an array of little-endian words to a hex string.
- */
-function binl2hex(binarray)
-{
-  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
-  var str = "";
-  for(var i = 0; i < binarray.length * 4; i++)
-  {
-    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
-           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
-  }
-  return str;
-}
-
-/*
- * Convert an array of little-endian words to a base-64 string
- */
-function binl2b64(binarray)
-{
-  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-  var str = "";
-  for(var i = 0; i < binarray.length * 4; i += 3)
-  {
-    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
-                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
-                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
-    for(var j = 0; j < 4; j++)
-    {
-      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
-      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
-    }
-  }
-  return str;
-}
diff --git a/OpenSRF/src/javascript/opensrf_app_session.js b/OpenSRF/src/javascript/opensrf_app_session.js
deleted file mode 100644 (file)
index 6baddea..0000000
+++ /dev/null
@@ -1,509 +0,0 @@
-/** @file oils_app_session.js
-  * @brief AppRequest and AppSession.
-  * The AppSession class does most of the communication work and the AppRequest 
-  * contains the top level client API.
-  */
-
-/** The default wait time when a client calls recv. It
-  * may be overrided by passing in a value to the recv method
-  */
-AppRequest.DEF_RECV_TIMEOUT = 10000;
-
-/** Provide a pre-built AppSession object and the payload of the REQUEST
-  * message you wish to send
-  */
-function AppRequest( session, payload ) {
-
-       /** Our controling session */
-       this.session = session;
-
-       /** This requests message thread trace */
-       this.thread_trace = null;
-
-       /** This request REQUEST payload */
-       this.payload = payload;
-
-       /** True if this request has completed is request cycle */
-       this.is_complete = false;
-
-       /** Stores responses received from requests */
-       this.recv_queue = new Array();
-}
-
-/** returns true if this AppRequest has completed its request cycle.  */
-AppRequest.prototype.complete = function() {
-       if( this.is_complete ) { return true; }
-       this.session.queue_wait(0);
-       return this.is_complete;
-}
-
-/** When called on an AppRequest object, its status will be
-  * set to complete regardless of its previous status
-  */
-AppRequest.prototype.set_complete = function() {
-       this.is_complete = true;
-}
-
-/** Returns the current thread trace */
-AppRequest.prototype.get_thread_trace = function() {
-       return this.thread_trace;
-}
-
-/** Pushes some payload onto the recv queue */
-AppRequest.prototype.push_queue = function( payload ) {
-       this.recv_queue.push( payload );
-}
-
-/** Returns the current payload of this request */
-AppRequest.prototype.get_payload = function() {
-       return this.payload;
-}
-
-/** Removes this request from the our AppSession's request bucket 
-  * Call this method when you are finished with a particular request 
-  */
-AppRequest.prototype.finish = function() {
-       this.session.remove_request( this );
-}
-
-
-/** Retrieves the current thread trace from the associated AppSession object,
-  * increments that session's thread trace, sets this AppRequest's thread trace
-  * to the new value.  The request is then sent.
-  */
-AppRequest.prototype.make_request = function() {
-       var tt = this.session.get_thread_trace();
-       this.session.set_thread_trace( ++tt );
-       this.thread_trace = tt;
-       this.session.add_request( this );
-       this.session.send( oilsMessage.REQUEST, tt, this.payload );
-}
-
-/** Checks the receive queue for message payloads.  If any are found, the first 
-  * is returned.  Otherwise, this method will wait at most timeout seconds for
-  * a message to appear in the receive queue.  Once it arrives it is returned.
-  * If no messages arrive in the timeout provided, null is returned.
-
-  * NOTE: timeout is in * milliseconds *
-  */
-
-AppRequest.prototype.recv = function( /*int*/ timeout ) {
-
-
-       if( this.recv_queue.length > 0 ) {
-               return this.recv_queue.shift();
-       }
-
-       if( this.is_complete ) { return null; }
-
-       if( timeout == null ) {
-               timeout = AppRequest.DEF_RECV_TIMEOUT;
-       }
-
-       while( timeout > 0 ) {
-
-               var start = new Date().getTime();
-               this.session.queue_wait( timeout );
-
-               if( this.recv_queue.length > 0 ) {
-                       return this.recv_queue.shift();
-               }
-
-               // shortcircuit the call if we're already complete
-               if( this.complete() ) { return null; }
-
-               new Logger().debug( "AppRequest looping in recv " 
-                               + this.get_thread_trace() + " with timeout " + timeout, Logger.DEBUG );
-
-               var end = new Date().getTime();
-               timeout -= ( end - start );
-       }
-
-       return null;
-}
-
-/** Resend this AppRequest's REQUEST message, useful for recovering
- * from disconnects, etc.
- */
-AppRequest.prototype.resend = function() {
-
-       new Logger().debug( "Resending msg with thread trace: " 
-                       + this.get_thread_trace(), Logger.DEBUG );
-       this.session.send( oilsMessage.REQUEST, this.get_thread_trace(), this.payload );
-}
-
-
-
-       
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// AppSession code
-// -----------------------------------------------------------------------------
-
-/** Global cach of AppSession objects */
-AppSession.session_cache = new Array();
-
-// -----------------------------------------------------------------------------
-// Session states
-// -----------------------------------------------------------------------------
-/** True when we're attempting to connect to a remte service */
-AppSession.CONNECTING  = 0; 
-/** True when we have successfully connected to a remote service */
-AppSession.CONNECTED           = 1;
-/** True when we have been disconnected from a remote service */
-AppSession.DISCONNECTED = 2;
-/** The current default method protocol */
-AppSession.PROTOCOL            = 1;
-
-/** Our connection with the outside world */
-AppSession.transport_handle = null;
-
-
-/** Returns the session with the given session id */
-AppSession.find_session = function(session_id) {
-       return AppSession.session_cache[session_id];
-}
-
-/** Adds the given session to the global cache */
-AppSession.push_session = function(session) {
-       AppSession.session_cache[session.get_session_id()] = session;
-}
-
-/** Deletes the session with the given session id from the global cache */
-AppSession.delete_session = function(session_id) {
-       AppSession.session_cache[session_id] = null;
-}
-
-/** Builds a new session.
-  * @param remote_service The remote service we want to make REQUEST's of
-  */
-function AppSession( remote_service ) {
-
-       if (arguments.length == 3) {
-               // it used to be AppSession( username, password, remote_service )
-               remote_service = arguments[2];
-       }
-
-       /** Our logger object */
-       this.logger = new Logger();
-
-       random_num = Math.random() + "";
-       random_num.replace( '.', '' );
-
-       /** Our session id */
-       this.session_id = new Date().getTime() + "" + random_num;
-
-       //this.auth = new userAuth( username, password );
-
-       /** Our AppRequest queue */
-       this.request_queue = new Array();
-
-       /** Our connectivity state */
-       this.state = AppSession.DISCONNECTED;
-
-       var config = new Config();
-       
-       /** The remote ID of the service we are communicating with as retrieved 
-         * from the config file
-        */
-       this.orig_remote_id = config.get_value( "remote_service/" + remote_service );
-       if( ! this.orig_remote_id ) { 
-               throw new oils_ex_config( "No remote service id for: " + remote_service );
-       }
-
-       /** The current remote ID of the service we are communicating with */
-       this.remote_id = this.orig_remote_id;
-
-       /** Our current request threadtrace, which is incremented with each 
-         * newly sent AppRequest */
-       this.thread_trace = 0;
-
-       /** Our queue of AppRequest objects */
-       this.req_queue = new Array();
-
-       /** Our queue of AppRequests that are awaiting a resend of their payload */
-       this.resend_queue = new Array();
-
-       // Build the transport_handle if if doesn't already exist
-       if( AppSession.transport_handle == null ) {
-               this.build_transport();
-       }
-
-       AppSession.push_session( this );
-
-}
-
-/** The transport implementation is loaded from the config file and magically
-  * eval'ed into an object.  All connection settings come from the client 
-  * config.
-  * * This should only be called by the AppSession constructor and only when
-  * the transport_handle is null.
-  */
-AppSession.prototype.build_transport = function() {
-
-       var config = new Config();
-       var transport_impl = config.get_value( "transport/transport_impl" );
-       if( ! transport_impl ) {
-               throw new oils_ex_config( "No transport implementation defined in config file" );
-       }
-
-       var username    = config.get_value( "transport/username" );
-       var password    = config.get_value( "transport/password" );
-       var this_host   = config.get_value( "system/hostname" );
-       var resource    = this_host + "_" + new Date().getTime();
-       var server              = config.get_value( "transport/primary" );
-       var port                        = config.get_value( "transport/port" );
-       var tim                 = config.get_value( "transport/connect_timeout" );
-       var timeout             = tim * 1000;
-
-       var eval_string = 
-               "AppSession.transport_handle = new " + transport_impl + "( username, password, resource );";
-
-       eval( eval_string );
-       
-       if( AppSession.transport_handle == null ) {
-               throw new oils_ex_config( "Transport implementation defined in config file is not valid" );
-       }
-
-       if( !AppSession.transport_handle.connect( server, port, timeout ) ) {
-               throw new oils_ex_transport( "Connection attempt to remote service timed out" );
-       }
-
-       if( ! AppSession.transport_handle.connected() ) {
-               throw new oils_ex_transport( "AppSession is unable to connect to the remote service" );
-       }
-}
-
-
-/** Adds the given AppRequest object to this AppSession's request queue */
-AppSession.prototype.add_request = function( req_obj ) {
-       new Logger().debug( "Adding AppRequest: " + req_obj.get_thread_trace(), Logger.DEBUG );
-       this.req_queue[req_obj.get_thread_trace()] = req_obj;
-}
-
-/** Removes the AppRequest object from this AppSession's request queue */
-AppSession.prototype.remove_request = function( req_obj ) {
-       this.req_queue[req_obj.get_thread_trace()] = null;
-}
-
-/** Returns the AppRequest with the given thread_trace */
-AppSession.prototype.get_request = function( thread_trace ) {
-       return this.req_queue[thread_trace];
-}
-
-
-/** Returns this AppSession's session id */
-AppSession.prototype.get_session_id = function() { 
-       return this.session_id; 
-}
-
-/** Resets the remote_id for the transport to the original remote_id retrieved
-  * from the config file
-  */
-AppSession.prototype.reset_remote = function() { 
-       this.remote_id = this.orig_remote_id; 
-}
-
-/** Returns the current message thread trace */
-AppSession.prototype.get_thread_trace = function() {
-       return this.thread_trace;
-}
-
-/** Sets the current thread trace */
-AppSession.prototype.set_thread_trace = function( tt ) {
-       this.thread_trace = tt;
-}
-
-/** Returns the state that this session is in (i.e. CONNECTED) */
-AppSession.prototype.get_state = function() {
-       return this.state;
-}
-
-/** Sets the session state.  The state should be one of the predefined 
-  * session AppSession session states.
-  */
-AppSession.prototype.set_state = function(state) {
-       this.state = state;
-}
-
-/** Returns the current remote_id for this session */
-AppSession.prototype.get_remote_id = function() {
-       return this.remote_id;
-}
-
-/** Sets the current remote_id for this session */
-AppSession.prototype.set_remote_id = function( id ) {
-       this.remote_id = id;
-}
-
-/** Pushes an AppRequest object onto the resend queue */
-AppSession.prototype.push_resend = function( app_request ) {
-       this.resend_queue.push( app_request );
-}
-
-/** Destroys the current session.  This will disconnect from the
-  * remote service, remove all AppRequests from the request
-  * queue, and finally remove this session from the global cache
-  */
-AppSession.prototype.destroy = function() {
-
-       new Logger().debug( "Destroying AppSession: " + this.get_session_id(), Logger.DEBUG );
-
-       // disconnect from the remote service
-       if( this.get_state() != AppSession.DISCONNECTED ) {
-               this.disconnect();
-       }
-       // remove us from the global cache
-       AppSession.delete_session( this.get_session_id() );
-
-       // Remove app request references
-       for( var index in this.req_queue ) {
-               this.req_queue[index] = null;
-       }
-}
-
-/** This forces a resend of all AppRequests that are currently 
-  * in the resend queue
-  */
-AppSession.prototype.flush_resend = function() {
-
-       if( this.resend_queue.length > 0 ) {
-               new Logger().debug( "Resending " 
-                       + this.resend_queue.length + " messages", Logger.INFO );
-       }
-
-       var req = this.resend_queue.shift();
-
-       while( req != null ) {
-               req.resend();
-               req = this.resend_queue.shift();
-       }
-}
-
-/** This method tracks down the AppRequest with the given thread_trace and 
-  * pushes the payload into that AppRequest's recieve queue.
-  */
-AppSession.prototype.push_queue = function( dom_payload, thread_trace ) {
-
-       var req = this.get_request( thread_trace );
-       if( ! req ) {
-               new Logger().debug( "No AppRequest exists for TT: " + thread_trace, Logger.ERROR );
-               return;
-       }
-       req.push_queue( dom_payload );
-}
-
-
-/** Connect to the remote service.  The connect timeout is read from the config.
-  * This method returns null if the connection fails.  It returns a reference
-  * to this AppSession object otherwise.
-  */
-AppSession.prototype.connect = function() {
-
-       if( this.get_state() == AppSession.CONNECTED ) { 
-               return this;
-       }
-
-       var config = new Config();
-       var rem = config.get_value( "transport/connect_timeout" );
-       if( ! rem ) {
-               throw new oils_ex_config( "Unable to retreive timeout value from config" );
-       }
-
-       var remaining = rem * 1000; // milliseconds
-
-       this.reset_remote();
-       this.set_state( AppSession.CONNECTING );
-       this.send( oilsMessage.CONNECT, 0, "" );
-
-       new Logger().debug( "CONNECTING with timeout: " + remaining, Logger.DEBUG );
-
-       while( this.get_state() != AppSession.CONNECTED && remaining > 0 ) {
-
-               var starttime = new Date().getTime();
-               this.queue_wait( remaining );
-               var endtime = new Date().getTime();
-               remaining -= (endtime - starttime);
-       }
-
-       if( ! this.get_state() == AppSession.CONNECTED ) {
-               return null;
-       }
-
-       return this;
-}
-
-/** Disconnects from the remote service */
-AppSession.prototype.disconnect = function() {
-
-       if( this.get_state() == AppSession.DISCONNECTED ) {
-               return;
-       }
-
-       this.send( oilsMessage.DISCONNECT, this.get_thread_trace(), "" );
-       this.set_state( AppSession.DISCONNECTED );
-       this.reset_remote();
-}
-
-
-/** Builds a new message with the given type and thread_trace.  If the message
-  * is a REQUEST, then the payload is added as well.
-  * This method will verify that the session is in the CONNECTED state before
-  * sending any REQUEST's by attempting to do a connect.
-  *
-  * Note: msg_type and thread_trace must be provided.
-  */
-AppSession.prototype.send = function( msg_type, thread_trace, payload ) {
-
-       if( msg_type == null || thread_trace == null ) {
-               throw new oils_ex_args( "Not enough arguments provided to AppSession.send method" );
-       }
-
-       // go ahead and make sure there's nothing new to process
-       this.queue_wait(0);
-
-       var msg;
-       msg = new oilsMessage( msg_type, AppSession.PROTOCOL );
-
-       msg.setThreadTrace( thread_trace );
-
-       if( msg_type == oilsMessage.REQUEST ) {
-               if( ! payload ) {
-                       throw new oils_ex_args( "No payload provided for REQUEST message in AppSession.send" );
-               }
-               msg.add( payload );
-       }
-
-
-       // Make sure we're connected
-       if( (msg_type != oilsMessage.DISCONNECT) && (msg_type != oilsMessage.CONNECT) &&
-                       (this.get_state() != AppSession.CONNECTED) ) {
-               if( ! this.connect() ) {
-                       throw new oils_ex_session( this.get_session_id() + " | Unable to connect to remote service after redirect" );
-               }
-       }
-
-       this.logger.debug( "AppSession sending tt: " 
-                       + thread_trace + " to " + this.get_remote_id() 
-                       + " " +  msg_type , Logger.INFO );
-
-       AppSession.transport_handle.send( this.get_remote_id(), this.get_session_id(), msg.toString(true) );
-
-}
-
-
-/** Waits up to 'timeout' milliseconds for some data to arrive.
-  * Any data that arrives will be process according to its
-  * payload and message type.  This method will return after
-  * any data has arrived.
-  * @param timeout How many milliseconds to wait or data to arrive
-  */
-AppSession.prototype.queue_wait = function( timeout ) {
-       this.flush_resend(); // necessary if running parallel sessions 
-       new Logger().debug( "In queue_wait " + timeout, Logger.DEBUG );
-       var tran_msg = AppSession.transport_handle.process_msg( timeout );
-       this.flush_resend();
-}
-
-
-
diff --git a/OpenSRF/src/javascript/opensrf_config.js b/OpenSRF/src/javascript/opensrf_config.js
deleted file mode 100644 (file)
index 39037ea..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/** @file oils_config.js
-  * Config code and Logger code
-  * The config module is simple.  It parses an xml config file and 
-  * the values from the file are accessed via XPATH queries.
-  */
-
-/** Searches up from Mozilla's chrome directory for the client 
-  * config file and returns the file object
-  */
-function get_config_file() {
-
-       var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
-               getService( Components.interfaces.nsIProperties );
-
-       chromeDir = dirService.get( "AChrom",  Components.interfaces.nsIFile );
-       chromeDir.append(myPackageDir);
-       chromeDir.append("content");
-       chromeDir.append("conf");
-       chromeDir.append("client_config.xml");
-       return chromeDir;
-
-}
-
-
-/** Constructor. You may provide an optional path to the config file. **/
-function Config( config_file ) {
-
-       if( Config.config != null ) { return Config.config; }
-
-       config_file = get_config_file();
-
-       // ------------------------------------------------------------------
-       // Grab the data from the config file
-       // ------------------------------------------------------------------
-       var data = "";
-       var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileInputStream);
-
-       var sstream = Components.classes["@mozilla.org/scriptableinputstream;1"]
-                       .createInstance(Components.interfaces.nsIScriptableInputStream);
-
-       fstream.init(config_file, 1, 0, false);
-       sstream.init(fstream);
-       data += sstream.read(-1);
-
-       sstream.close();
-       fstream.close();
-       
-       
-
-       var DOMParser = new Components.Constructor(
-               "@mozilla.org/xmlextras/domparser;1", "nsIDOMParser" );
-
-       this.config_doc = new DOMParser().parseFromString( data, "text/xml" );
-
-       Config.config = this;
-
-}
-
-/** Returns the value stored in the config file found with the
-  * given xpath expression
-  * E.g.  config.get_value( "/oils_config/dirs/log_dir" );
-  * Note, the 'oils_config' node is the base of the xpath expression,
-  * so something like this will also work:
-  * config.get_value( "dirs/log_dir" );
-  */
-Config.prototype.get_value = function( xpath_query ) {
-
-       var evaluator = Components.classes["@mozilla.org/dom/xpath-evaluator;1"].
-               createInstance( Components.interfaces.nsIDOMXPathEvaluator );
-
-       var xpath_obj = evaluator.evaluate( xpath_query, this.config_doc.documentElement, null, 0, null );
-       if( ! xpath_obj ) { return null; }
-
-       var node = xpath_obj.iterateNext();
-       if( node == null ) {
-               throw new oils_ex_config( "No config option matching " + xpath_query );
-       }
-
-       return node.firstChild.nodeValue;
-}      
-
-
-
-
-
-
-// ------------------------------------------------------------------
-// Logger code.
-// ------------------------------------------------------------------
-/** The global logging object */
-Logger.logger          = null;
-/** No logging level */
-Logger.NONE                    = 0;
-/** Error log level */
-Logger.ERROR           = 1;
-/** Info log level */
-Logger.INFO                    = 2;
-/* Debug log level */
-Logger.DEBUG           = 3;
-
-/** There exists a single logger object that all components share.
-  * Calling var logger = new Logger() will return the same one
-  * with each call.  This is so we only need one file handle for
-  * each type of log file.
-  */
-function Logger() {
-
-       if( Logger.logger != null ) { return Logger.logger }
-
-       var config = new Config();
-       this.log_level = config.get_value( "system/log_level" );
-
-       this.stdout_log = config.get_value( "system/stdout_log" );
-
-       if( ! this.stdout_log || this.stdout_log < 0 || this.stdout_log > 2 ) {
-               throw new oils_ex_config( "stdout_log setting is invalid: " + this.stdout_log + 
-                               ". Should be 0, 1, or 2." );
-       }
-
-       // ------------------------------------------------------------------
-       // Load up all of the log files
-       // ------------------------------------------------------------------
-       var transport_file = config.get_value( "logs/transport" );
-       if( transport_file == null ) {
-               throw new oils_ex_config( "Unable to load transport log file: 'logs/transport'" );
-       }
-
-       var debug_file = config.get_value( "logs/debug" );
-       if( debug_file == null ) {
-               throw new oils_ex_config( "Unable to load debug log file: 'logs/debug'" );
-       }
-       
-       var error_file = config.get_value( "logs/error" );
-       if( error_file == null ) {
-               throw new oils_ex_config( "Unable to load debug log file: 'logs/error'" );
-       }
-
-
-       // ------------------------------------------------------------------
-       // Build the file objects
-       // ------------------------------------------------------------------
-       var transport_file_obj = Logger.get_log_file( transport_file );
-
-       var debug_file_obj = Logger.get_log_file( debug_file );
-
-       var error_file_obj = Logger.get_log_file( error_file );
-
-
-       // ------------------------------------------------------------------
-       // Build all of the file stream objects
-       // ------------------------------------------------------------------
-       this.transport_stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileOutputStream);
-
-       this.debug_stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileOutputStream);
-
-       this.error_stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                       .createInstance(Components.interfaces.nsIFileOutputStream);
-
-       // ------------------------------------------------------------------
-       // Init all of the streams
-       // use 0x02 | 0x10 to open file for appending.
-       // ------------------------------------------------------------------
-       this.transport_stream.init(transport_file_obj,  0x02 | 0x10 | 0x08, 0664, 0 ); 
-       this.debug_stream.init( debug_file_obj,                 0x02 | 0x10 | 0x08, 0664, 0 ); 
-       this.error_stream.init( error_file_obj,                 0x02 | 0x10 | 0x08, 0664, 0 ); 
-
-       Logger.logger = this;
-
-}
-
-/** Internal.  Returns a XPCOM nsIFile object for the log file we're interested in */
-Logger.get_log_file = function( log_name ) {
-
-       var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
-               getService( Components.interfaces.nsIProperties );
-
-       logFile = dirService.get( "AChrom",  Components.interfaces.nsIFile );
-       logFile.append(myPackageDir);
-       logFile.append("content");
-       logFile.append("log");
-       logFile.append( log_name );
-
-       if( ! logFile.exists() ) {
-               logFile.create( 0, 0640 );
-       }
-
-       return logFile;
-}
-
-
-
-/** Internal. Builds a log message complete with data, etc. */
-Logger.prototype.build_string = function( message, level ) {
-
-       if( ! (message && level) ) { return null; }
-
-       var lev = "INFO";
-       if( level == Logger.ERROR ) { lev = "ERROR"; }
-       if( level == Logger.DEBUG ) { lev = "DEBUG"; }
-
-       var date                = new Date();
-       var year                = date.getYear();
-       year += 1900;
-
-       var month       = ""+date.getMonth();
-       if(month.length==1) {month="0"+month;}
-       var day         = ""+date.getDate();
-       if(day.length==1) {day="0"+day;}
-       var hour                = ""+date.getHours();
-       if(hour.length== 1){hour="0"+hour;}
-       var min         = ""+date.getMinutes();
-       if(min.length==1){min="0"+min;}
-       var sec         = ""+date.getSeconds();
-       if(sec.length==1){sec="0"+sec;}
-       var mil         = ""+date.getMilliseconds();
-       if(mil.length==1){sec="0"+sec;}
-
-       var date_string = year + "-" + month + "-" + day + " " + 
-               hour + ":" + min + ":" + sec + "." + mil;
-
-       var str_array = message.split('\n');
-       var ret_array = new Array();
-       for( var i in str_array ) {
-               ret_str = "[" + date_string +  "] " + lev + " " + str_array[i] + "\n";
-               ret_array.push( ret_str );
-       }
-
-       var line = "-------------------------\n";
-       ret_array.unshift( line );
-
-       return ret_array;
-}
-
-/** Internal. Does the actual writing */
-Logger.prototype._log = function( data, stream, level ) {
-
-       if( ! data ) { return; }
-       if( ! stream ) { 
-               throw oils_ex_logger( "No file stream open for log message: " + data ); 
-       }
-       if( ! level ) { level = Logger.DEBUG; }
-
-       if( level > this.log_level ) { return; }
-       var str_array = this.build_string( data, level );
-       if( ! str_array ) { return; }
-
-       for( var i in str_array ) {
-               if( this.stdout_log > 0 ) { dump( str_array[i] ); }
-               if( this.stdout_log < 2 ) { stream.write( str_array[i], str_array[i].length ); }
-       }
-
-       // write errors to the error log if they were destined for anywhere else
-       if( level == Logger.ERROR && stream != this.error_stream ) {
-               for( var i in str_array ) {
-                       if( this.stdout_log > 0 ) { dump( str_array[i] ); }
-                       if( this.stdout_log < 2 ) { this.error_stream.write( str_array[i], str_array[i].length ); }
-               }
-       }
-}
-       
-
-
-/** Writes the message to the error log */
-Logger.prototype.error = function( message, level ) {
-       this._log( message, this.error_stream, level );
-}
-
-
-/** Writes to the debug log */
-Logger.prototype.debug = function( message, level ) {
-       this._log( message, this.debug_stream, level );
-}
-
-
-/** Writes to the transport log */
-Logger.prototype.transport = function( message, level ) {
-       this._log( message, this.transport_stream, level );
-}
diff --git a/OpenSRF/src/javascript/opensrf_dom_element.js b/OpenSRF/src/javascript/opensrf_dom_element.js
deleted file mode 100644 (file)
index 2e419e3..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-/** @file oils_dom_element.js
-  * -----------------------------------------------------------------------------
-  * This file holds all of the core OILS DOM elements.
-  *  -----------------------------------------------------------------------------
-
-  * -----------------------------------------------------------------------------
-  * Make sure you load md5.js into  your script/html/etc. before loading this 
-  * file
-  * -----------------------------------------------------------------------------
-  * 
-  * -----------------------------------------------------------------------------
-  * 1. Use these if you are running via xpcshell, but not if you are running
-  *    directly from mozilla.
-  * 2. BTW. XMLSerializer doesn't like being run outside of mozilla, so
-  *            toString() fails.
-  * 
-  * var DOMParser = new Components.Constructor(
-  *            "@mozilla.org/xmlextras/domparser;1", "nsIDOMParser" );
-  * 
-  *    var XMLSerializer = new Components.Constructor(
-  *            "@mozilla.org/xmlextras/xmlserializer;1", "nsIDOMSerializer" );
-  *  -----------------------------------------------------------------------------
-  * 
-  * 
-  */
-
-/**
-  *  -----------------------------------------------------------------------------
-  *  DOM - Top level generic class
-  *  -----------------------------------------------------------------------------
-  */
-
-function DOM() { 
-       this.doc = null; 
-       this.root = null;
-       this.element = null;
-}
-
-/** Returns a string representation of the XML doc.  If full_bool
-  * is true, it will return the entire doc and not just the relevant
-  * portions (i.e. our object's element).
-  */
-DOM.prototype.toString = function(full_bool) {
-       if( full_bool ) {
-               return new XMLSerializer().serializeToString(this.doc);
-       } else {
-               return new XMLSerializer().serializeToString(this.element);
-       }
-}
-
-/** Initializes a document and sets this.doc, this.root and this.element */
-DOM.prototype.init = function( elementName ) {
-       
-       this.doc = new DOMParser().parseFromString( 
-               "<?xml version='1.0' encoding='UTF-8'?><oils:root xmlns:oils='http://open-ils.org/namespaces/oils_v1'></oils:root>", "text/xml" );
-       this.root = this.doc.documentElement;
-       this.element = this.doc.createElement( "oils:" + elementName );
-       return this.element;
-}
-
-/** Good for creating objects from raw xml.  This builds a new doc and inserts
-  * the node provided.  So you can build a dummy object, then call replaceNode  
-  * with the new xml to build an object from XML on the fly.
-  */
-DOM.prototype._replaceNode = function( name, new_element ) {
-
-       var node = this.doc.importNode( new_element, true );
-
-       if( node.nodeName != "oils:" + name ) {
-               throw new oils_ex_dom( "Invalid Tag to " + name + "::replaceNode()" );
-       }
-
-       this.doc = new DOMParser().parseFromString( 
-               "<?xml version='1.0' encoding='UTF-8'?><oils:root xmlns:oils='http://open-ils.org/namespaces/oils_v1'></oils:root>", "text/xml" );
-       this.root = this.doc.documentElement;
-
-       this.root.appendChild( node );
-       this.element = this.root.firstChild;
-       return this;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// domainObjectAttr
-// -----------------------------------------------------------------------------
-
-domainObjectAttr.prototype     = new DOM();
-domainObjectAttr.prototype.constructor = domainObjectAttr;
-domainObjectAttr.baseClass     = DOM.prototype.constructor;
-
-/** A domainObjectAttr is a single XML node with 'name' and 'value' attributes */
-function domainObjectAttr( name, value ) {
-
-       var node = this.init( "domainObjectAttr" );
-       if( ! name && value ) { return; }
-       node.setAttribute( "name", name );
-       node.setAttribute( "value", value );
-       this.root.appendChild( node );
-}
-
-
-/** Returns the attribute name */
-domainObjectAttr.prototype.getName = function() {
-       return this.element.getAttribute("name"); 
-}
-
-/** Returns the attribut value. */
-domainObjectAttr.prototype. getValue = function() {
-       return this.element.getAttribute("value"); 
-}
-
-/** Sets the attribute value. */
-domainObjectAttr.prototype. setValue = function( value ) {
-       return this.element.setAttribute("value", value ); 
-}
-
-/** Pass in the this.element component of a domainObjectAttr and this will
-  * replace the old element with the new one 
-  */
-domainObjectAttr.prototype.replaceNode = function( domainObjectAttr_element ) {
-       return this._replaceNode( "domainObjectAttr", domainObjectAttr_element );
-}
-
-// -----------------------------------------------------------------------------
-// userAuth
-// -----------------------------------------------------------------------------
-
-
-userAuth.prototype = new DOM();
-userAuth.prototype.constructor = userAuth;
-userAuth.baseClass = DOM.prototype.constructor;
-
-function userAuth( username, secret ) {
-
-       var node = this.init( "userAuth" );
-       if( !( username && secret) ) { return; }
-       node.setAttribute( "username", username );
-
-       //There is no way to specify the hash seed with the 
-       //md5 utility provided
-       var hash = hex_md5( secret );
-       node.setAttribute( "secret", hash );
-       node.setAttribute( "hashseed", "" ); 
-
-       this.root.appendChild( node );
-}
-
-userAuth.prototype.getUsername = function() {
-       return this.element.getAttribute( "username" );
-}
-
-userAuth.prototype.getSecret = function() {
-       return this.element.getAttribute( "secret" );
-}
-
-userAuth.prototype.getHashseed = function() {
-       return this.element.getAttribute( "hashseed" );
-}
-
-userAuth.prototype.replaceNode = function( userAuth_element ) {
-       return this._replaceNode( "userAuth", userAuth_element );
-}
-
-
-// -----------------------------------------------------------------------------
-// domainObject
-// -----------------------------------------------------------------------------
-
-domainObject.prototype = new DOM(); 
-domainObject.baseClass = DOM.prototype.constructor;
-domainObject.prototype.constructor = domainObject;
-
-/** Holds the XML for a DomainObject (see oils_domain_object.js or the DomainObject class) */
-function domainObject( name ) {
-       this._init_domainObject( name ); 
-}
-
-/** Initializes the domainObject XML node */
-domainObject.prototype._init_domainObject = function( name ) {
-
-       var node = this.init( "domainObject" );
-
-       if( ! name ) { return; }
-       node.setAttribute( "name", name );
-       this.root.appendChild( node ); 
-
-}
-
-/** Pass in any DOM Element or DomainObject and this method will as the
-  * new object as the next child of the root (domainObject) node 
-  */
-domainObject.prototype.add = function( new_DOM ) {
-
-       this.element.appendChild( 
-                       new_DOM.element.cloneNode( true ) );
-}
-
-/** Removes the original domainObject XML node and replaces it with the
-  * one provided.  This is useful for building new domainObject's from
-  * raw xml.  Just create a new one, then call replaceNode with the new XML.
-  */
-domainObject.prototype.replaceNode = function( domainObject_element ) {
-       return this._replaceNode( "domainObject", domainObject_element );
-}
-
-
-
-// -----------------------------------------------------------------------------
-// Param 
-// -----------------------------------------------------------------------------
-
-
-param.prototype = new DOM();
-param.baseClass = DOM.prototype.constructor;
-param.prototype.constructor = param;
-
-function param( value ) {
-       var node = this.init( "param" );
-       node.appendChild( this.doc.createTextNode( value ) );
-       this.root.appendChild( node );
-}
-
-param.prototype.getValue = function() {
-       return this.element.textContent;
-}
-
-param.prototype.replaceNode = function( param_element ) {
-       return this._replaceNode( "param", param_element );
-}
-
-
-// -----------------------------------------------------------------------------
-// domainObjectCollection
-// -----------------------------------------------------------------------------
-
-domainObjectCollection.prototype = new DOM();
-domainObjectCollection.prototype.constructor = 
-       domainObjectCollection;
-domainObjectCollection.baseClass = DOM.prototype.constructor;
-
-function domainObjectCollection( name ) {
-       var node = this.init( "domainObjectCollection" );       
-       this.root.appendChild( node );
-       if(name) { this._initCollection( name ); }
-}
-
-domainObjectCollection.prototype._initCollection = function( name ) {
-       if( name ) {
-               this.element.setAttribute( "name", name );
-       }
-}
-
-domainObjectCollection.prototype.add = function( new_domainObject ) {
-       this.element.appendChild( 
-                       new_domainObject.element.cloneNode( true ) );
-}
-
-domainObjectCollection.prototype.replaceNode = function( new_node ) {
-       return this._replaceNode( "domainObjectCollection", new_node );
-}
-
-
diff --git a/OpenSRF/src/javascript/opensrf_domain_object.js b/OpenSRF/src/javascript/opensrf_domain_object.js
deleted file mode 100644 (file)
index 54b3e6f..0000000
+++ /dev/null
@@ -1,627 +0,0 @@
-// -----------------------------------------------------------------------------
-// This houses all of the domain object code.
-// -----------------------------------------------------------------------------
-
-
-
-
-// -----------------------------------------------------------------------------
-// DomainObject 
-
-DomainObject.prototype                                 = new domainObject();
-DomainObject.prototype.constructor     = DomainObject;
-DomainObject.prototype.baseClass               = domainObject.prototype.constructor;
-
-/** Top level DomainObject class.  This most provides convience methods
-  * and a shared superclass
-  */
-function DomainObject( name ) {
-       if( name ) { this._init_domainObject( name ); }
-}
-
-/** Returns the actual element of the given domainObjectAttr. */
-DomainObject.prototype._findAttr = function ( name ) {
-       
-       var nodes = this.element.childNodes;
-
-       if( ! nodes || nodes.length < 1 ) {
-               throw new oils_ex_dom( "Invalid xml object in _findAttr: " + this.toString() );
-       }
-
-       var i=0;
-       var node = nodes.item(i);
-
-       while( node != null ) {
-
-               if( node.nodeName == "oils:domainObjectAttr" &&
-                               node.getAttribute("name") == name ) {
-                       return node;
-               }
-
-               node = nodes.item(++i);
-       }
-
-       return null;
-}
-
-
-
-
-/** Returns the value stored in the given attribute */
-DomainObject.prototype.getAttr = function ( name ) {
-
-       var node = this._findAttr( name );
-       if( node ) { return node.getAttribute( "value" ); }
-       else { 
-               throw new oils_ex_dom( "getAttr(); Getting nonexistent attribute: " + name ); 
-       }
-}
-
-/** Updates the value held by the given attribute */
-DomainObject.prototype.setAttr = function ( name, value ) {
-
-       var node = this._findAttr( name );
-       if( node ) {
-               node.setAttribute( "value", value );
-       } else { 
-               throw new oils_ex_dom( "setAttr(); Setting nonexistent attribute: " + name ); 
-       }
-}
-
-/** This takes a raw DOM Element node and creates the DomainObject that the node
-  * embodies and returns the object.  All new DomainObjects should be added to
-  * this list if they require this type of dynamic functionality.
-  * NOTE Much of this will be deprecated as move to a more JSON-centric wire protocol
-  */
-DomainObject.newFromNode = function( node ) {
-
-       switch( node.getAttribute("name") ) {
-
-               case "oilsMethod":
-                       return new oilsMethod().replaceNode( node );
-               
-               case "oilsMessage":
-                       return new oilsMessage().replaceNode( node );
-
-               case "oilsResponse":
-                       return new oilsResponse().replaceNode( node );
-
-               case "oilsResult":
-                       return new oilsResult().replaceNode( node );
-
-               case "oilsConnectStatus":
-                       return new oilsConnectStatus().replaceNode( node );
-
-               case "oilsException":
-                       return new oilsException().replaceNode( node );
-
-               case "oilsMethodException":
-                       return new oilsMethodException().replaceNode( node );
-
-               case "oilsBrokenSession":
-                       return new oilsBrokenSession().replaceNode( node );
-
-               case "oilsScalar":
-                       return new oilsScalar().replaceNode( node );
-
-               case "oilsPair":
-                       return new oilsPair().replaceNode( node );
-
-               case "oilsArray":
-                       return new oilsArray().replaceNode( node );
-
-               case "oilsHash":
-                       return new oilsHash().replaceNode( node );
-
-
-       }
-
-}
-
-
-
-// -----------------------------------------------------------------------------
-// oilsMethod
-
-oilsMethod.prototype = new DomainObject();
-oilsMethod.prototype.constructor = oilsMethod;
-oilsMethod.prototype.baseClass = DomainObject.prototype.constructor;
-
-/**
-  * oilsMethod Constructor
-  * 
-  * @param method_name The name of the method your are sending
-  * to the remote server
-  * @param params_array A Javascript array of the params (any
-  * Javascript data type)
-  */
-
-function oilsMethod( method_name, params_array ) {
-       this._init_domainObject( "oilsMethod" );
-       this.add( new domainObjectAttr( "method", method_name ) );
-
-       if( params_array ) {
-               var params = this.doc.createElement( "oils:params" );
-               this.element.appendChild( params ); 
-               params.appendChild( this.doc.createTextNode( 
-                               js2JSON( params_array ) ) ); 
-       }
-}
-
-
-/** Locates the params node of this method */
-oilsMethod.prototype._getParamsNode = function() {
-
-       var nodes = this.element.childNodes;
-       if( ! nodes || nodes.length < 1 ) { return null; }
-       var x=0;
-       var node = nodes.item(x);
-       while( node != null ) {
-               if( node.nodeName == "oils:params" ) {
-                       return node;
-               }
-               node = nodes.item(++x);
-       }
-
-       return null;
-}
-
-
-/** Returns an array of param objects  */
-oilsMethod.prototype.getParams = function() {
-       var node = this._getParamsNode();
-       if(node != null ) { 
-               return JSON2js( node.textContent ); 
-       }
-}
-
-
-
-// -----------------------------------------------------------------------------
-// oilsMessage
-
-// -----------------------------------------------------------------------------
-// oilsMessage message types
-// -----------------------------------------------------------------------------
-/** CONNECT Message type */
-oilsMessage.CONNECT            = 'CONNECT';
-/** DISCONNECT Message type */
-oilsMessage.DISCONNECT = 'DISCONNECT';
-/** STATUS Message type */
-oilsMessage.STATUS             = 'STATUS';
-/** REQUEST Message type */
-oilsMessage.REQUEST            = 'REQUEST';
-/** RESULT Message type */
-oilsMessage.RESULT             = 'RESULT';
-
-
-oilsMessage.prototype = new DomainObject();
-oilsMessage.prototype.constructor = oilsMessage;
-oilsMessage.prototype.baseClass = DomainObject.prototype.constructor;
-
-/** Core XML object for message passing */
-function oilsMessage( type, protocol ) {
-
-       if( !( type && protocol) ) { 
-               type = oilsMessage.CONNECT; 
-               protocol = "1";
-       }
-
-       if( ! ( type == oilsMessage.CONNECT             ||
-                               type == oilsMessage.DISCONNECT  ||
-                               type == oilsMessage.STATUS                      ||
-                               type == oilsMessage.REQUEST             ||
-                               type == oilsMessage.RESULT      ) ) {
-               throw new oils_ex_message( "Attempt to create oilsMessage with incorrect type: " + type );
-       }
-
-       this._init_domainObject( "oilsMessage" );
-
-       this.add( new domainObjectAttr( "type", type ) );
-       this.add( new domainObjectAttr( "threadTrace", 0 ) );
-       this.add( new domainObjectAttr( "protocol", protocol ) );       
-
-       // user_auth used to be a parameter for oilsMessage
-       //if( user_auth ) { this.add( user_auth ); }
-
-}
-
-/** Builds a new oilsMessage from raw xml.
-  * Checks are taken to make sure the xml is supposed to be an oilsMessage.  
-  * If not, an oils_ex_dom exception is throw.
-  */
-oilsMessage.newFromXML = function( xml ) {
-
-       try {
-
-               if( ! xml || xml == "" ) { throw 1; }
-
-               var doc = new DOMParser().parseFromString( xml, "text/xml" );
-               if( ! doc ) { throw 1; }
-
-               var root = doc.documentElement;
-               if( ! root ) { throw 1; }
-
-               // -----------------------------------------------------------------------------
-               // There are two options here.  One is that we were provided the full message
-               // xml (i.e. contains the <oils:root> tag.  The other option is that we were
-               // provided just the message xml portion (top level element is the 
-               // <oils:domainObject>
-               // -----------------------------------------------------------------------------
-               
-               var element;
-               if( root.nodeName == "oils:root"  ) { 
-
-                       element = root.firstChild;
-                       if( ! element ) { throw 1; }
-
-               } else { 
-
-                       if( root.nodeName == "oils:domainObject" ) { 
-                               element = root;
-
-                       } else { throw 1; }
-
-               }
-
-
-               if( element.nodeName != "oils:domainObject" ) { throw 1; } 
-               if( element.getAttribute( "name" ) != "oilsMessage" ) { throw 1; }
-
-               return new oilsMessage().replaceNode( element );
-
-       } catch( E ) {
-
-               if( E && E.message ) {
-                       throw new oils_ex_dom( "Bogus XML for creating oilsMessage: " + E.message + "\n" + xml );
-
-               } else {
-                       throw new oils_ex_dom( "Bogus XML for creating oilsMessage:\n" + xml );
-               }
-       }
-
-       return msg;
-}
-
-
-
-/** Adds a copy of the given DomainObject to the message */
-oilsMessage.prototype.addPayload = function( new_DomainObject ) {
-       this.add( new_DomainObject );
-}
-
-
-/** Returns the top level DomainObject contained in this message
-  *
-  * Note:  The object retuturned will be the actual object, not just a 
-  * generic DomainObject - e.g. oilsException.
-  */
-oilsMessage.prototype.getPayload = function() {
-       
-       var nodes = this.element.childNodes;
-       var x=0;
-       var node = nodes.item(0);
-
-       while( node != null ) {
-
-               if( node.nodeName == "oils:domainObject" ) {
-
-                       new Logger().debug( "Building oilsMessage payload from\n" + 
-                               new XMLSerializer().serializeToString( node ), Logger.DEBUG );
-                       return DomainObject.newFromNode( node );
-               }
-               node = nodes.item(++x);
-       }
-
-       return null;
-}
-
-oilsMessage.prototype.getUserAuth = function() {
-
-       var nodes = this.element.getElementsByTagName( "oils:userAuth" );
-       if( ! nodes ) { return null; }
-
-       var auth_elem = nodes.item(0); // should only be one
-       if ( ! auth_elem ) { return null; }
-
-       return new userAuth().replaceNode( auth_elem );
-
-}
-
-/** Returns the type of the message */
-oilsMessage.prototype.getType = function() {
-       return this.getAttr( "type" );
-}
-
-/** Returns the message protocol */
-oilsMessage.prototype.getProtocol = function() {
-       return this.getAttr( "protocol" );
-}
-
-/** Returns the threadTrace */
-oilsMessage.prototype.getThreadTrace = function() {
-       return this.getAttr( "threadTrace" );
-}
-
-/** Sets the thread trace - MUST be an integer */
-oilsMessage.prototype.setThreadTrace = function( trace ) {
-       this.setAttr( "threadTrace", trace );
-}
-
-/** Increments the thread trace by 1 */
-oilsMessage.prototype.updateThreadTrace = function() {
-       var tt = this.getThreadTrace();
-       return this.setThreadTrace( ++tt );
-}
-
-
-
-
-
-// -----------------------------------------------------------------------------
-// oilsResponse
-
-
-// -----------------------------------------------------------------------------
-// Response codes
-// -----------------------------------------------------------------------------
-
-/**
-  * Below are the various response statuses
-  */
-oilsResponse.STATUS_CONTINUE                                           = 100
-
-oilsResponse.STATUS_OK                                                         = 200
-oilsResponse.STATUS_ACCEPTED                                           = 202
-oilsResponse.STATUS_COMPLETE                                           = 205
-
-oilsResponse.STATUS_REDIRECTED                                 = 307
-
-oilsResponse.STATUS_BADREQUEST                                 = 400
-oilsResponse.STATUS_UNAUTHORIZED                                       = 401
-oilsResponse.STATUS_FORBIDDEN                                          = 403
-oilsResponse.STATUS_NOTFOUND                                           = 404
-oilsResponse.STATUS_NOTALLOWED                                 = 405
-oilsResponse.STATUS_TIMEOUT                                            = 408
-oilsResponse.STATUS_EXPFAILED                                          = 417
-oilsResponse.STATUS_INTERNALSERVERERROR                = 500
-oilsResponse.STATUS_NOTIMPLEMENTED                             = 501
-oilsResponse.STATUS_VERSIONNOTSUPPORTED                = 505
-
-
-oilsResponse.prototype = new DomainObject();
-oilsResponse.prototype.constructor = oilsResponse;
-oilsResponse.prototype.baseClass = DomainObject.prototype.constructor;
-
-/** Constructor.  status is the text describing the message status and
-  * statusCode must correspond to one of the oilsResponse status code numbers
-  */
-function oilsResponse( name, status, statusCode ) {
-       if( name && status && statusCode ) {
-               this._initResponse( name, status, statusCode );
-       }
-}
-
-/** Initializes the reponse XML */
-oilsResponse.prototype._initResponse = function( name, status, statusCode ) {
-
-       this._init_domainObject( name );
-       this.add( new domainObjectAttr( "status", status ));
-       this.add( new domainObjectAttr( "statusCode", statusCode ) );
-}
-
-
-
-/** Returns the status of the response */
-oilsResponse.prototype.getStatus = function() {
-       return this.getAttr( "status" );
-}
-
-/** Returns the statusCode of the response */
-oilsResponse.prototype.getStatusCode = function() {
-       return this.getAttr("statusCode");
-}
-
-
-oilsConnectStatus.prototype = new oilsResponse();
-oilsConnectStatus.prototype.constructor = oilsConnectStatus;
-oilsConnectStatus.prototype.baseClass = oilsResponse.prototype.constructor;
-
-/** Constructor.  These give us info on our connection attempts **/
-function oilsConnectStatus( status, statusCode ) {
-       this._initResponse( "oilsConnectStatus", status, statusCode );
-}
-
-
-oilsResult.prototype = new oilsResponse();
-oilsResult.prototype.constructor = oilsResult;
-oilsResult.prototype.baseClass = oilsResponse.prototype.constructor;
-
-
-/** Constructor.  These usually carry REQUEST responses */
-function oilsResult( status, statusCode ) {
-       if( status && statusCode ) {
-               this._initResponse( "oilsResult", status, statusCode );
-       }
-}
-
-/** Returns the top level DomainObject within this result message.
-  * Note:  The object retuturned will be the actual object, not just a 
-  * generic DomainObject - e.g. oilsException.
-  */
-oilsResult.prototype.getContent = function() {
-
-       var nodes = this.element.childNodes;
-       if( ! nodes || nodes.length < 1 ) {
-               throw new oils_ex_dom("Content node for oilsResult is invalid\n" + this.toString() );
-       }
-       var x = 0;
-       var node = nodes.item(x);
-       while( node != null ) {
-
-               if( node.nodeName == "oils:domainObject"                                        ||
-                               node.nodeName == "oils:domainObjectCollection" ) {
-
-                       //return DomainObject.newFromNode( node );
-                       return JSON2js( node.textContent );
-               }
-               node = nodes.item(++x);
-       }
-
-       throw new oils_ex_dom("Content node for oilsResult is invalid\n" + this.toString() );
-}
-
-
-oilsException.prototype = new oilsResponse();
-oilsException.prototype.constructor = oilsException;
-oilsException.prototype.baseClass = oilsResponse.prototype.constructor;
-
-/** Top level exception */
-function oilsException( status, statusCode ) {
-       if( status && statusCode ) {
-               this._initResponse( "oilsException", status, statusCode );
-       }
-}
-
-
-oilsMethodException.prototype = new oilsException();
-oilsMethodException.prototype.constructor = oilsMethodException;
-oilsMethodException.prototype.baseClass = oilsException.prototype.constructor;
-
-/** Method exception */
-function oilsMethodException( status, statusCode ) {
-       if( status && statusCode ) {
-               this._initResponse( "oilsMethodException", status, statusCode );
-       }
-}
-
-oilsBrokenSession.prototype = new oilsException();
-oilsBrokenSession.prototype.constructor = oilsBrokenSession;
-oilsBrokenSession.prototype.baseClass = oilsException.prototype.constructor;
-
-/** broken session exception */
-function oilsBrokenSession( status, statusCode ) {
-       if( status && statusCode ) {
-               this._initResponse( "oilsBrokenSession", status, statusCode );
-       }
-}
-
-
-// -----------------------------------------------------------------------------
-// oilsScalar
-
-
-oilsScalar.prototype = new DomainObject();
-oilsScalar.prototype.constructor = oilsScalar;
-oilsScalar.prototype.baseClass = DomainObject.prototype.constructor;
-
-/** Contains a single JSON item as its text content */
-function oilsScalar( value ) {
-       this._init_domainObject( "oilsScalar" );
-       this.element.appendChild( this.doc.createTextNode( value ) );
-}
-
-/** Returns the contained item as a Javascript object */
-oilsScalar.prototype.getValue = function() {
-       return JSON2js( this.element.textContent );
-}
-
-
-// -----------------------------------------------------------------------------
-// oilsPair
-
-
-oilsPair.prototype = new DomainObject()
-oilsPair.prototype.constructor = oilsPair;
-oilsPair.prototype.baseClass = DomainObject.prototype.constructor;
-
-function oilsPair( key, value ) {
-
-       this._init_domainObject( "oilsPair" );
-       this.element.appendChild( this.doc.createTextNode( value ) );
-       this.element.setAttribute( "key", key );
-}
-
-oilsPair.prototype.getKey = function() {
-       return this.element.getAttribute( "key" );
-}
-
-oilsPair.prototype.getValue = function() {
-       return this.element.textContent;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// oilsArray - is a domainObjectCollection that stores a list of domainObject's
-// or domainObjectCollections.
-// -----------------------------------------------------------------------------
-
-oilsArray.prototype = new domainObjectCollection()
-oilsArray.prototype.constructor = oilsArray;
-oilsArray.prototype.baseClass = domainObjectCollection.prototype.constructor;
-
-function oilsArray( obj_list ) {
-       this._initCollection( "oilsArray" );
-       if(obj_list) { this.initArray( obj_list ); }
-}
-
-// -----------------------------------------------------------------------------
-// Adds the array of objects to the array, these should be actual objects, not
-// DOM nodes/elements, etc.
-// -----------------------------------------------------------------------------
-oilsArray.prototype.initArray = function( obj_list ) {
-       if( obj_array != null && obj_array.length > 0 ) {
-               for( var i= 0; i!= obj_array.length; i++ ) {
-                       this.add( obj_array[i] );
-               }
-       }
-}
-
-// -----------------------------------------------------------------------------
-// Returns an array of DomainObjects or domainObjectCollections.  The objects
-// returned will already be 'cast' into the correct object. i.e. you will not
-// receieve an array of DomainObjects, but instead an array of oilsScalar's or
-// an array of oilsHashe's, etc.
-// -----------------------------------------------------------------------------
-oilsArray.prototype.getObjects = function() {
-
-       var obj_list = new Array();
-       var nodes = this.element.childNodes;
-       var i=0;
-       var node = nodes.item(i);
-
-       while( node != null ) {
-
-               if( node.nodeName == "oils:domainObject"                                        ||
-                               node.nodeName == "oils:domainObjectCollection" ) {
-                       obj_list[i++] = DomainObject.newFromNode( node );
-               }
-               node = nodes.item(i);
-       }
-
-       return obj_list;
-}
-
-
-// -----------------------------------------------------------------------------
-// oilsHash - an oilsHash is an oilsArray except it only stores oilsPair's
-// -----------------------------------------------------------------------------
-
-oilsHash.prototype = new oilsArray();
-oilsHash.prototype.constructor = oilsHash;
-oilsHash.prototype.baseClass = oilsArray.prototype.constructor;
-
-function oilsHash( pair_array ) {
-       this._initCollection("oilsHash");
-       if(pair_array) { this.initArray( pair_array ); }
-}
-
-// -----------------------------------------------------------------------------
-// Returns the array of oilsPairs objects that this hash contains
-// -----------------------------------------------------------------------------
-oilsHash.prototype.getPairs = function() {
-       return this.getObjects();
-}
-
-
diff --git a/OpenSRF/src/javascript/opensrf_jabber_transport.js b/OpenSRF/src/javascript/opensrf_jabber_transport.js
deleted file mode 100644 (file)
index 72e0b5d..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-// ------------------------------------------------------------------
-//             Houses the jabber transport code
-//
-// 1. jabber_connection - high level jabber component
-// 2. jabber_message - message class
-// 3. jabber_socket - socket handling code (shouldn't have to 
-//             use this class directly)
-//
-// Requires oils_utils.js
-// ------------------------------------------------------------------
-
-
-
-
-
-// ------------------------------------------------------------------
-// JABBER_CONNECTION
-// High level transport code
-
-// ------------------------------------------------------------------
-// Constructor
-// ------------------------------------------------------------------
-jabber_connection.prototype = new transport_connection();
-jabber_connection.prototype.constructor = jabber_connection;
-jabber_connection.baseClass = transport_connection.prototype.constructor;
-
-/** Initializes a jabber_connection object */
-function jabber_connection( username, password, resource ) {
-
-       this.username           = username;
-       this.password           = password;
-       this.resource           = resource;
-       this.socket                     = new jabber_socket();
-
-       this.host                       = "";
-
-}
-
-/** Connects to the Jabber server.  'timeout' is the connect timeout
-  * in milliseconds 
- */
-jabber_connection.prototype.connect = function( host, port, timeout ) {
-       this.host = host;
-       return this.socket.connect( 
-                       this.username, this.password, this.resource, host, port, timeout );
-}
-
-/** Sends a message to 'recipient' with the provided message 
-  * thread and body 
-  */
-jabber_connection.prototype.send = function( recipient, thread, body ) {
-       var jid = this.username+"@"+this.host+"/"+this.resource;
-       var msg = new jabber_message( jid, recipient, thread, body );
-       return this.socket.tcp_send( msg.to_string() );
-}
-
-/** This method will wait at most 'timeout' milliseconds
-  * for a Jabber message to arrive.  If one arrives
-  * it is returned to the caller, other it returns null
-  */
-jabber_connection.prototype.recv = function( timeout ) {
-       return this.socket.recv( timeout );
-}
-
-/** Disconnects from the jabber server */
-jabber_connection.prototype.disconnect = function() {
-       return this.socket.disconnect();
-}
-
-/** Returns true if we are currently connected to the 
-  * Jabber server
-  */
-jabber_connection.prototype.connected = function() {
-       return this.socket.connected();
-}
-
-
-
-// ------------------------------------------------------------------
-// JABBER_MESSAGE
-// High level message handling code
-       
-
-jabber_message.prototype = new transport_message();
-jabber_message.prototype.constructor = jabber_message;
-jabber_message.prototype.baseClass = transport_message.prototype.constructor;
-
-/** Builds a jabber_message object */
-function jabber_message( sender, recipient, thread, body ) {
-
-       if( sender == null || recipient == null || recipient.length < 1 ) { return; }
-
-       this.doc = new DOMParser().parseFromString("<message></message>", "text/xml");
-       this.root = this.doc.documentElement;
-       this.root.setAttribute( "from", sender );
-       this.root.setAttribute( "to", recipient );
-
-       var body_node = this.doc.createElement("body");
-       body_node.appendChild( this.doc.createTextNode( body ) );
-
-       var thread_node = this.doc.createElement("thread");
-       thread_node.appendChild( this.doc.createTextNode( thread ) );
-
-       this.root.appendChild( body_node );
-       this.root.appendChild( thread_node );
-
-}
-
-/** Builds a new message from raw xml.
-  * If the message is a Jabber error message, then msg.is_error_msg
-  * is set to true;
-  */
-jabber_message.prototype.from_xml = function( xml ) {
-       var msg = new jabber_message();
-       msg.doc = new DOMParser().parseFromString( xml, "text/xml" );
-       msg.root = msg.doc.documentElement;
-
-       if( msg.root.getAttribute( "type" ) == "error" ) {
-               msg.is_error_msg = true;
-       } else {
-               this.is_error_msg = false;
-       }
-
-       return msg;
-}
-
-/** Returns the 'from' field of the message */
-jabber_message.prototype.get_sender = function() {
-       return this.root.getAttribute( "from" );
-}
-
-/** Returns the jabber thread */
-jabber_message.prototype.get_thread = function() {
-       var nodes = this.root.getElementsByTagName( "thread" );
-       var thread_node = nodes.item(0);
-       return thread_node.firstChild.nodeValue;
-}
-
-/** Returns the message body */
-jabber_message.prototype.get_body = function() {
-       var nodes = this.root.getElementsByTagName( "body" );
-       var body_node = nodes.item(0);
-       new Logger().transport( "Get Body returning:\n" + body_node.textContent, Logger.DEBUG );
-       return body_node.textContent;
-}
-       
-/** Returns the message as a whole as an XML string */
-jabber_message.prototype.to_string = function() {
-   return new XMLSerializer().serializeToString(this.root);
-}
-
-
-
-
-// ------------------------------------------------------------------
-// TRANSPORT_SOCKET
-
-/** Initializes a new jabber_socket object */
-function jabber_socket() {
-
-       this.is_connected       = false;
-       this.outstream          = "";
-       this.instream           = "";
-       this.buffer                     = "";
-       this.socket                     = "";
-
-}
-
-/** Connects to the jabber server */
-jabber_socket.prototype.connect = 
-       function( username, password, resource,  host, port, timeout ) {
-
-       var starttime = new Date().getTime();
-
-       // there has to be at least some kind of timeout
-       if( ! timeout || timeout < 100 ) { timeout = 1000; }
-
-       try {
-
-               this.xpcom_init( host, port );
-               this.tcp_send( "<stream:stream to='"+host
-                               +"' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>" );
-
-               if( !this.tcp_recv( timeout ) ) {  throw 1; }
-
-       } catch( E ) {
-               throw new oils_ex_transport( "Could not open a socket to the transport server\n" 
-                               + "Server: " + host + " Port: " + port  );
-       }
-
-       // Send the auth packet
-       this.tcp_send( "<iq id='123456789' type='set'><query xmlns='jabber:iq:auth'><username>" 
-                       + username + "</username><password>" + password + 
-                       "</password><resource>" + resource + "</resource></query></iq>" );
-
-       var cur = new Date().getTime();
-       var remaining = timeout - ( cur - starttime );
-       this.tcp_recv( remaining );
-
-       if( ! this.connected() ) {
-               throw new oils_ex_transport( "Connection to transport server timed out" );
-       }
-
-       return true;
-
-
-}
-
-
-/** Sets up all of the xpcom components */
-jabber_socket.prototype.xpcom_init = function( host, port ) {
-
-       var transportService =
-               Components.classes["@mozilla.org/network/socket-transport-service;1"]
-               .getService(Components.interfaces.nsISocketTransportService);
-
-       this.transport = transportService.createTransport( null, 0, host, port, null);
-
-       // ------------------------------------------------------------------
-       // Build the stream objects
-       // ------------------------------------------------------------------
-       this.outstream = this.transport.openOutputStream(0,0,0);
-       
-       var stream = this.transport.openInputStream(0,0,0);
-
-       this.instream = Components.classes["@mozilla.org/scriptableinputstream;1"]
-                       .createInstance(Components.interfaces.nsIScriptableInputStream);
-
-       this.instream.init(stream);
-
-}
-
-/** Send data to the TCP pipe */
-jabber_socket.prototype.tcp_send = function( data ) {
-       new Logger().transport( "Sending Data: \n" + data, Logger.INFO );
-       this.outstream.write(data,data.length);
-}
-
-
-/** Accepts data coming directly from the socket.  If we're not
-  * connected, we pass it off to procecc_connect().  Otherwise,
-  * this method adds the data to the local buffer.
-  */
-jabber_socket.prototype.process_data = function( data ) {
-
-       new Logger().transport( "Received TCP data: " + data, Logger.DEBUG );
-
-       if( ! this.connected() ) {
-               this.process_connect( data );
-               return;
-       } 
-
-       this.buffer += data;
-
-}
-
-/** Processes connect data to verify we are logged in correctly */
-jabber_socket.prototype.process_connect = function( data ) {
-
-       var reg = /type=["\']result["\']/;
-       var err = /error/;
-
-       if( reg.exec( data ) ) {
-               this.is_connected = true;
-       } else {
-               if( err.exec( data ) ) {
-                       //throw new oils_ex_transport( "Server returned: \n" + data );
-                       throw new oils_ex_jabber_auth( "Server returned: \n" + data );
-                       // Throw exception, return something...
-               }
-       }
-}
-
-/** Waits up to at most 'timeout' milliseconds for data to arrive 
-  * in the TCP buffer.  If there is at least one byte of data 
-  * in the buffer, then all of the data that is in the buffer is sent 
-  * to the process_data method for processing and the method returns.  
-  */
-jabber_socket.prototype.tcp_recv = function( timeout ) {
-
-       var count = this.instream.available();
-       var did_receive = false;
-
-       // ------------------------------------------------------------------
-       // If there is any data in the tcp buffer, process it and return
-       // ------------------------------------------------------------------
-       if( count > 0 ) { 
-
-               did_receive = true;
-               while( count > 0 ) { 
-                       new Logger().transport(
-                               "before process data", Logger.DEBUG );
-
-                       this.process_data( this.instream.read( count ) );
-
-                       new Logger().transport(
-                               "after process data", Logger.DEBUG );
-
-                       count = this.instream.available();
-
-                       new Logger().transport(
-                               "received " + count + " bytes" , Logger.DEBUG );
-               }
-
-       } else { 
-
-               // ------------------------------------------------------------------
-               // Do the timeout dance
-               // ------------------------------------------------------------------
-
-               // ------------------------------------------------------------------
-               // If there is no data in the buffer, wait up to timeout seconds
-               // for some data to arrive.  Once it arrives, suck it all out
-               // and send it on for processing
-               // ------------------------------------------------------------------
-
-               var now, then;
-               now = new Date().getTime();
-               then = now;
-
-               // ------------------------------------------------------------------
-               // Loop and poll for data every 50 ms.
-               // ------------------------------------------------------------------
-               while( ((now-then) <= timeout) && count <= 0 ) { 
-                       sleep(50);
-                       count = this.instream.available();
-                       now = new Date().getTime();
-               }
-
-               // ------------------------------------------------------------------
-               // if we finally get some data, process it.
-               // ------------------------------------------------------------------
-               if( count > 0 ) {
-
-                       did_receive = true;
-                       while( count > 0 ) { // pull in all of the data there is
-                               this.process_data( this.instream.read( count ) );
-                               count = this.instream.available();
-                       }
-               }
-       }
-
-       return did_receive;
-
-}
-
-/** If a message is already sitting in the queue, it is returned.  
-  * If not, this method waits till at most 'timeout' milliseconds 
-  * for a full jabber message to arrive and then returns that.
-  * If none ever arrives, returns null.
-  */
-jabber_socket.prototype.recv = function( timeout ) {
-
-       var now, then;
-       now = new Date().getTime();
-       then = now;
-
-       var first_pass = true;
-       while( ((now-then) <= timeout) ) {
-               
-               if( this.buffer.length == 0  || !first_pass ) {
-                       if( ! this.tcp_recv( timeout ) ) {
-                               return null;
-                       }
-               }
-               first_pass = false;
-
-               //new Logger().transport( "\n\nTCP Buffer Before: \n" + this.buffer, Logger.DEBUG );
-
-               var buf = this.buffer;
-               this.buffer = "";
-
-               new Logger().transport( "CURRENT BUFFER\n" + buf,
-                       Logger.DEBUG );
-
-               buf = buf.replace( /\n/g, '' ); // remove pesky newlines
-
-               var reg = /<message.*?>.*?<\/message>/;
-               var iqr = /<iq.*?>.*?<\/iq>/;
-               var out = reg.exec(buf);
-
-               if( out ) { 
-
-                       var msg_xml = out[0];
-                       this.buffer = buf.substring( msg_xml.length, buf.length );
-                       new Logger().transport( "Building Jabber message\n\n" + msg_xml, Logger.DEBUG );
-                       var jab_msg = new jabber_message().from_xml( msg_xml );
-                       if( jab_msg.is_error_msg ) {
-                               new Logger().transport( "Received Jabber error message \n\n" + msg_xml, Logger.ERROR );
-                       } 
-
-                       return jab_msg;
-
-
-               } else { 
-
-                       out = iqr.exec(buf);
-
-                       if( out ) {
-                               var msg_xml = out[0];
-                               this.buffer = buf.substring( msg_xml.length, buf.length );
-                               process_iq_data( msg_xml );
-                               return;
-
-                       } else {
-                               this.buffer = buf;
-                       }
-
-               } 
-               now = new Date().getTime();
-       }
-
-       return null;
-}
-
-jabber_socket.prototype.process_iq_data = function( data ) {
-       new Logger().transport( "IQ Packet received... Not Implemented\n" + data, Logger.ERROR );
-}
-
-/** Disconnects from the jabber server and closes down shop */
-jabber_socket.prototype.disconnect = function() {
-       this.tcp_send( "</stream:stream>" );
-       this.instream.close();
-       this.outstream.close();
-}
-
-/** True if connected */
-jabber_socket.prototype.connected = function() {
-       return this.is_connected;
-}
-
-
-
-
-
diff --git a/OpenSRF/src/javascript/opensrf_msg_stack.js b/OpenSRF/src/javascript/opensrf_msg_stack.js
deleted file mode 100644 (file)
index a658439..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-// -----------------------------------------------------------------------------
-// Message stack code.
-// -----------------------------------------------------------------------------
-
-
-
-// -----------------------------------------------------------------------------
-// These just have to be defined for the 'static' methods to work
-// -----------------------------------------------------------------------------
-function Transport() {}
-function Message() {}
-function Application() {}
-
-/** Transport handler.  
-  * Takes a transport_message as parameter
-  * Parses the incoming message data and builds one or more oilsMessage objects
-  * from the XML.  Each message is passed in turn to the Message.handler
-  * method.
-  */
-Transport.handler = function( msg ) {
-
-       if( msg.is_error_msg ) {
-               throw new oils_ex_session( "Receved error message from jabber server for recipient: " + msg.get_sender() );
-               return;
-       }
-
-       var remote_id   = msg.get_sender();
-       var session_id = msg.get_thread();
-       var body                        = msg.get_body();
-
-       var session             = AppSession.find_session( session_id );
-
-       if( ! session ) {
-               new Logger().debug( "No AppSession found with id: " + session_id );
-               return;
-       }
-
-       session.set_remote_id( remote_id );
-
-       var nodelist; // oilsMessage nodes
-
-
-       // -----------------------------------------------------------------------------
-       // Parse the incoming XML
-       // -----------------------------------------------------------------------------
-       try {
-
-               var doc = new DOMParser().parseFromString( body, "text/xml" );
-               nodelist = doc.documentElement.getElementsByTagName( "oils:domainObject" );
-
-               if( ! nodelist || nodelist.length < 1 ) {
-                       nodelist = doc.documentElement.getElementsByTagName( "domainObject" );
-                       if( ! nodelist || nodelist.length < 1 ) { throw 1; }
-               }
-
-       } catch( E ) {
-
-               var str = "Error parsing incoming message document";
-
-               if( E ) { throw new oils_ex_dom( str + "\n" + E.message + "\n" + body ); 
-               } else { throw new oils_ex_dom( str + "\n" + body ); }
-
-       }
-       
-       // -----------------------------------------------------------------------------
-       // Pass the messages up the chain.
-       // -----------------------------------------------------------------------------
-       try {
-
-               var i = 0;
-               var node = nodelist.item(i); // a single oilsMessage
-
-               while( node != null ) {
-
-                       if( node.getAttribute("name") != "oilsMessage" ) {
-                               node = nodelist.item(++i);
-                               continue;
-                       }
-                               
-                       var oils_msg = new oilsMessage().replaceNode( node );  
-
-
-                       // -----------------------------------------------------------------------------
-                       // this is really inefficient compared to the above line of code,
-                       // however, this resolves some namespace oddities in DOMParser - 
-                       // namely, DOMParser puts dummy namesapaces in "a0" when, I'm assuming, it 
-                       // can't find the definition for the namesapace included.
-                       // -----------------------------------------------------------------------------
-                       //      var oils_msg = oilsMessage.newFromXML( new XMLSerializer().serializeToString( node ) );
-
-                       new Logger().transport( "Transport passing up:\n" + oils_msg.toString(true), Logger.INFO );
-
-                       // Pass the message off to the message layer
-                       Message.handler( session, oils_msg );
-                       node = nodelist.item(++i);
-               }
-
-       } catch( E ) {
-
-               var str = "Processing Error";
-
-               if( E ) { throw new oils_ex_session( str + "\n" + E.message + "\n" + body ); } 
-               else { throw new oils_ex_session( str + "\n" + body ); }
-       }
-}
-
-/** Checks to see what type of message has arrived.  If it is a 'STATUS' message,
-  * the appropriate transport layer actions are taken.  Otherwise (RESULT), the
-  * message is passed to the Application.handler method.
-  */
-Message.handler = function( session, msg ) {
-
-       var msg_type                                    = msg.getType();
-       var domain_object_payload       = msg.getPayload();
-       var tt                                                  = msg.getThreadTrace();
-
-       var code = domain_object_payload.getStatusCode();
-
-       new Logger().debug( "Message.handler received " + msg_type + " from " +
-                       session.get_remote_id() + " with thread_trace " + tt + " and status " + code, Logger.INFO );
-       new Logger().debug( "Message.handler received:\n" + domain_object_payload.toString(), Logger.DEBUG );
-
-       if( msg_type == oilsMessage.STATUS ) {
-
-               switch( code ) {
-
-                       case  oilsResponse.STATUS_OK + "": {
-                               session.set_state( AppSession.CONNECTED );
-                               new Logger().debug( " * Connected Successfully: " + tt, Logger.INFO );
-                               return;
-                       }
-
-                       case oilsResponse.STATUS_TIMEOUT + "": {
-                               return Message.reset_session( session, tt, "Disconnected because of timeout" );
-                       }
-
-                       case oilsResponse.STATUS_REDIRECTED + "": {
-                               return Message.reset_session( session, tt, "Disconnected because of redirect" );
-                       }
-
-                       case oilsResponse.STATUS_EXPFAILED + "": {
-                               return Message.reset_session( session, tt, "Disconnected because of mangled session" );
-                       }
-
-                       case oilsResponse.STATUS_NOTALLOWED + "": {
-                               new Logger().debug( "Method Not Allowed", Logger.ERROR );
-                               session.destroy();
-                               break; // we want the exception to be thrown below
-                       }
-
-                       case oilsResponse.STATUS_CONTINUE +"": {
-                               return;
-                       }
-
-                       case oilsResponse.STATUS_COMPLETE + "": {
-                               var req = session.get_request(tt);
-                               if( req ) { 
-                                       req.set_complete(); 
-                                       new Logger().debug( " * Request completed: " + tt, Logger.INFO );
-                               }
-                               return;
-                       }
-
-                       default: { break; } 
-               }
-
-       }
-
-       // throw any exceptions received from the server
-       if( domain_object_payload instanceof oilsException ) {
-               throw new oils_ex_session( domain_object_payload.getStatus() );
-       }
-
-       new Logger().debug( "Message Layer passing up:\n" + domain_object_payload.toString(), Logger.DEBUG );
-
-       Application.handler( session, domain_object_payload, tt );
-
-}
-
-/** Utility method for cleaning up a session.  Sets state to disconnected.
-  * resets the remoted_id, pushes the current app_request onto the resend
-  * queue. Logs a message.
-  */
-Message.reset_session = function( session, thread_trace, message ) {
-       session.set_state( AppSession.DISCONNECTED );
-       session.reset_remote();
-       var req = session.get_request( thread_trace );
-       if( req && !req.complete() ) { session.push_resend( req ); }
-       new Logger().debug( " * " + message + " : " + thread_trace, Logger.INFO );
-}
-
-
-/** Pushes all incoming messages onto the session message queue. **/
-Application.handler = function( session, domain_object_payload, thread_trace ) {
-
-       new Logger().debug( "Application Pushing onto queue: " 
-                       + thread_trace + "\n" + domain_object_payload.toString(), Logger.DEBUG );
-
-       session.push_queue( domain_object_payload, thread_trace );
-}
-
-
-       
-
-       
diff --git a/OpenSRF/src/javascript/opensrf_transport.js b/OpenSRF/src/javascript/opensrf_transport.js
deleted file mode 100644 (file)
index a0d846d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file oils_transport.js
-  * Houses the top level transport 'abstract' classes
-  * You can think of this like a header file which provides the 
-  * interface that any transport code must implement
-  */
-
-
-// ------------------------------------------------------------------
-// TRANSPORT_CONNECTION
-
-/** Constructor */
-function transport_connection( username, password, resource ) { }
-
-/** Connects to the transport host */
-transport_connection.prototype.connect = function(  host, /*int*/ port, /*int*/ timeout ) {}
-
-/** Sends a new message to recipient, with session_id and body */
-transport_connection.prototype.send = function( recipient, session_id, body ) {}
-
-
-/** Returns a transport_message.  This function will return 
-  * immediately if there is a message available.  Otherwise, it will
-  * wait at most 'timeout' seconds for one to arrive.  Returns
-  * null if a message does not arrivae in time.
-
-  * 'timeout' is specified in milliseconds
-  */
-transport_connection.prototype.recv = function( /*int*/ timeout ) {}
-
-/** This method calls recv and then passes the contents on to the
-  * message processing stack.
-  */
-transport_connection.prototype.process_msg = function( /*int*/ timeout ) {
-       var msg = this.recv( timeout );
-       if( msg ) { Transport.handler( msg ); }
-}
-
-/** Disconnects from the transpot host */
-transport_connection.prototype.disconnect = function() {}
-
-/** Returns true if this connection instance is currently connected
-  * to the transport host.
-  */
-transport_connection.prototype.connected = function() {}
-
-
-
-// ------------------------------------------------------------------
-// TRANSPORT_MESSAGE
-       
-
-/** Constructor */
-function transport_message( sender, recipient, session_id, body ) {}
-
-/** Returns the sender of the message */
-transport_message.prototype.get_sender = function() {}
-
-/** Returns the session id */
-transport_message.prototype.get_session = function() {}
-
-/** Returns the message body */
-transport_message.prototype.get_body = function() {}
-       
-
diff --git a/OpenSRF/src/javascript/opensrf_utils.js b/OpenSRF/src/javascript/opensrf_utils.js
deleted file mode 100644 (file)
index d348fd5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// ------------------------------------------------------------------
-// Houses utility functions
-// ------------------------------------------------------------------
-
-/** Prints to console.  If alert_bool = true, displays a popup as well */
-function _debug( message, alert_bool ) {
-
-       dump( "\n" + new Date() + "\n--------------------------------\n" + 
-                       message + "\n-----------------------------------\n" );
-       if( alert_bool == true ) { alert( message ) };
-
-}
-
-
-/** Provides millisec sleep times, enjoy... */
-function sleep(gap){ 
-
-       var threadService = Components.classes["@mozilla.org/thread;1"].
-               getService(Components.interfaces.nsIThread);
-
-       var th = threadService.currentThread;
-       th.sleep(gap);
-}
-
-
-
-/** Top level exception classe */
-function oils_ex() {}
-
-/** Initializes an exception */
-oils_ex.prototype.init_ex = function( name, message ) {
-       if( !(name && message) ) { return; }
-       this.name = name;
-       this.message = name + " : " + message;
-       new Logger().debug( "***\n" + this.message + "\n***", Logger.ERROR );
-}
-
-/** Returns a string representation of an exception */
-oils_ex.prototype.toString = function() {
-       return this.message;
-}
-
-
-oils_ex_transport.prototype = new oils_ex();
-oils_ex_transport.prototype.constructor = oils_ex_transport;
-oils_ex_transport.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown when the transport connection has problems*/
-function oils_ex_transport( message ) {
-       this.init_ex( "Transport Exception", message );
-}
-
-
-oils_ex_transport_auth.prototype = new oils_ex_transport(); 
-oils_ex_transport_auth.prototype.constructor = oils_ex_transport_auth;
-oils_ex_transport_auth.baseClass = oils_ex_transport.prototype.constructor;
-
-/** Thrown when the initial transport connection fails */
-function oils_ex_transport_auth( message ) {
-       this.init_ex( "Transport Authentication Error", message );
-}
-
-oils_ex_dom.prototype = new oils_ex(); 
-oils_ex_dom.prototype.constructor = oils_ex_dom;
-oils_ex_dom.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown when there is an XML problem */
-function oils_ex_dom( message ) {
-       this.init_ex( "DOM Error", message );
-}
-
-oils_ex_message.prototype = new oils_ex();
-oils_ex_message.prototype.constructor = oils_ex_message;
-oils_ex_message.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown when there is a message problem */
-function oils_ex_message( message ) {
-       this.init_ex( "OILS Message Layer Error", message ) ;
-}
-
-oils_ex_config.prototype = new oils_ex();
-oils_ex_config.prototype.constructor = oils_ex_config;
-oils_ex_config.prototype.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown when values cannot be retrieved from the config file */
-function oils_ex_config( message ) {
-       this.init_ex( "OILS Config Exception", message );
-}
-
-oils_ex_logger.prototype = new oils_ex();
-oils_ex_logger.prototype.constructor = oils_ex_logger;
-oils_ex_logger.prototype.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown where there are logging problems */
-function oils_ex_logger( message ) {
-       this.init_ex( "OILS Logger Exception", message );
-}
-
-
-oils_ex_args.prototype = new oils_ex();
-oils_ex_args.prototype.constructor = oils_ex_args;
-oils_ex_args.prototype.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown when when a method does not receive all of the required arguments */
-function oils_ex_args( message ) {
-       this.init_ex( "Method Argument Exception", message );
-}
-
-
-oils_ex_session.prototype = new oils_ex();
-oils_ex_session.prototype.constructor = oils_ex_session;
-oils_ex_session.prototype.baseClass = oils_ex.prototype.constructor;
-
-/** Thrown where there is a session processing problem */
-function oils_ex_session( message ) {
-       this.init_ex( "Session Exception", message );
-}
diff --git a/OpenSRF/src/jserver/Makefile b/OpenSRF/src/jserver/Makefile
deleted file mode 100644 (file)
index 28a6147..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-LDLIBS += -lopensrf -lxml2
-CFLAGS += -D_GNU_SOURCE
-
-all: chopchop
-
-chopchop: osrf_chat.o osrf_chat_main.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) osrf_chat.o osrf_chat_main.o -o $@
-
-osrf_chat.o: osrf_chat.c osrf_chat.h
-osrf_chat_main.o: osrf_chat_main.c
-
-install: 
-       cp chopchop $(BINDIR)
-
-clean:
-       /bin/rm -f *.o chopchop
-
diff --git a/OpenSRF/src/jserver/osrf_chat.c b/OpenSRF/src/jserver/osrf_chat.c
deleted file mode 100644 (file)
index 55b3c33..0000000
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "osrf_chat.h"
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-
-int __osrfChatXMLErrorOcurred = 0;
-int __osrfChatClientSentDisconnect = 0;
-
-/* shorter version of strcmp */
-static int eq(const char* a, const char* b) { return (a && b && !strcmp(a,b)); }
-//#define eq(a,b) ((a && b && !strcmp(a,b)) ? 1 : 0)
-
-/* gnarly debug function */
-static void chatdbg( osrfChatServer* server ) {
-
-       if(!server) return;
-       return; /* heavy logging, should only be used in heavy debug mode */
-
-       growing_buffer* buf = buffer_init(256);
-
-       buffer_add(buf, "---------------------------------------------------------------------\n");
-
-       buffer_fadd(buf, 
-               "ChopChop Debug:\n"
-               "Connections:           %lu\n"
-               "Named nodes in hash:   %lu\n"
-               "Domain:                %s\n"
-               "Port:                  %d\n"
-               "S2S Port:              %d\n"
-               "-------------------------------------------------------\n",
-               osrfListGetCount(server->nodeList), osrfHashGetCount(server->nodeHash),
-               server->domain, server->port, server->s2sport );
-
-       osrfListIterator* itr = osrfNewListIterator(server->nodeList);
-       osrfChatNode* node;
-
-       while( (node = osrfListIteratorNext(itr)) ) {
-
-               buffer_fadd( buf, 
-                       "sockid:    %d\n"
-                       "Remote:    %s\n"
-                       "State:     %d\n"
-                       "XMLState:  %d\n"
-                       "In Parse:  %d\n"
-                       "to:        %s\n"
-                       "Resource:  %s\n"
-                       "Username:  %s\n"
-                       "Domain:    %s\n"
-                       "Authkey:   %s\n"
-                       "type:          %d\n"
-                       "-------------------------------------------------------\n",
-                       node->sockid, node->remote, node->state, node->xmlstate, node->inparse,
-                       node->to, node->resource, node->username, node->domain, node->authkey, node->type );
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "DEBUG:\n%s", buf->buf );
-       buffer_free(buf);
-       osrfListIteratorFree(itr);
-}
-
-osrfChatServer* osrfNewChatServer( char* domain, char* secret, int s2sport ) {
-       if(!(domain && secret)) return NULL;
-
-       osrfChatServer* server = safe_malloc(sizeof(osrfChatServer));
-
-       server->nodeHash        = osrfNewHash();
-       server->nodeList        = osrfNewList();
-       server->deadNodes = osrfNewList();
-       server->nodeList->freeItem = &osrfChatNodeFree;
-       server->domain          = strdup(domain);
-       server->s2sport = s2sport;
-
-       server->mgr = safe_malloc(sizeof(socket_manager));
-       server->mgr->data_received = &osrfChatHandleData;
-       server->mgr->blob = server;
-       server->mgr->on_socket_closed = &osrfChatSocketClosed;
-
-       if(secret) server->secret = strdup(secret);
-       return server;
-}
-
-void osrfChatCleanupClients( osrfChatServer* server ) {
-       if(!server) return;
-       osrfListFree(server->deadNodes);
-       server->deadNodes = osrfNewList();
-}
-
-
-
-osrfChatNode* osrfNewChatNode( int sockid, char* domain ) {
-       if(sockid < 1 || !domain) return NULL;
-       osrfChatNode* node      = safe_malloc(sizeof(osrfChatNode));
-       node->state                             = OSRF_CHAT_STATE_NONE;
-       node->msgs                              = NULL; /* only s2s nodes cache messages */
-       node->parserCtx         = xmlCreatePushParserCtxt(osrfChatSaxHandler, node, "", 0, NULL);
-       node->msgDoc                    = xmlNewDoc(BAD_CAST "1.0");
-       node->domain = strdup(domain);
-       xmlKeepBlanksDefault(0);
-       node->authkey                   = NULL;
-       node->username                  = NULL;
-       node->resource                  = NULL;
-       node->to                                        = NULL;
-       node->type = 0;
-       return node;
-}
-
-
-osrfChatNode* osrfNewChatS2SNode( char* domain, char* remote ) {
-       if(!(domain && remote)) return NULL;
-       osrfChatNode* n = osrfNewChatNode( 1, domain );
-       n->state                = OSRF_CHAT_STATE_S2S_CHALLENGE;
-       n->sockid       = -1;
-       n->remote       = strdup(remote);
-       n->msgs         = osrfNewList();
-       n->msgs->freeItem = &osrfChatS2SMessageFree;
-       n->type = 1;
-       return n;
-}
-
-void osrfChatS2SMessageFree(void* n) { free(n); }
-
-void osrfChatNodeFree( void* node ) {
-       if(!node) return;
-       osrfChatNode* n = (osrfChatNode*) node;
-
-       /* we can't free messages that are mid-parse because the
-               we can't free the parser context */
-       if(n->inparse) {
-               n->inparse = 0;
-               osrfListPush(n->parent->deadNodes, n);
-               return;
-       }
-
-       free(n->remote);
-       free(n->to);
-       free(n->username);
-       free(n->resource);
-       free(n->domain);
-       free(n->authkey);
-
-       osrfListFree(n->msgs);
-
-       if(n->parserCtx) {
-               xmlFreeDoc(n->parserCtx->myDoc);
-               xmlFreeParserCtxt(n->parserCtx);
-       }
-
-       xmlFreeDoc(n->msgDoc);
-       free(n);
-}
-
-
-
-int osrfChatServerConnect( osrfChatServer* cs,  int port, int s2sport, char* listenAddr ) {
-       if(!(cs && port && listenAddr)) return -1;
-       cs->port = port;
-       cs->s2sport = s2sport;
-       if( socket_open_tcp_server(cs->mgr, port, listenAddr ) < 0 )
-               return -1;
-       if( socket_open_tcp_server(cs->mgr, s2sport, listenAddr ) < 0 )
-               return -1;
-       return 0;
-}
-
-
-int osrfChatServerWait( osrfChatServer* server ) {
-       if(!server) return -1;
-       while(1) {
-               if(socket_wait_all(server->mgr, -1) < 0)
-                       osrfLogWarning( OSRF_LOG_MARK,  "jserver_wait(): socket_wait_all() returned error");
-       }
-       return -1;
-}
-
-
-void osrfChatServerFree(osrfChatServer* server ) {
-       if(!server) return;
-       osrfHashFree(server->nodeHash);
-       osrfListFree(server->nodeList);
-       free(server->mgr);
-       free(server->secret);
-}
-
-
-void osrfChatHandleData( void* cs, 
-       socket_manager* mgr, int sockid, char* data, int parent_id ) {
-
-       if(!(cs && mgr && sockid && data)) return;
-
-       osrfChatServer* server = (osrfChatServer*) cs;
-
-       osrfChatNode* node = osrfListGetIndex( server->nodeList, sockid );
-
-       if(node)
-               osrfLogDebug( OSRF_LOG_MARK, "Found node for sockid %d with state %d", sockid, node->state);
-
-       if(!node) {
-               osrfLogDebug( OSRF_LOG_MARK, "Adding new connection for sockid %d", sockid );
-               node = osrfChatAddNode( server, sockid );
-       }
-
-       if(node) {
-               if( (osrfChatPushData( server, node, data ) == -1) ) {
-                       osrfLogError( OSRF_LOG_MARK, 
-                                       "Node at socket %d with remote address %s and destination %s, "
-                                       "received bad XML [%s], disconnecting...", sockid, node->remote, node->to, data );
-                       osrfChatSendRaw(  node, OSRF_CHAT_PARSE_ERROR );
-                       osrfChatRemoveNode( server, node );
-               }
-       }
-
-       osrfChatCleanupClients(server); /* clean up old dead clients */
-}
-
-
-void osrfChatSocketClosed( void* blob, int sockid ) {
-       if(!blob) return;
-       osrfChatServer* server = (osrfChatServer*) blob;
-       osrfChatNode* node = osrfListGetIndex(server->nodeList, sockid);
-       osrfChatRemoveNode( server, node );
-}
-
-osrfChatNode* osrfChatAddNode( osrfChatServer* server, int sockid ) {
-       if(!(server && sockid)) return NULL;
-       osrfChatNode* node = osrfNewChatNode(sockid, server->domain);
-       node->parent = server;
-       node->sockid = sockid;
-       osrfListSet( server->nodeList, node, sockid );
-       return node;
-}
-
-void osrfChatRemoveNode( osrfChatServer* server, osrfChatNode* node ) {
-       if(!(server && node)) return;
-       socket_disconnect(server->mgr, node->sockid);
-       if(node->remote) 
-               osrfHashRemove( server->nodeHash, node->remote );
-       osrfListRemove( server->nodeList, node->sockid ); /* this will free it */
-}
-
-int osrfChatSendRaw( osrfChatNode* node, char* msgXML ) {
-       if(!(node && msgXML)) return -1;
-       /* wait at most 3 second for this client to take our data */
-       return socket_send_timeout( node->sockid, msgXML, 3000000 ); 
-}
-
-void osrfChatNodeFinish( osrfChatServer* server, osrfChatNode* node ) {
-       if(!(server && node)) return;
-       osrfChatSendRaw( node, "</stream:stream>");
-       osrfChatRemoveNode( server, node );
-}
-
-
-int osrfChatSend( osrfChatServer* cs, osrfChatNode* node, char* toAddr, char* fromAddr, char* msgXML ) {
-       if(!(cs && node && toAddr && msgXML)) return -1;
-
-       int l = strlen(toAddr);
-       char dombuf[l];
-       bzero(dombuf, l);
-       jid_get_domain( toAddr, dombuf, l );    
-
-       if( eq( dombuf, cs->domain ) ) { /* this is to a user we host */
-
-               osrfLogInfo( OSRF_LOG_MARK, "Sending message on local connection\nfrom: %s\nto: %s", fromAddr, toAddr );
-               osrfChatNode* tonode = osrfHashGet(cs->nodeHash, toAddr);
-               if(tonode) {
-
-                       /* if we can't send to the recipient (recipient is gone or too busy, 
-                        * we drop the recipient and inform the sender that the recipient
-                        * is no more */
-                       if( osrfChatSendRaw( tonode, msgXML ) < 0 ) {
-
-                               osrfChatRemoveNode( cs, tonode );
-                               char* xml = va_list_to_string( OSRF_CHAT_NO_RECIPIENT, toAddr, fromAddr );
-
-                               osrfLogError( OSRF_LOG_MARK, "Node failed to function. "
-                                               "Responding to caller with error: %s", toAddr);
-
-
-                               if( osrfChatSendRaw( node, xml ) < 0 ) {
-                                       osrfLogError(OSRF_LOG_MARK, "Sending node is now gone..removing");
-                                       osrfChatRemoveNode( cs, node );
-                               }
-                               free(xml);
-                       }
-
-               } else {
-
-                       /* send an error message saying we don't have this connection */
-                       osrfLogInfo( OSRF_LOG_MARK, "We have no connection for %s", toAddr);
-                       char* xml = va_list_to_string( OSRF_CHAT_NO_RECIPIENT, toAddr, fromAddr );
-                       if( osrfChatSendRaw( node, xml ) < 0 ) 
-                               osrfChatRemoveNode( cs, node );
-                       free(xml);
-               }
-
-       } else {
-
-               osrfChatNode* tonode = osrfHashGet(cs->nodeHash, dombuf);
-               if(tonode) {
-                       if( tonode->state == OSRF_CHAT_STATE_CONNECTED ) {
-                               osrfLogDebug( OSRF_LOG_MARK, "Routing message to server %s", dombuf);
-
-                               if( osrfChatSendRaw( tonode, msgXML ) < 0 ) {
-                                       osrfLogError( OSRF_LOG_MARK, "Node failed to function: %s", toAddr);
-                                       char* xml = va_list_to_string( OSRF_CHAT_NO_RECIPIENT, toAddr, fromAddr );
-                                       if( osrfChatSendRaw( node, xml ) < 0 ) 
-                                               osrfChatRemoveNode( cs, node );
-                                       free(xml);
-                                       osrfChatRemoveNode( cs, tonode );
-                               }
-
-                       } else {
-                               osrfLogInfo( OSRF_LOG_MARK, "Received s2s message and we're still trying to connect...caching");
-                               osrfListPush( tonode->msgs, strdup(msgXML) );
-                       }
-
-               } else {
-
-                       if( osrfChatInitS2S( cs, dombuf, toAddr, msgXML ) != 0 ) {
-                               osrfLogWarning( OSRF_LOG_MARK, "We are unable to connect to remote server %s for recipient %s", dombuf, toAddr);
-                               char* xml = va_list_to_string( OSRF_CHAT_NO_RECIPIENT, toAddr, fromAddr );
-                               osrfChatSendRaw( node, xml );
-                               free(xml);
-                       }
-               }
-       }
-
-       return 0;
-}
-
-
-/*
-void osrfChatCacheS2SMessage( char* toAddr, char* msgXML, osrfChatNode* snode ) {
-       if(!(toAddr && msgXML)) return;
-       osrfChatS2SMessage* msg = safe_malloc(sizeof(osrfChatS2SMessage));
-       msg->toAddr = strdup(toAddr);
-       msg->msgXML = strdup(msgXML);
-       osrfLogInfo( OSRF_LOG_MARK, "Pushing client message onto s2s queue waiting for connect... ");
-       osrfListPush( snode->msgs, msgXML );
-}
-*/
-
-
-int osrfChatInitS2S( osrfChatServer* cs, char* remote, char* toAddr, char* msgXML ) {
-       if(!(cs && remote && toAddr && msgXML)) return -1;
-
-       osrfLogInfo( OSRF_LOG_MARK, "Initing server2server connection to domain %s", remote );
-       osrfChatNode* snode = osrfNewChatS2SNode( cs->domain, remote );
-       snode->parent = cs;
-
-       /* try to connect to the remote site */
-       snode->sockid = socket_open_tcp_client(cs->mgr, cs->s2sport, remote);
-       if(snode->sockid < 1) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to connect to remote server at %s", remote );
-               return -1;
-       }
-
-       /* store the message we were supposed to deliver until we're fully connected */
-       //osrfChatCacheS2SMessage( toAddr, msgXML, snode );
-       osrfListPush( snode->msgs, strdup(msgXML) );
-       osrfHashSet(cs->nodeHash, snode, remote );
-       osrfListSet(cs->nodeList, snode, snode->sockid );
-
-       /* send the initial s2s request */
-       osrfChatSendRaw( snode, OSRF_CHAT_S2S_INIT );
-
-       osrfLogDebug( OSRF_LOG_MARK, "Added new s2s node...");
-       chatdbg(cs);
-
-       return 0;
-}
-
-
-/* commence SAX handling code */
-
-int osrfChatPushData( osrfChatServer* server, osrfChatNode* node, char* data ) {
-       if(!(node && data)) return -1;
-
-       chatdbg(server);
-
-       osrfLogDebug( OSRF_LOG_MARK, "pushing data into xml parser for node %d with state %d:\n%s", 
-                                                node->sockid, node->state, data);
-       node->inparse = 1;
-       xmlParseChunk(node->parserCtx, data, strlen(data), 0);
-       node->inparse = 0;
-
-       if(__osrfChatXMLErrorOcurred) {
-               __osrfChatXMLErrorOcurred = 0;
-               return -1;
-       }
-
-       /* we can't do cleanup of the XML handlers while in the middle of a 
-               data push, so set flags in the data push and doe the cleanup here */
-       /*
-       if(__osrfChatClientSentDisconnect) {
-               __osrfChatClientSentDisconnect  = 0;
-               osrfChatNodeFinish( server, node );
-       }
-       */
-
-       return 0;
-}
-
-
-void osrfChatStartStream( void* blob ) {
-       osrfLogDebug( OSRF_LOG_MARK, "Starting new client stream...");
-}
-
-
-void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts ) {
-       if(!(blob && name)) return;
-       osrfChatNode* node = (osrfChatNode*) blob;
-
-       int status = -1;
-       char* nm = (char*) name;
-
-       osrfLogDebug( OSRF_LOG_MARK, "Starting element %s with namespace %s and node state %d", 
-                                                nm, xmlSaxAttr(atts, "xmlns"), node->state );
-
-       switch( node->state ) {
-
-               case OSRF_CHAT_STATE_NONE:
-                       status = osrfChatHandleNewConnection( node, nm, atts );
-                       osrfLogDebug( OSRF_LOG_MARK, "After NewConnection we have state %d", node->state);
-                       break;
-
-               case OSRF_CHAT_STATE_CONNECTING:
-                       status = osrfChatHandleConnecting( node, nm, atts );
-                       break;
-
-               case OSRF_CHAT_STATE_CONNECTED:
-                       status = osrfChatHandleConnected( node, nm, atts );
-                       break;
-
-               case OSRF_CHAT_STATE_S2S_CHALLENGE:      
-                       status = osrfChatHandleS2SChallenge( node, nm, atts );
-                       break;
-
-               case OSRF_CHAT_STATE_S2S_RESPONSE: /* server waiting for client response to challenge */
-                       if(eq(nm, "db:result")) {
-                               char* remote = xmlSaxAttr(atts, "from");
-                               if(remote) node->remote = strdup(remote); /* copy off the client's id */
-                               status = 0;
-                               node->xmlstate |= OSRF_CHAT_STATE_INS2SRESULT;
-                       } else status = -1; 
-                       break;
-
-               case OSRF_CHAT_STATE_S2S_VERIFY:        /* client : waiting for server verify message */
-                       if(eq(nm, "db:verify")) {
-                               char* id = xmlSaxAttr( atts, "id" );
-                               if(id) {
-                                       char* xml = va_list_to_string( OSRF_CHAT_S2S_VERIFY_RESPONSE, 
-                                                       node->remote, node->domain, id );
-                                       osrfChatSendRaw( node, xml );
-                                       free(xml);
-                                       node->state = OSRF_CHAT_STATE_S2S_VERIFY_FINAL;
-                                       status = 0;
-                               }
-                       }
-                       break;
-
-               case OSRF_CHAT_STATE_S2S_VERIFY_RESPONSE:       /* server waiting for client verify response */
-               case OSRF_CHAT_STATE_S2S_VERIFY_FINAL: /* client waitig for final verify */
-                       status = osrfChatHandleS2SConnected( node, nm, atts );
-                       break;
-
-       }
-
-       if(status != 0) 
-               osrfChatParseError( node, "We don't know how to handle the XML data received" );
-}
-
-#define CHAT_CHECK_VARS(x,y,z) if(!(x && y)) return -1; if(z) osrfLogDebug( OSRF_LOG_MARK, z);
-
-
-
-int osrfChatHandleS2SConnected( osrfChatNode* node, const char* name, const xmlChar**atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleS2SConnected" );
-
-       int status = -1;
-
-       if(eq(name,"db:verify")) { /* server receives verify from client */
-               char* xml = va_list_to_string(OSRF_CHAT_S2S_VERIFY_FINAL, node->domain, node->remote ); 
-               osrfChatSendRaw(node, xml );
-               free(xml);
-               status = 0;
-       }
-
-       if(eq(name, "db:result")) {
-               /* send all the messages that we have queued for this server */
-               node->state = OSRF_CHAT_STATE_CONNECTED;
-               osrfListIterator* itr = osrfNewListIterator(node->msgs);
-
-               char* xml;
-               while( (xml = (char*) osrfListIteratorNext(itr)) ) {
-                       xmlDocPtr doc = xmlParseMemory(xml, strlen(xml));
-                       if(doc) {
-                               char* from = (char*) xmlGetProp(xmlDocGetRootElement(doc), BAD_CAST "from");
-                               char* to = (char*) xmlGetProp(xmlDocGetRootElement(doc), BAD_CAST "to");
-                               osrfChatSend( node->parent, node, to, from, xml );
-                               osrfLogDebug( OSRF_LOG_MARK, "Sending cached message from %s to %s", from, to);
-                               xmlFree(to); xmlFree(from);
-                               xmlFreeDoc(doc);
-                       }
-               }
-
-               osrfListIteratorFree(itr);
-               osrfListFree(node->msgs);
-               node->msgs = NULL;
-               status = 0;
-       }
-
-       if(status == 0) {
-               osrfLogInfo( OSRF_LOG_MARK, "Successfully made S2S connection to %s", node->remote );
-               node->state = OSRF_CHAT_STATE_CONNECTED;
-               node->xmlstate = 0;
-       }
-
-       return status;
-}
-
-
-/** check the namespace of the stream message to see if it's a server or client connection */
-int osrfChatHandleNewConnection( osrfChatNode* node, const char* name, const xmlChar** atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleNewConnection()");
-
-       if(!eq(name, "stream:stream")) return -1;
-
-       node->authkey = osrfChatMkAuthKey();
-       char* ns = xmlSaxAttr(atts, "xmlns");
-       if(!ns) return -1;
-
-       if(eq(ns, "jabber:client")) { /* client connection */
-
-               char* domain = xmlSaxAttr( atts, "to" );
-               if(!domain) return -1; 
-       
-               if(!eq(domain, node->domain)) {
-                       osrfLogWarning( OSRF_LOG_MARK, 
-                               "Client attempting to connect to invalid domain %s. Our domain is %s", domain, node->domain);
-                       return -1;
-               }
-       
-               char* buf = va_list_to_string( OSRF_CHAT_START_STREAM, domain, node->authkey );
-               node->state = OSRF_CHAT_STATE_CONNECTING;
-
-               osrfLogDebug( OSRF_LOG_MARK, "Server node %d setting state to OSRF_CHAT_STATE_CONNECTING[%d]",
-                                                        node->sockid, node->state );
-       
-               osrfLogDebug( OSRF_LOG_MARK, "Server responding to connect message with\n%s\n", buf );
-               osrfChatSendRaw( node, buf );
-               free(buf);
-               return 0;
-       }
-
-       /* server to server init */
-       if(eq(ns, "jabber:server")) { /* client connection */
-               osrfLogInfo( OSRF_LOG_MARK, "We received a new server 2 server connection, generating auth key...");
-               char* xml = va_list_to_string( OSRF_CHAT_S2S_CHALLENGE, node->authkey );
-               osrfChatSendRaw( node, xml );
-               free(xml);
-               node->state = OSRF_CHAT_STATE_S2S_RESPONSE; /* the next message should be the response */
-               node->type = 1;
-               return 0;
-       }
-
-       return -1;
-}
-
-
-
-char* osrfChatMkAuthKey() {
-       char keybuf[112];
-       bzero(keybuf, 112);
-       snprintf(keybuf, 111, "%d%d%s", (int) time(NULL), getpid(), getenv("HOSTNAME"));
-       return strdup(shahash(keybuf));
-}
-
-int osrfChatHandleConnecting( osrfChatNode* node, const char* name, const xmlChar** atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleConnecting()");
-       osrfLogDebug( OSRF_LOG_MARK, "Handling connect node %s", name );
-
-       if(eq(name, "iq")) node->xmlstate |= OSRF_CHAT_STATE_INIQ;
-       else if(eq(name,"username")) node->xmlstate |= OSRF_CHAT_STATE_INUSERNAME;
-       else if(eq(name,"resource")) node->xmlstate |= OSRF_CHAT_STATE_INRESOURCE;
-       return 0;
-}
-
-int osrfChatHandleConnected( osrfChatNode* node, const char* name, const xmlChar** atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleConnected()");
-
-       if(eq(name,"message")) {
-
-               /* drop the old message and start with a new one */
-               xmlNodePtr root = xmlNewNode(NULL, name);
-               xmlAddAttrs(root, atts);
-               xmlNodePtr oldRoot = xmlDocSetRootElement(node->msgDoc, root);
-               free(node->to);
-
-               char* to = xmlSaxAttr(atts, "to");
-               if(!to) to = "";
-
-               node->to = strdup(to);
-               if(oldRoot) xmlFreeNode(oldRoot);
-               node->xmlstate = OSRF_CHAT_STATE_INMESSAGE;
-
-       } else {
-
-               /* all non "message" nodes are simply added to the message */
-               xmlNodePtr nodep = xmlNewNode(NULL, name);
-               xmlAddAttrs(nodep, atts);
-               xmlAddChild(xmlDocGetRootElement(node->msgDoc), nodep);
-       }
-
-       return 0;
-}
-
-/* takes s2s secret, hashdomain, and the s2s auth token */
-static char* osrfChatGenerateS2SKey( char* secret, char* hashdomain, char* authtoken ) {
-       if(!(secret && hashdomain && authtoken)) return NULL;
-       osrfLogInfo( OSRF_LOG_MARK, "Generating s2s key with auth token: %s", authtoken );
-       char* a = shahash(secret);
-       osrfLogDebug( OSRF_LOG_MARK, "S2S secret hash: %s", a);
-       char* b = va_list_to_string("%s%s", a, hashdomain);
-       char* c = shahash(b);
-       osrfLogDebug( OSRF_LOG_MARK, "S2S intermediate hash: %s", c);
-       char* d = va_list_to_string("%s%s", c, authtoken);
-       char* e = strdup(shahash(d));
-       free(b); free(d); 
-       return e;
-}
-
-int osrfChatHandleS2SChallenge( osrfChatNode* node, const char* name, const xmlChar** atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleS2SChallenge()");
-
-/* here we respond to the stream challenge */
-       if(eq(name, "stream:stream")) {
-               char* id = xmlSaxAttr(atts, "id");
-               if(id) {
-                       /* we use our domain in the s2s challenge hash */
-                       char* d = osrfChatGenerateS2SKey(node->parent->secret, node->domain, id );
-                       char* e = va_list_to_string(OSRF_CHAT_S2S_RESPONSE, node->remote, node->domain, d );
-                       osrfLogInfo( OSRF_LOG_MARK, "Answering s2s challenge with key:  %s", e );
-                       osrfChatSendRaw( node, e );
-                       free(d); free(e);
-                       node->state = OSRF_CHAT_STATE_S2S_VERIFY;
-                       return 0;
-               }
-       }
-
-       return -1;
-}
-
-/*
-int osrfChatHandleS2SResponse( osrfChatNode* node, const char* name, const xmlChar** atts ) {
-       CHAT_CHECK_VARS(node, name, "osrfChatHandleS2SResponse()");
-
-       if(eq(name, "db:result")) {
-               node->xmlstate |= OSRF_CHAT_STATE_INS2SRESULT;
-               return 0;
-       }
-
-       return -1;
-}
-*/
-
-
-
-void osrfChatEndElement( void* blob, const xmlChar* name ) {
-       if(!(blob && name)) return;
-       osrfChatNode* node = (osrfChatNode*) blob;
-
-       char* nm = (char*) name;
-
-       if(eq(nm,"stream:stream")) {
-               osrfChatNodeFinish( node->parent, node );
-               return;
-       }
-
-       if( node->state == OSRF_CHAT_STATE_CONNECTED ) {
-               if(eq(nm, "message")) {
-
-                       xmlNodePtr msg = xmlDocGetRootElement(node->msgDoc);
-                       if(msg && node->type == 0)
-                               xmlSetProp(msg, BAD_CAST "from", BAD_CAST node->remote );
-                       char* string = xmlDocToString(node->msgDoc, 0 );
-
-                       char* from = (char*) xmlGetProp(msg, BAD_CAST "from");
-                       osrfLogDebug( OSRF_LOG_MARK,  "Routing message to %s\n%s\n", node->to, from, string );
-                       osrfChatSend( node->parent, node, node->to, from, string ); 
-                       xmlFree(from);
-                       free(string);
-               }
-       }
-
-       if( node->state == OSRF_CHAT_STATE_CONNECTING ) {
-               if( node->xmlstate & OSRF_CHAT_STATE_INIQ ) {
-
-                       if(eq(nm, "iq")) {
-                               node->xmlstate &= ~OSRF_CHAT_STATE_INIQ;
-                               node->remote = va_list_to_string( 
-                                               "%s@%s/%s", node->username, node->domain, node->resource );
-
-                               osrfLogInfo( OSRF_LOG_MARK, "%s successfully logged in", node->remote );
-
-                               osrfLogDebug( OSRF_LOG_MARK, "Setting remote address to %s", node->remote );
-                               osrfChatSendRaw( node, OSRF_CHAT_LOGIN_OK );
-                               if(osrfHashGet( node->parent->nodeHash, node->remote ) ) {
-                                       osrfLogWarning( OSRF_LOG_MARK, "New node replaces existing node for remote id %s", node->remote);
-                                       osrfHashRemove(node->parent->nodeHash, node->remote);
-                               }
-                               osrfHashSet( node->parent->nodeHash, node, node->remote );
-                               node->state = OSRF_CHAT_STATE_CONNECTED;
-                       }
-               }
-       }
-}
-
-
-void osrfChatHandleCharacter( void* blob, const xmlChar *ch, int len) {
-       if(!(blob && ch && len)) return;
-       osrfChatNode* node = (osrfChatNode*) blob;
-
-       /*
-       osrfLogDebug( OSRF_LOG_MARK, "Char Handler: state %d, xmlstate %d, chardata %s", 
-                       node->state, node->xmlstate, (char*) ch );
-                       */
-
-       if( node->state == OSRF_CHAT_STATE_CONNECTING ) {
-               if( node->xmlstate & OSRF_CHAT_STATE_INIQ ) {
-
-                       if( node->xmlstate & OSRF_CHAT_STATE_INUSERNAME ) {
-                               free(node->username);
-                               node->username = strndup((char*) ch, len);
-                               node->xmlstate &= ~OSRF_CHAT_STATE_INUSERNAME;
-                       }
-
-                       if( node->xmlstate & OSRF_CHAT_STATE_INRESOURCE ) {
-                               free(node->resource);
-                               node->resource = strndup((char*) ch, len);
-                               node->xmlstate &= ~OSRF_CHAT_STATE_INRESOURCE;
-                       }
-               }
-
-               return;
-       } 
-       
-       if( node->state == OSRF_CHAT_STATE_CONNECTED ) {
-               xmlNodePtr last = xmlGetLastChild(xmlDocGetRootElement(node->msgDoc));
-               xmlNodePtr txt = xmlNewTextLen(ch, len);
-               xmlAddChild(last, txt);
-               return;
-       }
-
-       if( node->state == OSRF_CHAT_STATE_S2S_RESPONSE &&
-                       (node->xmlstate & OSRF_CHAT_STATE_INS2SRESULT) ) {
-
-               char* key = strndup((char*) ch, len);
-               osrfLogDebug( OSRF_LOG_MARK, "Got s2s key from %s : %s", node->remote, key );
-               char* e = osrfChatGenerateS2SKey(node->parent->secret, node->remote, node->authkey );
-               osrfLogInfo( OSRF_LOG_MARK, "\nReceived s2s key from server: %s\nKey should be: %s", key, e );
-
-               if(eq(key, e)) {
-                       char* msg = va_list_to_string(OSRF_CHAT_S2S_VERIFY_REQUEST,  
-                                       node->authkey, node->domain, node->remote, e );
-                       osrfChatSendRaw(node, msg );
-                       free(msg);
-                       node->state = OSRF_CHAT_STATE_S2S_VERIFY_RESPONSE;
-                       node->xmlstate = 0;
-
-               } else {
-                       osrfLogWarning( OSRF_LOG_MARK, "Server2Server keys do not match!");
-               }
-
-               /* do the hash dance again */
-       }
-
-       /* XXX free 'e' and 'key' ?? */
-
-}
-
-
-void osrfChatParseError( void* blob, const char* msg, ... ) {
-
-       __osrfChatXMLErrorOcurred = 1;
-}
-
-
-
-
diff --git a/OpenSRF/src/jserver/osrf_chat.h b/OpenSRF/src/jserver/osrf_chat.h
deleted file mode 100644 (file)
index fb24340..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#ifndef OSRF_CHAT_H
-#define OSRF_CHAT_H
-
-
-/* opensrf headers */
-#include "opensrf/utils.h"
-#include "opensrf/osrf_hash.h"
-#include "opensrf/osrf_list.h"
-#include "opensrf/log.h"
-#include "opensrf/xml_utils.h"
-#include "opensrf/socket_bundle.h"
-#include "opensrf/sha.h"
-#include "opensrf/transport_message.h"
-
-/* libxml2 headers */
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/globals.h>
-#include <libxml/xmlerror.h>
-
-/* client to server XML */
-#define OSRF_CHAT_START_STREAM "<?xml version='1.0'?><stream:stream "\
-       "xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' "\
-       "from='%s' version='1.0' id='%s'>" 
-
-#define OSRF_CHAT_PARSE_ERROR "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "\
-       "version='1.0'><stream:error xmlns:stream='http://etherx.jabber.org/streams'>"\
-       "<xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>"    \
-       "<text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>syntax error</text></stream:error></stream:stream>" 
-
-#define OSRF_CHAT_LOGIN_OK "<iq xmlns='jabber:client' id='0123456789' type='result'/>"
-
-#define OSRF_CHAT_NO_RECIPIENT "<message xmlns='jabber:client' type='error' from='%s' to='%s'>"\
-       "<error type='cancel' code='404'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"\
-       "</error><body>NOT ADDING BODY</body></message>"
-
-/* ---------------------------------------------------------------------------------- */
-/* server to server XML */
-
-// client to server init
-#define OSRF_CHAT_S2S_INIT "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "\
-       "xmlns='jabber:server' xmlns:db='jabber:server:dialback'>"
-
-// server to client challenge 
-#define OSRF_CHAT_S2S_CHALLENGE "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "\
-       "xmlns='jabber:server' id='%s' xmlns:db='jabber:server:dialback'>"
-
-// client to server challenge response
-#define OSRF_CHAT_S2S_RESPONSE "<db:result xmlns:db='jabber:server:dialback' to='%s' from='%s'>%s</db:result>"
-
-// server to client verify
-#define OSRF_CHAT_S2S_VERIFY_REQUEST "<db:verify xmlns:db='jabber:server:dialback' id='%s' from='%s' to='%s'>%s</db:verify>"
-
-// client to server verify response
-#define OSRF_CHAT_S2S_VERIFY_RESPONSE "<db:verify xmlns:db='jabber:server:dialback' type='valid' to='%s' from='%s' id='%s'/>"
-
-//server to client final verification
-#define OSRF_CHAT_S2S_VERIFY_FINAL "<db:result xmlns:db='jabber:server:dialback' type='valid' from='%s' to ='%s'/>"
-
-
-/* c2s states */
-#define OSRF_CHAT_STATE_NONE                                           0               /* blank node */
-#define OSRF_CHAT_STATE_CONNECTING                             1               /* we have received the opening stream */
-#define OSRF_CHAT_STATE_CONNECTED                              2               /* we have sent the OK/result message */
-
-/* s2s states */
-#define OSRF_CHAT_STATE_S2S_CHALLENGE                  4               /* client : waiting for the challenge */
-#define OSRF_CHAT_STATE_S2S_RESPONSE                   5               /* server : waiting for the challenge response */
-#define OSRF_CHAT_STATE_S2S_VERIFY                             6               /* client : waiting for verify message */
-#define OSRF_CHAT_STATE_S2S_VERIFY_RESPONSE    7               /* server : waiting for verify response */
-#define OSRF_CHAT_STATE_S2S_VERIFY_FINAL               8               /* client : waiting for final verify response */
-
-/* xml parser states */
-#define OSRF_CHAT_STATE_INMESSAGE              1
-#define OSRF_CHAT_STATE_INIQ                           2
-#define OSRF_CHAT_STATE_INUSERNAME             4
-#define OSRF_CHAT_STATE_INRESOURCE             8
-#define OSRF_CHAT_STATE_INS2SRESULT            16
-#define OSRF_CHAT_STATE_INS2SVERIFY            32
-
-
-struct __osrfChatNodeStruct {
-
-       int sockid;                     /* our socket id */
-
-       int type;                       /* 0 for client, 1 for server */
-
-       /* for clients this is the full JID of the client that connected to this server.
-               for servers it's the domain (network id) of the server we're connected to */
-       char* remote;           
-
-
-       int state;                      /* for the various stages of connectivity and parsing */
-       int xmlstate;           /* what part of the message are we currently parsing */
-       int inparse;            /* true if we are currently parsing a chunk of XML.  If so, we can't 
-                                                                       free the node.  we have to cache it and free it later */
-
-       char* to;                       /* The JID where the current message is being routed */
-
-       char* domain;           /* the domain, resource, and username of our connecting entity. */ 
-       char* resource; /* for s2s nodes, resource and username will be empty . */
-       char* username;
-
-       char* authkey;          /* when doing any auth negotiation, this is the auth seed hash */
-       osrfList* msgs; /* if we're a server node we may have a pool of messages waiting to be delivered */
-
-       xmlParserCtxtPtr parserCtx; 
-       xmlDocPtr msgDoc;
-       struct __osrfChatServerStruct* parent;
-
-};
-typedef struct __osrfChatNodeStruct osrfChatNode;
-
-/*
-struct __osrfChatS2SMessageStruct {
-       char* toAddr;
-       char* msgXML;
-};
-typedef struct __osrfChatS2SMessageStruct osrfChatS2SMessage;
-*/
-
-struct __osrfChatServerStruct {
-       osrfHash* nodeHash; /* sometimes we need hash (remote id) lookup, sometimes we need socket id lookup */
-       osrfList* nodeList;
-       osrfList* deadNodes; /* collection of nodes to free when we get a chance */
-       socket_manager* mgr;
-       char* secret;                   /* shared S2S secret */
-       char* domain;                   /* the domain this server hosts */
-       int s2sport;
-       int port;
-};
-
-typedef struct __osrfChatServerStruct osrfChatServer;
-
-
-void osrfChatCacheS2SMessage( char* toAddr, char* msgXML, osrfChatNode* snode );
-
-osrfChatNode* osrfNewChatS2SNode( char* domain, char* remote );
-osrfChatNode* osrfNewChatNode( int sockid, char* domain );
-void osrfChatNodeFree( void* node );
-
-/* @param s2sSecret The Server to server secret.  OK to leave NULL if no 
-       server to server communication is expected
-       */
-osrfChatServer* osrfNewChatServer( char* domain, char* s2sSecret, int s2sport );
-
-int osrfChatServerConnect( osrfChatServer* cs,  int port, int s2sport, char* listenAddr );
-
-int osrfChatServerWait( osrfChatServer* server );
-void osrfChatServerFree(osrfChatServer* cs);
-
-void osrfChatHandleData( void* cs, 
-       socket_manager* mgr, int sockid, char* data, int parent_id );
-
-
-/* removes dead nodes that have been cached due to mid-parse removals */
-void osrfChatCleanupClients( osrfChatServer* server );
-
-
-osrfChatNode* osrfChatAddNode( osrfChatServer* server, int sockid );
-
-
-void osrfChatRemoveNode( osrfChatServer* server, osrfChatNode* node );
-
-/** pushes new data into the nodes parser */
-int osrfChatPushData( osrfChatServer* server, osrfChatNode* node, char* data );
-
-
-void osrfChatSocketClosed( void* blob, int sockid );
-
-/**
-  Sends msgXML to the client with remote 'toAddr'.  if we have no connection
-  to 'toAddr' and the domain for 'toAddr' is different than our hosted domain
-  we attempt to send the message to the domain found in 'toAddr'.
-  */
-int osrfChatSend( osrfChatServer* cs, osrfChatNode* node, char* toAddr, char* fromAddr, char* msgXML );
-
-int osrfChatSendRaw( osrfChatNode* node, char* xml );
-
-
-void osrfChatNodeFinish( osrfChatServer* server, osrfChatNode* node );
-
-/* initializes the negotiation of a server to server connection */
-int osrfChatInitS2S( osrfChatServer* cs, char* remote, char* toAddr, char* msgXML );
-
-
-void osrfChatStartStream( void* blob );
-void osrfChatStartElement( void* blob, const xmlChar *name, const xmlChar **atts );
-void osrfChatEndElement( void* blob, const xmlChar* name );
-void osrfChatHandleCharacter(void* blob, const xmlChar *ch, int len);
-void osrfChatParseError( void* blob, const char* msg, ... );
-
-int osrfChatHandleNewConnection( osrfChatNode* node, const char* name, const xmlChar** atts );
-int osrfChatHandleConnecting( osrfChatNode* node, const char* name, const xmlChar** atts );
-int osrfChatHandleConnected( osrfChatNode* node, const char* name, const xmlChar** atts );
-int osrfChatHandleS2SInit( osrfChatNode* node, const char* name, const xmlChar** atts );
-int osrfChatHandleS2SChallenge( osrfChatNode* node, const char* name, const xmlChar** atts );
-int osrfChatHandleS2SResponse( osrfChatNode* node, const char* name, const xmlChar** atts );
-
-int osrfChatHandleS2SConnected( osrfChatNode* node, const char* nm, const xmlChar**atts );
-
-void osrfChatS2SMessageFree(void* n);
-
-
-
-/* generates a random sha1 hex key */
-char* osrfChatMkAuthKey();
-
-static xmlSAXHandler osrfChatSaxHandlerStruct = {
-   NULL,                                                               /* internalSubset */
-   NULL,                                                               /* isStandalone */
-   NULL,                                                               /* hasInternalSubset */
-   NULL,                                                               /* hasExternalSubset */
-   NULL,                                                               /* resolveEntity */
-   NULL,                                                               /* getEntity */
-   NULL,                                                               /* entityDecl */
-   NULL,                                                               /* notationDecl */
-   NULL,                                                               /* attributeDecl */
-   NULL,                                                               /* elementDecl */
-   NULL,                                                               /* unparsedEntityDecl */
-   NULL,                                                               /* setDocumentLocator */
-   osrfChatStartStream,                        /* startDocument */
-   NULL,                                                               /* endDocument */
-       osrfChatStartElement,           /* startElement */
-       osrfChatEndElement,                     /* endElement */
-   NULL,                                                               /* reference */
-       osrfChatHandleCharacter,        /* characters */
-   NULL,                                                               /* ignorableWhitespace */
-   NULL,                                                               /* processingInstruction */
-   NULL,                                                               /* comment */
-   osrfChatParseError,                 /* xmlParserWarning */
-   osrfChatParseError,                 /* xmlParserError */
-   NULL,                                                               /* xmlParserFatalError : unused */
-   NULL,                                                               /* getParameterEntity */
-   NULL,                                                               /* cdataBlock; */
-   NULL,                                                               /* externalSubset; */
-   1,
-   NULL,
-   NULL,                                                               /* startElementNs */
-   NULL,                                                               /* endElementNs */
-       NULL                                                            /* xmlStructuredErrorFunc */
-};
-
-static const xmlSAXHandlerPtr osrfChatSaxHandler = &osrfChatSaxHandlerStruct;
-
-
-#endif
-
-
diff --git a/OpenSRF/src/jserver/osrf_chat_main.c b/OpenSRF/src/jserver/osrf_chat_main.c
deleted file mode 100644 (file)
index 401d3b4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "osrf_chat.h"
-#include "opensrf/osrfConfig.h"
-#include <stdio.h>
-#include "opensrf/log.h"
-#include <syslog.h>
-
-
-int main( int argc, char* argv[] ) {
-
-       if( argc < 3 ) {
-               fprintf( stderr, "Usage: %s <config_file> <config_context>\n", argv[0] );
-               exit(0);
-       }
-
-       osrfConfig* cfg = osrfConfigInit( argv[1], argv[2] );
-
-       init_proc_title( argc, argv );
-       set_proc_title( "ChopChop" );
-
-       char* domain            = osrfConfigGetValue(cfg, "/domain");
-       char* secret            = osrfConfigGetValue(cfg, "/secret");
-       char* sport                     = osrfConfigGetValue(cfg, "/port");
-       char* s2sport           = osrfConfigGetValue(cfg, "/s2sport");
-       char* listenaddr        = osrfConfigGetValue(cfg, "/listen_address");
-       char* llevel            = osrfConfigGetValue(cfg, "/loglevel");
-       char* lfile                     = osrfConfigGetValue(cfg, "/logfile");
-       char* facility          = osrfConfigGetValue(cfg, "/syslog");
-
-       if(!(domain && secret && sport && listenaddr && llevel && lfile && s2sport)) {
-               fprintf(stderr, "Configuration error for ChopChop - missing key ingredient\n");
-               return -1;
-       }
-
-       int port = atoi(sport);
-       int s2port = atoi(s2sport);
-       int level = atoi(llevel);
-
-       if(!lfile) { fprintf(stderr, "Log file needed\n"); return -1; }
-
-       if(!strcmp(lfile, "syslog")) {
-               osrfLogInit( OSRF_LOG_TYPE_SYSLOG, "chochop", level );
-               osrfLogSetSyslogFacility(osrfLogFacilityToInt(facility));
-
-       } else {
-               osrfLogInit( OSRF_LOG_TYPE_FILE, "chopchop", level );
-               osrfLogSetFile( lfile );
-       }
-
-       fprintf(stderr, "Attempting to launch ChopChop with:\n"
-                       "domain: %s\nport: %s\nlisten address: %s\nlog level: %s\nlog file: %s\n",
-                       domain, sport, listenaddr, llevel, lfile );
-
-       osrfChatServer* server = osrfNewChatServer(domain, secret, s2port);
-
-       if( osrfChatServerConnect( server, port, s2port, listenaddr ) != 0 ) {
-               osrfLogError( OSRF_LOG_MARK, "ChopChop unable to bind to port %d on %s", port, listenaddr);
-               return -1;
-       }
-
-       daemonize();
-       osrfChatServerWait( server );
-
-       osrfChatServerFree( server );
-       osrfConfigFree(cfg);
-
-       return 0;
-
-}
-
diff --git a/OpenSRF/src/libstack/Makefile b/OpenSRF/src/libstack/Makefile
deleted file mode 100644 (file)
index 3dc5dd2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# OSRF_LOG_PARAMS log all incoming method params at OSRF_INFO log level. 
-# OSRF_STRICT_PARAMS instructs the app handler to return an error if the number of method arguments
-#      provided to any method is not at least as large as the 'argc' setting for the method
-
-CFLAGS +=  -DASSUME_STATELESS  -DOSRF_LOG_PARAMS -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -I.
-LDLIBS += -lxml2  -ldl -lmemcache
-
-TARGETS = osrf_message.o \
-                        osrf_app_session.o \
-                        osrf_stack.o \
-                        osrf_system.o \
-                        osrf_settings.o \
-                        osrf_prefork.o \
-                        osrfConfig.o \
-                        osrf_application.o \
-                        osrf_cache.o \
-                        osrf_transgroup.o \
-                        osrf_list.o \
-                        osrf_hash.o \
-                        xml_utils.o \
-                        osrf_hash.o \
-                        osrf_json_object.o \
-                        osrf_json_parser.o \
-                        osrf_json_tools.o \
-                        legacy_json.o \
-                        xml_utils.o
-
-HEADERS = osrf_message.h \
-                        osrf_app_session.h \
-                        osrf_stack.h \
-                        osrf_system.h \
-                        osrf_settings.h \
-                        osrf_prefork.h \
-                        osrfConfig.h \
-                        osrf_application.h \
-                        osrf_cache.h \
-                        osrf_transgroup.h \
-                        osrf_list.h \
-                        osrf_hash.h \
-                        osrf_json.h \
-                        xml_utils.h
-
-all: xml_utils.o $(TARGETS) copy 
-
-xml_utils.o:
-       cp ../utils/xml_utils.h .
-       cp ../utils/xml_utils.c .
-       $(CC) -c $(CFLAGS) xml_utils.c -o $@ 
-
-copy:
-       cp $(HEADERS) $(TMPDIR)/
-
-osrf_message.o:        osrf_message.c osrf_message.h
-osrf_app_session.o:    osrf_app_session.c osrf_app_session.h
-osrf_stack.o:  osrf_stack.c osrf_stack.h
-osrf_system.o: osrf_system.c osrf_system.h
-osrf_settings.o:       osrf_settings.c osrf_settings.h
-osrf_prefork.o:        osrf_prefork.c osrf_prefork.h
-osrfConfig.o:  osrfConfig.c osrfConfig.h xml_utils.o
-osrf_application.o: osrf_application.c osrf_application.h
-osrf_cache.o:  osrf_cache.c osrf_cache.h
-osrf_list.o:   osrf_list.c osrf_list.h
-osrf_hash.o:   osrf_hash.c osrf_hash.h
-osrf_json_object.o:    osrf_json_object.c osrf_json.h osrf_json_utils.h
-osrf_json_parser.o:    osrf_json_parser.c osrf_json.h osrf_json_utils.h
-osrf_json_tools.o:     osrf_json_tools.c osrf_json.h osrf_json_utils.h
-legacy_json.o: legacy_json.c osrf_json.h osrf_json_utils.h
-
-clean:
-       /bin/rm -f *.o libopensrf_stack.so xml_utils.h xml_utils.c opensrf
-
diff --git a/OpenSRF/src/libstack/Makefile.JSON b/OpenSRF/src/libstack/Makefile.JSON
deleted file mode 100644 (file)
index da15e1f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# --------------------------------------------------------------
-# This makefile creates a libosrfjson.so library for a standlone
-# JSON parser.
-#
-# usage: make -f Makefile.JSON
-#
-# --------------------------------------------------------------
-
-#PG = -pg # enable profiling support
-#G = -g  # enable debugging
-CFLAGS += $(G) -Wall $(PG) -O2 -fPIC -DJSON_IGNORE_COMMENTS -I ../utils/
-LDLIBS         += 
-LDFLAGS        += -L .  $(PG)
-
-TARGETS =      osrf_hash.o \
-                       osrf_list.o \
-                       osrf_json_parser.o \
-                       osrf_json_object.o \
-                       osrf_json_tools.o \
-                       ../utils/utils.o \
-                       ../utils/md5.o \
-                       ../utils/string_array.o \
-                       ../utils/log.o \
-
-
-all:   libosrfjson.so
-
-osrf_hash.o:   osrf_hash.c osrf_hash.h
-osrf_list.o:   osrf_list.c osrf_list.h
-osrf_json_parser.o:    osrf_json_parser.c osrf_json.h osrf_json_utils.h
-osrf_json_object.o:    osrf_json_object.c osrf_json.h osrf_json_utils.h
-osrf_json_tools.o:     osrf_json_tools.c osrf_json.h osrf_json_utils.h
-../utils/utils.o:      ../utils/utils.c ../utils/utils.h
-../utils/md5.o:        ../utils/md5.c ../utils/md5.h
-../utils/string_array.o:       ../utils/string_array.c ../utils/string_array.h
-../utils/log.o:        ../utils/log.c ../utils/log.h
-
-
-
-libosrfjson.so:        $(TARGETS)      
-       $(CC) -shared -W1 $(LDFLAGS) $(ARGETS) -o $@
-
-clean: 
-       rm -f $(TARGETS) libosrfjson.so
-
-
diff --git a/OpenSRF/src/libstack/legacy_json.c b/OpenSRF/src/libstack/legacy_json.c
deleted file mode 100644 (file)
index 516c282..0000000
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-#include "legacy_json.h"
-
-/* keep a copy of the length of the current json string so we don't 
- * have to calculate it in each function
- */
-int current_strlen; 
-
-
-jsonObject* legacy_jsonParseString( char* string) {
-       return json_parse_string( string );
-}
-
-jsonObject* legacy_jsonParseStringFmt( char* string, ... ) {
-       VA_LIST_TO_STRING(string);
-       return json_parse_string( VA_BUF );
-}
-
-
-jsonObject* json_parse_string(char* string) {
-
-       if(string == NULL) return NULL;
-
-       current_strlen = strlen(string);
-
-       if(current_strlen == 0) 
-               return NULL;
-
-       unsigned long index = 0;
-
-       json_eat_ws(string, &index, 1, current_strlen); /* remove leading whitespace */
-       if(index == current_strlen) return NULL;
-
-       jsonObject* obj = jsonNewObject(NULL);
-
-       int status = _json_parse_string(string, &index, obj, current_strlen);
-       if(!status) return obj;
-
-       if(status == -2) {
-               jsonObjectFree(obj);
-               return NULL;
-       }
-
-       return NULL;
-}
-
-
-int _json_parse_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( !string || !index || *index >= current_strlen) return -2;
-
-       int status = 0; /* return code from parsing routines */
-       char* classname = NULL; /* object class hint */
-       json_eat_ws(string, index, 1, current_strlen); /* remove leading whitespace */
-
-       char c = string[*index];
-
-       /* remove any leading comments */
-       if( c == '/' ) { 
-
-               while(1) {
-                       (*index)++; /* move to second comment char */
-                       status = json_eat_comment(string, index, &classname, 1, current_strlen);
-                       if(status) return status;
-
-                       json_eat_ws(string, index, 1, current_strlen);
-                       c = string[*index];
-                       if(c != '/')
-                               break;
-               }
-       }
-
-       json_eat_ws(string, index, 1, current_strlen); /* remove leading whitespace */
-
-       if(*index >= current_strlen)
-               return -2;
-
-       switch(c) {
-                               
-               /* json string */
-               case '"': 
-                       (*index)++;
-                       status = json_parse_json_string(string, index, obj, current_strlen); break;
-
-               /* json array */
-               case '[':
-                       (*index)++;
-                       status = json_parse_json_array(string, index, obj, current_strlen);                     
-                       break;
-
-               /* json object */
-               case '{':
-                       (*index)++;
-                       status = json_parse_json_object(string, index, obj, current_strlen);
-                       break;
-
-               /* NULL */
-               case 'n':
-               case 'N':
-                       status = json_parse_json_null(string, index, obj, current_strlen);
-                       break;
-                       
-
-               /* true, false */
-               case 'f':
-               case 'F':
-               case 't':
-               case 'T':
-                       status = json_parse_json_bool(string, index, obj, current_strlen);
-                       break;
-
-               default:
-                       if(is_number(c) || c == '.' || c == '-') { /* are we a number? */
-                               status = json_parse_json_number(string, index, obj, current_strlen);    
-                               if(status) return status;
-                               break;
-                       }
-
-                       (*index)--;
-                       /* we should never get here */
-                       return json_handle_error(string, index, "_json_parse_string() final switch clause");
-       }       
-
-       if(status) return status;
-
-       json_eat_ws(string, index, 1, current_strlen);
-
-       if( *index < current_strlen ) {
-               /* remove any trailing comments */
-               c = string[*index];
-               if( c == '/' ) { 
-                       (*index)++;
-                       status = json_eat_comment(string, index, NULL, 0, current_strlen);
-                       if(status) return status;
-               }
-       }
-
-       if(classname){
-               jsonObjectSetClass(obj, classname);
-               free(classname);
-       }
-
-       return 0;
-}
-
-
-int json_parse_json_null(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-
-       if(*index >= (current_strlen - 3)) {
-               return json_handle_error(string, index, 
-                       "_parse_json_null(): invalid null" );
-       }
-
-       if(!strncasecmp(string + (*index), "null", 4)) {
-               (*index) += 4;
-               obj->type = JSON_NULL;
-               return 0;
-       } else {
-               return json_handle_error(string, index,
-                       "_parse_json_null(): invalid null" );
-       }
-}
-
-/* should be at the first character of the bool at this point */
-int json_parse_json_bool(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! obj || *index >= current_strlen ) return -1;
-
-       char* ret = "json_parse_json_bool(): truncated bool";
-
-       if( *index >= (current_strlen - 5))
-               return json_handle_error(string, index, ret);
-       
-       if(!strncasecmp( string + (*index), "false", 5)) {
-               (*index) += 5;
-               obj->value.b = 0;
-               obj->type = JSON_BOOL;
-               return 0;
-       }
-
-       if( *index >= (current_strlen - 4))
-               return json_handle_error(string, index, ret);
-
-       if(!strncasecmp( string + (*index), "true", 4)) {
-               (*index) += 4;
-               obj->value.b = 1;
-               obj->type = JSON_BOOL;
-               return 0;
-       }
-
-       return json_handle_error(string, index, ret);
-}
-
-
-/* expecting the first character of the number */
-int json_parse_json_number(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! obj || *index >= current_strlen ) return -1;
-
-       growing_buffer* buf = buffer_init(64);
-       char c = string[*index];
-
-       int done = 0;
-       int dot_seen = 0;
-
-       /* negative number? */
-       if(c == '-') { buffer_add(buf, "-"); (*index)++; }
-
-       c = string[*index];
-
-       while(*index < current_strlen) {
-
-               if(is_number(c)) {
-                       buffer_add_char(buf, c);
-               }
-
-               else if( c == '.' ) {
-                       if(dot_seen) {
-                               buffer_free(buf);
-                               return json_handle_error(string, index, 
-                                       "json_parse_json_number(): malformed json number");
-                       }
-                       dot_seen = 1;
-                       buffer_add_char(buf, c);
-               } else {
-                       done = 1; break;
-               }
-
-               (*index)++;
-               c = string[*index];
-               if(done) break;
-       }
-
-       obj->type = JSON_NUMBER;
-       obj->value.n = strtod(buf->buf, NULL);
-       buffer_free(buf);
-       return 0;
-}
-
-/* index should point to the character directly following the '['.  when done
- * index will point to the character directly following the ']' character
- */
-int json_parse_json_array(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-
-       if( ! string || ! obj || ! index || *index >= current_strlen ) return -1;
-
-       int status = 0;
-       int in_parse = 0; /* true if this array already contains one item */
-       obj->type = JSON_ARRAY;
-       int set = 0;
-       int done = 0;
-
-       while(*index < current_strlen) {
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] == ']') {
-                       (*index)++;
-                       done = 1;
-                       break;
-               }
-
-               if(in_parse) {
-                       json_eat_ws(string, index, 1, current_strlen);
-                       if(string[*index] != ',') {
-                               return json_handle_error(string, index,
-                                       "json_parse_json_array(): array item not followed by a ','");
-                       }
-                       (*index)++;
-                       json_eat_ws(string, index, 1, current_strlen);
-               }
-
-               jsonObject* item = jsonNewObject(NULL);
-
-               #ifndef STRICT_JSON_READ
-               if(*index < current_strlen) {
-                       if(string[*index] == ',' || string[*index] == ']') {
-                               status = 0;
-                               set = 1;
-                       }
-               }
-               if(!set) status = _json_parse_string(string, index, item, current_strlen);
-
-               #else
-               status = _json_parse_string(string, index, item, current_strlen);
-               #endif
-
-               if(status) { jsonObjectFree(item); return status; }
-               jsonObjectPush(obj, item);
-               in_parse = 1;
-               set = 0;
-       }
-
-       if(!done)
-               return json_handle_error(string, index,
-                       "json_parse_json_array(): array not closed");
-
-       return 0;
-}
-
-
-/* index should point to the character directly following the '{'.  when done
- * index will point to the character directly following the '}'
- */
-int json_parse_json_object(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || !obj || ! index || *index >= current_strlen ) return -1;
-
-       obj->type = JSON_HASH;
-       int status;
-       int in_parse = 0; /* true if we've already added one item to this object */
-       int set = 0;
-       int done = 0;
-
-       while(*index < current_strlen) {
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] == '}') {
-                       (*index)++;
-                       done = 1;
-                       break;
-               }
-
-               if(in_parse) {
-                       if(string[*index] != ',') {
-                               return json_handle_error(string, index,
-                                       "json_parse_json_object(): object missing ',' between elements" );
-                       }
-                       (*index)++;
-                       json_eat_ws(string, index, 1, current_strlen);
-               }
-
-               /* first we grab the hash key */
-               jsonObject* key_obj = jsonNewObject(NULL);
-               status = _json_parse_string(string, index, key_obj, current_strlen);
-               if(status) return status;
-
-               if(key_obj->type != JSON_STRING) {
-                       return json_handle_error(string, index, 
-                               "_json_parse_json_object(): hash key not a string");
-               }
-
-               char* key = key_obj->value.s;
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] != ':') {
-                       return json_handle_error(string, index, 
-                               "json_parse_json_object(): hash key not followed by ':' character");
-               }
-
-               (*index)++;
-
-               /* now grab the value object */
-               json_eat_ws(string, index, 1, current_strlen);
-               jsonObject* value_obj = jsonNewObject(NULL);
-
-#ifndef STRICT_JSON_READ
-               if(*index < current_strlen) {
-                       if(string[*index] == ',' || string[*index] == '}') {
-                               status = 0;
-                               set = 1;
-                       }
-               }
-               if(!set)
-                       status = _json_parse_string(string, index, value_obj, current_strlen);
-
-#else
-                status = _json_parse_string(string, index, value_obj, current_strlen);
-#endif
-
-               if(status) return status;
-
-               /* put the data into the object and continue */
-               jsonObjectSetKey(obj, key, value_obj);
-               jsonObjectFree(key_obj);
-               in_parse = 1;
-               set = 0;
-       }
-
-       if(!done)
-               return json_handle_error(string, index,
-                       "json_parse_json_object(): object not closed");
-
-       return 0;
-}
-
-
-
-/* when done, index will point to the character after the closing quote */
-int json_parse_json_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! index || *index >= current_strlen ) return -1;
-
-       int in_escape = 0;      
-       int done = 0;
-       growing_buffer* buf = buffer_init(64);
-
-       while(*index < current_strlen) {
-
-               char c = string[*index]; 
-
-               switch(c) {
-
-                       case '\\':
-                               if(in_escape) {
-                                       buffer_add(buf, "\\");
-                                       in_escape = 0;
-                               } else 
-                                       in_escape = 1;
-                               break;
-
-                       case '"':
-                               if(in_escape) {
-                                       buffer_add(buf, "\"");
-                                       in_escape = 0;
-                               } else 
-                                       done = 1;
-                               break;
-
-                       case 't':
-                               if(in_escape) {
-                                       buffer_add(buf,"\t");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'b':
-                               if(in_escape) {
-                                       buffer_add(buf,"\b");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'f':
-                               if(in_escape) {
-                                       buffer_add(buf,"\f");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'r':
-                               if(in_escape) {
-                                       buffer_add(buf,"\r");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'n':
-                               if(in_escape) {
-                                       buffer_add(buf,"\n");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'u':
-                               if(in_escape) {
-                                       (*index)++;
-
-                                       if(*index >= (current_strlen - 4)) {
-                                               buffer_free(buf);
-                                               return json_handle_error(string, index,
-                                                       "json_parse_json_string(): truncated escaped unicode"); }
-
-                                       char buff[5];
-                                       memset(buff,0,5);
-                                       memcpy(buff, string + (*index), 4);
-
-
-                                       /* ----------------------------------------------------------------------- */
-                                       /* ----------------------------------------------------------------------- */
-                                       /* The following chunk was borrowed with permission from 
-                                               json-c http://oss.metaparadigm.com/json-c/ */
-                                       unsigned char utf_out[3];
-                                       memset(utf_out,0,3);
-
-                                       #define hexdigit(x) ( ((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
-
-                                       unsigned int ucs_char =
-                                               (hexdigit(string[*index] ) << 12) +
-                                               (hexdigit(string[*index + 1]) << 8) +
-                                               (hexdigit(string[*index + 2]) << 4) +
-                                               hexdigit(string[*index + 3]);
-       
-                                       if (ucs_char < 0x80) {
-                                               utf_out[0] = ucs_char;
-                                               buffer_add(buf, (char*) utf_out);
-
-                                       } else if (ucs_char < 0x800) {
-                                               utf_out[0] = 0xc0 | (ucs_char >> 6);
-                                               utf_out[1] = 0x80 | (ucs_char & 0x3f);
-                                               buffer_add(buf, (char*) utf_out);
-
-                                       } else {
-                                               utf_out[0] = 0xe0 | (ucs_char >> 12);
-                                               utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
-                                               utf_out[2] = 0x80 | (ucs_char & 0x3f);
-                                               buffer_add(buf, (char*) utf_out);
-                                       }
-                                       /* ----------------------------------------------------------------------- */
-                                       /* ----------------------------------------------------------------------- */
-
-                                       (*index) += 3;
-                                       in_escape = 0;
-
-                               } else {
-
-                                       buffer_add_char(buf, c);
-                               }
-
-                               break;
-
-                       default:
-                               buffer_add_char(buf, c);
-               }
-
-               (*index)++;
-               if(done) break;
-       }
-
-       jsonObjectSetString(obj, buf->buf);
-       buffer_free(buf);
-       return 0;
-}
-
-
-void json_eat_ws(char* string, unsigned long* index, int eat_all, int current_strlen) {
-       if( ! string || ! index ) return;
-       if(*index >= current_strlen)
-               return;
-
-       if( eat_all ) { /* removes newlines, etc */
-               while(string[*index] == ' '     || 
-                               string[*index] == '\n'  ||
-                               string[*index] == '\t') 
-                       (*index)++;
-       }
-
-       else    
-               while(string[*index] == ' ') (*index)++;
-}
-
-
-/* index should be at the '*' character at the beginning of the comment.
- * when done, index will point to the first character after the final /
- */
-int json_eat_comment(char* string, unsigned long* index, char** buffer, int parse_class, int current_strlen) {
-       if( ! string || ! index || *index >= current_strlen ) return -1;
-       
-
-       if(string[*index] != '*' && string[*index] != '/' )
-               return json_handle_error(string, index, 
-                       "json_eat_comment(): invalid character after /");
-
-       /* chop out any // style comments */
-       if(string[*index] == '/') {
-               (*index)++;
-               char c = string[*index];
-               while(*index < current_strlen) {
-                       (*index)++;
-                       if(c == '\n') 
-                               return 0;
-                       c = string[*index];
-               }
-               return 0;
-       }
-
-       (*index)++;
-
-       int on_star                     = 0; /* true if we just saw a '*' character */
-
-       /* we're just past the '*' */
-       if(!parse_class) { /* we're not concerned with class hints */
-               while(*index < current_strlen) {
-                       if(string[*index] == '/') {
-                               if(on_star) {
-                                       (*index)++;
-                                       return 0;
-                               }
-                       }
-
-                       if(string[*index] == '*') on_star = 1;
-                       else on_star = 0;
-
-                       (*index)++;
-               }
-               return 0;
-       }
-
-
-
-       growing_buffer* buf = buffer_init(64);
-
-       int first_dash          = 0;
-       int second_dash = 0;
-       int third_dash          = 0;
-       int fourth_dash = 0;
-
-       int in_hint                     = 0;
-       int done                                = 0;
-
-       /*--S hint--*/   /* <-- Hints  look like this */
-       /*--E hint--*/
-
-       while(*index < current_strlen) {
-               char c = string[*index];
-
-               switch(c) {
-
-                       case '-':
-                               on_star = 0;
-                               if(third_dash)                  fourth_dash = 1;
-                               else if(in_hint)                third_dash      = 1;
-                               else if(first_dash)     second_dash = 1;
-                               else                                            first_dash = 1;
-                               break;
-
-                       case 'S':
-                               on_star = 0;
-                               if(second_dash && !in_hint) {
-                                       (*index)++;
-                                       json_eat_ws(string, index, 1, current_strlen);
-                                       (*index)--; /* this will get incremented at the bottom of the loop */
-                                       in_hint = 1;
-                                       break;
-                               } 
-
-                               if(second_dash && in_hint) {
-                                       buffer_add_char(buf, c);
-                                       break;
-                               }
-
-                       case 'E':
-                               on_star = 0;
-                               if(second_dash && !in_hint) {
-                                       (*index)++;
-                                       json_eat_ws(string, index, 1, current_strlen);
-                                       (*index)--; /* this will get incremented at the bottom of the loop */
-                                       in_hint = 1;
-                                       break;
-                               }
-
-                               if(second_dash && in_hint) {
-                                       buffer_add_char(buf, c);
-                                       break;
-                               }
-
-                       case '*':
-                               on_star = 1;
-                               break;
-
-                       case '/':
-                               if(on_star) 
-                                       done = 1;
-                               else
-                               on_star = 0;
-                               break;
-
-                       default:
-                               on_star = 0;
-                               if(in_hint)
-                                       buffer_add_char(buf, c);
-               }
-
-               (*index)++;
-               if(done) break;
-       }
-
-       if( buf->n_used > 0 && buffer)
-               *buffer = buffer_data(buf);
-
-       buffer_free(buf);
-       return 0;
-}
-
-int is_number(char c) {
-       switch(c) {
-               case '0':
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                       return 1;
-       }
-       return 0;
-}
-
-int json_handle_error(char* string, unsigned long* index, char* err_msg) {
-
-       char buf[60];
-       memset(buf, 0, 60);
-
-       if(*index > 30)
-               strncpy( buf, string + (*index - 30), 59 );
-       else
-               strncpy( buf, string, 59 );
-
-       fprintf(stderr, 
-                       "\nError parsing json string at charracter %c "
-                       "(code %d) and index %ld\nString length: %d\nMsg:\t%s\nNear:\t%s\nFull String:\t%s\n", 
-                       string[*index], string[*index], *index, current_strlen, err_msg, buf, string );
-
-       return -1;
-}
-
-
-jsonObject* legacy_jsonParseFile( const char* filename ) {
-       return json_parse_file( filename );
-}
-       
-jsonObject* json_parse_file(const char* filename) {
-       if(!filename) return NULL;
-       char* data = file_to_string(filename);
-       jsonObject* o = json_parse_string(data);
-       free(data);
-       return o;
-}
-
-
-
-char* legacy_jsonObjectToJSON( const jsonObject* obj ) {
-
-       if(obj == NULL) return strdup("null");
-
-       growing_buffer* buf = buffer_init(64);
-
-       /* add class hints if we have a class name */
-       if(obj->classname) {
-               buffer_add(buf,"/*--S ");
-               buffer_add(buf,obj->classname);
-               buffer_add(buf, "--*/");
-       }
-
-       switch( obj->type ) {
-
-               case JSON_BOOL: 
-                       if(obj->value.b) buffer_add(buf, "true"); 
-                       else buffer_add(buf, "false"); 
-                       break;
-
-               case JSON_NUMBER: {
-                       double x = obj->value.n;
-
-                       /* if the number does not need to be a double,
-                               turn it into an int on the way out */
-                       if( x == (int) x ) {
-                               INT_TO_STRING((int)x);  
-                               buffer_add(buf, INTSTR);
-
-                       } else {
-                               DOUBLE_TO_STRING(x);
-                               buffer_add(buf, DOUBLESTR);
-                       }
-                       break;
-               }
-
-               case JSON_NULL:
-                       buffer_add(buf, "null");
-                       break;
-
-               case JSON_STRING:
-                       buffer_add(buf, "\"");
-                       char* data = obj->value.s;
-                       int len = strlen(data);
-                       
-                       char* output = uescape(data, len, 1);
-                       buffer_add(buf, output);
-                       free(output);
-                       buffer_add(buf, "\"");
-                       break;
-
-               case JSON_ARRAY:
-                       buffer_add(buf, "[");
-                       int i;
-                       for( i = 0; i!= obj->size; i++ ) {
-                               const jsonObject* x = jsonObjectGetIndex(obj,i);
-                               char* data = legacy_jsonObjectToJSON(x);
-                               buffer_add(buf, data);
-                               free(data);
-                               if(i != obj->size - 1)
-                                       buffer_add(buf, ",");
-                       }
-                       buffer_add(buf, "]");
-                       break;  
-
-               case JSON_HASH:
-       
-                       buffer_add(buf, "{");
-                       jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-                       jsonObject* tmp;
-       
-                       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-
-                               buffer_add(buf, "\"");
-
-                               char* key = itr->key;
-                               int len = strlen(key);
-                               char* output = uescape(key, len, 1);
-                               buffer_add(buf, output);
-                               free(output);
-
-                               buffer_add(buf, "\":");
-                               char* data =  legacy_jsonObjectToJSON(tmp);
-                               buffer_add(buf, data);
-                               if(jsonObjectIteratorHasNext(itr))
-                                       buffer_add(buf, ",");
-                               free(data);
-                       }
-
-                       jsonObjectIteratorFree(itr);
-                       buffer_add(buf, "}");
-                       break;
-               
-                       default:
-                               fprintf(stderr, "Unknown object type %d\n", obj->type);
-                               break;
-                               
-       }
-
-       /* close out the object hint */
-       if(obj->classname) {
-               buffer_add(buf, "/*--E ");
-               buffer_add(buf, obj->classname);
-               buffer_add(buf, "--*/");
-       }
-
-       char* data = buffer_data(buf);
-       buffer_free(buf);
-       return data;
-}
diff --git a/OpenSRF/src/libstack/legacy_json.h b/OpenSRF/src/libstack/legacy_json.h
deleted file mode 100644 (file)
index 27eac3f..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-
-
-/* ---------------------------------------------------------------------------------------
-       JSON parser.
- * --------------------------------------------------------------------------------------- */
-#ifndef LEGACY_JSON_H
-#define LEGACY_JSON_H
-
-#include "osrf_json.h"
-
-
-
-/* Parses the given JSON string and returns the built object. 
- *     returns NULL (and prints parser error to stderr) on error.  
- */
-
-jsonObject* json_parse_string(char* string);
-
-jsonObject* legacy_jsonParseString(char* string);
-jsonObject* legacy_jsonParseStringFmt( char* string, ... );
-
-jsonObject* json_parse_file( const char* filename );
-
-jsonObject* legacy_jsonParseFile( const char* string );
-
-
-
-/* does the actual parsing work.  returns 0 on success.  -1 on error and
- * -2 if there was no object to build (string was all comments) 
- */
-int _json_parse_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into a string object */
-int json_parse_json_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into a number or double object */
-int json_parse_json_number(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into an 'object' object */
-int json_parse_json_object(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns object into an array object */
-int json_parse_json_array(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* churns through whitespace and increments index as it goes.
- * eat_all == true means we should eat newlines, tabs
- */
-void json_eat_ws(char* string, unsigned long* index, int eat_all, int current_strlen);
-
-int json_parse_json_bool(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* removes comments from a json string.  if the comment contains a class hint
- * and class_hint isn't NULL, an allocated char* with the class name will be
- * shoved into *class_hint.  returns 0 on success, -1 on parse error.
- * 'index' is assumed to be at the second character (*) of the comment
- */
-int json_eat_comment(char* string, unsigned long* index, char** class_hint, int parse_class, int current_strlen);
-
-/* prints a useful error message to stderr. always returns -1 */
-int json_handle_error(char* string, unsigned long* index, char* err_msg);
-
-/* returns true if c is 0-9 */
-int is_number(char c);
-
-int json_parse_json_null(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-
-char* legacy_jsonObjectToJSON( const jsonObject* obj );
-
-#endif
diff --git a/OpenSRF/src/libstack/opensrf.c b/OpenSRF/src/libstack/opensrf.c
deleted file mode 100644 (file)
index 2277eb4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "osrf_system.h"
-#include "osrf_hash.h"
-#include "osrf_list.h"
-
-int main( int argc, char* argv[] ) {
-
-       if( argc < 4 ) {
-               fprintf(stderr, "Usage: %s <host> <bootstrap_config> <config_context>\n", argv[0]);
-               return 1;
-       }
-
-       fprintf(stderr, "Loading OpenSRF host %s with bootstrap config %s "
-                       "and config context %s\n", argv[1], argv[2], argv[3] );
-
-       /* these must be strdup'ed because init_proc_title / set_proc_title 
-               are evil and overwrite the argv memory */
-       char* host              = strdup( argv[1] );
-       char* config    = strdup( argv[2] );
-       char* context   = strdup( argv[3] );
-
-       init_proc_title( argc, argv );
-       set_proc_title( "OpenSRF System-C" );
-
-       osrfSystemBootstrap( host, config, context );
-
-       free(host);
-       free(config);
-       free(context);
-
-       return 0;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrfConfig.c b/OpenSRF/src/libstack/osrfConfig.c
deleted file mode 100644 (file)
index c195a19..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/* defines the currently used bootstrap config file */
-#include "osrfConfig.h"
-
-osrfConfig* __osrfConfigDefault = NULL;
-
-
-void osrfConfigSetDefaultConfig(osrfConfig* cfg) {
-       if(cfg) __osrfConfigDefault = cfg;
-}
-
-void osrfConfigFree(osrfConfig* cfg) {
-       if(cfg) {
-               jsonObjectFree(cfg->config);
-               free(cfg->configContext);
-               free(cfg);
-       }       
-}
-
-
-int osrfConfigHasDefaultConfig() {
-       return ( __osrfConfigDefault != NULL );
-}
-
-
-void osrfConfigCleanup() { 
-       osrfConfigFree(__osrfConfigDefault); 
-       __osrfConfigDefault = NULL; 
-}
-
-
-void osrfConfigReplaceConfig(osrfConfig* cfg, const jsonObject* obj) {
-       if(!cfg || !obj) return;
-       jsonObjectFree(cfg->config);
-       cfg->config = jsonObjectClone(obj);     
-}
-
-osrfConfig* osrfConfigInit(char* configFile, char* configContext) {
-       if(!configFile) return NULL;
-
-       osrfConfigFree(__osrfConfigDefault);
-
-       osrfConfig* cfg = safe_malloc(sizeof(osrfConfig));
-       if(configContext) cfg->configContext = strdup(configContext);
-       else cfg->configContext = NULL;
-
-       xmlDocPtr doc = xmlParseFile(configFile);
-       if(!doc) {
-               osrfLogWarning( OSRF_LOG_MARK,  "Unable to parse XML config file %s", configFile);
-               return NULL;
-       }
-
-       cfg->config = xmlDocToJSON(doc);
-
-       /*
-       char* j = jsonObjectToJSON(cfg->config);
-       fprintf(stderr, "JSON:\n%s\n", j);
-       free(j);
-       */
-
-       xmlFreeDoc(doc);
-
-       if(!cfg->config) {
-               osrfLogWarning( OSRF_LOG_MARK, "xmlDocToJSON failed for config %s", configFile);
-               return NULL;
-       }       
-
-       return cfg;
-}
-
-char* osrfConfigGetValue(osrfConfig* cfg, char* path, ...) {
-
-       if(!path) return NULL;
-       if(!cfg) cfg = __osrfConfigDefault;
-       if(!cfg) { osrfLogWarning( OSRF_LOG_MARK, "No Confif object!"); return NULL; }
-
-       VA_LIST_TO_STRING(path);
-
-       jsonObject* obj;
-       char* val = NULL;
-
-       if(cfg->configContext) {
-               obj = jsonObjectFindPath( cfg->config, "//%s%s", cfg->configContext, VA_BUF);
-               if(obj) val = jsonObjectToSimpleString(jsonObjectGetIndex(obj, 0));
-
-       } else {
-               obj = jsonObjectFindPath( cfg->config, VA_BUF);
-               if(obj) val = jsonObjectToSimpleString(obj);
-       }
-
-       jsonObjectFree(obj);
-       return val;
-}
-
-
-int osrfConfigGetValueList(osrfConfig* cfg, osrfStringArray* arr, char* path, ...) {
-
-       if(!arr || !path) return 0;
-       if(!cfg) cfg = __osrfConfigDefault;
-       if(!cfg) { osrfLogWarning( OSRF_LOG_MARK, "No Config object!"); return -1;}
-
-       VA_LIST_TO_STRING(path);
-
-       jsonObject* obj;
-       if(cfg->configContext) {
-               obj = jsonObjectFindPath( cfg->config, "//%s%s", cfg->configContext, VA_BUF);
-       } else {
-               obj = jsonObjectFindPath( cfg->config, VA_BUF);
-       }
-
-       int count = 0;
-
-       if(obj && obj->type == JSON_ARRAY ) {
-
-               int i;
-               for( i = 0; i < obj->size; i++ ) {
-
-                       char* val = jsonObjectToSimpleString(jsonObjectGetIndex(obj, i));
-                       if(val) {
-                               count++;
-                               osrfStringArrayAdd(arr, val);
-                               free(val);
-                       }
-               }
-       }
-
-       jsonObjectFree(obj);
-       return count;
-}
-
diff --git a/OpenSRF/src/libstack/osrfConfig.h b/OpenSRF/src/libstack/osrfConfig.h
deleted file mode 100644 (file)
index ff1cbbd..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#ifndef _OSRF_CONFIG_H
-#define _OSRF_CONFIG_H
-
-#include "xml_utils.h"
-#include "opensrf/utils.h"
-#include "opensrf/string_array.h"
-#include "osrf_json.h"
-
-typedef struct {
-       jsonObject* config;
-       char* configContext;
-} osrfConfig;
-
-
-/**
-       Parses a new config file.  Caller is responsible for freeing the returned
-               config object when finished.  
-       @param configFile The XML config file to parse.
-       @param configContext Optional root of the subtree in the config file where 
-       we will look for values. If it's not provided,  searches will be 
-       performed from the root of the config file
-       @return The config object if the file parses successfully.  Otherwise
-               it returns NULL;
-*/
-osrfConfig* osrfConfigInit(char* configFile, char* configContext);
-
-/**
-       @return True if we have a default config defined
-*/
-int osrfConfigHasDefaultConfig();
-
-/**
-       Replaces the config object's json object.  This is useful
-       if you have an ojbson object already and not an XML config
-       file to parse.
-       @param cfg The config object to alter
-       @param obj The json objet to use when searching values
-*/
-void osrfConfigReplaceConfig(osrfConfig* cfg, const jsonObject* obj);
-
-/** Deallocates a config object 
-       @param cfg The config object to free
-*/
-void osrfConfigFree(osrfConfig* cfg);
-
-
-/* Assigns the default config file.  This file will be used whenever
-       NULL is passed to config retrieval functions 
-       @param cfg The config object to use as the default config
-*/
-void osrfConfigSetDefaultConfig(osrfConfig* cfg);
-
-/* frees the default config if one exists */
-void osrfConfigCleanup();
-
-
-/** 
-       Returns the value in the config found at 'path'.
-       If the value found at 'path' is a long or a double,
-       the value is stringified and then returned.
-       The caller must free the returned char* 
-
-       if there is a configContext, then it will be appended to 
-       the front of the path like so: //<configContext>/<path>
-       if no configContext was provided to osfConfigSetFile, then 
-       the path is interpreted literally.
-       @param cfg The config file to search or NULL if the default
-               config should be used
-       @param path The search path
-*/
-char* osrfConfigGetValue(osrfConfig* cfg, char* path, ...);
-
-/** 
-       Puts the list of values found at 'path' into the pre-allocated 
-       string array.  
-       Note that the config node found at 'path' must be an array.
-       @param cfg The config file to search or NULL if the default
-               config should be used
-       @param arr An allocated string_array where the values will
-               be stored
-       @param path The search path
-       @return the number of values added to the string array;
-*/
-
-int osrfConfigGetValueList(osrfConfig* cfg, osrfStringArray* arr, char* path, ...);
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_app_session.c b/OpenSRF/src/libstack/osrf_app_session.c
deleted file mode 100644 (file)
index 770446f..0000000
+++ /dev/null
@@ -1,659 +0,0 @@
-#include "osrf_app_session.h"
-#include <time.h>
-
-/* the global app_session cache */
-osrfHash* osrfAppSessionCache = NULL;
-
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-// Request API
-// --------------------------------------------------------------------------
-
-/** Allocation and initializes a new app_request object */
-osrf_app_request* _osrf_app_request_init( 
-               osrf_app_session* session, osrf_message* msg ) {
-
-       osrf_app_request* req = 
-               (osrf_app_request*) safe_malloc(sizeof(osrf_app_request));
-
-       req->session            = session;
-       req->request_id = msg->thread_trace;
-       req->complete           = 0;
-       req->payload            = msg;
-       req->result                     = NULL;
-
-       return req;
-
-}
-
-
-void osrfAppSessionCleanup() {
-       osrfHashFree(osrfAppSessionCache);      
-}
-
-
-
-/** Frees memory used by an app_request object */
-void _osrf_app_request_free( void * req ){
-       if( req == NULL ) return;
-       osrfAppRequest* r = (osrfAppRequest*) req;
-       if( r->payload ) osrf_message_free( r->payload );
-       free( r );
-}
-
-/** Pushes the given message onto the list of 'responses' to this request */
-void _osrf_app_request_push_queue( osrf_app_request* req, osrf_message* result ){
-       if(req == NULL || result == NULL) return;
-       osrfLogDebug( OSRF_LOG_MARK,  "App Session pushing request [%d] onto request queue", result->thread_trace );
-       if(req->result == NULL) {
-               req->result = result;
-
-       } else {
-               
-               osrf_message* ptr = req->result;
-               osrf_message* ptr2 = req->result->next;
-               while( ptr2 ) {
-                       ptr = ptr2;
-                       ptr2 = ptr2->next;
-               }
-               ptr->next = result;
-       }
-}
-
-/** Removes this app_request from our session request set */
-void osrf_app_session_request_finish( 
-               osrf_app_session* session, int req_id ){
-
-       if(session == NULL) return;
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, req_id );
-       if(req == NULL) return;
-       osrfListRemove( req->session->request_queue, req->request_id );
-}
-
-
-void osrf_app_session_request_reset_timeout( osrf_app_session* session, int req_id ) {
-       if(session == NULL) return;
-       osrfLogDebug( OSRF_LOG_MARK, "Resetting request timeout %d", req_id );
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, req_id );
-       if(req == NULL) return;
-       req->reset_timeout = 1;
-}
-
-/** Checks the receive queue for messages.  If any are found, the first
-  * is popped off and returned.  Otherwise, this method will wait at most timeout 
-  * seconds for a message to appear in the receive queue.  Once it arrives it is returned.
-  * If no messages arrive in the timeout provided, null is returned.
-  */
-osrf_message* _osrf_app_request_recv( osrf_app_request* req, int timeout ) {
-
-       if(req == NULL) return NULL;
-
-       if( req->result != NULL ) {
-               /* pop off the first message in the list */
-               osrf_message* tmp_msg = req->result;
-               req->result = req->result->next;
-               return tmp_msg;
-       }
-
-       time_t start = time(NULL);      
-       time_t remaining = (time_t) timeout;
-
-       while( remaining >= 0 ) {
-               /* tell the session to wait for stuff */
-               osrfLogDebug( OSRF_LOG_MARK,  "In app_request receive with remaining time [%d]", (int) remaining );
-
-               osrf_app_session_queue_wait( req->session, 0, NULL );
-
-               if( req->result != NULL ) { /* if we received anything */
-                       /* pop off the first message in the list */
-                       osrfLogDebug( OSRF_LOG_MARK,  "app_request_recv received a message, returning it");
-                       osrf_message* ret_msg = req->result;
-                       osrf_message* tmp_msg = ret_msg->next;
-                       req->result = tmp_msg;
-                       return ret_msg;
-               }
-
-               if( req->complete )
-                       return NULL;
-
-               osrf_app_session_queue_wait( req->session, (int) remaining, NULL );
-
-               if( req->result != NULL ) { /* if we received anything */
-                       /* pop off the first message in the list */
-                       osrfLogDebug( OSRF_LOG_MARK,  "app_request_recv received a message, returning it");
-                       osrf_message* ret_msg = req->result;
-                       osrf_message* tmp_msg = ret_msg->next;
-                       req->result = tmp_msg;
-                       return ret_msg;
-               }
-               if( req->complete )
-                       return NULL;
-
-               if(req->reset_timeout) {
-                       remaining = (time_t) timeout;
-                       req->reset_timeout = 0;
-                       osrfLogDebug( OSRF_LOG_MARK, "Recevied a timeout reset");
-               } else {
-                       remaining -= (int) (time(NULL) - start);
-               }
-       }
-
-       osrfLogInfo( OSRF_LOG_MARK, "Returning NULL from app_request_recv after timeout");
-       return NULL;
-}
-
-/** Resend this requests original request message */
-int _osrf_app_request_resend( osrf_app_request* req ) {
-       if(req == NULL) return 0;
-       if(!req->complete) {
-               osrfLogDebug( OSRF_LOG_MARK,  "Resending request [%d]", req->request_id );
-               return _osrf_app_session_send( req->session, req->payload );
-       }
-       return 1;
-}
-
-
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-// Session API
-// --------------------------------------------------------------------------
-
-/** returns a session from the global session hash */
-osrf_app_session* osrf_app_session_find_session( char* session_id ) {
-       if(session_id) return osrfHashGet(osrfAppSessionCache, session_id);
-       return NULL;
-}
-
-
-/** adds a session to the global session cache */
-void _osrf_app_session_push_session( osrf_app_session* session ) {
-       if(!session) return;
-       if( osrfAppSessionCache == NULL ) osrfAppSessionCache = osrfNewHash();
-       if( osrfHashGet( osrfAppSessionCache, session->session_id ) ) return;
-       osrfHashSet( osrfAppSessionCache, session, session->session_id );
-}
-
-/** Allocates a initializes a new app_session */
-
-osrf_app_session* osrfAppSessionClientInit( char* remote_service ) {
-       return osrf_app_client_session_init( remote_service );
-}
-
-osrf_app_session* osrf_app_client_session_init( char* remote_service ) {
-
-       osrf_app_session* session = safe_malloc(sizeof(osrf_app_session));      
-
-       session->transport_handle = osrf_system_get_transport_client();
-       if( session->transport_handle == NULL ) {
-               osrfLogWarning( OSRF_LOG_MARK, "No transport client for service 'client'");
-               free( session );
-               return NULL;
-       }
-
-       char target_buf[512];
-       target_buf[ 0 ] = '\0';
-
-       osrfStringArray* arr = osrfNewStringArray(8);
-       osrfConfigGetValueList(NULL, arr, "/domains/domain");
-       char* domain = osrfStringArrayGetString(arr, 0);
-       char* router_name = osrfConfigGetValue(NULL, "/router_name");
-       
-       int len = snprintf( target_buf, 512, "%s@%s/%s",  router_name, domain, remote_service );
-       osrfStringArrayFree(arr);
-       //free(domain);
-       free(router_name);
-
-       if( len >= sizeof( target_buf ) ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Buffer overflow for remote_id");
-               free( session );
-               return NULL;
-       }
-
-       session->request_queue = osrfNewList();
-       session->request_queue->freeItem = &_osrf_app_request_free;
-       session->remote_id = strdup(target_buf);
-       session->orig_remote_id = strdup(session->remote_id);
-       session->remote_service = strdup(remote_service);
-
-       #ifdef ASSUME_STATELESS
-       session->stateless = 1;
-       osrfLogDebug( OSRF_LOG_MARK, "%s session is stateless", remote_service );
-       #else
-       session->stateless = 0;
-       osrfLogDebug( OSRF_LOG_MARK, "%s session is NOT stateless", remote_service );
-       #endif
-
-       /* build a chunky, random session id */
-       char id[256];
-       memset(id,0,256);
-
-       sprintf(id, "%f.%d%d", get_timestamp_millis(), (int)time(NULL), getpid());
-       session->session_id = strdup(id);
-       osrfLogDebug( OSRF_LOG_MARK,  "Building a new client session with id [%s] [%s]", 
-                       session->remote_service, session->session_id );
-
-       session->thread_trace = 0;
-       session->state = OSRF_SESSION_DISCONNECTED;
-       session->type = OSRF_SESSION_CLIENT;
-       //session->next = NULL;
-       _osrf_app_session_push_session( session );
-       return session;
-}
-
-osrf_app_session* osrf_app_server_session_init( 
-               char* session_id, char* our_app, char* remote_id ) {
-
-       osrfLogDebug( OSRF_LOG_MARK, "Initing server session with session id %s, service %s,"
-                       " and remote_id %s", session_id, our_app, remote_id );
-
-       osrf_app_session* session = osrf_app_session_find_session( session_id );
-       if(session) return session;
-
-       session = safe_malloc(sizeof(osrf_app_session));        
-
-       session->transport_handle = osrf_system_get_transport_client();
-       if( session->transport_handle == NULL ) {
-               osrfLogWarning( OSRF_LOG_MARK, "No transport client for service '%s'", our_app );
-               return NULL;
-       }
-
-       int stateless = 0;
-       char* statel = osrf_settings_host_value("/apps/%s/stateless", our_app );
-       if(statel) stateless = atoi(statel);
-       free(statel);
-
-
-       session->request_queue = osrfNewList();
-       session->request_queue->freeItem = &_osrf_app_request_free;
-       session->remote_id = strdup(remote_id);
-       session->orig_remote_id = strdup(remote_id);
-       session->session_id = strdup(session_id);
-       session->remote_service = strdup(our_app);
-       session->stateless = stateless;
-
-       #ifdef ASSUME_STATELESS
-       session->stateless = 1;
-       #endif
-
-       session->thread_trace = 0;
-       session->state = OSRF_SESSION_DISCONNECTED;
-       session->type = OSRF_SESSION_SERVER;
-
-       _osrf_app_session_push_session( session );
-       return session;
-
-}
-
-
-
-/** frees memory held by a session */
-void _osrf_app_session_free( osrf_app_session* session ){
-       if(session==NULL)
-               return;
-
-       if( session->userDataFree && session->userData ) 
-               session->userDataFree(session->userData);
-       
-       free(session->remote_id);
-       free(session->orig_remote_id);
-       free(session->session_id);
-       free(session->remote_service);
-       osrfListFree(session->request_queue);
-       free(session);
-}
-
-int osrfAppSessionMakeRequest(
-               osrf_app_session* session, jsonObject* params, 
-               char* method_name, int protocol, string_array* param_strings ) {
-
-       return osrf_app_session_make_req( session, params, 
-                       method_name, protocol, param_strings );
-}
-
-int osrf_app_session_make_req( 
-               osrf_app_session* session, jsonObject* params, 
-               char* method_name, int protocol, string_array* param_strings ) {
-       if(session == NULL) return -1;
-
-   osrfLogMkXid();
-
-       osrf_message* req_msg = osrf_message_init( REQUEST, ++(session->thread_trace), protocol );
-       osrf_message_set_method(req_msg, method_name);
-       if(params) {
-               osrf_message_set_params(req_msg, params);
-
-       } else {
-
-               if(param_strings) {
-                       int i;
-                       for(i = 0; i!= param_strings->size ; i++ ) {
-                               osrf_message_add_param(req_msg,
-                                       string_array_get_string(param_strings,i));
-                       }
-               }
-       }
-
-       osrf_app_request* req = _osrf_app_request_init( session, req_msg );
-       if(_osrf_app_session_send( session, req_msg ) ) {
-               osrfLogWarning( OSRF_LOG_MARK,  "Error sending request message [%d]", session->thread_trace );
-               return -1;
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK,  "Pushing [%d] onto requeust queue for session [%s] [%s]",
-                       req->request_id, session->remote_service, session->session_id );
-       osrfListSet( session->request_queue, req, req->request_id ); 
-       return req->request_id;
-}
-
-void osrf_app_session_set_complete( osrf_app_session* session, int request_id ) {
-       if(session == NULL)
-               return;
-
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, request_id );
-       if(req) req->complete = 1;
-}
-
-int osrf_app_session_request_complete( osrf_app_session* session, int request_id ) {
-       if(session == NULL)
-               return 0;
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, request_id );
-       if(req)
-               return req->complete;
-       return 0;
-}
-
-
-/** Resets the remote connection id to that of the original*/
-void osrf_app_session_reset_remote( osrf_app_session* session ){
-       if( session==NULL )
-               return;
-
-       free(session->remote_id);
-       osrfLogDebug( OSRF_LOG_MARK,  "App Session [%s] [%s] resetting remote id to %s",
-                       session->remote_service, session->session_id, session->orig_remote_id );
-
-       session->remote_id = strdup(session->orig_remote_id);
-}
-
-void osrf_app_session_set_remote( osrf_app_session* session, char* remote_id ) {
-       if(session == NULL)
-               return;
-       if( session->remote_id )
-               free(session->remote_id );
-       session->remote_id = strdup( remote_id );
-}
-
-/** pushes the given message into the result list of the app_request
-  with the given request_id */
-int osrf_app_session_push_queue( 
-               osrf_app_session* session, osrf_message* msg ){
-       if(session == NULL || msg == NULL) return 0;
-
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, msg->thread_trace );
-       if(req == NULL) return 0;
-       _osrf_app_request_push_queue( req, msg );
-
-       return 0;
-}
-
-int osrfAppSessionConnect( osrf_app_session* session ) { 
-       return osrf_app_session_connect(session);
-}
-
-
-/** Attempts to connect to the remote service */
-int osrf_app_session_connect(osrf_app_session* session){
-       
-       if(session == NULL)
-               return 0;
-
-       if(session->state == OSRF_SESSION_CONNECTED) {
-               return 1;
-       }
-
-       int timeout = 5; /* XXX CONFIG VALUE */
-
-       osrfLogDebug( OSRF_LOG_MARK,  "AppSession connecting to %s", session->remote_id );
-
-       /* defaulting to protocol 1 for now */
-       osrf_message* con_msg = osrf_message_init( CONNECT, session->thread_trace, 1 );
-       osrf_app_session_reset_remote( session );
-       session->state = OSRF_SESSION_CONNECTING;
-       int ret = _osrf_app_session_send( session, con_msg );
-       osrf_message_free(con_msg);
-       if(ret) return 0;
-
-       time_t start = time(NULL);      
-       time_t remaining = (time_t) timeout;
-
-       while( session->state != OSRF_SESSION_CONNECTED && remaining >= 0 ) {
-               osrf_app_session_queue_wait( session, remaining, NULL );
-               remaining -= (int) (time(NULL) - start);
-       }
-
-       if(session->state == OSRF_SESSION_CONNECTED)
-               osrfLogDebug( OSRF_LOG_MARK, " * Connected Successfully to %s", session->remote_service );
-
-       if(session->state != OSRF_SESSION_CONNECTED)
-               return 0;
-
-       return 1;
-}
-
-
-
-/** Disconnects from the remote service */
-int osrf_app_session_disconnect( osrf_app_session* session){
-       if(session == NULL)
-               return 1;
-
-       if(session->state == OSRF_SESSION_DISCONNECTED)
-               return 1;
-
-       if(session->stateless && session->state != OSRF_SESSION_CONNECTED) {
-               osrfLogDebug( OSRF_LOG_MARK,  
-                               "Exiting disconnect on stateless session %s", 
-                               session->session_id);
-               return 1;
-       }
-
-       osrfLogDebug(OSRF_LOG_MARK,  "AppSession disconnecting from %s", session->remote_id );
-
-       osrf_message* dis_msg = osrf_message_init( DISCONNECT, session->thread_trace, 1 );
-       _osrf_app_session_send( session, dis_msg );
-       session->state = OSRF_SESSION_DISCONNECTED;
-
-       osrf_message_free( dis_msg );
-       osrf_app_session_reset_remote( session );
-       return 1;
-}
-
-int osrf_app_session_request_resend( osrf_app_session* session, int req_id ) {
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, req_id );
-       return _osrf_app_request_resend( req );
-}
-
-
-int osrfAppSessionSendBatch( osrfAppSession* session, osrf_message* msgs[], int size ) {
-
-       if( !(session && msgs && size > 0) ) return 0;
-       int retval = 0;
-
-       osrfMessage* msg = msgs[0];
-
-       if(msg) {
-
-               osrf_app_session_queue_wait( session, 0, NULL );
-
-               if(session->state != OSRF_SESSION_CONNECTED)  {
-
-                       if(session->stateless) { /* stateless session always send to the root listener */
-                               osrf_app_session_reset_remote(session);
-
-                       } else { 
-
-                               /* do an auto-connect if necessary */
-                               if( ! session->stateless &&
-                                       (msg->m_type != CONNECT) && 
-                                       (msg->m_type != DISCONNECT) &&
-                                       (session->state != OSRF_SESSION_CONNECTED) ) {
-
-                                       if(!osrf_app_session_connect( session )) 
-                                               return 0;
-                               }
-                       }
-               }
-       }
-
-       char* string = osrfMessageSerializeBatch(msgs, size);
-
-       if( string ) {
-
-               transport_message* t_msg = message_init( 
-                               string, "", session->session_id, session->remote_id, NULL );
-      message_set_osrf_xid( t_msg, osrfLogGetXid() );
-
-               retval = client_send_message( session->transport_handle, t_msg );
-
-               if( retval ) osrfLogError(OSRF_LOG_MARK, "client_send_message failed");
-
-               osrfLogInfo(OSRF_LOG_MARK, "[%s] sent %d bytes of data to %s",
-                       session->remote_service, strlen(string), t_msg->recipient );
-
-               osrfLogDebug(OSRF_LOG_MARK, "Sent: %s", string );
-
-               free(string);
-               message_free( t_msg );
-       }
-
-       return retval; 
-}
-
-
-
-int _osrf_app_session_send( osrf_app_session* session, osrf_message* msg ){
-       if( !(session && msg) ) return 0;
-       osrfMessage* a[1];
-       a[0] = msg;
-       return osrfAppSessionSendBatch( session, a, 1 );
-}
-
-
-
-
-/**  Waits up to 'timeout' seconds for some data to arrive.
-  * Any data that arrives will be processed according to its
-  * payload and message type.  This method will return after
-  * any data has arrived.
-  */
-int osrf_app_session_queue_wait( osrf_app_session* session, int timeout, int* recvd ){
-       if(session == NULL) return 0;
-       int ret_val = 0;
-       osrfLogDebug(OSRF_LOG_MARK,  "AppSession in queue_wait with timeout %d", timeout );
-       ret_val = osrf_stack_entry_point(session->transport_handle, timeout, recvd);
-       return ret_val;
-}
-
-/** Disconnects (if client) and removes the given session from the global session cache 
-  * ! This free's all attached app_requests ! 
-  */
-void osrfAppSessionFree( osrfAppSession* ses ) {
-       osrf_app_session_destroy( ses );
-}
-
-
-void osrf_app_session_destroy( osrf_app_session* session ){
-       if(session == NULL) return;
-
-       osrfLogDebug(OSRF_LOG_MARK,  "AppSession [%s] [%s] destroying self and deleting requests", 
-                       session->remote_service, session->session_id );
-       if(session->type == OSRF_SESSION_CLIENT 
-                       && session->state != OSRF_SESSION_DISCONNECTED ) { /* disconnect if we're a client */
-               osrf_message* dis_msg = osrf_message_init( DISCONNECT, session->thread_trace, 1 );
-               _osrf_app_session_send( session, dis_msg ); 
-               osrf_message_free(dis_msg);
-       }
-
-       osrfHashRemove( osrfAppSessionCache, session->session_id );
-       _osrf_app_session_free( session );
-}
-
-osrf_message* osrfAppSessionRequestRecv(
-               osrf_app_session* session, int req_id, int timeout ) {
-       return osrf_app_session_request_recv( session, req_id, timeout );
-}
-osrf_message* osrf_app_session_request_recv( 
-               osrf_app_session* session, int req_id, int timeout ) {
-       if(req_id < 0 || session == NULL)
-               return NULL;
-       osrf_app_request* req = OSRF_LIST_GET_INDEX( session->request_queue, req_id );
-       return _osrf_app_request_recv( req, timeout );
-}
-
-
-
-int osrfAppRequestRespond( osrfAppSession* ses, int requestId, jsonObject* data ) {
-       if(!ses || ! data ) return -1;
-
-       osrf_message* msg = osrf_message_init( RESULT, requestId, 1 );
-       char* json = jsonObjectToJSON( data );
-
-       osrf_message_set_result_content( msg, json );
-       _osrf_app_session_send( ses, msg ); 
-
-       free(json);
-       osrf_message_free( msg );
-
-       return 0;
-}
-
-
-int osrfAppRequestRespondComplete( 
-               osrfAppSession* ses, int requestId, jsonObject* data ) {
-
-       osrf_message* payload = osrf_message_init( RESULT, requestId, 1 );
-       osrf_message_set_status_info( payload, NULL, "OK", OSRF_STATUS_OK );
-
-       osrf_message* status = osrf_message_init( STATUS, requestId, 1);
-       osrf_message_set_status_info( status, "osrfConnectStatus", "Request Complete", OSRF_STATUS_COMPLETE );
-       
-       if (data) {
-               char* json = jsonObjectToJSON( data );
-               osrf_message_set_result_content( payload, json );
-               free(json);
-
-               osrfMessage* ms[2];
-               ms[0] = payload;
-               ms[1] = status;
-
-               osrfAppSessionSendBatch( ses, ms, 2 );
-
-               osrf_message_free( payload );
-       } else {
-               osrfAppSessionSendBatch( ses, &status, 1 );
-       }
-
-       osrf_message_free( status );
-
-       return 0;
-}
-
-int osrfAppSessionStatus( osrfAppSession* ses, int type, char* name, int reqId, char* message ) {
-
-       if(ses) {
-               osrf_message* msg = osrf_message_init( STATUS, reqId, 1);
-               osrf_message_set_status_info( msg, name, message, type );
-               _osrf_app_session_send( ses, msg ); 
-               osrf_message_free( msg );
-               return 0;
-       }
-       return -1;
-}
-
-
-
-
-
-
diff --git a/OpenSRF/src/libstack/osrf_app_session.h b/OpenSRF/src/libstack/osrf_app_session.h
deleted file mode 100644 (file)
index 733cb28..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-#ifndef _OSRF_APP_SESSION
-#define _OSRF_APP_SESSION
-
-#include "opensrf/transport_client.h"
-#include "osrf_json.h"
-#include "osrf_message.h"
-#include "osrf_system.h"
-#include "opensrf/string_array.h"
-#include "osrfConfig.h"
-#include "osrf_hash.h"
-#include "osrf_list.h"
-
-
-
-#define        DEF_RECV_TIMEOUT 6 /* receive timeout */
-#define        DEF_QUEUE_SIZE  
-
-enum OSRF_SESSION_STATE { OSRF_SESSION_CONNECTING, OSRF_SESSION_CONNECTED, OSRF_SESSION_DISCONNECTED };
-enum OSRF_SESSION_TYPE { OSRF_SESSION_SERVER, OSRF_SESSION_CLIENT };
-
-/* entry point for data into the stack.  gets set in osrf_stack.c */
-int (*osrf_stack_entry_point) (transport_client* client, int timeout, int* recvd );
-
-struct osrf_app_request_struct {
-       /** Our controlling session */
-       struct osrf_app_session_struct* session;
-
-       /** our "id" */
-       int request_id;
-       /** True if we have received a 'request complete' message from our request */
-       int complete;
-       /** Our original request payload */
-       osrf_message* payload; 
-       /** List of responses to our request */
-       osrf_message* result;
-
-       /* if set to true, then a call that is waiting on a response, will reset the 
-               timeout and set this variable back to false */
-       int reset_timeout;
-};
-typedef struct osrf_app_request_struct osrf_app_request;
-typedef struct osrf_app_request_struct osrfAppRequest;
-
-struct osrf_app_session_struct {
-
-       /** Our messag passing object */
-       transport_client* transport_handle;
-       /** Cache of active app_request objects */
-
-       //osrf_app_request* request_queue;
-
-       osrfList* request_queue;
-
-       /** The original remote id of the remote service we're talking to */
-       char* orig_remote_id;
-       /** The current remote id of the remote service we're talking to */
-       char* remote_id;
-
-       /** Who we're talking to if we're a client.  
-               what app we're serving if we're a server */
-       char* remote_service;
-
-       /** The current request thread_trace */
-       int thread_trace;
-       /** Our ID */
-       char* session_id;
-
-       /* true if this session does not require connect messages */
-       int stateless;
-
-       /** The connect state */
-       enum OSRF_SESSION_STATE state;
-
-       /** SERVER or CLIENT */
-       enum OSRF_SESSION_TYPE type;
-
-       /* let the user use the session to store their own session data */
-       void* userData;
-
-       void (*userDataFree) (void*);
-};
-typedef struct osrf_app_session_struct osrf_app_session;
-typedef struct osrf_app_session_struct osrfAppSession;
-
-
-
-// -------------------------------------------------------------------------- 
-// PUBLIC API ***
-// -------------------------------------------------------------------------- 
-
-/** Allocates a initializes a new app_session */
-osrf_app_session* osrfAppSessionClientInit( char* remote_service );
-osrf_app_session* osrf_app_client_session_init( char* remote_service );
-
-/** Allocates and initializes a new server session.  The global session cache
-  * is checked to see if this session already exists, if so, it's returned 
-  */
-osrf_app_session* osrf_app_server_session_init( 
-               char* session_id, char* our_app, char* remote_id );
-
-/** returns a session from the global session hash */
-osrf_app_session* osrf_app_session_find_session( char* session_id );
-
-/** Builds a new app_request object with the given payload andn returns
-  * the id of the request.  This id is then used to perform work on the
-  * requeset.
-  */
-int osrfAppSessionMakeRequest(
-               osrf_app_session* session, jsonObject* params, 
-               char* method_name, int protocol, string_array* param_strings);
-
-int osrf_app_session_make_req( 
-               osrf_app_session* session, jsonObject* params, 
-               char* method_name, int protocol, string_array* param_strings);
-
-/** Sets the given request to complete state */
-void osrf_app_session_set_complete( osrf_app_session* session, int request_id );
-
-/** Returns true if the given request is complete */
-int osrf_app_session_request_complete( osrf_app_session* session, int request_id );
-
-/** Does a recv call on the given request */
-osrf_message* osrfAppSessionRequestRecv(
-               osrf_app_session* session, int request_id, int timeout );
-osrf_message* osrf_app_session_request_recv( 
-               osrf_app_session* session, int request_id, int timeout );
-
-/** Removes the request from the request set and frees the reqest */
-void osrf_app_session_request_finish( osrf_app_session* session, int request_id );
-
-/** Resends the orginal request with the given request id */
-int osrf_app_session_request_resend( osrf_app_session*, int request_id );
-
-/** Resets the remote connection target to that of the original*/
-void osrf_app_session_reset_remote( osrf_app_session* );
-
-/** Sets the remote target to 'remote_id' */
-void osrf_app_session_set_remote( osrf_app_session* session, char* remote_id );
-
-/** pushes the given message into the result list of the app_request
-  * whose request_id matches the messages thread_trace 
-  */
-int osrf_app_session_push_queue( osrf_app_session*, osrf_message* msg );
-
-/** Attempts to connect to the remote service. Returns 1 on successful 
-  * connection, 0 otherwise.
-  */
-int osrf_app_session_connect( osrf_app_session* );
-int osrfAppSessionConnect( osrf_app_session* );
-
-/** Sends a disconnect message to the remote service.  No response is expected */
-int osrf_app_session_disconnect( osrf_app_session* );
-
-/**  Waits up to 'timeout' seconds for some data to arrive.
-  * Any data that arrives will be processed according to its
-  * payload and message type.  This method will return after
-  * any data has arrived.
-  */
-int osrf_app_session_queue_wait( osrf_app_session*, int timeout, int* recvd );
-
-/** Disconnects (if client), frees any attached app_reuqests, removes the session from the 
-  * global session cache and frees the session.  Needless to say, only call this when the
-  * session is completey done.
-  */
-void osrf_app_session_destroy ( osrf_app_session* );
-void osrfAppSessionFree( osrfAppSession* );
-
-
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-// Request functions
-// --------------------------------------------------------------------------
-
-/** Allocations and initializes a new app_request object */
-osrf_app_request* _osrf_app_request_init( osrf_app_session* session, osrf_message* msg );
-
-/** Frees memory used by an app_request object */
-void _osrf_app_request_free( void * req );
-
-/** Pushes the given message onto the list of 'responses' to this request */
-void _osrf_app_request_push_queue( osrf_app_request*, osrf_message* payload );
-
-/** Checks the receive queue for messages.  If any are found, the first
-  * is popped off and returned.  Otherwise, this method will wait at most timeout 
-  * seconds for a message to appear in the receive queue.  Once it arrives it is returned.
-  * If no messages arrive in the timeout provided, null is returned.
-  */
-osrf_message* _osrf_app_request_recv( osrf_app_request* req, int timeout );
-
-/** Resend this requests original request message */
-int _osrf_app_request_resend( osrf_app_request* req );
-
-
-/* tells the request to reset it's wait timeout */
-void osrf_app_session_request_reset_timeout( osrf_app_session* session, int req_id );
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-// Session functions 
-// --------------------------------------------------------------------------
-
-/** Returns the app_request with the given thread_trace (request_id) */
-osrf_app_request* _osrf_app_session_get_request( osrf_app_session*, int thread_trace );
-
-/** frees memory held by a session. Note: We delete all requests in the request list */
-void _osrf_app_session_free( osrf_app_session* );
-
-/** adds a session to the global session cache */
-void _osrf_app_session_push_session( osrf_app_session* );
-
-/** Adds an app_request to the request set */
-void _osrf_app_session_push_request( osrf_app_session*, osrf_app_request* req );
-
-/** Removes an app_request from this session request set, freeing the request object */
-void _osrf_app_session_remove_request( osrf_app_session*, osrf_app_request* req );
-
-/** Send the given message */
-int _osrf_app_session_send( osrf_app_session*, osrf_message* msg );
-
-int osrfAppSessionSendBatch( osrf_app_session*, osrf_message* msgs[], int size );
-
-int osrfAppRequestRespond( osrfAppSession* ses, int requestId, jsonObject* data ); 
-int osrfAppRequestRespondComplete( osrfAppSession* ses, int requestId, jsonObject* data ); 
-
-int osrfAppSessionStatus( osrfAppSession* ses, int type, char* name, int reqId, char* message );
-
-void osrfAppSessionCleanup();
-
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_application.c b/OpenSRF/src/libstack/osrf_application.c
deleted file mode 100644 (file)
index 4110783..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-#include "osrf_application.h"
-
-osrfHash* __osrfAppHash = NULL;
-
-int osrfAppRegisterApplication( char* appName, char* soFile ) {
-       if(!appName || ! soFile) return -1;
-       char* error;
-
-       if(!__osrfAppHash) __osrfAppHash = osrfNewHash();
-
-       osrfLogInfo( OSRF_LOG_MARK, "Registering application %s with file %s", appName, soFile );
-
-       osrfApplication* app = safe_malloc(sizeof(osrfApplication));
-       app->handle = dlopen (soFile, RTLD_NOW);
-   app->onExit = NULL;
-
-       if(!app->handle) {
-               osrfLogWarning( OSRF_LOG_MARK, "Failed to dlopen library file %s: %s", soFile, dlerror() );
-               dlerror(); /* clear the error */
-               free(app);
-               return -1;
-       }
-
-       app->methods = osrfNewHash();
-       osrfHashSet( __osrfAppHash, app, appName );
-
-       /* see if we can run the initialize method */
-       int (*init) (void);
-       *(void **) (&init) = dlsym(app->handle, "osrfAppInitialize");
-
-       if( (error = dlerror()) != NULL ) {
-               osrfLogWarning( OSRF_LOG_MARK, 
-                       "! Unable to locate method symbol [osrfAppInitialize] for app %s: %s", appName, error );
-
-       } else {
-
-               /* run the method */
-               int ret;
-               if( (ret = (*init)()) ) {
-                       osrfLogWarning( OSRF_LOG_MARK, "Application %s returned non-zero value from "
-                                       "'osrfAppInitialize', not registering...", appName );
-                       //free(app->name); /* need a method to remove an application from the list */
-                       //free(app);
-                       return ret;
-               }
-       }
-
-       __osrfAppRegisterSysMethods(appName);
-
-       osrfLogInfo( OSRF_LOG_MARK, "Application %s registered successfully", appName );
-
-       osrfLogSetAppname(appName);
-
-   osrfAppSetOnExit(app, appName);
-
-       return 0;
-}
-
-
-void osrfAppSetOnExit(osrfApplication* app, char* appName) {
-   if(!(app && appName)) return;
-
-       /* see if we can run the initialize method */
-   char* error;
-       void (*onExit) (void);
-       *(void **) (&onExit) = dlsym(app->handle, "osrfAppChildExit");
-
-       if( (error = dlerror()) != NULL ) {
-      osrfLogDebug(OSRF_LOG_MARK, "No exit handler defined for %s", appName);
-      return;
-   }
-
-   osrfLogInfo(OSRF_LOG_MARK, "registering exit handler for %s", appName);
-   app->onExit = (*onExit);
-   //if( (ret = (*onExit)()) ) {
-}
-
-
-int osrfAppRunChildInit(char* appname) {
-       osrfApplication* app = _osrfAppFindApplication(appname);
-       if(!app) return -1;
-
-       char* error;
-       int ret;
-       int (*childInit) (void);
-
-       *(void**) (&childInit) = dlsym(app->handle, "osrfAppChildInit");
-
-       if( (error = dlerror()) != NULL ) {
-               osrfLogInfo( OSRF_LOG_MARK, "No child init defined for app %s : %s", appname, error);
-               return 0;
-       }
-
-       if( (ret = (*childInit)()) ) {
-               osrfLogError(OSRF_LOG_MARK, "App %s child init failed", appname);
-               return -1;
-       }
-
-       osrfLogInfo(OSRF_LOG_MARK, "%s child init succeeded", appname);
-       return 0;
-}
-
-
-void osrfAppRunExitCode() { 
-   osrfHashIterator* itr = osrfNewHashIterator(__osrfAppHash);
-   osrfApplication* app;
-   while( (app = osrfHashIteratorNext(itr)) ) {
-      if( app->onExit ) {
-         osrfLogInfo(OSRF_LOG_MARK, "Running onExit handler for app %s", itr->current);
-         app->onExit();
-      }
-   }
-}
-
-
-int osrfAppRegisterMethod( char* appName, char* methodName, 
-               char* symbolName, char* notes, int argc, int options ) {
-
-       return osrfAppRegisterExtendedMethod(
-                       appName,
-                       methodName,
-                       symbolName,
-                       notes,
-                       argc,
-                       options,
-                       NULL
-       );
-
-}
-
-int osrfAppRegisterExtendedMethod( char* appName, char* methodName, 
-               char* symbolName, char* notes, int argc, int options, void * user_data ) {
-
-       if( !appName || ! methodName  ) return -1;
-
-       osrfApplication* app = _osrfAppFindApplication(appName);
-       if(!app) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to locate application %s", appName );
-               return -1;
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "Registering method %s for app %s", methodName, appName );
-
-       osrfMethod* method = _osrfAppBuildMethod(
-               methodName, symbolName, notes, argc, options, user_data );              
-       method->options = options;
-
-       /* plug the method into the list of methods */
-       osrfHashSet( app->methods, method, method->name );
-
-       if( options & OSRF_METHOD_STREAMING ) { /* build the atomic counterpart */
-               int newops = options | OSRF_METHOD_ATOMIC;
-               osrfMethod* atomicMethod = _osrfAppBuildMethod(
-                       methodName, symbolName, notes, argc, newops, NULL );            
-               osrfHashSet( app->methods, atomicMethod, atomicMethod->name );
-               atomicMethod->userData = method->userData;
-       }
-
-       return 0;
-}
-
-
-
-osrfMethod* _osrfAppBuildMethod( char* methodName, 
-       char* symbolName, char* notes, int argc, int options, void* user_data ) {
-
-       osrfMethod* method                                      = safe_malloc(sizeof(osrfMethod));
-
-       if(methodName) method->name             = strdup(methodName);
-       if(symbolName) method->symbol           = strdup(symbolName);
-       if(notes) method->notes                         = strdup(notes);
-       if(user_data) method->userData  = user_data;
-
-       method->argc                                                    = argc;
-       method->options                                         = options;
-
-       if(options & OSRF_METHOD_ATOMIC) { /* add ".atomic" to the end of the name */
-               char mb[strlen(method->name) + 8];
-               sprintf(mb, "%s.atomic", method->name);
-               free(method->name);
-               method->name = strdup(mb);
-               method->options |= OSRF_METHOD_STREAMING;
-       }
-
-       return method;
-}
-
-
-int __osrfAppRegisterSysMethods( char* app ) {
-
-       osrfAppRegisterMethod( 
-                       app, OSRF_SYSMETHOD_INTROSPECT, NULL, 
-                       "Return a list of methods whose names have the same initial "
-                       "substring as that of the provided method name PARAMS( methodNameSubstring )", 
-                       1, OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING );
-
-       osrfAppRegisterMethod( 
-                       app, OSRF_SYSMETHOD_INTROSPECT_ALL, NULL, 
-                       "Returns a complete list of methods. PARAMS()", 0, 
-                       OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING );
-
-       osrfAppRegisterMethod( 
-                       app, OSRF_SYSMETHOD_ECHO, NULL, 
-                       "Echos all data sent to the server back to the client. PARAMS([a, b, ...])", 0, 
-                       OSRF_METHOD_SYSTEM | OSRF_METHOD_STREAMING );
-
-       return 0;
-}
-
-osrfApplication* _osrfAppFindApplication( char* name ) {
-       if(!name) return NULL;
-       return (osrfApplication*) osrfHashGet(__osrfAppHash, name);
-}
-
-osrfMethod* __osrfAppFindMethod( osrfApplication* app, char* methodName ) {
-       if(!app || ! methodName) return NULL;
-       return (osrfMethod*) osrfHashGet( app->methods, methodName );
-}
-
-osrfMethod* _osrfAppFindMethod( char* appName, char* methodName ) {
-       if(!appName || ! methodName) return NULL;
-       return __osrfAppFindMethod( _osrfAppFindApplication(appName), methodName );
-}
-
-
-int osrfAppRunMethod( char* appName, char* methodName, 
-               osrfAppSession* ses, int reqId, jsonObject* params ) {
-
-       if( !(appName && methodName && ses) ) return -1;
-
-       char* error;
-       osrfApplication* app;
-       osrfMethod* method;
-       osrfMethodContext context;
-
-       context.session = ses;
-       context.params = params;
-       context.request = reqId;
-       context.responses = NULL;
-
-       /* this is the method we're gonna run */
-       int (*meth) (osrfMethodContext*);       
-
-       if( !(app = _osrfAppFindApplication(appName)) )
-               return osrfAppRequestRespondException( ses, 
-                               reqId, "Application not found: %s", appName );
-       
-       if( !(method = __osrfAppFindMethod( app, methodName )) ) 
-               return osrfAppRequestRespondException( ses, reqId, 
-                               "Method [%s] not found for service %s", methodName, appName );
-
-       context.method = method;
-
-       #ifdef OSRF_STRICT_PARAMS
-       if( method->argc > 0 ) {
-               if(!params || params->type != JSON_ARRAY || params->size < method->argc )
-                       return osrfAppRequestRespondException( ses, reqId, 
-                               "Not enough params for method %s / service %s", methodName, appName );
-       }
-       #endif
-
-       int retcode = 0;
-
-       if( method->options & OSRF_METHOD_SYSTEM ) {
-               retcode = __osrfAppRunSystemMethod(&context);
-
-       } else {
-
-               /* open and now run the method */
-               *(void **) (&meth) = dlsym(app->handle, method->symbol);
-
-               if( (error = dlerror()) != NULL ) {
-                       return osrfAppRequestRespondException( ses, reqId, 
-                               "Unable to execute method [%s]  for service %s", methodName, appName );
-               }
-
-               retcode = (*meth) (&context);
-       }
-
-       if(retcode < 0) 
-               return osrfAppRequestRespondException( 
-                               ses, reqId, "An unknown server error occurred" );
-
-       return __osrfAppPostProcess( &context, retcode );
-
-}
-
-
-int osrfAppRespond( osrfMethodContext* ctx, jsonObject* data ) {
-       return _osrfAppRespond( ctx, data, 0 );
-}
-
-int osrfAppRespondComplete( osrfMethodContext* context, jsonObject* data ) {
-       return _osrfAppRespond( context, data, 1 );
-}
-
-int _osrfAppRespond( osrfMethodContext* ctx, jsonObject* data, int complete ) {
-       if(!(ctx && ctx->method)) return -1;
-
-       if( ctx->method->options & OSRF_METHOD_ATOMIC ) {
-               osrfLogDebug( OSRF_LOG_MARK,   
-                       "Adding responses to stash for atomic method %s", ctx->method->name );
-
-               if( ctx->responses == NULL )                                                                                            
-                       ctx->responses = jsonParseString("[]");                                                 
-
-               if ( data != NULL )
-                       jsonObjectPush( ctx->responses, jsonObjectClone(data) );        
-       }
-
-
-       if(     !(ctx->method->options & OSRF_METHOD_ATOMIC) && 
-                       !(ctx->method->options & OSRF_METHOD_CACHABLE) ) {
-
-               if(complete) 
-                       osrfAppRequestRespondComplete( ctx->session, ctx->request, data );
-               else
-                       osrfAppRequestRespond( ctx->session, ctx->request, data );
-               return 0;
-       }
-
-       return 0;
-}
-
-
-
-
-int __osrfAppPostProcess( osrfMethodContext* ctx, int retcode ) {
-       if(!(ctx && ctx->method)) return -1;
-
-       osrfLogDebug( OSRF_LOG_MARK,  "Postprocessing method %s with retcode %d",
-                       ctx->method->name, retcode );
-
-       if(ctx->responses) { /* we have cached responses to return (no responses have been sent) */
-
-               osrfAppRequestRespondComplete( ctx->session, ctx->request, ctx->responses );
-               jsonObjectFree(ctx->responses);
-               ctx->responses = NULL;
-
-       } else {
-
-               if( retcode > 0 ) 
-                       osrfAppSessionStatus( ctx->session, OSRF_STATUS_COMPLETE,  
-                                       "osrfConnectStatus", ctx->request, "Request Complete" );
-       }
-
-       return 0;
-}
-
-int osrfAppRequestRespondException( osrfAppSession* ses, int request, char* msg, ... ) {
-       if(!ses) return -1;
-       if(!msg) msg = "";
-       VA_LIST_TO_STRING(msg);
-       osrfLogWarning( OSRF_LOG_MARK,  "Returning method exception with message: %s", VA_BUF );
-       osrfAppSessionStatus( ses, OSRF_STATUS_NOTFOUND, "osrfMethodException", request,  VA_BUF );
-       return 0;
-}
-
-
-static void __osrfAppSetIntrospectMethod( osrfMethodContext* ctx, osrfMethod* method, jsonObject* resp ) {
-       if(!(ctx && resp)) return;
-
-       jsonObjectSetKey(resp, "api_name",      jsonNewObject(method->name));
-       jsonObjectSetKey(resp, "method",                jsonNewObject(method->symbol));
-       jsonObjectSetKey(resp, "service",       jsonNewObject(ctx->session->remote_service));
-       jsonObjectSetKey(resp, "notes",         jsonNewObject(method->notes));
-       jsonObjectSetKey(resp, "argc",          jsonNewNumberObject(method->argc));
-
-       jsonObjectSetKey(resp, "sysmethod", 
-                       jsonNewNumberObject( (method->options & OSRF_METHOD_SYSTEM) ? 1 : 0 ));
-       jsonObjectSetKey(resp, "atomic",                
-                       jsonNewNumberObject( (method->options & OSRF_METHOD_ATOMIC) ? 1 : 0 ));
-       jsonObjectSetKey(resp, "cachable",      
-                       jsonNewNumberObject( (method->options & OSRF_METHOD_CACHABLE) ? 1 : 0 ));
-
-       jsonObjectSetClass(resp, "method");
-}
-
-
-
-int __osrfAppRunSystemMethod(osrfMethodContext* ctx) {
-       OSRF_METHOD_VERIFY_CONTEXT(ctx);
-
-       if(     !strcmp(ctx->method->name, OSRF_SYSMETHOD_INTROSPECT_ALL ) || 
-                       !strcmp(ctx->method->name, OSRF_SYSMETHOD_INTROSPECT_ALL_ATOMIC )) {
-
-               return osrfAppIntrospectAll(ctx);
-       }
-
-
-       if(     !strcmp(ctx->method->name, OSRF_SYSMETHOD_INTROSPECT ) ||
-                       !strcmp(ctx->method->name, OSRF_SYSMETHOD_INTROSPECT_ATOMIC )) {
-
-               return osrfAppIntrospect(ctx);
-       }
-
-       if(     !strcmp(ctx->method->name, OSRF_SYSMETHOD_ECHO ) ||
-                       !strcmp(ctx->method->name, OSRF_SYSMETHOD_ECHO_ATOMIC )) {
-
-               return osrfAppEcho(ctx);
-       }
-
-
-       osrfAppRequestRespondException( ctx->session, 
-                       ctx->request, "System method implementation not found");
-
-       return 0;
-}
-
-
-int osrfAppIntrospect( osrfMethodContext* ctx ) {
-
-       jsonObject* resp = NULL;
-       char* methodSubstring = jsonObjectGetString( jsonObjectGetIndex(ctx->params, 0) );
-       osrfApplication* app = _osrfAppFindApplication( ctx->session->remote_service );
-       int len = 0;
-
-       if(!methodSubstring) return 1; /* respond with no methods */
-
-       if(app) {
-
-               osrfHashIterator* itr = osrfNewHashIterator(app->methods);
-               osrfMethod* method;
-
-               while( (method = osrfHashIteratorNext(itr)) ) {
-                       if( (len = strlen(methodSubstring)) <= strlen(method->name) ) {
-                               if( !strncmp( method->name, methodSubstring, len) ) {
-                                       resp = jsonNewObject(NULL);
-                                       __osrfAppSetIntrospectMethod( ctx, method, resp );
-                                       osrfAppRespond(ctx, resp);
-                                       jsonObjectFree(resp);
-                               }
-                       }
-               }
-               osrfHashIteratorFree(itr);
-               return 1;
-       }
-
-       return -1;
-
-}
-
-
-int osrfAppIntrospectAll( osrfMethodContext* ctx ) {
-       jsonObject* resp = NULL;
-       osrfApplication* app = _osrfAppFindApplication( ctx->session->remote_service );
-
-       if(app) {
-               osrfHashIterator* itr = osrfNewHashIterator(app->methods);
-               osrfMethod* method;
-               while( (method = osrfHashIteratorNext(itr)) ) {
-                       resp = jsonNewObject(NULL);
-                       __osrfAppSetIntrospectMethod( ctx, method, resp );
-                       osrfAppRespond(ctx, resp);
-                       jsonObjectFree(resp);
-               }
-               osrfHashIteratorFree(itr);
-               return 1;
-       }
-
-       return -1;
-}
-
-int osrfAppEcho( osrfMethodContext* ctx ) {
-       OSRF_METHOD_VERIFY_CONTEXT(ctx);
-       int i;
-       for( i = 0; i < ctx->params->size; i++ ) {
-               jsonObject* str = jsonObjectGetIndex(ctx->params,i);
-               osrfAppRespond(ctx, str);
-       }
-       return 1;
-}
-
diff --git a/OpenSRF/src/libstack/osrf_application.h b/OpenSRF/src/libstack/osrf_application.h
deleted file mode 100644 (file)
index de6a167..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-#include <stdio.h>
-#include <dlfcn.h>
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "osrf_json.h"
-#include "osrf_app_session.h"
-#include "osrf_hash.h"
-
-
-/**
-  All OpenSRF methods take the signature
-  int methodName( osrfMethodContext* );
-  If a negative number is returned, it means an unknown error occured and an exception
-  will be returned to the client automatically.
-  If a positive number is returned, it means that libopensrf should send a 'Request Complete'
-  message following any messages sent by the method.
-  If 0 is returned, it tells libopensrf that the method completed successfully and 
-  there is no need to send any further data to the client.
-  */
-
-
-
-/** 
-  This macro verifies methods receive the correct parameters */
-#define _OSRF_METHOD_VERIFY_CONTEXT(d) \
-       if(!d) return -1; \
-       if(!d->session) { osrfLogError( OSRF_LOG_MARK,  "Session is NULL in app reqeust" ); return -1; }\
-       if(!d->method) { osrfLogError( OSRF_LOG_MARK,  "Method is NULL in app reqeust" ); return -1; }\
-       if(d->method->argc) {\
-               if(!d->params) { osrfLogError( OSRF_LOG_MARK,  "Params is NULL in app reqeust %s", d->method->name ); return -1; }\
-               if( d->params->type != JSON_ARRAY ) { \
-                       osrfLogError( OSRF_LOG_MARK,  "'params' is not a JSON array for method %s", d->method->name);\
-                       return -1; }\
-       }\
-       if( !d->method->name ) { osrfLogError( OSRF_LOG_MARK,  "Method name is NULL"); return -1; } 
-
-#ifdef OSRF_LOG_PARAMS 
-#define OSRF_METHOD_VERIFY_CONTEXT(d) \
-       _OSRF_METHOD_VERIFY_CONTEXT(d); \
-       char* __j = jsonObjectToJSON(d->params);\
-       if(__j) { \
-               osrfLogInfo( OSRF_LOG_MARK,  "CALL:     %s %s - %s", d->session->remote_service, d->method->name, __j);\
-               free(__j); \
-       } 
-#else
-#define OSRF_METHOD_VERIFY_CONTEXT(d) _OSRF_METHOD_VERIFY_CONTEXT(d); 
-#endif
-
-
-
-/* used internally to make sure the method description provided is OK */
-#define OSRF_METHOD_VERIFY_DESCRIPTION(app, d) \
-       if(!app) return -1; \
-       if(!d) return -1;\
-       if(!d->name) { osrfLogError( OSRF_LOG_MARK,  "No method name provided in description" ), return -1; } \
-       if(!d->symbol) { osrfLogError( OSRF_LOG_MARK,  "No method symbol provided in description" ), return -1; } \
-       if(!d->notes) d->notes = ""; \
-       if(!d->paramNotes) d->paramNotes = "";\
-       if(!d->returnNotes) d->returnNotes = "";
-
-
-
-
-/* Some well known parameters */
-#define OSRF_SYSMETHOD_INTROSPECT                              "opensrf.system.method"
-#define OSRF_SYSMETHOD_INTROSPECT_ATOMIC               "opensrf.system.method.atomic"
-#define OSRF_SYSMETHOD_INTROSPECT_ALL                  "opensrf.system.method.all"
-#define OSRF_SYSMETHOD_INTROSPECT_ALL_ATOMIC   "opensrf.system.method.all.atomic"
-#define OSRF_SYSMETHOD_ECHO                                            "opensrf.system.echo"
-#define OSRF_SYSMETHOD_ECHO_ATOMIC                             "opensrf.system.echo.atomic"
-
-#define OSRF_METHOD_SYSTEM                     1
-#define OSRF_METHOD_STREAMING          2
-#define OSRF_METHOD_ATOMIC                     4
-#define OSRF_METHOD_CACHABLE           8
-
-       
-
-struct _osrfApplicationStruct {
-       void* handle;                                                                   /* the lib handle */
-       osrfHash* methods;
-   void (*onExit) (void);
-};
-typedef struct _osrfApplicationStruct osrfApplication;
-
-
-struct _osrfMethodStruct {
-       char* name;                                     /* the method name */
-       char* symbol;                           /* the symbol name (function) */
-       char* notes;                            /* public method documentation */
-       int argc;                                       /* how many args this method expects */
-       //char* paramNotes;                     /* Description of the params expected for this method */
-       int options;                            /* describes the various options for this method */
-       void* userData;                         /* You can put your weeeeeeed in it ... */
-
-       /*
-       int sysmethod;                          
-       int streaming;                          
-       int atomic;                                     
-       int cachable;                           
-       */
-}; 
-typedef struct _osrfMethodStruct osrfMethod;
-
-struct _osrfMethodContextStruct {
-       osrfAppSession* session;        /* the current session */
-       osrfMethod* method;                     /* the requested method */      
-       jsonObject* params;                     /* the params to the method */
-       int request;                                    /* request id */
-       jsonObject* responses;          /* array of cached responses. */
-};
-typedef struct _osrfMethodContextStruct osrfMethodContext;
-
-
-
-/** 
-  Register an application
-  @param appName The name of the application
-  @param soFile The library (.so) file that implements this application
-  @return 0 on success, -1 on error
-  */
-int osrfAppRegisterApplication( char* appName, char* soFile );
-
-/**
-  Register a method
-  Any method with  the OSRF_METHOD_STREAMING option set will have a ".atomic"
-  version of the method registered automatically
-  @param appName The name of the application that implements the method
-  @param methodName The fully qualified name of the method
-  @param symbolName The symbol name (function) that implements the method
-  @param notes Public documentation for this method.
-  @params argc The number of arguments this method expects 
-  @param streaming True if this is a streaming method that requires an atomic version
-  @return 0 on success, -1 on error
-  */
-int osrfAppRegisterMethod( char* appName, char* methodName, 
-               char* symbolName, char* notes, int argc, int options );
-
-
-int osrfAppRegisterExtendedMethod( char* appName, char* methodName, 
-               char* symbolName, char* notes, int argc, int options, void* );
-
-osrfMethod* _osrfAppBuildMethod( char* methodName, 
-               char* symbolName, char* notes, int argc, int options, void* );
-
-/**
-  Finds the given app in the list of apps
-  @param name The name of the application
-  @return The application pointer or NULL if there is no such application
-  */
-osrfApplication* _osrfAppFindApplication( char* name );
-
-/**
-  Finds the given method for the given app
-  @param appName The application
-  @param methodName The method to find
-  @return A method pointer or NULL if no such method 
-  exists for the given application
-  */
-osrfMethod* _osrfAppFindMethod( char* appName, char* methodName );
-
-/**
-  Finds the given method for the given app
-  @param app The application object
-  @param methodName The method to find
-  @return A method pointer or NULL if no such method 
-  exists for the given application
-  */
-osrfMethod* __osrfAppFindMethod( osrfApplication* app, char* methodName );
-
-
-/**
-  Runs the specified method for the specified application.
-  @param appName The name of the application who's method to run
-  @param methodName The name of the method to run
-  @param ses The app session attached to this request
-  @params reqId The request id for this request
-  @param params The method parameters
-  */
-int osrfAppRunMethod( char* appName, char* methodName, 
-               osrfAppSession* ses, int reqId, jsonObject* params );
-
-
-/**
-  Trys to run the requested method as a system method.
-  A system method is a well known method that all
-  servers implement.  
-  @param context The current method context
-  @return 0 if the method is run successfully, return < 0 means
-  the method was not run, return > 0 means the method was run
-  and the application code now needs to send a 'request complete' 
-  message
-  */
-int __osrfAppRunSystemMethod(osrfMethodContext* context);
-
-/**
-  Registers all of the system methods for this app so that they may be
-  treated the same as other methods */
-int __osrfAppRegisterSysMethods( char* app );
-
-
-
-/**
-  Responds to the client with a method exception
-  @param ses The current session
-  @param request The request id
-  @param msg The debug message to send to the client
-  @return 0 on successfully sending of the message, -1 otherwise
-  */
-int osrfAppRequestRespondException( osrfAppSession* ses, int request, char* msg, ... );
-
-int __osrfAppPostProcess( osrfMethodContext* context, int retcode );
-
-
-int osrfAppRespond( osrfMethodContext* context, jsonObject* data );
-int _osrfAppRespond( osrfMethodContext* context, jsonObject* data, int complete );
-int osrfAppRespondComplete( osrfMethodContext* context, jsonObject* data );
-
-/* OSRF_METHOD_ATOMIC and/or OSRF_METHOD_CACHABLE and/or 0 for no special options */
-//int osrfAppProcessMethodOptions( char* method );
-
-int osrfAppIntrospect( osrfMethodContext* ctx );
-int osrfAppIntrospectAll( osrfMethodContext* ctx );
-int osrfAppEcho( osrfMethodContext* ctx );
-
-
-/**
- * Tells the backend process to run its child init function */
-int osrfAppRunChildInit(char* appname);
-void osrfAppSetOnExit(osrfApplication* app, char* appName);
-void osrfAppRunExitCode();
-
-
diff --git a/OpenSRF/src/libstack/osrf_big_hash.c b/OpenSRF/src/libstack/osrf_big_hash.c
deleted file mode 100644 (file)
index 41d5131..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#include "osrf_big_hash.h"
-
-osrfBigHash* osrfNewBigHash() {
-       osrfBigHash* hash = safe_malloc(sizeof(osrfBigHash));
-       hash->hash = (Pvoid_t) NULL;
-       hash->freeItem = NULL;
-       return hash;
-}
-
-void* osrfBigHashSet( osrfBigHash* hash, void* item, const char* key, ... ) {
-       if(!(hash && item && key )) return NULL;
-
-       Word_t* value;
-       VA_LIST_TO_STRING(key);
-       uint8_t idx[strlen(VA_BUF) + 1];
-       strcpy( idx, VA_BUF );
-
-       void* olditem = osrfBigHashRemove( hash, VA_BUF );
-
-       JSLI(value, hash->hash, idx);
-       if(value) *value = (Word_t) item;
-       return olditem;
-       
-}
-
-void* osrfBigHashRemove( osrfBigHash* hash, const char* key, ... ) {
-       if(!(hash && key )) return NULL;
-
-       VA_LIST_TO_STRING(key);
-
-       Word_t* value;
-       uint8_t idx[strlen(VA_BUF) + 1];
-       strcpy( idx, VA_BUF );
-       void* item = NULL;
-       int retcode;
-
-       JSLG( value, hash->hash,  idx);
-
-       if( value ) {
-               item = (void*) *value;
-               if(item) {
-                       if( hash->freeItem ) {
-                               hash->freeItem( (char*) idx, item ); 
-                               item = NULL;
-                       }
-               }
-       }
-
-
-       JSLD( retcode, hash->hash, idx );
-
-       return item;
-}
-
-
-void* osrfBigHashGet( osrfBigHash* hash, const char* key, ... ) {
-       if(!(hash && key )) return NULL;
-
-       VA_LIST_TO_STRING(key);
-
-       Word_t* value;
-       uint8_t idx[strlen(VA_BUF) + 1];
-       strcpy( idx, VA_BUF );
-
-       JSLG( value, hash->hash, idx );
-       if(value) return (void*) *value;
-       return NULL;
-}
-
-
-osrfStringArray* osrfBigHashKeys( osrfBigHash* hash ) {
-       if(!hash) return NULL;
-
-       Word_t* value;
-       uint8_t idx[OSRF_HASH_MAXKEY];
-       strcpy(idx, "");
-       char* key;
-       osrfStringArray* strings = osrfNewStringArray(8);
-
-       JSLF( value, hash->hash, idx );
-
-       while( value ) {
-               key = (char*) idx;
-               osrfStringArrayAdd( strings, key );
-               JSLN( value, hash->hash, idx );
-       }
-
-       return strings;
-}
-
-
-unsigned long osrfBigHashGetCount( osrfBigHash* hash ) {
-       if(!hash) return -1;
-
-       Word_t* value;
-       unsigned long count = 0;
-       uint8_t idx[OSRF_HASH_MAXKEY];
-
-       strcpy( (char*) idx, "");
-       JSLF(value, hash->hash, idx);
-
-       while(value) {
-               count++;
-               JSLN( value, hash->hash, idx );
-       }
-
-       return count;
-}
-
-void osrfBigHashFree( osrfBigHash* hash ) {
-       if(!hash) return;
-
-       int i;
-       osrfStringArray* keys = osrfBigHashKeys( hash );
-
-       for( i = 0; i != keys->size; i++ )  {
-               char* key = (char*) osrfStringArrayGetString( keys, i );
-               osrfBigHashRemove( hash, key );
-       }
-
-       osrfStringArrayFree(keys);
-       free(hash);
-}
-
-
-
-osrfBigHashIterator* osrfNewBigHashIterator( osrfBigHash* hash ) {
-       if(!hash) return NULL;
-       osrfBigHashIterator* itr = safe_malloc(sizeof(osrfBigHashIterator));
-       itr->hash = hash;
-       itr->current = NULL;
-       return itr;
-}
-
-void* osrfBigHashIteratorNext( osrfBigHashIterator* itr ) {
-       if(!(itr && itr->hash)) return NULL;
-
-       Word_t* value;
-       uint8_t idx[OSRF_HASH_MAXKEY];
-
-       if( itr->current == NULL ) { /* get the first item in the list */
-               strcpy(idx, "");
-               JSLF( value, itr->hash->hash, idx );
-
-       } else {
-               strcpy(idx, itr->current);
-               JSLN( value, itr->hash->hash, idx );
-       }
-
-       if(value) {
-               free(itr->current);
-               itr->current = strdup((char*) idx);
-               return (void*) *value;
-       }
-
-       return NULL;
-
-}
-
-void osrfBigHashIteratorFree( osrfBigHashIterator* itr ) {
-       if(!itr) return;
-       free(itr->current);
-       free(itr);
-}
-
-void osrfBigHashIteratorReset( osrfBigHashIterator* itr ) {
-       if(!itr) return;
-       free(itr->current);
-       itr->current = NULL;
-}
-
-
-
diff --git a/OpenSRF/src/libstack/osrf_big_hash.h b/OpenSRF/src/libstack/osrf_big_hash.h
deleted file mode 100644 (file)
index 22e0a46..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef OSRF_HASH_H
-#define OSRF_HASH_H
-
-#include <Judy.h>
-#include "opensrf/utils.h"
-#include "opensrf/string_array.h"
-
-#define OSRF_HASH_MAXKEY 256
-
-struct __osrfBigHashStruct {
-       Pvoid_t hash;                                                   /* the hash */
-       void (*freeItem) (char* key, void* item);       /* callback for freeing stored items */
-};
-typedef struct __osrfBigHashStruct osrfBigHash;
-
-
-struct __osrfBigHashIteratorStruct {
-       char* current;
-       osrfBigHash* hash;
-};
-typedef struct __osrfBigHashIteratorStruct osrfBigHashIterator;
-
-/**
-  Allocates a new hash object
-  */
-osrfBigHash* osrfNewBigHash();
-
-/**
-  Sets the given key with the given item
-  if "freeItem" is defined and an item already exists at the given location, 
-  then old item is freed and the new item is put into place.
-  if "freeItem" is not defined and an item already exists, the old item
-  is returned.
-  @return The old item if exists and there is no 'freeItem', returns NULL
-  otherwise
-  */
-void* osrfBigHashSet( osrfBigHash* hash, void* item, const char* key, ... );
-
-/**
-  Removes an item from the hash.
-  if 'freeItem' is defined it is used and NULL is returned,
-  else the freed item is returned
-  */
-void* osrfBigHashRemove( osrfBigHash* hash, const char* key, ... );
-
-void* osrfBigHashGet( osrfBigHash* hash, const char* key, ... );
-
-
-/**
-  @return A list of strings representing the keys of the hash. 
-  caller is responsible for freeing the returned string array 
-  with osrfStringArrayFree();
-  */
-osrfStringArray* osrfBigHashKeys( osrfBigHash* hash );
-
-/**
-  Frees a hash
-  */
-void osrfBigHashFree( osrfBigHash* hash );
-
-/**
-  @return The number of items in the hash
-  */
-unsigned long osrfBigHashGetCount( osrfBigHash* hash );
-
-
-
-
-/**
-  Creates a new list iterator with the given list
-  */
-osrfBigHashIterator* osrfNewBigHashIterator( osrfBigHash* hash );
-
-/**
-  Returns the next non-NULL item in the list, return NULL when
-  the end of the list has been reached
-  */
-void* osrfBigHashIteratorNext( osrfBigHashIterator* itr );
-
-/**
-  Deallocates the given list
-  */
-void osrfBigHashIteratorFree( osrfBigHashIterator* itr );
-
-void osrfBigHashIteratorReset( osrfBigHashIterator* itr );
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_big_list.c b/OpenSRF/src/libstack/osrf_big_list.c
deleted file mode 100644 (file)
index 5d7e3dc..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#include "osrf_big_list.h"
-
-
-osrfBigList* osrfNewBigList() {
-       osrfBigList* list = safe_malloc(sizeof(osrfBigList));
-       list->list = (Pvoid_t) NULL;
-       list->size = 0;
-       list->freeItem = NULL;
-       return list;
-}
-
-
-int osrfBigListPush( osrfBigList* list, void* item ) {
-       if(!(list && item)) return -1;
-       Word_t* value;
-       unsigned long index = -1;
-       JLL(value, list->list, index );
-       osrfBigListSet( list, item, index+1 );
-       return 0;
-}
-
-
-void* osrfBigListSet( osrfBigList* list, void* item, unsigned long position ) {
-       if(!list || position < 0) return NULL;
-
-       Word_t* value;
-       void* olditem = osrfBigListRemove( list, position );
-
-       JLI( value, list->list, position ); 
-       *value = (Word_t) item;
-       __osrfBigListSetSize( list );
-
-       return olditem;
-}
-
-
-void* osrfBigListGetIndex( osrfBigList* list, unsigned long position ) {
-       if(!list) return NULL;
-
-       Word_t* value;
-       JLG( value, list->list, position );
-       if(value) return (void*) *value;
-       return NULL;
-}
-
-void osrfBigListFree( osrfBigList* list ) {
-       if(!list) return;
-
-       Word_t* value;
-       unsigned long index = -1;
-       JLL(value, list->list, index );
-       int retcode;
-
-       while (value != NULL) {
-               if(list->freeItem) 
-                       list->freeItem( (void*) *value );
-               JLD(retcode, list->list, index);
-               JLP(value, list->list, index);
-       }               
-
-       free(list);
-}
-
-void* osrfBigListRemove( osrfBigList* list, int position ) {
-       if(!list) return NULL;
-
-       int retcode;
-       Word_t* value;
-       JLG( value, list->list, position );
-       void* olditem = NULL;
-
-       if( value ) {
-
-               olditem = (void*) *value;
-               if( olditem ) {
-                       JLD(retcode, list->list, position );
-                       if(retcode == 1) {
-                               if(list->freeItem) {
-                                       list->freeItem( olditem );
-                                       olditem = NULL;
-                               }
-                               __osrfBigListSetSize( list );
-                       }
-               }
-       }
-
-       return olditem;
-}
-
-
-int osrfBigListFind( osrfBigList* list, void* addr ) {
-       if(!(list && addr)) return -1;
-
-       Word_t* value;
-       unsigned long index = -1;
-       JLL(value, list->list, index );
-
-       while (value != NULL) {
-               if( (void*) *value == addr )
-                       return index;
-               JLP(value, list->list, index);
-       }
-
-       return -1;
-}
-
-
-
-void __osrfBigListSetSize( osrfBigList* list ) {
-       if(!list) return;
-
-       Word_t* value;
-       unsigned long index = -1;
-       JLL(value, list->list, index );
-       list->size = index + 1;
-}
-
-
-unsigned long osrfBigListGetCount( osrfBigList* list ) {
-       if(!list) return -1;
-       unsigned long retcode = -1;
-       JLC( retcode, list->list, 0, -1 );
-       return retcode;
-}
-
-
-void* osrfBigListPop( osrfBigList* list ) {
-       if(!list) return NULL;
-       return osrfBigListRemove( list, list->size - 1 );
-}
-
-
-osrfBigBigListIterator* osrfNewBigListIterator( osrfBigList* list ) {
-       if(!list) return NULL;
-       osrfBigBigListIterator* itr = safe_malloc(sizeof(osrfBigBigListIterator));
-       itr->list = list;
-       itr->current = 0;
-       return itr;
-}
-
-void* osrfBigBigListIteratorNext( osrfBigBigListIterator* itr ) {
-       if(!(itr && itr->list)) return NULL;
-
-       Word_t* value;
-       if(itr->current >= itr->list->size) return NULL;
-       JLF( value, itr->list->list, itr->current );
-       if(value) {
-               itr->current++;
-               return (void*) *value;
-       }
-       return NULL;
-}
-
-void osrfBigBigListIteratorFree( osrfBigBigListIterator* itr ) {
-       if(!itr) return;
-       free(itr);
-}
-
-
-
-void osrfBigBigListIteratorReset( osrfBigBigListIterator* itr ) {
-       if(!itr) return;
-       itr->current = 0;
-}
-
-
-void osrfBigListVanillaFree( void* item ) {
-       free(item);
-}
-
-void osrfBigListSetDefaultFree( osrfBigList* list ) {
-       if(!list) return;
-       list->freeItem = osrfBigListVanillaFree;
-}
diff --git a/OpenSRF/src/libstack/osrf_big_list.h b/OpenSRF/src/libstack/osrf_big_list.h
deleted file mode 100644 (file)
index 523f28d..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef OSRF_BIG_LIST_H
-#define OSRF_BIG_LIST_H
-
-
-#include <stdio.h>
-#include "opensrf/utils.h"
-#include <Judy.h>
-
-/**
-  Items are stored as void*'s so it's up to the user to
-  manage the data wisely.  Also, if the 'freeItem' callback is defined for the list,
-  then, it will be used on any item that needs to be freed, so don't mix data
-  types in the list if you want magic freeing */
-
-struct __osrfBigListStruct {
-       Pvoid_t list;                                                   /* the list */
-       int size;                                                               /* how many items in the list including NULL items between non-NULL items */    
-       void (*freeItem) (void* item);  /* callback for freeing stored items */
-};
-typedef struct __osrfBigListStruct osrfBigList;
-
-
-struct __osrfBigBigListIteratorStruct {
-       osrfBigList* list;
-       unsigned long current;
-};
-typedef struct __osrfBigBigListIteratorStruct osrfBigBigListIterator;
-
-
-/**
-  Creates a new list iterator with the given list
-  */
-osrfBigBigListIterator* osrfNewBigListIterator( osrfBigList* list );
-
-/**
-  Returns the next non-NULL item in the list, return NULL when
-  the end of the list has been reached
-  */
-void* osrfBigBigListIteratorNext( osrfBigBigListIterator* itr );
-
-/**
-  Deallocates the given list
-  */
-void osrfBigBigListIteratorFree( osrfBigBigListIterator* itr );
-
-void osrfBigBigListIteratorReset( osrfBigBigListIterator* itr );
-
-
-/**
-  Allocates a new list
-  @param compress If true, the list will compress empty slots on delete.  If item positionality
-  is not important, then using this feature is reccomended to keep the list from growing indefinitely.
-  if item positionality is not important.
-  @return The allocated list
-  */
-osrfBigList* osrfNewBigList();
-
-/**
-  Pushes an item onto the end of the list.  This always finds the highest index
-  in the list and pushes the new item into the list after it.
-  @param list The list
-  @param item The item to push
-  @return 0 on success, -1 on failure
-  */
-int osrfBigListPush( osrfBigList* list, void* item );
-
-
-/**
- * Removes the last item in the list
- * See osrfBigListRemove for details on how the removed item is handled
- * @return The item, unless 'freeItem' exists, then returns NULL
- */
-void* osrfBigListPop( osrfBigList* list );
-
-/**
-  Puts the given item into the list at the specified position.  If there
-  is already an item at the given position and the list has it's 
-  "freeItem" function defined, then it will be used to free said item.
-  If no 'freeItem' callback is defined, then the displaced item will
-  be returned;
-  @param list The list
-  @param item The item to put into the list
-  @param position The position to place the item in
-  @return NULL in successfully inserting the new item and freeing
-  any displaced items.  Returns the displaced item if no "freeItem"
-  callback is defined.
-       */
-void* osrfBigListSet( osrfBigList* list, void* item, unsigned long position );
-
-/**
-  Returns the item at the given position
-  @param list The list
-  @param postiont the position
-  */
-void* osrfBigListGetIndex( osrfBigList* list, unsigned long  position );
-
-/**
-  Frees the list and all list items (if the list has a "freeItem" function defined )
-  @param list The list
-  */
-void osrfBigListFree( osrfBigList* list );
-
-/**
-  Removes the list item at the given index
-  @param list The list
-  @param position The position of the item to remove
-  @return A pointer to the item removed if "freeItem" is not defined
-  for this list, returns NULL if it is.
-  */
-void* osrfBigListRemove( osrfBigList* list, int position );
-
-/**
-  Finds the list item whose void* is the same as the one passed in
-  @param list The list
-  @param addr The pointer connected to the list item we're to find
-  @return the index of the item, or -1 if the item was not found
-  */
-int osrfBigListFind( osrfBigList* list, void* addr );
-
-
-void __osrfBigListSetSize( osrfBigList* list );
-
-
-/**
-  @return The number of non-null items in the list
-  */
-unsigned long osrfBigListGetCount( osrfBigList* list );
-
-/**
- * May be used as a default memory freeing call
- * Just calls free() on list items
- */
-void osrfBigListVanillaFree( void* item );
-
-/**
- * Tells the list to just call 'free()' on each item when
- * an item or the whole list is destroyed
- */
-void osrfBigListSetDefaultFree( osrfBigList* list );
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_cache.c b/OpenSRF/src/libstack/osrf_cache.c
deleted file mode 100644 (file)
index 13cb272..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "osrf_cache.h"
-
-struct memcache* __osrfCache = NULL;
-time_t __osrfCacheMaxSeconds = -1;
-
-int osrfCacheInit( char* serverStrings[], int size, time_t maxCacheSeconds ) {
-       if( !(serverStrings && size > 0) ) return -1;
-
-       int i;
-       __osrfCache = mc_new();
-       __osrfCacheMaxSeconds = maxCacheSeconds;
-
-       for( i = 0; i < size && serverStrings[i]; i++ ) 
-               mc_server_add4( __osrfCache, serverStrings[i] );
-
-       return 0;
-}
-
-int osrfCachePutObject( char* key, const jsonObject* obj, time_t seconds ) {
-       if( !(key && obj) ) return -1;
-       char* s = jsonObjectToJSON( obj );
-       osrfLogInternal( OSRF_LOG_MARK, "osrfCachePut(): Putting object: %s", s);
-       if( seconds < 0 ) seconds = __osrfCacheMaxSeconds;
-
-       mc_set(__osrfCache, key, strlen(key), s, strlen(s), seconds, 0);
-       free(s);
-       return 0;
-}
-
-int osrfCachePutString( char* key, const char* value, time_t seconds ) {
-       if( !(key && value) ) return -1;
-       if( seconds < 0 ) seconds = __osrfCacheMaxSeconds;
-       osrfLogInternal( OSRF_LOG_MARK, "osrfCachePutString(): Putting string: %s", value);
-       mc_set(__osrfCache, key, strlen(key), value, strlen(value), seconds, 0);
-       return 0;
-}
-
-jsonObject* osrfCacheGetObject( char* key, ... ) {
-       jsonObject* obj = NULL;
-       if( key ) {
-               VA_LIST_TO_STRING(key);
-               char* data = (char*) mc_aget( __osrfCache, VA_BUF, strlen(VA_BUF) );
-               if( data ) {
-                       osrfLogInternal( OSRF_LOG_MARK, "osrfCacheGetObject(): Returning object: %s", data);
-                       obj = jsonParseString( data );
-                       return obj;
-               }
-               osrfLogWarning(OSRF_LOG_MARK, "No cache data exists with key %s", VA_BUF);
-       }
-       return NULL;
-}
-
-char* osrfCacheGetString( char* key, ... ) {
-       if( key ) {
-               VA_LIST_TO_STRING(key);
-               char* data = (char*) mc_aget(__osrfCache, VA_BUF, strlen(VA_BUF) );
-               osrfLogInternal( OSRF_LOG_MARK, "osrfCacheGetObject(): Returning object: %s", data);
-               if(!data) osrfLogWarning(OSRF_LOG_MARK, "No cache data exists with key %s", VA_BUF);
-               return data;
-       }
-       return NULL;
-}
-
-
-int osrfCacheRemove( char* key, ... ) {
-       if( key ) {
-               VA_LIST_TO_STRING(key);
-               return mc_delete(__osrfCache, VA_BUF, strlen(VA_BUF), 0 );
-       }
-       return -1;
-}
-
-
-int osrfCacheSetExpire( time_t seconds, char* key, ... ) {
-       if( key ) {
-               VA_LIST_TO_STRING(key);
-               jsonObject* o = osrfCacheGetObject( VA_BUF );
-               //osrfCacheRemove(VA_BUF);
-               return osrfCachePutObject( VA_BUF, o, seconds );
-       }
-       return -1;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_cache.h b/OpenSRF/src/libstack/osrf_cache.h
deleted file mode 100644 (file)
index d110b47..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-#include "osrf_json.h"
-#include "memcache.h"
-#include "log.h"
-
-/**
-  osrfCache is a globally shared cache API
-  */
-
-
-/**
-  Initialize the cache.
-  @param serverStrings An array of "ip:port" strings to use as cache servers
-  @param size The size of the serverStrings array
-  @param maxCacheSeconds The maximum amount of time an object / string may
-       be cached.  Negative number means there is no limit
-  */
-int osrfCacheInit( char* serverStrings[], int size, time_t maxCacheSeconds );
-
-
-/**
-  Puts an object into the cache
-  @param key The cache key
-  @param obj The object to cache
-  @param seconds The amount of time to cache the data, negative number means
-       to cache up to 'maxCacheSeconds' as set by osrfCacheInit()
-  @return 0 on success, -1 on error
-  */
-int osrfCachePutObject( char* key, const jsonObject* obj, time_t seconds );
-
-/**
-  Puts a string into the cache
-  @param key The cache key
-  @param value The string to cache
-  @param seconds The amount of time to cache the data, negative number means
-       to cache up to 'maxCacheSeconds' as set by osrfCacheInit()
-  @return 0 on success, -1 on error
-  */
-int osrfCachePutString( char* key, const char* value, time_t seconds);
-
-/**
-  Grabs an object from the cache.
-  @param key The cache key
-  @return The object (which must be freed) if it exists, otherwise returns NULL
-  */
-jsonObject* osrfCacheGetObject( char* key, ... );
-
-/**
-  Grabs a string from the cache.
-  @param key The cache key
-  @return The string (which must be freed) if it exists, otherwise returns NULL
-  */
-char* osrfCacheGetString( char* key, ... );
-
-/**
-  Removes the item with the given key from the cache.
-  @return 0 on success, -1 on error.
-  */
-int osrfCacheRemove( char* key, ... );
-
-/**
- * Sets the expire time to 'seconds' for the given key
- */
-int osrfCacheSetExpire( time_t seconds, char* key, ... );
-
-
-
diff --git a/OpenSRF/src/libstack/osrf_hash.c b/OpenSRF/src/libstack/osrf_hash.c
deleted file mode 100644 (file)
index 778c282..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#include "osrf_hash.h"
-
-osrfHash* osrfNewHash() {
-       osrfHash* hash;
-       OSRF_MALLOC(hash, sizeof(osrfHash));
-       hash->hash              = osrfNewList();
-       hash->keys              = osrfNewStringArray(64);
-       return hash;
-}
-
-
-/* algorithm proposed by Donald E. Knuth 
- * in The Art Of Computer Programming Volume 3 (more or less..)*/
-/*
-static unsigned int osrfHashMakeKey(char* str) {
-       if(!str) return 0;
-       unsigned int len = strlen(str);
-       unsigned int h = len;
-       unsigned int i = 0;
-       for(i = 0; i < len; str++, i++)
-               h = ((h << 5) ^ (h >> 27)) ^ (*str);
-       return (h & (OSRF_HASH_LIST_SIZE-1));
-}
-*/
-
-
-/* macro version of the above function */
-#define OSRF_HASH_MAKE_KEY(str,num) \
-   do {\
-      char* __k = str;\
-      unsigned int __len = strlen(__k); \
-      unsigned int __h = __len;\
-      unsigned int __i = 0;\
-      for(__i = 0; __i < __len; __k++, __i++)\
-         __h = ((__h << 5) ^ (__h >> 27)) ^ (*__k);\
-      num = (__h & (OSRF_HASH_LIST_SIZE-1));\
-   } while(0)
-
-
-
-/* returns the index of the item and points l to the sublist the item
- * lives in if the item and points n to the hashnode the item 
- * lives in if the item is found.  Otherwise -1 is returned */
-static unsigned int osrfHashFindItem( osrfHash* hash, char* key, osrfList** l, osrfHashNode** n ) {
-       if(!(hash && key)) return -1;
-
-
-       unsigned int i = 0;
-       OSRF_HASH_MAKE_KEY(key,i);
-
-       osrfList* list = OSRF_LIST_GET_INDEX( hash->hash, i );
-       if( !list ) { return -1; }
-
-       int k;
-       osrfHashNode* node = NULL;
-       for( k = 0; k < list->size; k++ ) {
-               node = OSRF_LIST_GET_INDEX(list, k);
-               if( node && node->key && !strcmp(node->key, key) )
-                       break;
-               node = NULL;
-       }
-
-       if(!node) return -1;
-
-       if(l) *l = list;
-       if(n) *n = node;
-       return k;
-}
-
-osrfHashNode* osrfNewHashNode(char* key, void* item) {
-       if(!(key && item)) return NULL;
-       osrfHashNode* n;
-       OSRF_MALLOC(n, sizeof(osrfHashNode));
-       n->key = strdup(key);
-       n->item = item;
-       return n;
-}
-
-void* osrfHashNodeFree(osrfHash* hash, osrfHashNode* node) {
-       if(!(node && hash)) return NULL;
-       void* item = NULL;
-       if( hash->freeItem )
-               hash->freeItem( node->key, node->item );
-       else item = node->item;
-       free(node->key);
-       free(node);
-       return item;
-}
-
-void* osrfHashSet( osrfHash* hash, void* item, const char* key, ... ) {
-       if(!(hash && item && key )) return NULL;
-
-       VA_LIST_TO_STRING(key);
-       void* olditem = osrfHashRemove( hash, VA_BUF );
-
-       unsigned int bucketkey = 0;
-       OSRF_HASH_MAKE_KEY(VA_BUF,bucketkey);
-       
-       osrfList* bucket;
-       if( !(bucket = OSRF_LIST_GET_INDEX(hash->hash, bucketkey)) ) {
-               bucket = osrfNewList();
-               osrfListSet( hash->hash, bucket, bucketkey );
-       }
-
-       osrfHashNode* node = osrfNewHashNode(VA_BUF, item);
-       osrfListPushFirst( bucket, node );
-
-       if(!osrfStringArrayContains(hash->keys, VA_BUF))
-               osrfStringArrayAdd( hash->keys, VA_BUF );
-
-       hash->size++;
-       return olditem;
-}
-
-void* osrfHashRemove( osrfHash* hash, const char* key, ... ) {
-       if(!(hash && key )) return NULL;
-
-       VA_LIST_TO_STRING(key);
-
-       osrfList* list = NULL;
-       osrfHashNode* node;
-       int index = osrfHashFindItem( hash, (char*) VA_BUF, &list, &node );
-       if( index == -1 ) return NULL;
-
-       osrfListRemove( list, index );
-       hash->size--;
-
-       void* item = osrfHashNodeFree(hash, node);
-       osrfStringArrayRemove(hash->keys, VA_BUF);
-       return item;
-}
-
-
-void* osrfHashGet( osrfHash* hash, const char* key, ... ) {
-       if(!(hash && key )) return NULL;
-       VA_LIST_TO_STRING(key);
-
-       osrfHashNode* node = NULL;
-       int index = osrfHashFindItem( hash, (char*) VA_BUF, NULL, &node );
-       if( index == -1 ) return NULL;
-       return node->item;
-}
-
-
-osrfStringArray* osrfHashKeysInc( osrfHash* hash ) {
-       if(!hash) return NULL;
-       return hash->keys;
-}
-
-osrfStringArray* osrfHashKeys( osrfHash* hash ) {
-       if(!hash) return NULL;
-       
-       int i, k;
-       osrfList* list;
-       osrfHashNode* node;
-       osrfStringArray* strings = osrfNewStringArray(8);
-
-       for( i = 0; i != hash->hash->size; i++ ) {
-               list = OSRF_LIST_GET_INDEX( hash->hash, i );
-               if(list) {
-                       for( k = 0; k != list->size; k++ ) {
-                               node = OSRF_LIST_GET_INDEX( list, k );  
-                               if( node ) osrfStringArrayAdd( strings, node->key );
-                       }
-               }
-       }
-
-       return strings;
-}
-
-
-unsigned long osrfHashGetCount( osrfHash* hash ) {
-       if(!hash) return -1;
-       return hash->size;
-}
-
-void osrfHashFree( osrfHash* hash ) {
-       if(!hash) return;
-
-       int i, j;
-       osrfList* list;
-       osrfHashNode* node;
-
-       for( i = 0; i != hash->hash->size; i++ ) {
-               if( ( list = OSRF_LIST_GET_INDEX( hash->hash, i )) ) {
-                       for( j = 0; j != list->size; j++ ) {
-                               if( (node = OSRF_LIST_GET_INDEX( list, j )) ) {
-                                       OSRF_HASH_NODE_FREE(hash, node);
-                               }
-                       }
-                       osrfListFree(list);
-               }
-       }
-
-       osrfListFree(hash->hash);
-       osrfStringArrayFree(hash->keys);
-       free(hash);
-}
-
-
-
-osrfHashIterator* osrfNewHashIterator( osrfHash* hash ) {
-       if(!hash) return NULL;
-       //osrfHashIterator* itr = safe_malloc(sizeof(osrfHashIterator));
-       osrfHashIterator* itr;
-       OSRF_MALLOC(itr, sizeof(osrfHashIterator));
-       itr->hash = hash;
-       itr->current = NULL;
-       itr->keys = osrfHashKeysInc(hash);
-       return itr;
-}
-
-void* osrfHashIteratorNext( osrfHashIterator* itr ) {
-       if(!(itr && itr->hash)) return NULL;
-       if( itr->currentIdx >= itr->keys->size ) return NULL;
-       free(itr->current);
-       itr->current = strdup(
-                       osrfStringArrayGetString(itr->keys, itr->currentIdx++));
-       char* val = osrfHashGet( itr->hash, itr->current );
-       return val;
-}
-
-void osrfHashIteratorFree( osrfHashIterator* itr ) {
-       if(!itr) return;
-       free(itr->current);
-       //osrfStringArrayFree(itr->keys);
-       free(itr);
-}
-
-void osrfHashIteratorReset( osrfHashIterator* itr ) {
-       if(!itr) return;
-       free(itr->current);
-       //osrfStringArrayFree(itr->keys);
-       itr->keys = osrfHashKeysInc(itr->hash);
-       itr->currentIdx = 0;
-       itr->current = NULL;
-}
-
-
-int osrfHashIteratorHasNext( osrfHashIterator* itr ) {
-       return ( itr->currentIdx < itr->keys->size ) ? 1 : 0;
-}
diff --git a/OpenSRF/src/libstack/osrf_hash.h b/OpenSRF/src/libstack/osrf_hash.h
deleted file mode 100644 (file)
index 02e62c2..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef OSRF_HASH_H
-#define OSRF_HASH_H
-
-#include "opensrf/utils.h"
-#include "opensrf/string_array.h"
-#include "osrf_list.h"
-
-/* 0x100 is a good size for small hashes */
-//#define OSRF_HASH_LIST_SIZE 0x100  /* size of the main hash list */
-#define OSRF_HASH_LIST_SIZE 0x10  /* size of the main hash list */
-
-
-/* used internally */
-#define OSRF_HASH_NODE_FREE(h, n) \
-       if(h && n) { \
-               if(h->freeItem) h->freeItem(n->key, n->item);\
-               free(n->key); free(n); \
-       }
-
-
-struct __osrfHashStruct {
-       osrfList* hash; /* this hash */
-       void (*freeItem) (char* key, void* item);       /* callback for freeing stored items */
-       unsigned int size;
-       osrfStringArray* keys;
-};
-typedef struct __osrfHashStruct osrfHash;
-
-struct _osrfHashNodeStruct {
-       char* key;
-       void* item;
-};
-typedef struct _osrfHashNodeStruct osrfHashNode;
-
-
-struct __osrfHashIteratorStruct {
-       char* current;
-       int currentIdx;
-       osrfHash* hash;
-       osrfStringArray* keys;
-};
-typedef struct __osrfHashIteratorStruct osrfHashIterator;
-
-osrfHashNode* osrfNewHashNode(char* key, void* item);
-void* osrfHashNodeFree(osrfHash*, osrfHashNode*);
-
-/**
-  Allocates a new hash object
-  */
-osrfHash* osrfNewHash();
-
-/**
-  Sets the given key with the given item
-  if "freeItem" is defined and an item already exists at the given location, 
-  then old item is freed and the new item is put into place.
-  if "freeItem" is not defined and an item already exists, the old item
-  is returned.
-  @return The old item if exists and there is no 'freeItem', returns NULL
-  otherwise
-  */
-void* osrfHashSet( osrfHash* hash, void* item, const char* key, ... );
-
-/**
-  Removes an item from the hash.
-  if 'freeItem' is defined it is used and NULL is returned,
-  else the freed item is returned
-  */
-void* osrfHashRemove( osrfHash* hash, const char* key, ... );
-
-void* osrfHashGet( osrfHash* hash, const char* key, ... );
-
-
-/**
-  @return A list of strings representing the keys of the hash. 
-  caller is responsible for freeing the returned string array 
-  with osrfStringArrayFree();
-  */
-osrfStringArray* osrfHashKeys( osrfHash* hash );
-
-osrfStringArray* osrfHashKeysInc( osrfHash* hash );
-
-/**
-  Frees a hash
-  */
-void osrfHashFree( osrfHash* hash );
-
-/**
-  @return The number of items in the hash
-  */
-unsigned long osrfHashGetCount( osrfHash* hash );
-
-
-
-
-/**
-  Creates a new list iterator with the given list
-  */
-osrfHashIterator* osrfNewHashIterator( osrfHash* hash );
-
-int osrfHashIteratorHasNext( osrfHashIterator* itr );
-
-/**
-  Returns the next non-NULL item in the list, return NULL when
-  the end of the list has been reached
-  */
-void* osrfHashIteratorNext( osrfHashIterator* itr );
-
-/**
-  Deallocates the given list
-  */
-void osrfHashIteratorFree( osrfHashIterator* itr );
-
-void osrfHashIteratorReset( osrfHashIterator* itr );
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_json.h b/OpenSRF/src/libstack/osrf_json.h
deleted file mode 100644 (file)
index 2c64b93..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-#include "utils.h"
-#include "osrf_list.h"
-#include "osrf_hash.h"
-
-#ifndef _JSON_H
-#define _JSON_H
-
-
-/* parser states */
-#define JSON_STATE_IN_OBJECT   0x1
-#define JSON_STATE_IN_ARRAY            0x2
-#define JSON_STATE_IN_STRING   0x4
-#define JSON_STATE_IN_UTF              0x8
-#define JSON_STATE_IN_ESCAPE   0x10
-#define JSON_STATE_IN_KEY              0x20
-#define JSON_STATE_IN_NULL             0x40
-#define JSON_STATE_IN_TRUE             0x80
-#define JSON_STATE_IN_FALSE            0x100
-#define JSON_STATE_IN_NUMBER   0x200
-#define JSON_STATE_IS_INVALID  0x400
-#define JSON_STATE_IS_DONE             0x800
-#define JSON_STATE_START_COMMEN        0x1000
-#define JSON_STATE_IN_COMMENT  0x2000
-#define JSON_STATE_END_COMMENT 0x4000
-
-
-/* object and array (container) states are pushed onto a stack so we
- * can keep track of the object nest.  All other states are
- * simply stored in the state field of the parser */
-#define JSON_STATE_SET(ctx,s) ctx->state |= s; /* set a state */
-#define JSON_STATE_REMOVE(ctx,s) ctx->state &= ~s; /* unset a state */
-#define JSON_STATE_CHECK(ctx,s) (ctx->state & s) ? 1 : 0 /* check if a state is set */
-#define JSON_STATE_POP(ctx) osrfListPop( ctx->stateStack ); /* remove a state from the stack */
-#define JSON_STATE_PUSH(ctx, state) osrfListPush( ctx->stateStack,(void*) state );/* push a state on the stack */
-#define JSON_STATE_PEEK(ctx) osrfListGetIndex(ctx->stateStack, ctx->stateStack->size -1) /* check which container type we're currently in */
-#define JSON_STATE_CHECK_STACK(ctx, s) (JSON_STATE_PEEK(ctx) == (void*) s ) ? 1 : 0  /* compare stack values */
-
-/* JSON types */
-#define JSON_HASH      0
-#define JSON_ARRAY     1
-#define JSON_STRING    2
-#define JSON_NUMBER    3
-#define JSON_NULL      4       
-#define JSON_BOOL      5
-
-#define JSON_PARSE_LAST_CHUNK 0x1 /* this is the last part of the string we're parsing */
-
-#define JSON_PARSE_FLAG_CHECK(ctx, f) (ctx->flags & f) ? 1 : 0 /* check if a parser state is set */
-
-#ifndef JSON_CLASS_KEY
-#define JSON_CLASS_KEY "__c"
-#endif
-#ifndef JSON_DATA_KEY
-#define JSON_DATA_KEY "__p"
-#endif
-
-
-struct jsonParserContextStruct {
-       int state;                                              /* what are we currently parsing */
-       char* chunk;                                    /* the chunk we're currently parsing */
-       int index;                                              /* where we are in parsing the current chunk */
-       int chunksize;                                  /* the size of the current chunk */
-       int flags;                                              /* parser flags */
-       osrfList* stateStack;           /* represents the nest of object/array states */
-       growing_buffer* buffer;         /* used to hold JSON strings, number, true, false, and null sequences */
-       growing_buffer* utfbuf;         /* holds the current unicode characters */
-       void* userData;                         /* opaque user pointer.  we ignore this */
-       struct jsonParserHandlerStruct* handler; /* the event handler struct */
-};
-typedef struct jsonParserContextStruct jsonParserContext;
-
-struct jsonParserHandlerStruct {
-       void (*handleStartObject)       (void* userData);
-       void (*handleObjectKey)         (void* userData, char* key);
-       void (*handleEndObject)         (void* userData);
-       void (*handleStartArray)        (void* userData);
-       void (*handleEndArray)          (void* userData);
-       void (*handleNull)                      (void* userData);
-       void (*handleString)                    (void* userData, char* string);
-       void (*handleBool)                      (void* userData, int boolval);
-       void (*handleNumber)                    (void* userData, long double num);
-       void (*handleError)                     (void* userData, char* err, ...);
-};
-typedef struct jsonParserHandlerStruct jsonParserHandler;
-
-struct _jsonObjectStruct {
-       unsigned long size;     /* number of sub-items */
-       char* classname;                /* optional class hint (not part of the JSON spec) */
-       int type;                               /* JSON type */
-       struct _jsonObjectStruct* parent;       /* who we're attached to */
-       union __jsonValue {     /* cargo */
-               osrfHash*       h;              /* object container */
-               osrfList*       l;              /* array container */
-               char*           s;              /* string */
-               int                     b;              /* bool */
-               long double     n;              /* number */
-       } value;
-};
-typedef struct _jsonObjectStruct jsonObject;
-
-struct _jsonObjectIteratorStruct {
-       jsonObject* obj; /* the object we're traversing */
-       osrfHashIterator* hashItr; /* the iterator for this hash */
-       char* key; /* if this object is an object, the current key */
-       unsigned long index; /* if this object is an array, the index */
-};
-typedef struct _jsonObjectIteratorStruct jsonObjectIterator;
-
-
-
-/** 
- * Allocates a new parser context object
- * @param handler The event handler struct
- * @param userData Opaque user pointer which is available in callbacks
- * and ignored by the parser
- * @return An allocated parser context, NULL on error
- */
-jsonParserContext* jsonNewParser( jsonParserHandler* handler, void* userData);
-
-/**
- * Deallocates a parser context
- * @param ctx The context object
- */
-void jsonParserFree( jsonParserContext* ctx );
-
-/**
- * Parse a chunk of data.
- * @param ctx The parser context
- * @param data The data to parse
- * @param datalen The size of the chunk to parser
- * @param flags Reserved
- */
-int jsonParseChunk( jsonParserContext* ctx, char* data, int datalen, int flags );
-
-
-/**
- * Parses a JSON string;
- * @param str The string to parser
- * @return The resulting JSON object or NULL on error
- */
-jsonObject* jsonParseString( char* str );
-jsonObject* jsonParseStringRaw( char* str );
-
-jsonObject* jsonParseStringFmt( char* str, ... );
-
-/**
- * Parses a JSON string;
- * @param str The string to parser
- * @return The resulting JSON object or NULL on error
- */
-jsonObject* jsonParseStringHandleError( void (*errorHandler) (const char*), char* str, ... );
-
-
-
-/**
- * Creates a new json object
- * @param data The string data this object will hold if 
- * this object happens to be a JSON_STRING, NULL otherwise
- * @return The allocated json object.  Must be freed with 
- * jsonObjectFree()
- */
-jsonObject* jsonNewObject(char* data, ...);
-
-/**
- * Creates a new object of the given type
- */
-jsonObject* jsonNewObjectType(int type);
-
-/**
- * Creates a new number object
- */
-jsonObject* jsonNewNumberObject( long double num );
-
-/**
- * Deallocates an object
- */
-void jsonObjectFree( jsonObject* o );
-
-/**
- * Forces the given object to become an array (if it isn't already one) 
- * and pushes the new object into the array
- */
-unsigned long jsonObjectPush(jsonObject* o, jsonObject* newo);
-
-/**
- * Forces the given object to become a hash (if it isn't already one)
- * and assigns the new object to the key of the hash
- */
-unsigned long jsonObjectSetKey(
-               jsonObject* o, const char* key, jsonObject* newo);
-
-
-/**
- * Turns the object into a JSON string.  The string must be freed by the caller */
-char* jsonObjectToJSON( const jsonObject* obj );
-char* jsonObjectToJSONRaw( const jsonObject* obj );
-
-
-/**
- * Retrieves the object at the given key
- */
-jsonObject* jsonObjectGetKey( const jsonObject* obj, const char* key );
-
-
-
-
-
-
-/** Allocates a new iterator 
-       @param obj The object over which to iterate.
-*/
-jsonObjectIterator* jsonNewObjectIterator(const jsonObject* obj);
-
-
-/** 
-       De-allocates an iterator 
-       @param iter The iterator object to free
-*/
-void jsonObjectIteratorFree(jsonObjectIterator* iter);
-
-/** 
-       Returns the object_node currently pointed to by the iterator
-       and increments the pointer to the next node
-       @param iter The iterator in question.
- */
-jsonObject* jsonObjectIteratorNext(jsonObjectIterator* iter);
-
-
-/** 
-       @param iter The iterator.
-       @return True if there is another node after the current node.
- */
-int jsonObjectIteratorHasNext(const jsonObjectIterator* iter);
-
-
-/** 
-       Returns a pointer to the object at the given index.  This call is
-       only valid if the object has a type of JSON_ARRAY.
-       @param obj The object
-       @param index The position within the object
-       @return The object at the given index.
-*/
-jsonObject* jsonObjectGetIndex( const jsonObject* obj, unsigned long index );
-
-
-/* removes (and deallocates) the object at the given index (if one exists) and inserts 
- * the new one.  returns the size on success, -1 on error 
- * If obj is NULL, inserts a new object into the list with is_null set to true
- */
-unsigned long jsonObjectSetIndex(jsonObject* dest, unsigned long index, jsonObject* newObj);
-
-/* removes the object at the given index and, if more items exist,
- * re-indexes (shifts down by 1) the rest of the objects in the array
- */
-unsigned long jsonObjectRemoveIndex(jsonObject* dest, unsigned long index);
-
-/* removes (and deallocates) the object with key 'key' if it exists */
-unsigned long jsonObjectRemoveKey( jsonObject* dest, const char* key);
-
-/* returns a pointer to the string data held by this object if this object
-       is a string.  Otherwise returns NULL*/
-char* jsonObjectGetString(const jsonObject*);
-
-long double jsonObjectGetNumber( const jsonObject* obj );
-
-/* sets the string data */
-void jsonObjectSetString(jsonObject* dest, const char* string);
-
-/* sets the number value for the object */
-void jsonObjectSetNumber(jsonObject* dest, double num);
-
-/* sets the class hint for this object */
-void jsonObjectSetClass(jsonObject* dest, const char* classname );
-
-int jsonBoolIsTrue( jsonObject* boolObj );
-
-
-jsonObject* jsonObjectClone( const jsonObject* o );
-
-
-/* tries to extract the string data from an object.
-       if object       -> NULL (the C NULL)
-       if array                ->      NULL  
-       if null         -> NULL 
-       if bool         -> NULL
-       if string/number the string version of either of those
-       The caller is responsible for freeing the returned string
-       */
-char* jsonObjectToSimpleString( const jsonObject* o );
-
-
-
-/* provides an XPATH style search interface (e.g. /some/node/here) and 
-       return the object at that location if one exists.  Naturally,  
-       every element in the path must be a proper object ("hash" / {}).
-       Returns NULL if the specified node is not found 
-       Note also that the object returned is a clone and
-       must be freed by the caller
-*/
-jsonObject* jsonObjectFindPath( const jsonObject* obj, char* path, ... );
-
-
-/* formats a JSON string from printing.  User must free returned string */
-char* jsonFormatString( const char* jsonString );
-
-/* sets the error handler for all parsers */
-void jsonSetGlobalErrorHandler(void (*errorHandler) (const char*));
-
-jsonObject* jsonParseFile( char* filename );
-
-/* ------------------------------------------------------------------------- */
-/**
- * The following methods provide a ficility for serializing and
- * deserializing "classed" JSON objects.  To give a JSON object a 
- * class, simply call jsonObjectSetClass().  
- * Then, calling jsonObjectEncodeClass() will convert the JSON
- * object (and any sub-objects) to a JSON object with class 
- * wrapper objects like so:
- * { _c : "classname", _d : <json_thing> }
- * In this example _c is the class key and _d is the data (object)
- * key.  The keys are defined by the constants 
- * OSRF_JSON_CLASS_KEY and OSRF_JSON_DATA_KEY
- * To revive a serialized object, simply call
- * jsonObjectDecodeClass()
- */
-
-
-/** Converts a class-wrapped object into an object with the
- * classname set
- * Caller must free the returned object 
- */ 
-jsonObject* jsonObjectDecodeClass( jsonObject* obj );
-
-
-/** Converts an object with a classname into a
- * class-wrapped (serialized) object
- * Caller must free the returned object 
- */ 
-jsonObject* jsonObjectEncodeClass( jsonObject* obj );
-
-/* ------------------------------------------------------------------------- */
-
-
-/**
- *     Generates an XML representation of a JSON object */
-char* jsonObjectToXML(jsonObject*);
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_json_object.c b/OpenSRF/src/libstack/osrf_json_object.c
deleted file mode 100644 (file)
index 71fc181..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "osrf_json.h"
-#include "osrf_json_utils.h"
-jsonObject* jsonNewObject(char* data, ...) {
-
-       jsonObject* o;
-       OSRF_MALLOC(o, sizeof(jsonObject));
-       o->type = JSON_NULL;
-
-       if(data) {
-               VA_LIST_TO_STRING(data);
-               o->type = JSON_STRING;
-               o->value.s = strdup(VA_BUF);
-       }
-
-       return o;
-}
-
-jsonObject* jsonNewNumberObject( long double num ) {
-       jsonObject* o = jsonNewObject(NULL);
-       o->type = JSON_NUMBER;
-       o->value.n = num;
-       return o;
-}
-
-jsonObject* jsonNewObjectType(int type) {
-       jsonObject* o = jsonNewObject(NULL);
-       o->type = type;
-       return o;
-}
-
-void jsonObjectFree( jsonObject* o ) {
-
-       if(!o || o->parent) return;
-       free(o->classname);
-
-       switch(o->type) {
-               case JSON_HASH          : osrfHashFree(o->value.h); break;
-               case JSON_ARRAY : osrfListFree(o->value.l); break;
-               case JSON_STRING        : free(o->value.s); break;
-       }
-       free(o);
-}
-
-static void _jsonFreeHashItem(char* key, void* item){
-       if(!item) return;
-       jsonObject* o = (jsonObject*) item;
-       o->parent = NULL; /* detach the item */
-       jsonObjectFree(o);
-}
-static void _jsonFreeListItem(void* item){
-       if(!item) return;
-       jsonObject* o = (jsonObject*) item;
-       o->parent = NULL; /* detach the item */
-       jsonObjectFree(o);
-}
-
-
-unsigned long jsonObjectPush(jsonObject* o, jsonObject* newo) {
-       if(!(o && newo)) return -1;
-       JSON_INIT_CLEAR(o, JSON_ARRAY);
-       newo->parent = o;
-       osrfListPush( o->value.l, newo );
-       o->size = o->value.l->size;
-       return o->size;
-}
-
-unsigned long jsonObjectSetIndex(jsonObject* dest, unsigned long index, jsonObject* newObj) {
-       if(!(dest && newObj)) return -1;
-       JSON_INIT_CLEAR(dest, JSON_ARRAY);
-       newObj->parent = dest;
-       osrfListSet( dest->value.l, newObj, index );
-       dest->size = dest->value.l->size;
-       return dest->value.l->size;
-}
-
-unsigned long jsonObjectSetKey(
-               jsonObject* o, const char* key, jsonObject* newo) {
-       if(!(o && key && newo)) return -1;
-       JSON_INIT_CLEAR(o, JSON_HASH);
-       newo->parent = o;
-       osrfHashSet( o->value.h, newo, key );
-       o->size = o->value.h->size;
-       return o->size;
-}
-
-jsonObject* jsonObjectGetKey( const jsonObject* obj, const char* key ) {
-       if(!(obj && obj->type == JSON_HASH && obj->value.h && key)) return NULL;
-       return osrfHashGet( obj->value.h, key);
-}
-
-char* jsonObjectToJSON( const jsonObject* obj ) {
-       jsonObject* obj2 = jsonObjectEncodeClass( (jsonObject*) obj);
-       char* json = jsonObjectToJSONRaw(obj2);
-       jsonObjectFree(obj2);
-       return json;
-}
-
-char* jsonObjectToJSONRaw( const jsonObject* obj ) {
-       if(!obj) return NULL;
-       growing_buffer* buf = buffer_init(32);
-
-       switch(obj->type) {
-
-               case JSON_BOOL :
-                       if(obj->value.b) OSRF_BUFFER_ADD(buf, "true"); 
-                       else OSRF_BUFFER_ADD(buf, "false"); 
-                       break;
-
-               case JSON_NUMBER: {
-                       long double x = obj->value.n;
-                       if( x == (long) x ) {
-                               LONG_TO_STRING((long)x);        
-                               OSRF_BUFFER_ADD(buf, LONGSTR);
-
-                       } else {
-                               LONG_DOUBLE_TO_STRING(x);
-                               OSRF_BUFFER_ADD(buf, LONGDOUBLESTR);
-                       }
-                       break;
-               }
-
-               case JSON_NULL:
-                       OSRF_BUFFER_ADD(buf, "null");
-                       break;
-
-               case JSON_STRING:
-                       OSRF_BUFFER_ADD(buf, "\"");
-                       char* data = obj->value.s;
-                       int len = strlen(data);
-                       
-                       char* output = uescape(data, len, 1);
-                       OSRF_BUFFER_ADD(buf, output);
-                       free(output);
-                       OSRF_BUFFER_ADD(buf, "\"");
-                       break;
-                       
-               case JSON_ARRAY: {
-                       OSRF_BUFFER_ADD(buf, "[");
-                       if( obj->value.l ) {
-                               int i;
-                               for( i = 0; i != obj->value.l->size; i++ ) {
-                                       char* json = jsonObjectToJSON(osrfListGetIndex(obj->value.l, i));
-                                       if(i > 0) OSRF_BUFFER_ADD(buf, ",");
-                                       OSRF_BUFFER_ADD(buf, json);
-                                       free(json);
-                               }
-                       } 
-                       OSRF_BUFFER_ADD(buf, "]");
-                       break;
-               }
-
-               case JSON_HASH: {
-
-                       OSRF_BUFFER_ADD(buf, "{");
-                       osrfHashIterator* itr = osrfNewHashIterator(obj->value.h);
-                       jsonObject* item;
-                       int i = 0;
-
-                       while( (item = osrfHashIteratorNext(itr)) ) {
-                               if(i++ > 0) OSRF_BUFFER_ADD(buf, ",");
-                               buffer_fadd(buf, "\"%s\":", itr->current);
-                               char* json = jsonObjectToJSON(item);
-                               OSRF_BUFFER_ADD(buf, json);
-                               free(json);
-                       }
-
-                       osrfHashIteratorFree(itr);
-                       OSRF_BUFFER_ADD(buf, "}");
-                       break;
-               }
-       }
-
-       char* data = buffer_data(buf);
-       buffer_free(buf);
-       return data;
-}
-
-
-jsonObjectIterator* jsonNewObjectIterator(const jsonObject* obj) {
-       if(!obj) return NULL;
-       jsonObjectIterator* itr;
-       OSRF_MALLOC(itr, sizeof(jsonObjectIterator));
-
-       itr->obj                = (jsonObject*) obj;
-       itr->index      = 0;
-       itr->key                = NULL;
-
-       if( obj->type == JSON_HASH )
-               itr->hashItr = osrfNewHashIterator(obj->value.h);
-       
-       return itr;
-}
-
-void jsonObjectIteratorFree(jsonObjectIterator* itr) {
-       if(!itr) return;
-       free(itr->key);
-       osrfHashIteratorFree(itr->hashItr);
-       free(itr);
-}
-
-jsonObject* jsonObjectIteratorNext(jsonObjectIterator* itr) {
-       if(!(itr && itr->obj)) return NULL;
-       if( itr->obj->type == JSON_HASH ) {
-               if(!itr->hashItr) return NULL;
-               jsonObject* item = osrfHashIteratorNext(itr->hashItr);
-               free(itr->key);
-               itr->key = strdup(itr->hashItr->current);
-               return item;
-       } else {
-               return jsonObjectGetIndex( itr->obj, itr->index++ );
-       }
-}
-
-int jsonObjectIteratorHasNext(const jsonObjectIterator* itr) {
-       if(!(itr && itr->obj)) return 0;
-       if( itr->obj->type == JSON_HASH )
-               return osrfHashIteratorHasNext( itr->hashItr );
-       return (itr->index < itr->obj->size) ? 1 : 0;
-}
-
-jsonObject* jsonObjectGetIndex( const jsonObject* obj, unsigned long index ) {
-       if(!obj) return NULL;
-       return (obj->type == JSON_ARRAY) ? 
-               osrfListGetIndex(obj->value.l, index) : NULL;
-}
-
-
-
-unsigned long jsonObjectRemoveIndex(jsonObject* dest, unsigned long index) {
-       if( dest && dest->type == JSON_ARRAY ) {
-               osrfListRemove(dest->value.l, index);
-               return dest->value.l->size;
-       }
-       return -1;
-}
-
-
-unsigned long jsonObjectRemoveKey( jsonObject* dest, const char* key) {
-       if( dest && key && dest->type == JSON_HASH ) {
-               osrfHashRemove(dest->value.h, key);
-               return 1;
-       }
-       return -1;
-}
-
-char* jsonObjectGetString(const jsonObject* obj) {
-       return (obj && obj->type == JSON_STRING) ? obj->value.s : NULL;
-}
-
-long double jsonObjectGetNumber( const jsonObject* obj ) {
-       return (obj && obj->type == JSON_NUMBER) ? obj->value.n : 0;
-}
-
-void jsonObjectSetString(jsonObject* dest, const char* string) {
-       if(!(dest && string)) return;
-       JSON_INIT_CLEAR(dest, JSON_STRING);
-       free(dest->value.s);
-       dest->value.s = strdup(string);
-}
-
-void jsonObjectSetNumber(jsonObject* dest, double num) {
-       if(!dest) return;
-       JSON_INIT_CLEAR(dest, JSON_NUMBER);
-       dest->value.n = num;
-}
-
-void jsonObjectSetClass(jsonObject* dest, const char* classname ) {
-       if(!(dest && classname)) return;
-       free(dest->classname);
-       dest->classname = strdup(classname);
-}
-
-jsonObject* jsonObjectClone( const jsonObject* o ) {
-       if(!o) return NULL;
-       char* json = jsonObjectToJSONRaw(o);
-       jsonObject* oo = jsonParseStringRaw(json);
-       oo->type = o->type;
-       jsonObjectSetClass(oo, o->classname);
-       free(json);
-       return oo;
-}
-
-int jsonBoolIsTrue( jsonObject* boolObj ) {
-    if( boolObj && boolObj->type == JSON_BOOL && boolObj->value.b )
-        return 1;
-    return 0;
-}
-
-
-char* jsonObjectToSimpleString( const jsonObject* o ) {
-       if(!o) return NULL;
-
-       char* value = NULL;
-
-       switch( o->type ) {
-
-               case JSON_NUMBER: {
-
-                       if( o->value.n == (int) o->value.n ) {
-                               LONG_TO_STRING((long) o->value.n);      
-                               value = strdup(LONGSTR);
-
-                       } else {
-                               LONG_DOUBLE_TO_STRING(o->value.n);
-                               value = strdup(LONGDOUBLESTR);
-                       }
-
-                       break;
-               }
-
-               case JSON_STRING:
-                       value = strdup(o->value.s);
-       }
-
-       return value;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_json_parser.c b/OpenSRF/src/libstack/osrf_json_parser.c
deleted file mode 100644 (file)
index 37ab058..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "osrf_json.h"
-#include "osrf_json_utils.h"
-#include <ctype.h>
-
-
-/* if the client sets a global error handler, this will point to it */
-static void (*jsonClientErrorCallback) (const char*) = NULL;
-
-/* these are the handlers for our internal parser */
-static jsonParserHandler jsonInternalParserHandlerStruct = {
-       _jsonHandleStartObject,
-       _jsonHandleObjectKey,
-       _jsonHandleEndObject,
-       _jsonHandleStartArray,
-       _jsonHandleEndArray,
-       _jsonHandleNull,
-       _jsonHandleString,
-       _jsonHandleBool,
-       _jsonHandleNumber,
-       _jsonHandleError
-};
-static jsonParserHandler* 
-       jsonInternalParserHandler = &jsonInternalParserHandlerStruct; 
-
-
-jsonParserContext* jsonNewParser( jsonParserHandler* handler, void* userData) {
-       jsonParserContext* ctx;
-       OSRF_MALLOC(ctx, sizeof(jsonParserContext));
-       ctx->stateStack                 = osrfNewList();
-       ctx->buffer                                     = buffer_init(512);
-       ctx->utfbuf                                     = buffer_init(5);
-       ctx->handler                            = handler;
-       ctx->state                                      = 0;
-       ctx->index                                      = 0;
-       ctx->chunk                                      = NULL;
-       ctx->userData                           = userData;
-       return ctx;
-}
-
-void jsonParserFree( jsonParserContext* ctx ) {
-       if(!ctx) return;
-       buffer_free(ctx->buffer);
-       buffer_free(ctx->utfbuf);
-       osrfListFree(ctx->stateStack);
-       free(ctx);
-}
-
-
-void jsonSetGlobalErrorHandler(void (*errorHandler) (const char*)) {
-       jsonClientErrorCallback = errorHandler;
-}
-
-
-int _jsonParserError( jsonParserContext* ctx, char* err, ... ) {
-       if( ctx->handler->handleError ) {
-               VA_LIST_TO_STRING(err);
-               int pre = ctx->index - 15;
-               int post        = ctx->index + 15;
-               while( pre < 0 ) pre++;
-               while( post >= ctx->chunksize ) post--;
-               int l = post - pre;
-               char buf[l];
-        memset(buf, 0, l);
-               snprintf(buf, l, ctx->chunk + pre);
-               ctx->handler->handleError( ctx->userData, 
-                       "*JSON Parser Error\n - char  = %c\n "
-                       "- index = %d\n - near  => %s\n - %s", 
-                       ctx->chunk[ctx->index], ctx->index, buf, VA_BUF );
-       }
-       JSON_STATE_SET(ctx, JSON_STATE_IS_INVALID);
-       return -1;
-}
-
-
-int _jsonParserHandleUnicode( jsonParserContext* ctx ) {
-
-       /* collect as many of the utf characters as we can in this chunk */
-       JSON_CACHE_DATA(ctx, ctx->utfbuf, 4);
-
-       /* we ran off the end of the chunk */
-       if( ctx->utfbuf->n_used < 4 ) {
-               JSON_STATE_SET(ctx, JSON_STATE_IN_UTF);
-               return 1;
-       }
-
-       ctx->index--; /* push it back to index of the final utf char */
-
-       /* ----------------------------------------------------------------------- */
-       /* We have all of the escaped unicode data.  Write it to the buffer */
-       /* The following chunk is used with permission from 
-        * json-c http://oss.metaparadigm.com/json-c/ 
-        */
-       #define hexdigit(x) ( ((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
-       unsigned char utf_out[4];
-       memset(utf_out,0,4);
-       char* buf = ctx->utfbuf->buf;
-
-       unsigned int ucs_char =
-               (hexdigit(buf[0] ) << 12) +
-               (hexdigit(buf[1]) << 8) +
-               (hexdigit(buf[2]) << 4) +
-               hexdigit(buf[3]);
-
-       if (ucs_char < 0x80) {
-               utf_out[0] = ucs_char;
-               OSRF_BUFFER_ADD(ctx->buffer, (char*)utf_out);
-
-       } else if (ucs_char < 0x800) {
-               utf_out[0] = 0xc0 | (ucs_char >> 6);
-               utf_out[1] = 0x80 | (ucs_char & 0x3f);
-               OSRF_BUFFER_ADD(ctx->buffer, (char*)utf_out);
-
-       } else {
-               utf_out[0] = 0xe0 | (ucs_char >> 12);
-               utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
-               utf_out[2] = 0x80 | (ucs_char & 0x3f);
-               OSRF_BUFFER_ADD(ctx->buffer, (char*)utf_out);
-       }
-       /* ----------------------------------------------------------------------- */
-       /* ----------------------------------------------------------------------- */
-
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_UTF);
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_ESCAPE);
-       buffer_reset(ctx->utfbuf);
-       return 0;
-}
-
-
-
-/* type : 0=null, 1=true, 2=false */
-int _jsonParserHandleMatch( jsonParserContext* ctx, int type ) {
-
-       switch(type) {
-
-               case 0: /* JSON null */
-
-                       /* first see if we have it all first */
-                       if( ctx->chunksize > (ctx->index + 3) ) {
-                               if( strncasecmp(ctx->chunk + ctx->index, "null", 4) ) 
-                                       return _jsonParserError(ctx, "Invalid JSON 'null' sequence");
-                               if( ctx->handler->handleNull ) 
-                                       ctx->handler->handleNull(ctx->userData);
-                               ctx->index += 4;
-                               break;
-                       }
-
-                       JSON_CACHE_DATA(ctx, ctx->buffer, 4);
-                       if( ctx->buffer->n_used < 4 ) {
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_NULL);
-                               return 1;
-                       } 
-
-                       if( strncasecmp(ctx->buffer->buf, "null", 4) ) 
-                               return _jsonParserError(ctx, "Invalid JSON 'null' sequence");
-                       if( ctx->handler->handleNull ) 
-                               ctx->handler->handleNull(ctx->userData);
-                       break;
-
-               case 1: /* JSON true */
-
-                       /* see if we have it all first */
-                       if( ctx->chunksize > (ctx->index + 3) ) {
-                               if( strncasecmp(ctx->chunk + ctx->index, "true", 4) ) 
-                                       return _jsonParserError(ctx, "Invalid JSON 'true' sequence");
-                               if( ctx->handler->handleBool ) 
-                                       ctx->handler->handleBool(ctx->userData, 1);
-                               ctx->index += 4;
-                               break;
-                       }
-
-                       JSON_CACHE_DATA(ctx, ctx->buffer, 4);
-                       if( ctx->buffer->n_used < 4 ) {
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_TRUE);
-                               return 1;
-                       } 
-                       if( strncasecmp( ctx->buffer->buf, "true", 4 ) ) {
-                               return _jsonParserError(ctx, "Invalid JSON 'true' sequence");
-                       }
-                       if( ctx->handler->handleBool ) 
-                               ctx->handler->handleBool(ctx->userData, 1);
-                       break;
-
-               case 2: /* JSON false */
-
-                       /* see if we have it all first */
-                       if( ctx->chunksize > (ctx->index + 4) ) {
-                               if( strncasecmp(ctx->chunk + ctx->index, "false", 5) ) 
-                                       return _jsonParserError(ctx, "Invalid JSON 'false' sequence");
-                               if( ctx->handler->handleBool ) 
-                                       ctx->handler->handleBool(ctx->userData, 0);
-                               ctx->index += 5;
-                               break;
-                       }
-
-                       JSON_CACHE_DATA(ctx, ctx->buffer, 5);
-                       if( ctx->buffer->n_used < 5 ) {
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_FALSE);
-                               return 1;
-                       }
-                       if( strncasecmp( ctx->buffer->buf, "false", 5 ) ) 
-                               return _jsonParserError(ctx, "Invalid JSON 'false' sequence");
-                       if( ctx->handler->handleBool ) 
-                               ctx->handler->handleBool(ctx->userData, 0);
-                       break;
-
-               default: 
-                       fprintf(stderr, "Invalid type flag\n");
-                       return -1;
-
-       }
-
-       ctx->index--; /* set it back to the index of the final sequence character */
-       buffer_reset(ctx->buffer);
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_NULL);
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_TRUE);
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_FALSE);
-
-       return 0;
-}
-
-
-int _jsonParserHandleString( jsonParserContext* ctx ) {
-
-       char c = ctx->chunk[ctx->index];
-
-       if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_ESCAPE) ) {
-
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_UTF) ) {
-
-                       return _jsonParserHandleUnicode( ctx );
-                                               
-               } else {
-
-                       switch(c) {
-
-                               /* handle all of the escape chars */
-                               case '\\': OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\\' ); break;
-                               case '"'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\"' ); break;
-                               case 't'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\t' ); break;
-                               case 'b'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\b' ); break;
-                               case 'f'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\f' ); break;
-                               case 'r'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\r' ); break;
-                               case 'n'        : OSRF_BUFFER_ADD_CHAR( ctx->buffer, '\n' ); break;
-                               case 'u'        : 
-                                       ctx->index++; /* progress to the first utf char */
-                                       return _jsonParserHandleUnicode( ctx );
-                               default : OSRF_BUFFER_ADD_CHAR( ctx->buffer, c );
-                       }
-               }
-
-               JSON_STATE_REMOVE(ctx, JSON_STATE_IN_ESCAPE);
-               return 0;
-
-       } else {
-
-               switch(c) {
-
-                       case '"'        : /* this string is ending */
-                               if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_KEY) ) {
-
-                                       /* object key */
-                                       if(ctx->handler->handleObjectKey) {
-                                               ctx->handler->handleObjectKey( 
-                                                       ctx->userData, ctx->buffer->buf);
-                                       }
-
-                               } else { /* regular json string */
-
-                                       if(ctx->handler->handleString) {
-                                               ctx->handler->handleString( 
-                                                       ctx->userData, ctx->buffer->buf );
-                                       }
-
-                               }
-
-                               buffer_reset(ctx->buffer); /* flush the buffer and states */
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_IN_STRING);
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_IN_KEY);
-                               break;
-
-                       case '\\' : JSON_STATE_SET(ctx, JSON_STATE_IN_ESCAPE); break;
-                       default  : OSRF_BUFFER_ADD_CHAR( ctx->buffer, c );
-               }
-       }
-       return 0;
-}
-
-
-int _jsonParserHandleNumber( jsonParserContext* ctx ) {
-       char c = ctx->chunk[ctx->index];
-
-       do {
-               OSRF_BUFFER_ADD_CHAR(ctx->buffer, c);
-               c = ctx->chunk[++(ctx->index)];
-       } while( strchr(JSON_NUMBER_CHARS, c) && ctx->index < ctx->chunksize );
-
-       /* if we're run off the end of the chunk and we're not parsing the last chunk,
-        * save the number and the state */
-       if( ctx->index >= ctx->chunksize && 
-                       ! JSON_PARSE_FLAG_CHECK(ctx, JSON_PARSE_LAST_CHUNK) ) {
-               JSON_STATE_SET(ctx, JSON_STATE_IN_NUMBER);
-               return 1;
-       }
-
-       /* make me more strict */
-       char* err = NULL;
-       long double d = strtod(ctx->buffer->buf, &err);
-       if(err && err[0] != '\0') 
-               return _jsonParserError(ctx, "Invalid number sequence");
-       JSON_STATE_REMOVE(ctx, JSON_STATE_IN_NUMBER);
-       buffer_reset(ctx->buffer);
-       if(ctx->handler->handleNumber)
-               ctx->handler->handleNumber( ctx->userData, d );
-       ctx->index--; /* scooch back to the first non-digit number */
-       return 0;
-}
-
-
-
-
-int jsonParseChunk( jsonParserContext* ctx, char* data, int datalen, int flags ) {
-
-       if( !( ctx && ctx->handler && data && datalen > 0 )) return -1;
-       ctx->chunksize  = datalen;
-       ctx->chunk              = data;
-       ctx->flags              = flags;
-       char c;
-
-       if( JSON_STATE_CHECK(ctx, JSON_STATE_IS_INVALID) )
-               return _jsonParserError( ctx, "JSON Parser cannot continue after an error" );
-
-       if( JSON_STATE_CHECK(ctx, JSON_STATE_IS_DONE) )
-               return _jsonParserError( ctx, "Extra content at end of JSON data" );
-
-       for( ctx->index = 0; (ctx->index < ctx->chunksize) && 
-                               (c = ctx->chunk[ctx->index]); ctx->index++ ) {
-
-               /* middle of parsing a string */
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_STRING)) {
-                       if( _jsonParserHandleString(ctx) == -1 )
-                               return -1;
-                       continue;
-               }
-
-               /* middle of parsing a number */
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_NUMBER) ) {
-                       if( _jsonParserHandleNumber(ctx) == -1 )
-                               return -1;
-                       continue;
-               }
-
-
-#ifdef JSON_IGNORE_COMMENTS
-               /* we just saw a bare '/' character */
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_START_COMMENT) ) {
-                       if(c == '*') {
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_START_COMMENT);
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_COMMENT);
-                               continue;
-                       } else {
-                               return _jsonParserError( ctx, "Invalid comment initializer" );
-                       }
-               }
-
-               /* we're currently in the middle of a comment block */
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_IN_COMMENT) ) {
-                       if(c == '*') {
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_IN_COMMENT);
-                               JSON_STATE_SET(ctx, JSON_STATE_END_COMMENT);
-                               continue;
-                       } else {
-                               continue;
-                       }
-               }
-
-               /* we're in a comment, and we just saw a '*' character */
-               if( JSON_STATE_CHECK(ctx, JSON_STATE_END_COMMENT) ) {
-                       if( c == '/' ) { /* comment is finished */
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_END_COMMENT);
-                               continue;
-                       } else {
-                               /* looks like this isn't the end of the comment after all */
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_COMMENT);
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_END_COMMENT);
-                       }
-               }
-#endif
-
-               /* if we're in the middle of parsing a null/true/false sequence */
-               if( JSON_STATE_CHECK(ctx, (JSON_STATE_IN_NULL | 
-                                       JSON_STATE_IN_TRUE | JSON_STATE_IN_FALSE)) ) {
-
-                       int type = (JSON_STATE_CHECK(ctx, JSON_STATE_IN_NULL)) ? 0 :
-                               (JSON_STATE_CHECK(ctx, JSON_STATE_IN_TRUE)) ? 1 : 2;
-
-                       if( _jsonParserHandleMatch( ctx, type ) == -1 ) 
-                               return -1;
-                       continue;
-               }
-
-               JSON_EAT_WS(ctx);
-
-               /* handle all of the top level characters */
-               switch(c) {
-
-                       case '{' : /* starting an object */
-                               if( ctx->handler->handleStartObject) 
-                                       ctx->handler->handleStartObject( ctx->userData );
-                               JSON_STATE_PUSH(ctx, JSON_STATE_IN_OBJECT);
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_KEY);
-                               break;
-
-                       case '}' : /* ending an object */
-                               if( ctx->handler->handleEndObject) 
-                                       ctx->handler->handleEndObject( ctx->userData ); 
-                               JSON_STATE_POP(ctx);
-                               if( JSON_STATE_PEEK(ctx) == NULL )
-                                       JSON_STATE_SET(ctx, JSON_STATE_IS_DONE);
-                               break;
-
-                       case '[' : /* starting an array */
-                               if( ctx->handler->handleStartArray )
-                                       ctx->handler->handleStartArray( ctx->userData );
-                               JSON_STATE_PUSH(ctx, JSON_STATE_IN_ARRAY);
-                               break;
-
-                       case ']': /* ending an array */
-                               if( ctx->handler->handleEndArray )
-                                       ctx->handler->handleEndArray( ctx->userData );
-                               JSON_STATE_POP(ctx);
-                               if( JSON_STATE_PEEK(ctx) == NULL )
-                                       JSON_STATE_SET(ctx, JSON_STATE_IS_DONE);
-                               break;
-                               
-                       case ':' : /* done with the object key */
-                               JSON_STATE_REMOVE(ctx, JSON_STATE_IN_KEY);
-                               break;
-
-                       case ',' : /* after object or array item */
-                               if( JSON_STATE_CHECK_STACK(ctx, JSON_STATE_IN_OBJECT) )
-                                       JSON_STATE_SET(ctx, JSON_STATE_IN_KEY);
-                               break;
-
-                       case 'n' :
-                       case 'N' : /* null */
-                               if( _jsonParserHandleMatch( ctx, 0 ) == -1)
-                                       return -1;
-                               break;
-
-                       case 't' :
-                       case 'T' :
-                               if( _jsonParserHandleMatch( ctx, 1 ) == -1 )
-                                       return -1;
-                               break;
-
-                       case 'f' :
-                       case 'F' :
-                               if( _jsonParserHandleMatch( ctx, 2 ) == -1)
-                                       return -1;
-                               break;
-
-                       case '"' : 
-                               JSON_STATE_SET(ctx, JSON_STATE_IN_STRING);
-                               break;
-
-#ifdef JSON_IGNORE_COMMENTS
-                       case '/' :
-                               JSON_STATE_SET(ctx, JSON_STATE_START_COMMENT);
-                               break;
-#endif
-
-                       default:
-                               if( strchr(JSON_NUMBER_CHARS, c) ) {
-                                       if( _jsonParserHandleNumber( ctx ) == -1 )
-                                               return -1;
-                               } else {
-                                       return _jsonParserError( ctx, "Invalid Token" );
-                               }
-               }
-       }
-
-       return 0;
-}
-
-
-jsonInternalParser* _jsonNewInternalParser() {
-       jsonInternalParser* p;
-       OSRF_MALLOC(p, sizeof(jsonInternalParser));
-       p->ctx = jsonNewParser( jsonInternalParserHandler, p );
-       p->obj          = NULL;
-       p->lastkey      = NULL;
-       return p;
-}
-
-void _jsonInternalParserFree(jsonInternalParser* p) {
-       if(!p) return;
-       jsonParserFree(p->ctx);
-       free(p->lastkey);
-       free(p);
-}
-
-static jsonObject* _jsonParseStringImpl(char* str, void (*errorHandler) (const char*) ) {
-       jsonInternalParser* parser = _jsonNewInternalParser();
-       parser->handleError = errorHandler;
-       jsonParseChunk( parser->ctx, str, strlen(str),  JSON_PARSE_LAST_CHUNK );
-       jsonObject* obj = parser->obj;
-       _jsonInternalParserFree(parser);
-       return obj;
-}
-
-jsonObject* jsonParseStringHandleError( 
-               void (*errorHandler) (const char*), char* str, ... ) {
-       if(!str) return NULL;
-       VA_LIST_TO_STRING(str);
-       return _jsonParseStringImpl(VA_BUF, errorHandler);
-}
-
-jsonObject* jsonParseString( char* str ) {
-       if(!str) return NULL;
-       jsonObject* obj =  _jsonParseStringImpl(str, NULL);
-       jsonObject* obj2 = jsonObjectDecodeClass(obj);
-       jsonObjectFree(obj);
-       return obj2;
-}
-
-jsonObject* jsonParseStringRaw( char* str ) {
-       if(!str) return NULL;
-       return _jsonParseStringImpl(str, NULL);
-}
-
-jsonObject* jsonParseStringFmt( char* str, ... ) {
-       if(!str) return NULL;
-       VA_LIST_TO_STRING(str);
-       return _jsonParseStringImpl(VA_BUF, NULL);
-}
-
-
-#define JSON_SHOVE_ITEM(ctx,type)  \
-       jsonInternalParser* p = (jsonInternalParser*) ctx;\
-       _jsonInsertParserItem(p, jsonNewObjectType(type));
-
-void _jsonHandleStartObject(void* ctx) { JSON_SHOVE_ITEM(ctx, JSON_HASH); }
-void _jsonHandleStartArray(void* ctx) { JSON_SHOVE_ITEM(ctx, JSON_ARRAY); }
-void _jsonHandleNull(void* ctx) { JSON_SHOVE_ITEM(ctx, JSON_NULL); }
-
-void _jsonHandleObjectKey(void* ctx, char* key) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       free(p->lastkey);
-       p->lastkey = strdup(key);
-}
-
-void _jsonHandleEndObject(void* ctx) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       p->current = p->current->parent;
-}
-
-void _jsonHandleEndArray(void* ctx) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       p->current = p->current->parent;
-}
-
-void _jsonHandleString(void* ctx, char* string) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       _jsonInsertParserItem(p, jsonNewObject(string));
-}
-
-void _jsonHandleBool(void* ctx, int boolval) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       jsonObject* obj = jsonNewObjectType(JSON_BOOL);
-       obj->value.b = boolval;
-       _jsonInsertParserItem(p, obj);
-}
-
-void _jsonHandleNumber(void* ctx, long double num) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       _jsonInsertParserItem(p, jsonNewNumberObject(num));
-}
-
-void _jsonHandleError(void* ctx, char* str, ...) {
-       jsonInternalParser* p = (jsonInternalParser*) ctx;
-       VA_LIST_TO_STRING(str);
-
-       if( p->handleError ) 
-               p->handleError(VA_BUF);
-       else 
-               if( jsonClientErrorCallback ) 
-                       jsonClientErrorCallback(VA_BUF);
-
-       else fprintf(stderr, "%s\n", VA_BUF);
-       jsonObjectFree(p->obj);
-       p->obj = NULL;
-}
-
-
-void _jsonInsertParserItem( jsonInternalParser* p, jsonObject* newo ) {
-
-       if( !p->obj ) {
-
-               /* new parser, set the new object to our object */
-               p->obj = p->current = newo;
-
-       } else {
-
-               /* insert the new object into the current container object */
-               switch(p->current->type) { 
-                       case JSON_HASH  : jsonObjectSetKey(p->current, p->lastkey, newo);  break;
-                       case JSON_ARRAY: jsonObjectPush(p->current, newo); break;
-                       default: fprintf(stderr, "%s:%d -> how?\n", JSON_LOG_MARK); 
-               } 
-
-               /* if the new object is a container object, make it our current container */
-               if( newo->type == JSON_ARRAY || newo->type == JSON_HASH )
-                       p->current = newo;      
-       }
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_json_tools.c b/OpenSRF/src/libstack/osrf_json_tools.c
deleted file mode 100644 (file)
index 6144e8c..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "osrf_json.h"
-
-jsonObject* _jsonObjectEncodeClass( jsonObject* obj, int ignoreClass );
-
-
-jsonObject* jsonObjectFindPath( const jsonObject* obj, char* path, ...);
-jsonObject* _jsonObjectFindPathRecurse(const jsonObject* obj, char* root, char* path);
-jsonObject* __jsonObjectFindPathRecurse(const jsonObject* obj, char* root);
-
-
-static char* __tabs(int count) {
-       growing_buffer* buf = buffer_init(24);
-       int i;
-       for(i=0;i<count;i++) OSRF_BUFFER_ADD(buf, "  ");
-       char* final = buffer_data( buf );
-       buffer_free( buf );
-       return final;
-}
-
-char* jsonFormatString( const char* string ) {
-       if(!string) return strdup("");
-
-       growing_buffer* buf = buffer_init(64);
-       int i;
-       int depth = 0;
-       char* tab = NULL;
-
-       char c;
-       for(i=0; i!= strlen(string); i++) {
-               c = string[i];
-
-               if( c == '{' || c == '[' ) {
-
-                       tab = __tabs(++depth);
-                       buffer_fadd( buf, "%c\n%s", c, tab);
-                       free(tab);
-
-               } else if( c == '}' || c == ']' ) {
-
-                       tab = __tabs(--depth);
-                       buffer_fadd( buf, "\n%s%c", tab, c);
-                       free(tab);
-
-                       if(string[i+1] != ',') {
-                               tab = __tabs(depth);
-                               buffer_fadd( buf, "%s", tab );  
-                               free(tab);
-                       }
-
-               } else if( c == ',' ) {
-
-                       tab = __tabs(depth);
-                       buffer_fadd(buf, ",\n%s", tab);
-                       free(tab);
-
-               } else { buffer_add_char(buf, c); }
-
-       }
-
-       char* result = buffer_data(buf);
-       buffer_free(buf);
-       return result;
-}
-
-
-
-jsonObject* jsonObjectDecodeClass( jsonObject* obj ) {
-       if(!obj) return jsonNewObject(NULL);
-
-       jsonObject* newObj              = NULL; 
-       jsonObject* classObj            = NULL; 
-       jsonObject* payloadObj  = NULL;
-       int i;
-
-       if( obj->type == JSON_HASH ) {
-
-               /* are we a special class object? */
-               if( (classObj = jsonObjectGetKey( obj, JSON_CLASS_KEY )) ) {
-
-                       /* do we have a payload */
-                       if( (payloadObj = jsonObjectGetKey( obj, JSON_DATA_KEY )) ) {
-                               newObj = jsonObjectDecodeClass( payloadObj ); 
-                               jsonObjectSetClass( newObj, jsonObjectGetString(classObj) );
-
-                       } else { /* class is defined but there is no payload */
-                               return NULL;
-                       }
-
-               } else { /* we're a regular hash */
-
-                       jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-                       jsonObject* tmp;
-                       newObj = jsonNewObjectType(JSON_HASH);
-                       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-                               jsonObject* o = jsonObjectDecodeClass(tmp);
-                               jsonObjectSetKey( newObj, itr->key, o );
-                       }
-                       jsonObjectIteratorFree(itr);
-               }
-
-       } else {
-
-               if( obj->type == JSON_ARRAY ) { /* we're an array */
-                       newObj = jsonNewObjectType(JSON_ARRAY);
-                       for( i = 0; i != obj->size; i++ ) {
-                               jsonObject* tmp = jsonObjectDecodeClass(jsonObjectGetIndex( obj, i ) );
-                               jsonObjectSetIndex( newObj, i, tmp );
-                       }
-
-               } else { /* not an aggregate type */
-                       newObj = jsonObjectClone(obj);
-               }
-       }
-               
-       return newObj;
-}
-
-jsonObject* jsonObjectEncodeClass( jsonObject* obj ) {
-       return _jsonObjectEncodeClass( obj, 0 );
-}
-
-jsonObject* _jsonObjectEncodeClass( jsonObject* obj, int ignoreClass ) {
-
-       //if(!obj) return NULL;
-       if(!obj) return jsonNewObject(NULL);
-       jsonObject* newObj = NULL;
-
-       if( obj->classname && ! ignoreClass ) {
-               newObj = jsonNewObjectType(JSON_HASH);
-
-               jsonObjectSetKey( newObj, 
-                       JSON_CLASS_KEY, jsonNewObject(obj->classname) ); 
-
-               jsonObjectSetKey( newObj, 
-                       JSON_DATA_KEY, _jsonObjectEncodeClass(obj, 1));
-
-       } else if( obj->type == JSON_HASH ) {
-
-               jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-               jsonObject* tmp;
-               newObj = jsonNewObjectType(JSON_HASH);
-
-               while( (tmp = jsonObjectIteratorNext(itr)) ) {
-                       jsonObjectSetKey( newObj, itr->key, 
-                                       _jsonObjectEncodeClass(tmp, 0));
-               }
-               jsonObjectIteratorFree(itr);
-
-       } else if( obj->type == JSON_ARRAY ) {
-
-               newObj = jsonNewObjectType(JSON_ARRAY);
-               int i;
-               for( i = 0; i != obj->size; i++ ) {
-                       jsonObjectSetIndex( newObj, i, 
-                               _jsonObjectEncodeClass(jsonObjectGetIndex( obj, i ), 0 ));
-               }
-
-       } else {
-               newObj = jsonObjectClone(obj);
-       }
-
-       return newObj;
-}
-
-
-
-
-static char* _escape_xml (char*);
-static int _recurse_jsonObjectToXML(jsonObject*, growing_buffer*);
-
-char* jsonObjectToXML(jsonObject* obj) {
-
-       growing_buffer * res_xml;
-       char * output;
-
-       res_xml = buffer_init(1024);
-
-       if (!obj)
-               return strdup("<null/>");
-       
-       _recurse_jsonObjectToXML( obj, res_xml );
-       output = buffer_data(res_xml);
-       
-       buffer_free(res_xml);
-
-       return output;
-
-}
-
-int _recurse_jsonObjectToXML(jsonObject* obj, growing_buffer* res_xml) {
-
-       char * hint = NULL;
-       char * bool_val = NULL;
-       int i = 0;
-       
-       if (obj->classname)
-               hint = strdup(obj->classname);
-
-       if(obj->type == JSON_NULL) {
-
-               if (hint)
-                       buffer_fadd(res_xml, "<null class_hint=\"%s\"/>",hint);
-               else
-                       buffer_add(res_xml, "<null/>");
-
-       } else if(obj->type == JSON_BOOL) {
-
-               if (obj->value.b)
-                       bool_val = strdup("true");
-               else
-                       bool_val = strdup("false");
-
-               if (hint)
-                       buffer_fadd(res_xml, "<boolean value=\"%s\" class_hint=\"%s\"/>", bool_val, hint);
-               else
-                       buffer_fadd(res_xml, "<boolean value=\"%s\"/>", bool_val);
-
-               free(bool_val);
-                
-       } else if (obj->type == JSON_STRING) {
-               if (hint) {
-                       char * t = _escape_xml(jsonObjectGetString(obj));
-                       buffer_fadd(res_xml,"<string class_hint=\"%s\">%s</string>", hint, t);
-                       free(t);
-               } else {
-                       char * t = _escape_xml(jsonObjectGetString(obj));
-                       buffer_fadd(res_xml,"<string>%s</string>", t);
-                       free(t);
-               }
-
-       } else if(obj->type == JSON_NUMBER) {
-               double x = jsonObjectGetNumber(obj);
-               if (hint) {
-                       if (x == (int)x)
-                               buffer_fadd(res_xml,"<number class_hint=\"%s\">%d</number>", hint, (int)x);
-                       else
-                               buffer_fadd(res_xml,"<number class_hint=\"%s\">%lf</number>", hint, x);
-               } else {
-                       if (x == (int)x)
-                               buffer_fadd(res_xml,"<number>%d</number>", (int)x);
-                       else
-                               buffer_fadd(res_xml,"<number>%lf</number>", x);
-               }
-
-       } else if (obj->type == JSON_ARRAY) {
-
-               if (hint) 
-                       buffer_fadd(res_xml,"<array class_hint=\"%s\">", hint);
-               else
-                               buffer_add(res_xml,"<array>");
-
-               for ( i = 0; i!= obj->size; i++ )
-                       _recurse_jsonObjectToXML(jsonObjectGetIndex(obj,i), res_xml);
-
-               buffer_add(res_xml,"</array>");
-
-       } else if (obj->type == JSON_HASH) {
-
-               if (hint)
-                       buffer_fadd(res_xml,"<object class_hint=\"%s\">", hint);
-               else
-                       buffer_add(res_xml,"<object>");
-
-               jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-               jsonObject* tmp;
-               while( (tmp = jsonObjectIteratorNext(itr)) ) {
-                       buffer_fadd(res_xml,"<element key=\"%s\">",itr->key);
-                       _recurse_jsonObjectToXML(tmp, res_xml);
-                       buffer_add(res_xml,"</element>");
-               }
-               jsonObjectIteratorFree(itr);
-
-               buffer_add(res_xml,"</object>");
-       }
-
-       if (hint)
-               free(hint);
-
-       return 1;
-}
-
-char* _escape_xml (char* text) {
-       char* out;
-       growing_buffer* b = buffer_init(256);
-       int len = strlen(text);
-       int i;
-       for (i = 0; i < len; i++) {
-               if (text[i] == '&')
-                       buffer_add(b,"&amp;");
-               else if (text[i] == '<')
-                       buffer_add(b,"&lt;");
-               else if (text[i] == '>')
-                       buffer_add(b,"&gt;");
-               else
-                       buffer_add_char(b,text[i]);
-       }
-       out = buffer_data(b);
-       buffer_free(b);
-       return out;
-}
-
-
-jsonObject* jsonParseFile( char* filename ) {
-       if(!filename) return NULL;
-       char* data = file_to_string(filename);
-       jsonObject* o = jsonParseString(data);
-       free(data);
-       return o;
-}
-
-
-
-jsonObject* jsonObjectFindPath( const jsonObject* obj, char* format, ...) {
-       if(!obj || !format || strlen(format) < 1) return NULL;  
-
-       VA_LIST_TO_STRING(format);
-       char* buf = VA_BUF;
-       char* token = NULL;
-       char* t = buf;
-       char* tt; /* strtok storage */
-
-       /* copy the path before strtok_r destroys it */
-       char* pathcopy = strdup(buf);
-
-       /* grab the root of the path */
-       token = strtok_r(t, "/", &tt);
-       if(!token) return NULL;
-
-       /* special case where path starts with //  (start anywhere) */
-       if(strlen(pathcopy) > 2 && pathcopy[0] == '/' && pathcopy[1] == '/') {
-               jsonObject* it = _jsonObjectFindPathRecurse(obj, token, pathcopy + 1);
-               free(pathcopy);
-               return it;
-       }
-
-       free(pathcopy);
-
-       t = NULL;
-       do { 
-               obj = jsonObjectGetKey(obj, token);
-       } while( (token = strtok_r(NULL, "/", &tt)) && obj);
-
-       return jsonObjectClone(obj);
-}
-
-/* --------------------------------------------------------------- */
-
-
-
-jsonObject* _jsonObjectFindPathRecurse(const jsonObject* obj, char* root, char* path) {
-
-       if(!obj || ! root || !path) return NULL;
-
-       /* collect all of the potential objects */
-       jsonObject* arr = __jsonObjectFindPathRecurse(obj, root);
-
-       /* container for fully matching objects */
-       jsonObject* newarr = jsonParseString("[]");
-       int i;
-
-       /* path is just /root or /root/ */
-       if( strlen(root) + 2 >= strlen(path) ) {
-               return arr;
-
-       } else {
-
-               /* gather all of the sub-objects that match the full path */
-               for( i = 0; i < arr->size; i++ ) {
-                       jsonObject* a = jsonObjectGetIndex(arr, i);
-                       jsonObject* thing = jsonObjectFindPath(a , path + strlen(root) + 1); 
-
-                       if(thing) { //jsonObjectPush(newarr, thing);
-               if(thing->type == JSON_ARRAY) {
-               int i;
-                                       for( i = 0; i != thing->size; i++ )
-                                               jsonObjectPush(newarr, jsonObjectClone(jsonObjectGetIndex(thing,i)));
-                                       jsonObjectFree(thing);
-
-                               } else {
-                                       jsonObjectPush(newarr, thing);
-                               }                                               
-                       }
-               }
-       }
-       
-       jsonObjectFree(arr);
-       return newarr;
-}
-
-jsonObject* __jsonObjectFindPathRecurse(const jsonObject* obj, char* root) {
-
-       jsonObject* arr = jsonParseString("[]");
-       if(!obj) return arr;
-
-       int i;
-
-       /* if the current object has a node that matches, add it */
-
-       jsonObject* o = jsonObjectGetKey(obj, root);
-       if(o) jsonObjectPush( arr, jsonObjectClone(o) );
-
-       jsonObject* tmp = NULL;
-       jsonObject* childarr;
-       jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-
-       /* recurse through the children and find all potential nodes */
-       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-               childarr = __jsonObjectFindPathRecurse(tmp, root);
-               if(childarr && childarr->size > 0) {
-                       for( i = 0; i!= childarr->size; i++ ) {
-                               jsonObjectPush( arr, jsonObjectClone(jsonObjectGetIndex(childarr, i)) );
-                       }
-               }
-               jsonObjectFree(childarr);
-       }
-
-       jsonObjectIteratorFree(itr);
-
-       return arr;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_json_utils.h b/OpenSRF/src/libstack/osrf_json_utils.h
deleted file mode 100644 (file)
index 76af666..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-Copyright (C) 2006  Georgia Public Library Service 
-Bill Erickson <billserickson@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-/* ----------------------------------------------------------------------- */
-/* Clients need not include this file.  These are internal utilities only      */
-/* ----------------------------------------------------------------------- */
-
-#define JSON_EAT_WS(ctx)       \
-       while( ctx->index < ctx->chunksize ) {  \
-               if(!isspace(ctx->chunk[ctx->index])) break; \
-               ctx->index++;   \
-       } \
-       if( ctx->index >= ctx->chunksize ) return 0; \
-       c = ctx->chunk[ctx->index];
-
-#define JSON_CACHE_DATA(ctx, buf, size) \
-       while( (buf->n_used < size) && (ctx->index < ctx->chunksize) ) \
-               buffer_add_char(buf, ctx->chunk[ctx->index++]); 
-
-#define JSON_LOG_MARK __FILE__,__LINE__
-
-#define JSON_NUMBER_CHARS "0123456789.+-e"
-
-
-/* cleans up an object if it is morphing another object, also
- * verifies that the appropriate storage container exists where appropriate */
-#define JSON_INIT_CLEAR(_obj_, newtype)                \
-       if( _obj_->type == JSON_HASH && newtype != JSON_HASH ) {                        \
-               osrfHashFree(_obj_->value.h);                   \
-               _obj_->value.h = NULL;                                  \
-       } else if( _obj_->type == JSON_ARRAY && newtype != JSON_ARRAY ) {       \
-               osrfListFree(_obj_->value.l);                   \
-               _obj_->value.l = NULL;                                  \
-       } else if( _obj_->type == JSON_STRING && newtype != JSON_STRING ) { \
-               free(_obj_->value.s);                                           \
-               _obj_->value.s = NULL;                                  \
-       } \
-       _obj_->type = newtype;\
-       if( newtype == JSON_HASH && _obj_->value.h == NULL ) {  \
-               _obj_->value.h = osrfNewHash();         \
-               _obj_->value.h->freeItem = _jsonFreeHashItem; \
-       } else if( newtype == JSON_ARRAY && _obj_->value.l == NULL ) {  \
-               _obj_->value.l = osrfNewList();         \
-               _obj_->value.l->freeItem = _jsonFreeListItem;\
-       }                                                                                               \
-
-
-/** 
- * These are the callbacks through which the top level parser 
- * builds objects via the push parser
- */
-void _jsonHandleStartObject(void*);
-void _jsonHandleObjectKey(void*, char* key);
-void _jsonHandleEndObject(void*);
-void _jsonHandleStartArray(void*);
-void _jsonHandleEndArray(void*);
-void _jsonHandleNull(void*);
-void _jsonHandleString(void*, char* string);
-void _jsonHandleBool(void*, int boolval);
-void _jsonHandleNumber(void*, long double num);
-void _jsonHandleError(void*, char* str, ...);
-
-struct jsonInternalParserStruct {
-       jsonParserContext* ctx;
-       jsonObject* obj;
-       jsonObject* current;
-       char* lastkey;
-       void (*handleError) (const char*);
-};
-typedef struct jsonInternalParserStruct jsonInternalParser;
-
-jsonInternalParser* _jsonNewInternalParser();
-void _jsonInternalParserFree(jsonInternalParser* p);
-
-/**
- * Calls the defined error handler with the given error message.
- * @return -1
- */
-int _jsonParserError( jsonParserContext* ctx, char* err, ... );
-
-
-/**
- *
- * @return 0 on continue, 1 if it goes past the end of the string, -1 on error
- */
-int _jsonParserHandleUnicode( jsonParserContext* ctx );
-
-
-/**
- * @param type 0 for null, 1 for true, 2 for false
- * @return 0 on continue, 1 if it goes past the end of the string, -1 on error
- */
-int _jsonParserHandleMatch( jsonParserContext* ctx, int type );
-
-/**
- * @return 0 on continue, 1 on end of chunk, -1 on error 
- */
-int _jsonParserHandleString( jsonParserContext* ctx );
-
-/**
- * @return 0 on continue, 1 on end of chunk, -1 on error 
- */
-int _jsonParserHandleNumber( jsonParserContext* ctx );
-
-
-void _jsonInsertParserItem( jsonInternalParser* p, jsonObject* newo );
-
-
-/* Utility method. finds any object in the tree that matches the path.  
-       Use this for finding paths that start with '//' */
-jsonObject* _jsonObjectFindPathRecurse( const jsonObject* o, char* root, char* path );
-
-
-/* returns a list of object whose key is 'root'.  These are used as
-       potential objects when doing a // search */
-jsonObject* __jsonObjectFindPathRecurse( const jsonObject* o, char* root );
-
-
diff --git a/OpenSRF/src/libstack/osrf_list.c b/OpenSRF/src/libstack/osrf_list.c
deleted file mode 100644 (file)
index 0e58f0f..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-#include "osrf_list.h"
-
-osrfList* osrfNewList() {
-       osrfList* list;
-       OSRF_MALLOC(list, sizeof(osrfList));
-       list->arrsize   = OSRF_LIST_DEFAULT_SIZE;
-       OSRF_MALLOC(list->arrlist, list->arrsize * sizeof(void*));
-       return list;
-}
-
-osrfList* osrfNewListSize( unsigned int size ) {
-       osrfList* list;
-       OSRF_MALLOC(list, sizeof(osrfList));
-    if( size <= 0 ) size = 16;
-       list->arrsize   = size;
-       OSRF_MALLOC( list->arrlist, list->arrsize * sizeof(void*) );
-       return list;
-}
-
-
-int osrfListPush( osrfList* list, void* item ) {
-       if(!(list)) return -1;
-       osrfListSet( list, item, list->size );
-       return 0;
-}
-
-int osrfListPushFirst( osrfList* list, void* item ) {
-       if(!(list && item)) return -1;
-       int i;
-       for( i = 0; i < list->size; i++ ) 
-               if(!list->arrlist[i]) break;
-       osrfListSet( list, item, i );
-       return list->size;
-}
-
-void* osrfListSet( osrfList* list, void* item, unsigned int position ) {
-       if(!list || position < 0) return NULL;
-
-       int i;
-       int newsize = list->arrsize;
-       void** newarr;
-
-       while( position >= newsize ) 
-               newsize += OSRF_LIST_INC_SIZE;
-
-       if( newsize > list->arrsize ) { /* expand the list if necessary */
-               OSRF_MALLOC(newarr, newsize * sizeof(void*));
-               for( i = 0; i < list->arrsize; i++ ) 
-                       newarr[i] = list->arrlist[i];
-               free(list->arrlist);
-               list->arrlist = newarr;
-               list->arrsize = newsize;
-       }
-
-       void* olditem = osrfListRemove( list, position );
-       list->arrlist[position] = item;
-       if( list->size <= position ) list->size = position + 1;
-       return olditem;
-}
-
-
-void* osrfListGetIndex( const osrfList* list, unsigned int position ) {
-       if(!list || position >= list->size || position < 0) return NULL;
-       return list->arrlist[position];
-}
-
-void osrfListFree( osrfList* list ) {
-       if(!list) return;
-
-       if( list->freeItem ) {
-               int i; void* val;
-               for( i = 0; i < list->size; i++ ) {
-                       if( (val = list->arrlist[i]) ) 
-                               list->freeItem(val);
-               }
-       }
-
-       free(list->arrlist);
-       free(list);
-}
-
-void* osrfListRemove( osrfList* list, unsigned int position ) {
-       if(!list || position >= list->size || position < 0) return NULL;
-
-       void* olditem = list->arrlist[position];
-       list->arrlist[position] = NULL;
-       if( list->freeItem ) {
-               list->freeItem(olditem);
-               olditem = NULL;
-       }
-
-       if( position == list->size - 1 ) list->size--;
-       return olditem;
-}
-
-
-int osrfListFind( const osrfList* list, void* addr ) {
-       if(!(list && addr)) return -1;
-       int index;
-       for( index = 0; index < list->size; index++ ) {
-               if( list->arrlist[index] == addr ) 
-                       return index;
-       }
-       return -1;
-}
-
-
-unsigned int osrfListGetCount( const osrfList* list ) {
-       if(!list) return -1;
-       return list->size;
-}
-
-
-void* osrfListPop( osrfList* list ) {
-       if(!list) return NULL;
-       return osrfListRemove( list, list->size - 1 );
-}
-
-
-osrfListIterator* osrfNewListIterator( const osrfList* list ) {
-       if(!list) return NULL;
-       osrfListIterator* itr;
-       OSRF_MALLOC(itr, sizeof(osrfListIterator));
-       itr->list = list;
-       itr->current = 0;
-       return itr;
-}
-
-void* osrfListIteratorNext( osrfListIterator* itr ) {
-       if(!(itr && itr->list)) return NULL;
-       if(itr->current >= itr->list->size) return NULL;
-       return itr->list->arrlist[itr->current++];
-}
-
-void osrfListIteratorFree( osrfListIterator* itr ) {
-       if(!itr) return;
-       free(itr);
-}
-
-
-void osrfListIteratorReset( osrfListIterator* itr ) {
-       if(!itr) return;
-       itr->current = 0;
-}
-
-
-void osrfListVanillaFree( void* item ) {
-       free(item);
-}
-
-void osrfListSetDefaultFree( osrfList* list ) {
-       if(!list) return;
-       list->freeItem = osrfListVanillaFree;
-}
diff --git a/OpenSRF/src/libstack/osrf_list.h b/OpenSRF/src/libstack/osrf_list.h
deleted file mode 100644 (file)
index d829ab7..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef OSRF_LIST_H
-#define OSRF_LIST_H
-
-#include "opensrf/utils.h"
-
-#define OSRF_LIST_DEFAULT_SIZE 48 /* most opensrf lists are small... */
-#define OSRF_LIST_INC_SIZE 256
-#define OSRF_LIST_MAX_SIZE 10240
-
-
-#define OSRF_LIST_GET_INDEX(l, i) (!l || i >= l->size) ? NULL: l->arrlist[i]
-
-/**
-  Items are stored as void*'s so it's up to the user to
-  manage the data wisely.  Also, if the 'freeItem' callback is defined for the list,
-  then, it will be used on any item that needs to be freed, so don't mix data
-  types in the list if you want magic freeing */
-
-struct __osrfListStruct {
-       unsigned int size;                      /* how many items in the list including NULL items between non-NULL items */    
-       void (*freeItem) (void* item);  /* callback for freeing stored items */
-       void** arrlist;
-       int arrsize; /* how big is the currently allocated array */
-};
-typedef struct __osrfListStruct osrfList;
-
-
-struct __osrfListIteratorStruct {
-       const osrfList* list;
-       unsigned int current;
-};
-typedef struct __osrfListIteratorStruct osrfListIterator;
-
-osrfList* osrfNewListSize( unsigned int size );
-
-
-/**
-  Creates a new list iterator with the given list
-  */
-osrfListIterator* osrfNewListIterator( const osrfList* list );
-
-/**
-  Returns the next non-NULL item in the list, return NULL when
-  the end of the list has been reached
-  */
-void* osrfListIteratorNext( osrfListIterator* itr );
-
-/**
-  Deallocates the given list
-  */
-void osrfListIteratorFree( osrfListIterator* itr );
-
-void osrfListIteratorReset( osrfListIterator* itr );
-
-
-/**
-  Allocates a new list
-  @param compress If true, the list will compress empty slots on delete.  If item positionality
-  is not important, then using this feature is reccomended to keep the list from growing indefinitely.
-  if item positionality is not important.
-  @return The allocated list
-  */
-osrfList* osrfNewList();
-
-/**
-  Pushes an item onto the end of the list.  This always finds the highest index
-  in the list and pushes the new item into the list after it.
-  @param list The list
-  @param item The item to push
-  @return 0 on success, -1 on failure
-  */
-int osrfListPush( osrfList* list, void* item );
-
-
-/**
- * Removes the last item in the list
- * See osrfListRemove for details on how the removed item is handled
- * @return The item, unless 'freeItem' exists, then returns NULL
- */
-void* osrfListPop( osrfList* list );
-
-/**
-  Puts the given item into the list at the specified position.  If there
-  is already an item at the given position and the list has it's 
-  "freeItem" function defined, then it will be used to free said item.
-  If no 'freeItem' callback is defined, then the displaced item will
-  be returned;
-  @param list The list
-  @param item The item to put into the list
-  @param position The position to place the item in
-  @return NULL in successfully inserting the new item and freeing
-  any displaced items.  Returns the displaced item if no "freeItem"
-  callback is defined.
-       */
-void* osrfListSet( osrfList* list, void* item, unsigned int position );
-
-/**
-  Returns the item at the given position
-  @param list The list
-  @param postiont the position
-  */
-void* osrfListGetIndex( const osrfList* list, unsigned int  position );
-
-/**
-  Frees the list and all list items (if the list has a "freeItem" function defined )
-  @param list The list
-  */
-void osrfListFree( osrfList* list );
-
-/**
-  Removes the list item at the given index
-  @param list The list
-  @param position The position of the item to remove
-  @return A pointer to the item removed if "freeItem" is not defined
-  for this list, returns NULL if it is.
-  */
-void* osrfListRemove( osrfList* list, unsigned int position );
-
-/**
-  Finds the list item whose void* is the same as the one passed in
-  @param list The list
-  @param addr The pointer connected to the list item we're to find
-  @return the index of the item, or -1 if the item was not found
-  */
-int osrfListFind( const osrfList* list, void* addr );
-
-
-void __osrfListSetSize( osrfList* list );
-
-
-/**
-  @return The number of non-null items in the list
-  */
-unsigned int osrfListGetCount( const osrfList* list );
-
-/**
- * May be used as a default memory freeing call
- * Just calls free() on list items
- */
-void osrfListVanillaFree( void* item );
-
-/**
- * Tells the list to just call 'free()' on each item when
- * an item or the whole list is destroyed
- */
-void osrfListSetDefaultFree( osrfList* list );
-
-/**
- * Inserts the new item at the first free (null) slot
- * in the array.  Item is shoved onto the end of the
- * list if there are no null slots */
-int osrfListPushFirst( osrfList* list, void* item );
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_message.c b/OpenSRF/src/libstack/osrf_message.c
deleted file mode 100644 (file)
index c650139..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-#include "osrf_message.h"
-
-osrf_message* osrf_message_init( enum M_TYPE type, int thread_trace, int protocol ) {
-
-       osrf_message* msg                       = (osrf_message*) safe_malloc(sizeof(osrf_message));
-       msg->m_type                                     = type;
-       msg->thread_trace                       = thread_trace;
-       msg->protocol                           = protocol;
-       msg->next                                       = NULL;
-       msg->is_exception                       = 0;
-       msg->_params                            = NULL;
-       msg->_result_content            = NULL;
-
-       return msg;
-}
-
-
-void osrf_message_set_method( osrf_message* msg, char* method_name ) {
-       if( msg == NULL || method_name == NULL ) return;
-       msg->method_name = strdup( method_name );
-}
-
-
-void osrf_message_add_object_param( osrf_message* msg, jsonObject* o ) {
-       if(!msg|| !o) return;
-       if(!msg->_params)
-               msg->_params = jsonParseString("[]");
-       char* j = jsonObjectToJSON(o);
-       jsonObjectPush(msg->_params, jsonParseString(j));
-       free(j);
-}
-
-void osrf_message_set_params( osrf_message* msg, jsonObject* o ) {
-       if(!msg || !o) return;
-
-       if(o->type != JSON_ARRAY) {
-               osrfLogDebug( OSRF_LOG_MARK, "passing non-array to osrf_message_set_params(), fixing...");
-               jsonObject* clone = jsonObjectClone(o);
-               o = jsonNewObject(NULL);
-               jsonObjectPush(o, clone);
-               if(msg->_params) jsonObjectFree(msg->_params);
-               msg->_params = o;
-               return;
-       }
-
-       if(msg->_params) jsonObjectFree(msg->_params);
-       msg->_params = jsonObjectClone(o);
-}
-
-
-/* only works if parse_json_params is false */
-void osrf_message_add_param( osrf_message* msg, char* param_string ) {
-       if(msg == NULL || param_string == NULL) return;
-       if(!msg->_params) msg->_params = jsonParseString("[]");
-       jsonObjectPush(msg->_params, jsonParseString(param_string));
-}
-
-
-void osrf_message_set_status_info( 
-               osrf_message* msg, char* status_name, char* status_text, int status_code ) {
-       if(!msg) return;
-
-       if( status_name != NULL ) 
-               msg->status_name = strdup( status_name );
-
-       if( status_text != NULL )
-               msg->status_text = strdup( status_text );
-
-       msg->status_code = status_code;
-}
-
-
-void osrf_message_set_result_content( osrf_message* msg, char* json_string ) {
-       if( msg == NULL || json_string == NULL) return;
-       msg->result_string =    strdup(json_string);
-       if(json_string) msg->_result_content = jsonParseString(json_string);
-}
-
-
-
-void osrfMessageFree( osrfMessage* msg ) {
-       osrf_message_free( msg );
-}
-
-void osrf_message_free( osrf_message* msg ) {
-       if( msg == NULL )
-               return;
-
-       if( msg->status_name != NULL )
-               free(msg->status_name);
-
-       if( msg->status_text != NULL )
-               free(msg->status_text);
-
-       if( msg->_result_content != NULL )
-               jsonObjectFree( msg->_result_content );
-
-       if( msg->result_string != NULL )
-               free( msg->result_string);
-
-       if( msg->method_name != NULL )
-               free(msg->method_name);
-
-       if( msg->_params != NULL )
-               jsonObjectFree(msg->_params);
-
-       free(msg);
-}
-
-
-char* osrfMessageSerializeBatch( osrfMessage* msgs [], int count ) {
-       if( !msgs ) return NULL;
-
-       char* j;
-       int i = 0;
-       osrfMessage* msg = NULL;
-       jsonObject* wrapper = jsonNewObject(NULL);
-
-       while( ((msg = msgs[i]) && (i++ < count)) ) 
-               jsonObjectPush(wrapper, osrfMessageToJSON( msg ));
-
-       //jsonObject* enc = jsonObjectEncodeClass(wrapper);
-       j = jsonObjectToJSON(wrapper);
-       jsonObjectFree(wrapper);
-       //jsonObjectFree(enc);
-
-       return j;       
-}
-
-
-char* osrf_message_serialize(osrf_message* msg) {
-
-       if( msg == NULL ) return NULL;
-       char* j = NULL;
-
-       jsonObject* json = osrfMessageToJSON( msg );
-
-       if(!json) return NULL;
-
-       jsonObject* wrapper = jsonNewObject(NULL);
-       jsonObjectPush(wrapper, json);
-       //jsonObject* enc = jsonObjectEncodeClass(wrapper);
-       j = jsonObjectToJSON(wrapper);
-       jsonObjectFree(wrapper);
-       //jsonObjectFree(enc);
-
-       return j;
-}
-
-
-jsonObject* osrfMessageToJSON( osrfMessage* msg ) {
-
-       jsonObject* json = jsonNewObject(NULL);
-       jsonObjectSetClass(json, "osrfMessage");
-       jsonObject* payload;
-       char sc[64]; memset(sc,0,64);
-
-       char* str;
-
-       INT_TO_STRING(msg->thread_trace);
-       jsonObjectSetKey(json, "threadTrace", jsonNewObject(INTSTR));
-
-       switch(msg->m_type) {
-               
-               case CONNECT: 
-                       jsonObjectSetKey(json, "type", jsonNewObject("CONNECT"));
-                       break;
-
-               case DISCONNECT: 
-                       jsonObjectSetKey(json, "type", jsonNewObject("DISCONNECT"));
-                       break;
-
-               case STATUS:
-                       jsonObjectSetKey(json, "type", jsonNewObject("STATUS"));
-                       payload = jsonNewObject(NULL);
-                       jsonObjectSetClass(payload, msg->status_name);
-                       jsonObjectSetKey(payload, "status", jsonNewObject(msg->status_text));
-         sprintf(sc,"%d",msg->status_code);
-                       jsonObjectSetKey(payload, "statusCode", jsonNewObject(sc));
-                       jsonObjectSetKey(json, "payload", payload);
-                       break;
-
-               case REQUEST:
-                       jsonObjectSetKey(json, "type", jsonNewObject("REQUEST"));
-                       payload = jsonNewObject(NULL);
-                       jsonObjectSetClass(payload, "osrfMethod");
-                       jsonObjectSetKey(payload, "method", jsonNewObject(msg->method_name));
-                       str = jsonObjectToJSON(msg->_params);
-                       jsonObjectSetKey(payload, "params", jsonParseString(str));
-                       free(str);
-                       jsonObjectSetKey(json, "payload", payload);
-
-                       break;
-
-               case RESULT:
-                       jsonObjectSetKey(json, "type", jsonNewObject("RESULT"));
-                       payload = jsonNewObject(NULL);
-                       jsonObjectSetClass(payload,"osrfResult");
-                       jsonObjectSetKey(payload, "status", jsonNewObject(msg->status_text));
-         sprintf(sc,"%d",msg->status_code);
-                       jsonObjectSetKey(payload, "statusCode", jsonNewObject(sc));
-                       str = jsonObjectToJSON(msg->_result_content);
-                       jsonObjectSetKey(payload, "content", jsonParseString(str));
-                       free(str);
-                       jsonObjectSetKey(json, "payload", payload);
-                       break;
-       }
-
-       return json;
-}
-
-
-int osrf_message_deserialize(char* string, osrf_message* msgs[], int count) {
-
-       if(!string || !msgs || count <= 0) return 0;
-       int numparsed = 0;
-
-       /** XXX **/
-       jsonObject* json = jsonParseString(string);
-       //jsonObject* json2 = jsonObjectDecodeClass(json);
-       //jsonObjectFree(json);
-       //json = json2;
-
-       if(!json) {
-               osrfLogWarning( OSRF_LOG_MARK, 
-                       "osrf_message_deserialize() unable to parse data: \n%s\n", string);
-               return 0;
-       }
-
-       int x;
-
-       for( x = 0; x < json->size && x < count; x++ ) {
-
-               jsonObject* message = jsonObjectGetIndex(json, x);
-
-               if(message && message->type != JSON_NULL && 
-                       message->classname && !strcmp(message->classname, "osrfMessage")) {
-
-                       osrf_message* new_msg = safe_malloc(sizeof(osrf_message));
-
-                       jsonObject* tmp = jsonObjectGetKey(message, "type");
-
-                       char* t;
-                       if( ( t = jsonObjectGetString(tmp)) ) {
-
-                               if(!strcmp(t, "CONNECT"))               new_msg->m_type = CONNECT;
-                               if(!strcmp(t, "DISCONNECT"))    new_msg->m_type = DISCONNECT;
-                               if(!strcmp(t, "STATUS"))                new_msg->m_type = STATUS;
-                               if(!strcmp(t, "REQUEST"))               new_msg->m_type = REQUEST;
-                               if(!strcmp(t, "RESULT"))                new_msg->m_type = RESULT;
-                       }
-
-                       tmp = jsonObjectGetKey(message, "threadTrace");
-                       if(tmp) {
-                               char* tt = jsonObjectToSimpleString(tmp);
-                               if(tt) {
-                                       new_msg->thread_trace = atoi(tt);
-                                       free(tt);
-                               }
-                               /*
-                               if(tmp->type == JSON_NUMBER)
-                                       new_msg->thread_trace = (int) jsonObjectGetNumber(tmp);
-                               if(tmp->type == JSON_STRING)
-                                       new_msg->thread_trace = atoi(jsonObjectGetString(tmp));
-                                       */
-                       }
-
-
-                       tmp = jsonObjectGetKey(message, "protocol");
-
-                       if(tmp) {
-                               char* proto = jsonObjectToSimpleString(tmp);
-                               if(proto) {
-                                       new_msg->protocol = atoi(proto);
-                                       free(proto);
-                               }
-
-                               /*
-                               if(tmp->type == JSON_NUMBER)
-                                       new_msg->protocol = (int) jsonObjectGetNumber(tmp);
-                               if(tmp->type == JSON_STRING)
-                                       new_msg->protocol = atoi(jsonObjectGetString(tmp));
-                                       */
-                       }
-
-                       tmp = jsonObjectGetKey(message, "payload");
-                       if(tmp) {
-                               if(tmp->classname)
-                                       new_msg->status_name = strdup(tmp->classname);
-
-                               jsonObject* tmp0 = jsonObjectGetKey(tmp,"method");
-                               if(jsonObjectGetString(tmp0))
-                                       new_msg->method_name = strdup(jsonObjectGetString(tmp0));
-
-                               tmp0 = jsonObjectGetKey(tmp,"params");
-                               if(tmp0) {
-                                       char* s = jsonObjectToJSON(tmp0);
-                                       new_msg->_params = jsonParseString(s);
-                                       if(new_msg->_params && new_msg->_params->type == JSON_NULL) 
-                                               new_msg->_params->type = JSON_ARRAY;
-                                       free(s);
-                               }
-
-                               tmp0 = jsonObjectGetKey(tmp,"status");
-                               if(jsonObjectGetString(tmp0))
-                                       new_msg->status_text = strdup(jsonObjectGetString(tmp0));
-
-                               tmp0 = jsonObjectGetKey(tmp,"statusCode");
-                               if(tmp0) {
-                                       if(jsonObjectGetString(tmp0))
-                                               new_msg->status_code = atoi(jsonObjectGetString(tmp0));
-                                       if(tmp0->type == JSON_NUMBER)
-                                               new_msg->status_code = (int) jsonObjectGetNumber(tmp0);
-                               }
-
-                               tmp0 = jsonObjectGetKey(tmp,"content");
-                               if(tmp0) {
-                                       char* s = jsonObjectToJSON(tmp0);
-                                       new_msg->_result_content = jsonParseString(s);
-                                       free(s);
-                               }
-
-                       }
-                       msgs[numparsed++] = new_msg;
-               }
-       }
-
-       jsonObjectFree(json);
-       return numparsed;
-}
-
-
-
-jsonObject* osrfMessageGetResult( osrfMessage* msg ) {
-       if(msg) return msg->_result_content;
-       return NULL;
-}
-
diff --git a/OpenSRF/src/libstack/osrf_message.h b/OpenSRF/src/libstack/osrf_message.h
deleted file mode 100644 (file)
index e99a604..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#include "opensrf/string_array.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "osrf_json.h"
-
-
-/* libxml stuff for the config reader */
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/tree.h>
-
-
-
-#ifndef osrf_message_h
-#define osrf_message_h
-
-#define OSRF_XML_NAMESPACE "http://open-ils.org/xml/namespaces/oils_v1"
-
-#define OSRF_STATUS_CONTINUE                                           100
-
-#define OSRF_STATUS_OK                                                         200
-#define OSRF_STATUS_ACCEPTED                                           202
-#define OSRF_STATUS_COMPLETE                                           205
-
-#define OSRF_STATUS_REDIRECTED                                 307
-
-#define OSRF_STATUS_BADREQUEST                                 400
-#define OSRF_STATUS_UNAUTHORIZED                                       401
-#define OSRF_STATUS_FORBIDDEN                                          403
-#define OSRF_STATUS_NOTFOUND                                           404
-#define OSRF_STATUS_NOTALLOWED                                 405
-#define OSRF_STATUS_TIMEOUT                                            408
-#define OSRF_STATUS_EXPFAILED                                          417
-
-#define OSRF_STATUS_INTERNALSERVERERROR                500
-#define OSRF_STATUS_NOTIMPLEMENTED                             501
-#define OSRF_STATUS_VERSIONNOTSUPPORTED                505
-
-
-enum M_TYPE { CONNECT, REQUEST, RESULT, STATUS, DISCONNECT };
-
-#define OSRF_MAX_PARAMS                                                                128;
-
-struct osrf_message_struct {
-
-       enum M_TYPE m_type;
-       int thread_trace;
-       int protocol;
-
-       /* if we're a STATUS message */
-       char* status_name;
-
-       /* if we're a STATUS or RESULT */
-       char* status_text;
-       int status_code;
-
-       int is_exception;
-
-       /* if we're a RESULT */
-       jsonObject* _result_content;
-
-       /* unparsed json string */
-       char* result_string;
-
-       /* if we're a REQUEST */
-       char* method_name;
-
-       jsonObject* _params;
-
-       /* in case anyone wants to make a list of us.  
-               we won't touch this variable */
-       struct osrf_message_struct* next;
-
-       char* full_param_string;
-
-};
-typedef struct osrf_message_struct osrf_message;
-typedef struct osrf_message_struct osrfMessage;
-
-
-osrf_message* osrf_message_init( enum M_TYPE type, int thread_trace, int protocol );
-//void osrf_message_set_request_info( osrf_message*, char* param_name, json* params );
-void osrf_message_set_status_info( osrf_message*, char* status_name, char* status_text, int status_code );
-void osrf_message_set_result_content( osrf_message*, char* json_string );
-void osrfMessageFree( osrfMessage* );
-void osrf_message_free( osrf_message* );
-char* osrf_message_to_xml( osrf_message* );
-char* osrf_message_serialize(osrf_message*);
-
-/* count is the max number of messages we'll put into msgs[] */
-int osrf_message_deserialize(char* json, osrf_message* msgs[], int count);
-
-
-
-/** Pushes any message retreived from the xml into the 'msgs' array.
-  * it is assumed that 'msgs' has beenn pre-allocated.
-  * Returns the number of message that are in the buffer.
-  */
-int osrf_message_from_xml( char* xml, osrf_message* msgs[] );
-
-void osrf_message_set_params( osrf_message* msg, jsonObject* o );
-void osrf_message_set_method( osrf_message* msg, char* method_name );
-void osrf_message_add_object_param( osrf_message* msg, jsonObject* o );
-void osrf_message_add_param( osrf_message*, char* param_string );
-
-
-jsonObject* osrfMessageGetResult( osrfMessage* msg );
-
-/**
-  Returns the message as a jsonObject
-  @return The jsonObject which must be freed by the caller.
-  */
-jsonObject* osrfMessageToJSON( osrfMessage* msg );
-
-char* osrfMessageSerializeBatch( osrfMessage* msgs [], int count );
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_prefork.c b/OpenSRF/src/libstack/osrf_prefork.c
deleted file mode 100644 (file)
index 31548e9..0000000
+++ /dev/null
@@ -1,765 +0,0 @@
-#include "osrf_prefork.h"
-#include <signal.h>
-#include "osrf_app_session.h"
-#include "osrf_application.h"
-
-/* true if we just deleted a child.  This will allow us to make sure we're
-       not trying to use freed memory */
-int child_dead;
-
-int main();
-void sigchld_handler( int sig );
-
-int osrf_prefork_run(char* appname) {
-
-       if(!appname) {
-               osrfLogError( OSRF_LOG_MARK, "osrf_prefork_run requires an appname to run!");
-               return -1;
-       }
-
-       set_proc_title( "OpenSRF Listener [%s]", appname );
-
-       int maxr = 1000; 
-       int maxc = 10;
-       int minc = 3;
-
-       osrfLogInfo( OSRF_LOG_MARK, "Loading config in osrf_forker for app %s", appname);
-
-       jsonObject* max_req = osrf_settings_host_value_object("/apps/%s/unix_config/max_requests", appname);
-       jsonObject* min_children = osrf_settings_host_value_object("/apps/%s/unix_config/min_children", appname);
-       jsonObject* max_children = osrf_settings_host_value_object("/apps/%s/unix_config/max_children", appname);
-
-       char* keepalive = osrf_settings_host_value("/apps/%s/keepalive", appname);
-       time_t kalive;
-       if( keepalive ) {
-               kalive = atoi(keepalive);
-               free(keepalive);
-       } else {
-               kalive = 5; /* give it a default */
-       }
-
-       osrfLogInfo(OSRF_LOG_MARK, "keepalive setting = %d seconds", kalive);
-
-
-       
-       if(!max_req) osrfLogWarning( OSRF_LOG_MARK, "Max requests not defined, assuming 1000");
-       else maxr = (int) jsonObjectGetNumber(max_req);
-
-       if(!min_children) osrfLogWarning( OSRF_LOG_MARK, "Min children not defined, assuming 3");
-       else minc = (int) jsonObjectGetNumber(min_children);
-
-       if(!max_children) osrfLogWarning( OSRF_LOG_MARK, "Max children not defined, assuming 10");
-       else maxc = (int) jsonObjectGetNumber(max_children);
-
-       jsonObjectFree(max_req);
-       jsonObjectFree(min_children);
-       jsonObjectFree(max_children);
-       /* --------------------------------------------------- */
-
-       char* resc = va_list_to_string("%s_listener", appname);
-
-       if(!osrf_system_bootstrap_client_resc( NULL, NULL, resc )) {
-               osrfLogError( OSRF_LOG_MARK, "Unable to bootstrap client for osrf_prefork_run()");
-               free(resc);
-               return -1;
-       }
-
-       free(resc);
-
-       prefork_simple* forker = prefork_simple_init(
-               osrfSystemGetTransportClient(), maxr, minc, maxc);
-
-       forker->appname = strdup(appname);
-       forker->keepalive       = kalive;
-
-       if(forker == NULL) {
-               osrfLogError( OSRF_LOG_MARK, "osrf_prefork_run() failed to create prefork_simple object");
-               return -1;
-       }
-
-       prefork_launch_children(forker);
-
-       osrf_prefork_register_routers(appname);
-       
-       osrfLogInfo( OSRF_LOG_MARK, "Launching osrf_forker for app %s", appname);
-       prefork_run(forker);
-       
-       osrfLogWarning( OSRF_LOG_MARK, "prefork_run() retuned - how??");
-       prefork_free(forker);
-       return 0;
-
-}
-
-void osrf_prefork_register_routers( char* appname ) {
-
-       osrfStringArray* arr = osrfNewStringArray(4);
-
-       int c = osrfConfigGetValueList( NULL, arr, "/routers/router" );
-       char* routerName = osrfConfigGetValue( NULL, "/router_name" );
-       transport_client* client = osrfSystemGetTransportClient();
-
-       osrfLogInfo( OSRF_LOG_MARK, "router name is %s and we have %d routers to connect to", routerName, c );
-
-       while( c ) {
-               char* domain = osrfStringArrayGetString(arr, --c);
-               if(domain) {
-
-                       char* jid = va_list_to_string( "%s@%s/router", routerName, domain );
-                       osrfLogInfo( OSRF_LOG_MARK, "Registering with router %s", jid );
-
-                       transport_message* msg = message_init("registering", NULL, NULL, jid, NULL );
-                       message_set_router_info( msg, NULL, NULL, appname, "register", 0 );
-
-                       client_send_message( client, msg );
-                       message_free( msg );
-                       free(jid);
-               }
-       }
-
-       free(routerName);
-       osrfStringArrayFree(arr);
-}
-
-int prefork_child_init_hook(prefork_child* child) {
-
-       if(!child) return -1;
-       osrfLogDebug( OSRF_LOG_MARK, "Child init hook for child %d", child->pid);
-       char* resc = va_list_to_string("%s_drone",child->appname);
-
-   /* if we're a source-client, tell the logger now that we're a new process*/
-   char* isclient = osrfConfigGetValue(NULL, "/client");
-   if( isclient && !strcasecmp(isclient,"true") )
-      osrfLogSetIsClient(1);
-   free(isclient);
-
-
-       /* we want to remove traces of our parents socket connection 
-        * so we can have our own */
-       osrfSystemIgnoreTransportClient();
-
-       if(!osrf_system_bootstrap_client_resc( NULL, NULL, resc)) {
-               osrfLogError( OSRF_LOG_MARK, "Unable to bootstrap client for osrf_prefork_run()");
-               free(resc);
-               return -1;
-       }
-
-       free(resc);
-
-       if( ! osrfAppRunChildInit(child->appname) ) {
-               osrfLogDebug(OSRF_LOG_MARK, "Prefork child_init succeeded\n");
-       } else {
-               osrfLogError(OSRF_LOG_MARK, "Prefork child_init failed\n");
-               return -1;
-       }
-
-       set_proc_title( "OpenSRF Drone [%s]", child->appname );
-       return 0;
-}
-
-void prefork_child_process_request(prefork_child* child, char* data) {
-       if( !child ) return;
-
-       transport_client* client = osrfSystemGetTransportClient();
-
-       if(!client_connected(client)) {
-               osrfSystemIgnoreTransportClient();
-               osrfLogWarning(OSRF_LOG_MARK, "Reconnecting child to opensrf after disconnect...");
-               if(!osrf_system_bootstrap_client(NULL, NULL)) {
-                       osrfLogError( OSRF_LOG_MARK, 
-                               "Unable to bootstrap client in prefork_child_process_request()");
-                       sleep(1);
-         osrf_prefork_child_exit(child);
-               }
-       }
-
-       /* construct the message from the xml */
-       transport_message* msg = new_message_from_xml( data );
-
-       osrfAppSession* session = osrf_stack_transport_handler(msg, child->appname);
-       if(!session) return;
-
-       if( session->stateless && session->state != OSRF_SESSION_CONNECTED ) {
-               osrfAppSessionFree( session );
-               return;
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "Entering keepalive loop for session %s", session->session_id );
-       int keepalive = child->keepalive;
-       int retval;
-       int recvd;
-       time_t start;
-       time_t end;
-
-       while(1) {
-
-               osrfLogDebug(OSRF_LOG_MARK, 
-                               "osrf_prefork calling queue_wait [%d] in keepalive loop", keepalive);
-               start           = time(NULL);
-               retval  = osrf_app_session_queue_wait(session, keepalive, &recvd);
-               end             = time(NULL);
-
-               osrfLogDebug(OSRF_LOG_MARK, "Data received == %d", recvd);
-
-               if(retval) {
-                       osrfLogError(OSRF_LOG_MARK, "queue-wait returned non-success %d", retval);
-                       break;
-               }
-
-               /* see if the client disconnected from us */
-               if(session->state != OSRF_SESSION_CONNECTED) break;
-
-               /* if no data was reveived within the timeout interval */
-               if( !recvd && (end - start) >= keepalive ) {
-                       osrfLogInfo(OSRF_LOG_MARK, "No request was reveived in %d seconds, exiting stateful session", keepalive);
-                       osrfAppSessionStatus( 
-                                       session, 
-                                       OSRF_STATUS_TIMEOUT, 
-                                       "osrfConnectStatus", 
-                                       0, "Disconnected on timeout" );
-
-                       break;
-               }
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "Exiting keepalive loop for session %s", session->session_id );
-       osrfAppSessionFree( session );
-       return;
-}
-
-
-prefork_simple*  prefork_simple_init( transport_client* client, 
-               int max_requests, int min_children, int max_children ) {
-
-       if( min_children > max_children ) {
-               osrfLogError( OSRF_LOG_MARK,  "min_children (%d) is greater "
-                               "than max_children (%d)", min_children, max_children );
-               return NULL;
-       }
-
-       if( max_children > ABS_MAX_CHILDREN ) {
-               osrfLogError( OSRF_LOG_MARK,  "max_children (%d) is greater than ABS_MAX_CHILDREN (%d)",
-                               max_children, ABS_MAX_CHILDREN );
-               return NULL;
-       }
-
-       osrfLogInfo(OSRF_LOG_MARK, "Prefork launching child with max_request=%d,"
-               "min_children=%d, max_children=%d", max_requests, min_children, max_children );
-
-       /* flesh out the struct */
-       prefork_simple* prefork = (prefork_simple*) safe_malloc(sizeof(prefork_simple));        
-       prefork->max_requests = max_requests;
-       prefork->min_children = min_children;
-       prefork->max_children = max_children;
-       prefork->first_child = NULL;
-       prefork->connection = client;
-
-       return prefork;
-}
-
-prefork_child*  launch_child( prefork_simple* forker ) {
-
-       pid_t pid;
-       int data_fd[2];
-       int status_fd[2];
-
-       /* Set up the data pipes and add the child struct to the parent */
-       if( pipe(data_fd) < 0 ) { /* build the data pipe*/
-               osrfLogError( OSRF_LOG_MARK,  "Pipe making error" );
-               return NULL;
-       }
-
-       if( pipe(status_fd) < 0 ) {/* build the status pipe */
-               osrfLogError( OSRF_LOG_MARK,  "Pipe making error" );
-               return NULL;
-       }
-
-       osrfLogInternal( OSRF_LOG_MARK,  "Pipes: %d %d %d %d", data_fd[0], data_fd[1], status_fd[0], status_fd[1] );
-       prefork_child* child = prefork_child_init( forker->max_requests, data_fd[0], 
-                       data_fd[1], status_fd[0], status_fd[1] );
-
-       child->appname = strdup(forker->appname);
-       child->keepalive = forker->keepalive;
-
-
-       add_prefork_child( forker, child );
-
-       if( (pid=fork()) < 0 ) {
-               osrfLogError( OSRF_LOG_MARK,  "Forking Error" );
-               return NULL;
-       }
-
-       if( pid > 0 ) {  /* parent */
-
-               signal(SIGCHLD, sigchld_handler);
-               (forker->current_num_children)++;
-               child->pid = pid;
-
-               osrfLogDebug( OSRF_LOG_MARK,  "Parent launched %d", pid );
-               /* *no* child pipe FD's can be closed or the parent will re-use fd's that
-                       the children are currently using */
-               return child;
-       }
-
-       else { /* child */
-
-               osrfLogInternal( OSRF_LOG_MARK, "I am  new child with read_data_fd = %d and write_status_fd = %d",
-                       child->read_data_fd, child->write_status_fd );
-
-               child->pid = getpid();
-               close( child->write_data_fd );
-               close( child->read_status_fd );
-
-               /* do the initing */
-               if( prefork_child_init_hook(child) == -1 ) {
-                       osrfLogError(OSRF_LOG_MARK, 
-                               "Forker child going away because we could not connect to OpenSRF...");
-         osrf_prefork_child_exit(child);
-               }
-
-               prefork_child_wait( child );
-      osrf_prefork_child_exit(child); /* just to be sure */
-        }
-       return NULL;
-}
-
-void osrf_prefork_child_exit(prefork_child* child) {
-   osrfAppRunExitCode();
-   exit(0);
-}
-
-void prefork_launch_children( prefork_simple* forker ) {
-       if(!forker) return;
-       int c = 0;
-       while( c++ < forker->min_children )
-               launch_child( forker );
-}
-
-
-void sigchld_handler( int sig ) {
-       signal(SIGCHLD, sigchld_handler);
-       child_dead = 1;
-}
-
-
-void reap_children( prefork_simple* forker ) {
-
-       pid_t child_pid;
-       int status;
-
-       while( (child_pid=waitpid(-1,&status,WNOHANG)) > 0) 
-               del_prefork_child( forker, child_pid ); 
-
-       /* replenish */
-       while( forker->current_num_children < forker->min_children ) 
-               launch_child( forker );
-
-       child_dead = 0;
-}
-
-void prefork_run(prefork_simple* forker) {
-
-       if( forker->first_child == NULL )
-               return;
-
-       transport_message* cur_msg = NULL;
-
-
-       while(1) {
-
-               if( forker->first_child == NULL ) {/* no more children */
-                       osrfLogWarning( OSRF_LOG_MARK, "No more children..." );
-                       return;
-               }
-
-               osrfLogDebug( OSRF_LOG_MARK, "Forker going into wait for data...");
-               cur_msg = client_recv( forker->connection, -1 );
-
-               //fprintf(stderr, "Got Data %f\n", get_timestamp_millis() );
-
-               if( cur_msg == NULL ) continue;
-
-               int honored = 0;        /* true if we've serviced the request */
-               int no_recheck = 0;
-
-               while( ! honored ) {
-
-                       if(!no_recheck) check_children( forker, 0 ); 
-                       no_recheck = 0;
-
-                       osrfLogDebug( OSRF_LOG_MARK,  "Server received inbound data" );
-                       int k;
-                       prefork_child* cur_child = forker->first_child;
-
-                       /* Look for an available child */
-                       for( k = 0; k < forker->current_num_children; k++ ) {
-
-                               osrfLogInternal( OSRF_LOG_MARK, "Searching for available child. cur_child->pid = %d", cur_child->pid );
-                               osrfLogInternal( OSRF_LOG_MARK, "Current num children %d and loop %d", forker->current_num_children, k);
-                       
-                               if( cur_child->available ) {
-                                       osrfLogDebug( OSRF_LOG_MARK,  "forker sending data to %d", cur_child->pid );
-
-                                       message_prepare_xml( cur_msg );
-                                       char* data = cur_msg->msg_xml;
-                                       if( ! data || strlen(data) < 1 ) break;
-
-                                       cur_child->available = 0;
-                                       osrfLogInternal( OSRF_LOG_MARK,  "Writing to child fd %d", cur_child->write_data_fd );
-
-                                       int written = 0;
-                                       //fprintf(stderr, "Writing Data %f\n", get_timestamp_millis() );
-                                       if( (written = write( cur_child->write_data_fd, data, strlen(data) + 1 )) < 0 ) {
-                                               osrfLogWarning( OSRF_LOG_MARK, "Write returned error %d", errno);
-                                               cur_child = cur_child->next;
-                                               continue;
-                                       }
-
-                                       //fprintf(stderr, "Wrote %d bytes to child\n", written);
-
-                                       forker->first_child = cur_child->next;
-                                       honored = 1;
-                                       break;
-                               } else 
-                                       cur_child = cur_child->next;
-                       } 
-
-                       /* if none available, add a new child if we can */
-                       if( ! honored ) {
-                               osrfLogDebug( OSRF_LOG_MARK, "Not enough children, attempting to add...");
-
-                               if( forker->current_num_children < forker->max_children ) {
-                                       osrfLogDebug( OSRF_LOG_MARK,  "Launching new child with current_num = %d",
-                                                       forker->current_num_children );
-
-                                       prefork_child* new_child = launch_child( forker );
-                    if( new_child ) {
-
-                                           message_prepare_xml( cur_msg );
-                                           char* data = cur_msg->msg_xml;
-
-                        if( data ) {
-                            int len = strlen(data);
-
-                            if( len > 0 ) {
-                                                   new_child->available = 0;
-                                                   osrfLogDebug( OSRF_LOG_MARK,  "Writing to new child fd %d : pid %d", 
-                                                               new_child->write_data_fd, new_child->pid );
-        
-                                                   if( write( new_child->write_data_fd, data, len + 1 ) >= 0 ) {
-                                                       forker->first_child = new_child->next;
-                                                       honored = 1;
-                                }
-                            }
-                        }
-                    }
-
-                               }
-                       }
-
-                       if( !honored ) {
-                               osrfLogWarning( OSRF_LOG_MARK,  "No children available, waiting...");
-
-                               check_children( forker, 1 );  /* non-poll version */
-                               /* tell the loop no to call check_children again, since we're calling it now */
-                               no_recheck = 1;
-                       }
-
-                       if( child_dead )
-                               reap_children(forker);
-
-
-                       //fprintf(stderr, "Parent done with request %f\n", get_timestamp_millis() );
-
-               } // honored?
-
-               message_free( cur_msg );
-
-       } /* top level listen loop */
-
-}
-
-
-/** XXX Add a flag which tells select() to wait forever on children
- * in the best case, this will be faster than calling usleep(x), and
- * in the worst case it won't be slower and will do less logging...
- */
-
-void check_children( prefork_simple* forker, int forever ) {
-
-       //check_begin:
-
-       int select_ret;
-       fd_set read_set;
-       FD_ZERO(&read_set);
-       int max_fd = 0;
-       int n;
-
-
-       if( child_dead )
-               reap_children(forker);
-
-       prefork_child* cur_child = forker->first_child;
-
-       int i;
-       for( i = 0; i!= forker->current_num_children; i++ ) {
-
-               if( cur_child->read_status_fd > max_fd )
-                       max_fd = cur_child->read_status_fd;
-               FD_SET( cur_child->read_status_fd, &read_set );
-               cur_child = cur_child->next;
-       }
-
-       FD_CLR(0,&read_set);/* just to be sure */
-
-       if( forever ) {
-               osrfLogWarning(OSRF_LOG_MARK, "We have no children available - waiting for one to show up...");
-
-               if( (select_ret=select( max_fd + 1 , &read_set, NULL, NULL, NULL)) == -1 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Select returned error %d on check_children", errno );
-               }
-               osrfLogInfo(OSRF_LOG_MARK, "select() completed after waiting on children to become available");
-
-       } else {
-
-               struct timeval tv;
-               tv.tv_sec       = 0;
-               tv.tv_usec      = 0;
-       
-               if( (select_ret=select( max_fd + 1 , &read_set, NULL, NULL, &tv)) == -1 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Select returned error %d on check_children", errno );
-               }
-       }
-
-       if( select_ret == 0 )
-               return;
-
-       /* see if one of a child has told us it's done */
-       cur_child = forker->first_child;
-       int j;
-       int num_handled = 0;
-       for( j = 0; j!= forker->current_num_children && num_handled < select_ret ; j++ ) {
-
-               if( FD_ISSET( cur_child->read_status_fd, &read_set ) ) {
-                       //printf( "Server received status from a child %d\n", cur_child->pid );
-                       osrfLogDebug( OSRF_LOG_MARK,  "Server received status from a child %d", cur_child->pid );
-
-                       num_handled++;
-
-                       /* now suck off the data */
-                       char buf[64];
-                       memset( buf, 0, 64);
-                       if( (n=read(cur_child->read_status_fd, buf, 63))  < 0 ) {
-                               osrfLogWarning( OSRF_LOG_MARK, "Read error afer select in child status read with errno %d", errno);
-                       }
-
-                       osrfLogDebug( OSRF_LOG_MARK,  "Read %d bytes from status buffer: %s", n, buf );
-                       cur_child->available = 1;
-               }
-               cur_child = cur_child->next;
-       } 
-
-}
-
-
-void prefork_child_wait( prefork_child* child ) {
-
-       int i,n;
-       growing_buffer* gbuf = buffer_init( READ_BUFSIZE );
-       char buf[READ_BUFSIZE];
-       memset( buf, 0, READ_BUFSIZE );
-
-       for( i = 0; i < child->max_requests; i++ ) {
-
-               n = -1;
-               int gotdata = 0;
-               clr_fl(child->read_data_fd, O_NONBLOCK );
-
-               while( (n=read(child->read_data_fd, buf, READ_BUFSIZE-1)) > 0 ) {
-                       osrfLogDebug(OSRF_LOG_MARK, "Prefork child read %d bytes of data", n);
-                       if(!gotdata)
-                               set_fl(child->read_data_fd, O_NONBLOCK );
-                       buffer_add( gbuf, buf );
-                       memset( buf, 0, READ_BUFSIZE );
-                       gotdata = 1;
-               }
-
-               if( errno == EAGAIN ) n = 0;
-
-      if( errno == EPIPE ) {
-         osrfLogWarning(OSRF_LOG_MARK, "C child attempted read on broken pipe, exiting...");
-         break;
-      }
-
-               if( n < 0 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Prefork child read returned error with errno %d", errno );
-                       break;
-
-               } else if( gotdata ) {
-                       osrfLogDebug(OSRF_LOG_MARK, "Prefork child got a request.. processing..");
-                       prefork_child_process_request(child, gbuf->buf);
-                       buffer_reset( gbuf );
-               }
-
-               if( i < child->max_requests - 1 ) 
-                       write( child->write_status_fd, "available" /*less than 64 bytes*/, 9 );
-       }
-
-       buffer_free(gbuf);
-
-       osrfLogDebug( OSRF_LOG_MARK, "Child with max-requests=%d, num-served=%d exiting...[%d]", 
-                       child->max_requests, i, getpid() );
-
-   osrf_prefork_child_exit(child); /* just to be sure */
-}
-
-
-void add_prefork_child( prefork_simple* forker, prefork_child* child ) {
-       
-       if( forker->first_child == NULL ) {
-               forker->first_child = child;
-               child->next = child;
-               return;
-       }
-
-       /* we put the child in as the last because, regardless, 
-               we have to do the DLL splice dance, and this is the
-          simplest way */
-
-       prefork_child* start_child = forker->first_child;
-       while(1) {
-               if( forker->first_child->next == start_child ) 
-                       break;
-               forker->first_child = forker->first_child->next;
-       }
-
-       /* here we know that forker->first_child is the last element 
-               in the list and start_child is the first.  Insert the
-               new child between them*/
-
-       forker->first_child->next = child;
-       child->next = start_child;
-       return;
-}
-
-prefork_child* find_prefork_child( prefork_simple* forker, pid_t pid ) {
-
-       if( forker->first_child == NULL ) { return NULL; }
-       prefork_child* start_child = forker->first_child;
-       do {
-               if( forker->first_child->pid == pid ) 
-                       return forker->first_child;
-       } while( (forker->first_child = forker->first_child->next) != start_child );
-
-       return NULL;
-}
-
-
-void del_prefork_child( prefork_simple* forker, pid_t pid ) { 
-
-       if( forker->first_child == NULL ) { return; }
-
-       (forker->current_num_children)--;
-       osrfLogDebug( OSRF_LOG_MARK, "Deleting Child: %d", pid );
-
-       prefork_child* start_child = forker->first_child; /* starting point */
-       prefork_child* cur_child        = start_child; /* current pointer */
-       prefork_child* prev_child       = start_child; /* the trailing pointer */
-
-       /* special case where there is only one in the list */
-       if( start_child == start_child->next ) {
-               if( start_child->pid == pid ) {
-                       forker->first_child = NULL;
-
-                       close( start_child->read_data_fd );
-                       close( start_child->write_data_fd );
-                       close( start_child->read_status_fd );
-                       close( start_child->write_status_fd );
-
-                       prefork_child_free( start_child );
-               }
-               return;
-       }
-
-
-       /* special case where the first item in the list needs to be removed */
-       if( start_child->pid == pid ) { 
-
-               /* find the last one so we can remove the start_child */
-               do { 
-                       prev_child = cur_child;
-                       cur_child = cur_child->next;
-               }while( cur_child != start_child );
-
-               /* now cur_child == start_child */
-               prev_child->next = cur_child->next;
-               forker->first_child = prev_child;
-
-               close( cur_child->read_data_fd );
-               close( cur_child->write_data_fd );
-               close( cur_child->read_status_fd );
-               close( cur_child->write_status_fd );
-
-               prefork_child_free( cur_child );
-               return;
-       } 
-
-       do {
-               prev_child = cur_child;
-               cur_child = cur_child->next;
-
-               if( cur_child->pid == pid ) {
-                       prev_child->next = cur_child->next;
-
-                       close( cur_child->read_data_fd );
-                       close( cur_child->write_data_fd );
-                       close( cur_child->read_status_fd );
-                       close( cur_child->write_status_fd );
-
-                       prefork_child_free( cur_child );
-                       return;
-               }
-
-       } while(cur_child != start_child);
-}
-
-
-
-
-prefork_child* prefork_child_init( 
-       int max_requests, int read_data_fd, int write_data_fd, 
-       int read_status_fd, int write_status_fd ) {
-
-       prefork_child* child = (prefork_child*) safe_malloc(sizeof(prefork_child));
-       child->max_requests             = max_requests;
-       child->read_data_fd             = read_data_fd;
-       child->write_data_fd            = write_data_fd;
-       child->read_status_fd   = read_status_fd;
-       child->write_status_fd  = write_status_fd;
-       child->available                        = 1;
-
-       return child;
-}
-
-
-int prefork_free( prefork_simple* prefork ) {
-       
-       while( prefork->first_child != NULL ) {
-               osrfLogInfo( OSRF_LOG_MARK,  "Killing children and sleeping 1 to reap..." );
-               kill( 0,        SIGKILL );
-               sleep(1);
-       }
-
-       client_free(prefork->connection);
-       free(prefork->appname);
-       free( prefork );
-       return 1;
-}
-
-int prefork_child_free( prefork_child* child ) { 
-       free(child->appname);
-       close(child->read_data_fd);
-       close(child->write_status_fd);
-       free( child ); 
-       return 1;
-}
-
diff --git a/OpenSRF/src/libstack/osrf_prefork.h b/OpenSRF/src/libstack/osrf_prefork.h
deleted file mode 100644 (file)
index 9515445..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/select.h>
-#include <sys/wait.h>
-
-#include "opensrf/utils.h"
-#include "opensrf/transport_message.h"
-#include "opensrf/transport_client.h"
-#include "osrf_stack.h"
-#include "osrf_settings.h"
-#include "osrfConfig.h"
-
-//#define READ_BUFSIZE 4096
-#define READ_BUFSIZE 1024
-#define MAX_BUFSIZE 10485760 /* 10M enough? ;) */
-#define ABS_MAX_CHILDREN 256 
-
-/* we receive data.  we find the next child in
-       line that is available.  pass the data down that childs pipe and go
-       back to listening for more data.
-       when we receive SIGCHLD, we check for any dead children and clean up
-       their respective prefork_child objects, close pipes, etc.
-
-       we build a select fd_set with all the child pipes (going to the parent) 
-       when a child is done processing a request, it writes a small chunk of 
-       data to the parent to alert the parent that the child is again available 
-       */
-
-struct prefork_simple_struct {
-       int max_requests;
-       int min_children;
-       int max_children;
-       int fd;
-       int data_to_child;
-       int data_to_parent;
-       int current_num_children;
-       int keepalive; /* keepalive time for stateful sessions */
-       char* appname;
-       struct prefork_child_struct* first_child;
-       transport_client* connection;
-};
-typedef struct prefork_simple_struct prefork_simple;
-
-struct prefork_child_struct {
-       pid_t pid;
-       int read_data_fd;
-       int write_data_fd;
-       int read_status_fd;
-       int write_status_fd;
-       int min_children;
-       int available;
-       int max_requests;
-       char* appname;
-       int keepalive;
-       struct prefork_child_struct* next;
-};
-
-typedef struct prefork_child_struct prefork_child;
-
-int osrf_prefork_run(char* appname);
-
-prefork_simple*  prefork_simple_init( transport_client* client, 
-       int max_requests, int min_children, int max_children );
-
-prefork_child*  launch_child( prefork_simple* forker );
-void prefork_launch_children( prefork_simple* forker );
-
-void prefork_run(prefork_simple* forker);
-
-void add_prefork_child( prefork_simple* forker, prefork_child* child );
-prefork_child* find_prefork_child( prefork_simple* forker, pid_t pid );
-void del_prefork_child( prefork_simple* forker, pid_t pid );
-
-void check_children( prefork_simple* forker, int forever );
-
-void prefork_child_process_request(prefork_child*, char* data);
-int prefork_child_init_hook(prefork_child*);
-
-prefork_child* prefork_child_init( 
-               int max_requests, int read_data_fd, int write_data_fd, 
-               int read_status_fd, int write_status_fd );
-
-/* listens on the 'data_to_child' fd and wait for incoming data */
-void prefork_child_wait( prefork_child* child );
-
-int prefork_free( prefork_simple* );
-int prefork_child_free( prefork_child* );
-
-
-void osrf_prefork_register_routers( char* appname );
-
-void osrf_prefork_child_exit( prefork_child* );
diff --git a/OpenSRF/src/libstack/osrf_settings.c b/OpenSRF/src/libstack/osrf_settings.c
deleted file mode 100644 (file)
index fa8d98e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "osrf_settings.h" 
-
-osrf_host_config* config = NULL;
-
-char* osrf_settings_host_value(char* format, ...) {
-       VA_LIST_TO_STRING(format);
-       jsonObject* o = jsonObjectFindPath(config->config, VA_BUF);
-       char* val = jsonObjectToSimpleString(o);
-       jsonObjectFree(o);
-       return val;
-}
-
-jsonObject* osrf_settings_host_value_object(char* format, ...) {
-       VA_LIST_TO_STRING(format);
-
-       if( ! config ) {
-               const char * msg = "config pointer is NULL";
-               fprintf( stderr, "osrf_settings_host_value_object: %s\n", msg );
-               osrfLogError( OSRF_LOG_MARK, msg );
-               exit( 99 );
-       }
-
-       return jsonObjectFindPath(config->config, VA_BUF);
-}
-
-
-int osrf_settings_retrieve(char* hostname) {
-
-       if(!config) {
-
-               osrf_app_session* session = osrf_app_client_session_init("opensrf.settings");
-               jsonObject* params = jsonNewObject(NULL);
-               jsonObjectPush(params, jsonNewObject(hostname));
-               int req_id = osrf_app_session_make_req( 
-                       session, params, "opensrf.settings.host_config.get", 1, NULL );
-               osrf_message* omsg = osrf_app_session_request_recv( session, req_id, 60 );
-               jsonObjectFree(params);
-
-               if(omsg && omsg->_result_content) {
-                       config = osrf_settings_new_host_config(hostname);
-                       config->config = jsonObjectClone(omsg->_result_content);
-                       osrf_message_free(omsg);
-               }
-
-               osrf_app_session_request_finish( session, req_id );
-               osrf_app_session_destroy( session );
-
-               if(!config) {
-                       osrfLogError( OSRF_LOG_MARK, "Unable to load config for host %s", hostname);
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-osrf_host_config* osrf_settings_new_host_config(char* hostname) {
-       if(!hostname) return NULL;
-       osrf_host_config* c = safe_malloc(sizeof(osrf_host_config));
-       c->hostname = strdup(hostname);
-       return c;
-}
-
-void osrf_settings_free_host_config(osrf_host_config* c) {
-       if(!c) c = config;
-       if(!c) return;
-       free(c->hostname);
-       jsonObjectFree(c->config);      
-       free(c);
-}
diff --git a/OpenSRF/src/libstack/osrf_settings.h b/OpenSRF/src/libstack/osrf_settings.h
deleted file mode 100644 (file)
index 6313490..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef OSRF_SETTINGS_H
-#define OSRF_SETTINGS_H
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <stdarg.h>
-
-#include "opensrf/log.h"
-#include "opensrf/utils.h"
-#include "osrf_json.h"
-#include "osrf_app_session.h"
-
-
-typedef struct { 
-       char* hostname; 
-       jsonObject* config; 
-} osrf_host_config;
-
-
-osrf_host_config* osrf_settings_new_host_config(char* hostname);
-void osrf_settings_free_host_config(osrf_host_config*);
-char* osrf_settings_host_value(char* path, ...);
-jsonObject* osrf_settings_host_value_object(char* format, ...);
-int osrf_settings_retrieve(char* hostname);
-
-#endif
-
diff --git a/OpenSRF/src/libstack/osrf_stack.c b/OpenSRF/src/libstack/osrf_stack.c
deleted file mode 100644 (file)
index fe59c92..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-#include "osrf_stack.h"
-#include "osrf_application.h"
-
-osrf_message* _do_client( osrf_app_session*, osrf_message* );
-osrf_message* _do_server( osrf_app_session*, osrf_message* );
-
-/* tell osrf_app_session where the stack entry is */
-int (*osrf_stack_entry_point) (transport_client*, int, int*)  = &osrf_stack_process;
-
-int osrf_stack_process( transport_client* client, int timeout, int* msg_received ) {
-       if( !client ) return -1;
-       transport_message* msg = NULL;
-       if(msg_received) *msg_received = 0;
-
-       while( (msg = client_recv( client, timeout )) ) {
-               if(msg_received) *msg_received = 1;
-               osrfLogDebug( OSRF_LOG_MARK,  "Received message from transport code from %s", msg->sender );
-               osrf_stack_transport_handler( msg, NULL );
-               timeout = 0;
-       }
-
-       if( client->error ) {
-               osrfLogWarning(OSRF_LOG_MARK, "transport_client had trouble reading from the socket..");
-               return -1;
-       }
-
-       if( ! client_connected( client ) ) return -1;
-
-       return 0;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// Entry point into the stack
-// -----------------------------------------------------------------------------
-osrfAppSession* osrf_stack_transport_handler( transport_message* msg, char* my_service ) { 
-
-       if(!msg) return NULL;
-
-   osrfLogSetXid(msg->osrf_xid);
-
-       osrfLogDebug( OSRF_LOG_MARK,  "Transport handler received new message \nfrom %s "
-                       "to %s with body \n\n%s\n", msg->sender, msg->recipient, msg->body );
-
-       if( msg->is_error && ! msg->thread ) {
-               osrfLogWarning( OSRF_LOG_MARK, "!! Received jabber layer error for %s ... exiting\n", msg->sender );
-               message_free( msg );
-               return NULL;
-       }
-
-       if(! msg->thread  && ! msg->is_error ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Received a non-error message with no thread trace... dropping");
-               message_free( msg );
-               return NULL;
-       }
-
-       osrf_app_session* session = osrf_app_session_find_session( msg->thread );
-
-       if( !session && my_service ) 
-               session = osrf_app_server_session_init( msg->thread, my_service, msg->sender);
-
-       if( !session ) return NULL;
-
-       if(!msg->is_error)
-               osrfLogDebug( OSRF_LOG_MARK, "Session [%s] found or built", session->session_id );
-
-       osrf_app_session_set_remote( session, msg->sender );
-       osrf_message* arr[OSRF_MAX_MSGS_PER_PACKET];
-       memset(arr, 0, OSRF_MAX_MSGS_PER_PACKET );
-       int num_msgs = osrf_message_deserialize(msg->body, arr, OSRF_MAX_MSGS_PER_PACKET);
-
-       osrfLogDebug( OSRF_LOG_MARK,  "We received %d messages from %s", num_msgs, msg->sender );
-
-       double starttime = get_timestamp_millis();
-
-       int i;
-       for( i = 0; i != num_msgs; i++ ) {
-
-               /* if we've received a jabber layer error message (probably talking to 
-                       someone who no longer exists) and we're not talking to the original
-                       remote id for this server, consider it a redirect and pass it up */
-               if(msg->is_error) {
-                       osrfLogWarning( OSRF_LOG_MARK,  " !!! Received Jabber layer error message" ); 
-
-                       if(strcmp(session->remote_id,session->orig_remote_id)) {
-                               osrfLogWarning( OSRF_LOG_MARK,  "Treating jabber error as redirect for tt [%d] "
-                                       "and session [%s]", arr[i]->thread_trace, session->session_id );
-
-                               arr[i]->m_type = STATUS;
-                               arr[i]->status_code = OSRF_STATUS_REDIRECTED;
-
-                       } else {
-                               osrfLogWarning( OSRF_LOG_MARK, " * Jabber Error is for top level remote id [%s], no one "
-                                               "to send my message too!!!", session->remote_id );
-                       }
-               }
-
-               osrf_stack_message_handler( session, arr[i] );
-       }
-
-       double duration = get_timestamp_millis() - starttime;
-       osrfLogInfo(OSRF_LOG_MARK, "Message processing duration %f", duration);
-
-       message_free( msg );
-       osrfLogDebug( OSRF_LOG_MARK, "after msg delete");
-
-       return session;
-}
-
-int osrf_stack_message_handler( osrf_app_session* session, osrf_message* msg ) {
-       if(session == NULL || msg == NULL)
-               return 0;
-
-       osrf_message* ret_msg = NULL;
-
-       if( session->type ==  OSRF_SESSION_CLIENT )
-                ret_msg = _do_client( session, msg );
-       else
-               ret_msg= _do_server( session, msg );
-
-       if(ret_msg) {
-               osrfLogDebug( OSRF_LOG_MARK, "passing message %d / session %s to app handler", 
-                               msg->thread_trace, session->session_id );
-               osrf_stack_application_handler( session, ret_msg );
-       } else
-               osrf_message_free(msg);
-
-       return 1;
-
-} 
-
-/** If we return a message, that message should be passed up the stack, 
-  * if we return NULL, we're finished for now...
-  */
-osrf_message* _do_client( osrf_app_session* session, osrf_message* msg ) {
-       if(session == NULL || msg == NULL)
-               return NULL;
-
-       osrf_message* new_msg;
-
-       if( msg->m_type == STATUS ) {
-               
-               switch( msg->status_code ) {
-
-                       case OSRF_STATUS_OK:
-                               osrfLogDebug( OSRF_LOG_MARK, "We connected successfully");
-                               session->state = OSRF_SESSION_CONNECTED;
-                               osrfLogDebug( OSRF_LOG_MARK,  "State: %x => %s => %d", session, session->session_id, session->state );
-                               return NULL;
-
-                       case OSRF_STATUS_COMPLETE:
-                               osrf_app_session_set_complete( session, msg->thread_trace );
-                               return NULL;
-
-                       case OSRF_STATUS_CONTINUE:
-                               osrf_app_session_request_reset_timeout( session, msg->thread_trace );
-                               return NULL;
-
-                       case OSRF_STATUS_REDIRECTED:
-                               osrf_app_session_reset_remote( session );
-                               session->state = OSRF_SESSION_DISCONNECTED;
-                               osrf_app_session_request_resend( session, msg->thread_trace );
-                               return NULL;
-
-                       case OSRF_STATUS_EXPFAILED: 
-                               osrf_app_session_reset_remote( session );
-                               session->state = OSRF_SESSION_DISCONNECTED;
-                               return NULL;
-
-                       case OSRF_STATUS_TIMEOUT:
-                               osrf_app_session_reset_remote( session );
-                               session->state = OSRF_SESSION_DISCONNECTED;
-                               osrf_app_session_request_resend( session, msg->thread_trace );
-                               return NULL;
-
-
-                       default:
-                               new_msg = osrf_message_init( RESULT, msg->thread_trace, msg->protocol );
-                               osrf_message_set_status_info( new_msg, 
-                                               msg->status_name, msg->status_text, msg->status_code );
-                               osrfLogWarning( OSRF_LOG_MARK, "The stack doesn't know what to do with " 
-                                               "the provided message code: %d, name %s. Passing UP.", 
-                                               msg->status_code, msg->status_name );
-                               new_msg->is_exception = 1;
-                               osrf_app_session_set_complete( session, msg->thread_trace );
-                               osrf_message_free(msg);
-                               return new_msg;
-               }
-
-               return NULL;
-
-       } else if( msg->m_type == RESULT ) 
-               return msg;
-
-       return NULL;
-
-}
-
-
-/** If we return a message, that message should be passed up the stack, 
-  * if we return NULL, we're finished for now...
-  */
-osrf_message* _do_server( osrf_app_session* session, osrf_message* msg ) {
-
-       if(session == NULL || msg == NULL) return NULL;
-
-       osrfLogDebug( OSRF_LOG_MARK, "Server received message of type %d", msg->m_type );
-
-       switch( msg->m_type ) {
-
-               case STATUS:
-                               return NULL;
-
-               case DISCONNECT:
-                               /* session will be freed by the forker */
-                               osrfLogDebug(OSRF_LOG_MARK, "Client sent explicit disconnect");
-                               session->state = OSRF_SESSION_DISCONNECTED;
-                               return NULL;
-
-               case CONNECT:
-                               osrfAppSessionStatus( session, OSRF_STATUS_OK, 
-                                               "osrfConnectStatus", msg->thread_trace, "Connection Successful" );
-                               session->state = OSRF_SESSION_CONNECTED;
-                               return NULL;
-
-               case REQUEST:
-
-                               osrfLogDebug( OSRF_LOG_MARK, "server passing message %d to application handler "
-                                               "for session %s", msg->thread_trace, session->session_id );
-                               return msg;
-
-               default:
-                       osrfLogWarning( OSRF_LOG_MARK, "Server cannot handle message of type %d", msg->m_type );
-                       session->state = OSRF_SESSION_DISCONNECTED;
-                       return NULL;
-
-       }
-}
-
-
-
-int osrf_stack_application_handler( osrf_app_session* session, osrf_message* msg ) {
-       if(session == NULL || msg == NULL) return 0;
-
-       if(msg->m_type == RESULT && session->type == OSRF_SESSION_CLIENT) {
-               osrf_app_session_push_queue( session, msg ); 
-               return 1;
-       }
-
-       if(msg->m_type != REQUEST) return 1;
-
-       char* method = msg->method_name;
-       char* app       = session->remote_service;
-       jsonObject* params = msg->_params;
-
-       osrfAppRunMethod( app, method,  session, msg->thread_trace, params );
-       osrfMessageFree(msg);
-               
-       return 1;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_stack.h b/OpenSRF/src/libstack/osrf_stack.h
deleted file mode 100644 (file)
index 0ef6d00..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "opensrf/transport_client.h"
-#include "osrf_message.h"
-#include "osrf_app_session.h"
-
-#ifndef OSRF_STACK_H
-#define OSRF_STACK_H
-
-/* the max number of oilsMessage blobs present in any one root packet */
-#define OSRF_MAX_MSGS_PER_PACKET 256
-// -----------------------------------------------------------------------------
-
-int osrf_stack_process( transport_client* client, int timeout, int* msg_received );
-osrfAppSession*  osrf_stack_transport_handler( transport_message* msg, char* my_service );
-int osrf_stack_message_handler( osrf_app_session* session, osrf_message* msg );
-int osrf_stack_application_handler( osrf_app_session* session, osrf_message* msg );
-
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_system.c b/OpenSRF/src/libstack/osrf_system.c
deleted file mode 100644 (file)
index 68f2e3c..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-#include "osrf_system.h"
-#include <signal.h>
-#include "osrf_application.h"
-#include "osrf_prefork.h"
-
-void __osrfSystemSignalHandler( int sig );
-
-transport_client* __osrfGlobalTransportClient = NULL;
-
-transport_client* osrfSystemGetTransportClient() {
-       return __osrfGlobalTransportClient;
-}
-
-void osrfSystemIgnoreTransportClient() {
-       __osrfGlobalTransportClient = NULL;
-}
-
-transport_client* osrf_system_get_transport_client() {
-       return __osrfGlobalTransportClient;
-}
-
-int osrf_system_bootstrap_client( char* config_file, char* contextnode ) {
-       return osrf_system_bootstrap_client_resc(config_file, contextnode, NULL);
-}
-
-int osrfSystemBootstrapClientResc( char* config_file, char* contextnode, char* resource ) {
-       return osrf_system_bootstrap_client_resc( config_file, contextnode, resource );
-}
-
-
-int _osrfSystemInitCache() {
-
-       jsonObject* cacheServers = osrf_settings_host_value_object("/cache/global/servers/server");
-       char* maxCache = osrf_settings_host_value("/cache/global/max_cache_time");
-
-       if( cacheServers && maxCache) {
-
-               if( cacheServers->type == JSON_ARRAY ) {
-                       int i;
-                       char* servers[cacheServers->size];
-                       for( i = 0; i != cacheServers->size; i++ ) {
-                               servers[i] = jsonObjectGetString( jsonObjectGetIndex(cacheServers, i) );
-                               osrfLogInfo( OSRF_LOG_MARK, "Adding cache server %s", servers[i]);
-                       }
-                       osrfCacheInit( servers, cacheServers->size, atoi(maxCache) );
-
-               } else {
-                       char* servers[] = { jsonObjectGetString(cacheServers) };                
-                       osrfLogInfo( OSRF_LOG_MARK, "Adding cache server %s", servers[0]);
-                       osrfCacheInit( servers, 1, atoi(maxCache) );
-               }
-
-       } else {
-               osrfLogError( OSRF_LOG_MARK,  "Missing config value for /cache/global/servers/server _or_ "
-                       "/cache/global/max_cache_time");
-       }
-
-       return 0;
-}
-
-
-int osrfSystemBootstrap( char* hostname, char* configfile, char* contextNode ) {
-       if( !(hostname && configfile && contextNode) ) return -1;
-
-       /* first we grab the settings */
-       if(!osrfSystemBootstrapClientResc(configfile, contextNode, "settings_grabber" )) {
-               osrfLogError( OSRF_LOG_MARK, "Unable to bootstrap");
-               return -1;
-       }
-
-       osrf_settings_retrieve(hostname);
-       osrf_system_disconnect_client();
-
-       jsonObject* apps = osrf_settings_host_value_object("/activeapps/appname");
-       osrfStringArray* arr = osrfNewStringArray(8);
-       
-       _osrfSystemInitCache();
-
-       if(apps) {
-               int i = 0;
-
-               if(apps->type == JSON_STRING) {
-                       osrfStringArrayAdd(arr, jsonObjectGetString(apps));
-
-               } else {
-                       jsonObject* app;
-                       while( (app = jsonObjectGetIndex(apps, i++)) ) 
-                               osrfStringArrayAdd(arr, jsonObjectGetString(app));
-               }
-
-               char* appname = NULL;
-               i = 0;
-               while( (appname = osrfStringArrayGetString(arr, i++)) ) {
-
-                       char* lang = osrf_settings_host_value("/apps/%s/language", appname);
-
-                       if(lang && !strcasecmp(lang,"c"))  {
-
-                               char* libfile = osrf_settings_host_value("/apps/%s/implementation", appname);
-               
-                               if(! (appname && libfile) ) {
-                                       osrfLogWarning( OSRF_LOG_MARK, "Missing appname / libfile in settings config");
-                                       continue;
-                               }
-
-                               osrfLogInfo( OSRF_LOG_MARK, "Launching application %s with implementation %s", appname, libfile);
-               
-                               int pid;
-               
-                               if( (pid = fork()) ) { 
-                                       // storage pid in local table for re-launching dead children...
-                                       osrfLogInfo( OSRF_LOG_MARK, "Launched application child %d", pid);
-       
-                               } else {
-               
-                                       fprintf(stderr, " * Running application %s\n", appname);
-                                       if( osrfAppRegisterApplication( appname, libfile ) == 0 ) 
-                                               osrf_prefork_run(appname);
-       
-                                       osrfLogDebug( OSRF_LOG_MARK, "Server exiting for app %s and library %s", appname, libfile );
-                                       exit(0);
-                               }
-                       } // language == c
-               } 
-       }
-
-       /** daemonize me **/
-
-       /* background and let our children do their thing */
-       daemonize();
-       while(1) {
-               signal(SIGCHLD, __osrfSystemSignalHandler);
-               sleep(10000);
-       }
-       
-       return 0;
-}
-
-int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, char* resource ) {
-
-       if(osrfSystemGetTransportClient()) {
-               osrfLogInfo(OSRF_LOG_MARK, "Client is already bootstrapped");
-               return 1; /* we already have a client connection */
-       }
-
-       if( !( config_file && contextnode ) && ! osrfConfigHasDefaultConfig() ) {
-               osrfLogError( OSRF_LOG_MARK, "No Config File Specified\n" );
-               return -1;
-       }
-
-       if( config_file ) {
-               osrfConfigCleanup();
-               osrfConfig* cfg = osrfConfigInit( config_file, contextnode );
-               osrfConfigSetDefaultConfig(cfg);
-       }
-
-
-       char* log_file          = osrfConfigGetValue( NULL, "/logfile");
-       char* log_level = osrfConfigGetValue( NULL, "/loglevel" );
-       osrfStringArray* arr = osrfNewStringArray(8);
-       osrfConfigGetValueList(NULL, arr, "/domains/domain");
-       char* username          = osrfConfigGetValue( NULL, "/username" );
-       char* password          = osrfConfigGetValue( NULL, "/passwd" );
-       char* port                      = osrfConfigGetValue( NULL, "/port" );
-       char* unixpath          = osrfConfigGetValue( NULL, "/unixpath" );
-       char* facility          = osrfConfigGetValue( NULL, "/syslog" );
-       char* actlog            = osrfConfigGetValue( NULL, "/actlog" );
-
-       char* domain = strdup(osrfStringArrayGetString( arr, 0 )); /* just the first for now */
-       osrfStringArrayFree(arr);
-
-   /* if we're a source-client, tell the logger */
-   char* isclient = osrfConfigGetValue(NULL, "/client");
-   if( isclient && !strcasecmp(isclient,"true") )
-      osrfLogSetIsClient(1);
-   free(isclient);
-
-       int llevel = 0;
-       int iport = 0;
-       if(port) iport = atoi(port);
-       if(log_level) llevel = atoi(log_level);
-
-       if(!log_file) { fprintf(stderr, "Log file needed\n"); return -1; }
-
-       if(!strcmp(log_file, "syslog")) {
-               osrfLogInit( OSRF_LOG_TYPE_SYSLOG, contextnode, llevel );
-               osrfLogSetSyslogFacility(osrfLogFacilityToInt(facility));
-               if(actlog) osrfLogSetSyslogActFacility(osrfLogFacilityToInt(actlog));
-
-       } else {
-               osrfLogInit( OSRF_LOG_TYPE_FILE, contextnode, llevel );
-               osrfLogSetFile( log_file );
-       }
-
-       osrfLogInfo( OSRF_LOG_MARK, "Bootstrapping system with domain %s, port %d, and unixpath %s", domain, iport, unixpath );
-
-       transport_client* client = client_init( domain, iport, unixpath, 0 );
-
-       char* host;
-       host = getenv("HOSTNAME");
-
-       char tbuf[32];
-       memset(tbuf, 0x0, 32);
-       snprintf(tbuf, 32, "%f", get_timestamp_millis());
-
-       if(!host) host = "";
-       if(!resource) resource = "";
-
-       int len = strlen(resource) + 256;
-       char buf[len];
-       memset(buf,0,len);
-       snprintf(buf, len - 1, "%s_%s_%s_%d", resource, host, tbuf, getpid() );
-       
-       if(client_connect( client, username, password, buf, 10, AUTH_DIGEST )) {
-               /* child nodes will leak the parents client... but we can't free
-                       it without disconnecting the parents client :( */
-               __osrfGlobalTransportClient = client;
-       }
-
-       free(actlog);
-       free(facility);
-       free(log_level);
-       free(log_file);
-       free(username);
-       free(password);
-       free(port);     
-       free(unixpath);
-       free(domain);
-
-       if(__osrfGlobalTransportClient)
-               return 1;
-
-       return 0;
-}
-
-int osrf_system_disconnect_client() {
-       client_disconnect( __osrfGlobalTransportClient );
-       client_free( __osrfGlobalTransportClient );
-       __osrfGlobalTransportClient = NULL;
-       return 0;
-}
-
-int osrf_system_shutdown() {
-       osrfConfigCleanup();
-       osrf_system_disconnect_client();
-       osrf_settings_free_host_config(NULL);
-       osrfAppSessionCleanup();
-       osrfLogCleanup();
-       return 1;
-}
-
-
-
-
-void __osrfSystemSignalHandler( int sig ) {
-
-       pid_t pid;
-       int status;
-
-       while( (pid = waitpid(-1, &status, WNOHANG)) > 0) {
-               osrfLogWarning( OSRF_LOG_MARK, "We lost child %d", pid);
-       }
-
-       /** relaunch the server **/
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_system.h b/OpenSRF/src/libstack/osrf_system.h
deleted file mode 100644 (file)
index bc2e456..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef OSRF_SYSTEM_H
-#define OSRF_SYSTEM_H
-
-#include "opensrf/transport_client.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "osrf_settings.h"
-#include "osrfConfig.h"
-#include "osrf_cache.h"
-
-
-
-/** Connects to jabber.  Returns 1 on success, 0 on failure 
-       contextnode is the location in the config file where we collect config info
-*/
-
-
-int osrf_system_bootstrap_client( char* config_file, char* contextnode );
-
-/* bootstraps a client adding the given resource string to the host/pid, etc. resource string */
-/**
-  Sets up the global connection.
-  @param configFile The OpenSRF bootstrap config file
-  @param contextNode The location in the config file where we'll find the necessary info
-  @param resource The login resource.  If NULL a default will be created
-  @return 1 on successs, 0 on failure.
-  */
-int osrfSystemBootstrapClientResc( char* configFile, char* contextNode, char* resource );
-int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, char* resource );
-
-/**
-  Bootstrap the server.
-  @param hostname The name of this host.  This is the name that will be used to 
-       load the settings.
-  @param configfile The OpenSRF bootstrap config file
-  @param contextnode The config context
-  @return 0 on success, -1 on error
-  */
-int osrfSystemBootstrap( char* hostName, char* configfile, char* contextNode );
-
-transport_client* osrfSystemGetTransportClient();
-transport_client* osrf_system_get_transport_client();
-
-/* disconnects and destroys the current client connection */
-int osrf_system_disconnect_client();
-int osrf_system_shutdown(); 
-
-int _osrfSystemInitCache();
-
-
-/* this will clear the global transport client pointer without
- * actually destroying the socket.  this is useful for allowing
- * children to have their own socket, even though their parent
- * already created a socket
- */
-void osrfSystemIgnoreTransportClient();
-
-
-#endif
diff --git a/OpenSRF/src/libstack/osrf_transgroup.c b/OpenSRF/src/libstack/osrf_transgroup.c
deleted file mode 100644 (file)
index 1d3d3f4..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-#include "osrf_transgroup.h"
-#include <sys/select.h>
-
-
-osrfTransportGroupNode* osrfNewTransportGroupNode( 
-               char* domain, int port, char* username, char* password, char* resource ) {
-
-       if(!(domain && port && username && password && resource)) return NULL;
-
-       osrfTransportGroupNode* node = safe_malloc(sizeof(osrfTransportGroupNode));
-       node->domain    = strdup(domain);
-       node->port              = port;
-       node->username = strdup(username);
-       node->password = strdup(password);
-       node->domain    = strdup(domain);
-       node->resource  = strdup(resource);
-       node->active    = 0;
-       node->lastsent  = 0;
-       node->connection = client_init( domain, port, NULL, 0 );
-
-       return node;
-}
-
-
-osrfTransportGroup* osrfNewTransportGroup( osrfTransportGroupNode* nodes[], int count ) {
-       if(!nodes || count < 1) return NULL;
-
-       osrfTransportGroup* grp = safe_malloc(sizeof(osrfTransportGroup));
-       grp->nodes                                      = osrfNewHash();
-       grp->itr                                                = osrfNewHashIterator(grp->nodes);
-
-       int i;
-       for( i = 0; i != count; i++ ) {
-               if(!(nodes[i] && nodes[i]->domain) ) return NULL;
-               osrfHashSet( grp->nodes, nodes[i], nodes[i]->domain );
-               osrfLogDebug( OSRF_LOG_MARK, "Adding domain %s to TransportGroup", nodes[i]->domain);
-       }
-
-       return grp;
-}
-
-
-/* connect all of the nodes to their servers */
-int osrfTransportGroupConnectAll( osrfTransportGroup* grp ) {
-       if(!grp) return -1;
-       int active = 0;
-
-       osrfTransportGroupNode* node;
-       osrfHashIteratorReset(grp->itr);
-
-       while( (node = osrfHashIteratorNext(grp->itr)) ) {
-               osrfLogInfo( OSRF_LOG_MARK, "TransportGroup attempting to connect to domain %s", 
-                                                        node->connection->session->server);
-
-               if(client_connect( node->connection, node->username, 
-                                       node->password, node->resource, 10, AUTH_DIGEST )) {
-                       node->active = 1;
-                       active++;
-                       osrfLogInfo( OSRF_LOG_MARK, "TransportGroup successfully connected to domain %s", 
-                                                        node->connection->session->server);
-               } else {
-                       osrfLogWarning( OSRF_LOG_MARK, "TransportGroup unable to connect to domain %s", 
-                                                        node->connection->session->server);
-               }
-       }
-
-       osrfHashIteratorReset(grp->itr);
-       return active;
-}
-
-void osrfTransportGroupDisconnectAll( osrfTransportGroup* grp ) {
-       if(!grp) return;
-
-       osrfTransportGroupNode* node;
-       osrfHashIteratorReset(grp->itr);
-
-       while( (node = osrfHashIteratorNext(grp->itr)) ) {
-               osrfLogInfo( OSRF_LOG_MARK, "TransportGroup disconnecting from domain %s", 
-                                                        node->connection->session->server);
-               client_disconnect(node->connection);
-               node->active = 0;
-       }
-
-       osrfHashIteratorReset(grp->itr);
-}
-
-
-int osrfTransportGroupSendMatch( osrfTransportGroup* grp, transport_message* msg ) {
-       if(!(grp && msg)) return -1;
-
-       char domain[256];
-       bzero(domain, 256);
-       jid_get_domain( msg->recipient, domain, 255 );
-
-       osrfTransportGroupNode* node = osrfHashGet(grp->nodes, domain);
-       if(node) {
-               if( (client_send_message( node->connection, msg )) == 0 )
-                       return 0;
-       }
-
-       osrfLogWarning( OSRF_LOG_MARK, "Error sending message to domain %s", domain );
-       return -1;
-}
-
-int osrfTransportGroupSend( osrfTransportGroup* grp, transport_message* msg ) {
-
-       if(!(grp && msg)) return -1;
-       int bufsize = 256;
-
-       char domain[bufsize];
-       bzero(domain, bufsize);
-       jid_get_domain( msg->recipient, domain, bufsize - 1 );
-
-       char msgrecip[bufsize];
-       bzero(msgrecip, bufsize);
-       jid_get_username(msg->recipient, msgrecip, bufsize - 1);
-
-       char msgres[bufsize];
-       bzero(msgres, bufsize);
-       jid_get_resource(msg->recipient, msgres, bufsize - 1);
-
-       char* firstdomain = NULL;
-       char newrcp[1024];
-
-       int updateRecip = 1;
-       /* if we don't host this domain, don't update the recipient but send it as is */
-       if(!osrfHashGet(grp->nodes, domain)) updateRecip = 0;
-
-       osrfTransportGroupNode* node;
-
-       do {
-
-               node = osrfHashIteratorNext(grp->itr);
-               if(!node) osrfHashIteratorReset(grp->itr);
-
-               node = osrfHashIteratorNext(grp->itr);
-               if(!node) return -1;
-
-               if(firstdomain == NULL) {
-                       firstdomain = node->domain;
-
-               } else {
-                       if(!strcmp(firstdomain, node->domain)) { /* we've made a full loop */
-                               osrfLogWarning( OSRF_LOG_MARK, "We've tried to send to all domains.. giving up");
-                               return -1;
-                       }
-               }
-
-               /* update the recipient domain if necessary */
-
-               if(updateRecip) {
-                       bzero(newrcp, 1024);
-                       sprintf(newrcp, "%s@%s/%s", msgrecip, node->domain, msgres);
-                       free(msg->recipient);
-                       msg->recipient = strdup(newrcp);
-               }
-
-               if( (client_send_message( node->connection, msg )) == 0 ) 
-                       return 0;
-
-       } while(1);
-
-       return -1;
-}
-
-static int __osrfTGWait( fd_set* fdset, int maxfd, int timeout ) {
-       if(!(fdset && maxfd)) return 0;
-
-       struct timeval tv;
-       tv.tv_sec = timeout;
-       tv.tv_usec = 0;
-       int retval = 0;
-
-       if( timeout < 0 ) {
-               if( (retval = select( maxfd + 1, fdset, NULL, NULL, NULL)) == -1 ) 
-                       return 0;
-
-       } else {
-               if( (retval = select( maxfd + 1, fdset, NULL, NULL, &tv)) == -1 ) 
-                       return 0;
-       }
-
-       return retval;
-}
-
-
-transport_message* osrfTransportGroupRecvAll( osrfTransportGroup* grp, int timeout ) {
-       if(!grp) return NULL;
-
-       int maxfd = 0;
-       fd_set fdset;
-       FD_ZERO( &fdset );
-
-       osrfTransportGroupNode* node;
-       osrfHashIterator* itr = osrfNewHashIterator(grp->nodes);
-
-       while( (node = osrfHashIteratorNext(itr)) ) {
-               if(node->active) {
-                       int fd = node->connection->session->sock_id;
-                       if( fd < maxfd ) maxfd = fd;
-                       FD_SET( fd, &fdset );
-               }
-       }
-       osrfHashIteratorReset(itr);
-
-       if( __osrfTGWait( &fdset, maxfd, timeout ) ) {
-               while( (node = osrfHashIteratorNext(itr)) ) {
-                       if(node->active) {
-                               int fd = node->connection->session->sock_id;
-                               if( FD_ISSET( fd, &fdset ) ) {
-                                       return client_recv( node->connection, 0 );
-                               }
-                       }
-               }
-       }
-
-       osrfHashIteratorFree(itr);
-       return NULL;
-}
-
-transport_message* osrfTransportGroupRecv( osrfTransportGroup* grp, char* domain, int timeout ) {
-       if(!(grp && domain)) return NULL;
-
-       osrfTransportGroupNode* node = osrfHashGet(grp->nodes, domain);
-       if(!node && node->connection && node->connection->session) return NULL;
-       int fd = node->connection->session->sock_id;
-
-       fd_set fdset;
-       FD_ZERO( &fdset );
-       FD_SET( fd, &fdset );
-
-       int active = __osrfTGWait( &fdset, fd, timeout );
-       if(active) return client_recv( node->connection, 0 );
-       
-       return NULL;
-}
-
-void osrfTransportGroupSetInactive( osrfTransportGroup* grp, char* domain ) {
-       if(!(grp && domain)) return;
-       osrfTransportGroupNode* node = osrfHashGet(grp->nodes, domain );
-       if(node) node->active = 0;
-}
-
-
diff --git a/OpenSRF/src/libstack/osrf_transgroup.h b/OpenSRF/src/libstack/osrf_transgroup.h
deleted file mode 100644 (file)
index 57ee1be..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#include "opensrf/transport_client.h"
-#include "opensrf/transport_message.h"
-#include "osrf_list.h"
-#include "osrf_hash.h"
-#include "osrfConfig.h"
-#include "opensrf/utils.h"
-#include <time.h>
-
-/**
-  Maintains a set of transport clients 
-  */
-
-struct __osrfTransportGroupStruct {
-       osrfHash* nodes;                                                /* our hash of nodes keyed by domain */
-       osrfHashIterator* itr;                          /* points to the next node in the list */
-};
-typedef struct __osrfTransportGroupStruct osrfTransportGroup;
-
-
-struct __osrfTransportGroupNode {
-       transport_client* connection;           /* our connection to the network */
-       char* domain;                                                   /* the domain we're connected to */
-       char* username;                                         /* username used to connect to the group of servers */
-       char* password;                                         /* password used to connect to the group of servers */
-       char* resource;                                         /* the login resource */
-       int port;                                                               /* port used to connect to the group of servers */
-
-       int active;                                                             /* true if we're able to send data on this connection */
-       time_t lastsent;                                                /* the last time we sent a message */
-};
-typedef struct __osrfTransportGroupNode osrfTransportGroupNode;
-
-
-/**
-  Creates a new group node
-  @param domain The domain we're connecting to
-  @param port The port to connect on
-  @param username The login name
-  @param password The login password
-  @param resource The login resource
-  @return A new transport group node
-  */
-osrfTransportGroupNode* osrfNewTransportGroupNode( 
-               char* domain, int port, char* username, char* password, char* resource );
-
-
-/**
-  Allocates and initializes a new transport group.
-  The first node in the array is the default node for client connections.
-  @param nodes The nodes in the group.
-  */
-osrfTransportGroup* osrfNewTransportGroup( osrfTransportGroupNode* nodes[], int count );
-
-/**
-  Attempts to connect all of the nodes in this group.
-  @param grp The transport group
-  @return The number of nodes successfully connected
-  */
-int osrfTransportGroupConnectAll( osrfTransportGroup* grp );
-
-void osrfTransportGroupDisconnectAll( osrfTransportGroup* grp );
-
-
-/**
-  Sends a transport message by going to the next domain in the set.
-  if we have a connection for the recipient domain, then we consider it to be
-  a 'local' message.  Local messages have their recipient domains re-written to
-  match the domain of the next server in the set and they are sent directly to 
-  that server.  If we do not have a connection for the recipient domain, it is 
-  considered a 'remote' message and the message is sent directly (unchanged)
-  to the next connection in the set.
-
-  @param grp The transport group
-  @param msg The message to send 
-  @return 0 on normal successful send.  
-  Returns -1 if the message cannot be sent.  
-  */
-int osrfTransportGroupSend( osrfTransportGroup* grp, transport_message* msg );
-
-/**
-  Sends the message to the exact recipient.  No failover is attempted.
-  @return 0 on success, -1 on error.
-  */
-int osrfTransportGroupSendMatch( osrfTransportGroup* grp, transport_message* msg );
-
-
-int _osrfTGServerSend( osrfTransportGroup* grp, char* domain, transport_message* msg );
-int _osrfTGClientSend( osrfTransportGroup* grp, char* domain, transport_message* msg );
-
-/**
-  Waits on all connections for inbound data.
-  @param grp The transport group
-  @param timeout How long to wait for data.  0 means check for data
-  but don't wait, a negative number means to wait indefinitely
-  @return The received message or NULL if the timeout occurred before a 
-  message was received 
- */
-transport_message* osrfTransportGroupRecvAll( osrfTransportGroup* grp, int timeout );
-
-/**
-  Waits for data from a single domain
-  @param grp The transport group
-  @param domain The domain to wait for data on
-  @param timeout see osrfTransportGroupRecvAll
-  */
-transport_message* osrfTransportGroupRecv( osrfTransportGroup* grp, char* domain, int timeout );
-
-/**
-  Tells the group that a message to the given domain failed
-  domain did not make it through;
-  @param grp The transport group
-  @param comain The failed domain
-  */
-void osrfTransportGroupSetInactive( osrfTransportGroup* grp, char* domain );
-
-
-/**
-  Finds a node in our list of nodes 
-  */
-osrfTransportGroupNode* __osrfTransportGroupFindNode( osrfTransportGroup* grp, char* domain );
-
-
diff --git a/OpenSRF/src/libtransport/Makefile b/OpenSRF/src/libtransport/Makefile
deleted file mode 100644 (file)
index 103ecc9..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-TARGETS        = transport_message.o transport_session.o transport_client.o 
-HEADERS        = transport_message.h transport_session.h transport_client.h 
-CFLAGS += -I ../libstack -I ../utils
-
-TARGET = libopensrf_transport.so
-
-all:   $(TARGETS) copy
-
-copy:
-       cp $(HEADERS) $(TMPDIR)
-
-transport_session.o:   transport_session.c transport_session.h
-transport_message.o:   transport_message.c transport_message.h
-transport_client.o:    transport_client.c transport_client.h
-
-
-clean:
-       /bin/rm -f *.o 
diff --git a/OpenSRF/src/libtransport/basic_client.c b/OpenSRF/src/libtransport/basic_client.c
deleted file mode 100644 (file)
index d2178eb..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#include "transport_client.h"
-#include "signal.h"
-
-pid_t pid;
-void sig_int( int sig ) {
-       fprintf(stderr, "Killing child %d\n", pid );
-       kill( pid, SIGKILL );
-}
-
-/* connects and registers with the router */
-int main( int argc, char** argv ) {
-
-       if( argc < 5 ) {
-               osrfLogError( OSRF_LOG_MARK, "Usage: %s <username> <host> <resource> <recipient> \n", argv[0] );
-               return 99;
-       }
-
-       transport_message* send;
-       transport_client* client = client_init( argv[2], 5222, 0 );
-
-       // try to connect, allow 15 second connect timeout 
-       if( client_connect( client, argv[1], "jkjkasdf", argv[3], 15, AUTH_DIGEST ) ) 
-               osrfLogInfo(OSRF_LOG_MARK, "Connected...\n");
-        else { 
-               osrfLogError( OSRF_LOG_MARK, "NOT Connected...\n" ); 
-               return -1;
-        }
-       
-       if( (pid=fork()) ) { /* parent */
-
-               signal(SIGINT, sig_int);
-               fprintf(stderr, "Listener: %d\n", getpid() );   
-               char buf[300];
-               memset(buf, 0, 300);
-               printf("=> ");
-
-               while( fgets( buf, 299, stdin) ) {
-
-                       // remove newline
-                       buf[strlen(buf)-1] = '\0';
-
-                       if( strcmp(buf, "exit")==0) { 
-                               client_free( client );  
-                               break; 
-                       }
-
-                       send = message_init( buf, "", "123454321", argv[4], NULL );
-                       client_send_message( client, send );
-                       message_free( send );
-                       printf("\n=> ");
-                       memset(buf, 0, 300);
-               }
-               fprintf(stderr, "Killing child %d\n", pid );
-               kill( pid, SIGKILL );
-               return 0;
-
-       } else {
-
-               fprintf(stderr, "Sender: %d\n", getpid() );     
-
-               transport_message* recv;
-               while( (recv=client_recv( client, -1)) ) {
-                       if( recv->is_error )
-                               fprintf( stderr, "\nReceived Error\t: ------------------\nFrom:\t\t"
-                                       "%s\nRouterFrom:\t%s\nBody:\t\t%s\nType %s\nCode %d\n=> ", 
-                                       recv->sender, recv->router_from, recv->body, recv->error_type, recv->error_code );
-                       else
-                               fprintf( stderr, "\nReceived\t: ------------------\nFrom:\t\t"
-                                       "%s\nRouterFrom:\t%s\nBody:\t\t%s\n=> ", recv->sender, recv->router_from, recv->body );
-
-                       message_free( recv );
-               }
-
-       }
-       return 0;
-
-}
-
-
-
-
diff --git a/OpenSRF/src/libtransport/component.c b/OpenSRF/src/libtransport/component.c
deleted file mode 100644 (file)
index 1f909d2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "transport_client.h"
-#include "signal.h"
-
-
-/*
-void print_stuff(void* blah, char* data) {
-       fprintf(stderr, "Received from socket: %s\n", data);
-}
-*/
-
-/* connects and registers with the router */
-int main( int argc, char** argv ) {
-
-
-
-       if( argc < 5 ) {
-               osrfLogError(OSRF_LOG_MARK,  "Usage: %s <server> <port> <name> <secret>", argv[0] );
-               return -1;
-       }
-
-       int port = atoi(argv[2]);
-       transport_client* client = client_init( argv[1], port, 1 );
-
-       // try to connect, allow 15 second connect timeout 
-       if( client_connect( client, argv[3], argv[4], "", 15, 1 ) ) 
-               osrfLogInfo(OSRF_LOG_MARK, "Connected...\n");
-        else  {
-               osrfLogError(OSRF_LOG_MARK,  "NOT Connected...\n" ); 
-               return -1;
-        }
-       
-       transport_message* recv;
-       while( (recv=client_recv( client, -1)) ) {
-               if( recv->is_error )
-                       fprintf( stderr, "\nReceived Error\t: ------------------\nFrom:\t\t"
-                               "%s\nRouterFrom:\t%s\nBody:\t\t%s\nType %s\nCode %d\n=> ", 
-                               recv->sender, recv->router_from, recv->body, recv->error_type, recv->error_code );
-               else
-                       fprintf( stderr, "\nReceived\t: ------------------\nFrom:\t\t"
-                               "%s\nRouterFrom:\t%s\nBody:\t\t%s\n=> ", recv->sender, recv->router_from, recv->body );
-               transport_message* send = message_init( "Hello...", "", "123454321", recv->sender, argv[3] );
-               client_send_message( client, send );
-               message_free( recv );
-               message_free( send );
-       }
-       return 0;
-
-}
-
-
-
-
diff --git a/OpenSRF/src/libtransport/transport_client.c b/OpenSRF/src/libtransport/transport_client.c
deleted file mode 100644 (file)
index 32e3920..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-#include "transport_client.h"
-
-
-//int main( int argc, char** argv );
-
-/*
-int main( int argc, char** argv ) {
-
-       transport_message* recv;
-       transport_message* send;
-
-       transport_client* client = client_init( "spacely.georgialibraries.org", 5222 );
-
-       // try to connect, allow 15 second connect timeout 
-       if( client_connect( client, "admin", "asdfjkjk", "system", 15 ) ) {
-               printf("Connected...\n");
-       } else { 
-               printf( "NOT Connected...\n" ); exit(99); 
-       }
-
-       while( (recv = client_recv( client, -1 )) ) {
-
-               if( recv->body ) {
-                       int len = strlen(recv->body);
-                       char buf[len + 20];
-                       memset( buf, 0, len + 20); 
-                       sprintf( buf, "Echoing...%s", recv->body );
-                       send = message_init( buf, "Echoing Stuff", "12345", recv->sender, "" );
-               } else {
-                       send = message_init( " * ECHOING * ", "Echoing Stuff", "12345", recv->sender, "" );
-               }
-
-               if( send == NULL ) { printf("something's wrong"); }
-               client_send_message( client, send );
-                               
-               message_free( send );
-               message_free( recv );
-       }
-
-       printf( "ended recv loop\n" );
-
-       return 0;
-
-}
-*/
-
-
-transport_client* client_init( char* server, int port, char* unix_path, int component ) {
-
-       if(server == NULL) return NULL;
-
-       /* build and clear the client object */
-       size_t c_size = sizeof( transport_client);
-       transport_client* client = (transport_client*) safe_malloc( c_size );
-
-       /* build and clear the message list */
-       size_t l_size = sizeof( transport_message_list );
-       client->m_list = (transport_message_list*) safe_malloc( l_size );
-
-       client->m_list->type = MESSAGE_LIST_HEAD;
-       client->session = init_transport( server, port, unix_path, client, component );
-
-       client->session->message_callback = client_message_handler;
-       client->error = 0;
-
-       return client;
-}
-
-
-int client_connect( transport_client* client, 
-               char* username, char* password, char* resource, 
-               int connect_timeout, enum TRANSPORT_AUTH_TYPE  auth_type ) {
-       if(client == NULL) return 0; 
-       return session_connect( client->session, username, 
-                       password, resource, connect_timeout, auth_type );
-}
-
-
-int client_disconnect( transport_client* client ) {
-       if( client == NULL ) { return 0; }
-       return session_disconnect( client->session );
-}
-
-int client_connected( transport_client* client ) {
-       if(client == NULL) return 0;
-       return client->session->state_machine->connected;
-}
-
-int client_send_message( transport_client* client, transport_message* msg ) {
-       if(client == NULL) return 0;
-       if( client->error ) return -1;
-       return session_send_msg( client->session, msg );
-}
-
-
-transport_message* client_recv( transport_client* client, int timeout ) {
-       if( client == NULL ) { return NULL; }
-
-       transport_message_node* node;
-       transport_message* msg;
-
-
-       /* see if there are any message in the messages queue */
-       if( client->m_list->next != NULL ) {
-               /* pop off the first one... */
-               node = client->m_list->next;
-               client->m_list->next = node->next;
-               msg = node->message;
-               free( node );
-               return msg;
-       }
-
-       if( timeout == -1 ) {  /* wait potentially forever for data to arrive */
-
-               while( client->m_list->next == NULL ) {
-               //      if( ! session_wait( client->session, -1 ) ) {
-                       int x;
-                       if( (x = session_wait( client->session, -1 )) ) {
-                               osrfLogDebug(OSRF_LOG_MARK, "session_wait returned failure code %d\n", x);
-                               client->error = 1;
-                               return NULL;
-                       }
-               }
-
-       } else { /* wait at most timeout seconds */
-
-       
-               /* if not, loop up to 'timeout' seconds waiting for data to arrive */
-               time_t start = time(NULL);      
-               time_t remaining = (time_t) timeout;
-
-               int counter = 0;
-
-               int wait_ret;
-               while( client->m_list->next == NULL && remaining >= 0 ) {
-
-                       if( (wait_ret= session_wait( client->session, remaining)) ) {
-                               client->error = 1;
-                               osrfLogDebug(OSRF_LOG_MARK, "session_wait returned failure code %d: setting error=1\n", wait_ret);
-                               return NULL;
-                       }
-
-                       ++counter;
-
-#ifdef _ROUTER
-                       // session_wait returns -1 if there is no more data and we're a router
-                       if( remaining == 0 ) { // && wait_ret == -1 ) {
-                               break;
-                       }
-#else
-                       if( remaining == 0 ) // or infinite loop
-                               break;
-#endif
-
-                       remaining -= (int) (time(NULL) - start);
-               }
-
-       }
-
-       /* again, see if there are any messages in the message queue */
-       if( client->m_list->next != NULL ) {
-               /* pop off the first one... */
-               node = client->m_list->next;
-               client->m_list->next = node->next;
-               msg = node->message;
-               free( node );
-               return msg;
-
-       } else {
-               return NULL;
-       }
-}
-
-/* throw the message into the message queue */
-void client_message_handler( void* client, transport_message* msg ){
-
-       if(client == NULL) return;
-       if(msg == NULL) return; 
-
-       transport_client* cli = (transport_client*) client;
-
-       size_t len = sizeof(transport_message_node);
-       transport_message_node* node = 
-               (transport_message_node*) safe_malloc(len);
-       node->type = MESSAGE_LIST_ITEM;
-       node->message = msg;
-
-
-       /* find the last node and put this onto the end */
-       transport_message_node* tail = cli->m_list;
-       transport_message_node* current = tail->next;
-
-       while( current != NULL ) {
-               tail = current;
-               current = current->next;
-       }
-       tail->next = node;
-}
-
-
-int client_free( transport_client* client ){
-       if(client == NULL) return 0; 
-
-       session_free( client->session );
-       transport_message_node* current = client->m_list->next;
-       transport_message_node* next;
-
-       /* deallocate the list of messages */
-       while( current != NULL ) {
-               next = current->next;
-               message_free( current->message );
-               free(current);
-               current = next;
-       }
-
-       free( client->m_list );
-       free( client );
-       return 1;
-}
-
diff --git a/OpenSRF/src/libtransport/transport_client.h b/OpenSRF/src/libtransport/transport_client.h
deleted file mode 100644 (file)
index aa0b921..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "transport_session.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-
-#include <time.h>
-
-#ifndef TRANSPORT_CLIENT_H
-#define TRANSPORT_CLIENT_H
-
-#define MESSAGE_LIST_HEAD 1
-#define MESSAGE_LIST_ITEM 2
-
-
-// ---------------------------------------------------------------------------
-// Represents a node in a linked list.  The node holds a pointer to the next
-// node (which is null unless set), a pointer to a transport_message, and
-// and a type variable (which is not really curently necessary).
-// ---------------------------------------------------------------------------
-struct message_list_struct {
-       struct message_list_struct* next;
-       transport_message* message;
-       int type;
-};
-
-typedef struct message_list_struct transport_message_list;
-typedef struct message_list_struct transport_message_node;
-
-// ---------------------------------------------------------------------------
-// Our client struct.  We manage a list of messages and a controlling session
-// ---------------------------------------------------------------------------
-struct transport_client_struct {
-       transport_message_list* m_list;
-       transport_session* session;
-       int error;
-};
-typedef struct transport_client_struct transport_client;
-
-// ---------------------------------------------------------------------------
-// Allocates and initializes and transport_client.  This does no connecting
-// The user must call client_free(client) when finished with the allocated
-// object.
-// if port > 0 => connect via TCP
-// else if unix_path != NULL => connect via UNIX socket
-// ---------------------------------------------------------------------------
-transport_client* client_init( char* server, int port, char* unix_path, int component );
-
-
-// ---------------------------------------------------------------------------
-// Connects to the Jabber server with the provided information. Returns 1 on
-// success, 0 otherwise.
-// ---------------------------------------------------------------------------
-int client_connect( transport_client* client, 
-               char* username, char* password, char* resource, 
-               int connect_timeout, enum TRANSPORT_AUTH_TYPE auth_type );
-
-
-int client_disconnect( transport_client* client );
-
-// ---------------------------------------------------------------------------
-// De-allocates memory associated with a transport_client object.  Users
-// must use this method when finished with a client object.
-// ---------------------------------------------------------------------------
-int client_free( transport_client* client );
-
-// ---------------------------------------------------------------------------
-//  Sends the given message.  The message must at least have the recipient
-// field set.
-// ---------------------------------------------------------------------------
-int client_send_message( transport_client* client, transport_message* msg );
-
-// ---------------------------------------------------------------------------
-// Returns 1 if this client is currently connected to the server, 0 otherwise
-// ---------------------------------------------------------------------------
-int client_connected( transport_client* client );
-
-// ---------------------------------------------------------------------------
-// This is the message handler required by transport_session.  This handler
-// takes all incoming messages and puts them into the back of a linked list
-// of messages.  
-// ---------------------------------------------------------------------------
-void client_message_handler( void* client, transport_message* msg );
-
-// ---------------------------------------------------------------------------
-// If there are any message in the message list, the 'oldest' message is
-// returned.  If not, this function will wait at most 'timeout' seconds 
-// for a message to arrive.  Specifying -1 means that this function will not
-// return unless a message arrives.
-// ---------------------------------------------------------------------------
-transport_message* client_recv( transport_client* client, int timeout );
-
-
-#endif
diff --git a/OpenSRF/src/libtransport/transport_message.c b/OpenSRF/src/libtransport/transport_message.c
deleted file mode 100644 (file)
index 44eaa98..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-#include "transport_message.h"
-
-
-// ---------------------------------------------------------------------------------
-// Allocates and initializes a new transport_message
-// ---------------------------------------------------------------------------------
-transport_message* message_init( char* body, 
-               char* subject, char* thread, char* recipient, char* sender ) {
-
-       transport_message* msg = 
-               (transport_message*) safe_malloc( sizeof(transport_message) );
-
-       if( body                                        == NULL ) { body                        = ""; }
-       if( thread                              == NULL ) { thread              = ""; }
-       if( subject                             == NULL ) { subject             = ""; }
-       if( sender                              == NULL ) { sender              = ""; }
-       if( recipient                   ==      NULL ) { recipient      = ""; }
-
-       msg->body                               = strdup(body);
-       msg->thread                             = strdup(thread);
-       msg->subject                    = strdup(subject);
-       msg->recipient                  = strdup(recipient);
-       msg->sender                             = strdup(sender);
-
-       if(     msg->body               == NULL || msg->thread                          == NULL ||
-                       msg->subject    == NULL || msg->recipient                       == NULL ||
-                       msg->sender             == NULL ) {
-
-               osrfLogError(OSRF_LOG_MARK,  "message_init(): Out of Memory" );
-               return NULL;
-       }
-
-       return msg;
-}
-
-
-transport_message* new_message_from_xml( const char* msg_xml ) {
-
-       if( msg_xml == NULL || strlen(msg_xml) < 1 )
-               return NULL;
-
-       transport_message* new_msg = 
-               (transport_message*) safe_malloc( sizeof(transport_message) );
-
-       xmlKeepBlanksDefault(0);
-       xmlDocPtr msg_doc = xmlReadDoc( BAD_CAST msg_xml, NULL, NULL, 0 );
-       xmlNodePtr root = xmlDocGetRootElement(msg_doc);
-
-       xmlChar* sender = xmlGetProp(root, BAD_CAST "from");
-       xmlChar* recipient      = xmlGetProp(root, BAD_CAST "to");
-       xmlChar* subject                = xmlGetProp(root, BAD_CAST "subject");
-       xmlChar* thread         = xmlGetProp( root, BAD_CAST "thread" );
-       xmlChar* router_from    = xmlGetProp( root, BAD_CAST "router_from" );
-       xmlChar* router_to      = xmlGetProp( root, BAD_CAST "router_to" );
-       xmlChar* router_class= xmlGetProp( root, BAD_CAST "router_class" );
-       xmlChar* broadcast      = xmlGetProp( root, BAD_CAST "broadcast" );
-   xmlChar* osrf_xid    = xmlGetProp( root, BAD_CAST "osrf_xid" );
-
-   if( osrf_xid ) {
-      message_set_osrf_xid( new_msg, (char*) osrf_xid);
-      xmlFree(osrf_xid);
-   }
-
-       if( router_from ) {
-               new_msg->sender         = strdup((char*)router_from);
-       } else {
-               if( sender ) {
-                       new_msg->sender         = strdup((char*)sender);
-                       xmlFree(sender);
-               }
-       }
-
-       if( recipient ) {
-               new_msg->recipient      = strdup((char*)recipient);
-               xmlFree(recipient);
-       }
-       if(subject){
-               new_msg->subject                = strdup((char*)subject);
-               xmlFree(subject);
-       }
-       if(thread) {
-               new_msg->thread         = strdup((char*)thread);
-               xmlFree(thread);
-       }
-       if(router_from) {
-               new_msg->router_from    = strdup((char*)router_from);
-               xmlFree(router_from);
-       }
-       if(router_to) {
-               new_msg->router_to      = strdup((char*)router_to);
-               xmlFree(router_to);
-       }
-       if(router_class) {
-               new_msg->router_class = strdup((char*)router_class);
-               xmlFree(router_class);
-       }
-       if(broadcast) {
-               if(strcmp( (char*)broadcast,"0") )
-                       new_msg->broadcast      = 1;
-               xmlFree(broadcast);
-       }
-
-       xmlNodePtr search_node = root->children;
-       while( search_node != NULL ) {
-
-               if( ! strcmp( (char*) search_node->name, "thread" ) ) {
-                       if( search_node->children && search_node->children->content ) 
-                               new_msg->thread = strdup( (char*) search_node->children->content );
-               }
-
-               if( ! strcmp( (char*) search_node->name, "subject" ) ) {
-                       if( search_node->children && search_node->children->content )
-                               new_msg->subject = strdup( (char*) search_node->children->content );
-               }
-
-               if( ! strcmp( (char*) search_node->name, "body" ) ) {
-                       if( search_node->children && search_node->children->content )
-                               new_msg->body = strdup((char*) search_node->children->content );
-               }
-
-               search_node = search_node->next;
-       }
-
-       if( new_msg->thread == NULL ) 
-               new_msg->thread = strdup("");
-       if( new_msg->subject == NULL )
-               new_msg->subject = strdup("");
-       if( new_msg->body == NULL )
-               new_msg->body = strdup("");
-
-       new_msg->msg_xml = xmlDocToString(msg_doc, 0);
-   xmlFreeDoc(msg_doc);
-   xmlCleanupParser();
-
-       return new_msg;
-}
-
-void message_set_osrf_xid( transport_message* msg, char* osrf_xid ) {
-   if(!msg) return;
-   if( osrf_xid )
-      msg->osrf_xid = strdup(osrf_xid);
-   else msg->osrf_xid = strdup("");
-}
-
-void message_set_router_info( transport_message* msg, char* router_from,
-               char* router_to, char* router_class, char* router_command, int broadcast_enabled ) {
-
-       if(router_from)
-               msg->router_from                = strdup(router_from);
-       else
-               msg->router_from                = strdup("");
-
-       if(router_to)
-               msg->router_to                  = strdup(router_to);
-       else
-               msg->router_to                  = strdup("");
-
-       if(router_class)
-               msg->router_class               = strdup(router_class);
-       else 
-               msg->router_class               = strdup("");
-       
-       if(router_command)
-               msg->router_command     = strdup(router_command);
-       else
-               msg->router_command     = strdup("");
-
-       msg->broadcast = broadcast_enabled;
-
-       if( msg->router_from == NULL || msg->router_to == NULL ||
-                       msg->router_class == NULL || msg->router_command == NULL ) 
-               osrfLogError(OSRF_LOG_MARK,  "message_set_router_info(): Out of Memory" );
-
-       return;
-}
-
-
-
-/* encodes the message for traversal */
-int message_prepare_xml( transport_message* msg ) {
-       if( msg->msg_xml != NULL ) { return 1; }
-       msg->msg_xml = message_to_xml( msg );
-       return 1;
-}
-
-
-// ---------------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------------
-int message_free( transport_message* msg ){
-       if( msg == NULL ) { return 0; }
-
-       free(msg->body); 
-       free(msg->thread);
-       free(msg->subject);
-       free(msg->recipient);
-       free(msg->sender);
-       free(msg->router_from);
-       free(msg->router_to);
-       free(msg->router_class);
-       free(msg->router_command);
-   free(msg->osrf_xid);
-       if( msg->error_type != NULL ) free(msg->error_type);
-       if( msg->msg_xml != NULL ) free(msg->msg_xml);
-       free(msg);
-       return 1;
-}
-       
-// ---------------------------------------------------------------------------------
-// Allocates a char* holding the XML representation of this jabber message
-// ---------------------------------------------------------------------------------
-char* message_to_xml( const transport_message* msg ) {
-
-       //int                   bufsize;
-       //xmlChar*              xmlbuf;
-       //char*                 encoded_body;
-
-       xmlNodePtr      message_node;
-       xmlNodePtr      body_node;
-       xmlNodePtr      thread_node;
-       xmlNodePtr      subject_node;
-       xmlNodePtr      error_node;
-       
-       xmlDocPtr       doc;
-
-       xmlKeepBlanksDefault(0);
-
-       if( ! msg ) { 
-               osrfLogWarning(OSRF_LOG_MARK,  "Passing NULL message to message_to_xml()"); 
-               return 0; 
-       }
-
-       doc = xmlReadDoc( BAD_CAST "<message/>", NULL, NULL, XML_PARSE_NSCLEAN );
-       message_node = xmlDocGetRootElement(doc);
-
-       if( msg->is_error ) {
-               error_node = xmlNewChild(message_node, NULL, BAD_CAST "error" , NULL );
-               xmlAddChild( message_node, error_node );
-               xmlNewProp( error_node, BAD_CAST "type", BAD_CAST msg->error_type );
-               char code_buf[16];
-               memset( code_buf, 0, 16);
-               sprintf(code_buf, "%d", msg->error_code );
-               xmlNewProp( error_node, BAD_CAST "code", BAD_CAST code_buf  );
-       }
-
-       /* set from and to */
-       xmlNewProp( message_node, BAD_CAST "to", BAD_CAST msg->recipient );
-       xmlNewProp( message_node, BAD_CAST "from", BAD_CAST msg->sender );
-       xmlNewProp( message_node, BAD_CAST "router_from", BAD_CAST msg->router_from );
-       xmlNewProp( message_node, BAD_CAST "router_to", BAD_CAST msg->router_to );
-       xmlNewProp( message_node, BAD_CAST "router_class", BAD_CAST msg->router_class );
-       xmlNewProp( message_node, BAD_CAST "router_command", BAD_CAST msg->router_command );
-       xmlNewProp( message_node, BAD_CAST "osrf_xid", BAD_CAST msg->osrf_xid );
-
-       if( msg->broadcast )
-               xmlNewProp( message_node, BAD_CAST "broadcast", BAD_CAST "1" );
-
-       /* Now add nodes where appropriate */
-       char* body                              = msg->body;
-       char* subject                   = msg->subject;
-       char* thread                    = msg->thread; 
-
-       if( thread && strlen(thread) > 0 ) {
-               thread_node = xmlNewChild(message_node, NULL, (xmlChar*) "thread", NULL );
-               xmlNodePtr txt = xmlNewText((xmlChar*) thread);
-               xmlAddChild(thread_node, txt);
-               xmlAddChild(message_node, thread_node); 
-       }
-
-       if( subject && strlen(subject) > 0 ) {
-               subject_node = xmlNewChild(message_node, NULL, (xmlChar*) "subject", NULL );
-               xmlNodePtr txt = xmlNewText((xmlChar*) subject);
-               xmlAddChild(subject_node, txt);
-               xmlAddChild( message_node, subject_node ); 
-       }
-
-       if( body && strlen(body) > 0 ) {
-               body_node = xmlNewChild(message_node, NULL, (xmlChar*) "body", NULL);
-               xmlNodePtr txt = xmlNewText((xmlChar*) body);
-               xmlAddChild(body_node, txt);
-               xmlAddChild( message_node, body_node ); 
-       }
-
-       xmlBufferPtr xmlbuf = xmlBufferCreate();
-       xmlNodeDump( xmlbuf, doc, xmlDocGetRootElement(doc), 0, 0);
-       char* xml = strdup((char*) (xmlBufferContent(xmlbuf)));
-       xmlBufferFree(xmlbuf);
-       xmlFreeDoc( doc );               
-       xmlCleanupParser();
-       return xml;
-}
-
-
-
-void jid_get_username( const char* jid, char buf[], int size ) {
-
-       if( jid == NULL ) { return; }
-
-       /* find the @ and return whatever is in front of it */
-       int len = strlen( jid );
-       int i;
-       for( i = 0; i != len; i++ ) {
-               if( jid[i] == 64 ) { /*ascii @*/
-                       if(i > size)  i = size;
-                       strncpy( buf, jid, i );
-                       return;
-               }
-       }
-}
-
-
-void jid_get_resource( const char* jid, char buf[], int size)  {
-       if( jid == NULL ) { return; }
-       int len = strlen( jid );
-       int i;
-       for( i = 0; i!= len; i++ ) {
-               if( jid[i] == 47 ) { /* ascii / */
-                       const char* start = jid + i + 1; /* right after the '/' */
-                       int rlen = len - (i+1);
-                       if(rlen > size) rlen = size;
-                       strncpy( buf, start, rlen );
-               }
-       }
-}
-
-void jid_get_domain( const char* jid, char buf[], int size ) {
-
-       if(jid == NULL) return;
-
-       int len = strlen(jid);
-       int i;
-       int index1 = 0; 
-       int index2 = 0;
-
-       for( i = 0; i!= len; i++ ) {
-               if(jid[i] == 64) /* ascii @ */
-                       index1 = i + 1;
-               else if(jid[i] == 47 && index1 != 0) /* ascii / */
-                       index2 = i;
-       }
-
-       if( index1 > 0 && index2 > 0 && index2 > index1 ) {
-               int dlen = index2 - index1;
-               if(dlen > size) dlen = size;
-               memcpy( buf, jid + index1, dlen );
-       }
-}
-
-void set_msg_error( transport_message* msg, char* type, int err_code ) {
-
-       if( type != NULL && strlen( type ) > 0 ) {
-               msg->error_type = safe_malloc( strlen(type)+1); 
-               strcpy( msg->error_type, type );
-               msg->error_code = err_code;
-       }
-       msg->is_error = 1;
-}
diff --git a/OpenSRF/src/libtransport/transport_message.h b/OpenSRF/src/libtransport/transport_message.h
deleted file mode 100644 (file)
index 4e94e24..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <string.h>
-#include <libxml/globals.h>
-#include <libxml/xmlerror.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/debugXML.h>
-#include <libxml/xmlmemory.h>
-
-#include "opensrf/utils.h"
-#include "opensrf/xml_utils.h"
-#include "opensrf/log.h"
-
-#ifndef TRANSPORT_MESSAGE_H
-#define TRANSPORT_MESSAGE_H
-
-
-
-// ---------------------------------------------------------------------------------
-// Jabber message object.
-// ---------------------------------------------------------------------------------
-struct transport_message_struct {
-       char* body;
-       char* subject;
-       char* thread;
-       char* recipient;
-       char* sender;
-       char* router_from;
-       char* router_to;
-       char* router_class;
-       char* router_command;
-   char* osrf_xid;
-       int is_error;
-       char* error_type;
-       int error_code;
-       int broadcast;
-       char* msg_xml; /* the entire message as XML complete with entity encoding */
-};
-typedef struct transport_message_struct transport_message;
-
-// ---------------------------------------------------------------------------------
-// Allocates and returns a transport_message.  All chars are safely re-allocated
-// within this method.
-// Returns NULL on error
-// ---------------------------------------------------------------------------------
-transport_message* message_init( char* body, char* subject, 
-               char* thread, char* recipient, char* sender );
-
-transport_message* new_message_from_xml( const char* msg_xml );
-
-
-void message_set_router_info( transport_message* msg, char* router_from,
-               char* router_to, char* router_class, char* router_command, int broadcast_enabled );
-
-void message_set_osrf_xid( transport_message* msg, char* osrf_xid );
-
-// ---------------------------------------------------------------------------------
-// Formats the Jabber message as XML for encoding. 
-// Returns NULL on error
-// ---------------------------------------------------------------------------------
-char* message_to_xml( const transport_message* msg );
-
-
-// ---------------------------------------------------------------------------------
-// Call this to create the encoded XML for sending on the wire.
-// This is a seperate function so that encoding will not necessarily have
-// to happen on all messages (i.e. typically only occurs outbound messages).
-// ---------------------------------------------------------------------------------
-int message_prepare_xml( transport_message* msg );
-
-// ---------------------------------------------------------------------------------
-// Deallocates the memory used by the transport_message
-// Returns 0 on error
-// ---------------------------------------------------------------------------------
-int message_free( transport_message* msg );
-
-// ---------------------------------------------------------------------------------
-// Prepares the shared XML document
-// ---------------------------------------------------------------------------------
-//int message_init_xml();
-
-// ---------------------------------------------------------------------------------
-// Determines the username of a Jabber ID.  This expects a pre-allocated char 
-// array for the return value.
-// ---------------------------------------------------------------------------------
-void jid_get_username( const char* jid, char buf[], int size );
-
-// ---------------------------------------------------------------------------------
-// Determines the resource of a Jabber ID.  This expects a pre-allocated char 
-// array for the return value.
-// ---------------------------------------------------------------------------------
-void jid_get_resource( const char* jid, char buf[], int size );
-
-/** Puts the domain portion of the given jid into the pre-allocated buffer */
-void jid_get_domain( const char* jid, char buf[], int size );
-
-void set_msg_error( transport_message*, char* error_type, int error_code);
-
-
-#endif
diff --git a/OpenSRF/src/libtransport/transport_session.c b/OpenSRF/src/libtransport/transport_session.c
deleted file mode 100644 (file)
index 1db881a..0000000
+++ /dev/null
@@ -1,633 +0,0 @@
-#include "transport_session.h"
-
-
-
-// ---------------------------------------------------------------------------------
-// returns a built and allocated transport_session object.
-// This codes does no network activity, only memory initilization
-// ---------------------------------------------------------------------------------
-transport_session* init_transport(  char* server, 
-       int port, char* unix_path, void* user_data, int component ) {
-
-       /* create the session struct */
-       transport_session* session = 
-               (transport_session*) safe_malloc( sizeof(transport_session) );
-
-       session->user_data = user_data;
-
-       session->component = component;
-
-       /* initialize the data buffers */
-       session->body_buffer                    = buffer_init( JABBER_BODY_BUFSIZE );
-       session->subject_buffer         = buffer_init( JABBER_SUBJECT_BUFSIZE );
-       session->thread_buffer          = buffer_init( JABBER_THREAD_BUFSIZE );
-       session->from_buffer                    = buffer_init( JABBER_JID_BUFSIZE );
-       session->status_buffer          = buffer_init( JABBER_STATUS_BUFSIZE );
-       session->recipient_buffer       = buffer_init( JABBER_JID_BUFSIZE );
-       session->message_error_type = buffer_init( JABBER_JID_BUFSIZE );
-       session->session_id                     = buffer_init( 64 ); 
-
-       /* for OpenSRF extensions */
-       session->router_to_buffer               = buffer_init( JABBER_JID_BUFSIZE );
-       session->router_from_buffer     = buffer_init( JABBER_JID_BUFSIZE );
-       session->osrf_xid_buffer        = buffer_init( JABBER_JID_BUFSIZE );
-       session->router_class_buffer    = buffer_init( JABBER_JID_BUFSIZE );
-       session->router_command_buffer  = buffer_init( JABBER_JID_BUFSIZE );
-
-
-       if(     session->body_buffer            == NULL || session->subject_buffer       == NULL        ||
-                       session->thread_buffer  == NULL || session->from_buffer          == NULL        ||
-                       session->status_buffer  == NULL || session->recipient_buffer == NULL ||
-                       session->router_to_buffer       == NULL || session->router_from_buffer   == NULL ||
-                       session->router_class_buffer == NULL || session->router_command_buffer == NULL ||
-                       session->session_id == NULL ) { 
-
-               osrfLogError(OSRF_LOG_MARK,  "init_transport(): buffer_init returned NULL" );
-               return 0;
-       }
-
-
-       /* initialize the jabber state machine */
-       session->state_machine = (jabber_machine*) safe_malloc( sizeof(jabber_machine) );
-
-       /* initialize the sax push parser */
-       session->parser_ctxt = xmlCreatePushParserCtxt(SAXHandler, session, "", 0, NULL);
-
-       /* initialize the transport_socket structure */
-       session->sock_mgr = (socket_manager*) safe_malloc( sizeof(socket_manager) );
-
-       session->sock_mgr->data_received = &grab_incoming;
-       session->sock_mgr->blob = session;
-       
-       session->port = port;
-       session->server = strdup(server);
-       if(unix_path)   
-               session->unix_path = strdup(unix_path);
-       else session->unix_path = NULL;
-
-       session->sock_id = 0;
-
-       return session;
-}
-
-
-
-/* XXX FREE THE BUFFERS */
-int session_free( transport_session* session ) {
-       if( ! session ) { return 0; }
-
-       if(session->sock_mgr)
-               socket_manager_free(session->sock_mgr);
-
-       if( session->state_machine ) free( session->state_machine );
-       if( session->parser_ctxt) {
-               xmlFreeDoc( session->parser_ctxt->myDoc );
-               xmlFreeParserCtxt(session->parser_ctxt);
-       }
-
-       xmlCleanupCharEncodingHandlers();
-       xmlDictCleanup();
-       xmlCleanupParser();
-
-       buffer_free(session->body_buffer);
-       buffer_free(session->subject_buffer);
-       buffer_free(session->thread_buffer);
-       buffer_free(session->from_buffer);
-       buffer_free(session->recipient_buffer);
-       buffer_free(session->status_buffer);
-       buffer_free(session->message_error_type);
-       buffer_free(session->router_to_buffer);
-       buffer_free(session->router_from_buffer);
-       buffer_free(session->osrf_xid_buffer);
-       buffer_free(session->router_class_buffer);
-       buffer_free(session->router_command_buffer);
-       buffer_free(session->session_id);
-
-       free(session->server);
-       free(session->unix_path);
-
-       free( session );
-       return 1;
-}
-
-
-int session_wait( transport_session* session, int timeout ) {
-       if( ! session || ! session->sock_mgr ) {
-               return 0;
-       }
-
-       int ret =  socket_wait( session->sock_mgr, timeout, session->sock_id );
-
-       if( ret ) {
-               osrfLogWarning(OSRF_LOG_MARK, "socket_wait returned error code %d", ret);
-               session->state_machine->connected = 0;
-       }
-       return ret;
-}
-
-int session_send_msg( 
-               transport_session* session, transport_message* msg ) {
-
-       if( ! session ) { return -1; }
-
-       if( ! session->state_machine->connected ) {
-               osrfLogWarning(OSRF_LOG_MARK, "State machine is not connected in send_msg()");
-               return -1;
-       }
-
-       message_prepare_xml( msg );
-       //tcp_send( session->sock_obj, msg->msg_xml );
-       return socket_send( session->sock_id, msg->msg_xml );
-
-}
-
-
-/* connects to server and connects to jabber */
-int session_connect( transport_session* session, 
-               const char* username, const char* password, 
-               const char* resource, int connect_timeout, enum TRANSPORT_AUTH_TYPE auth_type ) {
-
-       int size1 = 0;
-       int size2 = 0;
-
-       if( ! session ) { 
-               osrfLogWarning(OSRF_LOG_MARK,  "session is null in connect" );
-               return 0; 
-       }
-
-
-       //char* server = session->sock_obj->server;
-       char* server = session->server;
-
-       if( ! session->sock_id ) {
-
-               if(session->port > 0) {
-                       if( (session->sock_id = socket_open_tcp_client(
-                               session->sock_mgr, session->port, session->server)) <= 0 ) 
-                       return 0;
-
-               } else if(session->unix_path != NULL) {
-                       if( (session->sock_id = socket_open_unix_client(
-                               session->sock_mgr, session->unix_path)) <= 0 ) 
-                       return 0;
-               }
-       }
-
-       if( session->component ) {
-
-               /* the first Jabber connect stanza */
-               char* our_hostname = getenv("HOSTNAME");
-               size1 = 150 + strlen( server );
-               char stanza1[ size1 ]; 
-               memset( stanza1, 0, size1 );
-               sprintf( stanza1, 
-                               "<stream:stream version='1.0' xmlns:stream='http://etherx.jabber.org/streams' "
-                               "xmlns='jabber:component:accept' to='%s' from='%s' xml:lang='en'>",
-                               username, our_hostname );
-
-               /* send the first stanze */
-               session->state_machine->connecting = CONNECTING_1;
-
-//             if( ! tcp_send( session->sock_obj, stanza1 ) ) {
-               if( socket_send( session->sock_id, stanza1 ) ) {
-                       osrfLogWarning(OSRF_LOG_MARK, "error sending");
-                       return 0;
-               }
-       
-               /* wait for reply */
-               //tcp_wait( session->sock_obj, connect_timeout ); /* make the timeout smarter XXX */
-               socket_wait(session->sock_mgr, connect_timeout, session->sock_id);
-       
-               /* server acknowledges our existence, now see if we can login */
-               if( session->state_machine->connecting == CONNECTING_2 ) {
-       
-                       int ss = session->session_id->n_used + strlen(password) + 5;
-                       char hashstuff[ss];
-                       memset(hashstuff,0,ss);
-                       sprintf( hashstuff, "%s%s", session->session_id->buf, password );
-
-                       char* hash = shahash( hashstuff );
-                       size2 = 100 + strlen( hash );
-                       char stanza2[ size2 ];
-                       memset( stanza2, 0, size2 );
-                       sprintf( stanza2, "<handshake>%s</handshake>", hash );
-       
-                       //if( ! tcp_send( session->sock_obj, stanza2 )  ) {
-                       if( socket_send( session->sock_id, stanza2 )  ) {
-                               osrfLogWarning(OSRF_LOG_MARK, "error sending");
-                               return 0;
-                       }
-               }
-
-       } else { /* we're not a component */
-
-               /* the first Jabber connect stanza */
-               size1 = 100 + strlen( server );
-               char stanza1[ size1 ]; 
-               memset( stanza1, 0, size1 );
-               sprintf( stanza1, 
-                               "<stream:stream to='%s' xmlns='jabber:client' "
-                               "xmlns:stream='http://etherx.jabber.org/streams'>",
-                       server );
-       
-
-               /* send the first stanze */
-               session->state_machine->connecting = CONNECTING_1;
-               //if( ! tcp_send( session->sock_obj, stanza1 ) ) {
-               if( socket_send( session->sock_id, stanza1 ) ) {
-                       osrfLogWarning(OSRF_LOG_MARK, "error sending");
-                       return 0;
-               }
-
-
-               /* wait for reply */
-               //tcp_wait( session->sock_obj, connect_timeout ); /* make the timeout smarter XXX */
-               socket_wait( session->sock_mgr, connect_timeout, session->sock_id ); /* make the timeout smarter XXX */
-
-               if( auth_type == AUTH_PLAIN ) {
-
-                       /* the second jabber connect stanza including login info*/
-                       size2 = 150 + strlen( username ) + strlen(password) + strlen(resource);
-                       char stanza2[ size2 ];
-                       memset( stanza2, 0, size2 );
-               
-                       sprintf( stanza2, 
-                                       "<iq id='123456789' type='set'><query xmlns='jabber:iq:auth'>"
-                                       "<username>%s</username><password>%s</password><resource>%s</resource></query></iq>",
-                                       username, password, resource );
-       
-                       /* server acknowledges our existence, now see if we can login */
-                       if( session->state_machine->connecting == CONNECTING_2 ) {
-                               //if( ! tcp_send( session->sock_obj, stanza2 )  ) {
-                               if( socket_send( session->sock_id, stanza2 )  ) {
-                                       osrfLogWarning(OSRF_LOG_MARK, "error sending");
-                                       return 0;
-                               }
-                       }
-
-               } else if( auth_type == AUTH_DIGEST ) {
-
-                       int ss = session->session_id->n_used + strlen(password) + 5;
-                       char hashstuff[ss];
-                       memset(hashstuff,0,ss);
-                       sprintf( hashstuff, "%s%s", session->session_id->buf, password );
-
-                       char* hash = shahash( hashstuff );
-
-                       /* the second jabber connect stanza including login info*/
-                       size2 = 150 + strlen( hash ) + strlen(password) + strlen(resource);
-                       char stanza2[ size2 ];
-                       memset( stanza2, 0, size2 );
-               
-                       sprintf( stanza2, 
-                                       "<iq id='123456789' type='set'><query xmlns='jabber:iq:auth'>"
-                                       "<username>%s</username><digest>%s</digest><resource>%s</resource></query></iq>",
-                                       username, hash, resource );
-       
-                       /* server acknowledges our existence, now see if we can login */
-                       if( session->state_machine->connecting == CONNECTING_2 ) {
-                               //if( ! tcp_send( session->sock_obj, stanza2 )  ) {
-                               if( socket_send( session->sock_id, stanza2 )  ) {
-                                       osrfLogWarning(OSRF_LOG_MARK, "error sending");
-                                       return 0;
-                               }
-                       }
-
-               }
-
-       } // not component
-
-
-       /* wait for reply */
-       //tcp_wait( session->sock_obj, connect_timeout );
-       socket_wait( session->sock_mgr, connect_timeout, session->sock_id );
-
-       if( session->state_machine->connected ) {
-               /* yar! */
-               return 1;
-       }
-
-       return 0;
-}
-
-// ---------------------------------------------------------------------------------
-// TCP data callback. Shove the data into the push parser.
-// ---------------------------------------------------------------------------------
-//void grab_incoming( void * session, char* data ) {
-void grab_incoming(void* blob, socket_manager* mgr, int sockid, char* data, int parent) {
-       transport_session* ses = (transport_session*) blob;
-       if( ! ses ) { return; }
-       xmlParseChunk(ses->parser_ctxt, data, strlen(data), 0);
-}
-
-
-void startElementHandler(
-       void *session, const xmlChar *ename, const xmlChar **atts) {
-
-       transport_session* ses = (transport_session*) session;
-       if( ! ses ) { return; }
-
-   char* name = (char*) ename;
-
-       if( strcmp(  name, "message" ) == 0 ) {
-               ses->state_machine->in_message = 1;
-               buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
-               buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
-               buffer_add( ses->router_from_buffer, get_xml_attr( atts, "router_from" ) );
-               buffer_add( ses->osrf_xid_buffer, get_xml_attr( atts, "osrf_xid" ) );
-               buffer_add( ses->router_to_buffer, get_xml_attr( atts, "router_to" ) );
-               buffer_add( ses->router_class_buffer, get_xml_attr( atts, "router_class" ) );
-               buffer_add( ses->router_command_buffer, get_xml_attr( atts, "router_command" ) );
-               char* broadcast = get_xml_attr( atts, "broadcast" );
-               if( broadcast )
-                       ses->router_broadcast = atoi( broadcast );
-
-               return;
-       }
-
-       if( ses->state_machine->in_message ) {
-
-               if( strcmp( name, "body" ) == 0 ) {
-                       ses->state_machine->in_message_body = 1;
-                       return;
-               }
-       
-               if( strcmp( name, "subject" ) == 0 ) {
-                       ses->state_machine->in_subject = 1;
-                       return;
-               }
-       
-               if( strcmp( name, "thread" ) == 0 ) {
-                       ses->state_machine->in_thread = 1;
-                       return;
-               }
-
-       }
-
-       if( strcmp( name, "presence" ) == 0 ) {
-               ses->state_machine->in_presence = 1;
-               buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
-               buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
-               return;
-       }
-
-       if( strcmp( name, "status" ) == 0 ) {
-               ses->state_machine->in_status = 1;
-               return;
-       }
-
-
-       if( strcmp( name, "stream:error" ) == 0 ) {
-               ses->state_machine->in_error = 1;
-               ses->state_machine->connected = 0;
-               osrfLogWarning(  OSRF_LOG_MARK, "Received <stream:error> message from Jabber server" );
-               return;
-       }
-
-
-       /* first server response from a connect attempt */
-       if( strcmp( name, "stream:stream" ) == 0 ) {
-               if( ses->state_machine->connecting == CONNECTING_1 ) {
-                       ses->state_machine->connecting = CONNECTING_2;
-                       buffer_add( ses->session_id, get_xml_attr(atts, "id") );
-               }
-       }
-
-       if( strcmp( name, "handshake" ) == 0 ) {
-               ses->state_machine->connected = 1;
-               ses->state_machine->connecting = 0;
-               return;
-       }
-
-
-       if( strcmp( name, "error" ) == 0 ) {
-               ses->state_machine->in_message_error = 1;
-               buffer_add( ses->message_error_type, get_xml_attr( atts, "type" ) );
-               ses->message_error_code = atoi( get_xml_attr( atts, "code" ) );
-               osrfLogInfo( OSRF_LOG_MARK,  "Received <error> message with type %s and code %s", 
-                       get_xml_attr( atts, "type"), get_xml_attr( atts, "code") );
-               return;
-       }
-
-       if( strcmp( name, "iq" ) == 0 ) {
-               ses->state_machine->in_iq = 1;
-
-               if( strcmp( get_xml_attr(atts, "type"), "result") == 0 
-                               && ses->state_machine->connecting == CONNECTING_2 ) {
-                       ses->state_machine->connected = 1;
-                       ses->state_machine->connecting = 0;
-                       return;
-               }
-
-               if( strcmp( get_xml_attr(atts, "type"), "error") == 0 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Error connecting to jabber" );
-                       return;
-               }
-       }
-}
-
-char* get_xml_attr( const xmlChar** atts, char* attr_name ) {
-       int i;
-       if (atts != NULL) {
-               for(i = 0;(atts[i] != NULL);i++) {
-                       if( strcmp( (char*)atts[i++], attr_name ) == 0 ) {
-                               if( atts[i] != NULL ) {
-                                       return (char*) atts[i];
-                               }
-                       }
-               }
-       }
-       return NULL;
-}
-
-
-// ------------------------------------------------------------------
-// See which tags are ending
-// ------------------------------------------------------------------
-void endElementHandler( void *session, const xmlChar *ename) {
-       transport_session* ses = (transport_session*) session;
-       if( ! ses ) { return; }
-
-   char* name = (char*) ename;
-       if( strcmp( name, "message" ) == 0 ) {
-
-
-               /* pass off the message info the callback */
-               if( ses->message_callback ) {
-
-                       /* here it's ok to pass in the raw buffers because
-                               message_init allocates new space for the chars 
-                               passed in */
-                       transport_message* msg =  message_init( 
-                               ses->body_buffer->buf, 
-                               ses->subject_buffer->buf,
-                               ses->thread_buffer->buf, 
-                               ses->recipient_buffer->buf, 
-                               ses->from_buffer->buf );
-
-                       message_set_router_info( msg, 
-                               ses->router_from_buffer->buf, 
-                               ses->router_to_buffer->buf, 
-                               ses->router_class_buffer->buf,
-                               ses->router_command_buffer->buf,
-                               ses->router_broadcast );
-
-         message_set_osrf_xid( msg, ses->osrf_xid_buffer->buf );
-
-                       if( ses->message_error_type->n_used > 0 ) {
-                               set_msg_error( msg, ses->message_error_type->buf, ses->message_error_code );
-                       }
-
-                       if( msg == NULL ) { return; }
-                       ses->message_callback( ses->user_data, msg );
-               }
-
-               ses->state_machine->in_message = 0;
-               reset_session_buffers( session );
-               return;
-       }
-       
-       if( strcmp( name, "body" ) == 0 ) {
-               ses->state_machine->in_message_body = 0;
-               return;
-       }
-
-       if( strcmp( name, "subject" ) == 0 ) {
-               ses->state_machine->in_subject = 0;
-               return;
-       }
-
-       if( strcmp( name, "thread" ) == 0 ) {
-               ses->state_machine->in_thread = 0;
-               return;
-       }
-       
-       if( strcmp( name, "iq" ) == 0 ) {
-               ses->state_machine->in_iq = 0;
-               if( ses->message_error_code > 0 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Error in IQ packet: code %d",  ses->message_error_code );
-                       osrfLogWarning( OSRF_LOG_MARK,  "Error 401 means not authorized" );
-               }
-               reset_session_buffers( session );
-               return;
-       }
-
-       if( strcmp( name, "presence" ) == 0 ) {
-               ses->state_machine->in_presence = 0;
-               /*
-               if( ses->presence_callback ) {
-                       // call the callback with the status, etc.
-               }
-               */
-               reset_session_buffers( session );
-               return;
-       }
-
-       if( strcmp( name, "status" ) == 0 ) {
-               ses->state_machine->in_status = 0;
-               return;
-       }
-
-       if( strcmp( name, "error" ) == 0 ) {
-               ses->state_machine->in_message_error = 0;
-               return;
-       }
-
-       if( strcmp( name, "error:error" ) == 0 ) {
-               ses->state_machine->in_error = 0;
-               return;
-       }
-}
-
-int reset_session_buffers( transport_session* ses ) {
-       buffer_reset( ses->body_buffer );
-       buffer_reset( ses->subject_buffer );
-       buffer_reset( ses->thread_buffer );
-       buffer_reset( ses->from_buffer );
-       buffer_reset( ses->recipient_buffer );
-       buffer_reset( ses->router_from_buffer );
-       buffer_reset( ses->osrf_xid_buffer );
-       buffer_reset( ses->router_to_buffer );
-       buffer_reset( ses->router_class_buffer );
-       buffer_reset( ses->router_command_buffer );
-       buffer_reset( ses->message_error_type );
-       buffer_reset( ses->session_id );
-
-       return 1;
-}
-
-// ------------------------------------------------------------------
-// takes data out of the body of the message and pushes it into
-// the appropriate buffer
-// ------------------------------------------------------------------
-void characterHandler(
-               void *session, const xmlChar *ch, int len) {
-
-       char data[len+1];
-       memset( data, 0, len+1 );
-       strncpy( data, (char*) ch, len );
-       data[len] = 0;
-
-       //printf( "Handling characters: %s\n", data );
-       transport_session* ses = (transport_session*) session;
-       if( ! ses ) { return; }
-
-       /* set the various message parts */
-       if( ses->state_machine->in_message ) {
-
-               if( ses->state_machine->in_message_body ) {
-                       buffer_add( ses->body_buffer, data );
-               }
-
-               if( ses->state_machine->in_subject ) {
-                       buffer_add( ses->subject_buffer, data );
-               }
-
-               if( ses->state_machine->in_thread ) {
-                       buffer_add( ses->thread_buffer, data );
-               }
-       }
-
-       /* set the presence status */
-       if( ses->state_machine->in_presence && ses->state_machine->in_status ) {
-               buffer_add( ses->status_buffer, data );
-       }
-
-       if( ses->state_machine->in_error ) {
-               /* for now... */
-               osrfLogWarning( OSRF_LOG_MARK,  "ERROR Xml fragment: %s\n", ch );
-       }
-
-}
-
-/* XXX change to warning handlers */
-void  parseWarningHandler( void *session, const char* msg, ... ) {
-
-       va_list args;
-       va_start(args, msg);
-       fprintf(stdout, "transport_session XML WARNING");
-       vfprintf(stdout, msg, args);
-       va_end(args);
-       fprintf(stderr, "XML WARNING: %s\n", msg ); 
-}
-
-void  parseErrorHandler( void *session, const char* msg, ... ){
-
-       va_list args;
-       va_start(args, msg);
-       fprintf(stdout, "transport_session XML ERROR");
-       vfprintf(stdout, msg, args);
-       va_end(args);
-       fprintf(stderr, "XML ERROR: %s\n", msg ); 
-
-}
-
-int session_disconnect( transport_session* session ) {
-       if( session == NULL ) { return 0; }
-       //tcp_send( session->sock_obj, "</stream:stream>");
-       socket_send(session->sock_id, "</stream:stream>");
-       socket_disconnect(session->sock_mgr, session->sock_id);
-       return 0;
-       //return tcp_disconnect( session->sock_obj );
-}
-
diff --git a/OpenSRF/src/libtransport/transport_session.h b/OpenSRF/src/libtransport/transport_session.h
deleted file mode 100644 (file)
index ba02e5b..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-// ---------------------------------------------------------------------------------
-// Manages the Jabber session.  Data is taken from the TCP object and pushed into
-// a SAX push parser as it arrives.  When key Jabber documetn elements are met, 
-// logic ensues.
-// ---------------------------------------------------------------------------------
-#include "transport_message.h"
-
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "opensrf/socket_bundle.h"
-
-#include "sha.h"
-
-#include <string.h>
-#include <libxml/globals.h>
-#include <libxml/xmlerror.h>
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h> /* only for xmlNewInputFromFile() */
-#include <libxml/tree.h>
-#include <libxml/debugXML.h>
-#include <libxml/xmlmemory.h>
-
-#ifndef TRANSPORT_SESSION_H
-#define TRANSPORT_SESSION_H
-
-#define CONNECTING_1 1 /* just starting the connection to Jabber */
-#define CONNECTING_2 2 /* First <stream> packet sent and <stream> packet received from server */
-
-/* Note. these are growing buffers, so all that's necessary is a sane starting point */
-#define JABBER_BODY_BUFSIZE            4096
-#define JABBER_SUBJECT_BUFSIZE 64      
-#define JABBER_THREAD_BUFSIZE          64      
-#define JABBER_JID_BUFSIZE                     64      
-#define JABBER_STATUS_BUFSIZE          16 
-
-// ---------------------------------------------------------------------------------
-// Takes data from the socket handler and pushes it directly into the push parser
-// ---------------------------------------------------------------------------------
-//void grab_incoming( void * session, char* data );
-void grab_incoming(void* blob, socket_manager* mgr, int sockid, char* data, int parent);
-
-// ---------------------------------------------------------------------------------
-// Callback for handling the startElement event.  Much of the jabber logic occurs
-// in this and the characterHandler callbacks.
-// Here we check for the various top level jabber elements: body, iq, etc.
-// ---------------------------------------------------------------------------------
-void startElementHandler( 
-               void *session, const xmlChar *name, const xmlChar **atts);
-
-// ---------------------------------------------------------------------------------
-// Callback for handling the endElement event.  Updates the Jabber state machine
-// to let us know the element is over.
-// ---------------------------------------------------------------------------------
-void endElementHandler( void *session, const xmlChar *name);
-
-// ---------------------------------------------------------------------------------
-// This is where we extract XML text content.  In particular, this is useful for
-// extracting Jabber message bodies.
-// ---------------------------------------------------------------------------------
-void characterHandler(
-               void *session, const xmlChar *ch, int len);
-
-void  parseWarningHandler( void *session, const char* msg, ... );
-void  parseErrorHandler( void *session, const char* msg, ... );
-
-// ---------------------------------------------------------------------------------
-// Tells the SAX parser which functions will be used as event callbacks
-// ---------------------------------------------------------------------------------
-static xmlSAXHandler SAXHandlerStruct = {
-   NULL,                                                       /* internalSubset */
-   NULL,                                                       /* isStandalone */
-   NULL,                                                       /* hasInternalSubset */
-   NULL,                                                       /* hasExternalSubset */
-   NULL,                                                       /* resolveEntity */
-   NULL,                                                       /* getEntity */
-   NULL,                                                       /* entityDecl */
-   NULL,                                                       /* notationDecl */
-   NULL,                                                       /* attributeDecl */
-   NULL,                                                       /* elementDecl */
-   NULL,                                                       /* unparsedEntityDecl */
-   NULL,                                                       /* setDocumentLocator */
-   NULL,                                                       /* startDocument */
-   NULL,                                                       /* endDocument */
-       startElementHandler,            /* startElement */
-       endElementHandler,              /* endElement */
-   NULL,                                                       /* reference */
-       characterHandler,                       /* characters */
-   NULL,                                                       /* ignorableWhitespace */
-   NULL,                                                       /* processingInstruction */
-   NULL,                                                       /* comment */
-   parseWarningHandler,                /* xmlParserWarning */
-   parseErrorHandler,          /* xmlParserError */
-   NULL,                                                       /* xmlParserFatalError : unused */
-   NULL,                                                       /* getParameterEntity */
-   NULL,                                                       /* cdataBlock; */
-   NULL,                                                       /* externalSubset; */
-   1,
-   NULL,
-   NULL,                                                       /* startElementNs */
-   NULL,                                                       /* endElementNs */
-       NULL                                                    /* xmlStructuredErrorFunc */
-};
-
-// ---------------------------------------------------------------------------------
-// Our SAX handler pointer.
-// ---------------------------------------------------------------------------------
-static const xmlSAXHandlerPtr SAXHandler = &SAXHandlerStruct;
-
-// ---------------------------------------------------------------------------------
-// Jabber state machine.  This is how we know where we are in the Jabber
-// conversation.
-// ---------------------------------------------------------------------------------
-struct jabber_state_machine_struct {
-       int connected;
-       int connecting;
-       int in_message;
-       int in_message_body;
-       int in_thread;
-       int in_subject;
-       int in_error;
-       int in_message_error;
-       int in_iq;
-       int in_presence;
-       int in_status;
-};
-typedef struct jabber_state_machine_struct jabber_machine;
-
-
-enum TRANSPORT_AUTH_TYPE { AUTH_PLAIN, AUTH_DIGEST };
-
-// ---------------------------------------------------------------------------------
-// Transport session.  This maintains all the various parts of a session
-// ---------------------------------------------------------------------------------
-struct transport_session_struct {
-
-       /* our socket connection */
-       //transport_socket* sock_obj;
-       socket_manager* sock_mgr;
-
-       /* our Jabber state machine */
-       jabber_machine* state_machine;
-       /* our SAX push parser context */
-       xmlParserCtxtPtr parser_ctxt;
-
-       /* our text buffers for holding text data */
-       growing_buffer* body_buffer;
-       growing_buffer* subject_buffer;
-       growing_buffer* thread_buffer;
-       growing_buffer* from_buffer;
-       growing_buffer* recipient_buffer;
-       growing_buffer* status_buffer;
-       growing_buffer* message_error_type;
-       growing_buffer* session_id;
-       int message_error_code;
-
-       /* for OILS extenstions */
-       growing_buffer* router_to_buffer;
-       growing_buffer* router_from_buffer;
-       growing_buffer* router_class_buffer;
-       growing_buffer* router_command_buffer;
-       growing_buffer* osrf_xid_buffer;
-       int router_broadcast;
-
-       /* this can be anything.  It will show up in the 
-               callbacks for your convenience. Otherwise, it's
-               left untouched.  */
-       void* user_data;
-
-       char* server;
-       char* unix_path;
-       int     port;
-       int sock_id;
-
-       int component; /* true if we're a component */
-
-       /* the Jabber message callback */
-       void (*message_callback) ( void* user_data, transport_message* msg );
-       //void (iq_callback) ( void* user_data, transport_iq_message* iq );
-};
-typedef struct transport_session_struct transport_session;
-
-
-// ------------------------------------------------------------------
-// Allocates and initializes the necessary transport session
-// data structures.
-// If port > 0, then this session uses  TCP connection.  Otherwise,
-// if unix_path != NULL, it uses a UNIX domain socket.
-// ------------------------------------------------------------------
-transport_session* init_transport( char* server, int port, 
-       char* unix_path, void* user_data, int component );
-
-// ------------------------------------------------------------------
-// Returns the value of the given XML attribute
-// The xmlChar** construct is commonly returned from SAX event
-// handlers.  Pass that in with the name of the attribute you want
-// to retrieve.
-// ------------------------------------------------------------------
-char* get_xml_attr( const xmlChar** atts, char* attr_name );
-
-// ------------------------------------------------------------------
-// Waits  at most 'timeout' seconds  for data to arrive from the 
-// TCP handler. A timeout of -1 means to wait indefinitely.
-// ------------------------------------------------------------------
-int session_wait( transport_session* session, int timeout );
-
-// ---------------------------------------------------------------------------------
-// Sends the given Jabber message
-// ---------------------------------------------------------------------------------
-int session_send_msg( transport_session* session, transport_message* msg );
-
-// ---------------------------------------------------------------------------------
-// Returns 1 if this session is connected to the jabber server. 0 otherwise
-// ---------------------------------------------------------------------------------
-int session_connected( transport_session* );
-
-// ------------------------------------------------------------------
-// Deallocates session memory
-// ------------------------------------------------------------------
-int session_free( transport_session* session );
-
-// ------------------------------------------------------------------
-// Connects to the Jabber server.  Waits at most connect_timeout
-// seconds before failing
-// ------------------------------------------------------------------
-int session_connect( transport_session* session, 
-               const char* username, const char* password, 
-               const char* resource, int connect_timeout, 
-               enum TRANSPORT_AUTH_TYPE auth_type );
-
-int session_disconnect( transport_session* session );
-
-int reset_session_buffers( transport_session* session );
-
-#endif
diff --git a/OpenSRF/src/objson/Makefile b/OpenSRF/src/objson/Makefile
deleted file mode 100644 (file)
index 5fcac70..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# --------------------------------------------------------------------
-# Copyright (C) 2005  Georgia Public Library Service 
-# Bill Erickson <highfalutin@gmail.com>
-# Mike Rylander <mrylander@gmail.com>
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# --------------------------------------------------------------------
-
-
-# --------------------------------------------------------------------
-#
-# -DSTRICT_JSON_WRITE if not defined, 'null' objects will be written
-#      as empty strings. e.g. [null, null] => [,,]
-#
-# -DSTRICT_JSON_READ if not defiend, empty array and object values
-#      (not keys) will be considered null.
-#      e.g. [,,{"key":}] will be parsed as [null, null, {"key":null}]
-#
-# --------------------------------------------------------------------
-
-OBJS                           = md5.o utils.o json2xml.o object.o json_parser.o
-UTIL_DIR                       = ../utils
-DEST_INCLUDE   = objson
-CFLAGS                 += -DSTRICT_JSON_WRITE #-DSTRICT_JSON_READ
-
-JSON_HEADERS = object.h json_parser.h json2xml.h
-
-all:   test
-
-test: libobjson.so objson_test.o
-
-objson_test.o: objson_test.c 
-object.o:      object.h object.c
-json_parser.o: json_parser.h json_parser.c
-
-install:
-       mkdir -p $(INCLUDEDIR)/$(DEST_INCLUDE)
-       cp $(TMPDIR)/$(DEST_INCLUDE)/*.h $(INCLUDEDIR)/objson/
-       cp $(TMPDIR)/libobjson.so $(LIBDIR)/libobjson.so
-
-libobjson.so:  $(OBJS)
-       $(CC) -shared -W1 $(OBJS) -o $(TMPDIR)/libobjson.so
-       $(CC) -shared -W1 $(OBJS) -o libobjson.so
-       mkdir -p $(TMPDIR)/$(DEST_INCLUDE)/
-       cp $(JSON_HEADERS) $(TMPDIR)/$(DEST_INCLUDE)/
-
-utils.o:       $(UTIL_DIR)/utils.h $(UTIL_DIR)/utils.c
-       cp $(UTIL_DIR)/utils.h .
-       cp $(UTIL_DIR)/utils.c .
-       $(CC) -c $(CFLAGS) utils.c -o $@
-
-md5.o: $(UTIL_DIR)/md5.h $(UTIL_DIR)/md5.c
-       cp $(UTIL_DIR)/md5.h .
-       cp $(UTIL_DIR)/md5.c .
-       $(CC) -c $(CFLAGS) md5.c -o $@
-
-json2xml.o:    json2xml.h json2xml.c
-       $(CC) -c $(CFLAGS) json2xml.c -o $@
-
-
-clean:
-       /bin/rm -f *.o *.so utils.c utils.h libobjson.so
-
diff --git a/OpenSRF/src/objson/json2xml.c b/OpenSRF/src/objson/json2xml.c
deleted file mode 100644 (file)
index ef4fa19..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-
-#include "json2xml.h"
-
-static char* _escape_xml (char*);
-static int _recurse_jsonObjectToXML(jsonObject*, growing_buffer*);
-
-char* jsonObjectToXML(jsonObject* obj) {
-
-       growing_buffer * res_xml;
-       char * output;
-
-       res_xml = buffer_init(1024);
-
-       if (!obj)
-               return strdup("<null/>");
-       
-       _recurse_jsonObjectToXML( obj, res_xml );
-       output = buffer_data(res_xml);
-       
-       buffer_free(res_xml);
-
-       return output;
-
-}
-
-int _recurse_jsonObjectToXML(jsonObject* obj, growing_buffer* res_xml) {
-
-       char * hint = NULL;
-       char * bool_val = NULL;
-       int i = 0;
-       
-       if (obj->classname)
-               hint = strdup(obj->classname);
-
-       if(obj->type == JSON_NULL) {
-
-               if (hint)
-                       buffer_fadd(res_xml, "<null class_hint=\"%s\"/>",hint);
-               else
-                       buffer_add(res_xml, "<null/>");
-
-       } else if(obj->type == JSON_BOOL) {
-
-               if (obj->value.b)
-                       bool_val = strdup("true");
-               else
-                       bool_val = strdup("false");
-
-               if (hint)
-                       buffer_fadd(res_xml, "<boolean value=\"%s\" class_hint=\"%s\"/>", bool_val, hint);
-               else
-                       buffer_fadd(res_xml, "<boolean value=\"%s\"/>", bool_val);
-
-               free(bool_val);
-                
-       } else if (obj->type == JSON_STRING) {
-               if (hint) {
-                       char * t = _escape_xml(jsonObjectGetString(obj));
-                       buffer_fadd(res_xml,"<string class_hint=\"%s\">%s</string>", hint, t);
-                       free(t);
-               } else {
-                       char * t = _escape_xml(jsonObjectGetString(obj));
-                       buffer_fadd(res_xml,"<string>%s</string>", t);
-                       free(t);
-               }
-
-       } else if(obj->type == JSON_NUMBER) {
-               double x = jsonObjectGetNumber(obj);
-               if (hint) {
-                       if (x == (int)x)
-                               buffer_fadd(res_xml,"<number class_hint=\"%s\">%d</number>", hint, (int)x);
-                       else
-                               buffer_fadd(res_xml,"<number class_hint=\"%s\">%f</number>", hint, x);
-               } else {
-                       if (x == (int)x)
-                               buffer_fadd(res_xml,"<number>%d</number>", (int)x);
-                       else
-                               buffer_fadd(res_xml,"<number>%f</number>", x);
-               }
-
-       } else if (obj->type == JSON_ARRAY) {
-
-               if (hint) 
-                       buffer_fadd(res_xml,"<array class_hint=\"%s\">", hint);
-               else
-                               buffer_add(res_xml,"<array>");
-
-               for ( i = 0; i!= obj->size; i++ )
-                       _recurse_jsonObjectToXML(jsonObjectGetIndex(obj,i), res_xml);
-
-               buffer_add(res_xml,"</array>");
-
-       } else if (obj->type == JSON_HASH) {
-
-               if (hint)
-                       buffer_fadd(res_xml,"<object class_hint=\"%s\">", hint);
-               else
-                       buffer_add(res_xml,"<object>");
-
-                jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-                jsonObjectNode* tmp;
-                while( (tmp = jsonObjectIteratorNext(itr)) ) {
-
-                       buffer_fadd(res_xml,"<element key=\"%s\">",tmp->key);
-
-                       _recurse_jsonObjectToXML(tmp->item, res_xml);
-
-                       buffer_add(res_xml,"</element>");
-                }
-                jsonObjectIteratorFree(itr);
-
-               buffer_add(res_xml,"</object>");
-       }
-
-       if (hint)
-               free(hint);
-
-       return 1;
-}
-
-char* _escape_xml (char* text) {
-       char* out;
-       growing_buffer* b = buffer_init(256);
-       int len = strlen(text);
-       int i;
-       for (i = 0; i < len; i++) {
-               if (text[i] == '&')
-                       buffer_add(b,"&amp;");
-               else if (text[i] == '<')
-                       buffer_add(b,"&lt;");
-               else if (text[i] == '>')
-                       buffer_add(b,"&gt;");
-               else
-                       buffer_add_char(b,text[i]);
-       }
-       out = buffer_data(b);
-       buffer_free(b);
-       return out;
-}
-
-
diff --git a/OpenSRF/src/objson/json2xml.h b/OpenSRF/src/objson/json2xml.h
deleted file mode 100644 (file)
index 47b5a4f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include <string.h>
-#include <stdio.h>
-
-/* the JSON parser, so we can read the response we're XMLizing */
-#include "object.h"
-#include "json_parser.h"
-#include "utils.h"
-
-char* jsonObjectToXML(jsonObject*);
-
diff --git a/OpenSRF/src/objson/json_parser.c b/OpenSRF/src/objson/json_parser.c
deleted file mode 100644 (file)
index d75431f..0000000
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-#include "json_parser.h"
-
-/* keep a copy of the length of the current json string so we don't 
- * have to calculate it in each function
- */
-int current_strlen; /* XXX need to move this into the function params for thread support */
-
-
-jsonObject* jsonParseString( char* string) {
-       return json_parse_string( string );
-}
-
-jsonObject* jsonParseStringFmt( char* string, ... ) {
-       VA_LIST_TO_STRING(string);
-       return json_parse_string( VA_BUF );
-}
-
-
-
-//jsonObject* (*jsonParseString) (char* str) = &_jsonParseString;
-
-jsonObject* json_parse_string(char* string) {
-
-       if(string == NULL) return NULL;
-
-       current_strlen = strlen(string);
-
-       if(current_strlen == 0) 
-               return NULL;
-
-       unsigned long index = 0;
-
-       json_eat_ws(string, &index, 1, current_strlen); /* remove leading whitespace */
-       if(index == current_strlen) return NULL;
-
-       jsonObject* obj = jsonNewObject(NULL);
-
-       int status = _json_parse_string(string, &index, obj, current_strlen);
-       if(!status) return obj;
-
-       if(status == -2) {
-               jsonObjectFree(obj);
-               return NULL;
-       }
-
-       return NULL;
-}
-
-
-int _json_parse_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( !string || !index || *index >= current_strlen) return -2;
-
-       int status = 0; /* return code from parsing routines */
-       char* classname = NULL; /* object class hint */
-       json_eat_ws(string, index, 1, current_strlen); /* remove leading whitespace */
-
-       char c = string[*index];
-
-       /* remove any leading comments */
-       if( c == '/' ) { 
-
-               while(1) {
-                       (*index)++; /* move to second comment char */
-                       status = json_eat_comment(string, index, &classname, 1, current_strlen);
-                       if(status) return status;
-
-                       json_eat_ws(string, index, 1, current_strlen);
-                       c = string[*index];
-                       if(c != '/')
-                               break;
-               }
-       }
-
-       json_eat_ws(string, index, 1, current_strlen); /* remove leading whitespace */
-
-       if(*index >= current_strlen)
-               return -2;
-
-       switch(c) {
-                               
-               /* json string */
-               case '"': 
-                       (*index)++;
-                       status = json_parse_json_string(string, index, obj, current_strlen); break;
-
-               /* json array */
-               case '[':
-                       (*index)++;
-                       status = json_parse_json_array(string, index, obj, current_strlen);                     
-                       break;
-
-               /* json object */
-               case '{':
-                       (*index)++;
-                       status = json_parse_json_object(string, index, obj, current_strlen);
-                       break;
-
-               /* NULL */
-               case 'n':
-               case 'N':
-                       status = json_parse_json_null(string, index, obj, current_strlen);
-                       break;
-                       
-
-               /* true, false */
-               case 'f':
-               case 'F':
-               case 't':
-               case 'T':
-                       status = json_parse_json_bool(string, index, obj, current_strlen);
-                       break;
-
-               default:
-                       if(is_number(c) || c == '.' || c == '-') { /* are we a number? */
-                               status = json_parse_json_number(string, index, obj, current_strlen);    
-                               if(status) return status;
-                               break;
-                       }
-
-                       (*index)--;
-                       /* we should never get here */
-                       return json_handle_error(string, index, "_json_parse_string() final switch clause");
-       }       
-
-       if(status) return status;
-
-       json_eat_ws(string, index, 1, current_strlen);
-
-       if( *index < current_strlen ) {
-               /* remove any trailing comments */
-               c = string[*index];
-               if( c == '/' ) { 
-                       (*index)++;
-                       status = json_eat_comment(string, index, NULL, 0, current_strlen);
-                       if(status) return status;
-               }
-       }
-
-       if(classname){
-               jsonObjectSetClass(obj, classname);
-               free(classname);
-       }
-
-       return 0;
-}
-
-
-int json_parse_json_null(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-
-       if(*index >= (current_strlen - 3)) {
-               return json_handle_error(string, index, 
-                       "_parse_json_null(): invalid null" );
-       }
-
-       if(!strncasecmp(string + (*index), "null", 4)) {
-               (*index) += 4;
-               obj->type = JSON_NULL;
-               return 0;
-       } else {
-               return json_handle_error(string, index,
-                       "_parse_json_null(): invalid null" );
-       }
-}
-
-/* should be at the first character of the bool at this point */
-int json_parse_json_bool(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! obj || *index >= current_strlen ) return -1;
-
-       char* ret = "json_parse_json_bool(): truncated bool";
-
-       if( *index > (current_strlen - 4))
-               return json_handle_error(string, index, ret);
-
-       if(!strncasecmp( string + (*index), "true", 4)) {
-               (*index) += 4;
-               obj->value.b = 1;
-               obj->type = JSON_BOOL;
-               return 0;
-       }
-
-       if( *index > (current_strlen - 5))
-               return json_handle_error(string, index, ret);
-       
-       if(!strncasecmp( string + (*index), "false", 5)) {
-               (*index) += 5;
-               obj->value.b = 0;
-               obj->type = JSON_BOOL;
-               return 0;
-       }
-
-       return json_handle_error(string, index, ret);
-}
-
-
-/* expecting the first character of the number */
-int json_parse_json_number(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! obj || *index >= current_strlen ) return -1;
-
-       growing_buffer* buf = buffer_init(64);
-       char c = string[*index];
-
-       int done = 0;
-       int dot_seen = 0;
-
-       /* negative number? */
-       if(c == '-') { buffer_add(buf, "-"); (*index)++; }
-
-       c = string[*index];
-
-       while(*index < current_strlen) {
-
-               if(is_number(c)) {
-                       buffer_add_char(buf, c);
-               }
-
-               else if( c == '.' ) {
-                       if(dot_seen) {
-                               buffer_free(buf);
-                               return json_handle_error(string, index, 
-                                       "json_parse_json_number(): malformed json number");
-                       }
-                       dot_seen = 1;
-                       buffer_add_char(buf, c);
-               } else {
-                       done = 1; break;
-               }
-
-               (*index)++;
-               c = string[*index];
-               if(done) break;
-       }
-
-       obj->type = JSON_NUMBER;
-       obj->value.n = strtod(buf->buf, NULL);
-       buffer_free(buf);
-       return 0;
-}
-
-/* index should point to the character directly following the '['.  when done
- * index will point to the character directly following the ']' character
- */
-int json_parse_json_array(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-
-       if( ! string || ! obj || ! index || *index >= current_strlen ) return -1;
-
-       int status = 0;
-       int in_parse = 0; /* true if this array already contains one item */
-       obj->type = JSON_ARRAY;
-       int set = 0;
-       int done = 0;
-
-       while(*index < current_strlen) {
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] == ']') {
-                       (*index)++;
-                       done = 1;
-                       break;
-               }
-
-               if(in_parse) {
-                       json_eat_ws(string, index, 1, current_strlen);
-                       if(string[*index] != ',') {
-                               return json_handle_error(string, index,
-                                       "json_parse_json_array(): array item not followed by a ','");
-                       }
-                       (*index)++;
-                       json_eat_ws(string, index, 1, current_strlen);
-               }
-
-               jsonObject* item = jsonNewObject(NULL);
-
-               #ifndef STRICT_JSON_READ
-               if(*index < current_strlen) {
-                       if(string[*index] == ',' || string[*index] == ']') {
-                               status = 0;
-                               set = 1;
-                       }
-               }
-               if(!set) status = _json_parse_string(string, index, item, current_strlen);
-
-               #else
-               status = _json_parse_string(string, index, item, current_strlen);
-               #endif
-
-               if(status) { jsonObjectFree(item); return status; }
-               jsonObjectPush(obj, item);
-               in_parse = 1;
-               set = 0;
-       }
-
-       if(!done)
-               return json_handle_error(string, index,
-                       "json_parse_json_array(): array not closed");
-
-       return 0;
-}
-
-
-/* index should point to the character directly following the '{'.  when done
- * index will point to the character directly following the '}'
- */
-int json_parse_json_object(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || !obj || ! index || *index >= current_strlen ) return -1;
-
-       obj->type = JSON_HASH;
-       int status;
-       int in_parse = 0; /* true if we've already added one item to this object */
-       int set = 0;
-       int done = 0;
-
-       while(*index < current_strlen) {
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] == '}') {
-                       (*index)++;
-                       done = 1;
-                       break;
-               }
-
-               if(in_parse) {
-                       if(string[*index] != ',') {
-                               return json_handle_error(string, index,
-                                       "json_parse_json_object(): object missing ',' between elements" );
-                       }
-                       (*index)++;
-                       json_eat_ws(string, index, 1, current_strlen);
-               }
-
-               /* first we grab the hash key */
-               jsonObject* key_obj = jsonNewObject(NULL);
-               status = _json_parse_string(string, index, key_obj, current_strlen);
-               if(status) return status;
-
-               if(key_obj->type != JSON_STRING) {
-                       return json_handle_error(string, index, 
-                               "_json_parse_json_object(): hash key not a string");
-               }
-
-               char* key = key_obj->value.s;
-
-               json_eat_ws(string, index, 1, current_strlen);
-
-               if(string[*index] != ':') {
-                       return json_handle_error(string, index, 
-                               "json_parse_json_object(): hash key not followed by ':' character");
-               }
-
-               (*index)++;
-
-               /* now grab the value object */
-               json_eat_ws(string, index, 1, current_strlen);
-               jsonObject* value_obj = jsonNewObject(NULL);
-
-#ifndef STRICT_JSON_READ
-               if(*index < current_strlen) {
-                       if(string[*index] == ',' || string[*index] == '}') {
-                               status = 0;
-                               set = 1;
-                       }
-               }
-               if(!set)
-                       status = _json_parse_string(string, index, value_obj, current_strlen);
-
-#else
-                status = _json_parse_string(string, index, value_obj, current_strlen);
-#endif
-
-               if(status) return status;
-
-               /* put the data into the object and continue */
-               jsonObjectSetKey(obj, key, value_obj);
-               jsonObjectFree(key_obj);
-               in_parse = 1;
-               set = 0;
-       }
-
-       if(!done)
-               return json_handle_error(string, index,
-                       "json_parse_json_object(): object not closed");
-
-       return 0;
-}
-
-
-
-/* when done, index will point to the character after the closing quote */
-int json_parse_json_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen) {
-       if( ! string || ! index || *index >= current_strlen ) return -1;
-
-       int in_escape = 0;      
-       int done = 0;
-       growing_buffer* buf = buffer_init(64);
-
-       while(*index < current_strlen) {
-
-               char c = string[*index]; 
-
-               switch(c) {
-
-                       case '\\':
-                               if(in_escape) {
-                                       buffer_add(buf, "\\");
-                                       in_escape = 0;
-                               } else 
-                                       in_escape = 1;
-                               break;
-
-                       case '"':
-                               if(in_escape) {
-                                       buffer_add(buf, "\"");
-                                       in_escape = 0;
-                               } else 
-                                       done = 1;
-                               break;
-
-                       case 't':
-                               if(in_escape) {
-                                       buffer_add(buf,"\t");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'b':
-                               if(in_escape) {
-                                       buffer_add(buf,"\b");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'f':
-                               if(in_escape) {
-                                       buffer_add(buf,"\f");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'r':
-                               if(in_escape) {
-                                       buffer_add(buf,"\r");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'n':
-                               if(in_escape) {
-                                       buffer_add(buf,"\n");
-                                       in_escape = 0;
-                               } else 
-                                       buffer_add_char(buf, c);
-                               break;
-
-                       case 'u':
-                               if(in_escape) {
-                                       (*index)++;
-
-                                       if(*index >= (current_strlen - 4)) {
-                                               buffer_free(buf);
-                                               return json_handle_error(string, index,
-                                                       "json_parse_json_string(): truncated escaped unicode"); }
-
-                                       char buff[5];
-                                       memset(buff,0,5);
-                                       memcpy(buff, string + (*index), 4);
-
-
-                                       /* ----------------------------------------------------------------------- */
-                                       /* ----------------------------------------------------------------------- */
-                                       /* The following chunk was borrowed with permission from 
-                                               json-c http://oss.metaparadigm.com/json-c/ */
-                                       unsigned char utf_out[4];
-                                       memset(utf_out,0,4);
-
-                                       #define hexdigit(x) ( ((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
-
-                                       unsigned int ucs_char =
-                                               (hexdigit(string[*index] ) << 12) +
-                                               (hexdigit(string[*index + 1]) << 8) +
-                                               (hexdigit(string[*index + 2]) << 4) +
-                                               hexdigit(string[*index + 3]);
-       
-                                       if (ucs_char < 0x80) {
-                                               utf_out[0] = ucs_char;
-                                               buffer_add(buf, utf_out);
-
-                                       } else if (ucs_char < 0x800) {
-                                               utf_out[0] = 0xc0 | (ucs_char >> 6);
-                                               utf_out[1] = 0x80 | (ucs_char & 0x3f);
-                                               buffer_add(buf, utf_out);
-
-                                       } else {
-                                               utf_out[0] = 0xe0 | (ucs_char >> 12);
-                                               utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
-                                               utf_out[2] = 0x80 | (ucs_char & 0x3f);
-                                               buffer_add(buf, utf_out);
-                                       }
-                                       /* ----------------------------------------------------------------------- */
-                                       /* ----------------------------------------------------------------------- */
-
-                                       (*index) += 3;
-                                       in_escape = 0;
-
-                               } else {
-
-                                       buffer_add_char(buf, c);
-                               }
-
-                               break;
-
-                       default:
-                               buffer_add_char(buf, c);
-               }
-
-               (*index)++;
-               if(done) break;
-       }
-
-       jsonObjectSetString(obj, buf->buf);
-       buffer_free(buf);
-       return 0;
-}
-
-
-void json_eat_ws(char* string, unsigned long* index, int eat_all, int current_strlen) {
-       if( ! string || ! index ) return;
-       if(*index >= current_strlen)
-               return;
-
-       if( eat_all ) { /* removes newlines, etc */
-               while(string[*index] == ' '     || 
-                               string[*index] == '\n'  ||
-                               string[*index] == '\t') 
-                       (*index)++;
-       }
-
-       else    
-               while(string[*index] == ' ') (*index)++;
-}
-
-
-/* index should be at the '*' character at the beginning of the comment.
- * when done, index will point to the first character after the final /
- */
-int json_eat_comment(char* string, unsigned long* index, char** buffer, int parse_class, int current_strlen) {
-       if( ! string || ! index || *index >= current_strlen ) return -1;
-       
-
-       if(string[*index] != '*' && string[*index] != '/' )
-               return json_handle_error(string, index, 
-                       "json_eat_comment(): invalid character after /");
-
-       /* chop out any // style comments */
-       if(string[*index] == '/') {
-               (*index)++;
-               char c = string[*index];
-               while(*index < current_strlen) {
-                       (*index)++;
-                       if(c == '\n') 
-                               return 0;
-                       c = string[*index];
-               }
-               return 0;
-       }
-
-       (*index)++;
-
-       int on_star                     = 0; /* true if we just saw a '*' character */
-
-       /* we're just past the '*' */
-       if(!parse_class) { /* we're not concerned with class hints */
-               while(*index < current_strlen) {
-                       if(string[*index] == '/') {
-                               if(on_star) {
-                                       (*index)++;
-                                       return 0;
-                               }
-                       }
-
-                       if(string[*index] == '*') on_star = 1;
-                       else on_star = 0;
-
-                       (*index)++;
-               }
-               return 0;
-       }
-
-
-
-       growing_buffer* buf = buffer_init(64);
-
-       int first_dash          = 0;
-       int second_dash = 0;
-       int third_dash          = 0;
-       int fourth_dash = 0;
-
-       int in_hint                     = 0;
-       int done                                = 0;
-
-       /*--S hint--*/   /* <-- Hints  look like this */
-       /*--E hint--*/
-
-       while(*index < current_strlen) {
-               char c = string[*index];
-
-               switch(c) {
-
-                       case '-':
-                               on_star = 0;
-                               if(third_dash)                  fourth_dash = 1;
-                               else if(in_hint)                third_dash      = 1;
-                               else if(first_dash)     second_dash = 1;
-                               else                                            first_dash = 1;
-                               break;
-
-                       case 'S':
-                               on_star = 0;
-                               if(second_dash && !in_hint) {
-                                       (*index)++;
-                                       json_eat_ws(string, index, 1, current_strlen);
-                                       (*index)--; /* this will get incremented at the bottom of the loop */
-                                       in_hint = 1;
-                                       break;
-                               } 
-
-                               if(second_dash && in_hint) {
-                                       buffer_add_char(buf, c);
-                                       break;
-                               }
-
-                       case 'E':
-                               on_star = 0;
-                               if(second_dash && !in_hint) {
-                                       (*index)++;
-                                       json_eat_ws(string, index, 1, current_strlen);
-                                       (*index)--; /* this will get incremented at the bottom of the loop */
-                                       in_hint = 1;
-                                       break;
-                               }
-
-                               if(second_dash && in_hint) {
-                                       buffer_add_char(buf, c);
-                                       break;
-                               }
-
-                       case '*':
-                               on_star = 1;
-                               break;
-
-                       case '/':
-                               if(on_star) 
-                                       done = 1;
-                               else
-                               on_star = 0;
-                               break;
-
-                       default:
-                               on_star = 0;
-                               if(in_hint)
-                                       buffer_add_char(buf, c);
-               }
-
-               (*index)++;
-               if(done) break;
-       }
-
-       if( buf->n_used > 0 && buffer)
-               *buffer = buffer_data(buf);
-
-       buffer_free(buf);
-       return 0;
-}
-
-int is_number(char c) {
-       switch(c) {
-               case '0':
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                       return 1;
-       }
-       return 0;
-}
-
-int json_handle_error(char* string, unsigned long* index, char* err_msg) {
-
-       char buf[60];
-       memset(buf, 0, 60);
-
-       if(*index > 30)
-               strncpy( buf, string + (*index - 30), 59 );
-       else
-               strncpy( buf, string, 59 );
-
-       fprintf(stderr, 
-                       "\nError parsing json string at charracter %c "
-                       "(code %d) and index %ld\nString length: %d\nMsg:\t%s\nNear:\t%s\nFull String:\t%s\n", 
-                       string[*index], string[*index], *index, current_strlen, err_msg, buf, string );
-
-       return -1;
-}
-
-
-jsonObject* jsonParseFile( const char* filename ) {
-       return json_parse_file( filename );
-}
-       
-jsonObject* json_parse_file(const char* filename) {
-       if(!filename) return NULL;
-       char* data = file_to_string(filename);
-       jsonObject* o = json_parse_string(data);
-       free(data);
-       return o;
-}
-
-
-
-
diff --git a/OpenSRF/src/objson/json_parser.h b/OpenSRF/src/objson/json_parser.h
deleted file mode 100644 (file)
index 32b6298..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-
-
-/* ---------------------------------------------------------------------------------------
-       JSON parser.
- * --------------------------------------------------------------------------------------- */
-#ifndef JSON_PARSER_H
-#define JSON_PARSER_H
-
-#include <stdio.h>
-#include "object.h"
-#include "utils.h"
-
-
-
-/* Parses the given JSON string and returns the built object. 
- *     returns NULL (and prints parser error to stderr) on error.  
- */
-
-jsonObject* json_parse_string(char* string);
-
-jsonObject* jsonParseString(char* string);
-jsonObject* jsonParseStringFmt( char* string, ... );
-
-jsonObject* json_parse_file( const char* filename );
-
-jsonObject* jsonParseFile( const char* string );
-
-
-
-/* does the actual parsing work.  returns 0 on success.  -1 on error and
- * -2 if there was no object to build (string was all comments) 
- */
-int _json_parse_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into a string object */
-int json_parse_json_string(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into a number or double object */
-int json_parse_json_number(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns obj into an 'object' object */
-int json_parse_json_object(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* returns 0 on success and turns object into an array object */
-int json_parse_json_array(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* churns through whitespace and increments index as it goes.
- * eat_all == true means we should eat newlines, tabs
- */
-void json_eat_ws(char* string, unsigned long* index, int eat_all, int current_strlen);
-
-int json_parse_json_bool(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-/* removes comments from a json string.  if the comment contains a class hint
- * and class_hint isn't NULL, an allocated char* with the class name will be
- * shoved into *class_hint.  returns 0 on success, -1 on parse error.
- * 'index' is assumed to be at the second character (*) of the comment
- */
-int json_eat_comment(char* string, unsigned long* index, char** class_hint, int parse_class, int current_strlen);
-
-/* prints a useful error message to stderr. always returns -1 */
-int json_handle_error(char* string, unsigned long* index, char* err_msg);
-
-/* returns true if c is 0-9 */
-int is_number(char c);
-
-int json_parse_json_null(char* string, unsigned long* index, jsonObject* obj, int current_strlen);
-
-
-#endif
diff --git a/OpenSRF/src/objson/object.c b/OpenSRF/src/objson/object.c
deleted file mode 100644 (file)
index 782379b..0000000
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "object.h"
-#include "json_parser.h"
-
-
-/* ---------------------------------------------------------------------- */
-/* See object.h for function info */
-/* ---------------------------------------------------------------------- */
-
-
-char* __tabs(int count);
-
-jsonObject* jsonNewObject( const char* stringValue ) { 
-
-       jsonObject* obj = (jsonObject*) safe_malloc(sizeof(jsonObject));
-       obj->size                       = 0;
-       obj->type = JSON_NULL;
-
-       if(stringValue) {
-               obj->type = JSON_STRING;
-               obj->value.s = strdup(stringValue);
-       }
-
-       return obj;
-}
-
-jsonObject* jsonNewObjectFmt( const char* stringValue, ... ) { 
-
-       jsonObject* obj = (jsonObject*) safe_malloc(sizeof(jsonObject));
-       obj->size                       = 0;
-       obj->type = JSON_NULL;
-
-       if(stringValue) {
-               VA_LIST_TO_STRING(stringValue);
-               obj->type = JSON_STRING;
-               obj->value.s = strdup(VA_BUF);
-       }
-
-       return obj;
-}
-
-
-
-
-jsonObject* jsonNewNumberObject( double num ) {
-       jsonObject* o = jsonNewObject(NULL);
-       o->type = JSON_NUMBER;
-       o->value.n = num;
-       return o;
-
-}
-
-
-jsonObjectNode* jsonNewObjectNode( jsonObject* obj ) {
-       jsonObjectNode* node = (jsonObjectNode*) safe_malloc(sizeof(jsonObjectNode));
-       node->item = obj;
-       node->next = NULL;
-       node->index = -1;
-       return node;
-}
-
-unsigned long jsonObjectPush( jsonObject* obj, jsonObject* new_obj) {
-       if(!obj) return -1;
-
-       obj->type = JSON_ARRAY;
-
-       if(new_obj == NULL) {
-               new_obj = jsonNewObject(NULL);
-               new_obj->type = JSON_NULL;
-       }
-
-       jsonObjectNode* node = jsonNewObjectNode(new_obj);
-       node->index = obj->size++;
-
-       if(obj->value.c == NULL) {
-               obj->value.c = node;
-
-       } else {
-               /* append the node onto the end */
-               jsonObjectNode* tmp = obj->value.c;
-               while(tmp) {
-                       if(tmp->next == NULL) break;
-                       tmp = tmp->next;
-               }
-               tmp->next = node;
-       }
-       return obj->size;
-}
-
-unsigned long  jsonObjectSetIndex( jsonObject* obj, unsigned long index, jsonObject* new_obj) {
-       if( obj == NULL ) return -1;
-       obj->type = JSON_ARRAY;
-
-       if(obj->size <= index)
-               obj->size = index + 1;
-
-       if(new_obj == NULL) {
-               new_obj = jsonNewObject(NULL);
-               new_obj->type = JSON_NULL;
-       }
-
-       jsonObjectNode* node = jsonNewObjectNode(new_obj);
-       node->index = index;
-       
-       if( obj->value.c == NULL ) {
-               obj->value.c = node;
-
-       } else {
-
-               if(obj->value.c->index == index) {
-                       jsonObjectNode* tmp = obj->value.c->next;
-                       jsonObjectNodeFree(obj->value.c);
-                       obj->value.c = node;
-                       node->next = tmp;
-
-               } else {
-               
-                       jsonObjectNode* prev = obj->value.c;
-                       jsonObjectNode* cur = prev->next;
-                       int inserted = 0;
-
-                       while(cur != NULL) {
-
-                               /* replace an existing node */
-                               if( cur->index == index ) {
-                                       jsonObjectNode* tmp = cur->next;
-                                       jsonObjectNodeFree(cur);
-                                       node->next = tmp;
-                                       prev->next = node;
-                                       inserted = 1;
-                                       break;
-                                       
-                                       /* instert between two nodes */
-                               } else if( prev->index < index && cur->index > index ) {
-                                       prev->next = node;
-                                       node->next = cur;
-                                       inserted = 1;
-                                       break;
-                               }
-                               prev = cur;
-                               cur = cur->next;
-                       }
-
-                       /* shove on to the end */
-                       if(!inserted) 
-                               prev->next = node;
-               }
-       }
-
-       return obj->size;
-}
-
-
-void _jsonObjectShifIndex( jsonObject* obj, unsigned long index) {
-       if( obj == NULL || index < 0 ) return;
-
-       if(obj->value.c == NULL) {
-               obj->size = 0;
-               return;
-       }
-
-       jsonObjectNode* data = obj->value.c;
-       while(data) {
-               if(data->index >= index)
-                       data->index--;
-               data = data->next;
-       }
-       obj->size--;
-}
-
-unsigned long jsonObjectRemoveIndex( jsonObject* obj, unsigned long index) {
-       if( obj == NULL || index < 0 ) return -1;
-
-       if(obj->value.c == NULL) return 0;
-
-       /* removing the first item in the list */
-       if(obj->value.c->index == index) {
-               jsonObjectNode* tmp = obj->value.c->next;
-               jsonObjectNodeFree(obj->value.c);
-               obj->value.c = tmp;
-               _jsonObjectShiftIndex(obj,index);
-               return obj->size;
-       }
-
-
-       jsonObjectNode* prev = obj->value.c;
-       jsonObjectNode* cur = prev->next;
-
-       while(cur) {
-               if(cur->index == index) {
-                       jsonObjectNode* tmp = cur->next;
-                       jsonObjectNodeFree(cur);
-                       prev->next = tmp;
-                       _jsonObjectShiftIndex(obj, index);
-                       break;
-               }
-               prev = cur;
-               cur = cur->next;
-       }
-
-       return obj->size;       
-}
-
-
-void _jsonObjectShiftIndex(jsonObject* obj, unsigned long index) {
-
-       if( ! obj ) return;
-
-       if(obj->value.c == NULL) {
-               obj->size = 0;
-               return;
-       }
-
-       jsonObjectNode* data = obj->value.c;
-       while(data) {
-               if(data->index >= index)
-                       data->index--;
-               data = data->next;
-       }
-       obj->size--;
-}
-
-
-unsigned long jsonObjectRemoveKey( jsonObject* obj, const char* key) {
-       if( obj == NULL || key == NULL ) return -1;
-
-       if(obj->value.c == NULL) return 0;
-
-       /* removing the first item in the list */
-       if(!strcmp(obj->value.c->key, key)) {
-
-               jsonObjectNode* tmp = obj->value.c->next;
-               jsonObjectNodeFree(obj->value.c);
-
-               obj->value.c = tmp;
-               if(!obj->value.c) obj->size = 0;
-               return obj->size;
-       }
-
-       jsonObjectNode* prev = obj->value.c;
-       jsonObjectNode* cur = prev->next;
-
-       while(cur) {
-               if(!strcmp(cur->key,key)) {
-
-                       jsonObjectNode* tmp = cur->next;
-                       jsonObjectNodeFree(cur);
-                       prev->next = tmp;
-                       obj->size--;
-                       break;
-               }
-               prev = cur;
-               cur = cur->next;
-       }
-
-       return obj->size;
-}
-
-
-unsigned long jsonObjectSetKey( jsonObject* obj, const char* key, jsonObject* new_obj ) {
-       if( obj == NULL || key == NULL ) return -1;
-       obj->type = JSON_HASH;
-
-       if(new_obj == NULL) {
-               new_obj = jsonNewObject(NULL);
-               new_obj->type = JSON_NULL;
-       }
-
-       jsonObjectNode* node = jsonNewObjectNode(new_obj);
-       node->key = strdup(key);
-       
-       if( obj->value.c == NULL ) {
-               obj->value.c = node;
-               obj->size++;
-
-       } else {
-
-               /* replace the first node */
-               if(!strcmp(obj->value.c->key, key)) {
-                       jsonObjectNode* tmp = obj->value.c->next;
-                       jsonObjectNodeFree(obj->value.c);
-                       obj->value.c = node;
-                       node->next = tmp;
-
-               } else {
-               
-                       jsonObjectNode* prev = obj->value.c;
-                       jsonObjectNode* cur = prev->next;
-                       int inserted = 0;
-
-                       while(cur != NULL) {
-
-                               /* replace an existing node */
-                               if( !strcmp(cur->key, key) ) {
-                                       jsonObjectNode* tmp = cur->next;
-                                       jsonObjectNodeFree(cur);
-                                       node->next = tmp;
-                                       prev->next = node;
-                                       inserted = 1;
-                                       break;
-                               }
-                                       
-                               prev = cur;
-                               cur = cur->next;
-                       }
-
-                       /* shove on to the end */
-                       if(!inserted) {
-                               prev->next = node;
-                               obj->size++;
-                       }
-               }
-       }
-
-       return obj->size;
-}
-
-
-void jsonObjectFree( jsonObject* obj) {
-       if(obj == NULL) return;
-
-       free(obj->classname);
-       free(obj->comment);
-
-       if( obj->type == JSON_ARRAY || obj->type == JSON_HASH ) {
-               while(obj->value.c) {
-                       jsonObjectNode* tmp = obj->value.c->next;
-                       jsonObjectNodeFree(obj->value.c);
-                       obj->value.c = tmp;
-               }
-       }
-
-       if(obj->type == JSON_STRING)
-               free(obj->value.s);
-
-       free(obj);
-}
-
-void jsonObjectNodeFree( jsonObjectNode* node ) {
-       if(node == NULL) return;
-       free(node->key);
-       jsonObjectFree(node->item);
-       free(node);
-}
-
-jsonObject* jsonObjectGetIndex( const jsonObject* obj, unsigned long index ) {
-
-       if( obj && index >= 0 && 
-                       index < obj->size && obj->type == JSON_ARRAY ) {
-
-               jsonObjectNode* node = obj->value.c;
-               while(node) {
-                       if(node->index == index)
-                               return node->item;
-                       node = node->next;
-               }
-       }
-
-       return NULL;
-}
-
-jsonObject* jsonObjectGetKey( const jsonObject* obj, const char* key ) {
-
-       if( obj && key && obj->type == JSON_HASH ) {
-
-               jsonObjectNode* node = obj->value.c;
-       
-               while(node) {
-                       if(node->key && !strcmp(node->key, key))
-                               return node->item;
-                       node = node->next;
-               }       
-       }
-
-       return NULL;
-}
-
-char* jsonObjectGetString( const jsonObject* obj ) {
-       if( obj && obj->type == JSON_STRING ) return obj->value.s;
-       return NULL;
-}
-
-double jsonObjectGetNumber( const jsonObject* obj ) {
-       if( obj && obj->type == JSON_NUMBER ) return obj->value.n;
-       return 0;
-}
-
-void jsonObjectSetString( jsonObject* obj, const char* string) {
-       if( obj ) {
-               obj->type = JSON_STRING;
-               if(string) obj->value.s = strdup(string);
-               else obj->value.s = NULL; 
-       }
-}
-
-
-void jsonObjectSetNumber( jsonObject* obj, double num) {
-       if(obj) {
-               obj->type = JSON_NUMBER;
-               obj->value.n = num;
-       }
-}
-
-
-void jsonObjectSetClass( jsonObject* obj, const char* classname) {
-       if( obj == NULL || classname == NULL ) return;
-       obj->classname = strdup(classname);
-}
-
-
-
-char* jsonObjectToJSON( const jsonObject* obj ) {
-
-       if(obj == NULL) return strdup("null");
-
-       growing_buffer* buf = buffer_init(64);
-
-       /* add class hints if we have a class name */
-       if(obj->classname) {
-               buffer_add(buf,"/*--S ");
-               buffer_add(buf,obj->classname);
-               buffer_add(buf, "--*/");
-       }
-
-       switch( obj->type ) {
-
-               case JSON_BOOL: 
-                       if(obj->value.b) buffer_add(buf, "true"); 
-                       else buffer_add(buf, "false"); 
-                       break;
-
-               case JSON_NUMBER: {
-                       double x = obj->value.n;
-
-                       /* if the number does not need to be a double,
-                               turn it into an int on the way out */
-                       if( x == (int) x ) {
-                               INT_TO_STRING((int)x);  
-                               buffer_add(buf, INTSTR);
-
-                       } else {
-                               DOUBLE_TO_STRING(x);
-                               buffer_add(buf, DOUBLESTR);
-                       }
-                       break;
-               }
-
-               case JSON_NULL:
-                       buffer_add(buf, "null");
-                       break;
-
-               case JSON_STRING:
-                       buffer_add(buf, "\"");
-                       char* data = obj->value.s;
-                       int len = strlen(data);
-                       
-                       char* output = uescape(data, len, 1);
-                       buffer_add(buf, output);
-                       free(output);
-                       buffer_add(buf, "\"");
-                       break;
-
-               case JSON_ARRAY:
-                       buffer_add(buf, "[");
-                       int i;
-                       for( i = 0; i!= obj->size; i++ ) {
-                               const jsonObject* x = jsonObjectGetIndex(obj,i);
-                               char* data = jsonObjectToJSON(x);
-       
-#ifdef STRICT_JSON_WRITE
-                               buffer_add(buf, data);
-#else
-                               if(strcmp(data,"null")) /* only add the string if it isn't null */
-                                       buffer_add(buf, data);
-#endif
-       
-                               free(data);
-                               if(i != obj->size - 1)
-                                       buffer_add(buf, ",");
-                       }
-                       buffer_add(buf, "]");
-                       break;  
-
-               case JSON_HASH:
-       
-                       buffer_add(buf, "{");
-                       jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-                       jsonObjectNode* tmp;
-       
-                       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-
-                               buffer_add(buf, "\"");
-
-                               char* key = tmp->key;
-                               int len = strlen(key);
-                               char* output = uescape(key, len, 1);
-                               buffer_add(buf, output);
-                               free(output);
-
-                               buffer_add(buf, "\":");
-                               char* data =  jsonObjectToJSON(tmp->item);
-
-#ifdef STRICT_JSON_WRITE
-                               buffer_add(buf, data);
-#else
-                               if(strcmp(data,"null")) /* only add the string if it isn't null */
-                                       buffer_add(buf, data);
-#endif
-
-                               if(jsonObjectIteratorHasNext(itr))
-                                       buffer_add(buf, ",");
-                               free(data);
-                       }
-
-                       jsonObjectIteratorFree(itr);
-                       buffer_add(buf, "}");
-                       break;
-               
-                       default:
-                               fprintf(stderr, "Unknown object type %d\n", obj->type);
-                               break;
-                               
-       }
-
-       /* close out the object hint */
-       if(obj->classname) {
-               buffer_add(buf, "/*--E ");
-               buffer_add(buf, obj->classname);
-               buffer_add(buf, "--*/");
-       }
-
-       if(obj->comment) {
-               buffer_add(buf, " /*");
-               buffer_add(buf, obj->comment);
-               buffer_add(buf, "*/");
-       }
-
-       char* data = buffer_data(buf);
-       buffer_free(buf);
-       return data;
-
-}
-
-
-void jsonObjectSetComment( jsonObject* obj, const char* com) {
-       if( obj == NULL || com == NULL ) return;
-       obj->comment = strdup(com);
-}
-
-
-char* __tabs(int count) {
-       growing_buffer* buf = buffer_init(24);
-       int i;
-       for(i=0;i!=count;i++) buffer_add(buf, "   ");
-       char* final = buffer_data( buf );
-       buffer_free( buf );
-       return final;
-}
-
-char* jsonFormatString( const char* string ) {
-
-       if(!string) return strdup("");
-
-       growing_buffer* buf = buffer_init(64);
-       int i;
-       int depth = 0;
-       char* tab = NULL;
-
-       for(i=0; i!= strlen(string); i++) {
-
-               if( string[i] == '{' || string[i] == '[' ) {
-
-                       tab = __tabs(++depth);
-                       buffer_fadd( buf, "%c\n%s", string[i], tab);
-                       free(tab);
-
-               } else if( string[i] == '}' || string[i] == ']' ) {
-
-                       tab = __tabs(--depth);
-                       buffer_fadd( buf, "\n%s%c", tab, string[i]);
-                       free(tab);
-
-                       if(string[i+1] != ',') {
-                               tab = __tabs(depth);
-                               buffer_fadd( buf, "\n%s", tab );        
-                               free(tab);
-                       }
-
-               } else if( string[i] == ',' ) {
-
-                       tab = __tabs(depth);
-                       buffer_fadd(buf, ",\n%s", tab);
-                       free(tab);
-
-               } else { buffer_add_char(buf, string[i]); }
-
-       }
-
-       char* result = buffer_data(buf);
-       buffer_free(buf);
-       return result;
-
-}
-
-
-jsonObject* jsonObjectClone(const jsonObject* o) {
-       if(!o) return NULL;
-       char* json = jsonObjectToJSON(o);
-       jsonObject* newo = jsonParseString(json);
-       free(json);
-       return newo;
-}
-
-
-
-/* ---------------------------------------------------------------------- */
-/* Iterator */
-
-jsonObjectIterator* jsonNewObjectIterator(const jsonObject* obj) {
-
-       if(!obj) return NULL;
-       jsonObjectIterator* iter = safe_malloc(sizeof(jsonObjectIterator));
-       iter->obj = obj;
-
-       if( obj->type ==  JSON_HASH || obj->type == JSON_ARRAY ) 
-               iter->current = obj->value.c;
-       else iter->current = NULL;
-       return iter;
-}
-
-jsonObjectNode* jsonObjectIteratorNext( jsonObjectIterator* itr ) {
-       if( itr == NULL ) return NULL;
-
-       jsonObjectNode* tmp = itr->current;
-       if(tmp == NULL) return NULL;
-       itr->current = itr->current->next;
-
-       return tmp;
-}
-
-void jsonObjectIteratorFree(jsonObjectIterator* iter) { 
-       free(iter);
-}
-
-int jsonObjectIteratorHasNext(const jsonObjectIterator* itr) {
-       return (itr && itr->current);
-}
-
-
-jsonObject* jsonObjectFindPath( const jsonObject* obj, char* format, ...) {
-       if(!obj || !format || strlen(format) < 1) return NULL;  
-
-       VA_LIST_TO_STRING(format);
-       char* buf = VA_BUF;
-
-       /* tmp storage for strtok_r */
-       //char tokbuf[len];             
-       //bzero(tokbuf, len);
-
-       char* token = NULL;
-       char* t = buf;
-       //char* tt = tokbuf;
-       char* tt; /* strtok storage */
-
-       /* copy the path before strtok_r destroys it */
-       char* pathcopy = strdup(buf);
-
-       /* grab the root of the path */
-       token = strtok_r(t, "/", &tt);
-       if(!token) return NULL;
-
-       /* special case where path starts with //  (start anywhere) */
-       if(strlen(pathcopy) > 2 && pathcopy[0] == '/' && pathcopy[1] == '/') {
-               jsonObject* it = _jsonObjectFindPathRecurse(obj, token, pathcopy + 1);
-               free(pathcopy);
-               return it;
-       }
-
-       free(pathcopy);
-
-       t = NULL;
-       do { 
-               obj = jsonObjectGetKey(obj, token);
-       } while( (token = strtok_r(NULL, "/", &tt)) && obj);
-
-       return jsonObjectClone(obj);
-}
-
-/* --------------------------------------------------------------- */
-
-
-
-jsonObject* _jsonObjectFindPathRecurse(const jsonObject* obj, char* root, char* path) {
-
-       if(!obj || ! root || !path) return NULL;
-
-       /* collect all of the potential objects */
-       jsonObject* arr = __jsonObjectFindPathRecurse(obj, root);
-
-       /* container for fully matching objects */
-       jsonObject* newarr = jsonParseString("[]");
-       int i;
-
-       /* path is just /root or /root/ */
-       if( strlen(root) + 2 >= strlen(path) ) {
-               return arr;
-
-       } else {
-
-               /* gather all of the sub-objects that match the full path */
-               for( i = 0; i < arr->size; i++ ) {
-                       jsonObject* a = jsonObjectGetIndex(arr, i);
-                       jsonObject* thing = jsonObjectFindPath(a , path + strlen(root) + 1); 
-
-                       if(thing) { //jsonObjectPush(newarr, thing);
-               if(thing->type == JSON_ARRAY) {
-               int i;
-                                       for( i = 0; i != thing->size; i++ )
-                                               jsonObjectPush(newarr, jsonObjectClone(jsonObjectGetIndex(thing,i)));
-                                       jsonObjectFree(thing);
-
-                               } else {
-                                       jsonObjectPush(newarr, thing);
-                               }                                               
-                       }
-               }
-       }
-       
-       jsonObjectFree(arr);
-       return newarr;
-}
-
-jsonObject* __jsonObjectFindPathRecurse(const jsonObject* obj, char* root) {
-
-       jsonObject* arr = jsonParseString("[]");
-       if(!obj) return arr;
-
-       int i;
-
-       /* if the current object has a node that matches, add it */
-
-       jsonObject* o = jsonObjectGetKey(obj, root);
-       if(o) jsonObjectPush( arr, jsonObjectClone(o) );
-
-       jsonObjectNode* tmp = NULL;
-       jsonObject* childarr;
-       jsonObjectIterator* itr = jsonNewObjectIterator(obj);
-
-       /* recurse through the children and find all potential nodes */
-       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-               childarr = __jsonObjectFindPathRecurse(tmp->item, root);
-               if(childarr && childarr->size > 0) {
-                       for( i = 0; i!= childarr->size; i++ ) {
-                               jsonObjectPush( arr, jsonObjectClone(jsonObjectGetIndex(childarr, i)) );
-                       }
-               }
-               jsonObjectFree(childarr);
-       }
-
-       jsonObjectIteratorFree(itr);
-
-       return arr;
-}
-
-
-char* jsonObjectToSimpleString( const jsonObject* o ) {
-       char* value = NULL;
-
-       if(o) {
-               switch( o->type ) {
-
-                       case JSON_NUMBER: {
-
-                               if( o->value.n == (int) o->value.n ) {
-                                       INT_TO_STRING((int) o->value.n);        
-                                       value = strdup(INTSTR);
-       
-                               } else {
-                                       DOUBLE_TO_STRING(o->value.n);
-                                       value = strdup(DOUBLESTR);
-                               }
-
-                               break;
-                       }
-
-                       case JSON_STRING:
-                               value = strdup(o->value.s);
-               }
-       }       
-       return value;
-}
-
-
-int jsonBoolIsTrue( const jsonObject* o ) {
-    return (o && o->type == JSON_BOOL && o->value.b);
-}
-
-
diff --git a/OpenSRF/src/objson/object.h b/OpenSRF/src/objson/object.h
deleted file mode 100644 (file)
index baa63e9..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-
-/* ---------------------------------------------------------------------------------------
-       libjson
- * --------------------------------------------------------------------------------------- */
-
-#ifndef _JSON_OBJECT_H
-#define _JSON_OBJECT_H
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "utils.h"
-
-/* json object types */
-#define JSON_HASH      0
-#define JSON_ARRAY     1
-#define JSON_STRING    2
-#define JSON_NUMBER    3
-#define JSON_NULL      4       
-#define JSON_BOOL      5
-
-
-/* top level generic object structure */
-struct _jsonObjectStruct {
-
-       /* how many sub-objects do we contain if we're an array or an object.  
-               Note that this includes null array elements in sparse arrays */
-       unsigned long size;
-
-       /* optional class hint */
-       char* classname;
-
-       /* see JSON types above */
-       int type;
-
-
-       /* our cargo */
-       union _jsonObjectValue {
-               struct _jsonObjectNodeStruct* c; /* our list of sub-objects if we're an array or a hash */
-               char*           s; /* string */
-               int                     b; /* bool */
-               double          n; /* number */
-       } value;
-       
-
-       /* client may provide a comment string which will be 
-        * added to the object when stringified */
-       char* comment;
-
-};
-typedef struct _jsonObjectStruct jsonObject;
-
-
-/** 
-       String parsing function.  This is assigned by the json_parser code.
-       to avoid circular dependency, declare the parse function here,
-       and have the json parse code set the variable to a real function 
-*/
-//jsonObject* (*jsonParseString) (char* str);
-
-
-/* this contains a single element of the object along with the elements 
- * index (if this object is an array) and key (if this object is a hash)
- */
-struct _jsonObjectNodeStruct {
-
-       unsigned long index; /* our array position */
-       char* key; /* our hash key */
-
-       jsonObject* item; /* our object */
-       struct _jsonObjectNodeStruct* next; /* pointer to the next object node */
-};
-typedef struct _jsonObjectNodeStruct jsonObjectNode;
-
-
-
-/* utility object for iterating over hash objects */
-struct _jsonObjectIteratorStruct {
-       const jsonObject* obj; /* the topic object */
-       jsonObjectNode* current; /* the current node within the object */
-};
-typedef struct _jsonObjectIteratorStruct jsonObjectIterator;
-
-
-/** Allocates a new iterator 
-       @param obj The object over which to iterate.
-*/
-jsonObjectIterator* jsonNewObjectIterator(const jsonObject* obj);
-
-/** 
-       De-allocates an iterator 
-       @param iter The iterator object to free
-*/
-void jsonObjectIteratorFree(jsonObjectIterator* iter);
-
-/** 
-       Returns the object_node currently pointed to by the iterator
-       and increments the pointer to the next node
-       @param iter The iterator in question.
- */
-jsonObjectNode* jsonObjectIteratorNext(jsonObjectIterator* iter);
-
-/** 
-       @param iter The iterator.
-       @return True if there is another node after the current node.
- */
-int jsonObjectIteratorHasNext(const jsonObjectIterator* iter);
-
-
-/** 
-       Allocates a new object. 
-       @param string The string data if this object is to be a string.  
-       if not, string should be NULL 
-       @return The newly allocated object or NULL on memory error.
-*/
-jsonObject* jsonNewObjectFmt(const char* string, ...);
-jsonObject* jsonNewObject(const char* string);
-
-/**
-       Allocates a new JSON number object.
-       @param num The number this object is to hold
-       @return The newly allocated object.
-*/
-jsonObject* jsonNewNumberObject( double num );
-
-
-/** 
-       Returns a pointer to the object at the given index.  This call is
-       only valid if the object has a type of JSON_ARRAY.
-       @param obj The object
-       @param index The position within the object
-       @return The object at the given index.
-*/
-jsonObject* jsonObjectGetIndex( const jsonObject* obj, unsigned long index );
-
-
-/** 
-       Returns a pointer to the object with the given key 
-       @param obj The object
-       @param key The key
-       @return The object with the given key.
-*/
-jsonObject* jsonObjectGetKey( const jsonObject* obj, const char* key );
-
-/** 
-       De-allocates an object.  Note that this function should only be called 
-       on objects that are _not_ children of other objects or there will be
-       double-free's
-       @param obj The object to free.
-*/
-void jsonObjectFree(jsonObject* obj);
-
-
-/** 
-       Allocates a new object node.
-       @param obj The object to which the node will be appended.
-       @return The new object node.
-*/
-jsonObjectNode* jsonNewObjectNode(jsonObject* obj);
-
-/** 
-       De-allocates an object node 
-       @param obj The object node to de-allocate.
-*/
-void jsonObjectNodeFree(jsonObjectNode* obj);
-
-
-/** 
-       Pushes the given object onto the end of the list.  This coerces an object
-       into becoming an array.  _Only_ use this function on objects that you
-       want to become an array.
-       If obj is NULL, inserts a new NULL object into the list.
-       @return array size on success, -1 on error 
- */
-unsigned long jsonObjectPush(jsonObject* dest, jsonObject* newObj);
-
-/* removes (and deallocates) the object at the given index (if one exists) and inserts 
- * the new one.  returns the size on success, -1 on error 
- * If obj is NULL, inserts a new object into the list with is_null set to true
- */
-unsigned long jsonObjectSetIndex(jsonObject* dest, unsigned long index, jsonObject* newObj);
-
-/* inserts the new object, overwriting (removing, deallocating) any 
- * previous object with the given key.
- * returns the size on success, -1 on error 
- * if 'obj' is NULL, a new object is inserted at key 'key' with 'is_null' 
- * set to true
- */
-unsigned long jsonObjectSetKey(jsonObject* dest, const char* key, jsonObject* newObj);
-
-/* removes the object at the given index and, if more items exist,
- * re-indexes (shifts down by 1) the rest of the objects in the array
- */
-unsigned long jsonObjectRemoveIndex(jsonObject* dest, unsigned long index);
-
-/* removes (and deallocates) the object with key 'key' if it exists */
-unsigned long jsonObjectRemoveKey( jsonObject* dest, const char* key);
-
-/* returns a pointer to the string data held by this object if this object
-       is a string.  Otherwise returns NULL*/
-char* jsonObjectGetString(const jsonObject*);
-
-double jsonObjectGetNumber( const jsonObject* obj );
-
-/* sets the string data */
-void jsonObjectSetString(jsonObject* dest, const char* string);
-
-/* sets the number value for the object */
-void jsonObjectSetNumber(jsonObject* dest, double num);
-
-/* sets the class hint for this object */
-void jsonObjectSetClass(jsonObject* dest, const char* classname );
-
-/* converts an object to a json string.  client is responsible for freeing the return string */
-char* jsonObjectToJSON( const jsonObject* obj );
-
-/* set this object's comment string */
-void jsonObjectSetComment(jsonObject* dest, const char* classname);
-
-/* utility method.  starting at index 'index', shifts all indices down by one and 
- * decrements the objects size by 1 
- */
-void _jsonObjectShiftIndex(jsonObject* dest, unsigned long index);
-
-/* formats a JSON string from printing.  User must free returned string */
-char* jsonFormatString( const char* jsonString );
-
-jsonObject* jsonObjectClone( const jsonObject* o );
-
-/* tries to extract the string data from an object.
-       if object -> NULL (the C NULL)
-       if array ->     NULL  (the C NULL)
-       if null  -> NULL (the C NULL)
-       if true/false -> true/false
-       if string/number/double the string version of either of those
-       The caller is responsible for freeing the returned string
-       */
-char* jsonObjectToSimpleString( const jsonObject* o );
-
-int jsonBoolIsTrue( const jsonObject* o );
-
-
-/* ------------------------------------------------------------------------ */
-/* XPATH */
-
-/* provides an XPATH style search interface (e.g. /some/node/here) and 
-       return the object at that location if one exists.  Naturally,  
-       every element in the path must be a proper object ("hash" / {}).
-       Returns NULL if the specified node is not found 
-       Note also that the object returned is a clone and
-       must be freed by the caller
-*/
-jsonObject* jsonObjectFindPath( const jsonObject* obj, char* path, ... );
-
-
-/* Utility method. finds any object in the tree that matches the path.  
-       Use this for finding paths that start with '//' */
-jsonObject* _jsonObjectFindPathRecurse( const jsonObject* o, char* root, char* path );
-
-/* returns a list of object whose key is 'root'.  These are used as
-       potential objects when doing a // search */
-jsonObject* __jsonObjectFindPathRecurse( const jsonObject* o, char* root );
-
-/* ------------------------------------------------------------------------ */
-
-
-#endif
-
-
diff --git a/OpenSRF/src/objson/objson_test.c b/OpenSRF/src/objson/objson_test.c
deleted file mode 100644 (file)
index 20cf2ff..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-//#include "utils.h"
-#include "object.h"
-#include "json_parser.h"
-
-#include <stdio.h>
-#include <fcntl.h>
-
-/* ---------------------------------------------------------------------- */
-/* See object.h for function info */
-/* ---------------------------------------------------------------------- */
-int main() {
-
-
-
-       jsonObject* o;
-
-
-       o = jsonParseString("[  1, 4, 6, 9 ]");
-       jsonObjectIterator* itr = jsonNewObjectIterator(o);
-       jsonObjectNode* tmp = NULL;
-       while( (tmp = jsonObjectIteratorNext(itr)) ) {
-               char* q = jsonObjectToJSON(tmp->item);
-               printf("Iterator thing => %s\n", q);
-               free(q);
-       }
-       jsonObjectIteratorFree(itr);
-       jsonObjectFree(o);
-       
-
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("{\"key\":-1}");
-       char* h = jsonObjectToJSON(o);
-       printf("\nParsed number: %s\n", h);
-       free(h);
-       jsonObjectFree(o);
-
-
-       /* number, double, and 'null' parsing... */
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("1");
-       printf("\nParsed number: %f\n", jsonObjectGetNumber(o));
-       jsonObjectFree(o);
-
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("nUlL");
-       char* s = jsonObjectToJSON(o);
-       printf("\nJSON Null: %s\n", s);
-       free(s);
-       jsonObjectFree(o);
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("[1, .5, null]");
-       s  = jsonObjectToJSON(o);
-       printf("\nJSON MIX: %s\n", s );
-       free(s);
-       jsonObjectFree(o);
-
-       printf("------------------------------------------------------------------\n");
-       /* simulate an error.. */
-       printf("\nShould print error msg: \n");
-       o = jsonParseString("[1, .5. null]");
-       if( o == NULL ) printf("\n"); 
-       jsonObjectFree(o);
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("[ Null, trUe, falSE, 1, 12.9, \"true\" ]");
-       s = jsonObjectToJSON(o);
-       printf("More JSON: %s\n", s);
-       free(s);
-       jsonObjectFree(o);
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("[ Null, trUe, falSE, 1, 12.9, \"true\", "
-                       "{\"key\":[0,0.0,1],\"key2\":null},NULL, { }, [] ]");
-       s = jsonObjectToJSON(o);
-       printf("More JSON: %s\n", s);
-       free(s);
-       jsonObjectFree(o);
-
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("{ Null: trUe }");
-
-
-
-       printf("------------------------------------------------------------------\n");
-       o = jsonParseString("\"Pin\\u0303ata\"");
-       s = jsonObjectToJSON(o);
-       printf("UNICODE:: %s\n", o->value.s);
-       printf("Back to JSON: %s\n", s);
-       jsonObjectFree(o);
-       free(s);
-
-
-       /* sample JSON string with some encoded UTF8 */
-       char* jsons = "/*--S mvr--*/[null,null,null,\"Griswold del Castillo, Richard\",[],null,\"1405676\",null,null,\"1558853243 (alk. paper) :\",\"c2002\",\"Pin\\u0303ata Books\",null,[],[[\"Chavez, Cesar 1927-\",\"Juvenile literature\"],[\"Labor leaders\",\"United States\",\"Biography\",\"Juvenile literature\"],[\"Mexican Americans\",\"Biography\",\"Juvenile literature\"],[\"Agricultural laborers\",\"Labor unions\",\"United States\",\"History\",\"Juvenile literature\"],[\"United Farm Workers\",\"History\",\"Juvenile literature\"],[\"Chavez, Cesar 1927-\"],[\"Labor leaders\"],[\"Mexican Americans\",\"Biography\"],[\"United Farm Workers.\"],[\"Spanish language materials\",\"Bilingual\"],[\"Chavez, Cesar 1927-\",\"Literatura juvenil\"],[\"Li\\u0301deres obreros\",\"Estados Unidos\",\"Biografi\\u0301a\",\"Literatura juvenil\"],[\"Mexicano-americanos\",\"Biografi\\u0301a\",\"Literatura juvenil\"],[\"Sindicatos\",\"Trabajadores agri\\u0301colas\",\"Estados Unidos\",\"Historia\",\"Literatura juvenil\"],[\"Unio\\u0301n de Trabajadores Agri\\u0301colas\",\"Historia\",\"Literatura juvenil\"]],\"ocm48083852 \",\"Ce\\u0301sar Cha\\u0301vez : the struggle for justice = Ce\\u0301sar Cha\\u0301vez : la lucha por la justicia\",[\"text\"], { \"hi\":\"you\"} ]/*--E mvr--*/";
-
-
-       printf("------------------------------------------------------------------\n");
-       printf("\nOriginal JSON\n%s\n", jsons); 
-
-       /* parse the JSON string */
-       jsonObject* yuk = jsonParseString(jsons); 
-
-       /* grab the class name from the object */
-       printf("------------------------------------------------------------------\n");
-       printf("\nParsed object with class %s\n", yuk->classname );
-
-       /* turn the resulting object back into JSON */
-       char* ccc = jsonObjectToJSON(yuk); 
-       
-       /* extract a sub-object from the object and print its data*/
-       o = jsonObjectGetIndex(yuk, 11);
-       printf("\nRandom unicode string => %s\n", jsonObjectGetString(o));
-
-       /* parse the new JSON string to build yet another object */
-       jsonObject* yuk2 = jsonParseString(ccc);
-
-       printf("------------------------------------------------------------------\n");
-       /* turn that one back into JSON and print*/
-       char* cccc = jsonObjectToJSON(yuk2);
-       printf("\nFinal JSON: \n%s\n", cccc);
-
-       char* string2 = strdup(jsons);
-
-       printf("------------------------------------------------------------------\n");
-       int x = 0;
-       int count = 30;
-       printf("\nParsing %d round trips at %f...\n", count, get_timestamp_millis());
-
-       /* parse and stringify many times in a loop to check speed */
-       while(x++ < count) {
-
-               jsonObject* o = jsonParseString(string2); 
-               free(string2);
-               string2 = jsonObjectToJSON(o);
-               jsonObjectFree(o);
-
-               if(!(x % 500))
-                       fprintf(stderr, "Round trip at %d\n", x);
-       }
-
-       printf("After Loop: %f\n", get_timestamp_millis());
-
-
-       free(string2);
-       free(ccc); 
-       free(cccc); 
-
-       /* only free the top level objects.  objects that are 'children'
-               of other objects should not be freed */
-       jsonObjectFree(yuk); 
-       jsonObjectFree(yuk2); 
-
-
-
-       /* ------------------------------------------------------------------------ */
-
-       /* parse a big JSON file */
-       FILE* F = fopen("test.json", "r");
-       if(!F) {
-               perror("unable to open test.json for testing");
-               exit(99);
-       }
-       fclose(F);
-
-       char buf[10240];
-       char smallbuf[512];
-       bzero(buf, 10240);
-       bzero(smallbuf, 512);
-
-       while(fgets(smallbuf, 512, F)) 
-               strcat(buf, smallbuf);
-
-       /* dig our way into the JSON object we parsed, see test.json to get
-          an idea of the object structure */
-       printf("------------------------------------------------------------------\n");
-       jsonObject* big = jsonParseString(buf);
-       jsonObject* k = jsonObjectGetKey(big,"web-app");
-       jsonObject* k2 = jsonObjectGetKey(k,"servlet");
-       jsonObject* k3 = jsonObjectGetIndex(k2, 0);
-       jsonObject* k4 = jsonObjectGetKey(k3,"servlet-class");
-
-       jsonObjectFree(big);
-
-       printf("\nValue for object with key 'servlet-class' in the JSON file => %s\n", jsonObjectGetString(k4));
-       
-
-       return 0;
-}
-
-
diff --git a/OpenSRF/src/patch/README b/OpenSRF/src/patch/README
deleted file mode 100644 (file)
index 02972b4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Note: Copy the source files found in this directory to the location 
-specified in the 'Location' column within the source tree specified
-
-
-Patch                                          Source                          Location                                                                                Purpose
-------------------------------------------------------------------------------------------------------
-
-mod_offline.c                  jabberd-2.0s4           jabberd-2.0s4/sm/mod_offline.c          Disables offline storage 
-------------------------------------------------------------------------------------------------------
-
-nad.c                                          jabberd-2.0s4           jabberd-2.0s4/util/nad.c                                Fixes segfault in a branch of code that we don't use 
-
diff --git a/OpenSRF/src/patch/mod_offline.c b/OpenSRF/src/patch/mod_offline.c
deleted file mode 100644 (file)
index 4234cd7..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * jabberd - Jabber Open Source Server
- * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney,
- *                    Ryan Eatmon, Robert Norris
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
- */
-
-
-/** ! ! !  Patched version to disable offline storage for jabberd-2.0s4 ! ! ! */
-
-#include "sm.h"
-
-/** @file sm/mod_offline.c
-  * @brief offline storage
-  * @author Robert Norris
-  * $Date$
-  * $Revision$
-  */
-
-typedef struct _mod_offline_st {
-    int dropmessages;
-    int dropsubscriptions;
-} *mod_offline_t;
-
-static mod_ret_t _offline_in_sess(mod_instance_t mi, sess_t sess, pkt_t pkt) {
-    st_ret_t ret;
-    os_t os;
-    os_object_t o;
-    os_type_t ot;
-    nad_t nad;
-    pkt_t queued;
-    int ns, elem, attr;
-    char cttl[15], cstamp[18];
-    time_t ttl, stamp;
-
-    /* if they're becoming available for the first time */
-    if(pkt->type == pkt_PRESENCE && pkt->to == NULL && sess->user->top == NULL) {
-
-        ret = storage_get(pkt->sm->st, "queue", jid_user(sess->jid), NULL, &os);
-        if(ret != st_SUCCESS) {
-            log_debug(ZONE, "storage_get returned %d", ret);
-            return mod_PASS;
-        }
-        
-        if(os_iter_first(os))
-            do {
-                o = os_iter_object(os);
-
-                if(os_object_get(o, "xml", (void **) &nad, &ot)) {
-                    queued = pkt_new(pkt->sm, nad_copy(nad));
-                    if(queued == NULL) {
-                        log_debug(ZONE, "invalid queued packet, not delivering");
-                    } else {
-                        /* check expiry as necessary */
-                        if((ns = nad_find_scoped_namespace(queued->nad, uri_EXPIRE, NULL)) >= 0 &&
-                           (elem = nad_find_elem(queued->nad, 1, ns, "x", 1)) >= 0 &&
-                           (attr = nad_find_attr(queued->nad, elem, -1, "seconds", NULL)) >= 0) {
-                            snprintf(cttl, 15, "%.*s", NAD_AVAL_L(queued->nad, attr), NAD_AVAL(queued->nad, attr));
-                            ttl = atoi(cttl);
-
-                            /* it should have a x:delay stamp, because we stamp everything we store */
-                            if((ns = nad_find_scoped_namespace(queued->nad, uri_DELAY, NULL)) >= 0 &&
-                               (elem = nad_find_elem(queued->nad, 1, ns, "x", 1)) >= 0 &&
-                               (attr = nad_find_attr(queued->nad, elem, -1, "stamp", NULL)) >= 0) {
-                                snprintf(cstamp, 18, "%.*s", NAD_AVAL_L(queued->nad, attr), NAD_AVAL(queued->nad, attr));
-                                stamp = datetime_in(cstamp);
-
-                                if(stamp + ttl <= time(NULL)) {
-                                    log_debug(ZONE, "queued packet has expired, dropping");
-                                    pkt_free(queued);
-                                    continue;
-                                }
-                            }
-                        }
-
-                        log_debug(ZONE, "delivering queued packet to %s", jid_full(sess->jid));
-                        pkt_sess(queued, sess);
-                    }
-                }
-            } while(os_iter_next(os));
-
-        os_free(os);
-
-        /* drop the spool */
-        storage_delete(pkt->sm->st, "queue", jid_user(sess->jid), NULL);
-    }
-
-    /* pass it so that other modules and mod_presence can get it */
-    return mod_PASS;
-}
-
-static mod_ret_t _offline_pkt_user(mod_instance_t mi, user_t user, pkt_t pkt) {
-    mod_offline_t offline = (mod_offline_t) mi->mod->private;
-    int ns, elem, attr;
-    os_t os;
-    os_object_t o;
-    pkt_t event;
-
-    /* send messages and s10ns to the top session */
-    if(user->top != NULL && (pkt->type & pkt_MESSAGE || pkt->type & pkt_S10N)) {
-        pkt_sess(pkt, user->top);
-        return mod_HANDLED;
-    }
-
-    /* save messages and s10ns for later */
-    if((pkt->type & pkt_MESSAGE && !offline->dropmessages) ||
-       (pkt->type & pkt_S10N && !offline->dropsubscriptions)) {
-        log_debug(ZONE, "saving message for later");
-
-        pkt_delay(pkt, time(NULL), user->sm->id);
-
-        /* new object */
-        os = os_new();
-        o = os_object_new(os);
-
-        os_object_put(o, "xml", pkt->nad, os_type_NAD);
-
-        /* store it */
-        switch(storage_put(user->sm->st, "queue", jid_user(user->jid), os)) {
-            case st_FAILED:
-                os_free(os);
-                return -stanza_err_INTERNAL_SERVER_ERROR;
-
-            case st_NOTIMPL:
-                os_free(os);
-                return -stanza_err_SERVICE_UNAVAILABLE;     /* xmpp-im 9.5#4 */
-
-            default:
-                os_free(os);
-
-                /* send offline events if they asked for it */
-                if((ns = nad_find_scoped_namespace(pkt->nad, uri_EVENT, NULL)) >= 0 &&
-                   (elem = nad_find_elem(pkt->nad, 1, ns, "x", 1)) >= 0 &&
-                   nad_find_elem(pkt->nad, elem, ns, "offline", 1) >= 0) {
-
-                    event = pkt_create(user->sm, "message", NULL, jid_full(pkt->from), jid_full(pkt->to));
-
-                    attr = nad_find_attr(pkt->nad, 1, -1, "type", NULL);
-                    if(attr >= 0)
-                        nad_set_attr(event->nad, 1, -1, "type", NAD_AVAL(pkt->nad, attr), NAD_AVAL_L(pkt->nad, attr));
-
-                    ns = nad_add_namespace(event->nad, uri_EVENT, NULL);
-                    nad_append_elem(event->nad, ns, "x", 2);
-                    nad_append_elem(event->nad, ns, "offline", 3);
-
-                    nad_append_elem(event->nad, ns, "id", 3);
-                    attr = nad_find_attr(pkt->nad, 1, -1, "id", NULL);
-                    if(attr >= 0)
-                        nad_append_cdata(event->nad, NAD_AVAL(pkt->nad, attr), NAD_AVAL_L(pkt->nad, attr), 4);
-
-                    pkt_router(event);
-                }
-
-                pkt_free(pkt);
-                return mod_HANDLED;
-        }
-    }
-
-    return mod_PASS;
-}
-
-static void _offline_user_delete(mod_instance_t mi, jid_t jid) {
-    os_t os;
-    os_object_t o;
-    os_type_t ot;
-    nad_t nad;
-    pkt_t queued;
-    int ns, elem, attr;
-    char cttl[15], cstamp[18];
-    time_t ttl, stamp;
-
-    log_debug(ZONE, "deleting queue for %s", jid_user(jid));
-
-    /* bounce the queue */
-    if(storage_get(mi->mod->mm->sm->st, "queue", jid_user(jid), NULL, &os) == st_SUCCESS) {
-        if(os_iter_first(os))
-            do {
-                o = os_iter_object(os);
-
-                if(os_object_get(o, "xml", (void **) &nad, &ot)) {
-                    queued = pkt_new(mi->mod->mm->sm, nad);
-                    if(queued == NULL) {
-                        log_debug(ZONE, "invalid queued packet, not delivering");
-                    } else {
-                        /* check expiry as necessary */
-                        if((ns = nad_find_scoped_namespace(queued->nad, uri_EXPIRE, NULL)) >= 0 &&
-                           (elem = nad_find_elem(queued->nad, 1, ns, "x", 1)) >= 0 &&
-                           (attr = nad_find_attr(queued->nad, elem, -1, "seconds", NULL)) >= 0) {
-                            snprintf(cttl, 15, "%.*s", NAD_AVAL_L(queued->nad, attr), NAD_AVAL(queued->nad, attr));
-                            ttl = atoi(cttl);
-
-                            /* it should have a x:delay stamp, because we stamp everything we store */
-                            if((ns = nad_find_scoped_namespace(queued->nad, uri_DELAY, NULL)) >= 0 &&
-                               (elem = nad_find_elem(queued->nad, 1, ns, "x", 1)) >= 0 &&
-                               (attr = nad_find_attr(queued->nad, elem, -1, "stamp", NULL)) >= 0) {
-                                snprintf(cstamp, 18, "%.*s", NAD_AVAL_L(queued->nad, attr), NAD_AVAL(queued->nad, attr));
-                                stamp = datetime_in(cstamp);
-
-                                if(stamp + ttl <= time(NULL)) {
-                                    log_debug(ZONE, "queued packet has expired, dropping");
-                                    pkt_free(queued);
-                                    continue;
-                                }
-                            }
-                        }
-
-                        log_debug(ZONE, "bouncing queued packet from %s", jid_full(queued->from));
-                        pkt_router(pkt_error(queued, stanza_err_ITEM_NOT_FOUND));
-                    }
-                }
-            } while(os_iter_next(os));
-
-        os_free(os);
-    }
-    
-    storage_delete(mi->sm->st, "queue", jid_user(jid), NULL);
-}
-
-static void _offline_free(module_t mod) {
-    mod_offline_t offline = (mod_offline_t) mod->private;
-
-    free(offline);
-}
-
-int offline_init(mod_instance_t mi, char *arg) {
-    module_t mod = mi->mod;
-    char *configval;
-    mod_offline_t offline;
-    int dropmessages = 0;
-    int dropsubscriptions = 0;
-
-    if(mod->init) return 0;
-
-    configval = config_get_one(mod->mm->sm->config, "offline.dropmessages", 0);
-    if (configval != NULL)
-        dropmessages = 1;
-    configval = config_get_one(mod->mm->sm->config, "offline.dropsubscriptions", 0);
-    if (configval != NULL)
-        dropsubscriptions = 1;
-
-    offline = (mod_offline_t) malloc(sizeof(struct _mod_offline_st));
-    offline->dropmessages = dropmessages;
-    offline->dropsubscriptions = dropsubscriptions;
-
-    mod->private = offline;
-
-    mod->in_sess = _offline_in_sess;
-    mod->pkt_user = _offline_pkt_user;
-    mod->user_delete = _offline_user_delete;
-    mod->free = _offline_free;
-
-    return 0;
-}
diff --git a/OpenSRF/src/patch/nad.c b/OpenSRF/src/patch/nad.c
deleted file mode 100644 (file)
index d9914c4..0000000
+++ /dev/null
@@ -1,1155 +0,0 @@
-/*
- * jabberd - Jabber Open Source Server
- * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney,
- *                    Ryan Eatmon, Robert Norris
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
- */
-
-
-/** ! ! ! Patched version to fix segfault issue for jabberd-2.0s4 ! ! ! */
-
-/**
- * !!! Things to do (after 2.0)
- *
- * - make nad_find_scoped_namespace() take an element index, and only search
- *   the scope on that element (currently, it searchs all elements from
- *   end to start, which isn't really correct, though it works in most cases
- *
- * - new functions:
- *     * insert one nad (or part thereof) into another nad
- *     * clear a part of a nad (like xmlnode_hide)
- *
- * - audit use of depth array and parent (see j2 bug #792)
- */
-
-#include "util.h"
-
-#ifdef HAVE_EXPAT
-#include "expat/expat.h"
-#endif
-
-/* define NAD_DEBUG to get pointer tracking - great for weird bugs that you can't reproduce */
-#ifdef NAD_DEBUG
-
-static xht _nad_alloc_tracked = NULL;
-static xht _nad_free_tracked = NULL;
-
-static void _nad_ptr_check(const char *func, nad_t nad) {
-    char loc[24];
-    snprintf(loc, sizeof(loc), "%x", (int) nad);
-
-    if(xhash_get(_nad_alloc_tracked, loc) == NULL) {
-        fprintf(stderr, ">>> NAD OP %s: 0x%x not allocated!\n", func, (int) nad);
-        abort();
-    }
-
-    if(xhash_get(_nad_free_tracked, loc) != NULL) {
-        fprintf(stderr, ">>> NAD OP %s: 0x%x previously freed!\n", func, (int) nad);
-        abort();
-    }
-
-    fprintf(stderr, ">>> NAD OP %s: 0x%x\n", func, (int) nad);
-}
-#else
-#define _nad_ptr_check(func,nad)
-#endif
-
-#define BLOCKSIZE 1024
-
-/** internal: do and return the math and ensure it gets realloc'd */
-int _nad_realloc(void **oblocks, int len)
-{
-    void *nblocks;
-    int nlen;
-
-    /* round up to standard block sizes */
-    nlen = (((len-1)/BLOCKSIZE)+1)*BLOCKSIZE;
-
-    /* keep trying till we get it */
-    while((nblocks = realloc(*oblocks, nlen)) == NULL) sleep(1);
-    *oblocks = nblocks;
-    return nlen;
-}
-
-/** this is the safety check used to make sure there's always enough mem */
-#define NAD_SAFE(blocks, size, len) if((size) > len) len = _nad_realloc((void**)&(blocks),(size));
-
-/** internal: append some cdata and return the index to it */
-int _nad_cdata(nad_t nad, const char *cdata, int len)
-{
-    NAD_SAFE(nad->cdata, nad->ccur + len, nad->clen);
-
-    memcpy(nad->cdata + nad->ccur, cdata, len);
-    nad->ccur += len;
-    return nad->ccur - len;
-}
-
-/** internal: create a new attr on any given elem */
-int _nad_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen)
-{
-    int attr;
-
-    /* make sure there's mem for us */
-    NAD_SAFE(nad->attrs, (nad->acur + 1) * sizeof(struct nad_attr_st), nad->alen);
-
-    attr = nad->acur;
-    nad->acur++;
-    nad->attrs[attr].next = nad->elems[elem].attr;
-    nad->elems[elem].attr = attr;
-    nad->attrs[attr].lname = strlen(name);
-    nad->attrs[attr].iname = _nad_cdata(nad,name,nad->attrs[attr].lname);
-    if(vallen > 0)
-        nad->attrs[attr].lval = vallen;
-    else
-        nad->attrs[attr].lval = strlen(val);
-    nad->attrs[attr].ival = _nad_cdata(nad,val,nad->attrs[attr].lval);    
-    nad->attrs[attr].my_ns = ns;
-
-    return attr;
-}
-
-/** create a new cache, simple pointer to a list of nads */
-nad_cache_t nad_cache_new(void)
-{
-    nad_cache_t cache;
-    while((cache = malloc(sizeof(nad_cache_t))) == NULL) sleep(1);
-    *cache = NULL;
-
-#ifdef NAD_DEBUG
-    if(_nad_alloc_tracked == NULL) _nad_alloc_tracked = xhash_new(501);
-    if(_nad_free_tracked == NULL) _nad_free_tracked = xhash_new(501);
-#endif
-    
-    return cache;
-}
-
-
-/** free the cache and any nads in it */
-void nad_cache_free(nad_cache_t cache)
-{
-    nad_t cur;
-    while((cur = *cache) != NULL)
-    {
-        *cache = cur->next;
-        free(cur->elems);
-        free(cur->attrs);
-        free(cur->nss);
-        free(cur->cdata);
-        free(cur->depths);
-        free(cur);
-    }
-    free(cache);
-}
-
-/** get the next nad from the cache, or create some */
-nad_t nad_new(nad_cache_t cache)
-{
-    nad_t nad;
-
-#ifndef NAD_DEBUG
-    /* If cache==NULL, then this NAD is not in a cache */
-
-    if ((cache!=NULL) && (*cache != NULL))
-    {
-        nad = *cache;
-        *cache = nad->next;
-        nad->ccur = nad->ecur = nad->acur = nad->ncur = 0;
-        nad->scope = -1;
-        nad->cache = cache;
-        nad->next = NULL;
-        return nad;
-    }
-#endif
-
-    while((nad = malloc(sizeof(struct nad_st))) == NULL) sleep(1);
-    memset(nad,0,sizeof(struct nad_st));
-
-    nad->scope = -1;
-    nad->cache = cache;
-
-#ifdef NAD_DEBUG
-    {
-    char loc[24];
-    snprintf(loc, sizeof(loc), "%x", (int) nad);
-    xhash_put(_nad_alloc_tracked, pstrdup(xhash_pool(_nad_alloc_tracked), loc), (void *) 1);
-    }
-    _nad_ptr_check(__func__, nad);
-#endif
-
-    return nad;
-}
-
-nad_t nad_copy(nad_t nad)
-{
-    nad_t copy;
-
-    _nad_ptr_check(__func__, nad);
-
-    if(nad == NULL) return NULL;
-
-    /* create a new nad not participating in a cache */
-    copy = nad_new(NULL);
-
-    /* if it's not large enough, make bigger */
-    NAD_SAFE(copy->elems, nad->elen, copy->elen);
-    NAD_SAFE(copy->attrs, nad->alen, copy->alen);
-    NAD_SAFE(copy->nss, nad->nlen, copy->nlen);
-    NAD_SAFE(copy->cdata, nad->clen, copy->clen);
-
-    /* copy all data */
-    memcpy(copy->elems, nad->elems, nad->elen);
-    memcpy(copy->attrs, nad->attrs, nad->alen);
-    memcpy(copy->nss, nad->nss, nad->nlen);
-    memcpy(copy->cdata, nad->cdata, nad->clen);
-
-    /* sync data */
-    copy->ecur = nad->ecur;
-    copy->acur = nad->acur;
-    copy->ncur = nad->ncur;
-    copy->ccur = nad->ccur;
-
-    copy->scope = nad->scope;
-
-    return copy;
-}
-
-/** free nad, or plug nad back in the cache */
-void nad_free(nad_t nad)
-{
-    if(nad == NULL) return;
-
-#ifdef NAD_DEBUG
-    _nad_ptr_check(__func__, nad);
-    {
-    char loc[24];
-    snprintf(loc, sizeof(loc), "%x", (int) nad);
-    xhash_zap(_nad_alloc_tracked, loc);
-    xhash_put(_nad_free_tracked, pstrdup(xhash_pool(_nad_free_tracked), loc), (void *) nad);
-    }
-#else
-    /* If nad->cache != NULL, then put back into cache, otherwise this nad is not in a cache */
-
-    if (nad->cache != NULL) {
-       nad->next = *(nad->cache);
-       *(nad->cache) = nad;
-       return;
-    } 
-#endif
-
-    /* Free nad */
-    free(nad->elems);
-    free(nad->attrs);
-    free(nad->cdata);
-    free(nad->nss);
-    free(nad->depths);
-}
-
-/** locate the next elem at a given depth with an optional matching name */
-int nad_find_elem(nad_t nad, int elem, int ns, const char *name, int depth)
-{
-    int my_ns;
-    int lname = 0;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* make sure there are valid args */
-    if(elem >= nad->ecur || name == NULL) return -1;
-
-    /* set up args for searching */
-    depth = nad->elems[elem].depth + depth;
-    if(name != NULL) lname = strlen(name);
-
-    /* search */
-    for(elem++;elem < nad->ecur;elem++)
-    {
-        /* if we hit one with a depth less than ours, then we don't have the
-         * same parent anymore, bail */
-        if(nad->elems[elem].depth < depth)
-            return -1;
-
-        if(nad->elems[elem].depth == depth && (lname <= 0 || (lname == nad->elems[elem].lname && strncmp(name,nad->cdata + nad->elems[elem].iname, lname) == 0)) &&
-          (ns < 0 || ((my_ns = nad->elems[elem].my_ns) >= 0 && NAD_NURI_L(nad, ns) == NAD_NURI_L(nad, my_ns) && strncmp(NAD_NURI(nad, ns), NAD_NURI(nad, my_ns), NAD_NURI_L(nad, ns)) == 0)))
-            return elem;
-    }
-
-    return -1;
-}
-
-/** get a matching attr on this elem, both name and optional val */
-int nad_find_attr(nad_t nad, int elem, int ns, const char *name, const char *val)
-{
-    int attr, my_ns;
-    int lname, lval = 0;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* make sure there are valid args */
-    if(elem >= nad->ecur || name == NULL) return -1;
-
-    attr = nad->elems[elem].attr;
-    lname = strlen(name);
-    if(val != NULL) lval = strlen(val);
-
-    while(attr >= 0)
-    {
-        /* hefty, match name and if a val, also match that */
-        if(lname == nad->attrs[attr].lname && strncmp(name,nad->cdata + nad->attrs[attr].iname, lname) == 0 && 
-          (lval <= 0 || (lval == nad->attrs[attr].lval && strncmp(val,nad->cdata + nad->attrs[attr].ival, lval) == 0)) &&
-          (ns < 0 || ((my_ns = nad->attrs[attr].my_ns) >= 0 && NAD_NURI_L(nad, ns) == NAD_NURI_L(nad, my_ns) && strncmp(NAD_NURI(nad, ns), NAD_NURI(nad, my_ns), NAD_NURI_L(nad, ns)) == 0)))
-            return attr;
-        attr = nad->attrs[attr].next;
-    }
-    return -1;
-}
-
-/** get a matching ns on this elem, both uri and optional prefix */
-int nad_find_namespace(nad_t nad, int elem, const char *uri, const char *prefix)
-{
-    int check, ns;
-
-    _nad_ptr_check(__func__, nad);
-
-    if(uri == NULL)
-        return -1;
-
-    /* work backwards through our parents, looking for our namespace on each one.
-     * if we find it, link it. if not, the namespace is undeclared - for now, just drop it */
-    check = elem;
-    while(check >= 0)
-    {
-        ns = nad->elems[check].ns;
-        while(ns >= 0)
-        {
-            if(strlen(uri) == NAD_NURI_L(nad, ns) && strncmp(uri, NAD_NURI(nad, ns), NAD_NURI_L(nad, ns)) == 0 && (prefix == NULL || (nad->nss[ns].iprefix >= 0 && strlen(prefix) == NAD_NPREFIX_L(nad, ns) && strncmp(prefix, NAD_NPREFIX(nad, ns), NAD_NPREFIX_L(nad, ns)) == 0)))
-                return ns;
-            ns = nad->nss[ns].next;
-        }
-        check = nad->elems[check].parent;
-    }
-
-    return -1;
-}
-
-/** find a namespace in scope */
-int nad_find_scoped_namespace(nad_t nad, const char *uri, const char *prefix)
-{
-    int ns;
-
-    _nad_ptr_check(__func__, nad);
-
-    if(uri == NULL)
-        return -1;
-
-    for(ns = 0; ns < nad->ncur; ns++)
-    {
-        if(strlen(uri) == NAD_NURI_L(nad, ns) && strncmp(uri, NAD_NURI(nad, ns), NAD_NURI_L(nad, ns)) == 0 &&
-           (prefix == NULL ||
-             (nad->nss[ns].iprefix >= 0 &&
-              strlen(prefix) == NAD_NPREFIX_L(nad, ns) && strncmp(prefix, NAD_NPREFIX(nad, ns), NAD_NPREFIX_L(nad, ns)) == 0)))
-            return ns;
-    }
-
-    return -1;
-}
-
-/** create, update, or zap any matching attr on this elem */
-void nad_set_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen)
-{
-    int attr;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* find one to replace first */
-    if((attr = nad_find_attr(nad, elem, ns, name, NULL)) < 0)
-    {
-        /* only create new if there's a value to store */
-        if(val != NULL)
-            _nad_attr(nad, elem, ns, name, val, vallen);
-        return;
-    }
-
-    /* got matching, update value or zap */
-    if(val == NULL)
-    {
-        nad->attrs[attr].lval = nad->attrs[attr].lname = 0;
-    }else{
-        if(vallen > 0)
-            nad->attrs[attr].lval = vallen;
-        else
-            nad->attrs[attr].lval = strlen(val);
-        nad->attrs[attr].ival = _nad_cdata(nad,val,nad->attrs[attr].lval);
-    }
-
-}
-
-/** shove in a new child elem after the given one */
-int nad_insert_elem(nad_t nad, int parent, int ns, const char *name, const char *cdata)
-{
-    int elem = parent + 1;
-
-    _nad_ptr_check(__func__, nad);
-
-    NAD_SAFE(nad->elems, (nad->ecur + 1) * sizeof(struct nad_elem_st), nad->elen);
-
-    /* relocate all the rest of the elems (unless we're at the end already) */
-    if(nad->ecur != elem)
-        memmove(&nad->elems[elem + 1], &nad->elems[elem], (nad->ecur - elem) * sizeof(struct nad_elem_st));
-    nad->ecur++;
-
-    /* set up req'd parts of new elem */
-    nad->elems[elem].parent = parent;
-    nad->elems[elem].lname = strlen(name);
-    nad->elems[elem].iname = _nad_cdata(nad,name,nad->elems[elem].lname);
-    nad->elems[elem].attr = -1;
-    nad->elems[elem].ns = nad->scope; nad->scope = -1;
-    nad->elems[elem].itail = nad->elems[elem].ltail = 0;
-    nad->elems[elem].my_ns = ns;
-
-    /* add cdata if given */
-    if(cdata != NULL)
-    {
-        nad->elems[elem].lcdata = strlen(cdata);
-        nad->elems[elem].icdata = _nad_cdata(nad,cdata,nad->elems[elem].lcdata);
-    }else{
-        nad->elems[elem].icdata = nad->elems[elem].lcdata = 0;
-    }
-
-    /* parent/child */
-    nad->elems[elem].depth = nad->elems[parent].depth + 1;
-
-    return elem;
-}
-
-/** wrap an element with another element */
-void nad_wrap_elem(nad_t nad, int elem, int ns, const char *name)
-{
-    int cur;
-
-    _nad_ptr_check(__func__, nad);
-
-    if(elem >= nad->ecur) return;
-
-    NAD_SAFE(nad->elems, (nad->ecur + 1) * sizeof(struct nad_elem_st), nad->elen);
-
-    /* relocate all the rest of the elems after us */
-    memmove(&nad->elems[elem + 1], &nad->elems[elem], (nad->ecur - elem) * sizeof(struct nad_elem_st));
-    nad->ecur++;
-
-    /* set up req'd parts of new elem */
-    nad->elems[elem].lname = strlen(name);
-    nad->elems[elem].iname = _nad_cdata(nad,name,nad->elems[elem].lname);
-    nad->elems[elem].attr = -1;
-    nad->elems[elem].ns = nad->scope; nad->scope = -1;
-    nad->elems[elem].itail = nad->elems[elem].ltail = 0;
-    nad->elems[elem].icdata = nad->elems[elem].lcdata = 0;
-    nad->elems[elem].my_ns = ns;
-
-    /* raise the bar on all the children */
-    nad->elems[elem+1].depth++;
-    for(cur = elem + 2; cur < nad->ecur && nad->elems[cur].depth > nad->elems[elem].depth; cur++) nad->elems[cur].depth++;
-
-    /* relink the parents */
-    nad->elems[elem].parent = nad->elems[elem + 1].parent;
-    nad->elems[elem + 1].parent = elem;
-}
-
-/** create a new elem on the list */
-int nad_append_elem(nad_t nad, int ns, const char *name, int depth)
-{
-    int elem;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* make sure there's mem for us */
-    NAD_SAFE(nad->elems, (nad->ecur + 1) * sizeof(struct nad_elem_st), nad->elen);
-
-    elem = nad->ecur;
-    nad->ecur++;
-    nad->elems[elem].lname = strlen(name);
-    nad->elems[elem].iname = _nad_cdata(nad,name,nad->elems[elem].lname);
-    nad->elems[elem].icdata = nad->elems[elem].lcdata = 0;
-    nad->elems[elem].itail = nad->elems[elem].ltail = 0;
-    nad->elems[elem].attr = -1;
-    nad->elems[elem].ns = nad->scope; nad->scope = -1;
-    nad->elems[elem].depth = depth;
-    nad->elems[elem].my_ns = ns;
-
-    /* make sure there's mem in the depth array, then track us */
-    NAD_SAFE(nad->depths, (depth + 1) * sizeof(int), nad->dlen);
-    nad->depths[depth] = elem;
-
-    /* our parent is the previous guy in the depth array */
-    if(depth <= 0)
-        nad->elems[elem].parent = -1;
-    else
-        nad->elems[elem].parent = nad->depths[depth - 1];
-
-    return elem;
-}
-
-/** attach new attr to the last elem */
-int nad_append_attr(nad_t nad, int ns, const char *name, const char *val)
-{
-    _nad_ptr_check(__func__, nad);
-
-    return _nad_attr(nad, nad->ecur - 1, ns, name, val, 0);
-}
-
-/** append new cdata to the last elem */
-void nad_append_cdata(nad_t nad, const char *cdata, int len, int depth)
-{
-    int elem = nad->ecur - 1;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* make sure this cdata is the child of the last elem to append */
-    if(nad->elems[elem].depth == depth - 1)
-    {
-        if(nad->elems[elem].icdata == 0)
-            nad->elems[elem].icdata = nad->ccur;
-        _nad_cdata(nad,cdata,len);
-        nad->elems[elem].lcdata += len;
-        return;
-    }
-
-    /* otherwise, pin the cdata on the tail of the last element at this depth */
-    elem = nad->depths[depth];
-    if(nad->elems[elem].itail == 0)
-        nad->elems[elem].itail = nad->ccur;
-    _nad_cdata(nad,cdata,len);
-    nad->elems[elem].ltail += len;
-}
-
-/** bring a new namespace into scope */
-int nad_add_namespace(nad_t nad, const char *uri, const char *prefix)
-{
-    int ns;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* only add it if its not already in scope */
-    ns = nad_find_scoped_namespace(nad, uri, NULL);
-    if(ns >= 0)
-        return ns;
-
-    /* make sure there's mem for us */
-    NAD_SAFE(nad->nss, (nad->ncur + 1) * sizeof(struct nad_ns_st), nad->nlen);
-
-    ns = nad->ncur;
-    nad->ncur++;
-    nad->nss[ns].next = nad->scope;
-    nad->scope = ns;
-
-    nad->nss[ns].luri = strlen(uri);
-    nad->nss[ns].iuri = _nad_cdata(nad, uri, nad->nss[ns].luri);
-    if(prefix != NULL)
-    {
-        nad->nss[ns].lprefix = strlen(prefix);
-        nad->nss[ns].iprefix = _nad_cdata(nad, prefix, nad->nss[ns].lprefix);    
-    }
-    else
-        nad->nss[ns].iprefix = -1;
-
-    return ns;
-}
-
-/** declare a namespace on an already-existing element */
-int nad_append_namespace(nad_t nad, int elem, const char *uri, const char *prefix) {
-    int ns;
-
-    _nad_ptr_check(__func__, nad);
-
-    /* see if its already scoped on this element */
-    ns = nad_find_namespace(nad, elem, uri, NULL);
-    if(ns >= 0)
-        return ns;
-
-    /* make some room */
-    NAD_SAFE(nad->nss, (nad->ncur + 1) * sizeof(struct nad_ns_st), nad->nlen);
-
-    ns = nad->ncur;
-    nad->ncur++;
-    nad->nss[ns].next = nad->elems[elem].ns;
-    nad->elems[elem].ns = ns;
-
-    nad->nss[ns].luri = strlen(uri);
-    nad->nss[ns].iuri = _nad_cdata(nad, uri, nad->nss[ns].luri);
-    if(prefix != NULL)
-    {
-        nad->nss[ns].lprefix = strlen(prefix);
-        nad->nss[ns].iprefix = _nad_cdata(nad, prefix, nad->nss[ns].lprefix);    
-    }
-    else
-        nad->nss[ns].iprefix = -1;
-
-    return ns;
-}
-
-void _nad_escape(nad_t nad, int data, int len, int flag)
-{
-    char *c;
-    int ic;
-
-    if(len <= 0) return;
-
-    /* first, if told, find and escape ' */
-    while(flag >= 3 && (c = memchr(nad->cdata + data,'\'',len)) != NULL)
-    {
-        /* get offset */
-        ic = c - nad->cdata;
-
-        /* cute, eh?  handle other data before this normally */
-        _nad_escape(nad, data, ic - data, 2);
-
-        /* ensure enough space, and add our escaped &apos; */
-        NAD_SAFE(nad->cdata, nad->ccur + 6, nad->clen);
-        memcpy(nad->cdata + nad->ccur, "&apos;", 6);
-        nad->ccur += 6;
-
-        /* just update and loop for more */
-        len -= (ic+1) - data;
-        data = ic+1;
-    }
-
-    /* next look for < */
-    while(flag >= 2 && (c = memchr(nad->cdata + data,'<',len)) != NULL)
-    {
-        ic = c - nad->cdata;
-        _nad_escape(nad, data, ic - data, 1);
-
-        /* ensure enough space, and add our escaped &lt; */
-        NAD_SAFE(nad->cdata, nad->ccur + 4, nad->clen);
-        memcpy(nad->cdata + nad->ccur, "&lt;", 4);
-        nad->ccur += 4;
-
-        /* just update and loop for more */
-        len -= (ic+1) - data;
-        data = ic+1;
-    }
-
-    /* check for ]]>, we need to escape the > */
-       /* WE DID THIS  (add the '0' as the first test to the while loop 
-               because the loops dies 3 lines in... (and we don't reall
-               need this)) ...
-        */
-    while( 0 && flag >= 1 && (c = memchr(nad->cdata + data, '>', len)) != NULL)
-    {
-        ic = c - nad->cdata;
-
-        _nad_escape(nad, data, ic - data, 0);
-
-        /* check for the sequence */
-
-        if( c >= nad->cdata + 2 && c[-1] == ']' && c[-2] == ']')
-        {
-            /* ensure enough space, and add our escaped &gt; */
-            NAD_SAFE(nad->cdata, nad->ccur + 4, nad->clen);
-            memcpy(nad->cdata + nad->ccur, "&gt;", 4);
-            nad->ccur += 4;
-        }
-
-        /* otherwise, just plug the > in as-is */
-        else
-        {
-            NAD_SAFE(nad->cdata, nad->ccur + 1, nad->clen);
-            *(nad->cdata + nad->ccur) = '>';
-            nad->ccur++;
-        }
-
-        /* just update and loop for more */
-        len -= (ic+1) - data;
-        data = ic+1;
-    }
-
-    /* if & is found, escape it */
-    while((c = memchr(nad->cdata + data,'&',len)) != NULL)
-    {
-        ic = c - nad->cdata;
-
-        /* ensure enough space */
-        NAD_SAFE(nad->cdata, nad->ccur + 5 + (ic - data), nad->clen);
-
-        /* handle normal data */
-        memcpy(nad->cdata + nad->ccur, nad->cdata + data, (ic - data));
-        nad->ccur += (ic - data);
-
-        /* append escaped &lt; */
-        memcpy(nad->cdata + nad->ccur, "&amp;", 5);
-        nad->ccur += 5;
-
-        /* just update and loop for more */
-        len -= (ic+1) - data;
-        data = ic+1;
-    }
-
-    /* nothing exciting, just append normal cdata */
-    NAD_SAFE(nad->cdata, nad->ccur + len, nad->clen);
-    memcpy(nad->cdata + nad->ccur, nad->cdata + data, len);
-    nad->ccur += len;
-}
-
-/** internal recursive printing function */
-int _nad_lp0(nad_t nad, int elem)
-{
-    int attr;
-    int ndepth;
-    int ns;
-
-    /* there's a lot of code in here, but don't let that scare you, it's just duplication in order to be a bit more efficient cpu-wise */
-
-    /* this whole thing is in a big loop for processing siblings */
-    while(elem != nad->ecur)
-    {
-
-    /* make enough space for the opening element */
-    ns = nad->elems[elem].my_ns;
-    if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-    {
-        NAD_SAFE(nad->cdata, nad->ccur + nad->elems[elem].lname + nad->nss[ns].lprefix + 2, nad->clen);
-    } else {
-        NAD_SAFE(nad->cdata, nad->ccur + nad->elems[elem].lname + 1, nad->clen);
-    }
-
-    /* opening tag */
-    *(nad->cdata + nad->ccur++) = '<';
-
-    /* add the prefix if necessary */
-    if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-    {
-        memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iprefix, nad->nss[ns].lprefix);
-        nad->ccur += nad->nss[ns].lprefix;
-        *(nad->cdata + nad->ccur++) = ':';
-    }
-    
-    /* copy in the name */
-    memcpy(nad->cdata + nad->ccur, nad->cdata + nad->elems[elem].iname, nad->elems[elem].lname);
-    nad->ccur += nad->elems[elem].lname;
-
-    /* add the namespaces */
-    for(ns = nad->elems[elem].ns; ns >= 0; ns = nad->nss[ns].next)
-    {
-        /* never explicitly declare the implicit xml namespace */
-        if(nad->nss[ns].luri == strlen(uri_XML) && strncmp(uri_XML, nad->cdata + nad->nss[ns].iuri, nad->nss[ns].luri) == 0)
-            continue;
-
-        /* make space */
-        if(nad->nss[ns].iprefix >= 0)
-        {
-            NAD_SAFE(nad->cdata, nad->ccur + nad->nss[ns].luri + nad->nss[ns].lprefix + 10, nad->clen);
-        } else {
-            NAD_SAFE(nad->cdata, nad->ccur + nad->nss[ns].luri + 9, nad->clen);
-        }
-
-        /* start */
-        memcpy(nad->cdata + nad->ccur, " xmlns", 6);
-        nad->ccur += 6;
-
-        /* prefix if necessary */
-        if(nad->nss[ns].iprefix >= 0)
-        {
-            *(nad->cdata + nad->ccur++) = ':';
-            memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iprefix, nad->nss[ns].lprefix);
-            nad->ccur += nad->nss[ns].lprefix;
-        }
-
-        *(nad->cdata + nad->ccur++) = '=';
-        *(nad->cdata + nad->ccur++) = '\'';
-
-        /* uri */
-        memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iuri, nad->nss[ns].luri);
-        nad->ccur += nad->nss[ns].luri;
-
-        *(nad->cdata + nad->ccur++) = '\'';
-    }
-
-    for(attr = nad->elems[elem].attr; attr >= 0; attr = nad->attrs[attr].next)
-    {
-        if(nad->attrs[attr].lname <= 0) continue;
-
-        /* make enough space for the wrapper part */
-        ns = nad->attrs[attr].my_ns;
-        if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-        {
-            NAD_SAFE(nad->cdata, nad->ccur + nad->attrs[attr].lname + nad->nss[ns].lprefix + 4, nad->clen);
-        } else {
-            NAD_SAFE(nad->cdata, nad->ccur + nad->attrs[attr].lname + 3, nad->clen);
-        }
-
-        *(nad->cdata + nad->ccur++) = ' ';
-
-        /* add the prefix if necessary */
-        if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-        {
-            memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iprefix, nad->nss[ns].lprefix);
-            nad->ccur += nad->nss[ns].lprefix;
-            *(nad->cdata + nad->ccur++) = ':';
-        }
-    
-        /* copy in the name parts */
-        memcpy(nad->cdata + nad->ccur, nad->cdata + nad->attrs[attr].iname, nad->attrs[attr].lname);
-        nad->ccur += nad->attrs[attr].lname;
-        *(nad->cdata + nad->ccur++) = '=';
-        *(nad->cdata + nad->ccur++) = '\'';
-
-        /* copy in the escaped value */
-        _nad_escape(nad, nad->attrs[attr].ival, nad->attrs[attr].lval, 3);
-
-        /* make enough space for the closing quote and add it */
-        NAD_SAFE(nad->cdata, nad->ccur + 1, nad->clen);
-        *(nad->cdata + nad->ccur++) = '\'';
-    }
-
-    /* figure out what's next */
-    if(elem+1 == nad->ecur)
-        ndepth = -1;
-    else
-        ndepth = nad->elems[elem+1].depth;
-
-    /* handle based on if there are children, update nelem after done */
-    if(ndepth <= nad->elems[elem].depth)
-    {
-        /* make sure there's enough for what we could need */
-        NAD_SAFE(nad->cdata, nad->ccur + 2, nad->clen);
-        if(nad->elems[elem].lcdata == 0)
-        {
-            memcpy(nad->cdata + nad->ccur, "/>", 2);
-            nad->ccur += 2;
-        }else{
-            *(nad->cdata + nad->ccur++) = '>';
-
-            /* copy in escaped cdata */
-            _nad_escape(nad, nad->elems[elem].icdata, nad->elems[elem].lcdata,2);
-
-            /* make room */
-            ns = nad->elems[elem].my_ns;
-            if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-            {
-                NAD_SAFE(nad->cdata, nad->ccur + 4 + nad->elems[elem].lname + nad->nss[ns].lprefix, nad->clen);
-            } else {
-                NAD_SAFE(nad->cdata, nad->ccur + 3 + nad->elems[elem].lname, nad->clen);
-            }
-
-            /* close tag */
-            memcpy(nad->cdata + nad->ccur, "</", 2);
-            nad->ccur += 2;
-    
-            /* add the prefix if necessary */
-            if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-            {
-                memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iprefix, nad->nss[ns].lprefix);
-                nad->ccur += nad->nss[ns].lprefix;
-                *(nad->cdata + nad->ccur++) = ':';
-            }
-    
-            memcpy(nad->cdata + nad->ccur, nad->cdata + nad->elems[elem].iname, nad->elems[elem].lname);
-            nad->ccur += nad->elems[elem].lname;
-            *(nad->cdata + nad->ccur++) = '>';
-        }
-
-        /* always try to append the tail */
-        _nad_escape(nad, nad->elems[elem].itail, nad->elems[elem].ltail,2);
-
-        /* if no siblings either, bail */
-        if(ndepth < nad->elems[elem].depth)
-            return elem+1;
-
-        /* next sibling */
-        elem++;
-    }else{
-        int nelem;
-        /* process any children */
-
-        /* close ourself and append any cdata first */
-        NAD_SAFE(nad->cdata, nad->ccur + 1, nad->clen);
-        *(nad->cdata + nad->ccur++) = '>';
-        _nad_escape(nad, nad->elems[elem].icdata, nad->elems[elem].lcdata,2);
-
-        /* process children */
-        nelem = _nad_lp0(nad,elem+1);
-
-        /* close and tail up */
-        ns = nad->elems[elem].my_ns;
-        if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-        {
-            NAD_SAFE(nad->cdata, nad->ccur + 4 + nad->elems[elem].lname + nad->nss[ns].lprefix, nad->clen);
-        } else {
-            NAD_SAFE(nad->cdata, nad->ccur + 3 + nad->elems[elem].lname, nad->clen);
-        }
-        memcpy(nad->cdata + nad->ccur, "</", 2);
-        nad->ccur += 2;
-        if(ns >= 0 && nad->nss[ns].iprefix >= 0)
-        {
-            memcpy(nad->cdata + nad->ccur, nad->cdata + nad->nss[ns].iprefix, nad->nss[ns].lprefix);
-            nad->ccur += nad->nss[ns].lprefix;
-            *(nad->cdata + nad->ccur++) = ':';
-        }
-        memcpy(nad->cdata + nad->ccur, nad->cdata + nad->elems[elem].iname, nad->elems[elem].lname);
-        nad->ccur += nad->elems[elem].lname;
-        *(nad->cdata + nad->ccur++) = '>';
-        _nad_escape(nad, nad->elems[elem].itail, nad->elems[elem].ltail,2);
-
-        /* if the next element is not our sibling, we're done */
-        if(nelem < nad->ecur && nad->elems[nelem].depth < nad->elems[elem].depth)
-            return nelem;
-
-        /* for next sibling in while loop */
-        elem = nelem;
-    }
-
-    /* here's the end of that big while loop */
-    }
-
-    return elem;
-}
-
-void nad_print(nad_t nad, int elem, char **xml, int *len)
-{
-    int ixml = nad->ccur;
-
-    _nad_ptr_check(__func__, nad);
-
-    _nad_lp0(nad,elem);
-    *len = nad->ccur - ixml;
-    *xml = nad->cdata + ixml;
-}
-
-/**
- * nads serialize to a buffer of this form:
- *
- * [buflen][ecur][acur][ncur][ccur][elems][attrs][nss][cdata]
- *
- * nothing is done with endianness or word length, so the nad must be
- * serialized and deserialized on the same platform
- *
- * buflen is not actually used by deserialize(), but is provided as a
- * convenience to the application so it knows how many bytes to read before
- * passing them in to deserialize()
- *
- * the depths array is not stored, so after deserialization
- * nad_append_elem() and nad_append_cdata() will not work. this is rarely
- * a problem
- */
-
-void nad_serialize(nad_t nad, char **buf, int *len) {
-    char *pos;
-
-    _nad_ptr_check(__func__, nad);
-
-    *len = sizeof(int) * 5 + /* 4 ints in nad_t, plus one for len */
-           sizeof(struct nad_elem_st) * nad->ecur +
-           sizeof(struct nad_attr_st) * nad->acur +
-           sizeof(struct nad_ns_st) * nad->ncur +
-           sizeof(char) * nad->ccur;
-
-    *buf = (char *) malloc(*len);
-    pos = *buf;
-
-    * (int *) pos = *len;       pos += sizeof(int);
-    * (int *) pos = nad->ecur;  pos += sizeof(int);
-    * (int *) pos = nad->acur;  pos += sizeof(int);
-    * (int *) pos = nad->ncur;  pos += sizeof(int);
-    * (int *) pos = nad->ccur;  pos += sizeof(int);
-
-    memcpy(pos, nad->elems, sizeof(struct nad_elem_st) * nad->ecur);    pos += sizeof(struct nad_elem_st) * nad->ecur;
-    memcpy(pos, nad->attrs, sizeof(struct nad_attr_st) * nad->acur);    pos += sizeof(struct nad_attr_st) * nad->acur;
-    memcpy(pos, nad->nss, sizeof(struct nad_ns_st) * nad->ncur);        pos += sizeof(struct nad_ns_st) * nad->ncur;
-    memcpy(pos, nad->cdata, sizeof(char) * nad->ccur);
-}
-
-nad_t nad_deserialize(nad_cache_t cache, const char *buf) {
-    nad_t nad = nad_new(cache);
-    const char *pos = buf + sizeof(int);  /* skip len */
-
-    _nad_ptr_check(__func__, nad);
-
-    nad->ecur = * (int *) pos; pos += sizeof(int);
-    nad->acur = * (int *) pos; pos += sizeof(int);
-    nad->ncur = * (int *) pos; pos += sizeof(int);
-    nad->ccur = * (int *) pos; pos += sizeof(int);
-    nad->elen = nad->ecur;
-    nad->alen = nad->acur;
-    nad->nlen = nad->ncur;
-    nad->clen = nad->ccur;
-
-    if(nad->ecur > 0)
-    {
-        nad->elems = (struct nad_elem_st *) malloc(sizeof(struct nad_elem_st) * nad->ecur);
-        memcpy(nad->elems, pos, sizeof(struct nad_elem_st) * nad->ecur);
-        pos += sizeof(struct nad_elem_st) * nad->ecur;
-    }
-
-    if(nad->acur > 0)
-    {
-        nad->attrs = (struct nad_attr_st *) malloc(sizeof(struct nad_attr_st) * nad->acur);
-        memcpy(nad->attrs, pos, sizeof(struct nad_attr_st) * nad->acur);
-        pos += sizeof(struct nad_attr_st) * nad->acur;
-    }
-
-    if(nad->ncur > 0)
-    {
-        nad->nss = (struct nad_ns_st *) malloc(sizeof(struct nad_ns_st) * nad->ncur);
-        memcpy(nad->nss, pos, sizeof(struct nad_ns_st) * nad->ncur);
-        pos += sizeof(struct nad_ns_st) * nad->ncur;
-    }
-
-    if(nad->ccur > 0)
-    {
-        nad->cdata = (char *) malloc(sizeof(char) * nad->ccur);
-        memcpy(nad->cdata, pos, sizeof(char) * nad->ccur);
-    }
-
-    return nad;
-}
-
-#ifdef HAVE_EXPAT
-
-/** parse a buffer into a nad */
-
-struct build_data {
-    nad_t               nad;
-    int                 depth;
-};
-
-static void _nad_parse_element_start(void *arg, const char *name, const char **atts) {
-    struct build_data *bd = (struct build_data *) arg;
-    char buf[1024];
-    char *uri, *elem, *prefix;
-    const char **attr;
-    int ns;
-
-    /* make a copy */
-    strncpy(buf, name, 1024);
-    buf[1023] = '\0';
-
-    /* expat gives us:
-         prefixed namespaced elem: uri|elem|prefix
-          default namespaced elem: uri|elem
-               un-namespaced elem: elem
-     */
-
-    /* extract all the bits */
-    uri = buf;
-    elem = strchr(uri, '|');
-    if(elem != NULL) {
-        *elem = '\0';
-        elem++;
-        prefix = strchr(elem, '|');
-        if(prefix != NULL) {
-            *prefix = '\0';
-            prefix++;
-        }
-        ns = nad_add_namespace(bd->nad, uri, prefix);
-    } else {
-        /* un-namespaced, just take it as-is */
-        uri = NULL;
-        elem = buf;
-        prefix = NULL;
-        ns = -1;
-    }
-
-    /* add it */
-    nad_append_elem(bd->nad, ns, elem, bd->depth);
-
-    /* now the attributes, one at a time */
-    attr = atts;
-    while(attr[0] != NULL) {
-
-        /* make a copy */
-        strncpy(buf, attr[0], 1024);
-        buf[1023] = '\0';
-
-        /* extract all the bits */
-        uri = buf;
-        elem = strchr(uri, '|');
-        if(elem != NULL) {
-            *elem = '\0';
-            elem++;
-            prefix = strchr(elem, '|');
-            if(prefix != NULL) {
-                *prefix = '\0';
-                prefix++;
-            }
-            ns = nad_add_namespace(bd->nad, uri, prefix);
-        } else {
-            /* un-namespaced, just take it as-is */
-            uri = NULL;
-            elem = buf;
-            prefix = NULL;
-            ns = -1;
-        }
-
-        /* add it */
-        nad_append_attr(bd->nad, ns, elem, (char *) attr[1]);
-
-        attr += 2;
-    }
-
-    bd->depth++;
-}
-
-static void _nad_parse_element_end(void *arg, const char *name) {
-    struct build_data *bd = (struct build_data *) arg;
-
-    bd->depth--;
-}
-
-static void _nad_parse_cdata(void *arg, const char *str, int len) {
-    struct build_data *bd = (struct build_data *) arg;
-
-    /* go */
-    nad_append_cdata(bd->nad, (char *) str, len, bd->depth);
-}
-
-static void _nad_parse_namespace_start(void *arg, const char *prefix, const char *uri) {
-    struct build_data *bd = (struct build_data *) arg;
-
-    nad_add_namespace(bd->nad, (char *) uri, (char *) prefix);
-}
-
-nad_t nad_parse(nad_cache_t cache, const char *buf, int len) {
-    struct build_data bd;
-    XML_Parser p;
-
-    if(len == 0)
-        len = strlen(buf);
-
-    p = XML_ParserCreateNS(NULL, '|');
-    if(p == NULL)
-        return NULL;
-
-    bd.nad = nad_new(cache);
-    bd.depth = 0;
-
-    XML_SetUserData(p, (void *) &bd);
-    XML_SetElementHandler(p, _nad_parse_element_start, _nad_parse_element_end);
-    XML_SetCharacterDataHandler(p, _nad_parse_cdata);
-    XML_SetStartNamespaceDeclHandler(p, _nad_parse_namespace_start);
-
-    if(!XML_Parse(p, buf, len, 1)) {
-        XML_ParserFree(p);
-        nad_free(bd.nad);
-        return NULL;
-    }
-
-    XML_ParserFree(p);
-
-    if(bd.depth != 0)
-        return NULL;
-
-    return bd.nad;
-}
-
-#endif
diff --git a/OpenSRF/src/perlmods/JSON.pm b/OpenSRF/src/perlmods/JSON.pm
deleted file mode 100644 (file)
index 13f75e8..0000000
+++ /dev/null
@@ -1,902 +0,0 @@
-
-package JSON::number;
-sub new {
-       my $class = shift;
-       my $x = shift || $class;
-       return bless \$x => __PACKAGE__;
-}
-
-use overload ( '""' => \&toString );
-
-sub toString { defined($_[1]) ? ${$_[1]} : ${$_[0]} }
-
-package JSON::bool::true;
-sub new { return bless {} => __PACKAGE__ }
-use overload ( '""' => \&toString );
-use overload ( 'bool' => sub { 1 } );
-use overload ( '0+' => sub { 1 } );
-
-sub toString { 'true' }
-
-package JSON::bool::false;
-sub new { return bless {} => __PACKAGE__ }
-use overload ( '""' => \&toString );
-use overload ( 'bool' => sub { 0 } );
-use overload ( '0+' => sub { 0 } );
-
-sub toString { 'false' }
-
-package JSON;
-use Unicode::Normalize;
-use vars qw/%_class_map/;
-
-sub register_class_hint {
-       my $class = shift;
-       my %args = @_;
-
-       $_class_map{hints}{$args{hint}} = \%args;
-       $_class_map{classes}{$args{name}} = \%args;
-}
-
-sub _JSON_regex {
-       my $string = shift;
-
-       $string =~ s/^\s* ( 
-                          {                            | # start object
-                          \[                           | # start array
-                          -?\d+\.?\d*                  | # number literal
-                          "(?:(?:\\[\"])|[^\"])*"      | # string literal
-                          (?:\/\*.+?\*\/)              | # C comment
-                          true                         | # bool true
-                          false                        | # bool false
-                          null                         | # undef()
-                          :                            | # object key-value sep
-                          ,                            | # list sep
-                          \]                           | # array end
-                          }                              # object end
-                       )
-                \s*//sox;
-       return ($string,$1);
-}
-
-sub lookup_class {
-       my $self = shift;
-       my $hint = shift;
-       return $_class_map{hints}{$hint}{name}
-}
-
-sub lookup_hint {
-       my $self = shift;
-       my $class = shift;
-       return $_class_map{classes}{$class}{hint}
-}
-
-sub _json_hint_to_class {
-       my $type = shift;
-       my $hint = shift;
-
-       return $_class_map{hints}{$hint}{name} if (exists $_class_map{hints}{$hint});
-       
-       $type = 'hash' if ($type eq '}');
-       $type = 'array' if ($type eq ']');
-
-       JSON->register_class_hint(name => $hint, hint => $hint, type => $type);
-
-       return $hint;
-}
-
-
-my $JSON_CLASS_KEY = '__c';
-my $JSON_PAYLOAD_KEY = '__p';
-
-sub JSON2perl {
-       my( $class, $string ) = @_;
-       my $perl = $class->rawJSON2perl($string);
-       use Data::Dumper;
-       return $class->JSONObject2Perl($perl);
-}
-
-sub perl2JSON {
-       my( $class, $obj ) = @_;
-       my $json = $class->perl2JSONObject($obj);
-       return $class->rawPerl2JSON($json);
-}
-
-sub JSONObject2Perl {
-       my $class = shift;
-       my $obj = shift;
-       my $ref = ref($obj);
-       if( $ref eq 'HASH' ) {
-               if( defined($obj->{$JSON_CLASS_KEY})) {
-                       my $cls = $obj->{$JSON_CLASS_KEY};
-                       if( $obj = $class->JSONObject2Perl($obj->{$JSON_PAYLOAD_KEY}) ) {
-                               $cls = $class->lookup_class($cls) || $cls;
-                               return bless(\$obj, $cls) unless ref($obj); 
-                               return bless($obj, $cls);
-                       }
-                       return undef;
-               }
-               $obj->{$_} = $class->JSONObject2Perl($obj->{$_}) for (keys %$obj);
-       } elsif( $ref eq 'ARRAY' ) {
-               $obj->[$_] = $class->JSONObject2Perl($obj->[$_]) for(0..scalar(@$obj) - 1);
-       }
-       return $obj;
-}
-
-sub perl2JSONObject {
-       my $class = shift;
-       my $obj = shift;
-       my $ref = ref($obj);
-
-       return $obj unless $ref;
-       my $newobj;
-
-       if( $ref eq 'HASH' ) {
-               $newobj = {};
-               $newobj->{$_} = $class->perl2JSONObject( $obj->{$_} ) for (keys %$obj);
-       } elsif( $ref eq 'ARRAY' ) {
-               $newobj = [];
-               $newobj->[$_] = $class->perl2JSONObject( $obj->[$_] ) for(0..scalar(@$obj) - 1 );
-       } elsif( $ref ) {
-               if(UNIVERSAL::isa($obj, 'HASH')) {
-                       $newobj = {};
-                       $newobj->{$_} = $class->perl2JSONObject( $obj->{$_} ) for (keys %$obj);
-                       bless( $newobj, ref($obj) );
-                       #bless($obj, 'HASH'); # so our parser won't add the hints
-               } elsif(UNIVERSAL::isa($obj, 'ARRAY')) {
-                       $newobj = [];
-                       $newobj->[$_] = $class->perl2JSONObject( $obj->[$_] ) for(0..scalar(@$obj) - 1);
-                       bless( $newobj, ref($obj) );
-                       #bless($obj, 'ARRAY'); # so our parser won't add the hints
-               }
-               $ref = $class->lookup_hint($ref) || $ref;
-               $newobj = { $JSON_CLASS_KEY => $ref, $JSON_PAYLOAD_KEY => $newobj };
-       } 
-       return $newobj; 
-}
-
-
-sub rawJSON2perl {
-       my $class = shift;
-       local $_ = shift;
-
-       s/(?<!\\)\$/\\\$/gmo; # fixup $ for later
-       s/(?<!\\)\@/\\\@/gmo; # fixup @ for later
-       s/(?<!\\)\%/\\\%/gmo; # fixup % for later
-
-       # Convert JSON Unicode...
-       s/\\u([0-9a-fA-F]{4})/chr(hex($1))/esog;
-
-       # handle class blessings
-#      s/\/\*--\s*S\w*?\s+\S+\s*--\*\// bless(/sog;
-#      s/(\]|\}|")\s*\/\*--\s*E\w*?\s+(\S+)\s*--\*\//$1 => _json_hint_to_class("$1", "$2")) /sog;
-
-       my $re = qr/((?<!\\)"(?>(?<=\\)"|[^"])*(?<!\\)")/;
-       # Grab strings...
-       my @strings = /$re/sog;
-
-       # Replace with code...
-       #s/"(?:(?:\\[\"])|[^\"])*"/ do{ \$t = '"'.shift(\@strings).'"'; eval \$t;} /sog;
-       s/$re/ eval shift(\@strings) /sog;
-
-       # Perlify hash notation
-       s/:/ => /sog;
-
-       # Do numbers...
-       #s/\b(-?\d+\.?\d*)\b/ JSON::number::new($1) /sog;
-
-       # Change javascript stuff to perl...
-       s/null/ undef /sog;
-       s/true/ bless( {}, "JSON::bool::true") /sog;
-       s/false/ bless( {}, "JSON::bool::false") /sog;
-
-       my $ret;
-       return eval '$ret = '.$_;
-}
-
-
-my $_json_index;
-sub ___JSON2perl {
-       my $class = shift;
-       my $data = shift;
-
-       $data = [ split //, $data ];
-
-       $_json_index = 0;
-
-       return _json_parse_data($data);
-}
-
-sub _eat_WS {
-       my $data = shift;
-       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-}
-
-sub _json_parse_data {
-       my $data = shift;
-
-       my $out; 
-
-       #warn "parse_data";
-
-       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-
-       my $class = '';
-
-       my $c = $$data[$_json_index];
-
-       if ($c eq '/') {
-               $_json_index++;
-               $class = _json_parse_comment($data);
-               
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               $c = $$data[$_json_index];
-       }
-
-       if ($c eq '"') {
-               $_json_index++;
-               my $val = '';
-
-               my $seen_slash = 0;
-               my $done = 0;
-               while (!$done) {
-                       my $c = $$data[$_json_index];
-                       #warn "c is $c";
-
-                       if ($c eq '\\') {
-                               if ($seen_slash) {
-                                       $val .= '\\';
-                                       $seen_slash = 0;
-                               } else {
-                                       $seen_slash = 1;
-                               }
-                       } elsif ($c eq '"') {
-                               if ($seen_slash) {
-                                       $val .= '"';
-                                       $seen_slash = 0;
-                               } else {
-                                       $done = 1;
-                               }
-                       } elsif ($c eq 't') {
-                               if ($seen_slash) {
-                                       $val .= "\t";
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 't';
-                               }
-                       } elsif ($c eq 'b') {
-                               if ($seen_slash) {
-                                       $val .= "\b";
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 'b';
-                               }
-                       } elsif ($c eq 'f') {
-                               if ($seen_slash) {
-                                       $val .= "\f";
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 'f';
-                               }
-                       } elsif ($c eq 'r') {
-                               if ($seen_slash) {
-                                       $val .= "\r";
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 'r';
-                               }
-                       } elsif ($c eq 'n') {
-                               if ($seen_slash) {
-                                       $val .= "\n";
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 'n';
-                               }
-                       } elsif ($c eq 'u') {
-                               if ($seen_slash) {
-                                       $_json_index++;
-                                       $val .= chr(hex(join('',$$data[$_json_index .. $_json_index + 3])));
-                                       $_json_index += 3;
-                                       $seen_slash = 0;
-                               } else {
-                                       $val .= 'u';
-                               }
-                       } else {
-                               $val .= $c;
-                       }
-                       $_json_index++;
-
-                       #warn "string is $val";
-               }
-
-               $out = $val;
-
-               #$out = _json_parse_string($data);
-       } elsif ($c eq '[') {
-               $_json_index++;
-               $out = [];
-
-               my $in_parse = 0;
-               my $done = 0;
-               while(!$done) {
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-
-                       if ($$data[$_json_index] eq ']') {
-                               $done = 1;
-                               $_json_index++;
-                               last;
-                       }
-
-                       if ($in_parse) {
-                               if ($$data[$_json_index] ne ',') {
-                                       #warn "_json_parse_array: bad data, leaving array parser";
-                                       last;
-                               }
-                               $_json_index++;
-                               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-                       }
-
-                       my $item = _json_parse_data($data);
-
-                       push @$out, $item;
-                       $in_parse++;
-               }
-
-               #$out = _json_parse_array($data);
-       } elsif ($c eq '{') {
-               $_json_index++;
-               $out = {};
-
-               my $in_parse = 0;
-               my $done = 0;
-               while(!$done) {
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-
-                       if ($$data[$_json_index] eq '}') {
-                               $done = 1;
-                               $_json_index++;
-                               last;
-                       }
-
-                       if ($in_parse) {
-                               if ($$data[$_json_index] ne ',') {
-                                       #warn "_json_parse_object: bad data, leaving object parser";
-                                       last;
-                               }
-                               $_json_index++;
-                               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-                       }
-
-                       my ($key,$value);
-                       $key = _json_parse_data($data);
-
-                       #warn "object key is $key";
-
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               
-                       if ($$data[$_json_index] ne ':') {
-                               #warn "_json_parse_object: bad data, leaving object parser";
-                               last;
-                       }
-                       $_json_index++;
-                       $value = _json_parse_data($data);
-
-                       $out->{$key} = $value;
-                       $in_parse++;
-               }
-               #$out = _json_parse_object($data);
-       } elsif (lc($c) eq 'n') {
-               if (lc(join('',$$data[$_json_index .. $_json_index + 3])) eq 'null') {
-                       $_json_index += 4;
-               } else {
-                       warn "CRAP! bad null parsing...";
-               }
-               $out = undef;
-               #$out = _json_parse_null($data);
-       } elsif (lc($c) eq 't' or lc($c) eq 'f') {
-               if (lc(join('',$$data[$_json_index .. $_json_index + 3])) eq 'true') {
-                       $out = 1;
-                       $_json_index += 4;
-               } elsif (lc(join('',$$data[$_json_index .. $_json_index + 4])) eq 'false') {
-                       $out = 0;
-                       $_json_index += 5;
-               } else {
-                       #warn "CRAP! bad bool parsing...";
-                       $out = undef;
-               }
-               #$out = _json_parse_bool($data);
-       } elsif ($c =~ /\d+/o or $c eq '.' or $c eq '-') {
-               my $val;
-               while ($$data[$_json_index] =~ /[-\.0-9]+/io) {
-                       $val .= $$data[$_json_index];
-                       $_json_index++;
-               }
-               $out = 0+$val;
-               #$out = _json_parse_number($data);
-       }
-
-       if ($class) {
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               my $c = $$data[$_json_index];
-
-               if ($c eq '/') {
-                       $_json_index++;
-                       _json_parse_comment($data)
-               }
-
-               bless( $out => lookup_class($class) );
-       }
-
-       $out;
-}
-
-sub _json_parse_null {
-       my $data = shift;
-
-       #warn "parse_null";
-
-       if (lc(join('',$$data[$_json_index .. $_json_index + 3])) eq 'null') {
-               $_json_index += 4;
-       } else {
-               #warn "CRAP! bad null parsing...";
-       }
-       return undef;
-}
-
-sub _json_parse_bool {
-       my $data = shift;
-
-       my $out;
-
-       #warn "parse_bool";
-
-       if (lc(join('',$$data[$_json_index .. $_json_index + 3])) eq 'true') {
-               $out = 1;
-               $_json_index += 4;
-       } elsif (lc(join('',$$data[$_json_index .. $_json_index + 4])) eq 'false') {
-               $out = 0;
-               $_json_index += 5;
-       } else {
-               #warn "CRAP! bad bool parsing...";
-               $out = undef;
-       }
-       return $out;
-}
-
-sub _json_parse_number {
-       my $data = shift;
-
-       #warn "parse_number";
-
-       my $val;
-       while ($$data[$_json_index] =~ /[-\.0-9]+/io) {
-               $val .= $$data[$_json_index];
-               $_json_index++;
-       }
-
-       return 0+$val;
-}
-
-sub _json_parse_object {
-       my $data = shift;
-
-       #warn "parse_object";
-
-       my $out = {};
-
-       my $in_parse = 0;
-       my $done = 0;
-       while(!$done) {
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-
-               if ($$data[$_json_index] eq '}') {
-                       $done = 1;
-                       $_json_index++;
-                       last;
-               }
-
-               if ($in_parse) {
-                       if ($$data[$_json_index] ne ',') {
-                               #warn "_json_parse_object: bad data, leaving object parser";
-                               last;
-                       }
-                       $_json_index++;
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               }
-
-               my ($key,$value);
-               $key = _json_parse_data($data);
-
-               #warn "object key is $key";
-
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               
-               if ($$data[$_json_index] ne ':') {
-                       #warn "_json_parse_object: bad data, leaving object parser";
-                       last;
-               }
-               $_json_index++;
-               $value = _json_parse_data($data);
-
-               $out->{$key} = $value;
-               $in_parse++;
-       }
-
-       return $out;
-}
-
-sub _json_parse_array {
-       my $data = shift;
-
-       #warn "parse_array";
-
-       my $out = [];
-
-       my $in_parse = 0;
-       my $done = 0;
-       while(!$done) {
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-
-               if ($$data[$_json_index] eq ']') {
-                       $done = 1;
-                       $_json_index++;
-                       last;
-               }
-
-               if ($in_parse) {
-                       if ($$data[$_json_index] ne ',') {
-                               #warn "_json_parse_array: bad data, leaving array parser";
-                               last;
-                       }
-                       $_json_index++;
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               }
-
-               my $item = _json_parse_data($data);
-
-               push @$out, $item;
-               $in_parse++;
-       }
-
-       return $out;
-}
-
-
-sub _json_parse_string {
-       my $data = shift;
-
-       #warn "parse_string";
-
-       my $val = '';
-
-       my $seen_slash = 0;
-       my $done = 0;
-       while (!$done) {
-               my $c = $$data[$_json_index];
-               #warn "c is $c";
-
-               if ($c eq '\\') {
-                       if ($seen_slash) {
-                               $val .= '\\';
-                               $seen_slash = 0;
-                       } else {
-                               $seen_slash = 1;
-                       }
-               } elsif ($c eq '"') {
-                       if ($seen_slash) {
-                               $val .= '"';
-                               $seen_slash = 0;
-                       } else {
-                               $done = 1;
-                       }
-               } elsif ($c eq 't') {
-                       if ($seen_slash) {
-                               $val .= "\t";
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 't';
-                       }
-               } elsif ($c eq 'b') {
-                       if ($seen_slash) {
-                               $val .= "\b";
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 'b';
-                       }
-               } elsif ($c eq 'f') {
-                       if ($seen_slash) {
-                               $val .= "\f";
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 'f';
-                       }
-               } elsif ($c eq 'r') {
-                       if ($seen_slash) {
-                               $val .= "\r";
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 'r';
-                       }
-               } elsif ($c eq 'n') {
-                       if ($seen_slash) {
-                               $val .= "\n";
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 'n';
-                       }
-               } elsif ($c eq 'u') {
-                       if ($seen_slash) {
-                               $_json_index++;
-                               $val .= chr(hex(join('',$$data[$_json_index .. $_json_index + 3])));
-                               $_json_index += 3;
-                               $seen_slash = 0;
-                       } else {
-                               $val .= 'u';
-                       }
-               } else {
-                       $val .= $c;
-               }
-               $_json_index++;
-
-               #warn "string is $val";
-       }
-
-       return $val;
-}
-
-sub _json_parse_comment {
-       my $data = shift;
-
-       #warn "parse_comment";
-
-       if ($$data[$_json_index] eq '/') {
-               $_json_index++;
-               while (!($$data[$_json_index] eq "\n")) { $_json_index++ }
-               $_json_index++;
-               return undef;
-       }
-
-       my $class = '';
-
-       if (join('',$$data[$_json_index .. $_json_index + 2]) eq '*--') {
-               $_json_index += 3;
-               while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               if ($$data[$_json_index] eq 'S') {
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-                       while ($$data[$_json_index] !~ /[-\s]+/o) {
-                               $class .= $$data[$_json_index];
-                               $_json_index++;
-                       }
-                       while ($$data[$_json_index] =~ /\s+/o) { $_json_index++ }
-               }
-       }
-
-       while ($$data[$_json_index] ne '/') { $_json_index++ };
-       $_json_index++;
-
-       return $class;
-}
-
-sub old_JSON2perl {
-       my ($class, $json) = @_;
-
-       if (!defined($json)) {
-               return undef;
-       }
-
-       $json =~ s/(?<!\\)\$/\\\$/gmo; # fixup $ for later
-       $json =~ s/(?<!\\)\@/\\\@/gmo; # fixup @ for later
-       $json =~ s/(?<!\\)\%/\\\%/gmo; # fixup % for later
-
-       my @casts;
-       my $casting_depth = 0;
-       my $current_cast;
-       my $element;
-       my $output = '';
-       while (($json,$element) = _JSON_regex($json)) {
-
-               last unless ($element);
-
-               if ($element eq 'null') {
-                       $output .= ' undef() ';
-                       next;
-               } elsif ($element =~ /^\/\*--\s*S\w*?\s+(\w+)\s*--\*\/$/) {
-                       my $hint = $1;
-                       if (exists $_class_map{hints}{$hint}) {
-                               $casts[$casting_depth] = $hint;
-                               $output .= ' bless(';
-                       }
-                       next;
-               } elsif ($element =~ /^\/\*/) {
-                       next;
-               } elsif ($element =~ /^\d/) {
-                       $output .= "do { JSON::number::new($element) }";
-                       next;
-               } elsif ($element eq '{' or $element eq '[') {
-                       $casting_depth++;
-               } elsif ($element eq '}' or $element eq ']') {
-                       $casting_depth--;
-                       my $hint = $casts[$casting_depth];
-                       $casts[$casting_depth] = undef;
-                       if (defined $hint and exists $_class_map{hints}{$hint}) {
-                               $output .= $element . ',"'. $_class_map{hints}{$hint}{name} . '")';
-                               next;
-                       }
-               } elsif ($element eq ':') {
-                       $output .= ' => ';
-                       next;
-               } elsif ($element eq 'true') {
-                       $output .= 'bless( {}, "JSON::bool::true")';
-                       next;
-               } elsif ($element eq 'false') {
-                       $output .= 'bless( {}, "JSON::bool::false")';
-                       next;
-               }
-               
-               $output .= $element;
-       }
-
-       return eval $output;
-}
-
-
-sub rawPerl2JSON {
-       my ($class, $perl, $strict) = @_;
-
-       my $output = '';
-       if (!defined($perl)) {
-               $output = '' if $strict;
-               $output = 'null' unless $strict;
-       } elsif (ref($perl) and ref($perl) =~ /^JSON/) {
-               $output .= $perl;
-#      } elsif ( ref($perl) && exists($_class_map{classes}{ref($perl)}) ) {
-#              $output .= '/*--S '.$_class_map{classes}{ref($perl)}{hint}.'--*/';
-#              if (lc($_class_map{classes}{ref($perl)}{type}) eq 'hash') {
-#                      my %hash =  %$perl;
-#                      $output .= rawPerl2JSON(undef,\%hash, $strict);
-#              } elsif (lc($_class_map{classes}{ref($perl)}{type}) eq 'array') {
-#                      my @array =  @$perl;
-#                      $output .= rawPerl2JSON(undef,\@array, $strict);
-#              }
-#              $output .= '/*--E '.$_class_map{classes}{ref($perl)}{hint}.'--*/';
-#      } elsif (ref($perl) and ref($perl) =~ /HASH/) {
-       } elsif (UNIVERSAL::isa($perl, 'HASH')) {
-               $output .= '{';
-               my $c = 0;
-               for my $key (sort keys %$perl) {
-                       my $outkey = NFC($key);
-                       $output .= ',' if ($c); 
-
-                       $outkey =~ s{\\}{\\\\}sgo;
-                       $outkey =~ s/"/\\"/sgo;
-                       $outkey =~ s/\t/\\t/sgo;
-                       $outkey =~ s/\f/\\f/sgo;
-                       $outkey =~ s/\r/\\r/sgo;
-                       $outkey =~ s/\n/\\n/sgo;
-                       $outkey =~ s/([\x{0080}-\x{fffd}])/sprintf('\u%0.4x',ord($1))/sgoe;
-
-                       $output .= '"'.$outkey.'":'. rawPerl2JSON(undef,$$perl{$key}, $strict);
-                       $c++;
-               }
-               $output .= '}';
-#      } elsif (ref($perl) and ref($perl) =~ /ARRAY/) {
-       } elsif (UNIVERSAL::isa($perl, 'ARRAY')) {
-               $output .= '[';
-               my $c = 0;
-               for my $part (@$perl) {
-                       $output .= ',' if ($c); 
-                       
-                       $output .= rawPerl2JSON(undef,$part, $strict);
-                       $c++;
-               }
-               $output .= ']';
-       } elsif (ref($perl) and ref($perl) =~ /CODE/) {
-               $output .= rawPerl2JSON(undef,$perl->(), $strict);
-       } elsif (ref($perl) and ("$perl" =~ /^([^=]+)=(\w+)/o)) {
-               my $type = $2;
-               my $name = $1;
-               JSON->register_class_hint(name => $name, hint => $name, type => lc($type));
-               $output .= rawPerl2JSON(undef,$perl, $strict);
-       } else {
-               $perl = NFC($perl);
-               $perl =~ s{\\}{\\\\}sgo;
-               $perl =~ s/"/\\"/sgo;
-               $perl =~ s/\t/\\t/sgo;
-               $perl =~ s/\f/\\f/sgo;
-               $perl =~ s/\r/\\r/sgo;
-               $perl =~ s/\n/\\n/sgo;
-               $perl =~ s/([\x{0080}-\x{fffd}])/sprintf('\u%0.4x',ord($1))/sgoe;
-               if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/o and $perl !~ /^(?:\+|-)?0\d+/o ) {
-                       $output = $perl;
-               } else {
-                       $output = '"'.$perl.'"';
-               }
-       }
-
-       return $output;
-}
-
-my $depth = 0;
-sub perl2prettyJSON {
-       my ($class, $perl, $nospace) = @_;
-       $perl ||= $class;
-
-       my $output = '';
-       if (!defined($perl)) {
-               $output = "   "x$depth unless($nospace);
-               $output .= 'null';
-       } elsif (ref($perl) and ref($perl) =~ /^JSON/) {
-               $output = "   "x$depth unless($nospace);
-               $output .= $perl;
-       } elsif ( ref($perl) && exists($_class_map{classes}{ref($perl)}) ) {
-               $depth++;
-               $output .= "\n";
-               $output .= "   "x$depth;
-               $output .= '/*--S '.$_class_map{classes}{ref($perl)}{hint}."--*/ ";
-               if (lc($_class_map{classes}{ref($perl)}{type}) eq 'hash') {
-                       my %hash =  %$perl;
-                       $output .= perl2prettyJSON(\%hash,undef,1);
-               } elsif (lc($_class_map{classes}{ref($perl)}{type}) eq 'array') {
-                       my @array =  @$perl;
-                       $output .= perl2prettyJSON(\@array,undef,1);
-               }
-               $output .= ' /*--E '.$_class_map{classes}{ref($perl)}{hint}.'--*/';
-               $depth--;
-       } elsif (ref($perl) and ref($perl) =~ /HASH/) {
-               $output .= "   "x$depth unless ($nospace);
-               $output .= "{\n";
-               my $c = 0;
-               $depth++;
-               for my $key (sort keys %$perl) {
-                       $output .= ",\n" if ($c); 
-                       $output .= "   "x$depth;
-                       $output .= perl2prettyJSON($key)." : ".perl2prettyJSON($$perl{$key}, undef, 1);
-                       $c++;
-               }
-               $depth--;
-               $output .= "\n";
-               $output .= "   "x$depth;
-               $output .= '}';
-       } elsif (ref($perl) and ref($perl) =~ /ARRAY/) {
-               $output .= "   "x$depth unless ($nospace);
-               $output .= "[\n";
-               my $c = 0;
-               $depth++;
-               for my $part (@$perl) {
-                       $output .= ",\n" if ($c); 
-                       $output .= "   "x$depth;
-                       $output .= perl2prettyJSON($part);
-                       $c++;
-               }
-               $depth--;
-               $output .= "\n";
-               $output .= "   "x$depth;
-               $output .= "]";
-       } elsif (ref($perl) and ref($perl) =~ /CODE/) {
-               $output .= perl2prettyJSON(undef,$perl->(), $nospace);
-       } elsif (ref($perl) and "$perl" =~ /^([^=]+)=(\w{4,5})\(0x/) {
-               my $type = $2;
-               my $name = $1;
-               register_class_hint(undef, name => $name, hint => $name, type => lc($type));
-               $output .= perl2prettyJSON(undef,$perl);
-       } else {
-               $perl = NFC($perl);
-               $perl =~ s/\\/\\\\/sgo;
-               $perl =~ s/"/\\"/sgo;
-               $perl =~ s/\t/\\t/sgo;
-               $perl =~ s/\f/\\f/sgo;
-               $perl =~ s/\r/\\r/sgo;
-               $perl =~ s/\n/\\n/sgo;
-               $perl =~ s/([\x{0080}-\x{fffd}])/sprintf('\u%0.4x',ord($1))/sgoe;
-               $output .= "   "x$depth unless($nospace);
-               if (length($perl) < 10 and $perl =~ /^(?:\+|-)?\d*\.?\d+$/o and $perl !~ /^(?:\+|-)?0\d+/o ) {
-                       $output = $perl;
-               } else {
-                       $output = '"'.$perl.'"';
-               }
-       }
-
-       return $output;
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF.pm b/OpenSRF/src/perlmods/OpenSRF.pm
deleted file mode 100644 (file)
index 865f997..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package OpenSRF;
-use strict;
-use Error;
-require UNIVERSAL::require;
-use vars qw/$VERSION $AUTOLOAD/;
-$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
-
-=head1 OpenSRF
-
-=cut
-
-=head2 Overview
-
- Top level class for OpenSRF perl modules.
-
-=cut
-
-# Exception base classes
-#use Exception::Class
-#      ( OpenSRFException => { fields => [ 'errno' ] });
-#push @Exception::Class::ISA, 'Error';
-
-=head3 AUTOLOAD()
-
- Traps methods calls for methods that have not been defined so they
- don't propogate up the class hierarchy.
-
-=cut
-sub AUTOLOAD {
-       my $self = shift;
-       my $type = ref($self) || $self;
-       my $name = $AUTOLOAD;
-       my $otype = ref $self;
-       
-       my ($package, $filename, $line) = caller;
-       my ($package1, $filename1, $line1) = caller(1);
-       my ($package2, $filename2, $line2) = caller(2);
-       my ($package3, $filename3, $line3) = caller(3);
-       my ($package4, $filename4, $line4) = caller(4);
-       my ($package5, $filename5, $line5) = caller(5);
-       $name =~ s/.*://;   # strip fully-qualified portion
-       warn <<"        WARN";
-****
-** ${name}() isn't there.  Please create me somewhere (like in $type)!
-** Error at $package ($filename), line $line
-** Call Stack (5 deep):
-**     $package1 ($filename1), line $line1
-**     $package2 ($filename2), line $line2
-**     $package3 ($filename3), line $line3
-**     $package4 ($filename4), line $line4
-**     $package5 ($filename5), line $line5
-** Object type was $otype
-****
-       WARN
-}
-
-
-
-=head3 alert_abstract()
-
- This method is called by abstract methods to ensure that
- the process dies when an undefined abstract method is called
-
-=cut
-sub alert_abstract() {
-       my $c = shift;
-       my $class = ref( $c ) || $c;
-       my ($file, $line, $method) = (caller(1))[1..3];
-       die " * Call to abstract method $method at $file, line $line";
-}
-
-sub class { return scalar(caller); }
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/AppSession.pm b/OpenSRF/src/perlmods/OpenSRF/AppSession.pm
deleted file mode 100644 (file)
index 6c32af1..0000000
+++ /dev/null
@@ -1,1029 +0,0 @@
-package OpenSRF::AppSession;
-use OpenSRF::DOM;
-#use OpenSRF::DOM::Element::userAuth;
-use OpenSRF::DomainObject::oilsMessage;
-use OpenSRF::DomainObject::oilsMethod;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::Transport::PeerHandle;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::Utils::SettingsClient;
-use OpenSRF::Utils::Config;
-use OpenSRF::EX;
-use OpenSRF;
-use Exporter;
-use base qw/Exporter OpenSRF/;
-use Time::HiRes qw( time usleep );
-use warnings;
-use strict;
-
-our @EXPORT_OK = qw/CONNECTING INIT_CONNECTED CONNECTED DISCONNECTED CLIENT SERVER/;
-our %EXPORT_TAGS = ( state => [ qw/CONNECTING INIT_CONNECTED CONNECTED DISCONNECTED/ ],
-                endpoint => [ qw/CLIENT SERVER/ ],
-);
-
-my $logger = "OpenSRF::Utils::Logger";
-
-our %_CACHE;
-our @_RESEND_QUEUE;
-
-sub CONNECTING { return 3 };
-sub INIT_CONNECTED { return 4 };
-sub CONNECTED { return 1 };
-sub DISCONNECTED { return 2 };
-
-sub CLIENT { return 2 };
-sub SERVER { return 1 };
-
-sub find {
-       return undef unless (defined $_[1]);
-       return $_CACHE{$_[1]} if (exists($_CACHE{$_[1]}));
-}
-
-sub transport_connected {
-       my $self = shift;
-       if( ! exists $self->{peer_handle} || ! $self->{peer_handle} ) {
-               return 0;
-       }
-       return $self->{peer_handle}->tcp_connected();
-}
-
-sub connected {
-       my $self = shift;
-       return $self->state == CONNECTED;
-}
-# ----------------------------------------------------------------------------
-# Clears the transport buffers
-# call this if you are not through with the sesssion, but you want 
-# to have a clean slate.  You shouldn't have to call this if
-# you are correctly 'recv'ing all of the data from a request.
-# however, if you don't want all of the data, this will
-# slough off any excess
-#  * * Note: This will delete data for all sessions using this transport
-# handle.  For example, all client sessions use the same handle.
-# ----------------------------------------------------------------------------
-sub buffer_reset {
-
-       my $self = shift;
-       if( ! exists $self->{peer_handle} || ! $self->{peer_handle} ) { 
-               return 0;
-       }
-       $self->{peer_handle}->buffer_reset();
-}
-
-
-# when any incoming data is received, this method is called.
-sub server_build {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $sess_id = shift;
-       my $remote_id = shift;
-       my $service = shift;
-
-       warn "Missing args to server_build():\n" .
-               "sess_id: $sess_id, remote_id: $remote_id, service: $service\n" 
-               unless ($sess_id and $remote_id and $service);
-
-       return undef unless ($sess_id and $remote_id and $service);
-
-       if ( my $thingy = $class->find($sess_id) ) {
-               $thingy->remote_id( $remote_id );
-               return $thingy;
-       }
-
-       if( $service eq "client" ) {
-               #throw OpenSRF::EX::PANIC ("Attempting to build a client session as a server" .
-               #       " Session ID [$sess_id], remote_id [$remote_id]");
-
-               warn "Attempting to build a client session as ".
-                               "a server Session ID [$sess_id], remote_id [$remote_id]";
-
-               $logger->debug("Attempting to build a client session as ".
-                               "a server Session ID [$sess_id], remote_id [$remote_id]", ERROR );
-
-               return undef;
-       }
-
-       my $config_client = OpenSRF::Utils::SettingsClient->new();
-       my $stateless = $config_client->config_value("apps", $service, "stateless");
-
-       #my $max_requests = $conf->$service->max_requests;
-       my $max_requests        = $config_client->config_value("apps",$service,"max_requests");
-       $logger->debug( "Max Requests for $service is $max_requests", INTERNAL ) if (defined $max_requests);
-
-       $logger->transport( "AppSession creating new session: $sess_id", INTERNAL );
-
-       my $self = bless { recv_queue  => [],
-                          request_queue  => [],
-                          requests  => 0,
-                          session_data  => {},
-                          callbacks  => {},
-                          endpoint    => SERVER,
-                          state       => CONNECTING, 
-                          session_id  => $sess_id,
-                          remote_id    => $remote_id,
-                               peer_handle => OpenSRF::Transport::PeerHandle->retrieve($service),
-                               max_requests => $max_requests,
-                               session_threadTrace => 0,
-                               service => $service,
-                               stateless => $stateless,
-                        } => $class;
-
-       return $_CACHE{$sess_id} = $self;
-}
-
-sub session_data {
-       my $self = shift;
-       my ($name, $datum) = @_;
-
-       $self->{session_data}->{$name} = $datum if (defined $datum);
-       return $self->{session_data}->{$name};
-}
-
-sub service { return shift()->{service}; }
-
-sub continue_request {
-       my $self = shift;
-       $self->{'requests'}++;
-       return 1 if (!$self->{'max_requests'});
-       return $self->{'requests'} <= $self->{'max_requests'} ? 1 : 0;
-}
-
-sub last_sent_payload {
-       my( $self, $payload ) = @_;
-       if( $payload ) {
-               return $self->{'last_sent_payload'} = $payload;
-       }
-       return $self->{'last_sent_payload'};
-}
-
-sub last_sent_type {
-       my( $self, $type ) = @_;
-       if( $type ) {
-               return $self->{'last_sent_type'} = $type;
-       }
-       return $self->{'last_sent_type'};
-}
-
-sub get_app_targets {
-       my $app = shift;
-
-       my $conf = OpenSRF::Utils::Config->current;
-       my $router_name = $conf->bootstrap->router_name || 'router';
-       my $routers = $conf->bootstrap->domains;
-
-       unless($router_name and $routers) {
-               throw OpenSRF::EX::Config 
-                       ("Missing router config information 'router_name' and 'routers'");
-       }
-
-       my @targets;
-       for my $router (@$routers) {
-               push @targets, "$router_name\@$router/$app";
-       }
-
-       return @targets;
-}
-
-sub stateless {
-       my $self = shift;
-       my $state = shift;
-       $self->{stateless} = $state if (defined $state);
-       return $self->{stateless};
-}
-
-# When we're a client and we want to connect to a remote service
-# create( $app, username => $user, secret => $passwd );
-#    OR
-# create( $app, sysname => $user, secret => $shared_secret );
-sub create {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $app = shift;
-        my $api_level = shift;
-       my $quiet = shift;
-
-       $api_level = 1 if (!defined($api_level));
-                               
-       $logger->debug( "AppSession creating new client session for $app", DEBUG );
-
-       my $stateless = 0;
-       my $c = OpenSRF::Utils::SettingsClient->new();
-       # we can get an infinite loop if we're grabbing the settings and we
-       # need the settings to grab the settings...
-       if($app ne "opensrf.settings" || $c->has_config()) { 
-               $stateless = $c->config_value("apps", $app, "stateless");
-       }
-
-       my $sess_id = time . rand( $$ );
-       while ( $class->find($sess_id) ) {
-               $sess_id = time . rand( $$ );
-       }
-
-       
-       my ($r_id) = get_app_targets($app);
-
-       my $peer_handle = OpenSRF::Transport::PeerHandle->retrieve("client"); 
-       if( ! $peer_handle ) {
-               $peer_handle = OpenSRF::Transport::PeerHandle->retrieve("system_client");
-       }
-
-       my $self = bless { app_name    => $app,
-                               #client_auth => $auth,
-                          #recv_queue  => [],
-                          request_queue  => [],
-                          endpoint    => CLIENT,
-                          state       => DISCONNECTED,#since we're init'ing
-                          session_id  => $sess_id,
-                          remote_id   => $r_id,
-                          raise_error   => $quiet ? 0 : 1,
-                          api_level   => $api_level,
-                          orig_remote_id   => $r_id,
-                               peer_handle => $peer_handle,
-                               session_threadTrace => 0,
-                               stateless               => $stateless,
-                        } => $class;
-
-       $logger->debug( "Created new client session $app : $sess_id" );
-
-       return $_CACHE{$sess_id} = $self;
-}
-
-sub raise_remote_errors {
-       my $self = shift;
-       my $err = shift;
-       $self->{raise_error} = $err if (defined $err);
-       return $self->{raise_error};
-}
-
-sub api_level {
-       return shift()->{api_level};
-}
-
-sub app {
-       return shift()->{app_name};
-}
-
-sub reset {
-       my $self = shift;
-       $self->remote_id($$self{orig_remote_id});
-}
-
-# 'connect' can be used as a constructor if called as a class method,
-# or used to connect a session that has disconnectd if called against
-# an existing session that seems to be disconnected, or was just built
-# using 'create' above.
-
-# connect( $app, username => $user, secret => $passwd );
-#    OR
-# connect( $app, sysname => $user, secret => $shared_secret );
-
-# --- Returns undef if the connect attempt times out.
-# --- Returns the OpenSRF::EX object if one is returned by the server
-# --- Returns self if connected
-sub connect {
-       my $self = shift;
-       my $class = ref($self) || $self;
-
-
-       if ( ref( $self ) and  $self->state && $self->state == CONNECTED  ) {
-               $logger->transport("AppSession already connected", DEBUG );
-       } else {
-               $logger->transport("AppSession not connected, connecting..", DEBUG );
-       }
-       return $self if ( ref( $self ) and  $self->state && $self->state == CONNECTED  );
-
-
-       my $app = shift;
-       my $api_level = shift;
-       $api_level = 1 unless (defined $api_level);
-
-       $self = $class->create($app, @_) if (!ref($self));
-
-       return undef unless ($self);
-
-       $self->{api_level} = $api_level;
-
-       $self->reset;
-       $self->state(CONNECTING);
-       $self->send('CONNECT', "");
-
-
-       # if we want to connect to settings, we may not have 
-       # any data for the settings client to work with...
-       # just using a default for now XXX
-
-       my $time_remaining = 5;
-       
-=head blah
-       my $client = OpenSRF::Utils::SettingsClient->new();
-       my $trans = $client->config_value("client_connection","transport_host");
-
-       if(!ref($trans)) {
-               $time_remaining = $trans->{connect_timeout};
-       } else {
-               # XXX for now, just use the first
-               $time_remaining = $trans->[0]->{connect_timeout};
-       }
-=cut
-
-       while ( $self->state != CONNECTED  and $time_remaining > 0 ) {
-               my $starttime = time;
-               $self->queue_wait($time_remaining);
-               my $endtime = time;
-               $time_remaining -= ($endtime - $starttime);
-       }
-
-       return undef unless($self->state == CONNECTED);
-
-       $self->stateless(0);
-
-       return $self;
-}
-
-sub finish {
-       my $self = shift;
-       if( ! $self->session_id ) {
-               return 0;
-       }
-}
-
-sub unregister_callback {
-       my $self = shift;
-       my $type = shift;
-       my $cb = shift;
-       if (exists $self->{callbacks}{$type}) {
-               delete $self->{callbacks}{$type}{$cb};
-               return $cb;
-       }
-       return undef;
-}
-
-sub register_callback {
-       my $self = shift;
-       my $type = shift;
-       my $cb = shift;
-       my $cb_key = "$cb";
-       $self->{callbacks}{$type}{$cb_key} = $cb;
-       return $cb_key;
-}
-
-sub kill_me {
-       my $self = shift;
-       if( ! $self->session_id ) { return 0; }
-
-       # run each 'death' callback;
-       if (exists $self->{callbacks}{death}) {
-               for my $sub (values %{$self->{callbacks}{death}}) {
-                       $sub->($self);
-               }
-       }
-
-       $self->disconnect;
-       $logger->transport( "AppSession killing self: " . $self->session_id(), DEBUG );
-       delete $_CACHE{$self->session_id};
-       delete($$self{$_}) for (keys %$self);
-}
-
-sub disconnect {
-       my $self = shift;
-
-       # run each 'disconnect' callback;
-       if (exists $self->{callbacks}{disconnect}) {
-               for my $sub (values %{$self->{callbacks}{disconnect}}) {
-                       $sub->($self);
-               }
-       }
-
-       if ( !$self->stateless and $self->state != DISCONNECTED ) {
-               $self->send('DISCONNECT', "") if ($self->endpoint == CLIENT);
-               $self->state( DISCONNECTED ); 
-       }
-
-       $self->reset;
-}
-
-sub request {
-       my $self = shift;
-       my $meth = shift;
-       return unless $self;
-
-   # tell the logger to create a new xid - the logger will decide if it's really necessary
-   $logger->mk_osrf_xid;
-
-       my $method;
-       if (!ref $meth) {
-               $method = new OpenSRF::DomainObject::oilsMethod ( method => $meth );
-       } else {
-               $method = $meth;
-       }
-       
-       $method->params( @_ );
-
-       $self->send('REQUEST',$method);
-}
-
-sub full_request {
-       my $self = shift;
-       my $meth = shift;
-
-       my $method;
-       if (!ref $meth) {
-               $method = new OpenSRF::DomainObject::oilsMethod ( method => $meth );
-       } else {
-               $method = $meth;
-       }
-       
-       $method->params( @_ );
-
-       $self->send(CONNECT => '', REQUEST => $method, DISCONNECT => '');
-}
-
-sub send {
-       my $self = shift;
-       my @payload_list = @_; # this is a Domain Object
-
-       return unless ($self and $self->{peer_handle});
-
-       $logger->debug( "In send", INTERNAL );
-       
-       my $tT;
-
-       if( @payload_list % 2 ) { $tT = pop @payload_list; }
-
-       if( ! @payload_list ) {
-               $logger->debug( "payload_list param is incomplete in AppSession::send()", ERROR );
-               return undef; 
-       }
-
-       my @doc = ();
-
-       my $disconnect = 0;
-       my $connecting = 0;
-
-       while( @payload_list ) {
-
-               my ($msg_type, $payload) = ( shift(@payload_list), shift(@payload_list) ); 
-
-               if ($msg_type eq 'DISCONNECT' ) {
-                       $disconnect++;
-                       if( $self->state == DISCONNECTED && !$connecting) {
-                               next;
-                       }
-               }
-
-               if( $msg_type eq "CONNECT" ) { 
-                       $connecting++; 
-               }
-
-               my $msg = OpenSRF::DomainObject::oilsMessage->new();
-               $msg->type($msg_type);
-       
-               no warnings;
-               $msg->threadTrace( $tT || int($self->session_threadTrace) || int($self->last_threadTrace) );
-               use warnings;
-       
-               if ($msg->type eq 'REQUEST') {
-                       if ( !defined($tT) || $self->last_threadTrace != $tT ) {
-                               $msg->update_threadTrace;
-                               $self->session_threadTrace( $msg->threadTrace );
-                               $tT = $self->session_threadTrace;
-                               OpenSRF::AppRequest->new($self, $payload);
-                       }
-               }
-       
-               $msg->api_level($self->api_level);
-               $msg->payload($payload) if $payload;
-       
-               push @doc, $msg;
-
-       
-               $logger->info( "AppSession sending ".$msg->type." to ".$self->remote_id.
-                       " with threadTrace [".$msg->threadTrace."]" );
-
-       }
-       
-       if ($self->endpoint == CLIENT and ! $disconnect) {
-               $self->queue_wait(0);
-
-
-               if($self->stateless && $self->state != CONNECTED) {
-                       $self->reset;
-                       $logger->debug("AppSession is stateless in send", INTERNAL );
-               }
-
-               if( !$self->stateless and $self->state != CONNECTED ) {
-
-                       $logger->debug( "Sending connect before request 1", INTERNAL );
-
-                       unless (($self->state == CONNECTING && $connecting )) {
-                               $logger->debug( "Sending connect before request 2", INTERNAL );
-                               my $v = $self->connect();
-                               if( ! $v ) {
-                                       $logger->debug( "Unable to connect to remote service in AppSession::send()", ERROR );
-                                       return undef;
-                               }
-                               if( ref($v) and $v->can("class") and $v->class->isa( "OpenSRF::EX" ) ) {
-                                       return $v;
-                               }
-                       }
-               }
-
-       } 
-       my $json = JSON->perl2JSON(\@doc);
-       $logger->internal("AppSession sending doc: $json");
-
-       $self->{peer_handle}->send( 
-                                       to     => $self->remote_id,
-                                  thread => $self->session_id,
-                                  body   => $json );
-
-       if( $disconnect) {
-               $self->state( DISCONNECTED );
-       }
-
-       my $req = $self->app_request( $tT );
-       $req->{_start} = time;
-       return $req
-}
-
-sub app_request {
-       my $self = shift;
-       my $tT = shift;
-       
-       return undef unless (defined $tT);
-       my ($req) = grep { $_->threadTrace == $tT } @{ $self->{request_queue} };
-
-       return $req;
-}
-
-sub remove_app_request {
-       my $self = shift;
-       my $req = shift;
-       
-       my @list = grep { $_->threadTrace != $req->threadTrace } @{ $self->{request_queue} };
-
-       $self->{request_queue} = \@list;
-}
-
-sub endpoint {
-       return $_[0]->{endpoint};
-}
-
-
-sub session_id {
-       my $self = shift;
-       return $self->{session_id};
-}
-
-sub push_queue {
-       my $self = shift;
-       my $resp = shift;
-       my $req = $self->app_request($resp->[1]);
-       return $req->push_queue( $resp->[0] ) if ($req);
-       push @{ $self->{recv_queue} }, $resp->[0];
-}
-
-sub last_threadTrace {
-       my $self = shift;
-       my $new_last_threadTrace = shift;
-
-       my $old_last_threadTrace = $self->{last_threadTrace};
-       if (defined $new_last_threadTrace) {
-               $self->{last_threadTrace} = $new_last_threadTrace;
-               return $new_last_threadTrace unless ($old_last_threadTrace);
-       }
-
-       return $old_last_threadTrace;
-}
-
-sub session_threadTrace {
-       my $self = shift;
-       my $new_last_threadTrace = shift;
-
-       my $old_last_threadTrace = $self->{session_threadTrace};
-       if (defined $new_last_threadTrace) {
-               $self->{session_threadTrace} = $new_last_threadTrace;
-               return $new_last_threadTrace unless ($old_last_threadTrace);
-       }
-
-       return $old_last_threadTrace;
-}
-
-sub last_message_type {
-       my $self = shift;
-       my $new_last_message_type = shift;
-
-       my $old_last_message_type = $self->{last_message_type};
-       if (defined $new_last_message_type) {
-               $self->{last_message_type} = $new_last_message_type;
-               return $new_last_message_type unless ($old_last_message_type);
-       }
-
-       return $old_last_message_type;
-}
-
-sub last_message_api_level {
-       my $self = shift;
-       my $new_last_message_api_level = shift;
-
-       my $old_last_message_api_level = $self->{last_message_api_level};
-       if (defined $new_last_message_api_level) {
-               $self->{last_message_api_level} = $new_last_message_api_level;
-               return $new_last_message_api_level unless ($old_last_message_api_level);
-       }
-
-       return $old_last_message_api_level;
-}
-
-sub remote_id {
-       my $self = shift;
-       my $new_remote_id = shift;
-
-       my $old_remote_id = $self->{remote_id};
-       if (defined $new_remote_id) {
-               $self->{remote_id} = $new_remote_id;
-               return $new_remote_id unless ($old_remote_id);
-       }
-
-       return $old_remote_id;
-}
-
-sub client_auth {
-       return undef;
-       my $self = shift;
-       my $new_ua = shift;
-
-       my $old_ua = $self->{client_auth};
-       if (defined $new_ua) {
-               $self->{client_auth} = $new_ua;
-               return $new_ua unless ($old_ua);
-       }
-
-       return $old_ua->cloneNode(1);
-}
-
-sub state {
-       my $self = shift;
-       my $new_state = shift;
-
-       my $old_state = $self->{state};
-       if (defined $new_state) {
-               $self->{state} = $new_state;
-               return $new_state unless ($old_state);
-       }
-
-       return $old_state;
-}
-
-sub DESTROY {
-       my $self = shift;
-       delete $$self{$_} for keys %$self;
-       return undef;
-}
-
-sub recv {
-       my $self = shift;
-       my @proto_args = @_;
-       my %args;
-
-       if ( @proto_args ) {
-               if ( !(@proto_args % 2) ) {
-                       %args = @proto_args;
-               } elsif (@proto_args == 1) {
-                       %args = ( timeout => @proto_args );
-               }
-       }
-
-       #$logger->debug( ref($self). " recv_queue before wait: " . $self->_print_queue(), INTERNAL );
-
-       if( exists( $args{timeout} ) ) {
-               $args{timeout} = int($args{timeout});
-               $self->{recv_timeout} = $args{timeout};
-       }
-
-       #$args{timeout} = 0 if ($self->complete);
-
-       if(defined($args{timeout})) {
-               $logger->debug( ref($self) ."->recv with timeout " . $args{timeout}, INTERNAL );
-       }
-
-       my $avail = @{ $self->{recv_queue} };
-       $self->{remaining_recv_timeout} = $self->{recv_timeout};
-
-       if (!$args{count}) {
-               if (wantarray) {
-                       $args{count} = $avail;
-               } else {
-                       $args{count} = 1;
-               }
-       }
-
-       while ( $self->{remaining_recv_timeout} > 0 and $avail < $args{count} ) {
-                       last if $self->complete;
-                       my $starttime = time;
-                       $self->queue_wait($self->{remaining_recv_timeout});
-                       my $endtime = time;
-                       if ($self->{timeout_reset}) {
-                               $self->{timeout_reset} = 0;
-                       } else {
-                               $self->{remaining_recv_timeout} -= ($endtime - $starttime)
-                       }
-                       $avail = @{ $self->{recv_queue} };
-       }
-
-
-       my @list;
-       while ( my $msg = shift @{ $self->{recv_queue} } ) {
-               push @list, $msg;
-               last if (scalar(@list) >= $args{count});
-       }
-
-       $logger->debug( "Number of matched responses: " . @list, DEBUG );
-       $self->queue_wait(0); # check for statuses
-       
-       return $list[0] unless (wantarray);
-       return @list;
-}
-
-sub push_resend {
-       my $self = shift;
-       push @OpenSRF::AppSession::_RESEND_QUEUE, @_;
-}
-
-sub flush_resend {
-       my $self = shift;
-       $logger->debug( "Resending..." . @_RESEND_QUEUE, INTERNAL );
-       while ( my $req = shift @OpenSRF::AppSession::_RESEND_QUEUE ) {
-               $req->resend unless $req->complete;
-       }
-}
-
-
-sub queue_wait {
-       my $self = shift;
-       if( ! $self->{peer_handle} ) { return 0; }
-       my $timeout = shift || 0;
-       $logger->debug( "Calling queue_wait($timeout)" , INTERNAL );
-       my $o = $self->{peer_handle}->process($timeout);
-       $self->flush_resend;
-       return $o;
-}
-
-sub _print_queue {
-       my( $self ) = @_;
-       my $string = "";
-       foreach my $msg ( @{$self->{recv_queue}} ) {
-               $string = $string . $msg->toString(1) . "\n";
-       }
-       return $string;
-}
-
-sub status {
-       my $self = shift;
-       return unless $self;
-       $self->send( 'STATUS', @_ );
-}
-
-sub reset_request_timeout {
-       my $self = shift;
-       my $tt = shift;
-       my $req = $self->app_request($tt);
-       $req->{remaining_recv_timeout} = $req->{recv_timeout};
-       $req->{timout_reset} = 1;
-}
-
-#-------------------------------------------------------------------------------
-
-package OpenSRF::AppRequest;
-use base qw/OpenSRF::AppSession/;
-use OpenSRF::Utils::Logger qw/:level/;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use Time::HiRes qw/time usleep/;
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $session = shift;
-       my $threadTrace = $session->session_threadTrace || $session->last_threadTrace;
-       my $payload = shift;
-       
-       my $self = {    session                 => $session,
-                       threadTrace             => $threadTrace,
-                       payload                 => $payload,
-                       complete                => 0,
-                       timeout_reset           => 0,
-                       recv_timeout            => 30,
-                       remaining_recv_timeout  => 30,
-                       recv_queue              => [],
-       };
-
-       bless $self => $class;
-
-       push @{ $self->session->{request_queue} }, $self;
-
-       return $self;
-}
-
-sub recv_timeout {
-       my $self = shift;
-       my $timeout = shift;
-       if (defined $timeout) {
-               $self->{recv_timeout} = $timeout;
-               $self->{remaining_recv_timeout} = $timeout;
-       }
-       return $self->{recv_timeout};
-}
-
-sub queue_size {
-       my $size = @{$_[0]->{recv_queue}};
-       return $size;
-}
-       
-sub send {
-       my $self = shift;
-       return unless ($self and $self->session and !$self->complete);
-       $self->session->send(@_);
-}
-
-sub finish {
-       my $self = shift;
-       return unless $self->session;
-       $self->session->remove_app_request($self);
-       delete($$self{$_}) for (keys %$self);
-}
-
-sub session {
-       return shift()->{session};
-}
-
-sub complete {
-       my $self = shift;
-       my $complete = shift;
-       return $self->{complete} if ($self->{complete});
-       if (defined $complete) {
-               $self->{complete} = $complete;
-               $self->{_duration} = time - $self->{_start} if ($self->{complete});
-       } else {
-               $self->session->queue_wait(0);
-       }
-       return $self->{complete};
-}
-
-sub duration {
-       my $self = shift;
-       $self->wait_complete;
-       return $self->{_duration};
-}
-
-sub wait_complete {
-       my $self = shift;
-       my $timeout = shift || 10;
-       my $time_remaining = $timeout;
-
-       while ( ! $self->complete  and $time_remaining > 0 ) {
-               my $starttime = time;
-               $self->queue_wait($time_remaining);
-               my $endtime = time;
-               $time_remaining -= ($endtime - $starttime);
-       }
-
-       return $self->complete;
-}
-
-sub threadTrace {
-       return shift()->{threadTrace};
-}
-
-sub push_queue {
-       my $self = shift;
-       my $resp = shift;
-       if( !$resp ) { return 0; }
-       if( UNIVERSAL::isa($resp, "Error")) {
-               $self->{failed} = $resp;
-               $self->complete(1);
-               #return; eventually...
-       }
-       push @{ $self->{recv_queue} }, $resp;
-}
-
-sub failed {
-       my $self = shift;
-       return $self->{failed};
-}
-
-sub queue_wait {
-       my $self = shift;
-       return $self->session->queue_wait(@_)
-}
-
-sub payload { return shift()->{payload}; }
-
-sub resend {
-       my $self = shift;
-       return unless ($self and $self->session and !$self->complete);
-       OpenSRF::Utils::Logger->debug( "I'm resending the request for threadTrace ". $self->threadTrace, DEBUG);
-       return $self->session->send('REQUEST', $self->payload, $self->threadTrace );
-}
-
-sub status {
-       my $self = shift;
-       my $msg = shift;
-       return unless ($self and $self->session and !$self->complete);
-       $self->session->send( 'STATUS',$msg, $self->threadTrace );
-}
-
-sub stream_push {
-       my $self = shift;
-       my $msg = shift;
-       $self->respond( $msg );
-}
-
-sub respond {
-       my $self = shift;
-       my $msg = shift;
-       return unless ($self and $self->session and !$self->complete);
-
-       my $response;
-       if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) {
-               $response = $msg;
-       } else {
-               $response = new OpenSRF::DomainObject::oilsResult;
-               $response->content($msg);
-       }
-
-       $self->session->send('RESULT', $response, $self->threadTrace);
-}
-
-sub respond_complete {
-       my $self = shift;
-       my $msg = shift;
-       return unless ($self and $self->session and !$self->complete);
-
-       my $response;
-       if (ref($msg) && UNIVERSAL::isa($msg, 'OpenSRF::DomainObject::oilsResult')) {
-               $response = $msg;
-       } else {
-               $response = new OpenSRF::DomainObject::oilsResult;
-               $response->content($msg);
-       }
-
-       my $stat = OpenSRF::DomainObject::oilsConnectStatus->new(
-               statusCode => STATUS_COMPLETE(),
-               status => 'Request Complete' );
-
-
-       $self->session->send( 'RESULT' => $response, 'STATUS' => $stat, $self->threadTrace);
-       $self->complete(1);
-}
-
-sub register_death_callback {
-       my $self = shift;
-       my $cb = shift;
-       $self->session->register_callback( death => $cb );
-}
-
-
-# utility method.  checks to see of the request failed.
-# if so, throws an OpenSRF::EX::ERROR. if everything is
-# ok, it returns the content of the request
-sub gather {
-       my $self = shift;
-       my $finish = shift;
-       $self->wait_complete;
-       my $resp = $self->recv( timeout => 60 );
-       if( $self->failed() ) { 
-               throw OpenSRF::EX::ERROR
-                       ($self->failed()->stringify());
-       }
-       if(!$resp) { return undef; }
-       my $content = $resp->content;
-       if($finish) { $self->finish();}
-       return $content;
-}
-
-
-package OpenSRF::AppSubrequest;
-
-sub respond {
-       my $self = shift;
-       my $resp = shift;
-       push @{$$self{resp}}, $resp if (defined $resp);
-}
-sub respond_complete { respond(@_); }
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-       return bless({resp => [], @_}, $class);
-}
-
-sub responses { @{$_[0]->{resp}} }
-
-sub status {}
-
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application.pm b/OpenSRF/src/perlmods/OpenSRF/Application.pm
deleted file mode 100644 (file)
index 0b3f9b7..0000000
+++ /dev/null
@@ -1,722 +0,0 @@
-package OpenSRF::Application;
-use vars qw/$_app $log @_METHODS $thunk $server_class/;
-
-use base qw/OpenSRF/;
-use OpenSRF::AppSession;
-use OpenSRF::DomainObject::oilsMethod;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::Utils::Logger qw/:level $logger/;
-use Data::Dumper;
-use Time::HiRes qw/time/;
-use OpenSRF::EX qw/:try/;
-use Carp;
-use JSON;
-#use OpenSRF::UnixServer;  # to get the server class from UnixServer::App
-
-sub DESTROY{};
-
-use strict;
-use warnings;
-
-$log = 'OpenSRF::Utils::Logger';
-
-our $in_request = 0;
-our @pending_requests;
-
-sub package {
-       my $self = shift;
-       return 1 unless ref($self);
-       return $self->{package};
-}
-
-sub signature {
-       my $self = shift;
-       return 0 unless ref($self);
-       return $self->{signature};
-}
-
-sub argc {
-       my $self = shift;
-       return 0 unless ref($self);
-       return $self->{argc};
-}
-
-sub api_name {
-       my $self = shift;
-       return 1 unless ref($self);
-       return $self->{api_name};
-}
-
-sub api_level {
-       my $self = shift;
-       return 1 unless ref($self);
-       return $self->{api_level};
-}
-
-sub server_class {
-       my $class = shift;
-       if($class) {
-               $server_class = $class;
-       }
-       return $server_class;
-}
-
-sub thunk {
-       my $self = shift;
-       my $flag = shift;
-       $thunk = $flag if (defined $flag);
-       return $thunk;
-}
-
-sub application_implementation {
-       my $self = shift;
-       my $app = shift;
-
-       if (defined $app) {
-               $_app = $app;
-               $_app->use;
-               if( $@ ) {
-                       $log->error( "Error loading application_implementation: $app -> $@", ERROR);
-               }
-
-       }
-
-       return $_app;
-}
-
-sub handler {
-       my ($self, $session, $app_msg) = @_;
-
-       if( ! $app_msg ) {
-               return 1;  # error?
-       }
-
-       my $app = $self->application_implementation;
-
-       if ($session->last_message_type eq 'REQUEST') {
-
-        my @p = $app_msg->params;
-               my $method_name = $app_msg->method;
-               my $method_proto = $session->last_message_api_level;
-        $logger->info("CALL: $method_name [".join(', ',@p)."]");
-
-               my $coderef = $app->method_lookup( $method_name, $method_proto, 1, 1 );
-
-               unless ($coderef) {
-                       $session->status( OpenSRF::DomainObject::oilsMethodException->new( 
-                                               statusCode => STATUS_NOTFOUND(),
-                                               status => "Method [$method_name] not found for $app"));
-                       return 1;
-               }
-
-               unless ($session->continue_request) {
-                       $session->status(
-                               OpenSRF::DomainObject::oilsConnectStatus->new(
-                                               statusCode => STATUS_REDIRECTED(),
-                                               status => 'Disconnect on max requests' ) );
-                       $session->kill_me;
-                       return 1;
-               }
-
-               if (ref $coderef) {
-                       my @args = $app_msg->params;
-                       my $appreq = OpenSRF::AppRequest->new( $session );
-
-                       $log->debug( "in_request = $in_request : [" . $appreq->threadTrace."]", INTERNAL );
-                       if( $in_request ) {
-                               $log->debug( "Pushing onto pending requests: " . $appreq->threadTrace, DEBUG );
-                               push @pending_requests, [ $appreq, \@args, $coderef ]; 
-                               return 1;
-                       }
-
-
-                       $in_request++;
-
-                       $log->debug( "Executing coderef for {$method_name}", INTERNAL );
-
-                       my $resp;
-                       try {
-                               # un-if(0) this block to enable param checking based on signature and argc
-                               if (0) {
-                                       if (@args < $coderef->argc) {
-                                               die     "Not enough params passed to ".
-                                                       $coderef->api_name." : requires ". $coderef->argc
-                                       }
-                                       if (@args) {
-                                               my $sig = $coderef->signature;
-                                               if ($sig && exists $sig->{params}) {
-                                                       for my $p (0 .. scalar(@{ $sig->{params} }) - 1 ) {
-                                                               my $s = $sig->{params}->[$p];
-                                                               my $a = $args[$p];
-                                                               if ($s->{class} && JSON->lookup_hint(ref $a) ne $s->{class}) {
-                                                                       die "Incorrect param class at position $p : should be a '$$s{class}'";
-                                                               } elsif ($s->{type}) {
-                                                                       if (lc($s->{type}) eq 'object' && $a !~ /HASH/o) {
-                                                                               die "Incorrect param type at position $p : should be an 'object'";
-                                                                       } elsif (lc($s->{type}) eq 'array' && $a !~ /ARRAY/o) {
-                                                                               die "Incorrect param type at position $p : should be an 'array'";
-                                                                       } elsif (lc($s->{type}) eq 'number' && (ref($a) || $a !~ /^-?\d+(?:\.\d+)?$/o)) {
-                                                                               die "Incorrect param type at position $p : should be a 'number'";
-                                                                       } elsif (lc($s->{type}) eq 'string' && ref($a)) {
-                                                                               die "Incorrect param type at position $p : should be a 'string'";
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               my $start = time();
-                               $resp = $coderef->run( $appreq, @args); 
-                               my $time = sprintf '%.3f', time() - $start;
-
-                               $log->debug( "Method duration for [$method_name]:  ". $time );
-                               if( defined( $resp ) ) {
-                                       $appreq->respond_complete( $resp );
-                               } else {
-                                       $appreq->status( OpenSRF::DomainObject::oilsConnectStatus->new(
-                                                               statusCode => STATUS_COMPLETE(),
-                                                               status => 'Request Complete' ) );
-                               }
-                       } catch Error with {
-                               my $e = shift;
-                               warn "Caught error from 'run' method: $e\n";
-
-                               if(UNIVERSAL::isa($e,"Error")) {
-                                       $e = $e->stringify();
-                               } 
-                               my $sess_id = $session->session_id;
-                               $session->status(
-                                       OpenSRF::DomainObject::oilsMethodException->new(
-                                                       statusCode      => STATUS_INTERNALSERVERERROR(),
-                                                       status          => " *** Call to [$method_name] failed for session ".
-                                                                          "[$sess_id], thread trace ".
-                                                                          "[".$appreq->threadTrace."]:\n$e\n"
-                                       )
-                               );
-                       };
-
-
-
-                       # ----------------------------------------------
-
-
-                       # XXX may need this later
-                       # $_->[1] = 1 for (@OpenSRF::AppSession::_CLIENT_CACHE);
-
-                       $in_request--;
-
-                       $log->debug( "Pending Requests: " . scalar(@pending_requests), INTERNAL );
-
-                       # cycle through queued requests
-                       while( my $aref = shift @pending_requests ) {
-                               $in_request++;
-                               my $resp;
-                               try {
-                                       # un-if(0) this block to enable param checking based on signature and argc
-                                       if (0) {
-                                               if (@args < $aref->[2]->argc) {
-                                                       die     "Not enough params passed to ".
-                                                               $aref->[2]->api_name." : requires ". $aref->[2]->argc
-                                               }
-                                               if (@args) {
-                                                       my $sig = $aref->[2]->signature;
-                                                       if ($sig && exists $sig->{params}) {
-                                                               for my $p (0 .. scalar(@{ $sig->{params} }) - 1 ) {
-                                                                       my $s = $sig->{params}->[$p];
-                                                                       my $a = $args[$p];
-                                                                       if ($s->{class} && JSON->lookup_hint(ref $a) ne $s->{class}) {
-                                                                               die "Incorrect param class at position $p : should be a '$$s{class}'";
-                                                                       } elsif ($s->{type}) {
-                                                                               if (lc($s->{type}) eq 'object' && $a !~ /HASH/o) {
-                                                                                       die "Incorrect param type at position $p : should be an 'object'";
-                                                                               } elsif (lc($s->{type}) eq 'array' && $a !~ /ARRAY/o) {
-                                                                                       die "Incorrect param type at position $p : should be an 'array'";
-                                                                               } elsif (lc($s->{type}) eq 'number' && (ref($a) || $a !~ /^-?\d+(?:\.\d+)?$/o)) {
-                                                                                       die "Incorrect param type at position $p : should be a 'number'";
-                                                                               } elsif (lc($s->{type}) eq 'string' && ref($a)) {
-                                                                                       die "Incorrect param type at position $p : should be a 'string'";
-                                                                               }
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-
-                                       my $start = time;
-                                       my $response = $aref->[2]->run( $aref->[0], @{$aref->[1]} );
-                                       my $time = sprintf '%.3f', time - $start;
-                                       $log->debug( "Method duration for [".$aref->[2]->api_name." -> ".join(', ',@{$aref->[1]}).']:  '.$time, DEBUG );
-
-                                       $appreq = $aref->[0];   
-                                       if( ref( $response ) ) {
-                                               $appreq->respond_complete( $response );
-                                       } else {
-                                               $appreq->status( OpenSRF::DomainObject::oilsConnectStatus->new(
-                                                                       statusCode => STATUS_COMPLETE(),
-                                                                       status => 'Request Complete' ) );
-                                       }
-                                       $log->debug( "Executed: " . $appreq->threadTrace, INTERNAL );
-                               } catch Error with {
-                                       my $e = shift;
-                                       if(UNIVERSAL::isa($e,"Error")) {
-                                               $e = $e->stringify();
-                                       }
-                                       $session->status(
-                                               OpenSRF::DomainObject::oilsMethodException->new(
-                                                               statusCode => STATUS_INTERNALSERVERERROR(),
-                                                               status => "Call to [".$aref->[2]->api_name."] faild:  $e"
-                                               )
-                                       );
-                               };
-                               $in_request--;
-                       }
-
-                       return 1;
-               } 
-
-               $log->info("Received non-REQUEST message in Application handler");
-
-               my $res = OpenSRF::DomainObject::oilsMethodException->new( 
-                               status => "Received non-REQUEST message in Application handler");
-               $session->send('ERROR', $res);
-               $session->kill_me;
-               return 1;
-
-       } else {
-               $session->push_queue([ $app_msg, $session->last_threadTrace ]);
-       }
-
-       $session->last_message_type('');
-       $session->last_message_api_level('');
-
-       return 1;
-}
-
-sub is_registered {
-       my $self = shift;
-       my $api_name = shift;
-       my $api_level = shift || 1;
-       return exists($_METHODS[$api_level]{$api_name});
-}
-
-
-sub normalize_whitespace {
-       my $txt = shift;
-
-       $txt =~ s/^\s+//gso;
-       $txt =~ s/\s+$//gso;
-       $txt =~ s/\s+/ /gso;
-       $txt =~ s/\n//gso;
-       $txt =~ s/\. /\.  /gso;
-
-       return $txt;
-}
-
-sub parse_string_signature {
-       my $string = shift;
-       return [] unless $string;
-       my @chunks = split(/\@/so, $string);
-
-       my @params;
-       my $ret;
-       my $desc = '';
-       for (@chunks) {
-               if (/^return (.+)$/so) {
-                       $ret = [normalize_whitespace($1)];
-               } elsif (/^param (\w+) \b(.+)$/so) {
-                       push @params, [ $1, normalize_whitespace($2) ];
-               } else {
-                       $desc .= '@' if $desc;
-                       $desc .= $_;
-               }
-       }
-
-       return [normalize_whitespace($desc),\@params, $ret];
-}
-
-sub parse_array_signature {
-       my $array = shift;
-       my ($d,$p,$r) = @$array;
-       return {} unless ($d or $p or $r);
-
-       return {
-               desc    => $d,
-               params  => [
-                       map { 
-                               { name  => $$_[0],
-                                 desc  => $$_[1],
-                                 type  => $$_[2],
-                                 class => $$_[3],
-                               }
-                       } @$p
-               ],
-               'return'=>
-                       { desc  => $$r[0],
-                         type  => $$r[1],
-                         class => $$r[2],
-                       }
-       };
-}
-
-sub register_method {
-       my $self = shift;
-       my $app = ref($self) || $self;
-       my %args = @_;
-
-
-       throw OpenSRF::DomainObject::oilsMethodException unless ($args{method});
-
-       $args{api_level} = 1 unless(defined($args{api_level}));
-       $args{stream} ||= 0;
-       $args{remote} ||= 0;
-       $args{argc} ||= 0;
-       $args{package} ||= $app;                
-       $args{server_class} = server_class();
-       $args{api_name} ||= $args{server_class} . '.' . $args{method};
-
-       # un-if(0) this block to enable signature parsing
-       if (!$args{signature}) {
-               if ($args{notes} && !ref($args{notes})) {
-                       $args{signature} =
-                               parse_array_signature( parse_string_signature( $args{notes} ) );
-               }
-       } elsif( !ref($args{signature}) ) {
-               $args{signature} =
-                       parse_array_signature( parse_string_signature( $args{signature} ) );
-       } elsif( ref($args{signature}) eq 'ARRAY') {
-               $args{signature} =
-                       parse_array_signature( $args{signature} );
-       }
-       
-       unless ($args{object_hint}) {
-               ($args{object_hint} = $args{package}) =~ s/::/_/go;
-       }
-
-       JSON->register_class_hint( name => $args{package}, hint => $args{object_hint}, type => "hash" );
-
-       $_METHODS[$args{api_level}]{$args{api_name}} = bless \%args => $app;
-
-       __PACKAGE__->register_method(
-               stream => 0,
-               argc => $args{argc},
-               api_name => $args{api_name}.'.atomic',
-               method => 'make_stream_atomic',
-               notes => "This is a system generated method.  Please see the definition for $args{api_name}",
-       ) if ($args{stream});
-}
-
-sub retrieve_remote_apis {
-       my $method = shift;
-       my $session = OpenSRF::AppSession->create('router');
-       try {
-               $session->connect or OpenSRF::EX::WARN->throw("Connection to router timed out");
-       } catch Error with {
-               my $e = shift;
-               $log->debug( "Remote subrequest returned an error:\n". $e );
-               return undef;
-       } finally {
-               return undef unless ($session->state == $session->CONNECTED);
-       };
-
-       my $req = $session->request( 'opensrf.router.info.class.list' );
-       my $list = $req->recv;
-
-       if( UNIVERSAL::isa($list,"Error") ) {
-               throw $list;
-       }
-
-       my $content = $list->content;
-
-       $req->finish;
-       $session->finish;
-       $session->disconnect;
-
-       my %u_list = map { ($_ => 1) } @$content;
-
-       for my $class ( keys %u_list ) {
-               next if($class eq $server_class);
-               populate_remote_method_cache($class, $method);
-       }
-}
-
-sub populate_remote_method_cache {
-       my $class = shift;
-       my $meth = shift;
-
-       my $session = OpenSRF::AppSession->create($class);
-       try {
-               $session->connect or OpenSRF::EX::WARN->throw("Connection to $class timed out");
-
-               my $call = 'opensrf.system.method.all' unless (defined $meth);
-               $call = 'opensrf.system.method' if (defined $meth);
-
-               my $req = $session->request( $call, $meth );
-
-               while (my $method = $req->recv) {
-                       next if (UNIVERSAL::isa($method, 'Error'));
-
-                       $method = $method->content;
-                       next if ( exists($_METHODS[$$method{api_level}]) &&
-                               exists($_METHODS[$$method{api_level}]{$$method{api_name}}) );
-                       $method->{remote} = 1;
-                       bless($method, __PACKAGE__ );
-                       $_METHODS[$$method{api_level}]{$$method{api_name}} = $method;
-               }
-
-               $req->finish;
-               $session->finish;
-               $session->disconnect;
-
-       } catch Error with {
-               my $e = shift;
-               $log->debug( "Remote subrequest returned an error:\n". $e );
-               return undef;
-       };
-}
-
-sub method_lookup {             
-       my $self = shift;
-       my $method = shift;
-       my $proto = shift;
-       my $no_recurse = shift || 0;
-       my $no_remote = shift || 0;
-
-       # this instead of " || 1;" above to allow api_level 0
-       $proto = $self->api_level unless (defined $proto);
-
-       my $class = ref($self) || $self;
-
-       $log->debug("Lookup of [$method] by [$class] in api_level [$proto]", DEBUG);
-       $log->debug("Available methods\n\t".join("\n\t", keys %{ $_METHODS[$proto] }), INTERNAL);
-
-       my $meth;
-       if (__PACKAGE__->thunk) {
-               for my $p ( reverse(1 .. $proto) ) {
-                       if (exists $_METHODS[$p]{$method}) {
-                               $meth = $_METHODS[$p]{$method};
-                       }
-               }
-       } else {
-               if (exists $_METHODS[$proto]{$method}) {
-                       $meth = $_METHODS[$proto]{$method};
-               }
-       }
-
-       if (defined $meth) {
-               if($no_remote and $meth->{remote}) {
-                       $log->debug("OH CRAP We're not supposed to return remote methods", WARN);
-                       return undef;
-               }
-
-       } elsif (!$no_recurse) {
-               $log->debug("We didn't find [$method], asking everyone else.", DEBUG);
-               retrieve_remote_apis($method);
-               $meth = $self->method_lookup($method,$proto,1);
-       }
-
-       return $meth;
-}
-
-sub run {
-       my $self = shift;
-       my $req = shift;
-
-       my $resp;
-       my @params = @_;
-
-       if ( !UNIVERSAL::isa($req, 'OpenSRF::AppRequest') ) {
-               $log->debug("Creating a SubRequest object", DEBUG);
-               unshift @params, $req;
-               $req = OpenSRF::AppSubrequest->new;
-       } else {
-               $log->debug("This is a top level request", DEBUG);
-       }
-
-       if (!$self->{remote}) {
-               my $code = \&{$self->{package} . '::' . $self->{method}};
-               my $err = undef;
-
-               try {
-                       $resp = $code->($self, $req, @params);
-
-               } catch Error with {
-                       $err = shift;
-
-                       if( ref($self) eq 'HASH') {
-                               $log->error("Sub $$self{package}::$$self{method} DIED!!!\n\t$err\n", ERROR);
-                       }
-               };
-
-               if($err) {
-                       if(UNIVERSAL::isa($err,"Error")) { 
-                               throw $err;
-                       } else {
-                               die $err->stringify; 
-                       }
-               }
-
-
-               $log->debug("Coderef for [$$self{package}::$$self{method}] has been run", DEBUG);
-
-               if ( ref($req) and UNIVERSAL::isa($req, 'OpenSRF::AppSubrequest') ) {
-                       $req->respond($resp) if (defined $resp);
-                       $log->debug("SubRequest object is responding with : " . join(" ",$req->responses), DEBUG);
-                       return $req->responses;
-               } else {
-                       $log->debug("A top level Request object is responding $resp", DEBUG) if (defined $resp);
-                       return $resp;
-               }
-       } else {
-               my $session = OpenSRF::AppSession->create($self->{server_class});
-               try {
-                       #$session->connect or OpenSRF::EX::WARN->throw("Connection to [$$self{server_class}] timed out");
-                       my $remote_req = $session->request( $self->{api_name}, @params );
-                       while (my $remote_resp = $remote_req->recv) {
-                               OpenSRF::Utils::Logger->debug("Remote Subrequest Received " . $remote_resp, INTERNAL );
-                               if( UNIVERSAL::isa($remote_resp,"Error") ) {
-                                       throw $remote_resp;
-                               }
-                               $req->respond( $remote_resp->content );
-                       }
-                       $remote_req->finish();
-
-               } catch Error with {
-                       my $e = shift;
-                       $log->debug( "Remote subrequest returned an error:\n". $e );
-                       return undef;
-               };
-
-               if ($session) {
-                       $session->disconnect();
-                       $session->finish();
-               }
-
-               $log->debug( "Remote Subrequest Responses " . join(" ", $req->responses), INTERNAL );
-
-               return $req->responses;
-       }
-       # huh? how'd we get here...
-       return undef;
-}
-
-sub introspect {
-       my $self = shift;
-       my $client = shift;
-       my $method = shift;
-       my $limit = shift;
-       my $offset = shift;
-
-       if ($self->api_name =~ /all$/o) {
-               $offset = $limit;
-               $limit = $method;
-               $method = undef; 
-       }
-
-       my ($seen,$returned) = (0,0);
-       for my $api_level ( reverse(1 .. $#_METHODS) ) {
-               for my $api_name ( sort keys %{$_METHODS[$api_level]} ) {
-                       if (!$offset || $offset <= $seen) {
-                               if (!$_METHODS[$api_level]{$api_name}{remote}) {
-                                       if (defined($method)) {
-                                               if ($api_name =~ $method) {
-                                                       if (!$limit || $returned < $limit) {
-                                                               $client->respond( $_METHODS[$api_level]{$api_name} );
-                                                               $returned++;
-                                                       }
-                                               }
-                                       } else {
-                                               if (!$limit || $returned < $limit) {
-                                                       $client->respond( $_METHODS[$api_level]{$api_name} );
-                                                       $returned++;
-                                               }
-                                       }
-                               }
-                       }
-                       $seen++;
-               }
-       }
-
-       return undef;
-}
-__PACKAGE__->register_method(
-       stream => 1,
-       method => 'introspect',
-       api_name => 'opensrf.system.method.all',
-       argc => 0,
-       signature => {
-               desc => q/This method is used to introspect an entire OpenSRF Application/,
-               return => {
-                       desc => q/A stream of objects describing the methods available via this OpenSRF Application/,
-                       type => 'object'
-               }
-       },
-);
-__PACKAGE__->register_method(
-       stream => 1,
-       method => 'introspect',
-       argc => 1,
-       api_name => 'opensrf.system.method',
-       argc => 1,
-       signature => {
-               desc => q/Use this method to get the definition of a single OpenSRF Method/,
-               params => [
-                       { desc => q/The method to introspect/,
-                         type => 'string' },
-               ],
-               return => { desc => q/An object describing the method requested, or an error if it can't be found/,
-                           type => 'object' }
-       },
-);
-
-sub echo_method {
-       my $self = shift;
-       my $client = shift;
-       my @args = @_;
-
-       $client->respond( $_ ) for (@args);
-       return undef;
-}
-__PACKAGE__->register_method(
-       stream => 1,
-       method => 'echo_method',
-       argc => 1,
-       api_name => 'opensrf.system.echo',
-       signature => {
-               desc => q/A test method that will echo back it's arguments in a streaming response/,
-               params => [
-                       { desc => q/One or more arguments to echo back/ }
-               ],
-               return => { desc => q/A stream of the arguments passed/ }
-       },
-);
-
-sub time_method {
-       my( $self, $conn ) = @_;
-       return CORE::time;
-}
-__PACKAGE__->register_method(
-       method => 'time_method',
-       argc => 0,
-       api_name => 'opensrf.system.time',
-       signature => {
-               desc => q/Returns the current system time as epoch seconds/,
-               return => { desc => q/epoch seconds/ }
-       }
-);
-
-sub make_stream_atomic {
-       my $self = shift;
-       my $req = shift;
-       my @args = @_;
-
-       (my $m_name = $self->api_name) =~ s/\.atomic$//o;
-       my @results = $self->method_lookup($m_name)->run(@args);
-
-       return \@results;
-}
-
-
-1;
-
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application/Client.pm b/OpenSRF/src/perlmods/OpenSRF/Application/Client.pm
deleted file mode 100644 (file)
index f5d11a2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package OpenSRF::App::Client;
-use base 'OpenSRF::Application';
-use OpenSRF::Utils::Logger qw/:level/;
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application/Demo/Math.pm b/OpenSRF/src/perlmods/OpenSRF/Application/Demo/Math.pm
deleted file mode 100644 (file)
index eed993a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package OpenSRF::Application::Demo::Math;
-use base qw/OpenSRF::Application/;
-use OpenSRF::Application;
-use OpenSRF::Utils::Logger qw/:level/;
-use OpenSRF::DomainObject::oilsResponse;
-#use OpenSRF::DomainObject::oilsPrimitive;
-use OpenSRF::EX qw/:try/;
-use strict;
-use warnings;
-
-
-sub DESTROY{}
-
-our $log = 'OpenSRF::Utils::Logger';
-
-sub send_request {
-       my $self = shift;
-       my $client = shift;
-
-       my $method_name = shift;
-       my @params = @_;
-
-       my $session = OpenSRF::AppSession->create( "opensrf.dbmath" );
-       my $request = $session->request( "dbmath.$method_name", @params );
-       my $response = $request->recv();
-       if(!$response) { return undef; }
-       if($response->isa("Error")) {throw $response ($response->stringify);}
-       $session->finish();
-
-       return $response->content;
-
-}
-__PACKAGE__->register_method( method => 'send_request', api_name => '_send_request' );
-
-__PACKAGE__->register_method( method => 'add_1', api_name => 'add' );
-sub add_1 {
-       my $self = shift;
-       my $client = shift;
-       my @args = @_;
-
-       my $meth = $self->method_lookup('_send_request');
-       my ($result) = $meth->run('add',@args);
-
-       return $result;
-       
-       return send_request( "add", @args );
-}
-
-__PACKAGE__->register_method( method => 'sub_1', api_name => 'sub' );
-sub sub_1 {
-       my $self = shift;
-       my $client = shift;
-       my @args = @_;
-
-       my $meth = $self->method_lookup('_send_request');
-       my ($result) = $meth->run('sub',@args);
-
-       return $result;
-       
-       return send_request( "sub", @args );
-}
-
-__PACKAGE__->register_method( method => 'mult_1', api_name => 'mult' );
-sub mult_1 {
-       my $self = shift;
-       my $client = shift;
-       my @args = @_;
-
-       my $meth = $self->method_lookup('_send_request');
-       my ($result) = $meth->run('mult',@args);
-
-       return $result;
-       
-       return send_request( "mult", @args );
-}
-
-__PACKAGE__->register_method( method => 'div_1', api_name => 'div' );
-sub div_1 {
-       my $self = shift;
-       my $client = shift;
-       my @args = @_;
-
-       my $meth = $self->method_lookup('_send_request');
-       my ($result) = $meth->run('div',@args);
-
-       return $result;
-       
-       return send_request( "div", @args );
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application/Demo/MathDB.pm b/OpenSRF/src/perlmods/OpenSRF/Application/Demo/MathDB.pm
deleted file mode 100644 (file)
index eb90345..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package OpenSRF::Application::Demo::MathDB;
-use JSON;
-use base qw/OpenSRF::Application/;
-use OpenSRF::Application;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-#use OpenSRF::DomainObject::oilsPrimitive;
-use OpenSRF::Utils::Logger qw/:level/;
-use strict;
-use warnings;
-
-sub DESTROY{}
-our $log = 'OpenSRF::Utils::Logger';
-sub initialize {}
-
-__PACKAGE__->register_method( method => 'add_1', api_name => 'dbmath.add' );
-sub add_1 {
-       my $self = shift;
-       my $client = shift;
-
-       my $n1 = shift; 
-       my $n2 = shift;
-       my $a = $n1 + $n2;
-       return JSON::number->new($a);
-}
-
-__PACKAGE__->register_method( method => 'sub_1', api_name => 'dbmath.sub' );
-sub sub_1 {
-       my $self = shift;
-       my $client = shift;
-
-       my $n1 = shift; 
-       my $n2 = shift;
-       my $a = $n1 - $n2;
-       return JSON::number->new($a);
-}
-
-__PACKAGE__->register_method( method => 'mult_1', api_name => 'dbmath.mult' );
-sub mult_1 {
-       my $self = shift;
-       my $client = shift;
-
-       my $n1 = shift; 
-       my $n2 = shift;
-       my $a = $n1 * $n2;
-       return JSON::number->new($a);
-}
-
-__PACKAGE__->register_method( method => 'div_1', api_name => 'dbmath.div' );
-sub div_1 {
-       my $self = shift;
-       my $client = shift;
-
-       my $n1 = shift; 
-       my $n2 = shift;
-       my $a = $n1 / $n2;
-       return JSON::number->new($a);
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application/Persist.pm b/OpenSRF/src/perlmods/OpenSRF/Application/Persist.pm
deleted file mode 100644 (file)
index 1099dba..0000000
+++ /dev/null
@@ -1,517 +0,0 @@
-package OpenSRF::Application::Persist;
-use base qw/OpenSRF::Application/;
-use OpenSRF::Application;
-
-use OpenSRF::Utils::SettingsClient;
-use OpenSRF::EX qw/:try/;
-use OpenSRF::Utils qw/:common/;
-use OpenSRF::Utils::Logger;
-use JSON;
-use DBI;
-
-use vars qw/$dbh $log $default_expire_time/;
-
-sub initialize {
-       $log = 'OpenSRF::Utils::Logger';
-
-       $sc = OpenSRF::Utils::SettingsClient->new;
-
-       my $dbfile = $sc->config_value( apps => 'opensrf.persist' => app_settings => 'dbfile');
-       unless ($dbfile) {
-               throw OpenSRF::EX::PANIC ("Can't find my dbfile for SQLite!");
-       }
-
-       my $init_dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
-       $init_dbh->{AutoCommit} = 1;
-       $init_dbh->{RaiseError} = 0;
-
-       $init_dbh->do( <<"      SQL" );
-               CREATE TABLE storage (
-                       id      INTEGER PRIMARY KEY,
-                       name_id INTEGER,
-                       value   TEXT
-               );
-       SQL
-
-       $init_dbh->do( <<"      SQL" );
-               CREATE TABLE store_name (
-                       id      INTEGER PRIMARY KEY,
-                       name    TEXT UNIQUE
-               );
-       SQL
-
-       $init_dbh->do( <<"      SQL" );
-               CREATE TABLE store_expire (
-                       id              INTEGER PRIMARY KEY,
-                       atime           INTEGER,
-                       expire_interval INTEGER
-               );
-       SQL
-
-}
-
-sub child_init {
-       my $sc = OpenSRF::Utils::SettingsClient->new;
-
-       $default_expire_time = $sc->config_value( apps => 'opensrf.persist' => app_settings => 'default_expire_time' );
-       $default_expire_time ||= 300;
-
-       my $dbfile = $sc->config_value( apps => 'opensrf.persist' => app_settings => 'dbfile');
-       unless ($dbfile) {
-               throw OpenSRF::EX::PANIC ("Can't find my dbfile for SQLite!");
-       }
-
-       $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
-       $dbh->{AutoCommit} = 1;
-       $dbh->{RaiseError} = 0;
-
-}
-
-sub create_store {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift || '';
-
-       try {
-       
-               my $continue = 0;
-               try {
-                       _get_name_id($name);
-
-               } catch Error with { 
-                       $continue++;
-               };
-
-               throw OpenSRF::EX::WARN ("Duplicate key:  object name [$name] already exists!  " . $dbh->errstr)
-                       unless ($continue);
-
-               my $sth = $dbh->prepare("INSERT INTO store_name (name) VALUES (?);");
-               $sth->execute($name);
-               $sth->finish;
-
-               unless ($name) {
-                       my $last_id = $dbh->last_insert_id(undef, undef, 'store_name', 'id');
-                       $name = 'AUTOGENERATED!!'.$last_id;
-                       $dbh->do("UPDATE store_name SET name = '$name' WHERE id = '$last_id';");
-               }
-
-               _flush_by_name($name);
-               return $name;
-       } catch Error with {
-               return undef;
-       };
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.create',
-       method => 'create_store',
-       argc => 1,
-);
-
-
-sub create_expirable_store {
-       my $self = shift;
-       my $client = shift;
-       my $name = shift || do { throw OpenSRF::EX::InvalidArg ("Expirable slots must be given a name!") };
-       my $time = shift || $default_expire_time;
-
-       try {
-               ($name) = $self->method_lookup( 'opensrf.persist.slot.create' )->run( $name );
-               return undef unless $name;
-
-               $self->method_lookup('opensrf.persist.slot.set_expire')->run($name, $time);
-               return $name;
-       } catch Error with {
-               return undef;
-       };
-
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.create_expirable',
-       method => 'create_expirable_store',
-       argc => 2,
-);
-
-sub _update_expire_atime {
-       my $id = shift;
-       $dbh->do('UPDATE store_expire SET atime = ? WHERE id = ?', {}, time(), $id);
-}
-
-sub set_expire_interval {
-       my $self = shift;
-       my $client = shift;
-       my $slot = shift;
-       my $new_interval = shift;
-
-       try {
-               my $etime = interval_to_seconds($new_interval);
-               my $sid = _get_name_id($slot);
-
-               $dbh->do('DELETE FROM store_expire where id = ?', {}, $sid);
-               return 0 if ($etime == 0);
-
-               $dbh->do('INSERT INTO store_expire (id, atime, expire_interval) VALUES (?,?,?);',{},$sid,time(),$etime);
-               return $etime;
-       } 
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.set_expire',
-       method => 'set_expire_interval',
-       argc => 2,
-);
-
-sub find_slot {
-       my $self = shift;
-       my $client = shift;
-       my $slot = shift;
-
-       my $sid = _get_name_id($slot);
-       return $slot if ($sid);
-       return undef;
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.find',
-       method => 'find_slot',
-       argc => 2,
-);
-
-sub get_expire_interval {
-       my $self = shift;
-       my $client = shift;
-       my $slot = shift;
-
-       my $sid = _get_name_id($slot);
-       my ($int) = $dbh->selectrow_array('SELECT expire_interval FROM store_expire WHERE id = ?;',{},$sid);
-       return undef unless ($int);
-
-       my ($future) = $dbh->selectrow_array('SELECT atime + expire_interval FROM store_expire WHERE id = ?;',{},$sid);
-       return $future - time();
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.get_expire',
-       method => 'get_expire_interval',
-       argc => 2,
-);
-
-
-sub _sweep_expired_slots {
-       return if (shift());
-
-       my $expired_slots = $dbh->selectcol_arrayref(<<"        SQL", {}, time() );
-               SELECT id FROM store_expire WHERE (atime + expire_interval) <= ?;
-       SQL
-
-       return unless ($expired_slots);
-
-       $dbh->do('DELETE FROM storage WHERE name_id IN ('.join(',', map { '?' } @$expired_slots).');', {}, @$expired_slots);
-       $dbh->do('DELETE FROM store_expire WHERE id IN ('.join(',', map { '?' } @$expired_slots).');', {}, @$expired_slots);
-       for my $id (@$expired_slots) {
-               _flush_by_name(_get_id_name($id), 1);
-       }
-}
-
-sub add_item {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No name specified!");
-       };
-
-       my $value = shift || '';
-
-       try {
-               my $name_id = _get_name_id($name);
-       
-               if ($self->api_name =~ /object/) {
-                       $dbh->do('DELETE FROM storage WHERE name_id = ?;', {}, $name_id);
-               }
-
-               $dbh->do('INSERT INTO storage (name_id,value) VALUES (?,?);', {}, $name_id, JSON->perl2JSON($value));
-
-               _flush_by_name($name);
-
-               return $name;
-       } catch Error with {
-               return undef;
-       };
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.object.set',
-       method => 'add_item',
-       argc => 2,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.push',
-       method => 'add_item',
-       argc => 2,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.push',
-       method => 'add_item',
-       argc => 2,
-);
-
-sub _get_id_name {
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No slot id specified!");
-       };
-
-
-       my $name_id = $dbh->selectcol_arrayref("SELECT name FROM store_name WHERE id = ?;", {}, $name);
-
-       if (!ref($name_id) || !defined($name_id->[0])) {
-               throw OpenSRF::EX::WARN ("Slot id [$name] does not exist!");
-       }
-
-       return $name_id->[0];
-}
-
-sub _get_name_id {
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No slot name specified!");
-       };
-
-
-       my $name_id = $dbh->selectrow_arrayref("SELECT id FROM store_name WHERE name = ?;", {}, $name);
-
-       if (!ref($name_id) || !defined($name_id->[0])) {
-               throw OpenSRF::EX::WARN ("Slot name [$name] does not exist!");
-       }
-
-       return $name_id->[0];
-}
-
-sub destroy_store {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift;
-
-       my $problem = 0;
-       try {
-               my $name_id = _get_name_id($name);
-       
-               $dbh->do("DELETE FROM storage WHERE name_id = ?;", {}, $name_id);
-               $dbh->do("DELETE FROM store_name WHERE id = ?;", {}, $name_id);
-               $dbh->do("DELETE FROM store_expire WHERE id = ?;", {}, $name_id);
-
-               _sweep_expired_slots();
-               return $name;
-       } catch Error with {
-               return undef;
-       };
-
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.slot.destroy',
-       method => 'destroy_store',
-       argc => 1,
-);
-
-sub _flush_by_name {
-       my $name = shift;
-       my $no_sweep = shift;
-       my $name_id = _get_name_id($name);
-
-       unless ($no_sweep) {
-               _update_expire_atime($name);
-               _sweep_expired_slots();
-       }
-       
-       if ($name =~ /^AUTOGENERATED!!/) {
-               my $count = $dbh->selectcol_arrayref("SELECT COUNT(*) FROM storage WHERE name_id = ?;", {}, $name_id);
-               if (!ref($count) || $$count[0] == 0) {
-                       $dbh->do("DELETE FROM store_name WHERE name = ?;", {}, $name);
-               }
-       }
-}
-       
-sub pop_queue {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No queue name specified!");
-       };
-
-       try {
-               my $name_id = _get_name_id($name);
-
-               my $value = $dbh->selectrow_arrayref('SELECT id, value FROM storage WHERE name_id = ? ORDER BY id ASC LIMIT 1;', {}, $name_id);
-               $dbh->do('DELETE FROM storage WHERE id = ?;',{}, $value->[0]) unless ($self->api_name =~ /peek$/);
-
-               _flush_by_name($name);
-
-               return JSON->JSON2perl( $value->[1] );
-       } catch Error with {
-               #my $e = shift;
-               #return $e;
-               return undef;
-       };
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.peek',
-       method => 'pop_queue',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.pop',
-       method => 'pop_queue',
-       argc => 1,
-);
-
-
-sub peek_slot {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No slot name specified!");
-       };
-       my $name_id = _get_name_id($name);
-
-       my $order = 'ASC';
-       $order = 'DESC' if ($self->api_name =~ /stack/o);
-       
-       my $values = $dbh->selectall_arrayref("SELECT value FROM storage WHERE name_id = ? ORDER BY id $order;", {}, $name_id);
-
-       $client->respond( JSON->JSON2perl( $_->[0] ) ) for (@$values);
-
-       _flush_by_name($name);
-       return undef;
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.peek.all',
-       method => 'peek_slot',
-       argc => 1,
-       stream => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.peek.all',
-       method => 'peek_slot',
-       argc => 1,
-       stream => 1,
-);
-
-
-sub store_size {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No queue name specified!");
-       };
-       my $name_id = _get_name_id($name);
-
-       my $value = $dbh->selectcol_arrayref('SELECT SUM(LENGTH(value)) FROM storage WHERE name_id = ?;', {}, $name_id);
-
-       return JSON->JSON2perl( $value->[0] );
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.size',
-       method => 'shift_stack',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.size',
-       method => 'shift_stack',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.object.size',
-       method => 'shift_stack',
-       argc => 1,
-);
-
-sub store_depth {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No queue name specified!");
-       };
-       my $name_id = _get_name_id($name);
-
-       my $value = $dbh->selectcol_arrayref('SELECT COUNT(*) FROM storage WHERE name_id = ?;', {}, $name_id);
-
-       return JSON->JSON2perl( $value->[0] );
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.queue.length',
-       method => 'shift_stack',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.depth',
-       method => 'shift_stack',
-       argc => 1,
-);
-
-sub shift_stack {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No slot name specified!");
-       };
-
-       try {
-               my $name_id = _get_name_id($name);
-
-               my $value = $dbh->selectrow_arrayref('SELECT id, value FROM storage WHERE name_id = ? ORDER BY id DESC LIMIT 1;', {}, $name_id);
-               $dbh->do('DELETE FROM storage WHERE id = ?;',{}, $value->[0]) unless ($self->api_name =~ /peek$/);
-
-               _flush_by_name($name);
-
-               return JSON->JSON2perl( $value->[1] );
-       } catch Error with {
-               my $e = shift;
-               return undef;
-       };
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.peek',
-       method => 'shift_stack',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.stack.pop',
-       method => 'shift_stack',
-       argc => 1,
-);
-
-sub get_object {
-       my $self = shift;
-       my $client = shift;
-
-       my $name = shift or do {
-               throw OpenSRF::EX::WARN ("No object name specified!");
-       };
-
-       try {
-               my $name_id = _get_name_id($name);
-
-               my $value = $dbh->selectrow_arrayref('SELECT name_id, value FROM storage WHERE name_id = ? ORDER BY id DESC LIMIT 1;', {}, $name_id);
-               $dbh->do('DELETE FROM storage WHERE name_id = ?',{}, $value->[0]) unless ($self->api_name =~ /peek$/);
-
-               _flush_by_name($name);
-
-               return JSON->JSON2perl( $value->[1] );
-       } catch Error with {
-               return undef;
-       };
-}
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.object.peek',
-       method => 'shift_stack',
-       argc => 1,
-);
-__PACKAGE__->register_method(
-       api_name => 'opensrf.persist.object.get',
-       method => 'shift_stack',
-       argc => 1,
-);
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Application/Settings.pm b/OpenSRF/src/perlmods/OpenSRF/Application/Settings.pm
deleted file mode 100644 (file)
index 66d9f32..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package OpenSRF::Application::Settings;
-use OpenSRF::Application;
-use OpenSRF::Utils::SettingsParser;
-use OpenSRF::Utils::Logger qw/$logger/;
-use base 'OpenSRF::Application';
-
-sub child_exit {
-    $logger->debug("settings server child exiting...$$");
-}
-
-
-__PACKAGE__->register_method( method => 'get_host_config', api_name => 'opensrf.settings.host_config.get' );
-sub get_host_config {
-       my( $self, $client, $host ) = @_;
-       my $parser = OpenSRF::Utils::SettingsParser->new();
-       return $parser->get_server_config($host);
-}
-
-__PACKAGE__->register_method( method => 'get_default_config', api_name => 'opensrf.settings.default_config.get' );
-sub get_default_config {
-       my( $self, $client ) = @_;
-       my $parser = OpenSRF::Utils::SettingsParser->new();
-       return $parser->get_default_config();
-}
-
-
-
-
-__PACKAGE__->register_method( method => 'xpath_get', api_name => 'opensrf.settings.xpath.get' );
-
-__PACKAGE__->register_method( 
-               method  => 'xpath_get', 
-               api_name => 'opensrf.settings.xpath.get.raw' );
-
-sub xpath_get {
-       my($self, $client, $xpath) = @_;
-       warn "*************** Received XPATH $xpath\n";
-       return  OpenSRF::Utils::SettingsParser->new()->_get_all( $xpath );
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DOM.pm b/OpenSRF/src/perlmods/OpenSRF/DOM.pm
deleted file mode 100644 (file)
index 8ddb095..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-use XML::LibXML;
-use OpenSRF::Utils::Logger qw(:level);
-
-package XML::LibXML::Element;
-use OpenSRF::EX;
-
-sub AUTOLOAD {
-       my $self = shift;
-       (my $name = $AUTOLOAD) =~ s/.*://;   # strip fully-qualified portion
-
-       ### Check for recursion
-       my $calling_method = (caller(1))[3];
-       my @info = caller(1);
-
-       if( @info ) {
-               if ($info[0] =~ /AUTOLOAD/) { @info = caller(2); }
-       }
-       unless( @info ) { @info = caller(); }
-       if( $calling_method  and $calling_method eq "XML::LibXML::Element::AUTOLOAD" ) {
-               throw OpenSRF::EX::PANIC ( "RECURSION! Caller [ @info ] | Object [ ".ref($self)." ]\n ** Trying to call $name", ERROR );
-       }
-       ### Check for recursion
-       
-       #OpenSRF::Utils::Logger->debug( "Autoloading method for DOM: $AUTOLOAD on ".$self->toString, INTERNAL );
-
-       my $new_node = OpenSRF::DOM::upcast($self);
-       OpenSRF::Utils::Logger->debug( "Autoloaded to: ".ref($new_node), INTERNAL );
-
-       return $new_node->$name(@_);
-}
-
-
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM;
-use base qw/XML::LibXML OpenSRF/;
-
-our %_NAMESPACE_MAP = (
-       'http://open-ils.org/xml/namespaces/oils_v1' => 'oils',
-);
-
-our $_one_true_parser;
-
-sub new {
-       my $self = shift;
-       return $_one_true_parser if (defined $_one_true_parser);
-       $_one_true_parser = $self->SUPER::new(@_);
-       $_one_true_parser->keep_blanks(0);
-       $XML::LibXML::skipXMLDeclaration = 0;
-       return $_one_true_parser = $self->SUPER::new(@_);
-}
-
-sub createDocument {
-       my $self = shift;
-
-       # DOM API: createDocument(namespaceURI, qualifiedName, doctype?)
-       my $doc = XML::LibXML::Document->new("1.0", "UTF-8");
-       my $el = $doc->createElement('root');
-
-       $el->setNamespace('http://open-ils.org/xml/namespaces/oils_v1', 'oils', 1);
-       $doc->setDocumentElement($el);
-
-       return $doc;
-}
-
-my %_loaded_classes;
-sub upcast {
-       my $node = shift;
-       return undef unless $node;
-
-       my ($ns,$tag) = split ':' => $node->nodeName;
-
-       return $node unless ($ns eq 'oils');
-
-       my $class = "OpenSRF::DOM::Element::$tag";
-       unless (exists $_loaded_classes{$class}) {
-               $class->use;
-               $_loaded_classes{$class} = 1;
-       }
-       if ($@) {
-               OpenSRF::Utils::Logger->error("Couldn't use $class! $@");
-       }
-
-       #OpenSRF::Utils::Logger->debug("Upcasting ".$node->toString." to $class", INTERNAL);
-
-       return bless $node => $class;
-}
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Node;
-use base 'XML::LibXML::Node';
-
-sub new {
-       my $class = shift;
-       return bless $class->SUPER::new(@_) => $class;
-}
-
-sub childNodes {
-       my $self = shift;
-       my @children = $self->_childNodes();
-       return wantarray ? @children : OpenSRF::DOM::NodeList->new( @children );
-}
-
-sub attributes {
-       my $self = shift;
-       my @attr = $self->_attributes();
-       return wantarray ? @attr : OpenSRF::DOM::NamedNodeMap->new( @attr );
-}
-
-sub findnodes {
-       my ($node, $xpath) = @_;
-       my @nodes = $node->_findnodes($xpath);
-       if (wantarray) {
-               return @nodes;
-       } else {
-               return OpenSRF::DOM::NodeList->new(@nodes);
-       }
-}
-
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::NamedNodeMap;
-use base 'XML::LibXML::NamedNodeMap';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::NodeList;
-use base 'XML::LibXML::NodeList';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Element;
-use base 'XML::LibXML::Element';
-
-sub new {
-       my $class = shift;
-
-       # magically create the element (tag) name, or build a blank element
-       (my $name = $class) =~ s/^OpenSRF::DOM::Element:://;
-       if ($name) {
-               $name = "oils:$name";
-       } else {
-               undef $name;
-       }
-
-       my $self = $class->SUPER::new($name);
-
-       my %attrs = @_;
-       for my $aname (keys %attrs) {
-               $self->setAttribute($aname, $attrs{$aname});
-       }
-
-       return $self;
-}
-
-sub getElementsByTagName {
-    my ( $node , $name ) = @_;
-        my $xpath = "descendant::$name";
-    my @nodes = $node->_findnodes($xpath);
-        return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-sub  getElementsByTagNameNS {
-    my ( $node, $nsURI, $name ) = @_;
-    my $xpath = "descendant::*[local-name()='$name' and namespace-uri()='$nsURI']";
-    my @nodes = $node->_findnodes($xpath);
-    return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-sub getElementsByLocalName {
-    my ( $node,$name ) = @_;
-    my $xpath = "descendant::*[local-name()='$name']";
-    my @nodes = $node->_findnodes($xpath);
-    return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-sub getChildrenByLocalName {
-    my ( $node,$name ) = @_;
-    my $xpath = "./*[local-name()='$name']";
-    my @nodes = $node->_findnodes($xpath);
-    return @nodes;
-}
-
-sub getChildrenByTagName {
-    my ( $node, $name ) = @_;
-    my @nodes = grep { $_->nodeName eq $name } $node->childNodes();
-    return @nodes;
-}
-
-sub getChildrenByTagNameNS {
-    my ( $node, $nsURI, $name ) = @_;
-    my $xpath = "*[local-name()='$name' and namespace-uri()='$nsURI']";
-    my @nodes = $node->_findnodes($xpath);
-    return @nodes;
-}
-
-sub appendWellBalancedChunk {
-    my ( $self, $chunk ) = @_;
-
-    my $local_parser = OpenSRF::DOM->new();
-    my $frag = $local_parser->parse_xml_chunk( $chunk );
-
-    $self->appendChild( $frag );
-}
-
-package OpenSRF::DOM::Element::root;
-use base 'OpenSRF::DOM::Element';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Text;
-use base 'XML::LibXML::Text';
-
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Comment;
-use base 'XML::LibXML::Comment';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::CDATASection;
-use base 'XML::LibXML::CDATASection';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Document;
-use base 'XML::LibXML::Document';
-
-sub empty {
-       my $self = shift;
-       return undef unless (ref($self));
-       $self->documentElement->removeChild($_) for $self->documentElement->childNodes;
-       return $self;
-}
-
-sub new {
-       my $class = shift;
-       return bless $class->SUPER::new(@_) => $class;
-}
-
-sub getElementsByTagName {
-       my ( $doc , $name ) = @_;
-       my $xpath = "descendant-or-self::node()/$name";
-       my @nodes = $doc->_findnodes($xpath);
-       return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-sub  getElementsByTagNameNS {
-       my ( $doc, $nsURI, $name ) = @_;
-       my $xpath = "descendant-or-self::*[local-name()='$name' and namespace-uri()='$nsURI']";
-       my @nodes = $doc->_findnodes($xpath);
-       return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-sub getElementsByLocalName {
-       my ( $doc,$name ) = @_;
-       my $xpath = "descendant-or-self::*[local-name()='$name']";
-       my @nodes = $doc->_findnodes($xpath);
-       return wantarray ? @nodes : OpenSRF::DOM::NodeList->new(@nodes);
-}
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::DocumentFragment;
-use base 'XML::LibXML::DocumentFragment';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Attr;
-use base 'XML::LibXML::Attr';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Dtd;
-use base 'XML::LibXML::Dtd';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::PI;
-use base 'XML::LibXML::PI';
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Namespace;
-use base 'XML::LibXML::Namespace';
-
-sub isEqualNode {
-       my ( $self, $ref ) = @_;
-       if ( $ref->isa("XML::LibXML::Namespace") ) {
-               return $self->_isEqual($ref);
-       }
-       return 0;
-}
-
-#--------------------------------------------------------------------------------
-package OpenSRF::DOM::Schema;
-use base 'XML::LibXML::Schema';
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObject.pm b/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObject.pm
deleted file mode 100644 (file)
index 4b98512..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-package OpenSRF::DOM::Element::domainObject;
-use strict; use warnings;
-use base 'OpenSRF::DOM::Element';
-use OpenSRF::DOM;
-use OpenSRF::DOM::Element::domainObjectAttr;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::EX qw(:try);
-use Carp;
-#use OpenSRF::DomainObject::oilsPrimitive;
-#use OpenSRF::DomainObject::oilsResponse;
-use vars qw($AUTOLOAD);
-
-sub AUTOLOAD {
-       my $self = shift;
-       (my $name = $AUTOLOAD) =~ s/.*://;   # strip fully-qualified portion
-
-       return class($self) if ($name eq 'class');
-       if ($self->can($name)) {
-               return $self->$name(@_);
-       }
-
-       if (1) {
-               ### Check for recursion
-               my $calling_method = (caller(1))[3];
-               my @info = caller(1);
-
-               if( @info ) {
-                       if ($info[0] =~ /AUTOLOAD/) { @info = caller(2); }
-               }
-               unless( @info ) { @info = caller(); }
-
-               if( $calling_method  and $calling_method eq "OpenSRF::DOM::Element::domainObject::AUTOLOAD" ) {
-                       warn Carp::cluck;
-                       throw OpenSRF::EX::PANIC ( "RECURSION! Caller [ @info[0..2] ] | Object [ ".ref($self)." ]\n ** Trying to call $name", ERROR );
-               }
-               ### Check for recursion
-       }
-
-        my @args = @_;
-       my $meth = class($self).'::'.$name;
-
-       try {
-               return $self->$meth(@args);
-       } catch Error with {
-               my $e = shift;
-               if( $e ) {
-                       OpenSRF::Utils::Logger->error( $@ . $e);
-               } else {
-                       OpenSRF::Utils::Logger->error( $@ );
-               }
-               die $@;
-       };
-
-
-       my $node = OpenSRF::DOM::Element::domainObject::upcast($self);
-       OpenSRF::Utils::Logger->debug( "Autoloaded to: ".ref($node), INTERNAL );
-
-       return $node->$name(@_);
-}
-
-sub downcast {
-       my $obj = shift;
-       return bless $obj => 'XML::LibXML::Element';
-}
-
-sub upcast {
-       my $self = shift;
-       return bless $self => class($self);
-}
-
-sub new {
-       my $class = shift;
-       my $type = shift;
-       my $obj = $class->SUPER::new( name => $type );
-       while (@_) {
-               my ($attr,$val) = (shift,shift);
-               last unless ($attr and $val);
-               $obj->addAttr( $attr, $val );
-               #$obj->appendChild( OpenSRF::DOM::Element::domainObjectAttr->new($attr, $val) );
-       }
-       return $obj;
-}
-
-sub class {
-       my $self = shift;
-       return 'OpenSRF::DomainObject::'.$self->getAttribute('name');
-}
-
-sub base_type {
-       my $self = shift;
-        return $self->getAttribute('name');
-}
-
-sub addAttr {
-       my $self = shift;
-       $self->appendChild( $_ ) for OpenSRF::DOM::Element::domainObjectAttr->new(@_);
-       return $self;
-}
-
-sub attrNode {
-       my $self = shift;
-       my $type = shift;
-       return (grep { $_->getAttribute('name') eq $type } $self->getChildrenByTagName("oils:domainObjectAttr"))[0];
-}
-
-sub attrHash {
-       my $self = shift;
-       my %attrs = map { ( $_->getAttribute('name') => $_->getAttribute('value') ) } $self->getChildrenByTagName('oils:domainObjectAttr');
-
-       return \%attrs;
-}
-
-sub attrValue {
-       my $self = shift;
-       return $self->attrHash->{shift};
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectAttr.pm b/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectAttr.pm
deleted file mode 100644 (file)
index fbdc28e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package OpenSRF::DOM::Element::domainObjectAttr;
-use base 'OpenSRF::DOM::Element';
-
-sub new {
-       my $class = shift;
-       my @nodes;
-       while (@_) {
-               my ($name,$val) = (shift,shift);
-               push @nodes, $class->SUPER::new(name => $name, value => $val);
-       }
-       return @nodes if (wantarray);
-       return $nodes[0];
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectCollection.pm b/OpenSRF/src/perlmods/OpenSRF/DOM/Element/domainObjectCollection.pm
deleted file mode 100644 (file)
index 264c435..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-package OpenSRF::DOM::Element::domainObjectCollection;
-use base 'OpenSRF::DOM::Element';
-use OpenSRF::DOM::Element::domainObjectAttr;
-use OpenSRF::EX;
-
-sub AUTOLOAD {
-       my $self = CORE::shift;
-       (my $name = $AUTOLOAD) =~ s/.*://;   # strip fully-qualified portion
-
-       return  class($self) if ($name eq 'class');
-
-       my @args = @_;
-       my $meth = class($self).'::'.$name;
-
-       ### Check for recursion
-       my $calling_method = (caller(1))[3];
-       my @info = caller(1);
-
-       if( @info ) {
-               if ($info[0] =~ /AUTOLOAD/) { @info = caller(2); }
-       }
-       unless( @info ) { @info = caller(); }
-               if( $calling_method  and $calling_method eq "OpenSRF::DOM::Element::domainObjectCollection::AUTOLOAD" ) {
-               throw OpenSRF::EX::PANIC ( "RECURSION! Caller [ @info ] | Object [ ".ref($self)." ]\n ** Trying to call $name", ERROR );
-       }
-       ### Check for recursion
-
-       try {
-               return $self->$meth(@args);;
-       } catch Error with {
-               my $e = shift;
-               OpenSRF::Utils::Logger->error( $@ . $e);
-               die $@;
-       };
-
-       return upcast($self)->$name(@_);
-}
-
-sub downcast {
-       my $obj = CORE::shift;
-       return bless $obj => 'XML::LibXML::Element';
-}
-
-sub upcast {
-       my $self = CORE::shift;
-       return bless $self => class($self);
-}
-
-sub new {
-       my $class = CORE::shift;
-       my $type = CORE::shift;
-       my $obj = $class->SUPER::new( name => $type );
-       while ( my $val = shift) {
-               throw OpenSRF::EX::NotADomainObject
-                       if (ref $val and $val->nodeName !~ /^oils:domainObject/o);
-               $obj->appendChild( $val );
-       }
-       return $obj;
-}
-
-sub class {
-       my $self = shift;
-       return 'OpenSRF::DomainObjectCollection::'.$self->getAttribute('name');
-}
-
-sub base_type {
-       my $self = shift;
-       return $self->getAttribute('name');
-}
-
-sub pop { 
-       my $self = CORE::shift;
-       return $self->removeChild( $self->lastChild )->upcast;
-}
-
-sub push { 
-       my $self = CORE::shift;
-       my @args = @_;
-       for my $node (@args) {
-               #throw OpenSRF::EX::NotADomainObject ( "$_ must be a oils:domainOjbect*, it's a ".$_->nodeName )
-               #       unless ($_->nodeName =~ /^oils:domainObject/o);
-               
-               unless ($node->nodeName =~ /^oils:domainObject/o) {
-                       $node = OpenSRF::DomainObject::oilsScalar->new($node);
-               }
-
-               $self->appendChild( $node );
-       }
-}
-
-sub shift { 
-       my $self = CORE::shift;
-       return $self->removeChild( $self->firstChild )->upcast;
-}
-
-sub unshift { 
-       my $self = CORE::shift;
-       my @args = @_;
-       for (reverse @args) {
-               throw OpenSRF::EX::NotADomainObject
-                       unless ($_->nodeName =~ /^oils:domainObject/o);
-               $self->insertBefore( $_, $self->firstChild );
-       }
-}
-
-sub first {
-       my $self = CORE::shift;
-       return $self->firstChild->upcast;
-}
-
-sub list {
-       my $self = CORE::shift;
-       return map {(bless($_ => 'OpenSRF::DomainObject::'.$_->getAttribute('name')))} $self->childNodes;
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DOM/Element/params.pm b/OpenSRF/src/perlmods/OpenSRF/DOM/Element/params.pm
deleted file mode 100644 (file)
index ee3755a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-package OpenSRF::DOM::Element::params;
-use base 'OpenSRF::DOM::Element';
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject.pm
deleted file mode 100644 (file)
index 4dc4258..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-package OpenSRF::DomainObject;
-use base 'OpenSRF::DOM::Element::domainObject';
-use OpenSRF::DOM;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::DomainObject::oilsPrimitive;
-my $logger = "OpenSRF::Utils::Logger";
-
-=head1 NAME
-
-OpenSRF::DomainObject
-
-=head1 SYNOPSIS
-
-OpenSRF::DomainObject is an abstract base class.  It
-should not be used directly.  See C<OpenSRF::DomainObject::*>
-for details.
-
-=cut
-
-my $tmp_doc;
-
-sub object_castor {
-       my $self = shift;
-       my $node = shift;
-
-       return unless (defined $node);
-
-       if (ref($node) eq 'HASH') {
-               return new OpenSRF::DomainObject::oilsHash (%$node);
-       } elsif (ref($node) eq 'ARRAY') {
-               return new OpenSRF::DomainObject::oilsArray (@$node);
-       }
-
-       return $node;
-}
-
-sub native_castor {
-       my $self = shift;
-       my $node = shift;
-
-       return unless (defined $node);
-
-       if ($node->nodeType == 3) {
-               return $node->nodeValue;
-       } elsif ($node->nodeName =~ /domainObject/o) {
-               return $node->tie_me if ($node->class->can('tie_me'));
-       }
-       return $node;
-}
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       (my $type = $class) =~ s/^.+://o;
-
-       $tmp_doc ||= OpenSRF::DOM->createDocument;
-       my $dO = OpenSRF::DOM::Element::domainObject->new( $type, @_ );
-
-       $tmp_doc->documentElement->appendChild($dO);
-
-       return $dO;
-}
-
-sub _attr_get_set {
-       my $self = shift;
-       my $part = shift;
-
-       my $node = $self->attrNode($part);
-
-       if (defined(my $new_value = shift)) {
-               if (defined $node) {
-                       my $old_val = $node->getAttribute( "value" );
-                       $node->setAttribute(value => $new_value);
-                       return $old_val;
-               } else {
-                       $self->addAttr( $part => $new_value );
-                       return $new_value;
-               }
-       } elsif ( $node ) {
-               return $node->getAttribute( "value" );
-       }
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm
deleted file mode 100644 (file)
index 56fa9d3..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-package OpenSRF::DomainObject::oilsMessage;
-use JSON;
-use OpenSRF::AppSession;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::Utils::Logger qw/:level/;
-use warnings; use strict;
-use OpenSRF::EX qw/:try/;
-
-JSON->register_class_hint(hint => 'osrfMessage', name => 'OpenSRF::DomainObject::oilsMessage', type => 'hash');
-
-sub toString {
-       my $self = shift;
-       my $pretty = shift;
-       return JSON->perl2prettyJSON($self) if ($pretty);
-       return JSON->perl2JSON($self);
-}
-
-sub new {
-       my $self = shift;
-       my $class = ref($self) || $self;
-       my %args = @_;
-       return bless \%args => $class;
-}
-
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsMessage
-
-=head1
-
-use OpenSRF::DomainObject::oilsMessage;
-
-my $msg = OpenSRF::DomainObject::oilsMessage->new( type => 'CONNECT' );
-
-$msg->payload( $domain_object );
-
-=head1 ABSTRACT
-
-OpenSRF::DomainObject::oilsMessage is used internally to wrap data sent
-between client and server.  It provides the structure needed to authenticate
-session data, and also provides the logic needed to unwrap session data and 
-pass this information along to the Application Layer.
-
-=cut
-
-my $log = 'OpenSRF::Utils::Logger';
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObject::oilsMessage->type( [$new_type] )
-
-=over 4
-
-Used to specify the type of message.  One of
-B<CONNECT, REQUEST, RESULT, STATUS, ERROR, or DISCONNECT>.
-
-=back
-
-=cut
-
-sub type {
-       my $self = shift;
-       my $val = shift;
-       $self->{type} = $val if (defined $val);
-       return $self->{type};
-}
-
-=head2 OpenSRF::DomainObject::oilsMessage->api_level( [$new_api_level] )
-
-=over 4
-
-Used to specify the api_level of message.  Currently, only api_level C<1> is
-supported.  This will be used to check that messages are well-formed, and as
-a hint to the Application as to which version of a method should fulfill a
-REQUEST message.
-
-=back
-
-=cut
-
-sub api_level {
-       my $self = shift;
-       my $val = shift;
-       $self->{api_level} = $val if (defined $val);
-       return $self->{api_level};
-}
-
-=head2 OpenSRF::DomainObject::oilsMessage->threadTrace( [$new_threadTrace] );
-
-=over 4
-
-Sets or gets the current message sequence identifier, or thread trace number,
-for a message.  Useful as a debugging aid, but that's about it.
-
-=back
-
-=cut
-
-sub threadTrace {
-       my $self = shift;
-       my $val = shift;
-       $self->{threadTrace} = $val if (defined $val);
-       return $self->{threadTrace};
-}
-
-=head2 OpenSRF::DomainObject::oilsMessage->update_threadTrace
-
-=over 4
-
-Increments the threadTrace component of a message.  This is automatic when
-using the normal session processing stack.
-
-=back
-
-=cut
-
-sub update_threadTrace {
-       my $self = shift;
-       my $tT = $self->threadTrace;
-
-       $tT ||= 0;
-       $tT++;
-
-       $log->debug("Setting threadTrace to $tT",DEBUG);
-
-       $self->threadTrace($tT);
-
-       return $tT;
-}
-
-=head2 OpenSRF::DomainObject::oilsMessage->payload( [$new_payload] )
-
-=over 4
-
-Sets or gets the payload of a message.  This should be exactly one object
-of (sub)type domainObject or domainObjectCollection.
-
-=back
-
-=cut
-
-sub payload {
-       my $self = shift;
-       my $val = shift;
-       $self->{payload} = $val if (defined $val);
-       return $self->{payload};
-}
-
-=head2 OpenSRF::DomainObject::oilsMessage->handler( $session_id )
-
-=over 4
-
-Used by the message processing stack to set session state information from the current
-message, and then sends control (via the payload) to the Application layer.
-
-=back
-
-=cut
-
-sub handler {
-       my $self = shift;
-       my $session = shift;
-
-       my $mtype = $self->type;
-       my $api_level = $self->api_level || 1;;
-       my $tT = $self->threadTrace;
-
-       $session->last_message_type($mtype);
-       $session->last_message_api_level($api_level);
-       $session->last_threadTrace($tT);
-
-       $log->debug(" Received api_level => [$api_level], MType => [$mtype], ".
-                       "from [".$session->remote_id."], threadTrace[".$self->threadTrace."]");
-
-       my $val;
-       if ( $session->endpoint == $session->SERVER() ) {
-               $val = $self->do_server( $session, $mtype, $api_level, $tT );
-
-       } elsif ($session->endpoint == $session->CLIENT()) {
-               $val = $self->do_client( $session, $mtype, $api_level, $tT );
-       }
-
-       if( $val ) {
-               return OpenSRF::Application->handler($session, $self->payload);
-       } else {
-               $log->debug("Request was handled internally", DEBUG);
-       }
-
-       return 1;
-
-}
-
-
-
-# handle server side message processing
-
-# !!! Returning 0 means that we don't want to pass ourselves up to the message layer !!!
-sub do_server {
-       my( $self, $session, $mtype, $api_level, $tT ) = @_;
-
-       # A Server should never receive STATUS messages.  If so, we drop them.
-       # This is to keep STATUS's from dead client sessions from creating new server
-       # sessions which send mangled session exceptions to backends for messages 
-       # that they are not aware of any more.
-       if( $mtype eq 'STATUS' ) { return 0; }
-
-       
-       if ($mtype eq 'DISCONNECT') {
-               $session->disconnect;
-               $session->kill_me;
-               return 0;
-       }
-
-       if ($session->state == $session->CONNECTING()) {
-
-               if($mtype ne "CONNECT" and $session->stateless) {
-                       return 1; #pass the message up the stack
-               }
-
-               # the transport layer thinks this is a new connection. is it?
-               unless ($mtype eq 'CONNECT') {
-                       $log->error("Connection seems to be mangled: Got $mtype instead of CONNECT");
-
-                       my $res = OpenSRF::DomainObject::oilsBrokenSession->new(
-                                       status => "Connection seems to be mangled: Got $mtype instead of CONNECT",
-                       );
-
-                       $session->status($res);
-                       $session->kill_me;
-                       return 0;
-
-               }
-               
-               my $res = OpenSRF::DomainObject::oilsConnectStatus->new;
-               $session->status($res);
-               $session->state( $session->CONNECTED );
-
-               return 0;
-       }
-
-
-       return 1;
-
-}
-
-
-# Handle client side message processing. Return 1 when the the message should be pushed
-# up to the application layer.  return 0 otherwise.
-sub do_client {
-
-       my( $self, $session , $mtype, $api_level, $tT) = @_;
-
-
-       if ($mtype eq 'STATUS') {
-
-               if ($self->payload->statusCode == STATUS_OK) {
-                       $session->state($session->CONNECTED);
-                       $log->debug("We connected successfully to ".$session->app);
-                       return 0;
-               }
-
-               if ($self->payload->statusCode == STATUS_TIMEOUT) {
-                       $session->state( $session->DISCONNECTED );
-                       $session->reset;
-                       $session->connect;
-                       $session->push_resend( $session->app_request($self->threadTrace) );
-                       $log->debug("Disconnected because of timeout");
-                       return 0;
-
-               } elsif ($self->payload->statusCode == STATUS_REDIRECTED) {
-                       $session->state( $session->DISCONNECTED );
-                       $session->reset;
-                       $session->connect;
-                       $session->push_resend( $session->app_request($self->threadTrace) );
-                       $log->debug("Disconnected because of redirect", WARN);
-                       return 0;
-
-               } elsif ($self->payload->statusCode == STATUS_EXPFAILED) {
-                       $session->state( $session->DISCONNECTED );
-                       $log->debug("Disconnected because of mangled session", WARN);
-                       $session->reset;
-                       $session->push_resend( $session->app_request($self->threadTrace) );
-                       return 0;
-
-               } elsif ($self->payload->statusCode == STATUS_CONTINUE) {
-                       $session->reset_request_timeout($self->threadTrace);
-                       return 0;
-
-               } elsif ($self->payload->statusCode == STATUS_COMPLETE) {
-                       my $req = $session->app_request($self->threadTrace);
-                       $req->complete(1) if ($req);
-                       return 0;
-               }
-
-               # add more STATUS handling code here (as 'elsif's), for Message layer status stuff
-
-               #$session->state( $session->DISCONNECTED() );
-               #$session->reset;
-
-       } elsif ($session->state == $session->CONNECTING()) {
-               # This should be changed to check the type of response (is it a connectException?, etc.)
-       }
-
-       if( $self->payload and $self->payload->isa( "ERROR" ) ) { 
-               if ($session->raise_remote_errors) {
-                       $self->payload->throw();
-               }
-       }
-
-       $log->debug("oilsMessage passing to Application: " . $self->type." : ".$session->remote_id );
-
-       return 1;
-
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMethod.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMethod.pm
deleted file mode 100644 (file)
index 6c81902..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-package OpenSRF::DomainObject::oilsMethod;
-
-use JSON;
-JSON->register_class_hint(hint => 'osrfMethod', name => 'OpenSRF::DomainObject::oilsMethod', type => 'hash');
-
-sub toString {
-       my $self = shift;
-       my $pretty = shift;
-       return JSON->perl2prettyJSON($self) if ($pretty);
-       return JSON->perl2JSON($self);
-}
-
-sub new {
-       my $self = shift;
-       my $class = ref($self) || $self;
-       my %args = @_;
-       return bless \%args => $class;
-}
-
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsMethod
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsMethod;
-
-my $method = OpenSRF::DomainObject::oilsMethod->new( method => 'search' );
-
-$method->return_type( 'mods' );
-
-$method->params( 'title:harry potter' );
-
-$client->send( 'REQUEST', $method );
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObject::oilsMethod->method( [$new_method_name] )
-
-=over 4
-
-Sets or gets the method name that will be called on the server.  As above,
-this can be specified as a build attribute as well as added to a prebuilt
-oilsMethod object.
-
-=back
-
-=cut
-
-sub method {
-       my $self = shift;
-       my $val = shift;
-       $self->{method} = $val if (defined $val);
-       return $self->{method};
-}
-
-=head2 OpenSRF::DomainObject::oilsMethod->return_type( [$new_return_type] )
-
-=over 4
-
-Sets or gets the return type for this method call.  This can also be supplied as
-a build attribute.
-
-This option does not require that the server return the type you request.  It is
-used as a suggestion when more than one return type or format is possible.
-
-=back
-
-=cut
-
-
-sub return_type {
-       my $self = shift;
-       my $val = shift;
-       $self->{return_type} = $val if (defined $val);
-       return $self->{return_type};
-}
-
-=head2 OpenSRF::DomainObject::oilsMethod->params( @new_params )
-
-=over 4
-
-Sets or gets the parameters for this method call.  Just pass in either text
-parameters, or DOM nodes of any type.
-
-=back
-
-=cut
-
-
-sub params {
-       my $self = shift;
-       my @args = @_;
-       $self->{params} = \@args if (@args);
-       return @{ $self->{params} };
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMultiSearch.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsMultiSearch.pm
deleted file mode 100644 (file)
index fda4523..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-package OpenSRF::DomainObjectCollection::oilsMultiSearch;
-use OpenSRF::DomainObjectCollection;
-use OpenSRF::DomainObject::oilsPrimitive;
-use OpenSRF::DomainObject::oilsSearch;
-use OpenSRF::DOM::Element::searchCriteria;
-use OpenSRF::DOM::Element::searchCriterium;
-use base 'OpenSRF::DomainObjectCollection::oilsHash';
-
-sub new {
-       my $class = shift;
-       my %args = @_;
-
-       $class = ref($class) || $class;
-
-       my $self = $class->SUPER::new;
-
-       tie my %hash, 'OpenSRF::DomainObjectCollection::oilsHash', $self;
-
-       $self->set( bind_count  => 1 );
-       $self->set( searches    => new OpenSRF::DomainObjectCollection::oilsHash );
-       $self->set( relators    => new OpenSRF::DomainObjectCollection::oilsArray );
-       $self->set( fields      => new OpenSRF::DomainObjectCollection::oilsArray );
-       $self->set( group_by    => new OpenSRF::DomainObjectCollection::oilsArray );
-       $self->set( order_by    => new OpenSRF::DomainObjectCollection::oilsArray );
-       
-       return $self;
-}
-
-sub add_subsearch {
-       my $self = shift;
-       my $alias = shift;
-       my $search = shift;
-       my $relator = shift;
-       
-       $search = OpenSRF::DomainObject::oilsSearch->new($search) if (ref($search) eq 'ARRAY');
-
-       $self->searches->set( $alias => $search );
-       
-       if ($self->searches->size > 1) {
-               throw OpenSRF::EX::InvalidArg ('You need to pass a relator searchCriterium')
-                       unless (defined $relator);
-       }
-
-       $relator = OpenSRF::DOM::Element::searchCriterium->new( @$relator )
-               if (ref($relator) eq 'ARRAY');
-
-       $self->relators->push( $relator ) if (defined $relator);
-
-       return $self;
-}
-
-sub relators {
-       return $_[0]->_accessor('relators');
-}
-
-sub searches {
-       return $_[0]->_accessor('searches');
-}
-
-sub fields {
-       my $self = shift;
-       my @parts = @_;
-       if (@parts) {
-               $self->set( fields => OpenSRF::DomainObjectCollection::oilsArray->new(@_) );
-       }
-       return $self->_accessor('fields')->list;
-}
-
-sub format {
-       $_[0]->set( format => $_[1] ) if (defined $_[1]);
-       return $_[0]->_accessor('format');
-}
-
-sub limit {
-       $_[0]->set( limit => $_[1] ) if (defined $_[1]);
-       return $_[0]->_accessor('limit');
-}
-
-sub offset {
-       $_[0]->set( offset => $_[1] ) if (defined $_[1]);
-       return $_[0]->_accessor('offset');
-}
-
-sub chunk_key {
-       $_[0]->set( chunk_key => $_[1] ) if (defined $_[1]);
-       return $_[0]->_accessor('chunk_key');
-}
-
-sub order_by {
-       my $self = shift;
-       my @parts = @_;
-       if (@parts) {
-               $self->set( order_by => OpenSRF::DomainObjectCollection::oilsArray->new(@_) );
-       }
-       return $self->_accessor('order_by')->list;
-}
-
-sub group_by {
-       my $self = shift;
-       my @parts = @_;
-       if (@parts) {
-               $self->set( group_by => OpenSRF::DomainObjectCollection::oilsArray->new(@_) );
-       }
-       return $self->_accessor('group_by')->list;
-}
-
-sub SQL_select_list {
-       my $self = shift;
-
-       if (my $sql = $self->_accessor('sql_select_list')) {
-               return $sql;
-       }
-
-       $self->set( sql_select_list => 'SELECT '.join(', ', $self->fields) ) if defined($self->fields);
-       return $self->_accessor('sql_select_list');
-}
-
-sub SQL_group_by {
-       my $self = shift;
-
-       if (my $sql = $self->_accessor('sql_group_by')) {
-               return $sql;
-       }
-
-       $self->set( sql_group_by => 'GROUP BY '.join(', ', $self->group_by) ) if defined($self->group_by);
-       return $self->_accessor('sql_group_by');
-}
-
-sub SQL_order_by {
-       my $self = shift;
-
-       if (my $sql = $self->_accessor('sql_order_by')) {
-               return $sql;
-       }
-
-       $self->set( sql_order_by => 'ORDER BY '.join(', ', $self->order_by) ) if defined($self->order_by);
-       return $self->_accessor('sql_order_by');
-}
-
-sub SQL_offset {
-       my $self = shift;
-
-       if (my $sql = $self->_accessor('sql_offset')) {
-               return $sql;
-       }
-
-       $self->set( sql_offset => 'OFFSET '.$self->offset ) if defined($self->offset);
-       return $self->_accessor('sql_offset');
-}
-
-sub SQL_limit {
-       my $self = shift;
-
-       if (my $sql = $self->_accessor('sql_limit')) {
-               return $sql;
-       }
-
-       $self->set( sql_limit => 'LIMIT '.$self->limit ) if defined($self->limit);
-       return $self->_accessor('sql_limit');
-}
-
-sub toSQL {
-       my $self = shift;
-
-       my $SQL = $self->SQL_select_list.' FROM ';
-
-       my @subselects;
-       for my $search ( $self->searches->keys ) {
-               push @subselects, '('.$self->searches->_accessor($search)->toSQL.') '.$search;
-       }
-       $SQL .= join(', ', @subselects).' WHERE ';
-
-       my @relators;
-       for my $rel ( $self->relators->list ) {
-               push @relators, $rel->value->toSQL( no_quote => 1 );
-       }
-       $SQL .= join(' AND ', @relators).' ';
-       $SQL .= join ' ', ($self->SQL_group_by, $self->SQL_order_by, $self->SQL_limit, $self->SQL_offset);
-
-       return $SQL;
-}
-
-#this is just to allow DomainObject to "upcast" nicely
-package OpenSRF::DomainObject::oilsMultiSearch;
-use base OpenSRF::DomainObjectCollection::oilsMultiSearch;
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsPrimitive.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsPrimitive.pm
deleted file mode 100644 (file)
index bf9507a..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-package OpenSRF::DomainObject::oilsScalar;
-use base 'OpenSRF::DomainObject';
-use OpenSRF::DomainObject;
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsScalar
-
-=head1 SYNOPSIS
-
-  use OpenSRF::DomainObject::oilsScalar;
-
-  my $text = OpenSRF::DomainObject::oilsScalar->new( 'a string or number' );
-  $text->value( 'replacement value' );
-  print "$text"; # stringify
-
-   ...
-
-  $text->value( 1 );
-  if( $text ) { # boolify
-
-   ...
-
-  $text->value( rand() * 1000 );
-  print 10 + $text; # numify
-
-    Or, using the TIE interface:
-
-  my $scalar;
-  my $real_object = tie($scalar, 'OpenSRF::DomainObject::oilsScalar', "a string to store...");
-
-  $scalar = "a new string";
-  print $scalar . "\n";
-  print $real_object->toString . "\n";
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObject::oilsScalar->value( [$new_value] )
-
-=over 4
-
-Sets or gets the value of the scalar.  As above, this can be specified
-as a build attribute as well as added to a prebuilt oilsScalar object.
-
-=back
-
-=cut
-
-use overload '""'   => sub { return ''.$_[0]->value };
-use overload '0+'   => sub { return int($_[0]->value) };
-use overload '<=>'   => sub { return int($_[0]->value) <=> $_[1] };
-use overload 'bool' => sub { return 1 if ($_[0]->value); return 0 };
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $value = shift;
-
-       return $value
-               if (    defined $value and
-                       ref $value and $value->can('base_type') and
-                       UNIVERSAL::isa($value->class, __PACKAGE__) and
-                       !scalar(@_)
-               );
-
-       my $self = $class->SUPER::new;
-
-       if (ref($value) and ref($value) eq 'SCALAR') {
-               $self->value($$value);
-               tie( $$value, ref($self->upcast), $self);
-       } else {
-               $self->value($value) if (defined $value);
-       }
-
-       return $self;
-}
-
-sub TIESCALAR {
-       return CORE::shift()->new(@_);
-}
-
-sub value {
-       my $self = shift;
-       my $value = shift;
-
-       if ( defined $value ) {
-               $self->removeChild($_) for ($self->childNodes);
-               if (ref($value) && $value->isa('XML::LibXML::Node')) {
-                       #throw OpenSRF::EX::NotADomainObject
-                       #       unless ($value->nodeName =~ /^oils:domainObject/o);
-                       $self->appendChild($value);
-               } elsif (defined $value) {
-                       $self->appendText( ''.$value );
-               }
-
-               return $value
-       } else {
-               $value = $self->firstChild;
-               if ($value) {
-                       if ($value->nodeType == 3) {
-                               return $value->textContent;
-                       } else {
-                               return $value;
-                       }
-               }
-               return undef;
-       }
-}
-
-sub FETCH { $_[0]->value }
-sub STORE { $_[0]->value($_[1]) }
-
-package OpenSRF::DomainObject::oilsPair;
-use base 'OpenSRF::DomainObject::oilsScalar';
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsPair
-
-=head1 SYNOPSIS
-
-  use OpenSRF::DomainObject::oilsPair;
-
-  my $pair = OpenSRF::DomainObject::oilsPair->new( 'key_for_pair' => 'a string or number' );
-
-  $pair->key( 'replacement key' );
-  $pair->value( 'replacement value' );
-
-  print "$pair"; # stringify 'value'
-
-   ...
-
-  $pair->value( 1 );
-
-  if( $pair ) { # boolify
-
-   ...
-
-  $pair->value( rand() * 1000 );
-
-  print 10 + $pair; # numify 'value'
-
-=head1 ABSTRACT
-
-This class impliments a "named pair" object.  This is the basis for
-hash-type domain objects.
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObject::oilsPair->value( [$new_value] )
-
-=over 4
-
-Sets or gets the value of the pair.  As above, this can be specified
-as a build attribute as well as added to a prebuilt oilsPair object.
-
-=back
-
-=head2 OpenSRF::DomainObject::oilsPair->key( [$new_key] )
-
-=over 4
-
-Sets or gets the key of the pair.  As above, this can be specified
-as a build attribute as well as added to a prebuilt oilsPair object.
-This must be a perlish scalar; any string or number that is valid as the 
-attribute on an XML node will work.
-
-=back
-
-=cut
-
-use overload '""'   => sub { return ''.$_[0]->value };
-use overload '0+'   => sub { return int($_[0]->value) };
-use overload 'bool' => sub { return 1 if ($_[0]->value); return 0 };
-
-sub new {
-       my $class = shift;
-       my ($key, $value) = @_;
-
-       my $self = $class->SUPER::new($value);
-       $self->setAttribute( key => $key);
-
-       return $self;
-}
-
-sub key {
-       my $self = shift;
-       my $key = shift;
-
-       $self->setAttribute( key => $key) if ($key);
-       return $self->getAttribute( 'key' );
-}
-
-package OpenSRF::DomainObjectCollection::oilsArray;
-use base qw/OpenSRF::DomainObjectCollection Tie::Array/;
-use OpenSRF::DomainObjectCollection;
-
-=head1 NAME
-
-OpenSRF::DomainObjectCollection::oilsArray
-
-=head1 SYNOPSIS
-
-  use OpenSRF::DomainObject::oilsPrimitive;
-
-  my $collection = OpenSRF::DomainObjectCollection::oilsArray->new( $domain_object, $another_domain_object, ...);
-
-  $collection->push( 'appended value' );
-  $collection->unshift( 'prepended vaule' );
-  my $first = $collection->shift;
-  my $last = $collection->pop;
-
-   ...
-
-  my @values = $collection->list;
-
-    Or, using the TIE interface:
-
-  my @array;
-  my $real_object = tie(@array, 'OpenSRF::DomainObjectCollection::oilsArray', $domain, $objects, 'to', $store);
-
-      or to tie an existing $collection object
-
-  my @array;
-  tie(@array, 'OpenSRF::DomainObjectCollection::oilsArray', $collection);
-
-      or even....
-
-  my @array;
-  tie(@array, ref($collection), $collection);
-
-
-  $array[2] = $DomainObject; # replaces 'to' (which is now an OpenSRF::DomainObject::oilsScalar) above
-  delete( $array[3] ); # removes '$store' above.
-  my $size = scalar( @array );
-
-  print $real_object->toString;
-
-=head1 ABSTRACT
-
-This package impliments array-like domain objects.  A full tie interface
-is also provided.  If elements are passed in as strings (or numbers) they
-are turned into oilsScalar objects.  Any simple scalar or Domain Object may
-be stored in the array.
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObjectCollection::oilsArray->list()
-
-=over 4
-
-Returns the array of 'OpenSRF::DomainObject's that this collection contains.
-
-=back
-
-=cut
-
-sub tie_me {
-       my $class = shift;
-       $class = ref($class) || $class;
-       my $node = shift;
-       my @array;
-       tie @array, $class, $node;
-       return \@array;
-}
-
-# an existing DomainObjectCollection::oilsArray can now be tied
-sub TIEARRAY {
-       return CORE::shift()->new(@_);
-}
-
-sub new {
-       my $class = CORE::shift;
-       $class = ref($class) || $class;
-
-       my $first = CORE::shift;
-
-       return $first
-               if (    defined $first and
-                       ref $first and $first->can('base_type') and
-                       UNIVERSAL::isa($first->class, __PACKAGE__) and
-                       !scalar(@_)
-               );
-
-       my $self = $class->SUPER::new;
-
-       my @args = @_;
-       if (ref($first) and ref($first) eq 'ARRAY') {
-               push @args, @$first;
-               tie( @$first, ref($self->upcast), $self);
-       } else {
-               unshift @args, $first if (defined $first);
-       }
-
-       $self->STORE($self->FETCHSIZE, $_) for (@args);
-       return $self;
-}
-
-sub STORE {
-       my $self = CORE::shift;
-       my ($index, $value) = @_;
-
-       $value = OpenSRF::DomainObject::oilsScalar->new($value)
-               unless ( ref $value and $value->nodeName =~ /^oils:domainObject/o );
-
-       $self->_expand($index) unless ($self->EXISTS($index));
-
-       ($self->childNodes)[$index]->replaceNode( $value );
-
-       return $value->upcast;
-}
-
-sub push {
-       my $self = CORE::shift;
-       my @values = @_;
-       $self->STORE($self->FETCHSIZE, $_) for (@values);
-}
-
-sub pop {
-       my $self = CORE::shift;
-       my $node = $self->SUPER::pop;
-       if ($node) {
-               if ($node->base_type eq 'oilsScalar') {
-                       return $node->value;
-               }
-               return $node->upcast;
-       }
-}
-
-sub unshift {
-       my $self = CORE::shift;
-       my @values = @_;
-       $self->insertBefore($self->firstChild, $_ ) for (reverse @values);
-}
-
-sub shift {
-       my $self = CORE::shift;
-       my $node = $self->SUPER::shift;
-       if ($node) {
-               if ($node->base_type eq 'oilsScalar') {
-                       return $node->value;
-               }
-               return $node->upcast;
-       }
-}
-
-sub FETCH {
-       my $self = CORE::shift;
-       my $index = CORE::shift;
-       my $node =  ($self->childNodes)[$index]->upcast;
-       if ($node) {
-               if ($node->base_type eq 'oilsScalar') {
-                       return $node->value;
-               }
-               return $node->upcast;
-       }
-}
-
-sub size {
-       my $self = CORE::shift;
-       scalar($self->FETCHSIZE)
-}
-
-sub FETCHSIZE {
-       my $self = CORE::shift;
-       my @a = $self->childNodes;
-       return scalar(@a);
-}
-
-sub _expand {
-       my $self = CORE::shift;
-       my $count = CORE::shift;
-       my $size = $self->FETCHSIZE;
-       for ($size..$count) {
-               $self->SUPER::push( new OpenSRF::DomainObject::oilsScalar );
-       }
-}
-
-sub STORESIZE {
-       my $self = CORE::shift;
-       my $count = CORE::shift;
-       my $size = $self->FETCHSIZE - 1;
-
-       if (defined $count and $count != $size) {
-               if ($size < $count) {
-                       $self->_expand($count);
-                       $size = $self->FETCHSIZE - 1;
-               } else {
-                       while ($size > $count) {
-                               $self->SUPER::pop;
-                               $size = $self->FETCHSIZE - 1;
-                       }
-               }
-       }
-
-       return $size
-}
-
-sub EXISTS {
-       my $self = CORE::shift;
-       my $index = CORE::shift;
-       return $self->FETCHSIZE > abs($index) ? 1 : 0;
-}
-
-sub CLEAR {
-       my $self = CORE::shift;
-       $self->STORESIZE(0);
-       return $self;
-}
-
-sub DELETE {
-       my $self = CORE::shift;
-       my $index = CORE::shift;
-       return $self->removeChild( ($self->childNodes)[$index] );
-}
-
-package OpenSRF::DomainObjectCollection::oilsHash;
-use base qw/OpenSRF::DomainObjectCollection Tie::Hash/;
-
-=head1 NAME
-
-OpenSRF::DomainObjectCollection::oilsHash
-
-=head1 SYNOPSIS
-
-  use OpenSRF::DomainObject::oilsPrimitive;
-
-  my $collection = OpenSRF::DomainObjectCollection::oilsHash->new( key1 => $domain_object, key2 => $another_domain_object, ...);
-
-  $collection->set( key =>'value' );
-  my $value = $collection->find( $key );
-  my $dead_value = $collection->remove( $key );
-  my @keys = $collection->keys;
-  my @values = $collection->values;
-
-    Or, using the TIE interface:
-
-  my %hash;
-  my $real_object = tie(%hash, 'OpenSRF::DomainObjectCollection::oilsHash', domain => $objects, to => $store);
-
-      or to tie an existing $collection object
-
-  my %hash;
-  tie(%hash, 'OpenSRF::DomainObjectCollection::oilsHash', $collection);
-
-      or even....
-
-  my %hash;
-  tie(%hash, ref($collection), $collection);
-
-      or perhaps ...
-
-  my $content = $session->recv->content; # eh? EH?!?!
-  tie(my %hash, ref($content), $content);
-
-  $hash{domain} = $DomainObject; # replaces value for key 'domain' above
-  delete( $hash{to} ); # removes 'to => $store' above.
-  for my $key ( keys %hash ) {
-    ... do stuff ...
-  }
-
-  print $real_object->toString;
-
-=head1 ABSTRACT
-
-This package impliments hash-like domain objects.  A full tie interface
-is also provided.  If elements are passed in as strings (or numbers) they
-are turned into oilsScalar objects.  Any simple scalar or Domain Object may
-be stored in the hash.
-
-=back
-
-=cut
-
-sub tie_me {
-       my $class = shift;
-       $class = ref($class) || $class;
-       my $node = shift;
-       my %hash;
-       tie %hash, $class, $node;
-       return %hash;
-}
-
-
-sub keys {
-       my $self = shift;
-       return map { $_->key } $self->childNodes;
-}
-
-sub values {
-       my $self = shift;
-       return map { $_->value } $self->childNodes;
-}
-
-# an existing DomainObjectCollection::oilsHash can now be tied
-sub TIEHASH {
-       return shift()->new(@_);
-}
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-       my $first = shift;
-       
-       return $first
-               if (    defined $first and
-                       ref $first and $first->can('base_type') and
-                       UNIVERSAL::isa($first->class, __PACKAGE__) and
-                       !scalar(@_)
-               );
-       
-       my $self = $class->SUPER::new;
-
-       my @args = @_;
-       if (ref($first) and ref($first) eq 'HASH') {
-               push @args, %$first;
-               tie( %$first, ref($self->upcast), $self);
-       } else {
-               unshift @args, $first if (defined $first);
-       }
-
-       my %arg_hash = @args;
-       while ( my ($key, $value) = each(%arg_hash) ) {
-               $self->STORE($key => $value);
-       }
-       return $self;
-}
-
-sub STORE {
-       shift()->set(@_);
-}
-
-sub set {
-       my $self = shift;
-       my ($key, $value) = @_;
-
-       my $node = $self->find_node($key);
-
-       return $node->value( $value ) if (defined $node);
-       return $self->appendChild( OpenSRF::DomainObject::oilsPair->new($key => $value) );
-}
-
-sub _accessor {
-       my $self = shift;
-       my $key = shift;
-       my $node = find_node($self, $key);
-       return $node->value if ($node);
-}       
-
-sub find_node {
-       my $self = shift;
-       my $key = shift;
-       return ($self->findnodes("oils:domainObject[\@name=\"oilsPair\" and \@key=\"$key\"]", $self))[0];
-}
-
-sub find {
-       my $self = shift;
-       my $key = shift;
-       my $node = $self->find_node($key);
-       my $value = $node->value if (defined $node);
-       return $value;
-}
-
-sub size {
-       my $self = CORE::shift;
-       my @a = $self->childNodes;
-       return scalar(@a);
-}
-
-sub FETCH {
-       my $self = shift;
-       my $key = shift;
-       return $self->find($key);
-}
-
-sub EXISTS {
-       my $self = shift;
-       my $key = shift;
-       return $self->find_node($key);
-}
-
-sub CLEAR {
-       my $self = shift;
-       $self->removeChild for ($self->childNodes);
-       return $self;
-}
-
-sub DELETE {
-       shift()->remove(@_);
-}
-
-sub remove {
-       my $self = shift;
-       my $key = shift;
-       return $self->removeChild( $self->find_node($key) );
-}
-
-sub FIRSTKEY {
-       my $self = shift;
-       return $self->firstChild->key;
-}
-
-sub NEXTKEY {
-       my $self = shift;
-       my $key = shift;
-       my ($prev_node) = $self->find_node($key);
-       my $last_node = $self->lastChild;
-
-       if ($last_node and $last_node->key eq $prev_node->key) {
-               return undef;
-       } else {
-               return $prev_node->nextSibling->key;
-       }
-}
-
-package OpenSRF::DomainObject::oilsHash;
-use base qw/OpenSRF::DomainObjectCollection::oilsHash/;
-
-package OpenSRF::DomainObject::oilsArray;
-use base qw/OpenSRF::DomainObjectCollection::oilsArray/;
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm
deleted file mode 100644 (file)
index 673516b..0000000
+++ /dev/null
@@ -1,455 +0,0 @@
-package OpenSRF::DomainObject::oilsResponse;
-use vars qw/@EXPORT_OK %EXPORT_TAGS/;
-use Exporter;
-use JSON;
-use base qw/Exporter/;
-use OpenSRF::Utils::Logger qw/:level/;
-
-JSON->register_class_hint( hint => 'osrfResponse', name => 'OpenSRF::DomainObject::oilsResponse', type => 'hash' );
-
-BEGIN {
-@EXPORT_OK = qw/STATUS_CONTINUE STATUS_OK STATUS_ACCEPTED
-                                       STATUS_BADREQUEST STATUS_UNAUTHORIZED STATUS_FORBIDDEN
-                                       STATUS_NOTFOUND STATUS_NOTALLOWED STATUS_TIMEOUT
-                                       STATUS_INTERNALSERVERERROR STATUS_NOTIMPLEMENTED
-                                       STATUS_VERSIONNOTSUPPORTED STATUS_REDIRECTED 
-                                       STATUS_EXPFAILED STATUS_COMPLETE/;
-
-%EXPORT_TAGS = (
-       status => [ qw/STATUS_CONTINUE STATUS_OK STATUS_ACCEPTED
-                                       STATUS_BADREQUEST STATUS_UNAUTHORIZED STATUS_FORBIDDEN
-                                       STATUS_NOTFOUND STATUS_NOTALLOWED STATUS_TIMEOUT
-                                       STATUS_INTERNALSERVERERROR STATUS_NOTIMPLEMENTED
-                                       STATUS_VERSIONNOTSUPPORTED STATUS_REDIRECTED 
-                                       STATUS_EXPFAILED STATUS_COMPLETE/ ],
-);
-
-}
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsResponse
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-
-my $resp = OpenSRF::DomainObject::oilsResponse->new;
-
-$resp->status( 'a status message' );
-
-$resp->statusCode( STATUS_CONTINUE );
-
-$client->respond( $resp );
-
-=head1 ABSTRACT
-
-OpenSRF::DomainObject::oilsResponse implements the base class for all Application
-layer messages send between the client and server.
-
-=cut
-
-sub STATUS_CONTINUE            { return 100 }
-
-sub STATUS_OK                          { return 200 }
-sub STATUS_ACCEPTED            { return 202 }
-sub STATUS_COMPLETE            { return 205 }
-
-sub STATUS_REDIRECTED  { return 307 }
-
-sub STATUS_BADREQUEST  { return 400 }
-sub STATUS_UNAUTHORIZED        { return 401 }
-sub STATUS_FORBIDDEN           { return 403 }
-sub STATUS_NOTFOUND            { return 404 }
-sub STATUS_NOTALLOWED  { return 405 }
-sub STATUS_TIMEOUT             { return 408 }
-sub STATUS_EXPFAILED           { return 417 }
-
-sub STATUS_INTERNALSERVERERROR { return 500 }
-sub STATUS_NOTIMPLEMENTED                      { return 501 }
-sub STATUS_VERSIONNOTSUPPORTED { return 505 }
-
-my $log = 'OpenSRF::Utils::Logger';
-
-sub toString {
-       my $self = shift;
-       my $pretty = shift;
-       return JSON->perl2prettyJSON($self) if ($pretty);
-       return JSON->perl2JSON($self);
-}
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $default_status = eval "\$${class}::status";
-       my $default_statusCode = eval "\$${class}::statusCode";
-
-       my %args = (    status => $default_status,
-                       statusCode => $default_statusCode,
-                       @_ );
-       
-       return bless( \%args => $class );
-}
-
-sub status {
-       my $self = shift;
-       my $val = shift;
-       $self->{status} = $val if (defined $val);
-       return $self->{status};
-}
-
-sub statusCode {
-       my $self = shift;
-       my $val = shift;
-       $self->{statusCode} = $val if (defined $val);
-       return $self->{statusCode};
-}
-
-
-#-------------------------------------------------------------------------------
-
-
-
-package OpenSRF::DomainObject::oilsStatus;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use base 'OpenSRF::DomainObject::oilsResponse';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfStatus', name => 'OpenSRF::DomainObject::oilsStatus', type => 'hash' );
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsException
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something happens.
-
-$client->status( OpenSRF::DomainObject::oilsStatus->new );
-
-=head1 ABSTRACT
-
-The base class for Status messages sent between client and server.  This
-is implemented on top of the C<OpenSRF::DomainObject::oilsResponse> class, and 
-sets the default B<status> to C<Status> and B<statusCode> to C<STATUS_OK>.
-
-=cut
-
-$status = 'Status';
-$statusCode = STATUS_OK;
-
-package OpenSRF::DomainObject::oilsConnectStatus;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use base 'OpenSRF::DomainObject::oilsStatus';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfConnectStatus', name => 'OpenSRF::DomainObject::oilsConnectStatus', type => 'hash' );
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsConnectStatus
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something happens.
-
-$client->status( new OpenSRF::DomainObject::oilsConnectStatus );
-
-=head1 ABSTRACT
-
-The class for Stati relating to the connection status of a session.  This
-is implemented on top of the C<OpenSRF::DomainObject::oilsStatus> class, and 
-sets the default B<status> to C<Connection Successful> and B<statusCode> to C<STATUS_OK>.
-
-=head1 SEE ALSO
-
-B<OpenSRF::DomainObject::oilsStatus>
-
-=cut
-
-$status = 'Connection Successful';
-$statusCode = STATUS_OK;
-
-
-
-
-package OpenSRF::DomainObject::oilsContinueStatus;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use base 'OpenSRF::DomainObject::oilsStatus';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfContinueStatus', name => 'OpenSRF::DomainObject::oilsContinueStatus', type => 'hash' );
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsContinueStatus
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something happens.
-
-$client->status( new OpenSRF::DomainObject::oilsContinueStatus );
-
-=head1 ABSTRACT
-
-Implements the STATUS_CONTINUE message, informing the client that it should
-continue to wait for a response to it's request.
-
-=head1 SEE ALSO
-
-B<OpenSRF::DomainObject::oilsStatus>
-
-=cut
-
-$status = 'Please hold.  Creating response...';
-$statusCode = STATUS_CONTINUE;
-
-1;
-
-
-
-#-------------------------------------------------------------------------------
-
-
-
-package OpenSRF::DomainObject::oilsResult;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::DomainObject::oilsPrimitive;
-use base 'OpenSRF::DomainObject::oilsResponse';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfResult', name => 'OpenSRF::DomainObject::oilsResult', type => 'hash' );
-
-
-$status = 'OK';
-$statusCode = STATUS_OK;
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsResult
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
- .... do stuff, create $object ...
-
-my $res = OpenSRF::DomainObject::oilsResult->new;
-
-$res->content($object)
-
-$session->respond( $res );
-
-=head1 ABSTRACT
-
-This is the base class for encapuslating RESULT messages send from the server
-to a client.  It is a subclass of B<OpenSRF::DomainObject::oilsResponse>, and
-sets B<status> to C<OK> and B<statusCode> to C<STATUS_OK>.
-
-=head1 METHODS
-
-=head2 OpenSRF::DomainObject::oilsMessage->content( [$new_content] )
-
-=over 4
-
-Sets or gets the content of the response.  This should be exactly one object
-of (sub)type domainObject or domainObjectCollection.
-
-=back
-
-=cut
-
-sub content {
-        my $self = shift;
-       my $val = shift;
-
-       $self->{content} = $val if (defined $val);
-       return $self->{content};
-}
-
-=head1 SEE ALSO
-
-B<OpenSRF::DomainObject::oilsResponse>
-
-=cut
-
-1;
-
-
-
-#-------------------------------------------------------------------------------
-
-
-
-package OpenSRF::DomainObject::oilsException;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX;
-use base qw/OpenSRF::EX OpenSRF::DomainObject::oilsResponse/;
-use vars qw/$status $statusCode/;
-use Error;
-JSON->register_class_hint( hint => 'osrfException', name => 'OpenSRF::DomainObject::oilsException', type => 'hash' );
-
-sub message {
-       my $self = shift;
-       return '<' . $self->statusCode . '>  ' . $self->status;
-}
-
-sub new {
-       my $class = shift;
-       return $class->OpenSRF::DomainObject::oilsResponse::new( @_ );
-}
-
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsException
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something breaks.
-
-$client->send( 'ERROR', OpenSRF::DomainObject::oilsException->new( status => "ARRRRRRG!" ) );
-
-=head1 ABSTRACT
-
-The base class for Exception messages sent between client and server.  This
-is implemented on top of the C<OpenSRF::DomainObject::oilsResponse> class, and 
-sets the default B<status> to C<Exception occured> and B<statusCode> to C<STATUS_BADREQUEST>.
-
-=cut
-
-$status = 'Exception occured';
-$statusCode = STATUS_INTERNALSERVERERROR;
-
-package OpenSRF::DomainObject::oilsConnectException;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX;
-use base qw/OpenSRF::DomainObject::oilsException OpenSRF::EX::ERROR/;
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfConnectException', name => 'OpenSRF::DomainObject::oilsConnectException', type => 'hash' );
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsConnectException
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something breaks while connecting.
-
-$client->send( 'ERROR', new OpenSRF::DomainObject::oilsConnectException );
-
-=head1 ABSTRACT
-
-The class for Exceptions that occur durring the B<CONNECT> phase of a session.  This
-is implemented on top of the C<OpenSRF::DomainObject::oilsException> class, and 
-sets the default B<status> to C<Connect Request Failed> and B<statusCode> to C<STATUS_FORBIDDEN>.
-
-=head1 SEE ALSO
-
-B<OpenSRF::DomainObject::oilsException>
-
-=cut
-
-
-$status = 'Connect Request Failed';
-$statusCode = STATUS_FORBIDDEN;
-
-package OpenSRF::DomainObject::oilsMethodException;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use base 'OpenSRF::DomainObject::oilsException';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfMethodException', name => 'OpenSRF::DomainObject::oilsMethodException', type => 'hash' );
-
-=head1 NAME
-
-OpenSRF::DomainObject::oilsMehtodException
-
-=head1 SYNOPSIS
-
-use OpenSRF::DomainObject::oilsResponse;
-
-...
-
-# something breaks while looking up or starting
-# a method call.
-
-$client->send( 'ERROR', new OpenSRF::DomainObject::oilsMethodException );
-
-=head1 ABSTRACT
-
-The class for Exceptions that occur durring the B<CONNECT> phase of a session.  This
-is implemented on top of the C<OpenSRF::DomainObject::oilsException> class, and 
-sets the default B<status> to C<Connect Request Failed> and B<statusCode> to C<STATUS_NOTFOUND>.
-
-=head1 SEE ALSO
-
-B<OpenSRF::DomainObject::oilsException>
-
-=cut
-
-
-$status = 'A server error occured during method execution';
-$statusCode = STATUS_INTERNALSERVERERROR;
-
-# -------------------------------------------
-
-package OpenSRF::DomainObject::oilsServerError;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use base 'OpenSRF::DomainObject::oilsException';
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfServerError', name => 'OpenSRF::DomainObject::oilsServerError', type => 'hash' );
-
-$status = 'Internal Server Error';
-$statusCode = STATUS_INTERNALSERVERERROR;
-
-# -------------------------------------------
-
-
-
-
-
-package OpenSRF::DomainObject::oilsBrokenSession;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX;
-use base qw/OpenSRF::DomainObject::oilsException OpenSRF::EX::ERROR/;
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfBrokenSession', name => 'OpenSRF::DomainObject::oilsBrokenSession', type => 'hash' );
-$status = "Request on Disconnected Session";
-$statusCode = STATUS_EXPFAILED;
-
-package OpenSRF::DomainObject::oilsXMLParseError;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX;
-use base qw/OpenSRF::DomainObject::oilsException OpenSRF::EX::ERROR/;
-use vars qw/$status $statusCode/;
-JSON->register_class_hint( hint => 'osrfXMLParseError', name => 'OpenSRF::DomainObject::oilsXMLParseError', type => 'hash' );
-$status = "XML Parse Error";
-$statusCode = STATUS_EXPFAILED;
-
-package OpenSRF::DomainObject::oilsAuthException;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX;
-use base qw/OpenSRF::DomainObject::oilsException OpenSRF::EX::ERROR/;
-JSON->register_class_hint( hint => 'osrfAuthException', name => 'OpenSRF::DomainObject::oilsAuthException', type => 'hash' );
-use vars qw/$status $statusCode/;
-$status = "Authentication Failure";
-$statusCode = STATUS_FORBIDDEN;
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsSearch.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsSearch.pm
deleted file mode 100644 (file)
index b2e23e4..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-package OpenSRF::DomainObject::oilsSearch;
-use OpenSRF::DomainObject;
-use OpenSRF::DomainObject::oilsPrimitive;
-use OpenSRF::DOM::Element::searchCriteria;
-use base 'OpenSRF::DomainObject';
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       unshift @_, 'table' if (@_ == 1);
-       my %args = @_;
-
-       my $self = $class->SUPER::new;
-       
-       for my $part ( keys %args ) {
-               if ($part ne 'criteria') {
-                       $self->$part( $args{$part} );
-                       next;
-               }
-               $self->criteria( OpenSRF::DOM::Element::searchCriteria->new( @{$args{$part}} ) );
-       }
-       return $self;
-}
-
-sub format {
-       my $self = shift;
-       return $self->_attr_get_set( format => shift );
-}
-
-sub table {
-       my $self = shift;
-       return $self->_attr_get_set( table => shift );
-}
-
-sub fields {
-       my $self = shift;
-       my $new_fields_ref = shift;
-
-       my ($old_fields) = $self->getChildrenByTagName("oils:domainObjectCollection");
-       
-       if ($new_fields_ref) {
-               my $do = OpenSRF::DomainObjectCollection::oilsArray->new( @$new_fields_ref );
-               if (defined $old_fields) {
-                       $old_fields->replaceNode($do);
-               } else {
-                       $self->appendChild($do);
-                       return $do->list;
-               }
-       }
-
-       return $old_fields->list if ($old_fields);
-}
-
-sub limit {
-       my $self = shift;
-       return $self->_attr_get_set( limit => shift );
-}
-
-sub offset {
-       my $self = shift;
-       return $self->_attr_get_set( offset => shift );
-}
-
-sub group_by {
-       my $self = shift;
-       return $self->_attr_get_set( group_by => shift );
-}
-
-sub criteria {
-       my $self = shift;
-       my $new_crit = shift;
-
-       if (@_) {
-               unshift @_, $new_crit;
-               $new_crit = OpenSRF::DOM::Element::searchCriteria->new(@_);
-       }
-
-       my ($old_crit) = $self->getChildrenByTagName("oils:searchCriteria");
-       
-       if (defined $new_crit) {
-               if (defined $old_crit) {
-                       $old_crit->replaceNode($new_crit);
-               } else {
-                       $self->appendChild($new_crit);
-                       return $new_crit;
-               }
-       }
-
-       return $old_crit;
-}
-
-sub toSQL {
-       my $self = shift;
-
-       my $SQL  = 'SELECT    ' . join(',', $self->fields);
-          $SQL .= '  FROM    ' . $self->table;
-          $SQL .= '  WHERE   ' . $self->criteria->toSQL if ($self->criteria);
-          $SQL .= ' GROUP BY ' . $self->group_by if ($self->group_by);
-          $SQL .= '  LIMIT   ' . $self->limit if ($self->limit);
-          $SQL .= '  OFFSET  ' . $self->offset if ($self->offset);
-       
-       return $SQL;
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObjectCollection.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObjectCollection.pm
deleted file mode 100644 (file)
index 7049af7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package OpenSRF::DomainObjectCollection;
-use base 'OpenSRF::DOM::Element::domainObjectCollection';
-use OpenSRF::DOM;
-use OpenSRF::Utils::Logger qw(:level);
-my $logger = "OpenSRF::Utils::Logger";
-
-=head1 NAME
-
-OpenSRF::DomainObjectCollection
-
-=head1 SYNOPSIS
-
-OpenSRF::DomainObjectCollection is an abstract base class.  It
-should not be used directly.  See C<OpenSRF::DomainObjectCollection::*>
-for details.
-
-=cut
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my @args = shift;
-
-       (my $type = $class) =~ s/^.+://o;
-
-       my $doc = OpenSRF::DOM->createDocument;
-       my $dO = OpenSRF::DOM::Element::domainObjectCollection->new( $type, @args );
-
-       $doc->documentElement->appendChild($dO);
-
-       return $dO;
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/EX.pm b/OpenSRF/src/perlmods/OpenSRF/EX.pm
deleted file mode 100644 (file)
index 7b2cfb0..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-package OpenSRF::EX;
-use Error qw(:try);
-use base qw( OpenSRF Error );
-use OpenSRF::Utils::Logger;
-
-my $log = "OpenSRF::Utils::Logger";
-$Error::Debug = 1;
-
-sub new {
-       my( $class, $message ) = @_;
-       $class = ref( $class ) || $class;
-       my $self = {};
-       $self->{'msg'} = ${$class . '::ex_msg_header'} ." \n$message";
-       return bless( $self, $class );
-}      
-
-sub message() { return $_[0]->{'msg'}; }
-
-sub DESTROY{}
-
-
-=head1 OpenSRF::EX
-
-Top level exception.  This class logs an exception when it is thrown.  Exception subclasses
-should subclass one of OpenSRF::EX::INFO, NOTICE, WARN, ERROR, CRITICAL, and PANIC and provide
-a new() method that takes a message and a message() method that returns that message.
-
-=cut
-
-=head2 Synopsis
-
-
-       throw OpenSRF::EX::Jabber ("I Am Dying");
-
-       OpenSRF::EX::InvalidArg->throw( "Another way" );
-
-       my $je = OpenSRF::EX::Jabber->new( "I Cannot Connect" );
-       $je->throw();
-
-
-       See OpenSRF/EX.pm for example subclasses.
-
-=cut
-
-# Log myself and throw myself
-
-#sub message() { shift->alert_abstract(); }
-
-#sub new() { shift->alert_abstract(); }
-
-sub throw() {
-
-       my $self = shift;
-
-       if( ! ref( $self ) || scalar( @_ ) ) {
-               $self = $self->new( @_ );
-       }
-
-       if(             $self->class->isa( "OpenSRF::EX::INFO" )        ||
-                               $self->class->isa( "OpenSRF::EX::NOTICE" ) ||
-                               $self->class->isa( "OpenSRF::EX::WARN" ) ) {
-
-               $log->debug( $self->stringify(), $log->DEBUG );
-       }
-
-       else{ $log->debug( $self->stringify(), $log->ERROR ); }
-       
-       $self->SUPER::throw;
-}
-
-
-sub stringify() {
-
-       my $self = shift;
-       my $ctime = localtime();
-       my( $package, $file, $line) = get_caller();
-       my $name = ref( $self );
-       my $msg = $self->message();
-
-       $msg =~ s/^/Mess: /mg;
-
-       return "  * ! EXCEPTION ! * \nTYPE: $name\n$msg\n".
-               "Loc.: $line $package \nLoc.: $file \nTime: $ctime\n";
-}
-
-
-# --- determine the originating caller of this exception
-sub get_caller() {
-
-       $package = caller();
-       my $x = 0;
-       while( $package->isa( "Error" ) || $package =~ /^Error::/ ) { 
-               $package = caller( ++$x );
-       }
-       return (caller($x));
-}
-
-
-
-
-# -------------------------------------------------------------------
-# -------------------------------------------------------------------
-
-# Top level exception subclasses defining the different exception
-# levels.
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::INFO;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System INFO";
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::NOTICE;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System NOTICE";
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::WARN;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System WARNING";
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::ERROR;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System ERROR";
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::CRITICAL;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System CRITICAL";
-
-# -------------------------------------------------------------------
-
-package OpenSRF::EX::PANIC;
-use base qw(OpenSRF::EX);
-our $ex_msg_header = "System PANIC";
-
-# -------------------------------------------------------------------
-# -------------------------------------------------------------------
-
-# Some basic exceptions
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::Jabber;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Jabber Exception";
-
-package OpenSRF::EX::JabberDisconnected;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "JabberDisconnected Exception";
-
-=head2 OpenSRF::EX::Jabber
-
-Thrown when there is a problem using the Jabber service
-
-=cut
-
-package OpenSRF::EX::Transport;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Transport Exception";
-
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::InvalidArg;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Invalid Arg Exception";
-
-=head2 OpenSRF::EX::InvalidArg
-
-Thrown where an argument to a method was invalid or not provided
-
-=cut
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::NotADomainObject;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Must be a Domain Object";
-
-=head2 OpenSRF::EX::NotADomainObject
-
-Thrown where a OpenSRF::DomainObject::oilsScalar or
-OpenSRF::DomainObject::oilsPair was passed a value that
-is not a perl scalar or a OpenSRF::DomainObject.
-
-=cut
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::ArrayOutOfBounds;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Tied array access on a nonexistant index";
-
-=head2 OpenSRF::EX::ArrayOutOfBounds
-
-Thrown where a TIEd array (OpenSRF::DomainObject::oilsArray) was accessed at
-a nonexistant index
-
-=cut
-
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::Socket;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Socket Exception";
-
-=head2 OpenSRF::EX::Socket
-
-Thrown when there is a network layer exception
-
-=cut
-
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::Config;
-use base 'OpenSRF::EX::PANIC';
-our $ex_msg_header = "Config Exception";
-
-=head2 OpenSRF::EX::Config
-
-Thrown when a package requires a config option that it cannot retrieve
-or the config file itself cannot be loaded
-
-=cut
-
-
-# -------------------------------------------------------------------
-package OpenSRF::EX::User;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "User Exception";
-
-=head2 OpenSRF::EX::User
-
-Thrown when an error occurs due to user identification information
-
-=cut
-
-package OpenSRF::EX::Session;
-use base 'OpenSRF::EX::ERROR';
-our $ex_msg_header = "Session Error";
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/MultiSession.pm b/OpenSRF/src/perlmods/OpenSRF/MultiSession.pm
deleted file mode 100644 (file)
index dd0579c..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-package OpenSRF::MultiSession;
-use OpenSRF::AppSession;
-use OpenSRF::Utils::Logger;
-use Time::HiRes qw/time usleep/;
-
-my $log = 'OpenSRF::Utils::Logger';
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $self = bless {@_} => $class;
-
-       $self->{api_level} = 1 if (!defined($self->{api_level}));
-       $self->{session_hash_function} = \&_dummy_session_hash_function
-               if (!defined($self->{session_hash_function}));
-
-       if ($self->{cap}) {
-               $self->session_cap($self->{cap}) if (!$self->session_cap);
-               $self->request_cap($self->{cap}) if (!$self->request_cap);
-       }
-
-       if (!$self->session_cap) {
-               # XXX make adaptive the default once the logic is in place
-               #$self->adaptive(1);
-
-               $self->session_cap(10);
-       }
-       if (!$self->request_cap) {
-               # XXX make adaptive the default once the logic is in place
-               #$self->adaptive(1);
-
-               $self->request_cap(10);
-       }
-
-       $self->{sessions} = [];
-       $self->{running} = [];
-       $self->{completed} = [];
-       $self->{failed} = [];
-
-       for ( 1 .. $self->session_cap) {
-               push @{ $self->{sessions} },
-                       OpenSRF::AppSession->create(
-                               $self->{app},
-                               $self->{api_level},
-                               1
-                       );
-               #print "Creating connection ".$self->{sessions}->[-1]->session_id." ...\n";
-               $log->debug("Creating connection ".$self->{sessions}->[-1]->session_id." ...");
-       }
-
-       return $self;
-}
-
-sub _dummy_session_hash_function {
-       my $self = shift;
-       $self->{_dummy_hash_counter} = 1 if (!exists($self->{_dummy_hash_counter}));
-       return $self->{_dummy_hash_counter}++;
-}
-
-sub connect {
-       my $self = shift;
-       for my $ses (@{$self->{sessions}}) {
-               $ses->connect unless ($ses->connected);
-       }
-}
-
-sub finish {
-       my $self = shift;
-       $_->finish for (@{$self->{sessions}});
-}
-
-sub disconnect {
-       my $self = shift;
-       $_->disconnect for (@{$self->{sessions}});
-}
-
-sub session_hash_function {
-       my $self = shift;
-       my $session_hash_function = shift;
-       return unless (ref $self);
-
-       $self->{session_hash_function} = $session_hash_function if (defined $session_hash_function);
-       return $self->{session_hash_function};
-}
-
-sub failure_handler {
-       my $self = shift;
-       my $failure_handler = shift;
-       return unless (ref $self);
-
-       $self->{failure_handler} = $failure_handler if (defined $failure_handler);
-       return $self->{failure_handler};
-}
-
-sub success_handler {
-       my $self = shift;
-       my $success_handler = shift;
-       return unless (ref $self);
-
-       $self->{success_handler} = $success_handler if (defined $success_handler);
-       return $self->{success_handler};
-}
-
-sub session_cap {
-       my $self = shift;
-       my $cap = shift;
-       return unless (ref $self);
-
-       $self->{session_cap} = $cap if (defined $cap);
-       return $self->{session_cap};
-}
-
-sub request_cap {
-       my $self = shift;
-       my $cap = shift;
-       return unless (ref $self);
-
-       $self->{request_cap} = $cap if (defined $cap);
-       return $self->{request_cap};
-}
-
-sub adaptive {
-       my $self = shift;
-       my $adapt = shift;
-       return unless (ref $self);
-
-       $self->{adaptive} = $adapt if (defined $adapt);
-       return $self->{adaptive};
-}
-
-sub completed {
-       my $self = shift;
-       my $count = shift;
-       return unless (ref $self);
-
-
-       if (wantarray) {
-               $count ||= scalar @{$self->{completed}}; 
-       }
-
-       if (defined $count) {
-               return () unless (@{$self->{completed}});
-               return splice @{$self->{completed}}, 0, $count;
-       }
-
-       return scalar @{$self->{completed}};
-}
-
-sub failed {
-       my $self = shift;
-       my $count = shift;
-       return unless (ref $self);
-
-
-       if (wantarray) {
-               $count ||= scalar @{$self->{failed}}; 
-       }
-
-       if (defined $count) {
-               return () unless (@{$self->{failed}});
-               return splice @{$self->{failed}}, 0, $count;
-       }
-
-       return scalar @{$self->{failed}};
-}
-
-sub running {
-       my $self = shift;
-       return unless (ref $self);
-       return scalar(@{ $self->{running} });
-}
-
-
-sub request {
-       my $self = shift;
-       my $hash_param;
-
-       my $method = shift;
-       if (ref $method) {
-               $hash_param = $method;
-               $method = shift;
-       }
-
-       my @params = @_;
-
-       $self->session_reap;
-       if ($self->running < $self->request_cap ) {
-               my $index = $self->session_hash_function->($self, (defined $hash_param ? $hash_param : ()), $method, @params);
-               my $ses = $self->{sessions}->[$index % $self->session_cap]; 
-
-               #print "Running $method using session ".$ses->session_id."\n";
-
-               my $req = $ses->request( $method, @params );
-
-               push @{ $self->{running} },
-                       { req => $req,
-                         meth => $method,
-                         hash => $hash_param,
-                         params => [@params]
-                       };
-
-               $log->debug("Making request [$method] ".$self->running."...");
-
-               return $req;
-       } elsif (!$self->adaptive) {
-               #print "Oops.  Too many running: ".$self->running."\n";
-               $self->session_wait;
-               return $self->request((defined $hash_param ? $hash_param : ()), $method => @params);
-       } else {
-               # XXX do addaptive stuff ...
-       }
-}
-
-sub session_wait {
-       my $self = shift;
-       my $all = shift;
-
-       my $count;
-       if ($all) {
-               $count = $self->running;
-               while ($self->running) {
-                       $self->session_reap;
-               }
-               return $count;
-       } else {
-               while(($count = $self->session_reap) == 0 && $self->running) {
-                       usleep 100;
-               }
-               return $count;
-       }
-}
-
-sub session_reap {
-       my $self = shift;
-
-       my @done;
-       my @running;
-       while ( my $req = shift @{ $self->{running} } ) {
-               if ($req->{req}->complete) {
-                       #print "Currently running: ".$self->running."\n";
-
-                       $req->{response} = [ $req->{req}->recv ];
-                       $req->{duration} = $req->{req}->duration;
-
-                       #print "Completed ".$req->{meth}." in session ".$req->{req}->session->session_id." [$req->{duration}]\n";
-
-                       if ($req->{req}->failed) {
-                               #print "ARG!!!! Failed command $req->{meth} in session ".$req->{req}->session->session_id."\n";
-                               $req->{error} = $req->{req}->failed;
-                               push @{ $self->{failed} }, $req;
-                       } else {
-                               push @{ $self->{completed} }, $req;
-                       }
-
-                       push @done, $req;
-
-               } else {
-                       #$log->debug("Still running ".$req->{meth}." in session ".$req->{req}->session->session_id);
-                       push @running, $req;
-               }
-       }
-       push @{ $self->{running} }, @running;
-
-       for my $req ( @done ) {
-               my $handler = $req->{error} ? $self->failure_handler : $self->success_handler;
-               $handler->($self, $req) if ($handler);
-
-               $req->{req}->finish;
-               delete $$req{$_} for (keys %$req);
-
-       }
-
-       my $complete = scalar @done;
-       my $incomplete = scalar @running;
-
-       #$log->debug("Still running $incomplete, completed $complete");
-
-       return $complete;
-}
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/System.pm b/OpenSRF/src/perlmods/OpenSRF/System.pm
deleted file mode 100644 (file)
index cf3e840..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-package OpenSRF::System;
-use strict; use warnings;
-use OpenSRF;
-use base 'OpenSRF';
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::Transport::Listener;
-use OpenSRF::Transport;
-use OpenSRF::UnixServer;
-use OpenSRF::Utils;
-use OpenSRF::Utils::LogServer;
-use OpenSRF::DOM;
-use OpenSRF::EX qw/:try/;
-use POSIX ":sys_wait_h";
-use OpenSRF::Utils::Config; 
-use OpenSRF::Utils::SettingsParser;
-use OpenSRF::Utils::SettingsClient;
-use OpenSRF::Application;
-use Net::Server::PreFork;
-use strict;
-
-my $bootstrap_config_file;
-sub import {
-       my( $self, $config ) = @_;
-       $bootstrap_config_file = $config;
-}
-
-=head2 Name/Description
-
-OpenSRF::System
-
-To start the system: OpenSRF::System->bootstrap();
-
-Simple system process management and automation.  After instantiating the class, simply call
-bootstrap() to launch the system.  Each launched process is stored as a process-id/method-name
-pair in a local hash.  When we receive a SIG{CHILD}, we loop through this hash and relaunch
-any child processes that may have terminated.  
-
-Currently automated processes include launching the internal Unix Servers, launching the inbound 
-connections for each application, and starting the system shell.
-
-
-Note: There should be only one instance of this class
-alive at any given time.  It is designed as a globel process handler and, hence, will cause much
-oddness if you call the bootstrap() method twice or attempt to create two of these by trickery.
-There is a single instance of the class created on the first call to new().  This same instance is 
-returned on subsequent calls to new().
-
-=cut
-
-$| = 1;
-
-sub DESTROY {}
-
-# ----------------------------------------------
-
-$SIG{INT} = sub { instance()->killall(); };
-
-$SIG{HUP} = sub{ instance()->hupall(); };
-
-#$SIG{CHLD} = \&process_automation;
-
-
-{ 
-       # --- 
-       # put $instance in a closure and return it for requests to new()
-       # since there should only be one System instance running
-       # ----- 
-       my $instance;
-       sub instance { return __PACKAGE__->new(); }
-       sub new {
-               my( $class ) = @_;
-
-               if( ! $instance ) {
-                       $class = ref( $class ) || $class;
-                       my $self = {};
-                       $self->{'pid_hash'} = {};
-                       bless( $self, $class );
-                       $instance = $self;
-               }
-               return $instance;
-       }
-}
-
-# ----------------------------------------------
-# Commands to execute at system launch
-
-sub _unixserver {
-       my( $app ) = @_;
-       return "OpenSRF::UnixServer->new( '$app')->serve()";
-}
-
-sub _listener {
-       my( $app ) = @_;
-       return "OpenSRF::Transport::Listener->new( '$app' )->initialize()->listen()";
-}
-
-
-# ----------------------------------------------
-# Boot up the system
-
-sub load_bootstrap_config {
-
-       if(OpenSRF::Utils::Config->current) {
-               return;
-       }
-
-       if(!$bootstrap_config_file) {
-               die "Please provide a bootstrap config file to OpenSRF::System!\n" . 
-                       "use OpenSRF::System qw(/path/to/bootstrap_config);";
-       }
-
-       OpenSRF::Utils::Config->load( config_file => $bootstrap_config_file );
-
-       JSON->register_class_hint( name => "OpenSRF::Application", hint => "method", type => "hash" );
-
-       OpenSRF::Transport->message_envelope(  "OpenSRF::Transport::SlimJabber::MessageWrapper" );
-       OpenSRF::Transport::PeerHandle->set_peer_client(  "OpenSRF::Transport::SlimJabber::PeerConnection" );
-       OpenSRF::Transport::Listener->set_listener( "OpenSRF::Transport::SlimJabber::Inbound" );
-       OpenSRF::Application->server_class('client');
-}
-
-sub bootstrap {
-
-       my $self = __PACKAGE__->instance();
-       load_bootstrap_config();
-       OpenSRF::Utils::Logger::set_config();
-       my $bsconfig = OpenSRF::Utils::Config->current;
-
-       # Start a process group and make me the captain
-       setpgrp( 0, 0 ); 
-       $0 = "OpenSRF System";
-
-       # -----------------------------------------------
-       # Launch the settings sever if necessary...
-       my $are_settings_server = 0;
-       if( (my $cfile = $bsconfig->bootstrap->settings_config) ) {
-               my $parser = OpenSRF::Utils::SettingsParser->new();
-
-               # since we're (probably) the settings server, we can go ahead and load the real config file
-               $parser->initialize( $cfile );
-               $OpenSRF::Utils::SettingsClient::host_config = 
-                       $parser->get_server_config($bsconfig->env->hostname);
-
-               my $client = OpenSRF::Utils::SettingsClient->new();
-               my $apps = $client->config_value("activeapps", "appname");
-               if(ref($apps) ne "ARRAY") { $apps = [$apps]; }
-
-               if(!defined($apps) || @$apps == 0) {
-                       print "No apps to load, exiting...";
-                       return;
-               }
-
-               for my $app (@$apps) {
-                       # verify we are a settings server and launch 
-                       if( $app eq "opensrf.settings" and 
-                               $client->config_value("apps","opensrf.settings", "language") =~ /perl/i ) {
-
-                               $are_settings_server = 1;
-                               $self->launch_settings();
-                               sleep 1;
-                               $self->launch_settings_listener();
-                               last;
-                       } 
-               }
-       }
-
-       # Launch everything else
-       OpenSRF::System->bootstrap_client(client_name => "system_client");
-       my $client = OpenSRF::Utils::SettingsClient->new();
-       my $apps = $client->config_value("activeapps", "appname" );
-       if(!ref($apps)) { $apps = [$apps]; }
-
-       if(!defined($apps) || @$apps == 0) {
-               print "No apps to load, exiting...";
-               return;
-       }
-
-       my $server_type = $client->config_value("server_type");
-       $server_type ||= "basic";
-
-       my $con = OpenSRF::Transport::PeerHandle->retrieve;
-       if($con) {
-               $con->disconnect;
-       }
-
-
-
-       if(  $server_type eq "prefork" ) { 
-               $server_type = "Net::Server::PreFork"; 
-       } else { 
-               $server_type = "Net::Server::Single"; 
-       }
-
-       _log( " * Server type: $server_type", INTERNAL );
-
-       $server_type->use;
-
-       if( $@ ) {
-               throw OpenSRF::EX::PANIC ("Cannot set $server_type: $@" );
-       }
-
-       push @OpenSRF::UnixServer::ISA, $server_type;
-
-       _log( " * System bootstrap" );
-       
-       # --- Boot the Unix servers
-       $self->launch_unix($apps);
-
-       sleep 2;
-
-       # --- Boot the listeners
-       $self->launch_listener($apps);
-
-    sleep 1;
-
-       _log( " * System is ready..." );
-
-#      sleep 1;
-#      my $ps = `ps ax | grep " Open" | grep -v grep | sort -r -k5`;
-#      print "\n --- PS --- \n$ps --- PS ---\n\n";
-
-       while( 1 ) { sleep; }
-       exit;
-}
-       
-       
-
-# ----------------------------------------------
-# Bootstraps a single client connection.  
-
-# named params are 'config_file' and 'client_name'
-#
-sub bootstrap_client {
-       my $self = shift;
-
-       my $con = OpenSRF::Transport::PeerHandle->retrieve;
-
-       if($con and $con->tcp_connected) {
-               return;
-       }
-
-       my %params = @_;
-
-       $bootstrap_config_file = 
-               $params{config_file} || $bootstrap_config_file;
-
-       my $app = $params{client_name} || "client";
-
-
-       load_bootstrap_config();
-       OpenSRF::Utils::Logger::set_config();
-       OpenSRF::Transport::PeerHandle->construct( $app );
-
-}
-
-sub connected {
-       if (my $con = OpenSRF::Transport::PeerHandle->retrieve) {
-               return 1 if ($con->tcp_connected);
-       }
-       return 0;
-}
-
-sub bootstrap_logger {
-       $0 = "Log Server";
-       OpenSRF::Utils::LogServer->serve();
-}
-
-
-# ----------------------------------------------
-# Cycle through the known processes, reap the dead child 
-# and put a new child in its place. (MMWWAHAHHAHAAAA!)
-
-sub process_automation {
-
-       my $self = __PACKAGE__->instance();
-
-       foreach my $pid ( keys %{$self->pid_hash} ) {
-
-               if( waitpid( $pid, WNOHANG ) == $pid ) {
-
-                       my $method = $self->pid_hash->{$pid};
-                       delete $self->pid_hash->{$pid};
-
-                       my $newpid =  OpenSRF::Utils::safe_fork();
-
-                       OpenSRF::Utils::Logger->debug( "Relaunching $method", ERROR );
-                       _log( "Relaunching => $method" );
-
-                       if( $newpid ) {
-                               $self->pid_hash( $newpid, $method );
-                       }
-                       else { eval $method; exit; }
-               }
-       }
-
-       $SIG{CHLD} = \&process_automation;
-}
-
-
-
-sub launch_settings {
-
-       #       XXX the $self like this and pid automation will not work with this setup....
-       my($self) = @_;
-       @OpenSRF::UnixServer::ISA = qw(OpenSRF Net::Server::PreFork);
-
-       my $pid = OpenSRF::Utils::safe_fork();
-       if( $pid ) {
-               $self->pid_hash( $pid , "launch_settings()" );
-       }
-       else {
-               my $apname = "opensrf.settings";
-               #$0 = "OpenSRF App [$apname]";
-               eval _unixserver( $apname );
-               if($@) { die "$@\n"; }
-               exit;
-       }
-
-       @OpenSRF::UnixServer::ISA = qw(OpenSRF);
-
-}
-
-
-sub launch_settings_listener {
-
-       my $self = shift;
-       my $app = "opensrf.settings";
-       my $pid = OpenSRF::Utils::safe_fork();
-       if ( $pid ) {
-               $self->pid_hash( $pid , _listener( $app ) );
-       }
-       else {
-               my $apname = $app;
-               $0 = "OpenSRF listener [$apname]";
-               eval _listener( $app );
-               exit;
-       }
-
-}
-
-# ----------------------------------------------
-# Launch the Unix Servers
-
-sub launch_unix {
-       my( $self, $apps ) = @_;
-
-       my $client = OpenSRF::Utils::SettingsClient->new();
-
-       foreach my $app ( @$apps ) {
-
-               next unless $app;
-               my $lang = $client->config_value( "apps", $app, "language");
-               next unless $lang =~ /perl/i;
-               next if $app eq "opensrf.settings";
-
-               _log( " * Starting UnixServer for $app..." );
-
-               my $pid = OpenSRF::Utils::safe_fork();
-               if( $pid ) {
-                       $self->pid_hash( $pid , _unixserver( $app ) );
-               }
-               else {
-                       my $apname = $app;
-                       $0 = "OpenSRF App ($apname)";
-                       eval _unixserver( $app );
-                       exit;
-               }
-       }
-}
-
-# ----------------------------------------------
-# Launch the inbound clients
-
-sub launch_listener {
-
-       my( $self, $apps ) = @_;
-       my $client = OpenSRF::Utils::SettingsClient->new();
-
-       foreach my $app ( @$apps ) {
-
-               next unless $app;
-               my $lang = $client->config_value( "apps", $app, "language");
-               next unless $lang =~ /perl/i;
-               next if $app eq "opensrf.settings";
-
-               _log( " * Starting Listener for $app..." );
-
-               my $pid = OpenSRF::Utils::safe_fork();
-               if ( $pid ) {
-                       $self->pid_hash( $pid , _listener( $app ) );
-               }
-               else {
-                       my $apname = $app;
-                       $0 = "OpenSRF listener [$apname]";
-                       eval _listener( $app );
-                       exit;
-               }
-       }
-}
-
-
-# ----------------------------------------------
-
-sub pid_hash {
-       my( $self, $pid, $method ) = @_;
-       $self->{'pid_hash'}->{$pid} = $method
-               if( $pid and $method );
-       return $self->{'pid_hash'};
-}
-
-# ----------------------------------------------
-# If requested, the System can shut down.
-
-sub killall {
-
-       $SIG{CHLD} = 'IGNORE';
-       $SIG{INT} = 'IGNORE';
-       kill( 'INT', -$$ ); #kill all in process group
-       exit;
-
-}
-
-# ----------------------------------------------
-# Handle $SIG{HUP}
-sub hupall {
-
-       _log( "HUPping brood" );
-       $SIG{CHLD} = 'IGNORE';
-       $SIG{HUP} = 'IGNORE';
-       kill( 'HUP', -$$ );
-#      $SIG{CHLD} = \&process_automation;
-       $SIG{HUP} = sub{ instance()->hupall(); };
-}
-
-
-# ----------------------------------------------
-# Log to debug, and stdout
-
-sub _log {
-       my $string = shift;
-       OpenSRF::Utils::Logger->debug( $string, INFO );
-       print $string . "\n";
-}
-
-# ----------------------------------------------
-
-
-1;
-
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport.pm b/OpenSRF/src/perlmods/OpenSRF/Transport.pm
deleted file mode 100644 (file)
index 4ee322c..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-package OpenSRF::Transport;
-use strict; use warnings;
-use base 'OpenSRF';
-use Time::HiRes qw/time/;
-use OpenSRF::AppSession;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::EX qw/:try/;
-use OpenSRF::Transport::SlimJabber::MessageWrapper;
-
-#------------------ 
-# --- These must be implemented by all Transport subclasses
-# -------------------------------------------
-
-=head2 get_listener
-
-Returns the package name of the package the system will use to 
-gather incoming requests
-
-=cut
-
-sub get_listener { shift()->alert_abstract(); }
-
-=head2 get_peer_client
-
-Returns the name of the package responsible for client communication
-
-=cut
-
-sub get_peer_client { shift()->alert_abstract(); } 
-
-=head2 get_msg_envelope
-
-Returns the name of the package responsible for parsing incoming messages
-
-=cut
-
-sub get_msg_envelope { shift()->alert_abstract(); } 
-
-# -------------------------------------------
-
-our $message_envelope;
-my $logger = "OpenSRF::Utils::Logger"; 
-
-
-
-=head2 message_envelope( [$envelope] );
-
-Sets the message envelope class that will allow us to extract
-information from the messages we receive from the low 
-level transport
-
-=cut
-
-sub message_envelope {
-       my( $class, $envelope ) = @_;
-       if( $envelope ) {
-               $message_envelope = $envelope;
-               $envelope->use;
-               if( $@ ) {
-                       $logger->error( 
-                                       "Error loading message_envelope: $envelope -> $@", ERROR);
-               }
-       }
-       return $message_envelope;
-}
-
-=head2 handler( $data )
-
-Creates a new MessageWrapper, extracts the remote_id, session_id, and message body
-from the message.  Then, creates or retrieves the AppSession object with the session_id and remote_id. 
-Finally, creates the message document from the body of the message and calls
-the handler method on the message document.
-
-=cut
-
-sub handler {
-       my $start_time = time();
-       my( $class, $service, $data ) = @_;
-
-       $logger->transport( "Transport handler() received $data", INTERNAL );
-
-       # pass data to the message envelope 
-       my $helper = OpenSRF::Transport::SlimJabber::MessageWrapper->new( $data );
-
-       # Extract message information
-       my $remote_id   = $helper->get_remote_id();
-       my $sess_id     = $helper->get_sess_id();
-       my $body        = $helper->get_body();
-       my $type        = $helper->get_msg_type();
-
-   $logger->set_osrf_xid($helper->get_osrf_xid);
-
-       if (defined($type) and $type eq 'error') {
-               throw OpenSRF::EX::Session ("$remote_id IS NOT CONNECTED TO THE NETWORK!!!");
-
-       }
-
-       # See if the app_session already exists.  If so, make 
-       # sure the sender hasn't changed if we're a server
-       my $app_session = OpenSRF::AppSession->find( $sess_id );
-       if( $app_session and $app_session->endpoint == $app_session->SERVER() and
-                       $app_session->remote_id ne $remote_id ) {
-               $logger->transport( "Backend Gone or invalid sender", INTERNAL );
-               my $res = OpenSRF::DomainObject::oilsBrokenSession->new();
-               $res->status( "Backend Gone or invalid sender, Reconnect" );
-               $app_session->status( $res );
-               return 1;
-       } 
-
-       # Retrieve or build the app_session as appropriate (server_build decides which to do)
-       $logger->transport( "AppSession is valid or does not exist yet", INTERNAL );
-       $app_session = OpenSRF::AppSession->server_build( $sess_id, $remote_id, $service );
-
-       if( ! $app_session ) {
-               throw OpenSRF::EX::Session ("Transport::handler(): No AppSession object returned from server_build()");
-       }
-
-       # Create a document from the JSON contained within the message 
-       my $doc; 
-       eval { $doc = JSON->JSON2perl($body); };
-       if( $@ ) {
-
-               $logger->transport( "Received bogus JSON: $@", INFO );
-               $logger->transport( "Bogus JSON data: \n $body \n", INTERNAL );
-               my $res = OpenSRF::DomainObject::oilsXMLParseError->new( status => "JSON Parse Error --- $body\n\n$@" );
-
-               $app_session->status($res);
-               #$app_session->kill_me;
-               return 1;
-       }
-
-       $logger->transport( "Transport::handler() creating \n$body", INTERNAL );
-
-       # We need to disconnect the session if we got a jabber error on the client side.  For
-       # server side, we'll just tear down the session and go away.
-       if (defined($type) and $type eq 'error') {
-               # If we're a server
-               if( $app_session->endpoint == $app_session->SERVER() ) {
-                       $app_session->kill_me;
-                       return 1;
-               } else {
-                       $app_session->reset;
-                       $app_session->state( $app_session->DISCONNECTED );
-                       # below will lead to infinite looping, should return an exception
-                       #$app_session->push_resend( $app_session->app_request( 
-                       #               $doc->documentElement->firstChild->threadTrace ) );
-                       $logger->debug(
-                               "Got Jabber error on client connection $remote_id, nothing we can do..", ERROR );
-                       return 1;
-               }
-       }
-
-
-       # cycle through and pass each oilsMessage contained in the message
-       # up to the message layer for processing.
-       for my $msg (@$doc) {
-
-               next unless (   $msg && UNIVERSAL::isa($msg => 'OpenSRF::DomainObject::oilsMessage'));
-
-               if( $app_session->endpoint == $app_session->SERVER() ) {
-
-                       try {  
-
-                               if( ! $msg->handler( $app_session ) ) { return 0; }
-
-                               $logger->debug("Successfully handled message", DEBUG);
-
-                       } catch Error with {
-
-                               my $e = shift;
-                               my $res = OpenSRF::DomainObject::oilsServerError->new();
-                               $res->status( $res->status . "\n$e");
-                               $app_session->status($res) if $res;
-                               $app_session->kill_me;
-                               return 0;
-
-                       };
-
-               } else { 
-
-                       if( ! $msg->handler( $app_session ) ) { return 0; } 
-                       $logger->info("Successfully handled message", DEBUG);
-
-               }
-
-       }
-
-       $logger->debug(sprintf("Message processing duration: %.3fs",(time() - $start_time)), DEBUG);
-
-       return $app_session;
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber.pm
deleted file mode 100644 (file)
index 3b45ac5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package OpenSRF::Transport::Jabber;
-use base qw/OpenSRF::Transport/;
-
-
-sub get_listener { return "OpenSRF::Transport::Jabber::JInbound"; }
-
-sub get_peer_client { return "OpenSRF::Transport::Jabber::JPeerConnection"; }
-
-sub get_msg_envelope { return "OpenSRF::Transport::Jabber::JMessageWrapper"; }
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JInbound.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JInbound.pm
deleted file mode 100644 (file)
index a381274..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-package OpenSRF::Transport::Jabber::JInbound;
-use strict;use warnings;
-use base qw/OpenSRF::Transport::Jabber::JabberClient/;
-use OpenSRF::EX;
-use OpenSRF::Utils::Config;
-use OpenSRF::Utils::Logger qw(:level);
-
-my $logger = "OpenSRF::Utils::Logger";
-
-=head1 Description
-
-This is the jabber connection where all incoming client requests will be accepted.
-This connection takes the data, passes it off to the system then returns to take
-more data.  Connection params are all taken from the config file and the values
-retreived are based on the $app name passed into new().
-
-This service should be loaded at system startup.
-
-=cut
-
-# XXX This will be overhauled to connect as a component instead of as
-# a user.  all in good time, though.
-
-{
-       my $unix_sock;
-       sub unix_sock { return $unix_sock; }
-       my $instance;
-
-       sub new {
-               my( $class, $app ) = @_;
-               $class = ref( $class ) || $class;
-               if( ! $instance ) {
-                       my $app_state = $app . "_inbound";
-                       my $config = OpenSRF::Utils::Config->current;
-
-                       if( ! $config ) {
-                               throw OpenSRF::EX::Jabber( "No suitable config found" );
-                       }
-
-                       my $host                        = $config->transport->server->primary;
-                       my $username    = $config->transport->users->$app;
-                       my $password    = $config->transport->auth->password;
-                       my $debug               = $config->transport->llevel->$app_state;
-                       my $log                 = $config->transport->log->$app_state;
-                       my $resource    = "system";
-
-
-                       my $self = __PACKAGE__->SUPER::new( 
-                                       username                => $username,
-                                       host                    => $host,
-                                       resource                => $resource,
-                                       password                => $password,
-                                       log_file                => $log,
-                                       debug                   => $debug,
-                                       );
-                                       
-                                       
-                       my $f = $config->dirs->sock_dir;
-                       $unix_sock = join( "/", $f, $config->unix_sock->$app );
-                       bless( $self, $class );
-                       $instance = $self;
-               }
-               $instance->SetCallBacks( message => \&handle_message );
-               return $instance;
-       }
-
-}
-       
-# ---
-# All incoming messages are passed untouched to the Unix Server for processing.  The
-# Unix socket is closed by the Unix Server as soon as it has received all of the
-# data.  This means we can go back to accepting more incoming connection.
-# -----
-sub handle_message { 
-       my $sid = shift;
-       my $message = shift;
-
-       my $packet = $message->GetXML();
-
-       $logger->transport( "JInbound $$ received $packet", INTERNAL );
-
-       # Send the packet to the unix socket for processing.
-       my $sock = unix_sock();
-       my $socket;
-       my $x = 0;
-       for( ;$x != 5; $x++ ) { #try 5 times
-               if( $socket = IO::Socket::UNIX->new( Peer => $sock  ) ) {
-                       last;
-               }
-       }
-       if( $x == 5 ) {
-               throw OpenSRF::EX::Socket( 
-                       "Unable to connect to UnixServer: socket-file: $sock \n :=> $! " );
-       }
-       print $socket $packet;
-       close( $socket );
-}
-
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JMessageWrapper.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JMessageWrapper.pm
deleted file mode 100644 (file)
index 15a6de5..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package OpenSRF::Transport::Jabber::JMessageWrapper;
-use Jabber::NodeFactory;
-use Net::Jabber qw(Client);
-use Net::Jabber::Message;
-use base qw/ Net::Jabber::Message OpenSRF /;
-use OpenSRF::Utils::Logger qw(:level);
-use strict; use warnings;
-
-=head1 Description
-
-OpenSRF::Transport::Jabber::JMessageWrapper
-
-Provides a means to extract information about a Jabber
-message when all you have is the raw XML.  The API
-implemented here should be implemented by any Transport
-helper/MessageWrapper class.
-
-=cut
-
-sub DESTROY{}
-
-my $logger = "OpenSRF::Utils::Logger";
-my $_node_factory = Jabber::NodeFactory->new( fromstr => 1 );
-
-
-=head2 new( Net::Jabber::Message/$raw_xml )
-
-Pass in the raw Jabber message as XML and create a new 
-JMessageWrapper
-
-=cut
-
-sub new {
-       my( $class, $xml ) = @_;
-       $class = ref( $class ) || $class;
-
-       return undef unless( $xml );
-       
-       my $self;
-
-       if( ref( $xml ) ) {
-               $self = $xml;
-       } else {
-               $logger->transport( "MWrapper got: " . $xml, INTERNAL );
-               my $node = $_node_factory->newNodeFromStr( $xml );
-               $self = $class->SUPER::new();
-               $self->SetFrom( $node->attr('from') );
-               $self->SetThread( $node->getTag('thread')->data );
-               $self->SetBody( $node->getTag('body')->data );
-       }
-
-       bless( $self, $class );
-
-       $logger->transport( "MessageWrapper $self after blessing", INTERNAL );
-
-       return $self;
-
-}
-
-=head2 get_remote_id
-
-Returns the JID (user@host/resource) of the remote user
-
-=cut
-sub get_remote_id {
-       my( $self ) = @_;
-       return $self->GetFrom();
-}
-
-=head2 get_sess_id
-
-Returns the Jabber thread associated with this message
-
-=cut
-sub get_sess_id {
-       my( $self ) = @_;
-       return $self->GetThread();
-}
-
-=head2 get_body
-
-Returns the message body of the Jabber message
-
-=cut
-sub get_body {
-       my( $self ) = @_;
-       return $self->GetBody();
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JPeerConnection.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JPeerConnection.pm
deleted file mode 100644 (file)
index 766de42..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package OpenSRF::Transport::Jabber::JPeerConnection;
-use strict;
-use base qw/OpenSRF::Transport::Jabber::JabberClient/;
-use OpenSRF::Utils::Config;
-use OpenSRF::Utils::Logger qw(:level);
-
-=head1 Description
-
-Represents a single connection to a remote peer.  The 
-Jabber values are loaded from the config file.  
-
-Subclasses OpenSRF::Transport::JabberClient.
-
-=cut
-
-=head2 new()
-
-       new( $appname );
-
-       The $appname parameter tells this class how to find the correct
-       Jabber username, password, etc to connect to the server.
-
-=cut
-
-our $main_instance;
-our %apps_hash;
-
-sub retrieve { 
-       my( $class, $app ) = @_;
-       my @keys = keys %apps_hash;
-       OpenSRF::Utils::Logger->transport( 
-                       "Requesting peer for $app and we have @keys", INTERNAL );
-       return $apps_hash{$app};
-}
-
-
-
-sub new {
-       my( $class, $app ) = @_;
-       my $config = OpenSRF::Utils::Config->current;
-
-       if( ! $config ) {
-               throw OpenSRF::EX::Config( "No suitable config found" );
-       }
-
-       my $app_stat    = $app . "_peer";
-       my $host                        = $config->transport->server->primary;
-       my $username    = $config->transport->users->$app;
-       my $password    = $config->transport->auth->password;
-       my $debug               = $config->transport->llevel->$app_stat;
-       my $log                 = $config->transport->log->$app_stat;
-       my $resource    = $config->env->hostname . "_$$";
-
-       OpenSRF::EX::Config->throw( "JPeer could not load all necesarry values from config" )
-               unless ( $host and $username and $password and $resource );
-
-
-       my $self = __PACKAGE__->SUPER::new( 
-               username                => $username,
-               host                    => $host,
-               resource                => $resource,
-               password                => $password,
-               log_file                => $log,
-               debug                   => $debug,
-               );      
-                                       
-        bless( $self, $class );
-
-        $self->SetCallBacks( message => sub {
-                        my $msg = $_[1];
-                        OpenSRF::Utils::Logger->transport( 
-                                "JPeer passing \n$msg \n to Transport->handler for $app", INTERNAL );
-                        OpenSRF::Transport->handler( $app, $msg ); } );
-
-       $apps_hash{$app} = $self;
-       return $apps_hash{$app};
-}
-       
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JabberClient.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Jabber/JabberClient.pm
deleted file mode 100644 (file)
index 50eb6ae..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-package OpenSRF::Transport::Jabber::JabberClient;
-use strict; use warnings;
-use OpenSRF::EX;
-use Net::Jabber qw( Client );
-use base qw( OpenSRF Net::Jabber::Client );
-use OpenSRF::Utils::Logger qw(:level);
-
-=head1 Description
-
-OpenSRF::Transport::Jabber::JabberClient
-
-Subclasses Net::Jabber::Client and, hence, provides the same
-functionality.  What it provides in addition is mainly some logging
-and exception throwing on the call to 'initialize()', which sets
-up the connection and authentication.
-
-=cut
-
-my $logger = "OpenSRF::Utils::Logger";
-
-sub DESTROY{};
-
-
-=head2 new()
-
-Creates a new JabberClient object.  The parameters should be self explanatory.
-If not, see Net::Jabber::Client for more.  
-
-debug and log_file are not required if you don't care to log the activity, 
-however all other parameters are.
-
-%params:
-
-       host
-       username
-       resource        
-       password
-       debug    
-       log_file
-
-=cut
-
-sub new {
-
-       my( $class, %params ) = @_;
-
-       $class = ref( $class ) || $class;
-
-       my $host                        = $params{'host'}                       || return undef;
-       my $username    = $params{'username'}   || return undef;
-       my $resource    = $params{'resource'}   || return undef;
-       my $password    = $params{'password'}   || return undef;
-       my $debug               = $params{'debug'};              
-       my $log_file    = $params{'log_file'};
-
-       my $self;
-
-       if( $debug and $log_file ) {
-               $self = Net::Jabber::Client->new( 
-                               debuglevel => $debug, debugfile => $log_file );
-       }
-       else { $self = Net::Jabber::Client->new(); }
-
-       bless( $self, $class );
-
-       $self->host( $host );
-       $self->username( $username );
-       $self->resource( $resource );
-       $self->password( $password );
-
-       $logger->transport( "Creating Jabber instance: $host, $username, $resource",
-                       $logger->INFO );
-
-       $self->SetCallBacks( send => 
-                       sub { $logger->transport( "JabberClient in 'send' callback: @_", INTERNAL ); } );
-
-
-       return $self;
-}
-
-# -------------------------------------------------
-
-=head2 gather()
-
-Gathers all Jabber messages sitting in the collection queue 
-and hands them each to their respective callbacks.  This call
-does not block (calls Process(0))
-
-=cut
-
-sub gather { my $self = shift; $self->Process( 0 ); }
-
-# -------------------------------------------------
-
-=head2 listen()
-
-Blocks and gathers incoming messages as they arrive.  Does not return
-unless an error occurs.
-
-Throws an OpenSRF::EX::JabberException if the call to Process ever fails.
-
-=cut
-sub listen {
-       my $self = shift;
-       while(1) {
-               my $o = $self->process( -1 );
-               if( ! defined( $o ) ) {
-                       throw OpenSRF::EX::Jabber( "Listen Loop failed at 'Process()'" );
-               }
-       }
-}
-
-# -------------------------------------------------
-
-sub password {
-       my( $self, $password ) = @_;
-       $self->{'oils:password'} = $password if $password;
-       return $self->{'oils:password'};
-}
-
-# -------------------------------------------------
-
-sub username {
-       my( $self, $username ) = @_;
-       $self->{'oils:username'} = $username if $username;
-       return $self->{'oils:username'};
-}
-       
-# -------------------------------------------------
-
-sub resource {
-       my( $self, $resource ) = @_;
-       $self->{'oils:resource'} = $resource if $resource;
-       return $self->{'oils:resource'};
-}
-
-# -------------------------------------------------
-
-sub host {
-       my( $self, $host ) = @_;
-       $self->{'oils:host'} = $host if $host;
-       return $self->{'oils:host'};
-}
-
-# -------------------------------------------------
-
-=head2 send()
-
-       Sends a Jabber message.
-       
-       %params:
-               to                      - The JID of the recipient
-               thread  - The Jabber thread
-               body            - The body of the message
-
-=cut
-
-sub send {
-       my( $self, %params ) = @_;
-
-       my $to = $params{'to'} || return undef;
-       my $body = $params{'body'} || return undef;
-       my $thread = $params{'thread'};
-
-       my $msg = Net::Jabber::Message->new();
-
-       $msg->SetTo( $to );
-       $msg->SetThread( $thread ) if $thread;
-       $msg->SetBody( $body );
-
-       $logger->transport( 
-                       "JabberClient Sending message to $to with thread $thread and body: \n$body", INTERNAL );
-
-       $self->Send( $msg );
-}
-
-
-=head2 inintialize()
-
-Connect to the server and log in.  
-
-Throws an OpenSRF::EX::JabberException if we cannot connect
-to the server or if the authentication fails.
-
-=cut
-
-# --- The logging lines have been commented out until we decide 
-# on which log files we're using.
-
-sub initialize {
-
-       my $self = shift;
-
-       my $host                        = $self->host; 
-       my $username    = $self->username;
-       my $resource    = $self->resource;
-       my $password    = $self->password;
-
-       my $jid = "$username\@$host\/$resource";
-
-       # --- 5 tries to connect to the jabber server
-       my $x = 0;
-       for( ; $x != 5; $x++ ) {
-               $logger->transport( "$jid: Attempting to connecto to server...$x", WARN );
-               if( $self->Connect( 'hostname' => $host ) ) {
-                       last; 
-               }
-               else { sleep 3; }
-       }
-
-       if( $x == 5 ) {
-               die "could not connect to server $!\n";
-               throw OpenSRF::EX::Jabber( " Could not connect to Jabber server" );
-       }
-
-       $logger->transport( "Logging into jabber as $jid " .
-                       "from " . ref( $self ), DEBUG );
-
-       # --- Log in
-       my @a = $self->AuthSend( 'username' => $username, 
-               'password' => $password, 'resource' => $resource );
-
-       if( $a[0] eq "ok" ) { 
-               $logger->transport( " * $jid: Jabber authenticated and connected", DEBUG );
-       }
-       else {
-               throw OpenSRF::EX::Jabber( " * $jid: Unable to authenticate: @a" );
-       }
-
-       return $self;
-}
-
-sub construct {
-       my( $class, $app ) = @_;
-       $logger->transport("Constructing new Jabber connection for $app", INTERNAL );
-       $class->peer_handle( 
-                       $class->new( $app )->initialize() );
-}
-
-sub process {
-
-       my( $self, $timeout ) = @_;
-       if( ! $timeout ) { $timeout = 0; }
-
-       unless( $self->Connected() ) {
-               OpenSRF::EX::Jabber->throw( 
-                 "This JabberClient instance is no longer connected to the server", ERROR );
-       }
-
-       my $val;
-
-       if( $timeout eq "-1" ) {
-               $val = $self->Process();
-       }
-       else { $val = $self->Process( $timeout ); }
-
-       if( $timeout eq "-1" ) { $timeout = " "; }
-       
-       if( ! defined( $val ) ) {
-               OpenSRF::EX::Jabber->throw( 
-                 "Call to Net::Jabber::Client->Process( $timeout ) failed", ERROR );
-       }
-       elsif( ! $val ) {
-               $logger->transport( 
-                       "Call to Net::Jabber::Client->Process( $timeout ) returned 0 bytes of data", DEBUG );
-       }
-       elsif( $val ) {
-               $logger->transport( 
-                       "Call to Net::Jabber::Client->Process( $timeout ) successfully returned data", INTERNAL );
-       }
-
-       return $val;
-
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/Listener.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/Listener.pm
deleted file mode 100644 (file)
index c3496b1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package OpenSRF::Transport::Listener;
-use base 'OpenSRF';
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::Transport::SlimJabber::Inbound;
-use base 'OpenSRF::Transport::SlimJabber::Inbound';
-
-=head1 Description
-
-This is the empty class that acts as the subclass of the transport listener.  My API
-includes
-
-new( $app )
-       create a new Listener with appname $app
-
-initialize()
-       Perform any transport layer connections/authentication.
-
-listen()
-       Block, wait for, and process incoming messages
-
-=cut
-
-=head2 set_listener()
-
-Sets my superclass.  Pass in a string representing the perl module
-(e.g. OpenSRF::Transport::Jabber::JInbound) to be used as the
-superclass and it will be pushed onto @ISA.
-
-=cut
-
-sub set_listener {
-       my( $class, $listener ) = @_;
-       OpenSRF::Utils::Logger->transport("Loading Listener $listener", INFO );
-       if( $listener ) {
-               $listener->use;
-               if( $@ ) {
-                       OpenSRF::Utils::Logger->error(
-                                       "Unable to set transport listener: $@", ERROR );
-               }
-               unshift @ISA, $listener;
-       }
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/PeerHandle.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/PeerHandle.pm
deleted file mode 100644 (file)
index e263971..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package OpenSRF::Transport::PeerHandle;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::EX;
-use base qw/OpenSRF::Transport::SlimJabber::PeerConnection/;
-use vars '@ISA';
-
-my $peer;
-
-=head2 peer_handle( $handle )
-
-Assigns the object that will act as the peer connection handle.
-
-=cut
-sub peer_handle {
-       my( $class, $handle ) = @_;
-       if( $handle ) { $peer = $handle; }
-       return $peer;
-}
-
-
-=head2 set_peer_client( $peer )
-
-Sets the class that will act as the superclass of this class.
-Pass in a string representing the module to be used as the superclass,
-and that module is 'used' and unshifted into @ISA.  We now have that
-classes capabilities.  
-
-=cut
-sub set_peer_client {
-       my( $class, $peer ) = @_;
-       if( $peer ) {
-               $peer->use;
-               if( $@ ) {
-                       throw OpenSRF::EX::PANIC ( "Unable to set peer client: $@" );
-               }
-               unshift @ISA, $peer;
-       }
-}
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber.pm
deleted file mode 100644 (file)
index 7963b93..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-package OpenSRF::Transport::SlimJabber;
-use base qw/OpenSRF::Transport/;
-
-=head2 OpenSRF::Transport::SlimJabber
-
-Implements the Transport interface for providing the system with appropriate
-classes for handling transport layer messaging
-
-=cut
-
-
-sub get_listener { return "OpenSRF::Transport::SlimJabber::Inbound"; }
-
-sub get_peer_client { return "OpenSRF::Transport::SlimJabber::PeerConnection"; }
-
-sub get_msg_envelope { return "OpenSRF::Transport::SlimJabber::MessageWrapper"; }
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm
deleted file mode 100644 (file)
index 657f719..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-package OpenSRF::Transport::SlimJabber::Client;
-use strict; use warnings;
-use OpenSRF::EX;
-use base qw( OpenSRF );
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::Utils::Config;
-use Time::HiRes qw(ualarm);
-use OpenSRF::Utils::Config;
-
-use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-use IO::Socket::INET;
-use IO::Socket::UNIX;
-
-=head1 Description
-
-OpenSRF::Transport::SlimJabber::Client
-
-Home-brewed slimmed down jabber connection agent. Supports SSL connections
-with a config file options:
-
-  transport->server->sslport # the ssl port
-  transport->server->ssl  # is this ssl?
-
-=cut
-
-my $logger = "OpenSRF::Utils::Logger";
-
-sub DESTROY{
-       my $self = shift;
-       $self->disconnect;
-}
-
-sub disconnect{
-       my $self = shift;
-       my $socket = $self->{_socket};
-       if( $socket and $socket->connected() ) {
-               print $socket "</stream:stream>";
-               close( $socket );
-       }
-}
-
-
-=head2 new()
-
-Creates a new Client object.
-
-debug and log_file are not required if you don't care to log the activity, 
-however all other parameters are.
-
-%params:
-
-       username
-       resource        
-       password
-       debug    
-       log_file
-
-=cut
-
-sub new {
-
-       my( $class, %params ) = @_;
-
-       $class = ref( $class ) || $class;
-
-       my $port                        = $params{'port'}                       || return undef;
-       my $username    = $params{'username'}   || return undef;
-       my $resource    = $params{'resource'}   || return undef;
-       my $password    = $params{'password'}   || return undef;
-       my $host                        = $params{'host'}                       || return undef;
-
-       my $jid = "$username\@$host\/$resource";
-
-       my $self = bless {} => $class;
-
-       $self->jid( $jid );
-       $self->host( $host );
-       $self->port( $port );
-       $self->username( $username );
-       $self->resource( $resource );
-       $self->password( $password );
-       $self->{temp_buffer} = "";
-
-       $logger->transport( "Creating Client instance: $host:$port, $username, $resource",
-                       $logger->INFO );
-
-       return $self;
-}
-
-# clears the tmp buffer as well as the TCP buffer
-sub buffer_reset { 
-
-       my $self = shift;
-       $self->{temp_buffer} = ""; 
-
-       my $fh = $self->{_socket};
-       set_nonblock( $fh );
-       my $t_buf = "";
-       while( sysread( $fh, $t_buf, 4096 ) ) {} 
-       set_block( $fh );
-}
-# -------------------------------------------------
-
-=head2 gather()
-
-Gathers all Jabber messages sitting in the collection queue 
-and hands them each to their respective callbacks.  This call
-does not block (calls Process(0))
-
-=cut
-
-sub gather { my $self = shift; $self->process( 0 ); }
-
-# -------------------------------------------------
-
-=head2 listen()
-
-Blocks and gathers incoming messages as they arrive.  Does not return
-unless an error occurs.
-
-Throws an OpenSRF::EX::JabberException if the call to Process ever fails.
-
-=cut
-sub listen {
-       my $self = shift;
-
-       my $sock = $self->unix_sock();
-       my $socket = IO::Socket::UNIX->new( Peer => $sock  );
-       $logger->transport( "Unix Socket opened by Listener", INTERNAL );
-       
-       throw OpenSRF::EX::Socket( "Unable to connect to UnixServer: socket-file: $sock \n :=> $! " )
-               unless ($socket->connected);
-               
-       while(1) {
-               my $o = $self->process( -1 );
-               $logger->transport( "Call to process() in listener returned:\n $o", INTERNAL );
-               if( ! defined( $o ) ) {
-                       throw OpenSRF::EX::Jabber( "Listen Loop failed at 'process()'" );
-               }
-               print $socket $o;
-
-       }
-       throw OpenSRF::EX::Socket( "How did we get here?!?!" );
-}
-
-sub set_nonblock {
-       my $fh = shift;
-       my      $flags = fcntl($fh, F_GETFL, 0)
-               or die "Can't get flags for the socket: $!\n";
-
-       $logger->transport( "Setting NONBLOCK: original flags: $flags", INTERNAL );
-
-       fcntl($fh, F_SETFL, $flags | O_NONBLOCK)
-               or die "Can't set flags for the socket: $!\n";
-
-       return $flags;
-}
-
-sub reset_fl {
-       my $fh = shift;
-       my $flags = shift;
-       $logger->transport( "Restoring BLOCK: to flags $flags", INTERNAL );
-       fcntl($fh, F_SETFL, $flags) if defined $flags;
-}
-
-sub set_block {
-       my $fh = shift;
-
-       my      $flags = fcntl($fh, F_GETFL, 0)
-               or die "Can't get flags for the socket: $!\n";
-
-       $flags &= ~O_NONBLOCK;
-
-       fcntl($fh, F_SETFL, $flags)
-               or die "Can't set flags for the socket: $!\n";
-}
-
-
-sub timed_read {
-       my ($self, $timeout) = @_;
-    $timeout = defined($timeout) ? int($timeout) : undef;
-
-       $logger->transport( "Temp Buffer Contained: \n". $self->{temp_buffer}, INTERNAL) if $self->{temp_buffer};
-       if( $self->can( "app" ) ) {
-               $logger->transport( "timed_read called for ".$self->app.", I am: ".$self->jid, INTERNAL );
-       }
-
-       # See if there is a complete message in the temp_buffer
-       # that we can return
-       if( $self->{temp_buffer} ) {
-               my $buffer = $self->{temp_buffer};
-               my $complete = 0;
-               $self->{temp_buffer} = '';
-
-               my ($tag) = ($buffer =~ /<([^\s\?\>]+)/o);
-               $self->{last_tag} = $tag;
-               $logger->transport("Using tag: $tag  ", INTERNAL);
-
-               if ( $buffer =~ /^(.*?<\/$tag>){1}(.*)/s) {
-                       $buffer = $1;
-                       $self->{temp_buffer} = $2;
-                       $complete++;
-                       $logger->transport( "completed read with $buffer", INTERNAL );
-               } elsif ( $buffer =~ /^<$tag[^>]*?\/>(.*)/) {
-                       $self->{temp_buffer} = $1;
-                       $complete++;
-                       $logger->transport( "completed read with $buffer", INTERNAL );
-               } else {
-                       $self->{temp_buffer} = $buffer;
-               }
-                               
-               if( $buffer and $complete ) {
-                       return $buffer;
-               }
-
-       }
-       ############
-
-       my $fh = $self->{_socket};
-
-       unless( $fh and $fh->connected ) {
-               throw OpenSRF::EX::Socket ("Attempted read on closed socket", ERROR );
-       }
-
-       $logger->transport( "Temp Buffer After first attempt: \n ".$self->{temp_buffer}, INTERNAL) if $self->{temp_buffer};
-
-       my $flags;
-       if (defined($timeout) && !$timeout) {
-               $flags = set_nonblock( $fh );
-       }
-
-       $timeout ||= 0;
-       $logger->transport( "Calling timed_read with timetout $timeout", INTERNAL );
-
-
-       my $complete = 0;
-       my $first_read = 1;
-       my $xml = '';
-       eval {
-               my $tag = '';
-               eval {
-                       no warnings;
-                       local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
-
-                       # alarm needs a number greater => 1.
-                       my $alarm_timeout = $timeout;
-                       if( $alarm_timeout > 0 and $alarm_timeout < 1 ) {
-                               $alarm_timeout = 1;
-                       }
-                       alarm $alarm_timeout;
-                       do {    
-
-                               my $buffer = $self->{temp_buffer};
-                               $self->{temp_buffer} = '';
-                               #####
-
-                               # This code is no longer in use
-                               #my $ff =  fcntl($fh, F_GETFL, 0);
-                               #if ($ff == ($ff | O_NONBLOCK) and $timeout > 0 ) {
-                                       #throw OpenSRF::EX::ERROR ("File flags are set to NONBLOCK but timeout is $timeout", ERROR );
-                               #}
-
-                               my $t_buf = "";
-                               my $read_size = 1024; my $f = 0;
-                               while( my $n = sysread( $fh, $t_buf, $read_size ) ) {
-
-                                       unless( $fh->connected ) {
-                                               OpenSRF::EX::JabberDisconnected->throw(
-                                                       "Lost jabber client in timed_read()");
-                                       }
-
-                                       # XXX Change me to debug/internal at some point, this is for testing...
-                                       # XXX Found a race condition where reading >= $read_size bytes of data
-                                       # will fail if the log line below is removed.
-                                       $logger->info("timed_read() read $n bytes of data");
-
-
-                                       $buffer .= $t_buf;
-                                       if( $n < $read_size ) {
-                                               #reset_fl( $fh, $f ) if $f;
-                                               set_block( $fh );
-                                               last;
-                                       }
-                                       # see if there is any more data to grab...
-                                       $f = set_nonblock( $fh );
-                               }
-
-                               #sysread($fh, $buffer, 2048, length($buffer) );
-                               #sysread( $fh, $t_buf, 2048 );
-                               #$buffer .= $t_buf;
-
-                               #####
-                               $logger->transport(" Got [$buffer] from the socket", INTERNAL);
-
-                               if ($first_read) {
-                                       $logger->transport(" First read Buffer\n [$buffer]", INTERNAL);
-                                       ($tag) = ($buffer =~ /<([^\s\?\>\/]+){1}/o);
-                                       $self->{last_tag} = $tag;
-                                       $first_read--;
-                                       $logger->transport("Using tag: $tag  ", INTERNAL);
-                               }
-
-                               if (!$first_read && $buffer =~ /^(.*?<\/$tag>){1}(.*)/s) {
-                                       $buffer = $1;
-                                       $self->{temp_buffer} = $2;
-                                       $complete++;
-                                       $logger->transport( "completed read with $buffer", INTERNAL );
-                               } elsif (!$first_read && $buffer =~ /^<$tag[^>]*?\/>(.*)/) {
-                                       $self->{temp_buffer} = $1;
-                                       $complete++;
-                                       $logger->transport( "completed read with $buffer", INTERNAL );
-                               }
-                               
-                               $xml .= $buffer;
-
-                       } while (!$complete && $xml);
-                       alarm(0);
-               };
-               alarm(0);
-       };
-
-       $logger->transport( "XML Read: $xml", INTERNAL );
-       #reset_fl( $fh, $flags) if defined $flags;
-       set_block( $fh ) if defined $flags;
-
-       if ($complete) {
-               return $xml;
-       }
-       if( $@ ) {
-               return undef;
-       }
-       return "";
-}
-
-
-# -------------------------------------------------
-
-sub tcp_connected {
-
-       my $self = shift;
-       return 1 if ($self->{_socket} and $self->{_socket}->connected);
-       return 0;
-}
-
-sub password {
-       my( $self, $password ) = @_;
-       $self->{'oils:password'} = $password if $password;
-       return $self->{'oils:password'};
-}
-
-# -------------------------------------------------
-
-sub username {
-       my( $self, $username ) = @_;
-       $self->{'oils:username'} = $username if $username;
-       return $self->{'oils:username'};
-}
-       
-# -------------------------------------------------
-
-sub resource {
-       my( $self, $resource ) = @_;
-       $self->{'oils:resource'} = $resource if $resource;
-       return $self->{'oils:resource'};
-}
-
-# -------------------------------------------------
-
-sub jid {
-       my( $self, $jid ) = @_;
-       $self->{'oils:jid'} = $jid if $jid;
-       return $self->{'oils:jid'};
-}
-
-sub port {
-       my( $self, $port ) = @_;
-       $self->{'oils:port'} = $port if $port;
-       return $self->{'oils:port'};
-}
-
-sub host {
-       my( $self, $host ) = @_;
-       $self->{'oils:host'} = $host if $host;
-       return $self->{'oils:host'};
-}
-
-# -------------------------------------------------
-
-=head2 send()
-
-       Sends a Jabber message.
-       
-       %params:
-               to                      - The JID of the recipient
-               thread  - The Jabber thread
-               body            - The body of the message
-
-=cut
-
-sub send {
-       my $self = shift;
-       my %params = @_;
-
-       my $to = $params{'to'} || return undef;
-       my $body = $params{'body'} || return undef;
-       my $thread = $params{'thread'} || "";
-       my $router_command = $params{'router_command'} || "";
-       my $router_class = $params{'router_class'} || "";
-
-       my $msg = OpenSRF::Transport::SlimJabber::MessageWrapper->new;
-
-       $msg->setTo( $to );
-       $msg->setThread( $thread ) if $thread;
-       $msg->setBody( $body );
-       $msg->set_router_command( $router_command );
-       $msg->set_router_class( $router_class );
-   $msg->set_osrf_xid($logger->get_osrf_xid);
-
-       $logger->transport( 
-                       "JabberClient Sending message to $to with thread $thread and body: \n$body", INTERNAL );
-
-       my $soc = $self->{_socket};
-       unless( $soc and $soc->connected ) {
-               throw OpenSRF::EX::Jabber ("No longer connected to jabber server");
-       }
-       print $soc $msg->toString;
-
-       $logger->transport( 
-                       "JabberClient Sent message to $to with thread $thread and body: \n$body", INTERNAL );
-}
-
-
-=head2 inintialize()
-
-Connect to the server and log in.  
-
-Throws an OpenSRF::EX::JabberException if we cannot connect
-to the server or if the authentication fails.
-
-=cut
-
-# --- The logging lines have been commented out until we decide 
-# on which log files we're using.
-
-sub initialize {
-
-       my $self = shift;
-
-       my $jid         = $self->jid; 
-       my $host        = $self->host; 
-       my $port        = $self->port; 
-       my $username    = $self->username;
-       my $resource    = $self->resource;
-       my $password    = $self->password;
-
-       my $stream = <<"        XML";
-<stream:stream to='$host' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>
-       XML
-
-       my $conf = OpenSRF::Utils::Config->current;
-       my $tail = "_$$";
-       if(!$conf->bootstrap->router_name && $username eq "router") {
-               $tail = "";
-       }
-
-       my $auth = <<"  XML";
-<iq id='123' type='set'>
-<query xmlns='jabber:iq:auth'>
-<username>$username</username>
-<password>$password</password>
-<resource>${resource}$tail</resource>
-</query>
-</iq>
-       XML
-
-       my $sock_type = 'IO::Socket::INET';
-       
-       # if port is a string, then we're connecting to a UNIX socket
-       unless( $port =~ /^\d+$/ ) {
-               $sock_type = 'IO::Socket::UNIX';
-       }
-
-       # --- 5 tries to connect to the jabber server
-       my $socket;
-       for(1..5) {
-               $socket = $sock_type->new( PeerHost => $host,
-                                          PeerPort => $port,
-                                          Peer => $port,
-                                          Proto    => 'tcp' );
-               $logger->debug( "$jid: $_ connect attempt to $host:$port");
-               last if ( $socket and $socket->connected );
-               $logger->warn( "$jid: Failed to connect to server...$host:$port (Try # $_)");
-               sleep 3;
-       }
-
-       unless ( $socket and $socket->connected ) {
-               throw OpenSRF::EX::Jabber( " Could not connect to Jabber server: $!" );
-       }
-
-       $logger->transport( "Logging into jabber as $jid " .
-                       "from " . ref( $self ), DEBUG );
-
-       print $socket $stream;
-
-       my $buffer;
-       eval {
-               eval {
-                       local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
-                       alarm 3;
-                       sysread($socket, $buffer, 4096);
-                       $logger->transport( "Login buffer 1: $buffer", INTERNAL );
-                       alarm(0);
-               };
-               alarm(0);
-       };
-
-       print $socket $auth;
-
-       if( $socket and $socket->connected() ) {
-               $self->{_socket} = $socket;
-       } else {
-               throw OpenSRF::EX::Jabber( " ** Unable to connect to Jabber server", ERROR );
-       }
-
-
-       $buffer = $self->timed_read(10);
-
-       if( $buffer ) {$logger->transport( "Login buffer 2: $buffer", INTERNAL );}
-
-       if( $buffer and $buffer =~ /type=["\']result["\']/ ) { 
-               $logger->transport( " * $jid: Jabber authenticated and connected", DEBUG );
-       } else {
-               if( !$buffer ) { $buffer = " "; }
-               $socket->close;
-               throw OpenSRF::EX::Jabber( " * $jid: Unable to authenticate: $buffer", ERROR );
-       }
-
-       return $self;
-}
-
-sub construct {
-       my( $class, $app ) = @_;
-       $logger->transport("Constructing new Jabber connection for $app, my class $class", INTERNAL );
-       $class->peer_handle( 
-                       $class->new( $app )->initialize() );
-}
-
-sub process {
-
-       my( $self, $timeout ) = @_;
-
-       $timeout ||= 0;
-    $timeout = int($timeout);
-       undef $timeout if ( $timeout < 0 );
-
-       unless( $self->{_socket}->connected ) {
-               OpenSRF::EX::JabberDisconnected->throw( 
-                 "This JabberClient instance is no longer connected to the server " . 
-                 $self->username . " : " . $self->resource, ERROR );
-       }
-
-       my $val = $self->timed_read( $timeout );
-
-       $timeout = "FOREVER" unless ( defined $timeout );
-       
-       if ( ! defined( $val ) ) {
-               OpenSRF::EX::Jabber->throw( 
-                 "Call to Client->timed_read( $timeout ) failed", ERROR );
-       } elsif ( ! $val ) {
-               $logger->transport( 
-                       "Call to Client->timed_read( $timeout ) returned 0 bytes of data", INTERNAL );
-       } elsif ( $val ) {
-               $logger->transport( 
-                       "Call to Client->timed_read( $timeout ) successfully returned data", INTERNAL );
-       }
-
-       my $t = $self->{last_tag};
-
-       if( $t and $val ) {
-               my @msgs = $val =~ /(<$t[^>]*>.*?<\/$t>)/g;
-               $val = shift(@msgs);
-       
-               if (@msgs) {
-                       my $tmp = $self->{temp_buffer};
-       
-                       $self->{temp_buffer} = '';
-                       $self->{temp_buffer} .= $_ for (@msgs);
-                       $self->{temp_buffer} .= $tmp;
-               }
-       }
-
-       return $val;
-}
-
-
-# --------------------------------------------------------------
-# Sets the socket to O_NONBLOCK, reads all of the data off of
-# the socket, the restores the sockets flags
-# Returns 1 on success, 0 if the socket isn't connected
-# --------------------------------------------------------------
-sub flush_socket {
-
-       my $self = shift;
-       my $socket = $self->{_socket};
-
-       if( $socket ) {
-
-               my $buf;
-               my      $flags = fcntl($socket, F_GETFL, 0);
-
-               fcntl($socket, F_SETFL, $flags | O_NONBLOCK);
-               while( my $n = sysread( $socket, $buf, 8192 ) ) {
-                       $logger->debug("flush_socket dropped $n bytes of data");
-                       if(!$socket->connected()) {
-                               $logger->error("flush_socket dropped data on disconnected socket: $buf");
-                       }
-               }
-               fcntl($socket, F_SETFL, $flags);
-
-               return 0 unless $socket->connected();
-
-               return 1;
-
-       } else {
-
-               return 0;
-       }
-}
-
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/Inbound.pm
deleted file mode 100644 (file)
index 32b7e7e..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-package OpenSRF::Transport::SlimJabber::Inbound;
-use strict;use warnings;
-use base qw/OpenSRF::Transport::SlimJabber::Client/;
-use OpenSRF::EX qw(:try);
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::Utils::SettingsClient;
-use OpenSRF::Utils::Config;
-use Time::HiRes qw/usleep/;
-
-my $logger = "OpenSRF::Utils::Logger";
-
-=head1 Description
-
-This is the jabber connection where all incoming client requests will be accepted.
-This connection takes the data, passes it off to the system then returns to take
-more data.  Connection params are all taken from the config file and the values
-retreived are based on the $app name passed into new().
-
-This service should be loaded at system startup.
-
-=cut
-
-# XXX This will be overhauled to connect as a component instead of as
-# a user.  all in good time, though.
-
-{
-       my $unix_sock;
-       sub unix_sock { return $unix_sock; }
-       my $instance;
-
-       sub new {
-               my( $class, $app ) = @_;
-               $class = ref( $class ) || $class;
-               if( ! $instance ) {
-
-                       my $conf = OpenSRF::Utils::Config->current;
-                       my $domains = $conf->bootstrap->domains;
-
-                       my $username    = $conf->bootstrap->username;
-                       my $password    = $conf->bootstrap->passwd;
-                       my $port                        = $conf->bootstrap->port;
-                       my $host                        = $domains->[0]; # XXX for now...
-                       my $resource    = $app . '_listener_at_' . $conf->env->hostname;
-
-                       my $router_name = $conf->bootstrap->router_name;
-                       # no router, only one listener running..
-                       if(!$router_name) { 
-                               $username = "router";
-                               $resource = $app; 
-                       }
-
-                       OpenSRF::Utils::Logger->transport("Inbound as $username, $password, $resource, $host, $port\n", INTERNAL );
-
-                       my $self = __PACKAGE__->SUPER::new( 
-                                       username                => $username,
-                                       resource                => $resource,
-                                       password                => $password,
-                                       host                    => $host,
-                                       port                    => $port,
-                                       );
-
-                       $self->{app} = $app;
-                                       
-                       my $client = OpenSRF::Utils::SettingsClient->new();
-                       my $f = $client->config_value("dirs", "sock");
-                       $unix_sock = join( "/", $f, 
-                                       $client->config_value("apps", $app, "unix_config", "unix_sock" ));
-                       bless( $self, $class );
-                       $instance = $self;
-               }
-               return $instance;
-       }
-
-}
-
-sub DESTROY {
-       my $self = shift;
-
-       my $routers = $self->{routers}; #store for destroy
-       my $router_name = $self->{router_name};
-
-       unless($router_name and $routers) {
-               return;
-       }
-
-       my @targets;
-       for my $router (@$routers) {
-               push @targets, "$router_name\@$router/router";
-       }
-
-       for my $router (@targets) {
-               if($self->tcp_connected()) {
-                       $self->send( to => $router, body => "registering", 
-                               router_command => "unregister" , router_class => $self->{app} );
-               }
-       }
-}
-       
-sub listen {
-       my $self = shift;
-       
-       my $routers;
-
-       try {
-
-               my $conf = OpenSRF::Utils::Config->current;
-               my $router_name = $conf->bootstrap->router_name;
-               my $routers = $conf->bootstrap->domains;
-
-               $self->{routers} = $routers; #store for destroy
-               $self->{router_name} = $router_name;
-       
-               if($router_name and $routers) {
-       
-                       my @targets;
-                       for my $router (@$routers) {
-                               push @targets, "$router_name\@$router/router";
-                       }
-       
-                       for my $router (@targets) {
-                               $logger->transport( $self->{app} . " connecting to router $router", INFO ); 
-                               $self->send( to => $router, 
-                                               body => "registering", router_command => "register" , router_class => $self->{app} );
-                       }
-                       $logger->transport( $self->{app} . " :routers connected", INFO ); 
-
-               } else {
-
-                       $logger->transport("Bypassing routers...", INFO);
-               }
-
-               
-       } catch OpenSRF::EX::Config with {
-               $logger->transport( $self->{app} . ": No routers defined" , WARN ); 
-               # no routers defined
-       };
-
-
-       
-                       
-       $logger->transport( $self->{app} . " going into listen loop", INFO );
-
-       while(1) {
-       
-               my $sock = $self->unix_sock();
-               my $o;
-
-               $logger->debug("Inbound listener calling process()");
-
-               try {
-                       $o = $self->process( -1 );
-
-                       $logger->debug("Inbound listener received ".length($o)." bytes of data");
-
-                       if(!$o){
-                               $logger->error(
-                                       "Inbound received no data from the Jabber socket in process()");
-                               usleep(100000); # otherwise we loop and pound syslog logger with errors
-                       }
-
-               } catch OpenSRF::EX::JabberDisconnected with {
-
-                       $logger->error("Inbound process lost its ".
-                               "jabber connection.  Attempting to reconnect...");
-                       $self->initialize;
-                       $o = undef;
-               };
-
-
-               if($o) {
-                       my $socket = IO::Socket::UNIX->new( Peer => $sock  );
-                       throw OpenSRF::EX::Socket( 
-                               "Unable to connect to UnixServer: socket-file: $sock \n :=> $! " )
-                               unless ($socket->connected);
-                       print $socket $o;
-                       $socket->close;
-               } 
-       }
-
-       throw OpenSRF::EX::Socket( "How did we get here?!?!" );
-}
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm
deleted file mode 100644 (file)
index 3f5393c..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-package OpenSRF::Transport::SlimJabber::MessageWrapper;
-use XML::LibXML;
-use OpenSRF::EX qw/:try/;
-use OpenSRF::Utils::Logger qw/$logger/;
-
-sub new {
-       my $class = shift;
-       $class = ref($class) || $class;
-
-       my $xml = shift;
-
-       my ($doc, $msg);
-       if ($xml) {
-               my $err;
-
-               try {
-                       $doc = XML::LibXML->new->parse_string($xml);
-               } catch Error with {
-                       $err = shift; 
-                       warn "MessageWrapper received bad XML : error = $err\nXML = $xml\n";
-                       $logger->error("MessageWrapper received bad XML : error = $err : XML = $xml");
-               };
-               throw $err if $err;
-
-               $msg = $doc->documentElement;
-       } else {
-               $doc = XML::LibXML::Document->createDocument;
-               $msg = $doc->createElement( 'message' );
-               $doc->setDocumentElement( $msg );
-       }
-
-       
-       my $self = { msg_node => $msg };
-
-       return bless $self => $class;
-}
-
-sub toString {
-       my $self = shift;
-       if( $self->{msg_node} ) {
-               return $self->{msg_node}->toString(@_);
-       }
-       return "";
-}
-
-sub get_body {
-       my $self = shift;
-       my ($t_body) = grep {$_->nodeName eq 'body'} $self->{msg_node}->childNodes;
-       if( $t_body ) {
-               my $body = $t_body->textContent;
-               return $body;
-       }
-       return "";
-}
-
-sub get_sess_id {
-       my $self = shift;
-       my ($t_node) = grep {$_->nodeName eq 'thread'} $self->{msg_node}->childNodes;
-       if( $t_node ) {
-               return $t_node->textContent;
-       }
-       return "";
-}
-
-sub get_msg_type {
-       my $self = shift;
-       $self->{msg_node}->getAttribute( 'type' );
-}
-
-sub get_remote_id {
-       my $self = shift;
-
-       #
-       my $rid = $self->{msg_node}->getAttribute( 'router_from' );
-       return $rid if $rid;
-
-       return $self->{msg_node}->getAttribute( 'from' );
-}
-
-sub setType {
-       my $self = shift;
-       $self->{msg_node}->setAttribute( type => shift );
-}
-
-sub setTo {
-       my $self = shift;
-       $self->{msg_node}->setAttribute( to => shift );
-}
-
-sub setThread {
-       my $self = shift;
-       $self->{msg_node}->appendTextChild( thread => shift );
-}
-
-sub setBody {
-       my $self = shift;
-       my $body = shift;
-       $self->{msg_node}->appendTextChild( body => $body );
-}
-
-sub set_router_command {
-       my( $self, $router_command ) = @_;
-       if( $router_command ) {
-               $self->{msg_node}->setAttribute( router_command => $router_command );
-       }
-}
-sub set_router_class {
-       my( $self, $router_class ) = @_;
-       if( $router_class ) {
-               $self->{msg_node}->setAttribute( router_class => $router_class );
-       }
-}
-
-sub set_osrf_xid {
-   my( $self, $xid ) = @_;
-   $self->{msg_node}->setAttribute( osrf_xid => $xid );
-}
-
-
-sub get_osrf_xid {
-   my $self = shift;
-   $self->{msg_node}->getAttribute('osrf_xid');
-}
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm b/OpenSRF/src/perlmods/OpenSRF/Transport/SlimJabber/PeerConnection.pm
deleted file mode 100644 (file)
index 1273ddc..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-package OpenSRF::Transport::SlimJabber::PeerConnection;
-use strict;
-use base qw/OpenSRF::Transport::SlimJabber::Client/;
-use OpenSRF::Utils::Config;
-use OpenSRF::Utils::Logger qw(:level);
-use OpenSRF::EX qw/:try/;
-
-=head1 Description
-
-Represents a single connection to a remote peer.  The 
-Jabber values are loaded from the config file.  
-
-Subclasses OpenSRF::Transport::SlimJabber::Client.
-
-=cut
-
-=head2 new()
-
-       new( $appname );
-
-       The $appname parameter tells this class how to find the correct
-       Jabber username, password, etc to connect to the server.
-
-=cut
-
-our %apps_hash;
-our $_singleton_connection;
-
-sub retrieve { 
-       my( $class, $app ) = @_;
-       return $_singleton_connection;
-#      my @keys = keys %apps_hash;
-#      OpenSRF::Utils::Logger->transport( 
-#                      "Requesting peer for $app and we have @keys", INFO );
-#      return $apps_hash{$app};
-}
-
-
-
-# !! In here we use the bootstrap config ....
-sub new {
-       my( $class, $app ) = @_;
-
-       my $peer_con = $class->retrieve;
-       return $peer_con if ($peer_con and $peer_con->tcp_connected);
-
-       my $config = OpenSRF::Utils::Config->current;
-
-       if( ! $config ) {
-               throw OpenSRF::EX::Config( "No suitable config found for PeerConnection" );
-       }
-
-       my $conf                        = OpenSRF::Utils::Config->current;
-       my $domains = $conf->bootstrap->domains;
-       my $h = $conf->env->hostname;
-
-       my $username    = $conf->bootstrap->username;
-       my $password    = $conf->bootstrap->passwd;
-       my $port        = $conf->bootstrap->port;
-       my $resource    = "${app}_drone_at_$h";
-       my $host        = $domains->[0]; # XXX for now...
-
-       if( $app eq "client" ) { $resource = "client_at_$h"; }
-
-#      unless ( $conf->bootstrap->router_name ) {
-#              $username = 'router';
-#              $resource = $app;
-#      }
-
-
-       OpenSRF::EX::Config->throw( "JPeer could not load all necesarry values from config" )
-               unless ( $username and $password and $resource and $host and $port );
-
-       OpenSRF::Utils::Logger->transport( "Built Peer with", INTERNAL );
-
-       my $self = __PACKAGE__->SUPER::new( 
-               username                => $username,
-               resource                => $resource,
-               password                => $password,
-               host                    => $host,
-               port                    => $port,
-               );      
-                                       
-       bless( $self, $class );
-
-       $self->app($app);
-
-       $_singleton_connection = $self;
-       $apps_hash{$app} = $self;
-
-       return $_singleton_connection;
-       return $apps_hash{$app};
-}
-
-sub process {
-
-       my $self = shift;
-       my $val = $self->SUPER::process(@_);
-       return 0 unless $val;
-
-       OpenSRF::Utils::Logger->transport( "Calling transport handler for ".$self->app." with: $val", INTERNAL );
-       my $t;
-       $t = OpenSRF::Transport->handler($self->app, $val);
-
-       return $t;
-}
-
-sub app {
-       my $self = shift;
-       my $app = shift;
-       if( $app ) {
-               OpenSRF::Utils::Logger->transport( "PEER changing app to $app: ".$self->jid, INTERNAL );
-       }
-
-       $self->{app} = $app if ($app);
-       return $self->{app};
-}
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/UnixServer.pm b/OpenSRF/src/perlmods/OpenSRF/UnixServer.pm
deleted file mode 100644 (file)
index 120f73c..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-package OpenSRF::UnixServer;
-use strict; use warnings;
-use base qw/OpenSRF/;
-use OpenSRF::EX qw(:try);
-use OpenSRF::Utils::Logger qw(:level $logger);
-use OpenSRF::Transport::PeerHandle;
-use OpenSRF::Application;
-use OpenSRF::AppSession;
-use OpenSRF::DomainObject::oilsResponse qw/:status/;
-use OpenSRF::System;
-use OpenSRF::Utils::SettingsClient;
-use Time::HiRes qw(time);
-use JSON;
-use vars qw/@ISA $app/;
-use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-use Carp;
-
-use IO::Socket::INET;
-use IO::Socket::UNIX;
-
-sub DESTROY { confess "Dying $$"; }
-
-=head1 What am I
-
-All inbound messages are passed on to the UnixServer for processing.
-We take the data, close the Unix socket, and pass the data on to our abstract
-'process()' method.  
-
-Our purpose is to 'multiplex' a single TCP connection into multiple 'client' connections.
-So when you pass data down the Unix socket to us, we have been preforked and waiting
-to disperse new data among us.
-
-=cut
-
-sub app { return $app; }
-
-{
-
-       sub new {
-               my( $class, $app1 ) = @_;
-               if( ! $app1 ) {
-                       throw OpenSRF::EX::InvalidArg( "UnixServer requires an app name to run" );
-               }
-               $app = $app1;
-               my $self = bless( {}, $class );
-#              my $client = OpenSRF::Utils::SettingsClient->new();
-#              if( $client->config_value("server_type") !~ /fork/i || 
-#                              OpenSRF::Utils::Config->current->bootstrap->settings_config ) {
-#                      warn "Calling hooks for non-prefork\n";
-#                      $self->configure_hook();
-#                      $self->child_init_hook();
-#              }
-               return $self;
-       }
-
-}
-
-=head2 process_request()
-
-Takes the incoming data, closes the Unix socket and hands the data untouched 
-to the abstract process() method.  This method is implemented in our subclasses.
-
-=cut
-
-sub process_request {
-
-       my $self = shift;
-       my $data; my $d;
-       while( $d = <STDIN> ) { $data .= $d; }
-
-       my $orig = $0;
-       $0 = "$0*";
-
-       if( ! $data or ! defined( $data ) or $data eq "" ) {
-               close($self->{server}->{client}); 
-               $logger->debug("Unix child received empty data from socket", ERROR);
-               $0 = $orig;
-               return;
-       }
-
-
-       if( ! close( $self->{server}->{client} ) ) {
-               $logger->debug( "Error closing Unix socket: $!", ERROR );
-       }
-
-       my $app = $self->app();
-       $logger->transport( "UnixServer for $app received $data", INTERNAL );
-
-       # --------------------------------------------------------------
-       # Drop all data from the socket before coninuting to process
-       # --------------------------------------------------------------
-       my $ph = OpenSRF::Transport::PeerHandle->retrieve;
-       if(!$ph->flush_socket()) {
-               $logger->error("We received a request ".
-                       "and we are no longer connected to the jabber network. ".
-                       "We will go away and drop this request: $data");
-               exit;
-       }
-
-       my $app_session = OpenSRF::Transport->handler( $self->app(), $data );
-
-       if(!ref($app_session)) {
-               $logger->transport( "Did not receive AppSession from transport handler, returning...", WARN );
-               $0 = $orig;
-               return;
-       }
-
-       if($app_session->stateless and $app_session->state != $app_session->CONNECTED()){
-               $logger->debug("Exiting keepalive for stateless session / orig = $orig");
-               $app_session->kill_me;
-               $0 = $orig;
-               return;
-       }
-
-
-       my $client = OpenSRF::Utils::SettingsClient->new();
-       my $keepalive = $client->config_value("apps", $self->app(), "keepalive");
-
-       my $req_counter = 0;
-       while( $app_session and 
-                       $app_session->state and 
-                       $app_session->state != $app_session->DISCONNECTED() and
-                       $app_session->find( $app_session->session_id ) ) {
-               
-
-               my $before = time;
-               $logger->debug( "UnixServer calling queue_wait $keepalive", INTERNAL );
-               $app_session->queue_wait( $keepalive );
-               $logger->debug( "after queue wait $keepalive", INTERNAL );
-               my $after = time;
-
-               if( ($after - $before) >= $keepalive ) { 
-
-                       my $res = OpenSRF::DomainObject::oilsConnectStatus->new(
-                                                                       status => "Disconnected on timeout",
-                                                                       statusCode => STATUS_TIMEOUT);
-                       $app_session->status($res);
-                       $app_session->state( $app_session->DISCONNECTED() );
-                       last;
-               }
-       
-       }
-
-       my $x = 0;
-       while( $app_session && $app_session->queue_wait(0) ) {
-               $logger->debug( "Looping on zombies " . $x++ , DEBUG);
-       }
-
-       $logger->debug( "Timed out, disconnected, or auth failed" );
-       $app_session->kill_me if ($app_session);
-
-       $0 = $orig;
-}
-
-
-sub serve {
-       my( $self ) = @_;
-
-       my $app = $self->app();
-       $logger->set_service($app);
-
-       $0 = "OpenSRF master [$app]";
-
-       my $client = OpenSRF::Utils::SettingsClient->new();
-    my @base = ('apps', $app, 'unix_config' );
-
-       my $min_servers = $client->config_value(@base, 'min_children');
-       my $max_servers = $client->config_value(@base, "max_children" );
-       my $min_spare = $client->config_value(@base, "min_spare_children" );
-       my $max_spare = $client->config_value(@base, "max_spare_children" );
-       my $max_requests = $client->config_value(@base, "max_requests" );
-    # fwiw, these file paths are (obviously) not portable
-       my $log_file = join("/", $client->config_value("dirs", "log"), $client->config_value(@base, "unix_log" ));
-       my $port = join("/", $client->config_value("dirs", "sock"), $client->config_value(@base, "unix_sock" ));
-       my $pid_file = join("/", $client->config_value("dirs", "pid"), $client->config_value(@base, "unix_pid" ));
-
-    $min_spare ||= $min_servers;
-    $max_spare ||= $max_servers;
-    $max_requests ||= 1000;
-
-    $logger->info("UnixServer: min=$min_servers, max=$max_servers, min_spare=$min_spare ".
-        "max_spare=$max_spare, max_req=$max_requests, log_file=$log_file, port=$port, pid_file=$pid_file");
-
-    $self->run(
-        min_servers => $min_servers,
-        max_servers => $max_servers,
-        min_spare_servers => $min_spare,
-        max_spare_servers => $max_spare,
-        max_requests => $max_requests,
-        log_file => $log_file,
-        port => $port,
-        proto => 'unix',
-        pid_file => $pid_file,
-    );
-
-}
-
-
-sub configure_hook {
-       my $self = shift;
-       my $app = $self->app;
-
-       # boot a client
-       OpenSRF::System->bootstrap_client( client_name => "system_client" );
-
-       $logger->debug( "Setting application implementaion for $app", DEBUG );
-       my $client = OpenSRF::Utils::SettingsClient->new();
-       my $imp = $client->config_value("apps", $app, "implementation");
-       OpenSRF::Application::server_class($app);
-       OpenSRF::Application->application_implementation( $imp );
-       JSON->register_class_hint( name => $imp, hint => $app, type => "hash" );
-       OpenSRF::Application->application_implementation->initialize()
-               if (OpenSRF::Application->application_implementation->can('initialize'));
-
-       if( $client->config_value("server_type") !~ /fork/i  ) {
-               $self->child_init_hook();
-       }
-
-       my $con = OpenSRF::Transport::PeerHandle->retrieve;
-       if($con) {
-               $con->disconnect;
-       }
-
-       return OpenSRF::Application->application_implementation;
-}
-
-sub child_init_hook { 
-
-       $0 =~ s/master/drone/g;
-
-       if ($ENV{OPENSRF_PROFILE}) {
-               my $file = $0;
-               $file =~ s/\W/_/go;
-               eval "use Devel::Profiler output_file => '/tmp/profiler_$file.out', buffer_size => 0;";
-               if ($@) {
-                       $logger->debug("Could not load Devel::Profiler: $@",ERROR);
-               } else {
-                       $0 .= ' [PROFILING]';
-                       $logger->debug("Running under Devel::Profiler", INFO);
-               }
-       }
-
-       my $self = shift;
-
-#      $logger->transport( 
-#                      "Creating PeerHandle from UnixServer child_init_hook", INTERNAL );
-       OpenSRF::Transport::PeerHandle->construct( $self->app() );
-       $logger->transport( "PeerHandle Created from UnixServer child_init_hook", INTERNAL );
-
-       OpenSRF::Application->application_implementation->child_init
-               if (OpenSRF::Application->application_implementation->can('child_init'));
-
-       return OpenSRF::Transport::PeerHandle->retrieve;
-}
-
-sub child_finish_hook {
-    $logger->debug("attempting to call child exit handler...");
-       OpenSRF::Application->application_implementation->child_exit
-               if (OpenSRF::Application->application_implementation->can('child_exit'));
-}
-
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils.pm b/OpenSRF/src/perlmods/OpenSRF/Utils.pm
deleted file mode 100644 (file)
index 46816cb..0000000
+++ /dev/null
@@ -1,464 +0,0 @@
-package OpenSRF::Utils;
-
-=head1 NAME 
-
-OpenSRF::Utils
-
-=head1 DESCRIPTION 
-
-This is a container package for methods that are useful to derived modules.
-It has no constructor, and is generally not useful by itself... but this
-is where most of the generic methods live.
-
-=head1 METHODS 
-
-
-=cut
-
-use vars qw/@ISA $AUTOLOAD %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION/;
-push @ISA, 'Exporter';
-
-$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
-
-use Time::Local;
-use Errno;
-use POSIX;
-use FileHandle;
-#use Cache::FileCache;
-#use Storable qw(dclone);
-use Digest::MD5 qw(md5 md5_hex md5_base64);
-use Exporter;
-use DateTime;
-use DateTime::Format::ISO8601;
-use DateTime::TimeZone;
-
-our $date_parser = DateTime::Format::ISO8601->new;
-
-# This turns errors into warnings, so daemons don't die.
-#$Storable::forgive_me = 1;
-
-%EXPORT_TAGS = (
-       common          => [qw(interval_to_seconds seconds_to_interval sendmail tree_filter)],
-       daemon          => [qw(safe_fork set_psname daemonize)],
-       datetime        => [qw(clense_ISO8601 gmtime_ISO8601 interval_to_seconds seconds_to_interval)],
-);
-
-Exporter::export_ok_tags('common','daemon','datetime');  # add aa, cc and dd to @EXPORT_OK
-
-sub AUTOLOAD {
-       my $self = shift;
-       my $type = ref($self) or return undef;
-
-       my $name = $AUTOLOAD;
-       $name =~ s/.*://;   # strip fully-qualified portion
-
-       if (defined($_[0])) {
-               return $self->{$name} = shift;
-       }
-       return $self->{$name};
-}
-
-
-sub _sub_builder {
-       my $self = shift;
-       my $class = ref($self) || $self;
-       my $part = shift;
-       unless ($class->can($part)) {
-               *{$class.'::'.$part} =
-                       sub {
-                               my $self = shift;
-                               my $new_val = shift;
-                               if ($new_val) {
-                                       $$self{$part} = $new_val;
-                               }
-                               return $$self{$part};
-               };
-       }
-}
-
-sub tree_filter {
-       my $tree = shift;
-       my $field = shift;
-       my $filter = shift;
-
-       my @things = $filter->($tree);
-       for my $v ( @{$tree->$field} ){
-               push @things, $filter->($v);
-               push @things, tree_filter($v, $field, $filter);
-       }
-       return @things
-}
-
-#sub standalone_ipc_cache {
-#      my $self = shift;
-#      my $class = ref($self) || $self;
-#      my $uniquifier = shift || return undef;
-#      my $expires = shift || 3600;
-
-#      return new Cache::FileCache ( { namespace => $class.'::'.$uniquifier, default_expires_in => $expires } );
-#}
-
-sub sendmail {
-       my $self = shift;
-        my $message = shift || $self;
-
-        open SM, '|/usr/sbin/sendmail -U -t' or return 0;
-        print SM $message;
-        close SM or return 0;
-        return 1;
-}
-
-sub __strip_comments {
-       my $self = shift;
-       my $config_file = shift;
-       my ($line, @done);
-       while (<$config_file>) {
-               s/^\s*(.*)\s*$/$1/o if (lc($$self{keep_space}) ne 'true');
-               /^(.*)$/o;
-               $line .= $1;
-               # keep new lines if keep_space is true
-               if ($line =~ /^$/o && (lc($$self{keep_space}) ne 'true')) {
-                       $line = '';
-                       next;
-               }
-               if (/^([^<]+)\s*<<\s*(\w+)\s*$/o) {
-                       $line = "$1 = ";
-                       my $breaker = $2;
-                       while (<$config_file>) {
-                               chomp;
-                               last if (/^$breaker/);
-                               $line .= $_;
-                       }
-               }
-
-               if ($line =~ /^#/ && $line !~ /^#\s*include\s+/o) {
-                       $line = '';
-                       next;
-               }
-               if ($line =~ /\\$/o) {
-                       chomp $line;
-                       $line =~ s/^\s*(.*)\s*\\$/$1/o;
-                       next;
-               }
-               push @done, $line;
-               $line = '';
-       }
-       return @done;
-}
-
-
-=head2 $thing->encrypt(@stuff)
-
-Returns a one way hash (MD5) of the values appended together.
-
-=cut
-
-sub encrypt {
-       my $self = shift;
-       return md5_hex(join('',@_));
-}
-
-=head2 $utils_obj->es_time('field') OR noo_es_time($timestamp)
-
-Returns the epoch-second style timestamp for the value stored in
-$utils_obj->{field}.  Returns B<0> for an empty or invalid date stamp, and
-assumes a PostgreSQL style datestamp to be supplied.
-
-=cut
-
-sub es_time {
-       my $self = shift;
-       my $part = shift;
-       my $es_part = $part.'_ES';
-       return $$self{$es_part} if (exists($$self{$es_part}) && defined($$self{$es_part}) && $$self{$es_part});
-       if (!$$self{$part} or $$self{$part} !~ /\d+/) {
-               return 0;
-
-       }
-       my @tm = reverse($$self{$part} =~ /([\d\.]+)/og);
-       if ($tm[5] > 0) {
-               $tm[5] -= 1;
-       }
-
-        return $$self{$es_part} = noo_es_time($$self{$part});
-}
-
-=head2 noo_es_time($timestamp) (non-OO es_time)
-
-Returns the epoch-second style timestamp for the B<$timestamp> passed
-in.  Returns B<0> for an empty or invalid date stamp, and
-assumes a PostgreSQL style datestamp to be supplied.
-
-=cut
-
-sub noo_es_time {
-        my $timestamp = shift;
-
-        my @tm = reverse($timestamp =~ /([\d\.]+)/og);
-        if ($tm[5] > 0) {
-                $tm[5] -= 1;
-        }
-        return timelocal(int($tm[1]), int($tm[2]), int($tm[3]), int($tm[4]) || 1, int($tm[5]), int($tm[6]) || 2002 );
-}
-
-
-=head2 $thing->interval_to_seconds('interval') OR interval_to_seconds('interval')
-
-=head2 $thing->seconds_to_interval($seconds) OR seconds_to_interval($seconds)
-
-Returns the number of seconds for any interval passed, or the interval for the seconds.
-This is the generic version of B<interval> listed below.
-
-The interval must match the regex I</\s*\+?\s*(\d+)\s*(\w{1})\w*\s*/g>, for example
-B<2 weeks, 3 d and 1hour + 17 Months> or
-B<1 year, 5 Months, 2 weeks, 3 days and 1 hour of seconds> meaning 46148400 seconds.
-
-       my $expire_time = time() + $thing->interval_to_seconds('17h 9m');
-
-The time size indicator may be one of
-
-=over 2
-
-=item s[econd[s]]
-
-for seconds
-
-=item m[inute[s]]
-
-for minutes
-
-=item h[our[s]]
-
-for hours
-
-=item d[ay[s]]
-
-for days
-
-=item w[eek[s]]
-
-for weeks
-
-=item M[onth[s]]
-
-for months (really (365 * 1d)/12 ... that may get smarter, though)
-
-=item y[ear[s]]
-
-for years (this is 365 * 1d)
-
-=back
-
-=cut
-sub interval_to_seconds {
-       my $self = shift;
-        my $interval = shift || $self;
-
-        $interval =~ s/and/,/g;
-        $interval =~ s/,/ /g;
-
-        my $amount = 0;
-        while ($interval =~ /\s*\+?\s*(\d+)\s*(\w+)\s*/g) {
-               my ($count, $type) = ($1, $2);
-                $amount += $count if ($type eq 's');
-                $amount += 60 * $count if ($type =~ /^m(?!o)/oi);
-                $amount += 60 * 60 * $count if ($type =~ /^h/);
-                $amount += 60 * 60 * 24 * $count if ($type =~ /^d/oi);
-                $amount += 60 * 60 * 24 * 7 * $count if ($2 =~ /^w/oi);
-                $amount += ((60 * 60 * 24 * 365)/12) * $count if ($type =~ /^mo/io);
-                $amount += 60 * 60 * 24 * 365 * $count if ($type =~ /^y/oi);
-        }
-        return $amount;
-}
-
-sub seconds_to_interval {
-       my $self = shift;
-        my $interval = shift || $self;
-
-        my $limit = shift || 's';
-        $limit =~ s/^(.)/$1/o;
-
-        my ($y,$ym,$M,$Mm,$w,$wm,$d,$dm,$h,$hm,$m,$mm,$s,$string);
-        my ($year, $month, $week, $day, $hour, $minute, $second) =
-                ('year','Month','week','day', 'hour', 'minute', 'second');
-
-        if ($y = int($interval / (60 * 60 * 24 * 365))) {
-                $string = "$y $year". ($y > 1 ? 's' : '');
-                $ym = $interval % (60 * 60 * 24 * 365);
-        } else {
-                $ym = $interval;
-        }
-        return $string if ($limit eq 'y');
-
-        if ($M = int($ym / ((60 * 60 * 24 * 365)/12))) {
-                $string .= ($string ? ', ':'')."$M $month". ($M > 1 ? 's' : '');
-                $Mm = $ym % ((60 * 60 * 24 * 365)/12);
-        } else {
-                $Mm = $ym;
-        }
-        return $string if ($limit eq 'M');
-
-        if ($w = int($Mm / 604800)) {
-                $string .= ($string ? ', ':'')."$w $week". ($w > 1 ? 's' : '');
-                $wm = $Mm % 604800;
-        } else {
-                $wm = $Mm;
-        }
-        return $string if ($limit eq 'w');
-
-        if ($d = int($wm / 86400)) {
-                $string .= ($string ? ', ':'')."$d $day". ($d > 1 ? 's' : '');
-                $dm = $wm % 86400;
-        } else {
-                $dm = $wm;
-        }
-        return $string if ($limit eq 'd');
-
-        if ($h = int($dm / 3600)) {
-                $string .= ($string ? ', ' : '')."$h $hour". ($h > 1 ? 's' : '');
-                $hm = $dm % 3600;
-        } else {
-                $hm = $dm;
-        }
-        return $string if ($limit eq 'h');
-
-        if ($m = int($hm / 60)) {
-                $string .= ($string ? ', ':'')."$m $minute". ($m > 1 ? 's' : '');
-                $mm = $hm % 60;
-        } else {
-                $mm = $hm;
-        }
-        return $string if ($limit eq 'm');
-
-        if ($s = int($mm)) {
-                $string .= ($string ? ', ':'')."$s $second". ($s > 1 ? 's' : '');
-        } else {
-                $string = "0s" unless ($string);
-        }
-        return $string;
-}
-
-sub full {
-       my $self = shift;
-       $$self{empty} = 0;
-}
-
-=head2 $utils_obj->set_psname('string') OR set_psname('string')
-
-Sets the name of this process in a B<ps> listing to B<string>.
-
-
-=cut
-
-sub set_psname {
-       my $self = shift;
-       my $PS_NAME = shift || $self;
-       $0 = $PS_NAME if ($PS_NAME);
-}
-
-sub gmtime_ISO8601 {
-       my $self = shift;
-       my @date = gmtime;
-
-       my $y = $date[5] + 1900;
-       my $M = $date[4] + 1;
-       my $d = $date[3];
-       my $h = $date[2];
-       my $m = $date[1];
-       my $s = $date[0];
-
-       return sprintf('%d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d+00:00', $y, $M, $d, $h, $m, $s);
-}
-
-sub clense_ISO8601 {
-       my $self = shift;
-       my $date = shift || $self;
-       if ($date =~ /^\s*(\d{4})-?(\d{2})-?(\d{2})/o) {
-               my $new_date = "$1-$2-$3";
-
-               if ($date =~/(\d{2}):(\d{2}):(\d{2})/o) {
-                       $new_date .= "T$1:$2:$3";
-
-                       my $z;
-                       if ($date =~ /([-+]{1})([0-9]{1,2})(?::?([0-9]{1,2}))*\s*$/o) {
-                               $z = sprintf('%s%0.2d%0.2d',$1,$2,$3)
-                       } else {
-                               $z =  DateTime::TimeZone::offset_as_string(
-                                       DateTime::TimeZone
-                                               ->new( name => 'local' )
-                                               ->offset_for_datetime(
-                                                       $date_parser->parse_datetime($new_date)
-                                               )
-                               );
-                       }
-
-                       if (length($z) > 3 && index($z, ':') == -1) {
-                               substr($z,3,0) = ':';
-                               substr($z,6,0) = ':' if (length($z) > 6);
-                       }
-               
-                       $new_date .= $z;
-               } else {
-                       $new_date .= "T00:00:00";
-               }
-
-               return $new_date;
-       }
-       return $date;
-}
-
-=head2 $utils_obj->daemonize('ps_name') OR daemonize('ps_name')
-
-Turns the current process into a daemon.  B<ps_name> is optional, and is used
-as the argument to I<< set_psname() >> if passed.
-
-
-=cut
-
-sub daemonize {
-       my $self = shift;
-       my $PS_NAME = shift || $self;
-       my $pid;
-       if ($pid = safe_fork($self)) {
-               exit 0;
-       } elsif (defined($pid)) {
-               set_psname($PS_NAME);
-               chdir '/';
-               setsid;
-               return $$;
-       }
-}
-
-=head2 $utils_obj->safe_fork('ps_name') OR safe_fork('ps_name');
-
-Forks the current process in a retry loop.  B<ps_name> is optional, and is used
-as the argument to I<< set_psname() >> if passed.
-
-
-=cut
-
-sub safe_fork {
-       my $self = shift;
-       my $pid;
-
-FORK:
-       {
-               if (defined($pid = fork())) {
-                       srand(time ^ ($$ + ($$ << 15))) unless ($pid);
-                       return $pid;
-               } elsif ($! == EAGAIN) {
-                       $self->error("Can't fork()!  $!, taking 5 and trying again.") if (ref $self);
-                       sleep 5;
-                       redo FORK;
-               } else {
-                       $self->error("Can't fork()! $!") if ($! && ref($self));
-                       exit $!;
-               }
-       }
-}
-
-#------------------------------------------------------------------------------------------------------------------------------------
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/Cache.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/Cache.pm
deleted file mode 100644 (file)
index ac430bd..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-package OpenSRF::Utils::Cache;
-use strict; use warnings;
-use base qw/OpenSRF/;
-use Cache::Memcached;
-use OpenSRF::Utils::Logger qw/:level/;
-use OpenSRF::Utils::Config;
-use OpenSRF::Utils::SettingsClient;
-use OpenSRF::EX qw(:try);
-use JSON;
-
-my $log = 'OpenSRF::Utils::Logger';
-
-=head OpenSRF::Utils::Cache
-
-This class just subclasses Cache::Memcached.
-see Cache::Memcached for more options.
-
-The value passed to the call to current is the cache type
-you wish to access.  The below example sets/gets data
-from the 'user' cache.
-
-my $cache = OpenSRF::Utils::Cache->current("user");
-$cache->set( "key1", "value1" [, $expire_secs ] );
-my $val = $cache->get( "key1" );
-
-
-=cut
-
-sub DESTROY {}
-
-my %caches;
-
-# ------------------------------------------------------
-# Persist methods and method names
-# ------------------------------------------------------
-my $persist_add_slot; 
-my $persist_push_stack;
-my $persist_peek_stack;
-my $persist_destroy_slot;
-my $persist_slot_get_expire;
-my $persist_slot_find;
-
-my $max_persist_time;
-my $persist_add_slot_name                      = "opensrf.persist.slot.create_expirable";
-my $persist_push_stack_name            = "opensrf.persist.stack.push";
-my $persist_peek_stack_name            = "opensrf.persist.stack.peek";
-my $persist_destroy_slot_name          = "opensrf.persist.slot.destroy";
-my $persist_slot_get_expire_name = "opensrf.persist.slot.get_expire";
-my $persist_slot_find_name                     = "opensrf.persist.slot.find";;
-
-# ------------------------------------------------------
-
-
-# return a named cache if it exists
-sub current { 
-       my ( $class, $c_type )  = @_;
-       return undef unless $c_type;
-       return $caches{$c_type} if exists $caches{$c_type};
-       return $caches{$c_type} = $class->new( $c_type );
-}
-
-
-# create a new named memcache object.
-sub new {
-
-       my( $class, $cache_type, $persist ) = @_;
-       $cache_type ||= 'global';
-       $class = ref( $class ) || $class;
-
-       return $caches{$cache_type} 
-               if (defined $caches{$cache_type});
-
-       my $conf = OpenSRF::Utils::SettingsClient->new;
-       my $servers = $conf->config_value( cache => $cache_type => servers => 'server' );
-       $max_persist_time = $conf->config_value( cache => $cache_type => 'max_cache_time' );
-
-       if(!ref($servers)){
-               $servers = [ $servers ];
-       }
-
-       my $self = {};
-       $self->{persist} = $persist || 0;
-       $self->{memcache} = Cache::Memcached->new( { servers => $servers } ); 
-       if(!$self->{memcache}) {
-               throw OpenSRF::EX::PANIC ("Unable to create a new memcache object for $cache_type");
-       }
-
-       bless($self, $class);
-       $caches{$cache_type} = $self;
-       return $self;
-}
-
-
-
-sub put_cache {
-       my($self, $key, $value, $expiretime ) = @_;
-       return undef unless( defined $key and defined $value );
-
-       $value = JSON->perl2JSON($value);
-
-       if($self->{persist}){ _load_methods(); }
-
-       $expiretime ||= $max_persist_time;
-
-       unless( $self->{memcache}->set( $key, $value, $expiretime ) ) {
-               $log->error("Unable to store $key => [".length($value)." bytes]  in memcached server" );
-               return undef;
-       }
-
-       $log->debug("Stored $key => $value in memcached server", INTERNAL);
-
-       if($self->{"persist"}) {
-
-               my ($slot) = $persist_add_slot->run("_CACHEVAL_$key", $expiretime . "s");
-
-               if(!$slot) {
-                       # slot may already exist
-                       ($slot) = $persist_slot_find->run("_CACHEVAL_$key");
-                       if(!defined($slot)) {
-                               throw OpenSRF::EX::ERROR ("Unable to create cache slot $key in persist server" );
-                       } else {
-                               #XXX destroy the slot and rebuild it to prevent DOS
-                       }
-               }
-
-               ($slot) = $persist_push_stack->run("_CACHEVAL_$key", $value);
-
-               if(!$slot) {
-                       throw OpenSRF::EX::ERROR ("Unable to push data onto stack in persist slot _CACHEVAL_$key" );
-               }
-       }
-
-       return $key;
-}
-
-sub delete_cache {
-       my( $self, $key ) = @_;
-       if(!$key) { return undef; }
-       if($self->{persist}){ _load_methods(); }
-       $self->{memcache}->delete($key);
-       if( $self->{persist} ) {
-               $persist_destroy_slot->run("_CACHEVAL_$key");
-       }
-       return $key; 
-}
-
-sub get_cache {
-       my($self, $key ) = @_;
-
-       my $val = $self->{memcache}->get( $key );
-       return JSON->JSON2perl($val) if defined($val);
-
-       if($self->{persist}){ _load_methods(); }
-
-       # if not in memcache but we are persisting, the put it into memcache
-       if( $self->{"persist"} ) {
-               $val = $persist_peek_stack->( "_CACHEVAL_$key" );
-               if(defined($val)) {
-                       my ($expire) = $persist_slot_get_expire->run("_CACHEVAL_$key");
-                       if($expire)     {
-                               $self->{memcache}->set( $key, $val, $expire);
-                       } else {
-                               $self->{memcache}->set( $key, $val, $max_persist_time);
-                       }
-                       return JSON->JSON2perl($val);
-               } 
-       }
-       return undef;
-} 
-
-
-
-
-sub _load_methods {
-
-       if(!$persist_add_slot) {
-               $persist_add_slot = 
-                       OpenSRF::Application->method_lookup($persist_add_slot_name);
-               if(!ref($persist_add_slot)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_add_slot_name");
-               }
-       }
-
-       if(!$persist_push_stack) {
-               $persist_push_stack = 
-                       OpenSRF::Application->method_lookup($persist_push_stack_name);
-               if(!ref($persist_push_stack)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_push_stack_name");
-               }
-       }
-
-       if(!$persist_peek_stack) {
-               $persist_peek_stack = 
-                       OpenSRF::Application->method_lookup($persist_peek_stack_name);
-               if(!ref($persist_peek_stack)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_peek_stack_name");
-               }
-       }
-
-       if(!$persist_destroy_slot) {
-               $persist_destroy_slot = 
-                       OpenSRF::Application->method_lookup($persist_destroy_slot_name);
-               if(!ref($persist_destroy_slot)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_destroy_slot_name");
-               }
-       }
-       if(!$persist_slot_get_expire) {
-               $persist_slot_get_expire = 
-                       OpenSRF::Application->method_lookup($persist_slot_get_expire_name);
-               if(!ref($persist_slot_get_expire)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_slot_get_expire_name");
-               }
-       }
-       if(!$persist_slot_find) {
-               $persist_slot_find = 
-                       OpenSRF::Application->method_lookup($persist_slot_find_name);
-               if(!ref($persist_slot_find)) {
-                       throw OpenSRF::EX::PANIC ("Unable to retrieve method $persist_slot_find_name");
-               }
-       }
-}
-
-
-
-
-
-
-
-1;
-
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/Config.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/Config.pm
deleted file mode 100755 (executable)
index 359c255..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-package OpenSRF::Utils::Config::Section;
-
-no strict 'refs';
-
-use vars qw/@ISA $AUTOLOAD $VERSION/;
-push @ISA, qw/OpenSRF::Utils/;
-
-use OpenSRF::Utils (':common');
-use Net::Domain qw/hostfqdn/;
-
-$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
-
-my %SECTIONCACHE;
-my %SUBSECTION_FIXUP;
-
-#use overload '""' => \&OpenSRF::Utils::Config::dump_ini;
-
-sub SECTION {
-       my $sec = shift;
-       return $sec->__id(@_);
-}
-
-sub new {
-       my $self = shift;
-       my $class = ref($self) || $self;
-
-       $self = bless {}, $class;
-
-       my $lines = shift;
-
-       for my $line (@$lines) {
-
-               #($line) = split(/\s+\/\//, $line);
-               #($line) = split(/\s+#/, $line);
-
-               if ($line =~ /^\s*\[([^\[\]]+)\]/) {
-                       $self->_sub_builder('__id');
-                       $self->__id( $1 );
-                       next;
-               }
-
-               my ($protokey,$value,$keytype,$key);
-               if ($line =~ /^([^=\s]+)\s*=\s*(.*)/s) {
-                       ($protokey,$value) = ($1,$2);
-                       ($keytype,$key) = split(/:/,$protokey);
-               }
-
-               $key = $protokey unless ($key);
-
-               if ($keytype ne $key) {
-                       $keytype = lc $keytype;
-                       if ($keytype eq 'list') {
-                               $value = [split /\s*,\s*/, $value];
-                       } elsif ($keytype eq 'bool') {
-                               $value = do{ $value =~ /^t|y|1/i ? 1 : 0; };
-                       } elsif ($keytype eq 'interval') {
-                               $value = interval_to_seconds($value);
-                       } elsif ($keytype eq 'subsection') {
-                               if (exists $SECTIONCACHE{$value}) {
-                                       $value = $SECTIONCACHE{$value};
-                               } else {
-                                       $SUBSECTION_FIXUP{$value}{$self->SECTION} = $key ;
-                                       next;
-                               }
-                       }
-               }
-
-               $self->_sub_builder($key);
-               $self->$key($value);
-       }
-
-       no warnings;
-       if (my $parent_def = $SUBSECTION_FIXUP{$self->SECTION}) {
-               my ($parent_section, $parent_key) = each %$parent_def;
-               $SECTIONCACHE{$parent_section}->{$parent_key} = $self;
-               delete $SUBSECTION_FIXUP{$self->SECTION};
-       }
-
-       $SECTIONCACHE{$self->SECTION} = $self;
-
-       return $self;
-}
-
-package OpenSRF::Utils::Config;
-
-use vars qw/@ISA $AUTOLOAD $VERSION $OpenSRF::Utils::ConfigCache/;
-push @ISA, qw/OpenSRF::Utils/;
-
-use FileHandle;
-use OpenSRF::Utils (':common');  
-use OpenSRF::Utils::Logger;
-use Net::Domain qw/hostfqdn/;
-
-#use overload '""' => \&OpenSRF::Utils::Config::dump_ini;
-
-sub import {
-       my $class = shift;
-       my $config_file = shift;
-
-       return unless $config_file;
-
-       $class->load( config_file => $config_file);
-}
-
-sub dump_ini {
-       no warnings;
-        my $self = shift;
-        my $string;
-       my $included = 0;
-       if ($self->isa('OpenSRF::Utils::Config')) {
-               if (UNIVERSAL::isa(scalar(caller()), 'OpenSRF::Utils::Config' )) {
-                       $included = 1;
-               } else {
-                       $string = "# Main File:  " . $self->FILE . "\n\n" . $string;
-               }
-       }
-        for my $section ( ('__id', grep { $_ ne '__id' } sort keys %$self) ) {
-               next if ($section eq 'env' && $self->isa('OpenSRF::Utils::Config'));
-                if ($section eq '__id') {
-                       $string .= '['.$self->SECTION."]\n" if ($self->isa('OpenSRF::Utils::Config::Section'));
-               } elsif (ref($self->$section)) {
-                        if (ref($self->$section) =~ /ARRAY/o) {
-                                $string .= "list:$section = ". join(', ', @{$self->$section}) . "\n";
-                       } elsif (UNIVERSAL::isa($self->$section,'OpenSRF::Utils::Config::Section')) {
-                               if ($self->isa('OpenSRF::Utils::Config::Section')) {
-                                       $string .= "subsection:$section = " . $self->$section->SECTION . "\n";
-                                       next;
-                               } else {
-                                       next if ($self->$section->{__sub} && !$included);
-                                       $string .= $self->$section . "\n";
-                               }
-                        } elsif (UNIVERSAL::isa($self->$section,'OpenSRF::Utils::Config')) {
-                               $string .= $self->$section . "\n";
-                       }
-               } else {
-                       next if $section eq '__sub';
-                               $string .= "$section = " . $self->$section . "\n";
-               }
-        }
-       if ($included) {
-               $string =~ s/^/## /gm;
-               $string = "# Subfile:  " . $self->FILE . "\n#" . '-'x79 . "\n".'#include "'.$self->FILE."\"\n". $string;
-       }
-
-        return $string;
-}
-
-=head1 NAME
-OpenSRF::Utils::Config
-
-=head1 SYNOPSIS
-
-  use OpenSRF::Utils::Config;
-
-  my $config_obj = OpenSRF::Utils::Config->load( config_file   => '/config/file.cnf' );
-
-  my $attrs_href = $config_obj->attributes();
-
-  $config_obj->attributes->no_db(0);
-
-  open FH, '>'.$config_obj->FILE() . '.new';
-  print FH $config_obj;
-  close FH;
-
-
-=head1 DESCRIPTION
-
-This module is mainly used by other modules to load a configuration file.
-
-=head1 NOTES
-
-Hashrefs of sections can be returned by calling a method of the object of the same name as the section.
-They can be set by passing a hashref back to the same method.  Sections will B<NOT> be autovivicated, though.
-
-Here be a config file example, HAR!:
-
- [datasource]
- # backend=XMLRPC
- backend=DBI
- subsection:definition=devel_db
-
- [devel_db]
- dsn=dbi:Pg(RaiseError => 0, AutoCommit => 1):dbname=dcl;host=nsite-dev
- user=postgres
- pw=postgres
- #readonly=1
- [live_db]
- dsn=dbi:Pg(RaiseError => 0, AutoCommit => 1):dbname=dcl
- user=n2dcl
- pw=dclserver
- #readonly=1
-
- [devel_xmlrpc]
- subsection:definition=devel_rpc
- [logs]
- base=/var/log/nsite
- debug=debug.log
- error=error.log
- [debug]
- enabled=1
- level=ALL
- [devel_rpc]
- url=https://localhost:9000/
- proto=SSL
- SSL_cipher_list=ALL
- SSL_verify_mode=5
- SSL_use_cert=1
- SSL_key_file=client-key.pem
- SSL_cert_file=client-cert.pem
- SSL_ca_file=cacert.pem
- log_level=4
- [dirs]
- base_dir=/home/miker/cvs/NOC/monitor_core/
- cert_dir=certs/
-
-=head1 METHODS
-
-
-=cut
-
-
-$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
-
-
-=head2 OpenSRF::Utils::Config->load( config_file => '/some/config/file.cnf' )
-
-Returns a OpenSRF::Utils::Config object representing the config file that was loaded.
-The most recently loaded config file (hopefully the only one per app)
-is stored at $OpenSRF::Utils::ConfigCache. Use OpenSRF::Utils::Config::current() to get at it.
-
-
-=cut
-
-sub load {
-       my $pkg = shift;
-       $pkg = ref($pkg) || $pkg;
-
-       my %args = @_;
-
-       (my $new_pkg = $args{config_file}) =~ s/\W+/_/g;
-       $new_pkg .= "::$pkg";
-       $new_section_pkg .= "${new_pkg}::Section";
-
-       {       eval <<"                PERL";
-
-                       package $new_pkg;
-                       use base $pkg;
-                       sub section_pkg { return '$new_section_pkg'; }
-
-                       package $new_section_pkg;
-                       use base "${pkg}::Section";
-       
-               PERL
-       }
-
-       return $new_pkg->_load( %args );
-}
-
-sub _load {
-       my $pkg = shift;
-       $pkg = ref($pkg) || $pkg;
-       my $self = {@_};
-       bless $self, $pkg;
-
-       no warnings;
-       if ((exists $$self{config_file} and OpenSRF::Utils::Config->current) and (OpenSRF::Utils::Config->current->FILE eq $$self{config_file}) and (!$self->{force})) {
-               delete $$self{force};
-               return OpenSRF::Utils::Config->current();
-       }
-
-       $self->_sub_builder('__id');
-       $self->FILE($$self{config_file});
-       delete $$self{config_file};
-       return undef unless ($self->FILE);
-
-       $self->load_config();
-       $self->load_env();
-       $self->mangle_dirs();
-       $self->mangle_logs();
-
-       $OpenSRF::Utils::ConfigCache = $self unless $self->nocache;
-       delete $$self{nocache};
-       delete $$self{force};
-       return $self;
-}
-
-sub sections {
-       my $self = shift;
-       my %filters = @_;
-
-       my @parts = (grep { UNIVERSAL::isa($_,'OpenSRF::Utils::Config::Section') } values %$self);
-       if (keys %filters) {
-               my $must_match = scalar(keys %filters);
-               my @ok_parts;
-               foreach my $part (@parts) {
-                       my $part_count = 0;
-                       for my $fkey (keys %filters) {
-                               $part_count++ if ($part->$key eq $filters{$key});
-                       }
-                       push @ok_parts, $part if ($part_count == $must_match);
-               }
-               return @ok_parts;
-       }
-       return @parts;
-}
-
-sub current {
-       return $OpenSRF::Utils::ConfigCache;
-}
-
-sub FILE {
-       return shift()->__id(@_);
-}
-
-sub load_env {
-       my $self = shift;
-       my $host = hostfqdn();
-       chomp $host;
-       $$self{env} = $self->section_pkg->new;
-       $$self{env}{hostname} = $host;
-}
-
-sub mangle_logs {
-       my $self = shift;
-       return unless ($self->logs && $self->dirs && $self->dirs->log_dir);
-       for my $i ( keys %{$self->logs} ) {
-               next if ($self->logs->$i =~ /^\//);
-               $self->logs->$i($self->dirs->log_dir."/".$self->logs->$i);
-       }
-}
-
-sub mangle_dirs {
-       my $self = shift;
-       return unless ($self->dirs && $self->dirs->base_dir);
-       for my $i ( keys %{$self->dirs} ) {
-               if ( $i ne 'base_dir' ) {
-                       next if ($self->dirs->$i =~ /^\//);
-                       my $dir_tmp = $self->dirs->base_dir."/".$self->dirs->$i;
-                       $dir_tmp =~ s#//#/#go;
-                       $dir_tmp =~ s#/$##go;
-                       $self->dirs->$i($dir_tmp);
-               }
-       }
-}
-
-sub load_config {
-       my $self = shift;
-       my $config = new FileHandle $self->FILE, 'r';
-       unless ($config) {
-               OpenSRF::Utils::Logger->error("Could not open ".$self->FILE.": $!\n");
-               die "Could not open ".$self->FILE.": $!\n";
-       }
-       my @stripped_config = $self->__strip_comments($config) if (defined $config);
-
-       my $chunk = [];
-       for my $line (@stripped_config) {
-               no warnings;
-               next unless ($line);
-
-               if ($line =~ /^\s*\[/ and @$chunk) {
-                       my $section = $self->section_pkg->new($chunk);
-
-                       my $sub_name = $section->SECTION;
-                       $self->_sub_builder($sub_name);
-                       $self->$sub_name($section);
-
-                       #$self->{$section->SECTION} = $section;
-
-                       $chunk = [];
-                       push @$chunk,$line;
-                       next;
-               } 
-               if ($line =~ /^#\s*include\s+"(\S+)"\s*$/o) {
-                        my $included_file = $1;
-                       my $section = OpenSRF::Utils::Config->load(config_file => $included_file, nocache => 1);
-
-                       my $sub_name = $section->FILE;
-                       $self->_sub_builder($sub_name);
-                       $self->$sub_name($section);
-
-                       for my $subsect (keys %$section) {
-                               next if ($subsect eq '__id');
-
-                               $self->_sub_builder($subsect);
-                               $self->$subsect($$section{$subsect});
-
-                               #$self->$subsect($section->$subsect);
-                               $self->$subsect->{__sub} = 1;
-                       }
-                       next;
-               }
-
-               push @$chunk,$line;
-       }
-       my $section = $self->section_pkg->new($chunk) if (@$chunk);
-       my $sub_name = $section->SECTION;
-       $self->_sub_builder($sub_name);
-       $self->$sub_name($section);
-
-}
-
-
-#------------------------------------------------------------------------------------------------------------------------------------
-
-=head1 SEE ALSO
-
-       OpenSRF::Utils
-
-=head1 BUGS
-
-No know bugs, but report any to miker@purplefrog.com.
-
-=head1 COPYRIGHT AND LICENSING
-
-Mike Rylander, Copyright 2000-2004
-
-The OpenSRF::Utils::Config module is free software. You may distribute under the terms
-of the GNU General Public License version 2 or greater.
-
-=cut
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/LogServer.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/LogServer.pm
deleted file mode 100644 (file)
index c27f512..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-package OpenSRF::Utils::LogServer;
-use strict; use warnings;
-use base qw(OpenSRF);
-use IO::Socket::INET;
-use FileHandle;
-use OpenSRF::Utils::Config;
-use Fcntl;
-use Time::HiRes qw(gettimeofday);
-use OpenSRF::Utils::Logger;
-
-=head2 Name
-
-OpenSRF::Utils::LogServer
-
-=cut
-
-=head2 Synopsis
-
-Networ Logger
-
-=cut
-
-=head2 Description
-
-
-=cut
-
-
-
-our $config;
-our $port;
-our $bufsize = 4096;
-our $proto;
-our @file_info;
-
-
-sub DESTROY {
-       for my $file (@file_info) {
-               if( $file->handle ) {
-                       close( $file->handle );
-               }
-       }
-}
-
-
-sub serve {
-
-       $config = OpenSRF::Utils::Config->current;
-
-       unless ($config) { throw OpenSRF::EX::Config ("No suitable config found"); }
-
-       $port = $config->system->log_port;
-       $proto = $config->system->log_proto;
-
-
-       my $server = IO::Socket::INET->new(
-               LocalPort       => $port,
-               Proto                   => $proto )
-       or die "Error creating server socket : $@\n"; 
-
-
-
-       while ( 1 ) {
-               my $client = <$server>;
-               process( $client );
-       }
-
-       close( $server );
-}
-
-sub process {
-       my $client = shift;
-       my @params = split(/\|/,$client);
-       my $log = shift @params;
-
-       if( (!$log) || (!@params) ) {
-               warn "Invalid logging params: $log\n";
-               return;
-       }
-
-       # Put |'s back in since they are stripped 
-       # from the message by 'split'
-       my $message;
-       if( @params > 1 ) {
-               foreach my $param (@params) {
-                       if( $param ne $params[0] ) {
-                               $message .= "|";
-                       }
-                       $message .= $param;
-               }
-       }
-       else{ $message = "@params"; }
-
-       my @lines = split( "\n", $message );
-       my $time = format_time();
-
-       my $fh;
-
-       my ($f_obj) = grep { $_->name eq $log } @file_info;
-
-       unless( $f_obj and ($fh=$f_obj->handle) ) {
-               my $file = $config->logs->$log;
-
-               sysopen( $fh, $file, O_WRONLY|O_APPEND|O_CREAT ) 
-                       or warn "Cannot sysopen $log: $!";
-               $fh->autoflush(1);
-
-               my $obj = new OpenSRF::Utils::NetLogFile( $log, $file, $fh );
-               push @file_info, $obj;
-       }
-
-       foreach my $line (@lines) {
-               print $fh "$time $line\n" || die "$!";
-       }
-
-}
-
-sub format_time {
-       my ($s, $ms) = gettimeofday();
-       my @time = localtime( $s );
-       $ms = substr( $ms, 0, 3 );
-       my $year = $time[5] + 1900;
-       my $mon = $time[4] + 1;
-       my $day = $time[3];
-       my $hour = $time[2];
-       my $min = $time[1];
-       my $sec = $time[0];
-       $mon = "0" . "$mon" if ( length($mon) == 1 );
-       $day = "0" . "$day" if ( length($day) == 1 );
-       $hour = "0" . "$hour" if ( length($hour) == 1 );
-       $min = "0" . "$min" if (length($min) == 1 );
-       $sec = "0" . "$sec" if (length($sec) == 1 );
-
-       my $proc = $$;
-       while( length( $proc ) < 5 ) { $proc = "0" . "$proc"; }
-       return "[$year-$mon-$day $hour:$min:$sec.$ms $proc]";
-}
-
-
-package OpenSRF::Utils::NetLogFile;
-
-sub new{ return bless( [ $_[1], $_[2], $_[3] ], $_[0] ); }
-
-sub name { return $_[0]->[0]; }
-sub file { return $_[0]->[1]; }
-sub handle { return $_[0]->[2]; }
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm
deleted file mode 100644 (file)
index bbeff7a..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-package OpenSRF::Utils::Logger;
-use strict;
-use vars qw($AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
-use Exporter;
-use Unix::Syslog qw(:macros :subs);
-use base qw/OpenSRF Exporter/;
-use FileHandle;
-use Time::HiRes qw(gettimeofday);
-use OpenSRF::Utils::Config;
-use Fcntl;
-
-=head1
-
-Logger code
-
-my $logger = OpenSRF::Utils::Logger;
-$logger->error( $msg );
-
-For backwards compability, a log level may also be provided to each log
-function thereby overriding the level defined by the function.
-
-i.e. $logger->error( $msg, WARN );  # logs at log level WARN
-
-=cut
-
-@EXPORT_OK = qw/ NONE ERROR WARN INFO DEBUG INTERNAL /;
-push @EXPORT_OK, '$logger';
-
-%EXPORT_TAGS = ( level => [ qw/ NONE ERROR WARN INFO DEBUG INTERNAL / ], logger => [ '$logger' ] );
-
-my $config;                                                    # config handle
-my $loglevel;                                          # global log level
-my $logfile;                                           # log file
-my $facility;                                          # syslog facility
-my $actfac;                                                    # activity log syslog facility
-my $actfile;                                           # activity log file
-my $service = $0;                      # default service name
-my $syslog_enabled = 0;                        # is syslog enabled?
-my $act_syslog_enabled = 0;    # is syslog enabled?
-my $logfile_enabled = 1;               # are we logging to a file?
-my $act_logfile_enabled = 1;   # are we logging to a file?
-my $logdir;                                                    # log file directory
-
-our $logger = "OpenSRF::Utils::Logger";
-
-# log levels
-sub ACTIVITY   { return -1; }
-sub NONE                       { return 0;     }
-sub ERROR              { return 1;     }
-sub WARN                       { return 2;     }
-sub INFO                       { return 3;     }
-sub DEBUG              { return 4;     }
-sub INTERNAL   { return 5;     }
-sub ALL                        { return 100; }
-
-my $isclient;  # true if we control the osrf_xid
-
-# load up our config options
-sub set_config {
-
-       return if defined $config;
-
-       $config = OpenSRF::Utils::Config->current;
-       if( !defined($config) ) {
-               $loglevel = INFO();
-               warn "*** Logger found no config.  Using STDERR ***\n";
-       }
-
-       $loglevel =  $config->bootstrap->debug; 
-       if($loglevel =~ /error/i){ $loglevel = ERROR(); }
-       elsif($loglevel =~ /warn/i){ $loglevel = WARN(); }
-       elsif($loglevel =~ /info/i){ $loglevel = INFO(); }
-       elsif($loglevel =~ /debug/i){ $loglevel = DEBUG(); }
-       elsif($loglevel =~ /internal/i){ $loglevel = INTERNAL(); }
-       else{$loglevel= INFO(); }
-
-       my $logdir = $config->bootstrap->log_dir;
-
-       $logfile = $config->bootstrap->logfile;
-       if($logfile =~ /^syslog/) {
-               $syslog_enabled = 1;
-               $logfile_enabled = 0;
-               $logfile =~ s/^syslog:?//;
-               $facility = $logfile;
-               $logfile = undef;
-               $facility = _fac_to_const($facility);
-               openlog($service, 0, $facility);
-
-       } else { $logfile = "$logdir/$logfile"; }
-
-       $actfile = $config->bootstrap->actlog;
-       if($actfile =~ /^syslog/) {
-               $act_syslog_enabled = 1;
-               $act_logfile_enabled = 0;
-               $actfile =~ s/^syslog:?//;
-               $actfac = $actfile || "local1";
-               $actfile = undef;
-               $actfac = _fac_to_const($actfac);
-
-       } else { $actfile = "$logdir/$actfile"; }
-
-       $isclient = (OpenSRF::Utils::Config->current->bootstrap->client =~ /^true$/iog) ?  1 : 0;
-}
-
-sub _fac_to_const {
-       my $name = shift;
-       return LOG_LOCAL0 unless $name;
-       return LOG_LOCAL0 if $name =~ /local0/i;
-       return LOG_LOCAL1 if $name =~ /local1/i;
-       return LOG_LOCAL2 if $name =~ /local2/i;
-       return LOG_LOCAL3 if $name =~ /local3/i;
-       return LOG_LOCAL4 if $name =~ /local4/i;
-       return LOG_LOCAL5 if $name =~ /local5/i;
-       return LOG_LOCAL6 if $name =~ /local6/i;
-       return LOG_LOCAL7 if $name =~ /local7/i;
-       return LOG_LOCAL0;
-}
-
-sub is_syslog {
-       set_config();
-       return $syslog_enabled;
-}
-
-sub is_act_syslog {
-       set_config();
-       return $act_syslog_enabled;
-}
-
-sub is_filelog {
-       set_config();
-       return $logfile_enabled;
-}
-
-sub is_act_filelog {
-       set_config();
-       return $act_logfile_enabled;
-}
-
-sub set_service {
-       my( $self, $svc ) = @_;
-       $service = $svc;        
-       if( is_syslog() ) {
-               closelog();
-               openlog($service, 0, $facility);
-       }
-}
-
-sub error {
-       my( $self, $msg, $level ) = @_;
-       $level = ERROR() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-sub warn {
-       my( $self, $msg, $level ) = @_;
-       $level = WARN() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-sub info {
-       my( $self, $msg, $level ) = @_;
-       $level = INFO() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-sub debug {
-       my( $self, $msg, $level ) = @_;
-       $level = DEBUG() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-sub internal {
-       my( $self, $msg, $level ) = @_;
-       $level = INTERNAL() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-sub activity {
-       my( $self, $msg ) = @_;
-       _log_message( $msg, ACTIVITY() );
-}
-
-# for backward compability
-sub transport {
-       my( $self, $msg, $level ) = @_;
-       $level = DEBUG() unless defined ($level);
-       _log_message( $msg, $level );
-}
-
-
-# ----------------------------------------------------------------------
-# creates a new xid if necessary
-# ----------------------------------------------------------------------
-my $osrf_xid = '';
-my $osrf_xid_inc = 0;
-sub mk_osrf_xid {
-   return unless $isclient;
-   $osrf_xid_inc++;
-   return $osrf_xid = "$^T${$}$osrf_xid_inc";
-}
-
-sub set_osrf_xid { 
-   return if $isclient; # if we're a client, we control our xid
-   $osrf_xid = $_[1]; 
-}
-
-sub get_osrf_xid { return $osrf_xid; }
-# ----------------------------------------------------------------------
-
-   
-sub _log_message {
-       my( $msg, $level ) = @_;
-       return if $level > $loglevel;
-
-       my $l; my $n; 
-       my $fac = $facility;
-
-       if ($level == ERROR())                  {$l = LOG_ERR; $n = "ERR "; }
-       elsif ($level == WARN())                {$l = LOG_WARNING; $n = "WARN"; }
-       elsif ($level == INFO())                {$l = LOG_INFO; $n = "INFO"; }  
-       elsif ($level == DEBUG())               {$l = LOG_DEBUG; $n = "DEBG"; }
-       elsif ($level == INTERNAL())    {$l = LOG_DEBUG; $n = "INTL"; }
-       elsif ($level == ACTIVITY())    {$l = LOG_INFO; $n = "ACT"; $fac = $actfac; }
-
-       my( undef, $file, $line_no ) = caller(1);
-   $file =~ s#/.*/##og;
-
-       # help syslog with the formatting
-       $msg =~ s/\%/\%\%/gso if( is_act_syslog() or is_syslog() );
-
-       $msg = "[$n:"."$$".":$file:$line_no:$osrf_xid] $msg";
-
-       $msg = substr($msg, 0, 1536); 
-
-       if( $level == ACTIVITY() ) {
-               if( is_act_syslog() ) { syslog( $fac | $l, $msg ); } 
-               elsif( is_act_filelog() ) { _write_file( $msg, 1 ); }
-
-       } else {
-               if( is_syslog() ) { syslog( $fac | $l, $msg ); }
-               elsif( is_filelog() ) { _write_file($msg); }
-       }
-}
-
-
-sub _write_file {
-       my( $msg, $isact) = @_;
-       my $file = $logfile;
-       $file = $actfile if $isact;
-       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);  
-       $year += 1900; $mon += 1;
-       sysopen( SINK, $file, O_NONBLOCK|O_WRONLY|O_APPEND|O_CREAT ) 
-               or die "Cannot sysopen $logfile: $!";
-       binmode(SINK, ':utf8');
-       print SINK "[$year-$mon-$mday $hour:$min:$sec] $service $msg\n";
-       close( SINK );
-}
-
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/SettingsClient.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/SettingsClient.pm
deleted file mode 100755 (executable)
index ab936f3..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-use strict; use warnings;
-package OpenSRF::Utils::SettingsClient;
-use OpenSRF::Utils::SettingsParser;
-use OpenSRF::System;
-use OpenSRF::AppSession;
-use OpenSRF::Utils::Config;
-use OpenSRF::EX qw(:try);
-
-use vars qw/$host_config/;
-
-
-sub new {return bless({},shift());}
-my $session;
-$host_config = undef;
-
-my $we_cache = 1;
-sub set_cache {
-       my($self, $val) = @_;
-       if(defined($val)) { $we_cache = $val; }
-}
-
-sub has_config {
-       if($host_config) { return 1; }
-       return 0;
-}
-
-
-# ------------------------------------
-# utility method for grabbing config info
-sub config_value {
-       my($self,@keys) = @_;
-
-
-       my $bsconfig = OpenSRF::Utils::Config->current;
-       die "No bootstrap config exists.  Have you bootstrapped?\n" unless $bsconfig;
-       my $host = $bsconfig->env->hostname;
-
-       if($we_cache) {
-               if(!$host_config) { grab_host_config($host); }
-       } else {
-               grab_host_config($host);
-       }
-
-       if(!$host_config) {
-               throw OpenSRF::EX::Config ("Unable to retrieve host config for $host" );
-       }
-
-       my $hash = $host_config;
-
-       # XXX TO DO, check local config 'version', 
-       # call out to settings server when necessary....
-       try {
-               for my $key (@keys) {
-                       if(!ref($hash) eq 'HASH'){
-                               return undef;
-                       }
-                       $hash = $hash->{$key};
-               }
-
-       } catch Error with {
-               my $e = shift;
-               throw OpenSRF::EX::Config ("No Config information for @keys : $e : $@");
-       };
-
-       return $hash;
-
-}
-
-
-# XXX make smarter and more robust...
-sub grab_host_config {
-
-       my $host = shift;
-
-       $session = OpenSRF::AppSession->create( "opensrf.settings" ) unless $session;
-       my $bsconfig = OpenSRF::Utils::Config->current;
-
-       my $resp;
-       my $req;
-       try {
-
-               if( ! ($session->connect()) ) {die "Settings Connect timed out\n";}
-               $req = $session->request( "opensrf.settings.host_config.get", $host );
-               $resp = $req->recv( timeout => 10 );
-
-       } catch OpenSRF::EX with {
-
-               if( ! ($session->connect()) ) {die "Settings Connect timed out\n";}
-               $req = $session->request( "opensrf.settings.default_config.get" );
-               $resp = $req->recv( timeout => 10 );
-
-       } catch Error with {
-
-               my $e = shift;
-               warn "Connection to Settings Failed  $e : $@ ***\n";
-               die $e;
-
-       } otherwise {
-
-               my $e = shift;
-               warn "Settings Retrieval Failed  $e : $@ ***\n";
-               die $e;
-       };
-
-       if(!$resp) {
-               warn "No Response from settings server...going to sleep\n";
-               sleep;
-       }
-
-       if( $resp && UNIVERSAL::isa( $resp, "OpenSRF::EX" ) ) {
-               throw $resp;
-       }
-
-       $host_config = $resp->content();
-       $req->finish();
-       $session->disconnect();
-       $session->finish;
-       $session->kill_me();
-}
-
-
-
-1;
diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/SettingsParser.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/SettingsParser.pm
deleted file mode 100755 (executable)
index 5e280e0..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-use strict; use warnings;
-package OpenSRF::Utils::SettingsParser;
-use OpenSRF::Utils::Config;
-use OpenSRF::EX qw(:try);
-
-
-
-use XML::LibXML;
-
-sub DESTROY{}
-our $log = 'OpenSRF::Utils::Logger';
-my $parser;
-my $doc;
-
-sub new { return bless({},shift()); }
-
-
-# returns 0 if the config file could not be found or if there is a parse error
-# returns 1 if successful
-sub initialize {
-
-       my ($self,$bootstrap_config) = @_;
-       return 0 unless($self and $bootstrap_config);
-
-       $parser = XML::LibXML->new();
-       $parser->keep_blanks(0);
-       try {
-               $doc = $parser->parse_file( $bootstrap_config );
-       } catch Error with {
-               return 0;
-       };
-       return 1;
-}
-
-sub _get { _get_overlay(@_) }
-
-sub _get_overlay {
-       my( $self, $xpath ) = @_;
-       my @nodes = $doc->documentElement->findnodes( $xpath );
-       
-       my $base = XML2perl(shift(@nodes));
-       my @overlays;
-       for my $node (@nodes) {
-               push @overlays, XML2perl($node);
-       }
-
-       for my $ol ( @overlays ) {
-               $base = merge_perl($base, $ol);
-       }
-       
-       return $base;
-}
-
-sub _get_all {
-       my( $self, $xpath ) = @_;
-       my @nodes = $doc->documentElement->findnodes( $xpath );
-       
-       my @overlays;
-       for my $node (@nodes) {
-               push @overlays, XML2perl($node);
-       }
-
-       return \@overlays;
-}
-
-sub merge_perl {
-       my $base = shift;
-       my $ol = shift;
-
-       if (ref($ol)) {
-               if (ref($ol) eq 'HASH') {
-                       for my $key (keys %$ol) {
-                               if (ref($$ol{$key}) and ref($$ol{$key}) eq ref($$base{$key})) {
-                                       merge_perl($$base{$key}, $$ol{$key});
-                               } else {
-                                       $$base{$key} = $$ol{$key};
-                               }
-                       }
-               } else {
-                       for my $key (0 .. scalar(@$ol) - 1) {
-                               if (ref($$ol[$key]) and ref($$ol[$key]) eq ref($$base[$key])) {
-                                       merge_perl($$base[$key], $$ol[$key]);
-                               } else {
-                                       $$base[$key] = $$ol[$key];
-                               }
-                       }
-               }
-       } else {
-               $base = $ol;
-       }
-
-       return $base;
-}
-
-
-sub XML2perl {
-       my $node = shift;
-       my %output;
-
-       return undef unless($node);
-
-       for my $attr ( ($node->attributes()) ) {
-               next unless($attr);
-               $output{$attr->nodeName} = $attr->value;
-       }
-
-       my @kids = $node->childNodes;
-       if (@kids == 1 && $kids[0]->nodeType == 3) {
-                       return $kids[0]->textContent;
-       } else {
-               for my $kid ( @kids ) {
-                       next if ($kid->nodeName eq 'comment');
-                       if (exists $output{$kid->nodeName}) {
-                               if (ref $output{$kid->nodeName} ne 'ARRAY') {
-                                       $output{$kid->nodeName} = [$output{$kid->nodeName}, XML2perl($kid)];
-                               } else {
-                                       push @{$output{$kid->nodeName}}, XML2perl($kid);
-                               }
-                               next;
-                       }
-                       $output{$kid->nodeName} = XML2perl($kid);
-               }
-       }
-
-       return \%output;
-}
-
-
-# returns the full config hash for a given server
-sub get_server_config {
-       my( $self, $server ) = @_;
-       my $xpath = "/opensrf/default|/opensrf/hosts/$server";
-       return $self->_get( $xpath );
-}
-
-sub get_default_config {
-       my( $self, $server ) = @_;
-       my $xpath = "/opensrf/default";
-       return $self->_get( $xpath );
-}
-
-sub get_bootstrap_config {
-       my( $self ) = @_;
-       my $xpath = "/opensrf/bootstrap";
-       return $self->_get( $xpath );
-}
-
-sub get_router_config {
-       my( $self, $router ) = @_;
-       my $xpath = "/opensrf/routers/$router";
-       return $self->_get($xpath );
-}
-
-
-
-
-1;
diff --git a/OpenSRF/src/python/osrf/__init__.py b/OpenSRF/src/python/osrf/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/OpenSRF/src/python/osrf/conf.py b/OpenSRF/src/python/osrf/conf.py
deleted file mode 100644 (file)
index 34e8df3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-
-from osrf.utils import *
-from osrf.ex import *
-
-class osrfConfig(object):
-       """Loads and parses the bootstrap config file"""
-
-       config = None
-
-       def __init__(self, file=None):
-               self.file = file        
-               self.data = {}
-
-       def parseConfig(self,file=None):
-               self.data = osrfXMLFileToObject(file or self.file)
-               osrfConfig.config = self
-       
-       def getValue(self, key, idx=None):
-               val = osrfObjectFindPath(self.data, key, idx)
-               if not val:
-                       raise osrfConfigException("Config value not found: " + key)
-               return val
-
-
-def osrfConfigValue(key, idx=None):
-       """Returns a bootstrap config value.
-
-       key -- A string representing the path to the value in the config object
-               e.g.  "domains.domain", "username"
-       idx -- Optional array index if the searched value is an array member
-       """
-       return osrfConfig.config.getValue(key, idx)
-                               
diff --git a/OpenSRF/src/python/osrf/const.py b/OpenSRF/src/python/osrf/const.py
deleted file mode 100644 (file)
index eacf479..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-#
-# Collection of global constants
-# -----------------------------------------------------------------------
-
-# -----------------------------------------------------------------------
-# log levels
-# -----------------------------------------------------------------------
-OSRF_LOG_ERR   = 1
-OSRF_LOG_WARN  = 2
-OSRF_LOG_INFO  = 3
-OSRF_LOG_DEBUG = 4
-OSRF_LOG_INTERNAL = 5
-
-# -----------------------------------------------------------------------
-# Session states
-# -----------------------------------------------------------------------
-OSRF_APP_SESSION_CONNECTED    = 0
-OSRF_APP_SESSION_CONNECTING   = 1
-OSRF_APP_SESSION_DISCONNECTED = 2
-
-# -----------------------------------------------------------------------
-# OpenSRF message types
-# -----------------------------------------------------------------------
-OSRF_MESSAGE_TYPE_REQUEST = 'REQUEST'
-OSRF_MESSAGE_TYPE_STATUS  = 'STATUS' 
-OSRF_MESSAGE_TYPE_RESULT  = 'RESULT'
-OSRF_MESSAGE_TYPE_CONNECT = 'CONNECT'
-OSRF_MESSAGE_TYPE_DISCONNECT = 'DISCONNECT'
-
-# -----------------------------------------------------------------------
-# OpenSRF message statuses
-# -----------------------------------------------------------------------
-OSRF_STATUS_CONTINUE                 = 100
-OSRF_STATUS_OK                       = 200
-OSRF_STATUS_ACCEPTED                 = 202
-OSRF_STATUS_COMPLETE                 = 205
-OSRF_STATUS_REDIRECTED               = 307
-OSRF_STATUS_BADREQUEST               = 400
-OSRF_STATUS_UNAUTHORIZED             = 401
-OSRF_STATUS_FORBIDDEN                = 403
-OSRF_STATUS_NOTFOUND                 = 404
-OSRF_STATUS_NOTALLOWED               = 405
-OSRF_STATUS_TIMEOUT                  = 408
-OSRF_STATUS_EXPFAILED                = 417
-OSRF_STATUS_INTERNALSERVERERROR      = 500
-OSRF_STATUS_NOTIMPLEMENTED           = 501
-OSRF_STATUS_VERSIONNOTSUPPORTED      = 505
-
-
-# -----------------------------------------------------------------------
-# Some well-known services
-# -----------------------------------------------------------------------
-OSRF_APP_SETTINGS = 'opensrf.settings'
-OSRF_APP_MATH = 'opensrf.math'
-
-
-# where do we find the settings config
-OSRF_METHOD_GET_HOST_CONFIG = 'opensrf.settings.host_config.get'
-
-
diff --git a/OpenSRF/src/python/osrf/ex.py b/OpenSRF/src/python/osrf/ex.py
deleted file mode 100644 (file)
index 4c160f3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-#
-# This modules define the exception classes.  In general, an 
-# exception is little more than a name.
-# -----------------------------------------------------------------------
-
-class osrfException(Exception):
-       """Root class for exceptions."""
-       def __init__(self, info=None):
-               self.info = info;
-       def __str__(self):
-               return self.info
-
-
-class osrfNetworkException(osrfException):
-       def __str__(self):
-               str = "\nUnable to communicate with the OpenSRF network"
-               if self.info:
-                       str = str + '\n' + repr(self.info)
-               return str
-
-class osrfProtocolException(osrfException):
-       """Raised when something happens during opensrf network stack processing."""
-       pass
-
-class osrfServiceException(osrfException):
-       """Raised when there was an error communicating with a remote service."""
-       pass
-
-class osrfConfigException(osrfException):
-       """Invalid config option requested."""
-       pass
-
-class osrfNetworkObjectException(osrfException):
-       pass
-       
-class osrfJSONParseException(osrfException):
-       """Raised when a JSON parsing error occurs."""
-       pass
-
-
-
diff --git a/OpenSRF/src/python/osrf/json.py b/OpenSRF/src/python/osrf/json.py
deleted file mode 100644 (file)
index 826e6b9..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-
-import simplejson, types, cjson
-
-JSON_PAYLOAD_KEY = '__p'
-JSON_CLASS_KEY = '__c'
-
-class osrfNetworkObject(object):
-    """Base class for serializable network objects."""
-    def getData(self):
-        """Returns a dict of data contained by this object"""
-        return self.data
-
-
-class __unknown(osrfNetworkObject):
-    """Default class for un-registered network objects."""
-    def __init__(self, data=None):
-        self.data = data
-
-setattr(__unknown,'__keys', [])
-setattr(osrfNetworkObject,'__unknown', __unknown)
-
-
-def osrfNetworkRegisterHint(hint, keys, type='hash'):
-    """Register a network hint.  
-    
-        This creates a new class at osrfNetworkObject.<hint> with 
-        methods for accessing/mutating the object's data.  
-        Method names will match the names found in the keys array
-
-        hint - The hint name to encode with the object
-        type - The data container type.  
-        keys - An array of data keys.  If type is an 'array', the order of
-        the keys will determine how the data is accessed
-    """
-
-    # XXX there must be a cleaner way to do this via the python API
-
-    estr = "class %s(osrfNetworkObject):\n" % hint
-    estr += "\tdef __init__(self, data=None):\n"
-    estr += "\t\tself.data = data\n"
-    estr += "\t\tif data:\n"
-
-    if type == 'hash': 
-        estr += "\t\t\tpass\n"
-    else:
-        # we have to make sure the array is large enough    
-        estr += "\t\t\twhile len(data) < %d:\n" % len(keys)
-        estr += "\t\t\t\tdata.append(None)\n"
-
-    estr += "\t\telse:\n"
-
-    if type == 'array':
-        estr += "\t\t\tself.data = []\n"
-        estr += "\t\t\tfor i in range(%s):\n" % len(keys)
-        estr += "\t\t\t\tself.data.append(None)\n"
-        for i in range(len(keys)):
-            estr += "\tdef %s(self, *args):\n"\
-                        "\t\tif len(args) != 0:\n"\
-                        "\t\t\tself.data[%s] = args[0]\n"\
-                        "\t\treturn self.data[%s]\n" % (keys[i], i, i)
-
-    if type == 'hash':
-        estr += "\t\t\tself.data = {}\n"
-        estr += "\t\t\tfor i in %s:\n" % str(keys)
-        estr += "\t\t\t\tself.data[i] = None\n"
-        for i in keys:
-            estr += "\tdef %s(self, *args):\n"\
-                        "\t\tif len(args) != 0:\n"\
-                        "\t\t\tself.data['%s'] = args[0]\n"\
-                        "\t\tval = None\n"\
-                        "\t\ttry: val = self.data['%s']\n"\
-                        "\t\texcept: return None\n"\
-                        "\t\treturn val\n" % (i, i, i)
-
-    estr += "setattr(osrfNetworkObject, '%s', %s)\n" % (hint,hint)
-    estr += "setattr(osrfNetworkObject.%s, '__keys', keys)" % hint
-    exec(estr)
-    
-        
-
-# -------------------------------------------------------------------
-# Define the custom object parsing behavior 
-# -------------------------------------------------------------------
-def __parseNetObject(obj):
-    hint = None
-    #islist = False
-    try:
-        hint = obj[JSON_CLASS_KEY]
-        obj = obj[JSON_PAYLOAD_KEY]
-    except: pass
-    if isinstance(obj,list):
-        #islist = True
-        for i in range(len(obj)):
-            obj[i] = __parseNetObject(obj[i])
-    else: 
-        if isinstance(obj,dict):
-            for k,v in obj.iteritems():
-                obj[k] = __parseNetObject(v)
-
-    if hint: # Now, "bless" the object into an osrfNetworkObject
-        estr = 'obj = osrfNetworkObject.%s(obj)' % hint
-        try:
-            exec(estr)
-        except AttributeError:
-            # this object has not been registered, shove it into the default container
-            obj = osrfNetworkObject.__unknown(obj)
-
-    return obj;
-
-
-# -------------------------------------------------------------------
-# Define the custom object encoding behavior 
-# -------------------------------------------------------------------
-class osrfJSONNetworkEncoder(simplejson.JSONEncoder):
-    def default(self, obj):
-        if isinstance(obj, osrfNetworkObject):
-            return { 
-                JSON_CLASS_KEY: obj.__class__.__name__,
-                JSON_PAYLOAD_KEY: self.default(obj.getData())
-            }   
-        return obj
-
-
-def osrfObjectToJSON(obj):
-    """Turns a python object into a wrapped JSON object"""
-    return simplejson.dumps(obj, cls=osrfJSONNetworkEncoder)
-
-
-def osrfJSONToObject(json):
-    """Turns a JSON string into python objects"""
-    #obj = simplejson.loads(json)
-    obj = None
-    try:
-        obj = cjson.decode(json)
-    except Exception:
-        # cjson is more finicky, if it dies, try simplejson
-        obj = simplejson.loads(json)
-    return __parseNetObject(obj)
-
-def osrfParseJSONRaw(json):
-    """Parses JSON the old fashioned way."""
-    return simplejson.loads(json)
-
-def osrfToJSONRaw(obj):
-    """Stringifies an object as JSON with no additional logic."""
-    return simplejson.dumps(obj)
-
-def __tabs(t):
-    r=''
-    for i in range(t): r += '   '
-    return r
-
-def osrfDebugNetworkObject(obj, t=0):
-    """Returns a debug string for a given object.
-
-    If it's an osrfNetworkObject and has registered keys, key/value p
-    pairs are returned.  Otherwise formatted JSON is returned"""
-
-    s = ''
-    if isinstance(obj, osrfNetworkObject) and len(obj.__keys):
-        obj.__keys.sort()
-
-        for k in obj.__keys:
-
-            key = k
-            while len(key) < 24: key += '.' # pad the names to make the values line up somewhat
-            val = getattr(obj, k)()
-
-            subobj = val and not (isinstance(val,unicode) or isinstance(val,str) or\
-                    isinstance(val, int) or isinstance(val, float) or isinstance(val, long))
-
-
-            s += __tabs(t) + key + ' '
-
-            if subobj:
-                s += '\n'
-                val = osrfDebugNetworkObject(val, t+1)
-
-            s += str(val)
-
-            if not subobj: s += '\n'
-
-    else:
-        s = osrfFormatJSON(osrfObjectToJSON(obj))
-    return s
-
-def osrfFormatJSON(json):
-    """JSON pretty-printer"""
-    r = ''
-    t = 0
-    instring = False
-    inescape = False
-    done = False
-
-    for c in json:
-
-        done = False
-        if (c == '{' or c == '[') and not instring:
-            t += 1
-            r += c + '\n' + __tabs(t)
-            done = True
-
-        if (c == '}' or c == ']') and not instring:
-            t -= 1
-            r += '\n' + __tabs(t) + c
-            done = True
-
-        if c == ',' and not instring:
-            r += c + '\n' + __tabs(t)
-            done = True
-
-        if c == '"' and not inescape:
-            instring = not instring
-
-        if inescape: 
-            inescape = False
-
-        if c == '\\':
-            inescape = True
-
-        if not done:
-            r += c
-
-    return r
-
-    
diff --git a/OpenSRF/src/python/osrf/log.py b/OpenSRF/src/python/osrf/log.py
deleted file mode 100644 (file)
index 083d513..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from syslog import *
-import traceback, sys, os, re
-from osrf.const import *
-
-loglevel = 4
-
-def osrfInitLog(level, facility=None, file=None):
-       """Initialize the logging subsystem."""
-       global loglevel
-       if facility: osrfInitSyslog(facility, level)
-       loglevel = level
-       syslog(LOG_DEBUG, "syslog initialized")
-
-
-# -----------------------------------------------------------------------
-# Define wrapper functions for the log levels
-# -----------------------------------------------------------------------
-def osrfLogInternal(s): __osrfLog(OSRF_LOG_INTERNAL,s)
-def osrfLogDebug(s): __osrfLog(OSRF_LOG_DEBUG,s)
-def osrfLogInfo(s): __osrfLog(OSRF_LOG_INFO,s)
-def osrfLogWarn(s): __osrfLog(OSRF_LOG_WARN,s)
-def osrfLogErr(s): __osrfLog(OSRF_LOG_ERR,s)
-
-
-frgx = re.compile('/.*/')
-
-def __osrfLog(level, msg):
-       """Builds the log message and passes the message off to the logger."""
-       global loglevel
-       if int(level) > int(loglevel): return
-
-       # find the caller info for logging the file and line number
-       tb = traceback.extract_stack(limit=3)
-       tb = tb[0]
-       lvl = 'DEBG'
-       slvl = LOG_DEBUG
-
-       if level == OSRF_LOG_INTERNAL: lvl = 'INT '; slvl=LOG_DEBUG
-       if level == OSRF_LOG_INFO: lvl = 'INFO'; slvl=LOG_INFO
-       if level == OSRF_LOG_WARN: lvl = 'WARN'; slvl=LOG_WARNING
-       if level == OSRF_LOG_ERR:  lvl = 'ERR '; slvl=LOG_ERR
-
-       file = frgx.sub('',tb[0])
-       msg = '[%s:%d:%s:%s] %s' % (lvl, os.getpid(), file, tb[1], msg)
-       syslog(slvl, msg)
-
-       if level == OSRF_LOG_ERR:
-               sys.stderr.write(msg + '\n')
-
-
-def osrfInitSyslog(facility, level):
-       """Connect to syslog and set the logmask based on the level provided."""
-
-       level = int(level)
-
-       if facility == 'local0': facility = LOG_LOCAL0
-       if facility == 'local1': facility = LOG_LOCAL1
-       if facility == 'local2': facility = LOG_LOCAL2
-       if facility == 'local3': facility = LOG_LOCAL3
-       if facility == 'local4': facility = LOG_LOCAL4
-       if facility == 'local5': facility = LOG_LOCAL5
-       if facility == 'local6': facility = LOG_LOCAL6
-       # XXX add other facility maps if necessary
-       openlog(sys.argv[0], 0, facility)
-
-       # this is redundant...
-       mask = LOG_UPTO(LOG_ERR)
-       if level >= 1: mask |= LOG_MASK(LOG_WARNING)
-       if level >= 2: mask |= LOG_MASK(LOG_NOTICE)
-       if level >= 3: mask |= LOG_MASK(LOG_INFO)
-       if level >= 4: mask |= LOG_MASK(LOG_DEBUG)
-       setlogmask(mask)
-
diff --git a/OpenSRF/src/python/osrf/net.py b/OpenSRF/src/python/osrf/net.py
deleted file mode 100644 (file)
index 5664761..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-
-from pyxmpp.jabber.client import JabberClient
-from pyxmpp.message import Message
-from pyxmpp.jid import JID
-from socket import gethostname
-from osrf.log import *
-import os, time
-import logging
-
-# - if you need raw jabber logs
-#logger=logging.getLogger()
-#logger.addHandler(logging.StreamHandler())
-#logger.addHandler(logging.FileHandler('j.log'))
-#logger.setLevel(logging.DEBUG)
-
-__network = None
-def osrfSetNetworkHandle(handle):
-       """Sets the global network connection handle."""
-       global __network
-       __network = handle
-
-def osrfGetNetworkHandle():
-       """Returns the global network connection handle."""
-       global __network
-       return __network
-
-
-class osrfNetworkMessage(object):
-       """Network message
-
-       attributes:
-
-       sender - message sender
-       to - message recipient
-       body - the body of the message
-       thread - the message thread
-       """
-
-       def __init__(self, message=None, **args):
-               if message:
-                       self.body = message.get_body()
-                       self.thread = message.get_thread()
-                       self.to = message.get_to()
-                       if message.xmlnode.hasProp('router_from') and message.xmlnode.prop('router_from') != '':
-                               self.sender = message.xmlnode.prop('router_from')
-                       else: self.sender = message.get_from().as_utf8()
-               else:
-                       if args.has_key('sender'): self.sender = args['sender']
-                       if args.has_key('to'): self.to = args['to']
-                       if args.has_key('body'): self.body = args['body']
-                       if args.has_key('thread'): self.thread = args['thread']
-
-
-class osrfNetwork(JabberClient):
-       def __init__(self, **args):
-               self.isconnected = False
-
-               # Create a unique jabber resource
-               resource = 'osrf_client'
-               if args.has_key('resource'):
-                       resource = args['resource']
-               resource += '_' + gethostname()+':'+ str(os.getpid()) 
-               self.jid = JID(args['username'], args['host'], resource)
-
-               osrfLogDebug("initializing network with JID %s and host=%s, port=%s, username=%s" % 
-                       (self.jid.as_utf8(), args['host'], args['port'], args['username']))
-
-               #initialize the superclass
-               JabberClient.__init__(self, self.jid, args['password'], args['host'])
-               self.queue = []
-
-       def connect(self):
-               JabberClient.connect(self)
-               while not self.isconnected:
-                       stream = self.get_stream()
-                       act = stream.loop_iter(10)
-                       if not act: self.idle()
-
-       def setRecvCallback(self, func):
-               """The callback provided is called when a message is received.
-               
-                       The only argument to the function is the received message. """
-               self.recvCallback = func
-
-       def session_started(self):
-               osrfLogInfo("Successfully connected to the opensrf network")
-               self.authenticated()
-               self.stream.set_message_handler("normal",self.message_received)
-               self.isconnected = True
-
-       def send(self, message):
-               """Sends the provided network message."""
-               osrfLogInternal("jabber sending to %s: %s" % (message.to, message.body))
-               msg = Message(None, None, message.to, None, None, None, message.body, message.thread)
-               self.stream.send(msg)
-       
-       def message_received(self, stanza):
-               """Handler for received messages."""
-               osrfLogInternal("jabber received a message of type %s" % stanza.get_type())
-               if stanza.get_type()=="headline":
-                       return True
-               # check for errors
-               osrfLogInternal("jabber received message from %s : %s" 
-                       % (stanza.get_from().as_utf8(), stanza.get_body()))
-               self.queue.append(osrfNetworkMessage(stanza))
-               return True
-
-       def recv(self, timeout=120):
-               """Attempts to receive a message from the network.
-
-               timeout - max number of seconds to wait for a message.  
-               If no message is received in 'timeout' seconds, None is returned. """
-
-               msg = None
-               if len(self.queue) == 0:
-                       while timeout >= 0 and len(self.queue) == 0:
-                               starttime = time.time()
-                               osrfLogInternal("going into stream loop at " + str(starttime))
-                               act = self.get_stream().loop_iter(timeout)
-                               endtime = time.time() - starttime
-                               timeout -= endtime
-                               osrfLogInternal("exiting stream loop after %s seconds" % str(endtime))
-                               osrfLogInternal("act = %s : queue length = %d" % (act, len(self.queue)) )
-                               if not act: self.idle()
-
-               # if we've acquired a message, handle it
-               if len(self.queue) > 0:
-                       self.recvCallback(self.queue.pop(0))
-               return None
-
-
-
diff --git a/OpenSRF/src/python/osrf/ses.py b/OpenSRF/src/python/osrf/ses.py
deleted file mode 100644 (file)
index 2fbb502..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from osrf.json import *
-from osrf.conf import osrfConfigValue
-from osrf.net import osrfNetworkMessage, osrfGetNetworkHandle
-from osrf.log import *
-from osrf.const import *
-import random, sys, os, time
-
-
-# -----------------------------------------------------------------------
-# Go ahead and register the common network objects
-# -----------------------------------------------------------------------
-osrfNetworkRegisterHint('osrfMessage', ['threadTrace', 'type', 'payload'], 'hash')
-osrfNetworkRegisterHint('osrfMethod', ['method', 'params'], 'hash')
-osrfNetworkRegisterHint('osrfResult', ['status', 'statusCode', 'content'], 'hash')
-osrfNetworkRegisterHint('osrfConnectStatus', ['status','statusCode'], 'hash')
-osrfNetworkRegisterHint('osrfMethodException', ['status', 'statusCode'], 'hash')
-
-
-class osrfSession(object):
-       """Abstract session superclass."""
-
-       def __init__(self):
-               # by default, we're connected to no one
-               self.state = OSRF_APP_SESSION_DISCONNECTED
-
-
-       def wait(self, timeout=120):
-               """Wait up to <timeout> seconds for data to arrive on the network"""
-               osrfLogInternal("osrfSession.wait(%d)" % timeout)
-               handle = osrfGetNetworkHandle()
-               handle.recv(timeout)
-
-       def send(self, omessage):
-               """Sends an OpenSRF message"""
-               netMessage = osrfNetworkMessage(
-                       to              = self.remoteId,
-                       body    = osrfObjectToJSON([omessage]),
-                       thread = self.thread )
-
-               handle = osrfGetNetworkHandle()
-               handle.send(netMessage)
-
-       def cleanup(self):
-               """Removes the session from the global session cache."""
-               del osrfClientSession.sessionCache[self.thread]
-
-class osrfClientSession(osrfSession):
-       """Client session object.  Use this to make server requests."""
-
-       def __init__(self, service):
-               
-               # call superclass constructor
-               osrfSession.__init__(self)
-
-               # the remote service we want to make requests of
-               self.service = service
-
-               # find the remote service handle <router>@<domain>/<service>
-               domain = osrfConfigValue('domains.domain', 0)
-               router = osrfConfigValue('router_name')
-               self.remoteId = "%s@%s/%s" % (router, domain, service)
-               self.origRemoteId = self.remoteId
-
-               # generate a random message thread
-               self.thread = "%s%s%s" % (os.getpid(), str(random.randint(100,100000)), str(time.time()))
-
-               # how many requests this session has taken part in
-               self.nextId = 0 
-
-               # cache of request objects 
-               self.requests = {}
-
-               # cache this session in the global session cache
-               osrfClientSession.sessionCache[self.thread] = self
-
-       def resetRequestTimeout(self, rid):
-               req = self.findRequest(rid)
-               if req:
-                       req.resetTimeout = True
-                       
-
-       def request2(self, method, arr):
-               """Creates a new request and sends the request to the server using a python array as the params."""
-               return self.__request(method, arr)
-
-       def request(self, method, *args):
-               """Creates a new request and sends the request to the server using a variable argument list as params"""
-               arr = list(args)
-               return self.__request(method, arr)
-
-       def __request(self, method, arr):
-               """Builds the request object and sends it."""
-               if self.state != OSRF_APP_SESSION_CONNECTED:
-                       self.resetRemoteId()
-
-               osrfLogDebug("Sending request %s -> %s " % (self.service, method))
-               req = osrfRequest(self, self.nextId, method, arr)
-               self.requests[str(self.nextId)] = req
-               self.nextId += 1
-               req.send()
-               return req
-
-
-       def connect(self, timeout=10):
-               """Connects to a remote service"""
-
-               if self.state == OSRF_APP_SESSION_CONNECTED:
-                       return True
-               self.state == OSRF_APP_SESSION_CONNECTING
-
-               # construct and send a CONNECT message
-               self.send(
-                       osrfNetworkObject.osrfMessage( 
-                               {       'threadTrace' : 0,
-                                       'type' : OSRF_MESSAGE_TYPE_CONNECT
-                               } 
-                       )
-               )
-
-               while timeout >= 0 and not self.state == OSRF_APP_SESSION_CONNECTED:
-                       start = time.time()
-                       self.wait(timeout)
-                       timeout -= time.time() - start
-               
-               if self.state != OSRF_APP_SESSION_CONNECTED:
-                       raise osrfServiceException("Unable to connect to " + self.service)
-               
-               return True
-
-       def disconnect(self):
-               """Disconnects from a remote service"""
-
-               if self.state == OSRF_APP_SESSION_DISCONNECTED:
-                       return True
-
-               self.send(
-                       osrfNetworkObject.osrfMessage( 
-                               {       'threadTrace' : 0,
-                                       'type' : OSRF_MESSAGE_TYPE_DISCONNECT
-                               } 
-                       )
-               )
-
-               self.state = OSRF_APP_SESSION_DISCONNECTED
-
-
-               
-       
-       def setRemoteId(self, remoteid):
-               self.remoteId = remoteid
-               osrfLogInternal("Setting request remote ID to %s" % self.remoteId)
-
-       def resetRemoteId(self):
-               """Recovers the original remote id"""
-               self.remoteId = self.origRemoteId
-               osrfLogInternal("Resetting remote ID to %s" % self.remoteId)
-
-       def pushResponseQueue(self, message):
-               """Pushes the message payload onto the response queue 
-                       for the request associated with the message's ID."""
-               osrfLogDebug("pushing %s" % message.payload())
-               try:
-                       self.findRequest(message.threadTrace()).pushResponse(message.payload())
-               except Exception, e: 
-                       osrfLogWarn("pushing respond to non-existent request %s : %s" % (message.threadTrace(), e))
-
-       def findRequest(self, rid):
-               """Returns the original request matching this message's threadTrace."""
-               try:
-                       return self.requests[str(rid)]
-               except KeyError:
-                       osrfLogDebug('findRequest(): non-existent request %s' % str(rid))
-                       return None
-
-
-
-osrfSession.sessionCache = {}
-def osrfFindSession(thread):
-       """Finds a session in the global cache."""
-       try:
-               return osrfClientSession.sessionCache[thread]
-       except: return None
-
-class osrfRequest(object):
-       """Represents a single OpenSRF request.
-               A request is made and any resulting respones are 
-               collected for the client."""
-
-       def __init__(self, session, id, method=None, params=[]):
-
-               self.session = session # my session handle
-               self.id         = id # my unique request ID
-               self.method = method # method name
-               self.params = params # my method params
-               self.queue      = [] # response queue
-               self.resetTimeout = False # resets the recv timeout?
-               self.complete = False # has the server told us this request is done?
-               self.sendTime = 0 # local time the request was put on the wire
-               self.completeTime =  0 # time the server told us the request was completed
-               self.firstResponseTime = 0 # time it took for our first reponse to be received
-
-       def send(self):
-               """Sends a request message"""
-
-               # construct the method object message with params and method name
-               method = osrfNetworkObject.osrfMethod( {
-                       'method' : self.method,
-                       'params' : self.params
-               } )
-
-               # construct the osrf message with our method message embedded
-               message = osrfNetworkObject.osrfMessage( {
-                       'threadTrace' : self.id,
-                       'type' : OSRF_MESSAGE_TYPE_REQUEST,
-                       'payload' : method
-               } )
-
-               self.sendTime = time.time()
-               self.session.send(message)
-
-       def recv(self, timeout=120):
-               """Waits up to <timeout> seconds for a response to this request.
-               
-                       If a message is received in time, the response message is returned.
-                       Returns None otherwise."""
-
-               self.session.wait(0)
-
-               origTimeout = timeout
-               while not self.complete and timeout >= 0 and len(self.queue) == 0:
-                       s = time.time()
-                       self.session.wait(timeout)
-                       timeout -= time.time() - s
-                       if self.resetTimeout:
-                               self.resetTimeout = False
-                               timeout = origTimeout
-
-               now = time.time()
-
-               # -----------------------------------------------------------------
-               # log some statistics 
-               if len(self.queue) > 0:
-                       if not self.firstResponseTime:
-                               self.firstResponseTime = now
-                               osrfLogDebug("time elapsed before first response: %f" \
-                                       % (self.firstResponseTime - self.sendTime))
-
-               if self.complete:
-                       if not self.completeTime:
-                               self.completeTime = now
-                               osrfLogDebug("time elapsed before complete: %f" \
-                                       % (self.completeTime - self.sendTime))
-               # -----------------------------------------------------------------
-
-
-               if len(self.queue) > 0:
-                       # we have a reponse, return it
-                       return self.queue.pop(0)
-
-               return None
-
-       def pushResponse(self, content):
-               """Pushes a method response onto this requests response queue."""
-               self.queue.append(content)
-
-       def cleanup(self):
-               """Cleans up request data from the cache. 
-
-                       Do this when you are done with a request to prevent "leaked" cache memory."""
-               del self.session.requests[str(self.id)]
-
-       def setComplete(self):
-               """Sets me as complete.  This means the server has sent a 'request complete' message"""
-               self.complete = True
-
-
-class osrfServerSession(osrfSession):
-       """Implements a server-side session"""
-       pass
-
-
-def osrfAtomicRequest(service, method, *args):
-       ses = osrfClientSession(service)
-       req = ses.request2('open-ils.cstore.direct.actor.user.retrieve', list(args)) # grab user with ID 1
-       resp = req.recv()
-       data = resp.content()
-       req.cleanup()
-       ses.cleanup()
-       return data
-
-
-
diff --git a/OpenSRF/src/python/osrf/set.py b/OpenSRF/src/python/osrf/set.py
deleted file mode 100644 (file)
index a075bc1..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from osrf.utils import *
-from osrf.const import *
-from osrf.ex import *
-
-# global settings config object
-__conifg = None
-
-def osrfSettingsValue(path, idx=0):
-       global __config
-       val = osrfObjectFindPath(__config, path, idx)
-       if not val:
-               raise osrfConfigException("Config value not found: " + path)
-       return val
-
-
-def osrfLoadSettings(hostname):
-       global __config
-
-       from osrf.system import osrfConnect
-       from osrf.ses import osrfClientSession
-
-       ses = osrfClientSession(OSRF_APP_SETTINGS)
-       req = ses.request(OSRF_METHOD_GET_HOST_CONFIG, hostname)
-       resp = req.recv(timeout=30)
-       __config = resp.content()
-       req.cleanup()
-       ses.cleanup()
-
diff --git a/OpenSRF/src/python/osrf/stack.py b/OpenSRF/src/python/osrf/stack.py
deleted file mode 100644 (file)
index 0bf4892..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from osrf.json import *
-from osrf.log import *
-from osrf.ex import *
-from osrf.ses import osrfFindSession, osrfClientSession, osrfServerSession
-from osrf.const import *
-from time import time
-
-
-def osrfPushStack(netMessage):
-   ses = osrfFindSession(netMessage.thread)
-
-   if not ses:
-      # This is an incoming request from a client, create a new server session
-      pass
-
-   ses.setRemoteId(netMessage.sender)
-
-   oMessages = osrfJSONToObject(netMessage.body)
-
-   osrfLogInternal("osrfPushStack(): received %d messages" % len(oMessages))
-
-   # Pass each bundled opensrf message to the message handler
-   t = time()
-   for m in oMessages:
-      osrfHandleMessage(ses, m)
-   t = time() - t
-
-   if isinstance(ses, osrfServerSession):
-      osrfLogInfo("Message processing duration %f" % t)
-
-def osrfHandleMessage(session, message):
-
-   osrfLogInternal("osrfHandleMessage(): processing message of type %s" % message.type())
-
-   if isinstance(session, osrfClientSession):
-      
-      if message.type() == OSRF_MESSAGE_TYPE_RESULT:
-         session.pushResponseQueue(message)
-         return
-
-      if message.type() == OSRF_MESSAGE_TYPE_STATUS:
-
-         statusCode = int(message.payload().statusCode())
-         statusText = message.payload().status()
-         osrfLogInternal("osrfHandleMessage(): processing STATUS,  statusCode =  %d" % statusCode)
-
-         if statusCode == OSRF_STATUS_COMPLETE:
-            # The server has informed us that this request is complete
-            req = session.findRequest(message.threadTrace())
-            if req: 
-               osrfLogInternal("marking request as complete: %d" % req.id)
-               req.setComplete()
-            return
-
-         if statusCode == OSRF_STATUS_OK:
-            # We have connected successfully
-            osrfLogDebug("Successfully connected to " + session.service)
-            session.state = OSRF_APP_SESSION_CONNECTED
-            return
-
-         if statusCode == OSRF_STATUS_CONTINUE:
-            # server is telling us to reset our wait timeout and keep waiting for a response
-            session.resetRequestTimeout(message.threadTrace())
-            return;
-
-         if statusCode == OSRF_STATUS_TIMEOUT:
-            osrfLogDebug("The server did not receive a request from us in time...")
-            session.state = OSRF_APP_SESSION_DISCONNECTED
-            return
-
-         if statusCode == OSRF_STATUS_NOTFOUND:
-            osrfLogErr("Requested method was not found on the server: %s" % statusText)
-            session.state = OSRF_APP_SESSION_DISCONNECTED
-            raise osrfServiceException(statusText)
-
-         raise osrfProtocolException("Unknown message status: %d" % statusCode)
-      
-         
-   
-   
diff --git a/OpenSRF/src/python/osrf/system.py b/OpenSRF/src/python/osrf/system.py
deleted file mode 100644 (file)
index 4a978a5..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-from osrf.conf import osrfConfig, osrfConfigValue
-from osrf.net import osrfNetwork, osrfSetNetworkHandle
-from osrf.stack import osrfPushStack
-from osrf.log import *
-from osrf.set import osrfLoadSettings
-import sys
-
-
-def osrfConnect(configFile):
-       """ Connects to the opensrf network """
-
-       # parse the config file
-       configParser = osrfConfig(configFile)
-       configParser.parseConfig()
-       
-       # set up logging
-       osrfInitLog(osrfConfigValue('loglevel'), osrfConfigValue('syslog'))
-
-       # connect to the opensrf network
-       network = osrfNetwork(
-               host=osrfConfigValue('domains.domain'),
-               port=osrfConfigValue('port'),
-               username=osrfConfigValue('username'), 
-               password=osrfConfigValue('passwd'))
-       network.setRecvCallback(osrfPushStack)
-       osrfSetNetworkHandle(network)
-       network.connect()
-
-       # load the domain-wide settings file
-       osrfLoadSettings(osrfConfigValue('domains.domain'))
-
-
-
diff --git a/OpenSRF/src/python/osrf/utils.py b/OpenSRF/src/python/osrf/utils.py
deleted file mode 100644 (file)
index 1d9d7aa..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Georgia Public Library Service
-# Bill Erickson <billserickson@gmail.com>
-# 
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# -----------------------------------------------------------------------
-
-import libxml2, re
-
-def osrfXMLFileToObject(filename):
-       """Turns the contents of an XML file into a Python object"""
-       doc     = libxml2.parseFile(filename)
-       xmlNode = doc.children.children
-       return osrfXMLNodeToObject(xmlNode)
-
-def osrfXMLStringToObject(string):
-       """Turns an XML string into a Python object"""
-       doc     = libxml2.parseString(string)
-       xmlNode = doc.children.children
-       return osrfXMLNodeToObject(xmlNode)
-
-def osrfXMLNodeToObject(xmlNode):
-       """Turns an XML node into a Python object"""
-       obj = {}
-
-       while xmlNode:
-               if xmlNode.type == 'element':
-                       nodeChild = xmlNode.children
-                       done = False
-                       nodeName = xmlNode.name
-
-                       while nodeChild:
-                               if nodeChild.type == 'element':
-
-                                       # If a node has element children, create a new sub-object 
-                                       # for this node, attach an array for each type of child
-                                       # and recursively collect the children data into the array(s)
-
-                                       if not obj.has_key(nodeName):
-                                               obj[nodeName] = {}
-
-                                       sub_obj = osrfXMLNodeToObject(nodeChild);
-
-                                       if not obj[nodeName].has_key(nodeChild.name):
-                                               # we've encountered 1 sub-node with nodeChild's name
-                                               obj[nodeName][nodeChild.name] = sub_obj[nodeChild.name]
-
-                                       else:
-                                               if isinstance(obj[nodeName][nodeChild.name], list):
-                                                       # we already have multiple sub-nodes with nodeChild's name
-                                                       obj[nodeName][nodeChild.name].append(sub_obj[nodeChild.name])
-
-                                               else:
-                                                       # we already have 1 sub-node with nodeChild's name, make 
-                                                       # it a list and append the current node
-                                                       val = obj[nodeName][nodeChild.name]
-                                                       obj[nodeName][nodeChild.name] = [ val, sub_obj[nodeChild.name] ]
-
-                                       done = True
-
-                               nodeChild = nodeChild.next
-
-                       if not done:
-                               # If the node has no children, clean up the text content 
-                               # and use that as the data
-                               data = re.compile('^\s*').sub('', xmlNode.content)
-                               data = re.compile('\s*$').sub('', data)
-
-                               obj[nodeName] = data
-
-               xmlNode = xmlNode.next
-
-       return obj
-
-
-def osrfObjectFindPath(obj, path, idx=None):
-       """Searches an object along the given path for a value to return.
-
-       Path separaters can be '/' or '.', '/' is tried first."""
-
-       parts = []
-
-       if re.compile('/').search(path):
-               parts = path.split('/')
-       else:
-               parts = path.split('.')
-
-       for part in parts:
-               try:
-                       o = obj[part]
-               except Exception:
-                       return None
-               if isinstance(o,str): 
-                       return o
-               if isinstance(o,list):
-                       if( idx != None ):
-                               return o[idx]
-                       return o
-               if isinstance(o,dict):
-                       obj = o
-               else:
-                       return o
-
-       return obj
-
-
-                       
-
diff --git a/OpenSRF/src/python/srfsh.py b/OpenSRF/src/python/srfsh.py
deleted file mode 100755 (executable)
index e3e63c4..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-#!/usr/bin/python2.4
-import os, sys, time, readline, atexit, re
-from string import *
-from osrf.system import osrfConnect
-from osrf.json import *
-from osrf.ses import osrfClientSession
-from osrf.conf import osrfConfigValue
-import osrf.ex
-
-prompt = "\033[01;32msrfsh\033[01;34m% \033[00m"
-last_response = None
-commands = {}
-
-
-def register_command(name, callback):
-    commands[name] = callback
-    
-
-# -------------------------------------------------------------------
-# main listen loop
-# -------------------------------------------------------------------
-"""
-def do_loop():
-    while True:
-
-        try:
-            line = raw_input(prompt+'')
-            if not len(line): 
-                continue
-            if lower(line) == 'exit' or lower(line) == 'quit': 
-                break
-            parts = split(line)
-
-            command = parts.pop(0)
-        
-            if command == 'request':
-                handle_request(parts)
-                continue
-
-            if command == 'math_bench':
-                handle_math_bench(parts)
-                continue
-
-            if command == 'help':
-                handle_help()
-                continue
-
-            if command == 'set':
-                handle_set(parts)
-
-            if command == 'get':
-                handle_get(parts)
-
-            if command == 'eval':
-                handle_eval(parts)
-
-
-
-        except KeyboardInterrupt:
-            print ""
-
-        except EOFError:
-            print "exiting..."
-            sys.exit(0)
-"""
-
-
-# -------------------------------------------------------------------
-# Set env variables to control behavior
-# -------------------------------------------------------------------
-def handle_set(parts):
-    m = re.compile('(.*)=(.*)').match(parts[0])
-    key = m.group(1)
-    val = m.group(2)
-    set_var(key, val)
-    print "%s = %s" % (key, val)
-
-def handle_get(parts):
-    try:
-        print get_var(parts[0])
-    except:
-        print ""
-
-def handle_eval(parts):
-    com = ' '.join(parts)
-    try:
-        print eval(com)
-    except Exception, e:
-        print "EVAL failed: " + str(e)
-
-# -------------------------------------------------------------------
-# Prints help info
-# -------------------------------------------------------------------
-def handle_help():
-    print """
-  help
-    - show this menu
-
-  math_bench <count>
-    - runs <count> opensrf.math requests and reports the average time
-
-  request <service> <method> [<param1>, <param2>, ...]
-    - performs an opensrf request
-
-  eval <command>
-    - evals the requested command within the srfsh environment
-    - special variables:
-      - last_response - last item received from a network call
-
-  set VAR=<value>
-    - sets an environment variable
-
-  Environment variables:
-    SRFSH_OUTPUT = pretty - print pretty JSON and key/value pairs for network objects
-                 = raw - print formatted JSON 
-    """
-
-        
-
-
-# -------------------------------------------------------------------
-# performs an opesnrf request
-# -------------------------------------------------------------------
-def handle_request(parts):
-    service = parts.pop(0)
-    method = parts.pop(0)
-    jstr = '[%s]' % join(parts)
-    params = None
-    global last_response
-
-    try:
-        params = osrfJSONToObject(jstr)
-    except:
-        print "Error parsing JSON: %s" % jstr
-        return
-
-    otp = get_var('SRFSH_OUTPUT')
-
-    ses = osrfClientSession(service)
-
-    end = None
-    start = time.time()
-    req = ses.request2(method, tuple(params))
-
-
-    while True:
-
-        resp = None
-
-        try:
-            resp = req.recv(timeout=120)
-        except Exception, e:
-            print "\nThere was a problem running your request:\n\n%s\n" % str(e)
-            return
-
-        if not end:
-            total = time.time() - start
-        if not resp: break
-
-        if otp == 'pretty':
-            print osrfDebugNetworkObject(resp.content())
-        else:
-            print osrfFormatJSON(osrfObjectToJSON(resp.content()))
-        last_response = resp.content()
-
-    req.cleanup()
-    ses.cleanup()
-
-    print '-'*60
-    print "Total request time: %f" % total
-    print '-'*60
-
-
-def handle_math_bench(parts):
-
-    count = int(parts.pop(0))
-    ses = osrfClientSession('opensrf.math')
-    times = []
-
-    for i in range(100):
-        if i % 10: sys.stdout.write('.')
-        else: sys.stdout.write( str( i / 10 ) )
-    print "";
-
-
-    for i in range(count):
-    
-        starttime = time.time()
-        req = ses.request('add', 1, 2)
-        resp = req.recv(timeout=2)
-        endtime = time.time()
-    
-        if resp.content() == 3:
-            sys.stdout.write("+")
-            sys.stdout.flush()
-            times.append( endtime - starttime )
-        else:
-            print "What happened? %s" % str(resp.content())
-    
-        req.cleanup()
-        if not ( (i+1) % 100):
-            print ' [%d]' % (i+1)
-    
-    ses.cleanup()
-    total = 0
-    for i in times: total += i
-    print "\naverage time %f" % (total / len(times))
-
-
-
-
-# -------------------------------------------------------------------
-# Defines the tab-completion handling and sets up the readline history 
-# -------------------------------------------------------------------
-def setup_readline():
-    class SrfshCompleter(object):
-        def __init__(self, words):
-            self.words = words
-            self.prefix = None
-    
-        def complete(self, prefix, index):
-            if prefix != self.prefix:
-                # find all words that start with this prefix
-                self.matching_words = [
-                    w for w in self.words if w.startswith(prefix)
-                ]
-                self.prefix = prefix
-                try:
-                    return self.matching_words[index]
-                except IndexError:
-                    return None
-    
-    words = 'request', 'help', 'exit', 'quit', 'opensrf.settings', 'opensrf.math', 'set'
-    completer = SrfshCompleter(words)
-    readline.parse_and_bind("tab: complete")
-    readline.set_completer(completer.complete)
-
-    histfile = os.path.join(get_var('HOME'), ".srfsh_history")
-    try:
-        readline.read_history_file(histfile)
-    except IOError:
-        pass
-    atexit.register(readline.write_history_file, histfile)
-
-def do_connect():
-    file = os.path.join(get_var('HOME'), ".srfsh.xml")
-
-    print_green("Connecting to opensrf...")
-    osrfConnect(file)
-    print_red('OK')
-    print ''
-
-def load_plugins():
-    # Load the user defined external plugins
-    # XXX Make this a real module interface, with tab-complete words, commands, etc.
-    plugins = osrfConfigValue('plugins')
-    plugins = osrfConfigValue('plugins.plugin')
-    if not isinstance(plugins, list):
-        plugins = [plugins]
-
-    for module in plugins:
-        name = module['module']
-        init = module['init']
-        print_green("Loading module %s..." % name)
-
-        try:
-            str = 'from %s import %s\n%s()' % (name, init, init)
-            exec(str)
-            print_red('OK')
-            print ''
-
-        except Exception, e:
-            sys.stderr.write("\nError importing plugin %s, with init symbol %s: \n%s\n" % (name, init, e))
-
-def set_vars():
-    if not get_var('SRFSH_OUTPUT'):
-        set_var('SRFSH_OUTPUT', 'pretty')
-
-
-def set_var(key, val):
-    os.environ[key] = val
-
-
-def get_var(key):
-    try: return os.environ[key]
-    except: return ''
-    
-    
-def print_green(str):
-    sys.stdout.write("\033[01;32m")
-    sys.stdout.write(str)
-    sys.stdout.write("\033[00m")
-    #sys.stdout.flush()
-
-def print_red(str):
-    sys.stdout.write("\033[01;31m")
-    sys.stdout.write(str)
-    sys.stdout.write("\033[00m")
-    #sys.stdout.flush()
-
-def print_purple(str):
-    sys.stdout.write("\033[01;34m")
-    sys.stdout.write(str)
-    sys.stdout.write("\033[00m")
-    #sys.stdout.flush()
-
-
-
-
-
-
-
-# -------------------------------------------------------------------
-# main listen loop
-# -------------------------------------------------------------------
-def do_loop():
-    while True:
-
-        try:
-            line = raw_input(prompt+'')
-            if not len(line): 
-                continue
-            if lower(line) == 'exit' or lower(line) == 'quit': 
-                break
-            parts = split(line)
-
-            command = parts.pop(0)
-        
-            if command == 'request':
-                handle_request(parts)
-                continue
-
-            if command == 'math_bench':
-                handle_math_bench(parts)
-                continue
-
-            if command == 'help':
-                handle_help()
-                continue
-
-            if command == 'set':
-                handle_set(parts)
-
-            if command == 'get':
-                handle_get(parts)
-
-            if command == 'eval':
-                handle_eval(parts)
-
-
-
-        except KeyboardInterrupt:
-            print ""
-
-        except EOFError:
-            print "exiting..."
-            sys.exit(0)
-
-
-
-
-
-
-
-# Kick it off
-set_vars()
-setup_readline()
-do_connect()
-load_plugins()
-do_loop()
-
-
-
diff --git a/OpenSRF/src/router/Makefile b/OpenSRF/src/router/Makefile
deleted file mode 100644 (file)
index f545b66..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#MALLOC_CHECK_=1 # XXX debug only
-
-LDLIBS += -lxml2 -lopensrf 
-CFLAGS += -D_ROUTER
-
-all: opensrf_router 
-#osrf_router
-
-install: 
-       cp opensrf_router $(BINDIR)
-
-#opensrf_router:       router.o 
-#      $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) router.o -o $@
-#router.o:     router.c router.h
-
-opensrf_router:        osrf_router.o osrf_router_main.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) osrf_router.o osrf_router_main.o -o $@
-osrf_router.o: osrf_router.c osrf_router.h
-osrf_router_main.o: osrf_router_main.c 
-
-clean:
-       /bin/rm -f *.o opensrf_router
-
diff --git a/OpenSRF/src/router/osrf_router.c b/OpenSRF/src/router/osrf_router.c
deleted file mode 100644 (file)
index 8308851..0000000
+++ /dev/null
@@ -1,641 +0,0 @@
-#include "osrf_router.h"
-
-#define ROUTER_SOCKFD connection->session->sock_id
-#define ROUTER_REGISTER "register"
-#define ROUTER_UNREGISTER "unregister"
-
-
-#define ROUTER_REQUEST_CLASS_LIST "opensrf.router.info.class.list"
-
-osrfRouter* osrfNewRouter( 
-               char* domain, char* name, 
-               char* resource, char* password, int port, 
-               osrfStringArray* trustedClients, osrfStringArray* trustedServers ) {
-
-       if(!( domain && name && resource && password && port && trustedClients && trustedServers )) return NULL;
-
-       osrfRouter* router      = safe_malloc(sizeof(osrfRouter));
-       router->domain                  = strdup(domain);
-       router->name                    = strdup(name);
-       router->password                = strdup(password);
-       router->resource                = strdup(resource);
-       router->port                    = port;
-
-       router->trustedClients = trustedClients;
-       router->trustedServers = trustedServers;
-
-       
-       router->classes = osrfNewHash(); 
-       router->classes->freeItem = &osrfRouterClassFree;
-
-       router->connection = client_init( domain, port, NULL, 0 );
-
-       return router;
-}
-
-
-
-int osrfRouterConnect( osrfRouter* router ) {
-       if(!router) return -1;
-       int ret = client_connect( router->connection, router->name, 
-                       router->password, router->resource, 10, AUTH_DIGEST );
-       if( ret == 0 ) return -1;
-       return 0;
-}
-
-
-void osrfRouterRun( osrfRouter* router ) {
-       if(!(router && router->classes)) return;
-
-       int routerfd = router->ROUTER_SOCKFD;
-       int selectret = 0;
-
-       while(1) {
-
-               fd_set set;
-               int maxfd = __osrfRouterFillFDSet( router, &set );
-               int numhandled = 0;
-
-               if( (selectret = select(maxfd + 1, &set, NULL, NULL, NULL)) < 0 ) {
-                       osrfLogWarning( OSRF_LOG_MARK, "Top level select call failed with errno %d", errno);
-                       continue;
-               }
-
-               /* see if there is a top level router message */
-
-               if( FD_ISSET(routerfd, &set) ) {
-                       osrfLogDebug( OSRF_LOG_MARK, "Top router socket is active: %d", routerfd );
-                       numhandled++;
-                       osrfRouterHandleIncoming( router );
-               }
-
-
-               /* now check each of the connected classes and see if they have data to route */
-               while( numhandled < selectret ) {
-
-                       osrfRouterClass* class;
-                       osrfHashIterator* itr = osrfNewHashIterator(router->classes);
-
-                       while( (class = osrfHashIteratorNext(itr)) ) {
-
-                               char* classname = itr->current;
-
-                               if( classname && (class = osrfRouterFindClass( router, classname )) ) {
-
-                                       osrfLogDebug( OSRF_LOG_MARK, "Checking %s for activity...", classname );
-
-                                       int sockfd = class->ROUTER_SOCKFD;
-                                       if(FD_ISSET( sockfd, &set )) {
-                                               osrfLogDebug( OSRF_LOG_MARK, "Socket is active: %d", sockfd );
-                                               numhandled++;
-                                               osrfRouterClassHandleIncoming( router, classname, class );
-                                       }
-                               }
-                       }
-
-                       osrfHashIteratorFree(itr);
-               }
-       }
-}
-
-
-void osrfRouterHandleIncoming( osrfRouter* router ) {
-       if(!router) return;
-
-       transport_message* msg = NULL;
-
-       //if( (msg = client_recv( router->connection, 0 )) ) { 
-       while( (msg = client_recv( router->connection, 0 )) ) { 
-
-               if( msg->sender ) {
-
-                       osrfLogDebug(OSRF_LOG_MARK, 
-                               "osrfRouterHandleIncoming(): investigating message from %s", msg->sender);
-
-                       /* if the sender is not a trusted server, drop the message */
-                       int len = strlen(msg->sender) + 1;
-                       char domain[len];
-                       bzero(domain, len);
-                       jid_get_domain( msg->sender, domain, len - 1 );
-
-                       if(osrfStringArrayContains( router->trustedServers, domain)) 
-                               osrfRouterHandleMessage( router, msg );
-                        else 
-                               osrfLogWarning( OSRF_LOG_MARK, "Received message from un-trusted server domain %s", msg->sender);
-               }
-
-               message_free(msg);
-       }
-}
-
-int osrfRouterClassHandleIncoming( osrfRouter* router, char* classname, osrfRouterClass* class ) {
-       if(!(router && class)) return -1;
-
-       transport_message* msg;
-       osrfLogDebug( OSRF_LOG_MARK, "osrfRouterClassHandleIncoming()");
-
-       while( (msg = client_recv( class->connection, 0 )) ) {
-
-      osrfLogSetXid(msg->osrf_xid);
-
-               if( msg->sender ) {
-
-                       osrfLogDebug(OSRF_LOG_MARK, 
-                               "osrfRouterClassHandleIncoming(): investigating message from %s", msg->sender);
-
-                       /* if the client is not from a trusted domain, drop the message */
-                       int len = strlen(msg->sender) + 1;
-                       char domain[len];
-                       bzero(domain, len);
-                       jid_get_domain( msg->sender, domain, len - 1 );
-
-                       if(osrfStringArrayContains( router->trustedClients, domain)) {
-
-                               transport_message* bouncedMessage = NULL;
-                               if( msg->is_error )  {
-
-                                       /* handle bounced message */
-                                       if( !(bouncedMessage = osrfRouterClassHandleBounce( router, classname, class, msg )) ) 
-                                               return -1; /* we have no one to send the requested message to */
-
-                                       message_free( msg );
-                                       msg = bouncedMessage;
-                               }
-                               osrfRouterClassHandleMessage( router, class, msg );
-
-                       } else {
-                               osrfLogWarning( OSRF_LOG_MARK, "Received client message from untrusted client domain %s", domain );
-                       }
-               }
-
-      osrfLogClearXid();
-               message_free( msg );
-       }
-
-       return 0;
-}
-
-
-
-
-int osrfRouterHandleMessage( osrfRouter* router, transport_message* msg ) {
-       if(!(router && msg)) return -1;
-
-       if( !msg->router_command || !strcmp(msg->router_command,"")) 
-               return osrfRouterHandleAppRequest( router, msg ); /* assume it's an app session level request */
-
-       if(!msg->router_class) return -1;
-
-       osrfRouterClass* class = NULL;
-       if(!strcmp(msg->router_command, ROUTER_REGISTER)) {
-               class = osrfRouterFindClass( router, msg->router_class );
-
-               osrfLogInfo( OSRF_LOG_MARK, "Registering class %s", msg->router_class );
-
-               if(!class) class = osrfRouterAddClass( router, msg->router_class );
-
-               if(class) { 
-
-                       if( osrfRouterClassFindNode( class, msg->sender ) )
-                               return 0;
-                       else 
-                               osrfRouterClassAddNode( class, msg->sender );
-
-               } 
-
-       } else if( !strcmp( msg->router_command, ROUTER_UNREGISTER ) ) {
-
-               if( msg->router_class && strcmp( msg->router_class, "") ) {
-                       osrfLogInfo( OSRF_LOG_MARK, "Unregistering router class %s", msg->router_class );
-                       osrfRouterClassRemoveNode( router, msg->router_class, msg->sender );
-               }
-       }
-
-       return 0;
-}
-
-
-
-osrfRouterClass* osrfRouterAddClass( osrfRouter* router, char* classname ) {
-       if(!(router && router->classes && classname)) return NULL;
-
-       osrfRouterClass* class = safe_malloc(sizeof(osrfRouterClass));
-       class->nodes = osrfNewHash();
-       class->itr = osrfNewHashIterator(class->nodes);
-       class->nodes->freeItem = &osrfRouterNodeFree;
-       class->router   = router;
-
-       class->connection = client_init( router->domain, router->port, NULL, 0 );
-
-       if(!client_connect( class->connection, router->name, 
-                       router->password, classname, 10, AUTH_DIGEST ) ) {
-               osrfRouterClassFree( classname, class );
-               return NULL;
-       }
-       
-       osrfHashSet( router->classes, class, classname );
-       return class;
-}
-
-
-int osrfRouterClassAddNode( osrfRouterClass* rclass, char* remoteId ) {
-       if(!(rclass && rclass->nodes && remoteId)) return -1;
-
-       osrfLogInfo( OSRF_LOG_MARK, "Adding router node for remote id %s", remoteId );
-
-       osrfRouterNode* node = safe_malloc(sizeof(osrfRouterNode));
-       node->count = 0;
-       node->lastMessage = NULL;
-       node->remoteId = strdup(remoteId);
-
-       osrfHashSet( rclass->nodes, node, remoteId );
-       return 0;
-}
-
-/* copy off the lastMessage, remove the offending node, send error if it's tht last node 
-       ? return NULL if it's the last node ?
- */
-
-transport_message* osrfRouterClassHandleBounce( 
-               osrfRouter* router, char* classname, osrfRouterClass* rclass, transport_message* msg ) {
-
-       osrfLogDebug( OSRF_LOG_MARK, "osrfRouterClassHandleBounce()");
-
-       osrfLogInfo( OSRF_LOG_MARK, "Received network layer error message from %s", msg->sender );
-       osrfRouterNode* node = osrfRouterClassFindNode( rclass, msg->sender );
-       transport_message* lastSent = NULL;
-
-       if( node && osrfHashGetCount(rclass->nodes) == 1 ) { /* the last node is dead */
-
-               if( node->lastMessage ) {
-                       osrfLogWarning( OSRF_LOG_MARK, "We lost the last node in the class, responding with error and removing...");
-       
-                       transport_message* error = message_init( 
-                               node->lastMessage->body, node->lastMessage->subject, 
-                               node->lastMessage->thread, node->lastMessage->router_from, node->lastMessage->recipient );
-         message_set_osrf_xid(error, node->lastMessage->osrf_xid);
-                       set_msg_error( error, "cancel", 501 );
-       
-                       /* send the error message back to the original sender */
-                       client_send_message( rclass->connection, error );
-                       message_free( error );
-               }
-       
-               return NULL;
-       
-       } else { 
-
-               if( node ) {
-                       if( node->lastMessage ) {
-                               osrfLogDebug( OSRF_LOG_MARK, "Cloning lastMessage so next node can send it");
-                               lastSent = message_init( node->lastMessage->body,
-                                       node->lastMessage->subject, node->lastMessage->thread, "", node->lastMessage->router_from );
-                               message_set_router_info( lastSent, node->lastMessage->router_from, NULL, NULL, NULL, 0 );
-            message_set_osrf_xid( lastSent, node->lastMessage->osrf_xid );
-                       }
-               } else {
-
-                       osrfLogInfo(OSRF_LOG_MARK, "network error occurred after we removed the class.. ignoring");
-                       return NULL;
-               }
-       }
-
-       /* remove the dead node */
-       osrfRouterClassRemoveNode( router, classname, msg->sender);
-       return lastSent;
-}
-
-
-/**
-  If we get a regular message, we send it to the next node in the list of nodes
-  if we get an error, it's a bounce back from a previous attempt.  We take the
-  body and thread from the last sent on the node that had the bounced message
-  and propogate them on to the new message being sent
-  */
-int osrfRouterClassHandleMessage( 
-               osrfRouter* router, osrfRouterClass* rclass, transport_message* msg ) {
-       if(!(router && rclass && msg)) return -1;
-
-       osrfLogDebug( OSRF_LOG_MARK, "osrfRouterClassHandleMessage()");
-
-       osrfRouterNode* node = osrfHashIteratorNext( rclass->itr );
-       if(!node) {
-               osrfHashIteratorReset(rclass->itr);
-               node = osrfHashIteratorNext( rclass->itr );
-       }
-
-       if(node) {
-
-               transport_message* new_msg= message_init(       msg->body, 
-                               msg->subject, msg->thread, node->remoteId, msg->sender );
-               message_set_router_info( new_msg, msg->sender, NULL, NULL, NULL, 0 );
-      message_set_osrf_xid( new_msg, msg->osrf_xid );
-
-               osrfLogInfo( OSRF_LOG_MARK,  "Routing message:\nfrom: [%s]\nto: [%s]", 
-                               new_msg->router_from, new_msg->recipient );
-
-               message_free( node->lastMessage );
-               node->lastMessage = new_msg;
-
-               if ( client_send_message( rclass->connection, new_msg ) == 0 ) 
-                       node->count++;
-
-               else {
-                       message_prepare_xml(new_msg);
-                       osrfLogWarning( OSRF_LOG_MARK, "Error sending message from %s to %s\n%s", 
-                                       new_msg->sender, new_msg->recipient, new_msg->msg_xml );
-               }
-
-       } 
-
-       return 0;
-}
-
-
-int osrfRouterRemoveClass( osrfRouter* router, char* classname ) {
-       if(!(router && router->classes && classname)) return -1;
-       osrfLogInfo( OSRF_LOG_MARK, "Removing router class %s", classname );
-       osrfHashRemove( router->classes, classname );
-       return 0;
-}
-
-
-int osrfRouterClassRemoveNode( 
-               osrfRouter* router, char* classname, char* remoteId ) {
-
-       if(!(router && router->classes && classname && remoteId)) return 0;
-
-       osrfLogInfo( OSRF_LOG_MARK, "Removing router node %s", remoteId );
-
-       osrfRouterClass* class = osrfRouterFindClass( router, classname );
-
-       if( class ) {
-
-               osrfHashRemove( class->nodes, remoteId );
-               if( osrfHashGetCount(class->nodes) == 0 ) {
-                       osrfRouterRemoveClass( router, classname );
-                       return 1;
-               }
-
-               return 0;
-       }
-
-       return -1;
-}
-
-
-void osrfRouterClassFree( char* classname, void* c ) {
-       if(!(classname && c)) return;
-       osrfRouterClass* rclass = (osrfRouterClass*) c;
-       client_disconnect( rclass->connection );        
-       client_free( rclass->connection );      
-
-       osrfHashIteratorReset( rclass->itr );
-       osrfRouterNode* node;
-
-       while( (node = osrfHashIteratorNext(rclass->itr)) ) 
-               osrfRouterClassRemoveNode( rclass->router, classname, node->remoteId );
-
-   osrfHashIteratorFree(rclass->itr);
-   osrfHashFree(rclass->nodes);
-
-       free(rclass);
-}
-
-
-void osrfRouterNodeFree( char* remoteId, void* n ) {
-       if(!n) return;
-       osrfRouterNode* node = (osrfRouterNode*) n;
-       free(node->remoteId);
-       message_free(node->lastMessage);
-       free(node);
-}
-
-
-void osrfRouterFree( osrfRouter* router ) {
-       if(!router) return;
-
-       free(router->domain);           
-       free(router->name);
-       free(router->resource);
-       free(router->password);
-
-       osrfStringArrayFree( router->trustedClients );
-       osrfStringArrayFree( router->trustedServers );
-
-       client_free( router->connection );
-       free(router);
-}
-
-
-
-osrfRouterClass* osrfRouterFindClass( osrfRouter* router, char* classname ) {
-       if(!( router && router->classes && classname )) return NULL;
-       return (osrfRouterClass*) osrfHashGet( router->classes, classname );
-}
-
-
-osrfRouterNode* osrfRouterClassFindNode( osrfRouterClass* rclass, char* remoteId ) {
-       if(!(rclass && remoteId))  return NULL;
-       return (osrfRouterNode*) osrfHashGet( rclass->nodes, remoteId );
-}
-
-
-int __osrfRouterFillFDSet( osrfRouter* router, fd_set* set ) {
-       if(!(router && router->classes && set)) return -1;
-
-       FD_ZERO(set);
-       int maxfd = router->ROUTER_SOCKFD;
-       FD_SET(maxfd, set);
-
-       int sockid;
-
-       osrfRouterClass* class = NULL;
-       osrfHashIterator* itr = osrfNewHashIterator(router->classes);
-
-       while( (class = osrfHashIteratorNext(itr)) ) {
-               char* classname = itr->current;
-
-               if( classname && (class = osrfRouterFindClass( router, classname )) ) {
-                       sockid = class->ROUTER_SOCKFD;
-       
-                       if( osrfUtilsCheckFileDescriptor( sockid ) ) {
-
-                               osrfLogWarning(OSRF_LOG_MARK, 
-                                       "Removing router class '%s' because of a bad top-level file descriptor [%d]", classname, sockid);
-                               osrfRouterRemoveClass( router, classname );
-       
-                       } else {
-                               if( sockid > maxfd ) maxfd = sockid;
-                               FD_SET(sockid, set);
-                       }
-               }
-       }
-
-       osrfHashIteratorFree(itr);
-       return maxfd;
-}
-
-
-
-int osrfRouterHandleAppRequest( osrfRouter* router, transport_message* msg ) {
-
-       int T = 32;
-       osrfMessage* arr[T];
-       memset(arr, 0, T );
-
-       int num_msgs = osrf_message_deserialize( msg->body, arr, T );
-       osrfMessage* omsg = NULL;
-
-       int i;
-       for( i = 0; i != num_msgs; i++ ) {
-
-               if( !(omsg = arr[i]) ) continue;
-
-               switch( omsg->m_type ) {
-
-                       case CONNECT:
-                               osrfRouterRespondConnect( router, msg, omsg );
-                               break;
-
-                       case REQUEST:
-                               osrfRouterProcessAppRequest( router, msg, omsg );
-                               break;
-
-                       default: break;
-               }
-
-               osrfMessageFree( omsg );
-       }
-
-       return 0;
-}
-
-int osrfRouterRespondConnect( osrfRouter* router, transport_message* msg, osrfMessage* omsg ) {
-       if(!(router && msg && omsg)) return -1;
-
-       osrfMessage* success = osrf_message_init( STATUS, omsg->thread_trace, omsg->protocol );
-
-       osrfLogDebug( OSRF_LOG_MARK, "router recevied a CONNECT message from %s", msg->sender );
-
-       osrf_message_set_status_info( 
-               success, "osrfConnectStatus", "Connection Successful", OSRF_STATUS_OK );
-
-       char* data      = osrf_message_serialize(success);
-
-       transport_message* return_m = message_init( 
-               data, "", msg->thread, msg->sender, "" );
-
-       client_send_message(router->connection, return_m);
-
-       free(data);
-       osrf_message_free(success);
-       message_free(return_m);
-
-       return 0;
-}
-
-
-
-int osrfRouterProcessAppRequest( osrfRouter* router, transport_message* msg, osrfMessage* omsg ) {
-
-       if(!(router && msg && omsg && omsg->method_name)) return -1;
-
-       osrfLogInfo( OSRF_LOG_MARK, "Router received app request: %s", omsg->method_name );
-
-       jsonObject* jresponse = NULL;
-       if(!strcmp( omsg->method_name, ROUTER_REQUEST_CLASS_LIST )) {
-
-               int i;
-               jresponse = jsonParseString("[]");
-
-               osrfStringArray* keys = osrfHashKeys( router->classes );
-               for( i = 0; i != keys->size; i++ )
-                       jsonObjectPush( jresponse, jsonNewObject(osrfStringArrayGetString( keys, i )) );
-               osrfStringArrayFree(keys);
-
-
-       } else {
-
-               return osrfRouterHandleMethodNFound( router, msg, omsg );
-       }
-
-
-       osrfRouterHandleAppResponse( router, msg, omsg, jresponse );
-       jsonObjectFree(jresponse); 
-
-       return 0;
-
-}
-
-
-
-int osrfRouterHandleMethodNFound( 
-               osrfRouter* router, transport_message* msg, osrfMessage* omsg ) {
-
-       osrf_message* err = osrf_message_init( STATUS, omsg->thread_trace, 1);
-               osrf_message_set_status_info( err, 
-                               "osrfMethodException", "Router method not found", OSRF_STATUS_NOTFOUND );
-
-               char* data =  osrf_message_serialize(err);
-
-               transport_message* tresponse = message_init(
-                               data, "", msg->thread, msg->sender, msg->recipient );
-
-               client_send_message(router->connection, tresponse );
-
-               free(data);
-               osrf_message_free( err );
-               message_free(tresponse);
-               return 0;
-}
-
-
-
-int osrfRouterHandleAppResponse( osrfRouter* router, 
-       transport_message* msg, osrfMessage* omsg, jsonObject* response ) {
-
-       if( response ) { /* send the response message */
-
-               osrfMessage* oresponse = osrf_message_init(
-                               RESULT, omsg->thread_trace, omsg->protocol );
-       
-               char* json = jsonObjectToJSON(response);
-               osrf_message_set_result_content( oresponse, json);
-       
-               char* data =  osrf_message_serialize(oresponse);
-               osrfLogDebug( OSRF_LOG_MARK,  "Responding to client app request with data: \n%s\n", data );
-
-               transport_message* tresponse = message_init(
-                               data, "", msg->thread, msg->sender, msg->recipient );
-       
-               client_send_message(router->connection, tresponse );
-
-               osrfMessageFree(oresponse); 
-               message_free(tresponse);
-               free(json);
-               free(data);
-       }
-
-
-       /* now send the 'request complete' message */
-       osrf_message* status = osrf_message_init( STATUS, omsg->thread_trace, 1);
-       osrf_message_set_status_info( status, "osrfConnectStatus", "Request Complete", OSRF_STATUS_COMPLETE );
-
-       char* statusdata = osrf_message_serialize(status);
-
-       transport_message* sresponse = message_init(
-                       statusdata, "", msg->thread, msg->sender, msg->recipient );
-       client_send_message(router->connection, sresponse );
-
-
-       free(statusdata);
-       osrfMessageFree(status);
-       message_free(sresponse);
-
-       return 0;
-}
-
-
-
-
diff --git a/OpenSRF/src/router/osrf_router.h b/OpenSRF/src/router/osrf_router.h
deleted file mode 100644 (file)
index 1122a08..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-#include <sys/select.h>
-#include <signal.h>
-#include <stdio.h>
-
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "opensrf/osrf_list.h"
-#include "opensrf/osrf_hash.h"
-
-#include "opensrf/string_array.h"
-#include "opensrf/transport_client.h"
-#include "opensrf/transport_message.h"
-
-#include "opensrf/osrf_message.h"
-
-
-
-/* a router maintains a list of server classes */
-struct __osrfRouterStruct {
-
-       osrfHash* classes;      /* our list of server classes */
-       char* domain;                   /* our login domain */
-       char* name;
-       char* resource;
-       char* password;
-       int port;
-
-       osrfStringArray* trustedClients;
-       osrfStringArray* trustedServers;
-
-       transport_client* connection;
-};
-
-typedef struct __osrfRouterStruct osrfRouter;
-
-
-/* a class maintains a set of server nodes */
-struct __osrfRouterClassStruct {
-       osrfRouter* router; /* our router handle */
-       osrfHashIterator* itr;
-       osrfHash* nodes;
-       transport_client* connection;
-};
-typedef struct __osrfRouterClassStruct osrfRouterClass;
-
-/* represents a link to a single server's inbound connection */
-struct __osrfRouterNodeStruct {
-       char* remoteId; /* send message to me via this login */
-       int count;                      /* how many message have been sent to this node */
-       transport_message* lastMessage;
-};
-typedef struct __osrfRouterNodeStruct osrfRouterNode;
-
-/**
-  Allocates a new router.  
-  @param domain The jabber domain to connect to
-  @param name The login name for the router
-  @param resource The login resource for the router
-  @param password The login password for the new router
-  @param port The port to connect to the jabber server on
-  @param trustedClients The array of client domains that we allow to send requests through us
-  @param trustedServers The array of server domains that we allow to register, etc. with ust.
-  @return The allocated router or NULL on memory error
-  */
-osrfRouter* osrfNewRouter( char* domain, char* name, char* resource, 
-       char* password, int port, osrfStringArray* trustedClients, osrfStringArray* trustedServers );
-
-/**
-  Connects the given router to the network
-  */
-int osrfRouterConnect( osrfRouter* router );
-
-/**
-  Waits for incoming data to route
-  If this function returns, then the router's connection to the jabber server
-  has failed.
-  */
-void osrfRouterRun( osrfRouter* router );
-
-
-/**
-  Allocates and adds a new router class handler to the router's list of handlers.
-  Also connects the class handler to the network at <routername>@domain/<classname>
-  @param router The current router instance
-  @param classname The name of the class this node handles.
-  @return 0 on success, -1 on connection error.
-  */
-osrfRouterClass* osrfRouterAddClass( osrfRouter* router, char* classname );
-
-/**
-  Adds a new server node to the given class.
-  @param rclass The Router class to add the node to
-  @param remoteId The remote login of this node
-  @return 0 on success, -1 on generic error
-  */
-int osrfRouterClassAddNode( osrfRouterClass* rclass, char* remoteId );
-
-
-/**
-  Handles top level router messages
-  @return 0 on success
-  */
-int osrfRouterHandleMessage( osrfRouter* router, transport_message* msg );
-
-
-/**
-  Handles class level requests
-  @return 0 on success
-  */
-int osrfRouterClassHandleMessage( osrfRouter* router, 
-               osrfRouterClass* rclass, transport_message* msg );
-
-/**
-  Removes a given class from the router, freeing as it goes
-  */
-int osrfRouterRemoveClass( osrfRouter* router, char* classname );
-
-/**
-  Removes the given node from the class.  Also, if this is that last node in the set,
-  removes the class from the router 
-  @return 0 on successful removal with no class removal
-  @return 1 on successful remove with class removal
-  @return -1 error on removal
- */
-int osrfRouterClassRemoveNode( osrfRouter* router, char* classname, char* remoteId );
-
-/**
-  Frees a router class object
-  Takes a void* since it is freed by the hash code
-  */
-void osrfRouterClassFree( char* classname, void* rclass );
-
-/**
-  Frees a router node object 
-  Takes a void* since it is freed by the list code
-  */
-void osrfRouterNodeFree( char* remoteId, void* node );
-
-
-/**
-  Frees a router
-  */
-void osrfRouterFree( osrfRouter* router );
-
-/**
-  Finds the class associated with the given class name in the list of classes
-  */
-osrfRouterClass* osrfRouterFindClass( osrfRouter* router, char* classname );
-
-/**
-  Finds the router node within this class with the given remote id 
-  */
-osrfRouterNode* osrfRouterClassFindNode( osrfRouterClass* rclass, char* remoteId );
-
-
-/**
-  Clears and populates the provided fd_set* with file descriptors
-  from the router's top level connection as well as each of the
-  router class connections
-  @return The largest file descriptor found in the filling process
-  */
-int __osrfRouterFillFDSet( osrfRouter* router, fd_set* set );
-
-
-
-/**
-  Utility method for handling incoming requests to the router
-  and making sure the sender is allowed.
-  */
-void osrfRouterHandleIncoming( osrfRouter* router );
-
-/**
-       Utility method for handling incoming requests to a router class,
-       makes sure sender is a trusted client
-       */
-int osrfRouterClassHandleIncoming( osrfRouter* router, char* classname,  osrfRouterClass* class );
-
-/* handles case where router node is not longer reachable.  copies over the
-       data from the last sent message and returns a newly crafted suitable for treating
-       as a newly inconing message.  Removes the dead node and If there are no more
-       nodes to send the new message to, returns NULL.
-       */
-transport_message* osrfRouterClassHandleBounce(
-               osrfRouter* router, char* classname, osrfRouterClass* rclass, transport_message* msg );
-
-
-
-/**
-  handles messages that don't have a 'router_command' set.  They are assumed to
-  be app request messages 
-  */
-int osrfRouterHandleAppRequest( osrfRouter* router, transport_message* msg );
-
-
-/**
-  Handles connects, disconnects, etc.
-  */
-int osrfRouterHandeStatusMessage( osrfRouter* router, transport_message* msg );
-
-
-/**
-  Handles REQUEST messages 
-  */
-int osrfRouterHandleRequestMessage( osrfRouter* router, transport_message* msg );
-
-
-
-int osrfRouterHandleAppRequest( osrfRouter* router, transport_message* msg );
-
-
-int osrfRouterRespondConnect( osrfRouter* router, transport_message* msg, osrfMessage* omsg );
-
-
-
-int osrfRouterProcessAppRequest( osrfRouter* router, transport_message* msg, osrfMessage* omsg );
-
-int osrfRouterHandleAppResponse( osrfRouter* router, 
-               transport_message* msg, osrfMessage* omsg, jsonObject* response );
-
-
-int osrfRouterHandleMethodNFound( osrfRouter* router, transport_message* msg, osrfMessage* omsg );
-
diff --git a/OpenSRF/src/router/osrf_router_main.c b/OpenSRF/src/router/osrf_router_main.c
deleted file mode 100644 (file)
index f3122cb..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "osrf_router.h"
-#include "opensrf/osrfConfig.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include <signal.h>
-
-osrfRouter* __osrfRouter = NULL;
-
-void routerSignalHandler( int signal ) {
-       osrfLogWarning( OSRF_LOG_MARK, "Received signal [%d], cleaning up...", signal );
-       osrfConfigCleanup();
-       osrfRouterFree(__osrfRouter);
-}
-
-static int __setupRouter( char* config, char* context );
-
-
-int main( int argc, char* argv[] ) {
-
-       if( argc < 3 ) {
-               osrfLogError( OSRF_LOG_MARK,  "Usage: %s <path_to_config_file> <config_context>", argv[0] );
-               exit(0);
-       }
-
-       char* config = strdup( argv[1] );
-       char* context = strdup( argv[2] );
-       init_proc_title( argc, argv );
-       set_proc_title( "OpenSRF Router" );
-
-       return __setupRouter( config, context );
-       free(config);
-       free(context);
-
-}
-
-int __setupRouter( char* config, char* context ) {
-
-       osrfLogInfo(OSRF_LOG_MARK, "Launching router with config "
-                       "%s and config context %s", config, context );
-       osrfConfig* cfg = osrfConfigInit( config, context );
-       osrfConfigSetDefaultConfig(cfg);
-
-
-       char* server                    = osrfConfigGetValue(NULL, "/transport/server");
-       char* port                              = osrfConfigGetValue(NULL, "/transport/port");
-       char* username                  = osrfConfigGetValue(NULL, "/transport/username");
-       char* password                  = osrfConfigGetValue(NULL, "/transport/password");
-       char* resource                  = osrfConfigGetValue(NULL, "/transport/resource");
-
-       /* set up the logger */
-       char* level = osrfConfigGetValue(NULL, "/loglevel");
-       char* log_file = osrfConfigGetValue(NULL, "/logfile");
-       char* facility = osrfConfigGetValue(NULL, "/syslog");
-
-       int llevel = 1;
-       if(level) llevel = atoi(level);
-
-       /*
-       if(!log_init( llevel, log_file )) 
-               fprintf(stderr, "Unable to init logging, going to stderr...\n" );
-               */
-
-       if(!log_file) { fprintf(stderr, "Log file needed\n"); return -1; }
-
-       if(!strcmp(log_file, "syslog")) {
-               osrfLogInit( OSRF_LOG_TYPE_SYSLOG, "router", llevel );
-               osrfLogSetSyslogFacility(osrfLogFacilityToInt(facility));
-
-       } else {
-               osrfLogInit( OSRF_LOG_TYPE_FILE, "router", llevel );
-               osrfLogSetFile( log_file );
-       }
-
-       free(facility);
-       free(level);
-       free(log_file);
-
-       osrfLogInfo(  OSRF_LOG_MARK, "Router connecting as: server: %s port: %s "
-                       "user: %s resource: %s", server, port, username, resource );
-
-       int iport = 0;
-       if(port)        iport = atoi( port );
-
-       osrfStringArray* tclients = osrfNewStringArray(4);
-       osrfStringArray* tservers = osrfNewStringArray(4);
-       osrfConfigGetValueList(NULL, tservers, "/trusted_domains/server" );
-       osrfConfigGetValueList(NULL, tclients, "/trusted_domains/client" );
-
-       int i;
-       for( i = 0; i != tservers->size; i++ ) 
-               osrfLogInfo( OSRF_LOG_MARK,  "Router adding trusted server: %s", osrfStringArrayGetString( tservers, i ) );
-
-       for( i = 0; i != tclients->size; i++ ) 
-               osrfLogInfo( OSRF_LOG_MARK,  "Router adding trusted client: %s", osrfStringArrayGetString( tclients, i ) );
-
-       if( tclients->size == 0 || tservers->size == 0 ) {
-               osrfLogError( OSRF_LOG_MARK, "We need trusted servers and trusted client to run the router...");
-               return -1;
-       }
-
-       osrfRouter* router = osrfNewRouter( server, 
-                       username, resource, password, iport, tclients, tservers );
-       
-       signal(SIGHUP,routerSignalHandler);
-       signal(SIGINT,routerSignalHandler);
-       signal(SIGTERM,routerSignalHandler);
-
-       if( (osrfRouterConnect(router)) != 0 ) {
-               fprintf(stderr, "!!!! Unable to connect router to jabber server %s... exiting", server );
-               return -1;
-       }
-
-       free(server); free(port); 
-       free(username); free(password); 
-
-       __osrfRouter = router;
-       daemonize();
-       osrfRouterRun( router );
-
-       return -1;
-}
-
-
diff --git a/OpenSRF/src/srfsh/Makefile b/OpenSRF/src/srfsh/Makefile
deleted file mode 100644 (file)
index 17526a0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# if EXEC_DEFAULT is defined, then srfsh will send all unknown commands to the shell for execution
-
-LDLIBS +=  -lreadline -lxml2 -lopensrf -lncurses 
-LDFLAGS        += -DEXEC_DEFAULT
-
-all: srfsh
-
-srfsh: srfsh.o
-srfsh.o:       srfsh.c srfsh.h
-
-install: 
-       cp srfsh $(BINDIR)
-
-clean:
-       /bin/rm -f *.o srfsh
diff --git a/OpenSRF/src/srfsh/srfsh.c b/OpenSRF/src/srfsh/srfsh.c
deleted file mode 100644 (file)
index a5e1f82..0000000
+++ /dev/null
@@ -1,882 +0,0 @@
-#include "srfsh.h"
-
-int recv_timeout = 120;
-int is_from_script = 0;
-FILE* shell_writer = NULL;
-FILE* shell_reader = NULL;
-
-int main( int argc, char* argv[] ) {
-
-       /* --------------------------------------------- */
-       /* see if they have a .srfsh.xml in their home directory */
-       char* home = getenv("HOME");
-       int l = strlen(home) + 36;
-       char fbuf[l];
-       memset(fbuf, 0, l);
-       sprintf(fbuf,"%s/.srfsh.xml",home);
-       
-       if(!access(fbuf, R_OK)) {
-               if( ! osrf_system_bootstrap_client(fbuf, "srfsh") ) {
-                       fprintf(stderr,"Unable to bootstrap client for requests\n");
-                       osrfLogError( OSRF_LOG_MARK,  "Unable to bootstrap client for requests");
-                       return -1;
-               }
-
-       } else {
-               fprintf(stderr,"No Config file found at %s\n", fbuf ); 
-               return -1;
-       }
-
-       if(argc > 1) {
-               /* for now.. the first arg is used as a script file for processing */
-               int f;
-               if( (f = open(argv[1], O_RDONLY)) == -1 ) {
-                       osrfLogError( OSRF_LOG_MARK, "Unable to open file %s for reading, exiting...", argv[1]);
-                       return -1;
-               }
-
-               if(dup2(f, STDIN_FILENO) == -1) {
-                       osrfLogError( OSRF_LOG_MARK, "Unable to duplicate STDIN, exiting...");
-                       return -1;
-               }
-
-               close(f);
-               is_from_script = 1;
-       }
-               
-       /* --------------------------------------------- */
-       load_history();
-
-
-       client = osrf_system_get_transport_client();
-
-       /* open the shell handle */
-       shell_writer = popen( "bash", "w");
-       //shell_reader = popen( "bash", "r");
-
-       /* main process loop */
-       char* request;
-       while((request=readline(prompt))) {
-
-               if( !strcasecmp(request, "exit") || !strcasecmp(request,"quit")) 
-                       break; 
-
-               char* req_copy = strdup(request);
-
-               parse_request( req_copy ); 
-               if( request && strlen(request) > 1 ) {
-                       add_history(request);
-               }
-
-               free(request);
-               free(req_copy);
-
-               fflush(shell_writer);
-               fflush(stderr);
-               fflush(stdout);
-       }
-
-       if(history_file != NULL )
-               write_history(history_file);
-
-       free(request);
-
-       osrf_system_shutdown();
-       return 0;
-}
-
-void sig_child_handler( int s ) {
-       child_dead = 1;
-}
-
-/*
-void sig_int_handler( int s ) {
-       printf("\n");
-       caught_sigint = 1;
-       signal(SIGINT,sig_int_handler);
-}
-*/
-
-int load_history() {
-
-       char* home = getenv("HOME");
-       int l = strlen(home) + 24;
-       char fbuf[l];
-
-       memset(fbuf, 0, l);
-       sprintf(fbuf,"%s/.srfsh_history",home);
-       history_file = strdup(fbuf);
-
-       if(!access(history_file, W_OK | R_OK )) {
-               history_length = 5000;
-               read_history(history_file);
-       }
-       return 1;
-}
-
-
-int parse_error( char* words[] ) {
-
-       if( ! words )
-               return 0;
-
-
-       int i = 0;
-       char* current;
-       char buffer[256];
-       memset(buffer, 0, 256);
-       while( (current=words[i++]) ) {
-               strcat(buffer, current);
-               strcat(buffer, " ");
-       }
-       if( ! buffer || strlen(buffer) < 1 ) 
-               printf("\n");
-
-       fprintf( stderr, "???: %s\n", buffer );
-       return 0;
-
-}
-
-
-int parse_request( char* request ) {
-
-       if( request == NULL )
-               return 0;
-
-       int ret_val = 0;
-       int i = 0;
-       char* words[COMMAND_BUFSIZE]; 
-       memset(words,0,COMMAND_BUFSIZE);
-       char* req = request;
-
-       char* cur_tok = strtok( req, " " );
-
-       if( cur_tok == NULL )
-               return 0;
-
-       while(cur_tok != NULL) {
-               words[i++] = cur_tok;
-               cur_tok = strtok( NULL, " " );
-       }
-
-
-       // not sure why (strtok?), but this is necessary
-       memset( words + i, 0, COMMAND_BUFSIZE - i );
-
-       /* pass off to the top level command */
-       if( !strcmp(words[0],"router") ) 
-               ret_val = handle_router( words );
-
-       /*
-       else if( !strcmp(words[0],"time") ) 
-               ret_val = handle_time( words );
-               */
-
-       else if (!strcmp(words[0],"request"))
-               ret_val = handle_request( words, 0 );
-
-       else if (!strcmp(words[0],"relay"))
-               ret_val = handle_request( words, 1 );
-
-       else if (!strcmp(words[0],"help"))
-               ret_val = print_help();
-
-       else if (!strcmp(words[0],"set"))
-               ret_val = handle_set(words);
-
-       else if (!strcmp(words[0],"print"))
-               ret_val = handle_print(words);
-
-       else if (!strcmp(words[0],"math_bench"))
-               ret_val = handle_math(words);
-
-       else if (!strcmp(words[0],"introspect"))
-               ret_val = handle_introspect(words);
-
-       else if (!strcmp(words[0],"login"))
-               ret_val = handle_login(words);
-
-       else if (words[0][0] == '!')
-               ret_val = handle_exec( words, 1 );
-
-       if(!ret_val) {
-               #ifdef EXEC_DEFAULT
-                       return handle_exec( words, 0 );
-               #else
-                       return parse_error( words );
-               #endif
-       }
-
-       return 1;
-
-}
-
-
-int handle_introspect(char* words[]) {
-
-       if(words[1] && words[2]) {
-               fprintf(stderr, "--> %s\n", words[1]);
-               char buf[256];
-               memset(buf,0,256);
-               sprintf( buf, "request %s opensrf.system.method %s", words[1], words[2] );
-               return parse_request( buf );
-
-       } else {
-       
-               if(words[1]) {
-                       fprintf(stderr, "--> %s\n", words[1]);
-                       char buf[256];
-                       memset(buf,0,256);
-                       sprintf( buf, "request %s opensrf.system.method.all", words[1] );
-                       return parse_request( buf );
-               }
-       }
-
-       return 0;
-}
-
-
-int handle_login( char* words[]) {
-
-       if( words[1] && words[2]) {
-
-               char* username          = words[1];
-               char* password          = words[2];
-               char* type                      = words[3];
-               char* orgloc            = words[4];
-               char* workstation       = words[5];
-               int orgloci = (orgloc) ? atoi(orgloc) : 0;
-               if(!type) type = "opac";
-
-               char buf[256];
-               memset(buf,0,256);
-
-               char buf2[256];
-               memset(buf2,0,256);
-
-               sprintf( buf, 
-                               "request open-ils.auth open-ils.auth.authenticate.init \"%s\"", username );
-               parse_request(buf); 
-
-               char* hash;
-               if(last_result && last_result->_result_content) {
-                       jsonObject* r = last_result->_result_content;
-                       hash = jsonObjectGetString(r);
-               } else return 0;
-
-
-               char* pass_buf = md5sum(password);
-
-               char both_buf[256];
-               memset(both_buf,0,256);
-               sprintf(both_buf,"%s%s",hash, pass_buf);
-
-               char* mess_buf = md5sum(both_buf);
-
-               /*
-               sprintf( buf2, "request open-ils.auth open-ils.auth.authenticate.complete "
-                               "{ \"username\" : \"%s\", \"password\" : \"%s\", "
-                               "\"type\" : \"%s\", \"org\" : %d, \"workstation\": \"%s\"}", 
-                               username, mess_buf, type, orgloci, workstation );
-                               */
-
-               growing_buffer* argbuf = buffer_init(64);
-               buffer_fadd(argbuf, 
-                               "request open-ils.auth open-ils.auth.authenticate.complete "
-                               "{ \"username\" : \"%s\", \"password\" : \"%s\"", username, mess_buf );
-
-               if(type) buffer_fadd( argbuf, ", \"type\" : \"%s\"", type );
-               if(orgloci) buffer_fadd( argbuf, ", \"org\" : %d", orgloci );
-               if(workstation) buffer_fadd( argbuf, ", \"workstation\" : \"%s\"", workstation);
-               buffer_add(argbuf, "}");
-
-               free(pass_buf);
-               free(mess_buf);
-
-               parse_request( argbuf->buf );
-               buffer_free(argbuf);
-
-               jsonObject* x = last_result->_result_content;
-               double authtime = 0;
-               if(x) {
-                       char* authtoken = jsonObjectGetString(
-                                       jsonObjectGetKey(jsonObjectGetKey(x,"payload"), "authtoken"));
-                       authtime  = jsonObjectGetNumber(
-                                       jsonObjectGetKey(jsonObjectGetKey(x,"payload"), "authtime"));
-                       if(authtoken) login_session = strdup(authtoken);
-                       else login_session = NULL;
-               }
-               else login_session = NULL;
-
-               printf("Login Session: %s.  Session timeout: %f\n", login_session, authtime );
-               
-               return 1;
-
-       }
-
-       return 0;
-}
-
-int handle_set( char* words[]) {
-
-       char* variable;
-       if( (variable=words[1]) ) {
-
-               char* val;
-               if( (val=words[2]) ) {
-
-                       if(!strcmp(variable,"pretty_print")) {
-                               if(!strcmp(val,"true")) {
-                                       pretty_print = 1;
-                                       printf("pretty_print = true\n");
-                                       return 1;
-                               } 
-                               if(!strcmp(val,"false")) {
-                                       pretty_print = 0;
-                                       printf("pretty_print = false\n");
-                                       return 1;
-                               } 
-                       }
-
-                       if(!strcmp(variable,"raw_print")) {
-                               if(!strcmp(val,"true")) {
-                                       raw_print = 1;
-                                       printf("raw_print = true\n");
-                                       return 1;
-                               } 
-                               if(!strcmp(val,"false")) {
-                                       raw_print = 0;
-                                       printf("raw_print = false\n");
-                                       return 1;
-                               } 
-                       }
-
-               }
-       }
-
-       return 0;
-}
-
-
-int handle_print( char* words[]) {
-
-       char* variable;
-       if( (variable=words[1]) ) {
-               if(!strcmp(variable,"pretty_print")) {
-                       if(pretty_print) {
-                               printf("pretty_print = true\n");
-                               return 1;
-                       } else {
-                               printf("pretty_print = false\n");
-                               return 1;
-                       }
-               }
-
-               if(!strcmp(variable,"login")) {
-                       printf("login session = %s\n", login_session );
-                       return 1;
-               }
-
-       }
-       return 0;
-}
-
-int handle_router( char* words[] ) {
-
-       if(!client)
-               return 1;
-
-       int i;
-
-       if( words[1] ) { 
-               if( !strcmp(words[1],"query") ) {
-                       
-                       if( words[2] && !strcmp(words[2],"servers") ) {
-                               for(i=3; i < COMMAND_BUFSIZE - 3 && words[i]; i++ ) {   
-                                       router_query_servers( words[i] );
-                               }
-                               return 1;
-                       }
-                       return 0;
-               }
-               return 0;
-       }
-       return 0;
-}
-
-
-/* if new shell, spawn a new child and subshell to do the work,
-       otherwise pipe the request to the currently open (piped) shell */
-int handle_exec(char* words[], int new_shell) {
-
-       if(!words[0]) return 0;
-
-       if( words[0] && words[0][0] == '!') {
-               int len = strlen(words[0]);
-               char command[len];
-               memset(command,0,len);
-       
-               int i; /* chop out the ! */
-               for( i=1; i!= len; i++) {
-                       command[i-1] = words[0][i];
-               }
-       
-               free(words[0]);
-               words[0] = strdup(command);
-       }
-
-       if(new_shell) {
-               signal(SIGCHLD, sig_child_handler);
-
-               if(fork()) {
-       
-                       waitpid(-1, 0, 0);
-                       if(child_dead) {
-                               signal(SIGCHLD,sig_child_handler);
-                               child_dead = 0;
-                       }
-       
-               } else {
-                       execvp( words[0], words );
-                       exit(0);
-               }
-
-       } else {
-
-
-               growing_buffer* b = buffer_init(64);
-               int i = 0;
-               while(words[i]) 
-                       buffer_fadd( b, "%s ", words[i++] );
-       
-               buffer_add( b, "\n");
-       
-               //int reader;
-               //int reader = dup2(STDOUT_FILENO, reader);
-               //int reader = dup(STDOUT_FILENO);
-               //close(STDOUT_FILENO);
-
-               fprintf( shell_writer, b->buf );
-               buffer_free(b);
-       
-               fflush(shell_writer);
-               usleep(1000);
-
-               /*
-               char c[4096];
-               bzero(c, 4096);
-               read( reader, c, 4095 );
-               fprintf(stderr, "read %s", c);
-               dup2(reader, STDOUT_FILENO);
-               */
-
-       }
-
-       
-       return 1;
-}
-
-
-int handle_request( char* words[], int relay ) {
-
-       if(!client)
-               return 1;
-
-       if(words[1]) {
-               char* server = words[1];
-               char* method = words[2];
-               int i;
-               growing_buffer* buffer = NULL;
-               if(!relay) {
-                       buffer = buffer_init(128);
-                       buffer_add(buffer, "[");
-                       for(i = 3; words[i] != NULL; i++ ) {
-                               /* removes trailing semicolon if user accidentally enters it */
-                               if( words[i][strlen(words[i])-1] == ';' )
-                                       words[i][strlen(words[i])-1] = '\0';
-                               buffer_add( buffer, words[i] );
-                               buffer_add(buffer, " ");
-                       }
-                       buffer_add(buffer, "]");
-               }
-
-               return send_request( server, method, buffer, relay );
-       } 
-
-       return 0;
-}
-
-int send_request( char* server, 
-               char* method, growing_buffer* buffer, int relay ) {
-       if( server == NULL || method == NULL )
-               return 0;
-
-       jsonObject* params = NULL;
-       if( !relay ) {
-               if( buffer != NULL && buffer->n_used > 0 ) 
-                       params = jsonParseString(buffer->buf);
-       } else {
-               if(!last_result || ! last_result->_result_content) { 
-                       printf("We're not going to call 'relay' with no result params\n");
-                       return 1;
-               }
-               else {
-                       jsonObject* o = jsonNewObject(NULL);
-                       jsonObjectPush(o, last_result->_result_content );
-                       params = o;
-               }
-       }
-
-
-       if(buffer->n_used > 0 && params == NULL) {
-               fprintf(stderr, "JSON error detected, not executing\n");
-               return 1;
-       }
-
-       osrf_app_session* session = osrf_app_client_session_init(server);
-
-       if(!osrf_app_session_connect(session)) {
-               osrfLogWarning( OSRF_LOG_MARK,  "Unable to connect to remote service %s\n", server );
-               return 1;
-       }
-
-       double start = get_timestamp_millis();
-       //int req_id = osrf_app_session_make_request( session, params, method, 1, NULL );
-       int req_id = osrf_app_session_make_req( session, params, method, 1, NULL );
-
-
-       osrf_message* omsg = osrf_app_session_request_recv( session, req_id, recv_timeout );
-
-       if(!omsg) 
-               printf("\nReceived no data from server\n");
-       
-       
-       signal(SIGPIPE, SIG_IGN);
-
-       FILE* less; 
-       if(!is_from_script) less = popen( "less -EX", "w");
-       else less = stdout;
-
-       if( less == NULL ) { less = stdout; }
-
-       growing_buffer* resp_buffer = buffer_init(4096);
-
-       while(omsg) {
-
-               if(raw_print) {
-
-                       if(omsg->_result_content) {
-       
-                               osrf_message_free(last_result);
-                               last_result = omsg;
-       
-                               char* content;
-       
-                               if( pretty_print && omsg->_result_content ) {
-                                       char* j = jsonObjectToJSON(omsg->_result_content);
-                                       //content = json_printer(j); 
-                                       content = jsonFormatString(j);
-                                       free(j);
-                               } else
-                                       content = jsonObjectGetString(omsg->_result_content);
-       
-                               printf( "\nReceived Data: %s\n", content ); 
-                               free(content);
-       
-                       } else {
-
-                               char code[16];
-                               memset(code, 0, 16);
-                               sprintf( code, "%d", omsg->status_code );
-                               buffer_add( resp_buffer, code );
-
-                               printf( "\nReceived Exception:\nName: %s\nStatus: %s\nStatus: %s\n", 
-                                               omsg->status_name, omsg->status_text, code );
-
-                               fflush(stdout);
-                       }
-
-               } else {
-
-                       if(omsg->_result_content) {
-       
-                               osrf_message_free(last_result);
-                               last_result = omsg;
-       
-                               char* content;
-       
-                               if( pretty_print && omsg->_result_content ) {
-                                       char* j = jsonObjectToJSON(omsg->_result_content);
-                                       //content = json_printer(j); 
-                                       content = jsonFormatString(j);
-                                       free(j);
-                               } else
-                                       content = jsonObjectGetString(omsg->_result_content);
-       
-                               buffer_add( resp_buffer, "\nReceived Data: " ); 
-                               buffer_add( resp_buffer, content );
-                               buffer_add( resp_buffer, "\n" );
-                               free(content);
-       
-                       } else {
-       
-                               buffer_add( resp_buffer, "\nReceived Exception:\nName: " );
-                               buffer_add( resp_buffer, omsg->status_name );
-                               buffer_add( resp_buffer, "\nStatus: " );
-                               buffer_add( resp_buffer, omsg->status_text );
-                               buffer_add( resp_buffer, "\nStatus: " );
-                               char code[16];
-                               memset(code, 0, 16);
-                               sprintf( code, "%d", omsg->status_code );
-                               buffer_add( resp_buffer, code );
-                       }
-               }
-
-
-               omsg = osrf_app_session_request_recv( session, req_id, recv_timeout );
-
-       }
-
-       double end = get_timestamp_millis();
-
-       fprintf( less, resp_buffer->buf );
-       buffer_free( resp_buffer );
-       fprintf( less, "\n------------------------------------\n");
-       if( osrf_app_session_request_complete( session, req_id ))
-               fprintf(less, "Request Completed Successfully\n");
-
-
-       fprintf(less, "Request Time in seconds: %.6f\n", end - start );
-       fprintf(less, "------------------------------------\n");
-
-       pclose(less); 
-
-       osrf_app_session_request_finish( session, req_id );
-       osrf_app_session_disconnect( session );
-       osrf_app_session_destroy( session );
-
-
-       return 1;
-
-
-}
-
-/*
-int handle_time( char* words[] ) {
-
-       if( ! words[1] ) {
-
-               char buf[36];
-               memset(buf,0,36);
-               get_timestamp(buf);
-               printf( "%s\n", buf );
-               return 1;
-       }
-
-       if( words[1] ) {
-               time_t epoch = (time_t)atoi( words[1] );
-               char* localtime = strdup( ctime( &epoch ) );
-               printf( "%s => %s", words[1], localtime );
-               free(localtime);
-               return 1;
-       }
-
-       return 0;
-
-}
-*/
-
-               
-
-int router_query_servers( char* router_server ) {
-
-       if( ! router_server || strlen(router_server) == 0 ) 
-               return 0;
-
-       char rbuf[256];
-       memset(rbuf,0,256);
-       sprintf(rbuf,"router@%s/router", router_server );
-               
-       transport_message* send = 
-               message_init( "servers", NULL, NULL, rbuf, NULL );
-       message_set_router_info( send, NULL, NULL, NULL, "query", 0 );
-
-       client_send_message( client, send );
-       message_free( send );
-
-       transport_message* recv = client_recv( client, -1 );
-       if( recv == NULL ) {
-               fprintf(stderr, "NULL message received from router\n");
-               return 1;
-       }
-       
-       printf( 
-                       "---------------------------------------------------------------------------------\n"
-                       "Received from 'server' query on %s\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "original reg time | latest reg time | last used time | class | server\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "%s"
-                       "---------------------------------------------------------------------------------\n"
-                       , router_server, recv->body );
-
-       message_free( recv );
-       
-       return 1;
-}
-               
-int print_help() {
-
-       printf(
-                       "---------------------------------------------------------------------------------\n"
-                       "Commands:\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "help                   - Display this message\n"
-                       "!<command> [args] - Forks and runs the given command in the shell\n"
-                       "time                   - Prints the current time\n"                                    
-                       "time <timestamp>       - Formats seconds since epoch into readable format\n"   
-                       "set <variable> <value> - set a srfsh variable (e.g. set pretty_print true )\n"
-                       "print <variable>               - Displays the value of a srfsh variable\n"
-                       "---------------------------------------------------------------------------------\n"
-
-                       "router query servers <server1 [, server2, ...]>\n"
-                       "       - Returns stats on connected services\n"
-                       "\n"
-                       "\n"
-                       "request <service> <method> [ <json formatted string of params> ]\n"
-                       "       - Anything passed in will be wrapped in a json array,\n"
-                       "               so add commas if there is more than one param\n"
-                       "\n"
-                       "\n"
-                       "relay <service> <method>\n"
-                       "       - Performs the requested query using the last received result as the param\n"
-                       "\n"
-                       "\n"
-                       "math_bench <num_batches> [0|1|2]\n"
-                       "       - 0 means don't reconnect, 1 means reconnect after each batch of 4, and\n"
-                       "                2 means reconnect after every request\n"
-                       "\n"
-                       "introspect <service>\n"
-                       "       - prints the API for the service\n"
-                       "\n"
-                       "\n"
-                       "---------------------------------------------------------------------------------\n"
-                       " Commands for Open-ILS\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "login <username> <password>\n"
-                       "       -       Logs into the 'server' and displays the session id\n"
-                       "       - To view the session id later, enter: print login\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "\n"
-                       "\n"
-                       "Note: long output is piped through 'less'.  To search in 'less', type: /<search>\n"
-                       "---------------------------------------------------------------------------------\n"
-                       "\n"
-                       );
-
-       return 1;
-}
-
-
-
-char* tabs(int count) {
-       growing_buffer* buf = buffer_init(24);
-       int i;
-       for(i=0;i!=count;i++)
-               buffer_add(buf, "  ");
-
-       char* final = buffer_data( buf );
-       buffer_free( buf );
-       return final;
-}
-
-int handle_math( char* words[] ) {
-       if( words[1] )
-               return do_math( atoi(words[1]), 0 );
-       return 0;
-}
-
-
-int do_math( int count, int style ) {
-
-       osrf_app_session* session = osrf_app_client_session_init(  "opensrf.math" );
-       osrf_app_session_connect(session);
-
-       jsonObject* params = jsonParseString("[]");
-       jsonObjectPush(params,jsonNewObject("1"));
-       jsonObjectPush(params,jsonNewObject("2"));
-
-       char* methods[] = { "add", "sub", "mult", "div" };
-       char* answers[] = { "3", "-1", "2", "0.500000" };
-
-       float times[ count * 4 ];
-       memset(times,0,count*4);
-
-       int k;
-       for(k=0;k!=100;k++) {
-               if(!(k%10)) 
-                       fprintf(stderr,"|");
-               else
-                       fprintf(stderr,".");
-       }
-
-       fprintf(stderr,"\n\n");
-
-       int running = 0;
-       int i;
-       for(i=0; i!= count; i++) {
-
-               int j;
-               for(j=0; j != 4; j++) {
-
-                       ++running;
-
-                       double start = get_timestamp_millis();
-                       int req_id = osrf_app_session_make_req( session, params, methods[j], 1, NULL );
-                       osrf_message* omsg = osrf_app_session_request_recv( session, req_id, 5 );
-                       double end = get_timestamp_millis();
-
-                       times[(4*i) + j] = end - start;
-
-                       if(omsg) {
-       
-                               if(omsg->_result_content) {
-                                       char* jsn = jsonObjectToJSON(omsg->_result_content);
-                                       if(!strcmp(jsn, answers[j]))
-                                               fprintf(stderr, "+");
-                                       else
-                                               fprintf(stderr, "\n![%s] - should be %s\n", jsn, answers[j] );
-                                       free(jsn);
-                               }
-
-
-                               osrf_message_free(omsg);
-               
-                       } else { fprintf( stderr, "\nempty message for tt: %d\n", req_id ); }
-
-                       osrf_app_session_request_finish( session, req_id );
-
-                       if(style == 2)
-                               osrf_app_session_disconnect( session );
-
-                       if(!(running%100))
-                               fprintf(stderr,"\n");
-               }
-
-               if(style==1)
-                       osrf_app_session_disconnect( session );
-       }
-
-       osrf_app_session_destroy( session );
-       jsonObjectFree(params);
-
-       int c;
-       float total = 0;
-       for(c=0; c!= count*4; c++) 
-               total += times[c];
-
-       float avg = total / (count*4); 
-       fprintf(stderr, "\n      Average round trip time: %f\n", avg );
-
-       return 1;
-}
diff --git a/OpenSRF/src/srfsh/srfsh.h b/OpenSRF/src/srfsh/srfsh.h
deleted file mode 100644 (file)
index f6fc7ca..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "opensrf/transport_client.h"
-#include "opensrf/osrf_message.h"
-#include "opensrf/osrf_app_session.h"
-#include <time.h>
-#include <sys/timeb.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "utils.h"
-#include "log.h"
-
-#include <signal.h>
-
-#include <stdio.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-
-
-
-
-#define SRFSH_PORT 5222
-#define COMMAND_BUFSIZE 4096
-
-
-/* shell prompt */
-char* prompt = "srfsh# "; 
-
-char* history_file = NULL;
-
-int child_dead = 0;
-
-char* login_session = NULL;
-
-/* true if we're pretty printing json results */
-int pretty_print = 1;
-/* true if we're bypassing 'less' */
-int raw_print = 0;
-
-/* our jabber connection */
-transport_client* client = NULL; 
-
-/* the last result we received */
-osrf_message* last_result = NULL;
-
-/* functions */
-int parse_request( char* request );
-
-/* handles router requests */
-int handle_router( char* words[] );
-
-/* utility method for print time data */
-int handle_time( char* words[] );
-
-/* handles app level requests */
-int handle_request( char* words[], int relay );
-int handle_exec(char* words[], int new_shell);
-int handle_set( char* words[]);
-int handle_print( char* words[]);
-int send_request( char* server, 
-               char* method, growing_buffer* buffer, int relay );
-int parse_error( char* words[] );
-int router_query_servers( char* server );
-int srfsh_client_connect();
-int print_help();
-char* tabs(int count);
-void sig_child_handler( int s );
-void sig_int_handler( int s );
-
-int load_history();
-int handle_math( char* words[] );
-int do_math( int count, int style );
-int handle_introspect(char* words[]);
-int handle_login( char* words[]);
diff --git a/OpenSRF/src/utils/Makefile b/OpenSRF/src/utils/Makefile
deleted file mode 100644 (file)
index 77eae02..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-
-UTIL_HEADERS = md5.h log.h utils.h socket_bundle.h sha.h string_array.h xml_utils.h
-UTIL_OBJECTS = md5.o log.o utils.o socket_bundle.o sha.o string_array.o 
-
-all:   $(UTIL_OBJECTS) copy
-
-copy:
-       cp $(UTIL_HEADERS) $(TMPDIR)
-
-log.o: log.c log.h
-utils.o: utils.c utils.h
-socket_bundle.o: socket_bundle.c socket_bundle.h
-md5.o: md5.c md5.h
-sha.o: sha.c sha.h
-string_array.o: string_array.c string_array.h
-
-
-clean:
-       /bin/rm -f *.o 
-
-
diff --git a/OpenSRF/src/utils/fieldmapper-c.pl b/OpenSRF/src/utils/fieldmapper-c.pl
deleted file mode 100755 (executable)
index 063e614..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-#!/usr/bin/perl
-use strict; use warnings;
-use Data::Dumper; 
-use OpenILS::Utils::Fieldmapper;  
-
-
-if(!$ARGV[1]) {
-       print "usage: $0 <header_file> <source_file>\n";
-       exit;
-}
-
-warn "Generating fieldmapper-c code...\n";
-
-#open(HEADER, ">fieldmapper.h");
-#open(SOURCE, ">fieldmapper.c");
-
-print $ARGV[0] . "\n";
-print $ARGV[1] . "\n";
-
-open(HEADER, ">$ARGV[0]");
-open(SOURCE, ">$ARGV[1]");
-
-my $map = $Fieldmapper::fieldmap;
-
-print HEADER <<C;
-
-#include "opensrf/osrf_json.h"
-#include "utils.h"
-
-/* Fieldmapper-C.  Autogenerated from fieldmapper-c.pl.\n\nNote that object*'s passed in as
-constructor parameters are copied in so the originals will need to be freed*/
-
-/* fm_obj is the generic placeholder object */
-struct fm_obj_struct { 
-       char* classname; 
-       object* array;
-};
-typedef struct fm_obj_struct fm_obj;
-
-/* takes a json object and builds a fieldmapper object.  the object
-       is then cast into an fm_obj and returned.  To verify an object is
-       what is expected, check fm_obj_thing->classname. */
-fm_obj* fm_factory(object*);
-
-/* builds a new fieldmapper object by class name */
-fm_obj* fm_factory_string(char*);
-
-void fm_free(fm_obj* fm);
-C
-
-print SOURCE <<C;
-#include "fieldmapper.h"
-
-void fm_free(fm_obj* fm) {
-       if(!fm) return;
-       free_object(fm->array);
-       free(fm);
-}
-C
-
-my $factory_string = <<C;
-fm_obj* fm_factory(object* obj) {
-
-       if(!obj) return NULL;
-       if(!obj->classname) return NULL;
-       fm_obj* fm = NULL;
-
-C
-
-my $fstring_string = <<C;
-fm_obj* fm_factory_string(char* string) {
-       if(!string) return NULL;
-       object* obj = new_object(NULL);
-       object* tmp = NULL;
-C
-
-for my $object (keys %$map) {
-
-       my $short_name                          = $map->{$object}->{hint};
-       my $func_header_string  = "";
-       my $func_code_string            = "";
-       my $constructor_string  = "";
-
-       $factory_string .= <<CODE;
-       if(!strcmp(obj->classname,"$short_name"))
-               fm = (fm_obj*) fm_new_$short_name(obj);
-CODE
-
-       $fstring_string .= <<CODE;
-       if(!strcmp(string, "$short_name")) {
-               obj->set_class(obj, "$short_name");
-CODE
-
-       my $header_string = <<CODE;
-struct fm_${short_name}_struct {
-       char* classname;
-       object* array;
-       char*\t\t(*to_string) (struct fm_${short_name}_struct*);
-CODE
-
-       $func_header_string .= <<CODE;
-char* fm_${short_name}_to_string(fm_$short_name*);
-CODE
-
-       my $to_string   = <<CODE;
-char* fm_${short_name}_to_string(fm_$short_name* fm) {
-       if(!fm || !fm->array) return NULL;
-       growing_buffer* buf = buffer_init(256);
-       buffer_fadd(buf, "%s => {\\n", fm->classname);
-       object* o;
-CODE
-
-       $constructor_string .= <<CODE; 
-fm_$short_name* fm_new_$short_name(object* obj_array) {
-
-       fm_$short_name* fm = (fm_$short_name*) safe_malloc(sizeof(fm_$short_name));
-
-       /* build an empty array object */
-       if(!obj_array) {
-               fm->array = new_object(NULL);
-               fm->array->is_array = 1;
-               fm->array->set_class(fm->array, "$short_name");
-
-       } else {
-
-               /* we don't want invalid objects */
-               if (!obj_array->classname) return NULL;
-               if(strcmp(obj_array->classname, "$short_name")) return NULL;
-       
-               char* s = obj_array->to_json(obj_array);
-               fm->array = json_parse_string(s);
-               free(s);
-       }
-
-       fm->classname = fm->array->classname;
-       fm->to_string = &fm_${short_name}_to_string;
-CODE
-
-       for my $field (keys %{$map->{$object}->{fields}}) {
-               my $position = $map->{$object}->{fields}->{$field}->{position};
-
-               $to_string .= <<CODE;
-       o = fm->array->get_index(fm->array, $position);
-       if(o) {
-               char* str = o->to_json(o);
-               buffer_fadd(buf, "  $field\\t: %s\\n", str);
-               free(str);
-       };
-CODE
-               
-               $fstring_string .= <<CODE;
-               tmp = new_object(NULL);
-               tmp->is_null = 1;
-               obj->set_index(obj, $position, tmp);
-CODE
-
-               $header_string .= <<CODE;
-       object*\t(*get_$field) (struct fm_${short_name}_struct*);
-       void\t\t(*set_$field) (struct fm_${short_name}_struct*, object*);
-CODE
-
-               $constructor_string .= <<CODE;
-       fm->set_$field = &fm_${short_name}_set_$field;
-       fm->get_$field = &fm_${short_name}_get_$field;
-CODE
-
-               $func_header_string .= <<CODE;
-object* fm_${short_name}_get_$field(fm_$short_name*);
-void fm_${short_name}_set_$field(fm_$short_name*, object*);
-CODE
-
-               $func_code_string .= <<CODE
-       object* fm_${short_name}_get_$field(fm_$short_name* fm) {
-               if(!fm || !fm->array) return NULL;
-               return fm->array->get_index(fm->array, $position);
-       }
-
-       void fm_${short_name}_set_$field(fm_$short_name* fm, object* obj) {
-               if(!fm || !fm->array || !obj) return;
-               fm->array->set_index(fm->array, $position, obj);
-       }
-CODE
-
-       }
-
-       $fstring_string .= <<CODE;
-               return (fm_obj*) fm_new_$short_name(obj);
-       }
-CODE
-
-       $to_string .= <<CODE;
-       buffer_add(buf,"}\\n");
-       char* b = buffer_data(buf);
-       buffer_free(buf);
-       return b;
-}
-CODE
-
-       $constructor_string .= "\treturn fm;\n}\n";
-       $header_string .= "};\n";
-       $func_code_string = $constructor_string . $to_string . $func_code_string;
-
-       $header_string .= "typedef struct fm_$short_name"."_struct fm_$short_name;\n\n";
-       $header_string .= "fm_$short_name* fm_new_$short_name(object*);\n";
-       $header_string .= "$func_header_string\n";
-
-       print HEADER "\n$header_string\n";
-       print SOURCE "\n$func_code_string\n";
-
-
-}
-
-$factory_string .= "\treturn fm;\n}\n";
-#$fstring_string .= "\treturn NULL;\n}\n";
-$fstring_string .= <<CODE;
-       free_object(obj);
-       return NULL;
-}
-CODE
-
-print SOURCE "\n$factory_string\n";
-print SOURCE "\n$fstring_string\n";
-
-close HEADER;
-close SOURCE;
-
-warn  "done\n";
-
diff --git a/OpenSRF/src/utils/log.c b/OpenSRF/src/utils/log.c
deleted file mode 100644 (file)
index be2abe0..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-#include "log.h"
-
-int __osrfLogType                                      = -1;
-int __osrfLogFacility                  = LOG_LOCAL0;
-int __osrfLogActFacility               = LOG_LOCAL1;
-char* __osrfLogFile                            = NULL;
-char* __osrfLogAppname                 = NULL;
-int __osrfLogLevel                             = OSRF_LOG_INFO;
-int __osrfLogActivityEnabled   = 1;
-int __osrfLogIsClient         = 0;
-
-
-int __osrfLogXidInc              = 0; /* increments with each new xid for uniqueness */
-char* __osrfLogXid            = NULL; /* current xid */
-char* __osrfLogXidPfx         = NULL; /* xid prefix string */
-
-
-void osrfLogCleanup() {
-       free(__osrfLogAppname);
-       free(__osrfLogFile);
-}
-
-
-void osrfLogInit( int type, const char* appname, int maxlevel ) {
-       osrfLogSetType(type);
-       if(appname) osrfLogSetAppname(appname);
-       osrfLogSetLevel(maxlevel);
-       if( type == OSRF_LOG_TYPE_SYSLOG ) 
-               openlog(__osrfLogAppname, 0, __osrfLogFacility );
-}
-
-static void __osrfLogSetXid(char* xid) {
-   if(xid) {
-      if(__osrfLogXid) free(__osrfLogXid);
-      __osrfLogXid = strdup(xid);
-   }
-}
-
-void osrfLogClearXid() { __osrfLogSetXid(""); }
-void osrfLogSetXid(char* xid) {
-   if(!__osrfLogIsClient) __osrfLogSetXid(xid);
-}
-
-void osrfLogMkXid() {
-   if(__osrfLogIsClient) {
-      char buf[32];
-      memset(buf, 0x0, 32);
-      snprintf(buf, 32, "%s%d", __osrfLogXidPfx, __osrfLogXidInc);
-      __osrfLogSetXid(buf);
-      __osrfLogXidInc++;
-   }
-}
-
-char* osrfLogGetXid() {
-   return __osrfLogXid;
-}
-
-void osrfLogSetIsClient(int is) {
-   __osrfLogIsClient = is;
-   if(!is) return;
-   /* go ahead and create the xid prefix so it will be consistent later */
-   static char buff[32];
-   memset(buff, 0x0, 32);
-   snprintf(buff, 32, "%d%d", (int)time(NULL), getpid());
-   __osrfLogXidPfx = buff;
-}
-
-void osrfLogSetType( int logtype ) { 
-       if( logtype != OSRF_LOG_TYPE_FILE &&
-                       logtype != OSRF_LOG_TYPE_SYSLOG ) {
-               fprintf(stderr, "Unrecognized log type.  Logging to stderr\n");
-               return;
-       }
-       __osrfLogType = logtype; 
-}
-
-void osrfLogSetFile( const char* logfile ) {
-       if(!logfile) return;
-       if(__osrfLogFile) free(__osrfLogFile);
-       __osrfLogFile = strdup(logfile);
-}
-
-void osrfLogSetActivityEnabled( int enabled ) {
-       __osrfLogActivityEnabled = enabled;
-}
-
-void osrfLogSetAppname( const char* appname ) {
-       if(!appname) return;
-       if(__osrfLogAppname) free(__osrfLogAppname);
-       __osrfLogAppname = strdup(appname);
-
-       /* if syslogging, re-open the log with the appname */
-       if( __osrfLogType == OSRF_LOG_TYPE_SYSLOG) {
-               closelog();
-               openlog(__osrfLogAppname, 0, __osrfLogFacility);
-       }
-}
-
-void osrfLogSetSyslogFacility( int facility ) {
-       __osrfLogFacility = facility;
-}
-void osrfLogSetSyslogActFacility( int facility ) {
-       __osrfLogActFacility = facility;
-}
-
-void osrfLogSetLevel( int loglevel ) {
-       __osrfLogLevel = loglevel;
-}
-
-void osrfLogError( const char* file, int line, const char* msg, ... ) 
-       { OSRF_LOG_GO(file, line, msg, OSRF_LOG_ERROR); }
-void osrfLogWarning( const char* file, int line, const char* msg, ... ) 
-       { OSRF_LOG_GO(file, line, msg, OSRF_LOG_WARNING); }
-void osrfLogInfo( const char* file, int line, const char* msg, ... ) 
-       { OSRF_LOG_GO(file, line, msg, OSRF_LOG_INFO); }
-void osrfLogDebug( const char* file, int line, const char* msg, ... ) 
-       { OSRF_LOG_GO(file, line, msg, OSRF_LOG_DEBUG); }
-void osrfLogInternal( const char* file, int line, const char* msg, ... ) 
-       { OSRF_LOG_GO(file, line, msg, OSRF_LOG_INTERNAL); }
-void osrfLogActivity( const char* file, int line, const char* msg, ... ) { 
-       OSRF_LOG_GO(file, line, msg, OSRF_LOG_ACTIVITY); 
-       _osrfLogDetail( OSRF_LOG_INFO, file, line, VA_BUF ); /* also log at info level */
-}
-
-void _osrfLogDetail( int level, const char* filename, int line, char* msg ) {
-
-       if( level == OSRF_LOG_ACTIVITY && ! __osrfLogActivityEnabled ) return;
-       if( level > __osrfLogLevel ) return;
-       if(!msg) return;
-       if(!filename) filename = "";
-
-       char* l = "INFO";               /* level name */
-       int lvl = LOG_INFO;     /* syslog level */
-       int fac = __osrfLogFacility;
-
-       switch( level ) {
-               case OSRF_LOG_ERROR:            
-                       l = "ERR "; 
-                       lvl = LOG_ERR;
-                       break;
-
-               case OSRF_LOG_WARNING:  
-                       l = "WARN"; 
-                       lvl = LOG_WARNING;
-                       break;
-
-               case OSRF_LOG_INFO:             
-                       l = "INFO"; 
-                       lvl = LOG_INFO;
-                       break;
-
-               case OSRF_LOG_DEBUG:    
-                       l = "DEBG"; 
-                       lvl = LOG_DEBUG;
-                       break;
-
-               case OSRF_LOG_INTERNAL: 
-                       l = "INT "; 
-                       lvl = LOG_DEBUG;
-                       break;
-
-               case OSRF_LOG_ACTIVITY: 
-                       l = "ACT"; 
-                       lvl = LOG_INFO;
-                       fac = __osrfLogActFacility;
-                       break;
-       }
-
-   char* xid = (__osrfLogXid) ? __osrfLogXid : "";
-
-       if(__osrfLogType == OSRF_LOG_TYPE_SYSLOG ) {
-               char buf[1536];  
-               memset(buf, 0x0, 1536);
-               /* give syslog some breathing room, and be cute about it */
-               strncat(buf, msg, 1535);
-               buf[1532] = '.';
-               buf[1533] = '.';
-               buf[1534] = '.';
-               buf[1535] = '\0';
-               syslog( fac | lvl, "[%s:%d:%s:%d:%s] %s", l, getpid(), filename, line, xid, buf );
-       }
-
-       else if( __osrfLogType == OSRF_LOG_TYPE_FILE )
-               _osrfLogToFile("[%s:%d:%s:%d:%s] %s", l, getpid(), filename, line, xid, msg );
-
-}
-
-
-void _osrfLogToFile( char* msg, ... ) {
-
-       if(!msg) return;
-       if(!__osrfLogFile) return;
-       VA_LIST_TO_STRING(msg);
-
-       if(!__osrfLogAppname) __osrfLogAppname = strdup("osrf");
-       int l = strlen(VA_BUF) + strlen(__osrfLogAppname) + 36;
-       char buf[l];
-       bzero(buf,l);
-
-       char datebuf[36];
-       bzero(datebuf,36);
-       time_t t = time(NULL);
-       struct tm* tms = localtime(&t);
-       strftime(datebuf, 36, "%Y-%m-%d %H:%M:%S", tms);
-
-       FILE* file = fopen(__osrfLogFile, "a");
-       if(!file) {
-               fprintf(stderr, "Unable to fopen file %s for writing", __osrfLogFile);
-               return;
-       }
-
-       fprintf(file, "%s %s %s\n", __osrfLogAppname, datebuf, VA_BUF );
-       if( fclose(file) != 0 ) 
-               osrfLogWarning(OSRF_LOG_MARK, "Error closing log file: %s", strerror(errno));
-       
-}
-
-
-int osrfLogFacilityToInt( char* facility ) {
-       if(!facility) return LOG_LOCAL0;
-       if(strlen(facility) < 6) return LOG_LOCAL0;
-       switch( facility[5] ) {
-               case '0': return LOG_LOCAL0;
-               case '1': return LOG_LOCAL1;
-               case '2': return LOG_LOCAL2;
-               case '3': return LOG_LOCAL3;
-               case '4': return LOG_LOCAL4;
-               case '5': return LOG_LOCAL5;
-               case '6': return LOG_LOCAL6;
-               case '7': return LOG_LOCAL7;
-       }
-       return LOG_LOCAL0;
-}
-
-
diff --git a/OpenSRF/src/utils/log.h b/OpenSRF/src/utils/log.h
deleted file mode 100644 (file)
index 588bb1b..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <syslog.h>
-#include <stdio.h>
-#include "utils.h"
-#include <time.h>
-#include <errno.h>
-
-#ifndef OSRF_LOG_INCLUDED
-#define OSRF_LOG_INCLUDED
-
-/* log levels */
-#define OSRF_LOG_ERROR 1
-#define OSRF_LOG_WARNING 2
-#define OSRF_LOG_INFO 3
-#define OSRF_LOG_DEBUG 4
-#define OSRF_LOG_INTERNAL 5
-#define OSRF_LOG_ACTIVITY -1
-
-#define OSRF_LOG_TYPE_FILE 1
-#define OSRF_LOG_TYPE_SYSLOG 2
-
-#define OSRF_LOG_MARK __FILE__, __LINE__
-
-
-#define OSRF_LOG_GO(f,li,m,l)          \
-       if(!m) return;                                  \
-       VA_LIST_TO_STRING(m);           \
-       _osrfLogDetail( l, f, li, VA_BUF );
-       
-
-
-/* Initializes the logger. */
-void osrfLogInit( int type, const char* appname, int maxlevel );
-/** Sets the type of logging to perform.  See log types */
-void osrfLogSetType( int logtype );
-/** Sets the systlog facility for the regular logs */
-void osrfLogSetSyslogFacility( int facility );
-/** Sets the systlog facility for the activity logs */
-void osrfLogSetSyslogActFacility( int facility );
-/** Sets the log file to use if we're logging to a file */
-void osrfLogSetFile( const char* logfile );
-/* once we know which application we're running, call this method to
- * set the appname so log lines can include the app name */
-void osrfLogSetAppname( const char* appname );
-/** Sets the global log level.  Any log statements with a higher level
- * than "level" will not be logged */
-void osrfLogSetLevel( int loglevel );
-/* Log an error message */
-void osrfLogError( const char* file, int line, const char* msg, ... );
-/* Log a warning message */
-void osrfLogWarning( const char* file, int line, const char* msg, ... );
-/* log an info message */
-void osrfLogInfo( const char* file, int line, const char* msg, ... );
-/* Log a debug message */
-void osrfLogDebug( const char* file, int line, const char* msg, ... );
-/* Log an internal debug message */
-void osrfLogInternal( const char* file, int line, const char* msg, ... );
-/* Log an activity message */
-void osrfLogActivity( const char* file, int line, const char* msg, ... );
-
-void osrfLogCleanup();
-
-void osrfLogClearXid();
-void osrfLogSetXid(char* xid);
-void osrfLogMkXid();
-void osrfLogSetIsClient(int is);
-char* osrfLogGetXid();
-
-/* sets the activity flag */
-void osrfLogSetActivityEnabled( int enabled );
-
-/** Actually does the logging */
-void _osrfLogDetail( int level, const char* filename, int line, char* msg );
-
-void _osrfLogToFile( char* msg, ... );
-
-/* returns the int representation of the log facility based on the facility name
- * if the facility name is invalid, LOG_LOCAL0 is returned 
- */
-int osrfLogFacilityToInt( char* facility );
-
-#endif
diff --git a/OpenSRF/src/utils/md5.c b/OpenSRF/src/utils/md5.c
deleted file mode 100644 (file)
index 7da3d60..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/* --- The data --- */
-
-const char data[] =
-"/* --- The MD5 routines --- */\n\n/* MD5 routines, after Ron R"
-"ivest */\n/* Written by David Madore <david.madore@ens.fr>, w"
-"ith code taken in\n * part from Colin Plumb. */\n/* Public dom"
-"ain (1999/11/24) */\n\n/* Note: these routines do not depend o"
-"n endianness. */\n\n/* === The header === */\n\n/* Put this in m"
-"d5.h if you don't like having everything in one big\n * file."
-" */\n\n#ifndef _DMADORE_MD5_H\n#define _DMADORE_MD5_H\n\nstruct m"
-"d5_ctx {\n  /* The four chaining variables */\n  unsigned long"
-" buf[4];\n  /* Count number of message bits */\n  unsigned lon"
-"g bits[2];\n  /* Data being fed in */\n  unsigned long in[16];"
-"\n  /* Our position within the 512 bits (always between 0 and"
-" 63) */\n  int b;\n};\n\nvoid MD5_transform (unsigned long buf[4"
-"], const unsigned long in[16]);\nvoid MD5_start (struct md5_c"
-"tx *context);\nvoid MD5_feed (struct md5_ctx *context, unsign"
-"ed char inb);\nvoid MD5_stop (struct md5_ctx *context, unsign"
-"ed char digest[16]);\n\n#endif /* not defined _DMADORE_MD5_H *"
-"/\n\n/* === The implementation === */\n\n#define F1(x, y, z) (z "
-"^ (x & (y ^ z)))\n#define F2(x, y, z) F1(z, x, y)\n#define F3("
-"x, y, z) (x ^ y ^ z)\n#define F4(x, y, z) (y ^ (x | ~z))\n\n#de"
-"fine MD5STEP(f, w, x, y, z, data, s) \\\n\t{ w += f (x, y, z) +"
-" data;  w = w<<s | (w&0xffffffffUL)>>(32-s); \\\n\t  w += x; }\n"
-"\nvoid\nMD5_transform (unsigned long buf[4], const unsigned lo"
-"ng in[16])\n{\n  register unsigned long a, b, c, d;\n\n  a = buf"
-"[0];  b = buf[1];  c = buf[2];  d = buf[3];\n  MD5STEP(F1, a,"
-" b, c, d, in[0] + 0xd76aa478UL, 7);\n  MD5STEP(F1, d, a, b, c"
-", in[1] + 0xe8c7b756UL, 12);\n  MD5STEP(F1, c, d, a, b, in[2]"
-" + 0x242070dbUL, 17);\n  MD5STEP(F1, b, c, d, a, in[3] + 0xc1"
-"bdceeeUL, 22);\n  MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafU"
-"L, 7);\n  MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aUL, 12);\n"
-"  MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613UL, 17);\n  MD5ST"
-"EP(F1, b, c, d, a, in[7] + 0xfd469501UL, 22);\n  MD5STEP(F1, "
-"a, b, c, d, in[8] + 0x698098d8UL, 7);\n  MD5STEP(F1, d, a, b,"
-" c, in[9] + 0x8b44f7afUL, 12);\n  MD5STEP(F1, c, d, a, b, in["
-"10] + 0xffff5bb1UL, 17);\n  MD5STEP(F1, b, c, d, a, in[11] + "
-"0x895cd7beUL, 22);\n  MD5STEP(F1, a, b, c, d, in[12] + 0x6b90"
-"1122UL, 7);\n  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193UL,"
-" 12);\n  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eUL, 17);\n"
-"  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821UL, 22);\n  MD5S"
-"TEP(F2, a, b, c, d, in[1] + 0xf61e2562UL, 5);\n  MD5STEP(F2, "
-"d, a, b, c, in[6] + 0xc040b340UL, 9);\n  MD5STEP(F2, c, d, a,"
-" b, in[11] + 0x265e5a51UL, 14);\n  MD5STEP(F2, b, c, d, a, in"
-"[0] + 0xe9b6c7aaUL, 20);\n  MD5STEP(F2, a, b, c, d, in[5] + 0"
-"xd62f105dUL, 5);\n  MD5STEP(F2, d, a, b, c, in[10] + 0x024414"
-"53UL, 9);\n  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681UL, 1"
-"4);\n  MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8UL, 20);\n  M"
-"D5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6UL, 5);\n  MD5STEP(F"
-"2, d, a, b, c, in[14] + 0xc33707d6UL, 9);\n  MD5STEP(F2, c, d"
-", a, b, in[3] + 0xf4d50d87UL, 14);\n  MD5STEP(F2, b, c, d, a,"
-" in[8] + 0x455a14edUL, 20);\n  MD5STEP(F2, a, b, c, d, in[13]"
-" + 0xa9e3e905UL, 5);\n  MD5STEP(F2, d, a, b, c, in[2] + 0xfce"
-"fa3f8UL, 9);\n  MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9UL,"
-" 14);\n  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aUL, 20);\n"
-"  MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942UL, 4);\n  MD5STE"
-"P(F3, d, a, b, c, in[8] + 0x8771f681UL, 11);\n  MD5STEP(F3, c"
-", d, a, b, in[11] + 0x6d9d6122UL, 16);\n  MD5STEP(F3, b, c, d"
-", a, in[14] + 0xfde5380cUL, 23);\n  MD5STEP(F3, a, b, c, d, i"
-"n[1] + 0xa4beea44UL, 4);\n  MD5STEP(F3, d, a, b, c, in[4] + 0"
-"x4bdecfa9UL, 11);\n  MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b"
-"60UL, 16);\n  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70UL, "
-"23);\n  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6UL, 4);\n  "
-"MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faUL, 11);\n  MD5STEP"
-"(F3, c, d, a, b, in[3] + 0xd4ef3085UL, 16);\n  MD5STEP(F3, b,"
-" c, d, a, in[6] + 0x04881d05UL, 23);\n  MD5STEP(F3, a, b, c, "
-"d, in[9] + 0xd9d4d039UL, 4);\n  MD5STEP(F3, d, a, b, c, in[12"
-"] + 0xe6db99e5UL, 11);\n  MD5STEP(F3, c, d, a, b, in[15] + 0x"
-"1fa27cf8UL, 16);\n  MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac566"
-"5UL, 23);\n  MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244UL, 6)"
-";\n  MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97UL, 10);\n  MD5"
-"STEP(F4, c, d, a, b, in[14] + 0xab9423a7UL, 15);\n  MD5STEP(F"
-"4, b, c, d, a, in[5] + 0xfc93a039UL, 21);\n  MD5STEP(F4, a, b"
-", c, d, in[12] + 0x655b59c3UL, 6);\n  MD5STEP(F4, d, a, b, c,"
-" in[3] + 0x8f0ccc92UL, 10);\n  MD5STEP(F4, c, d, a, b, in[10]"
-" + 0xffeff47dUL, 15);\n  MD5STEP(F4, b, c, d, a, in[1] + 0x85"
-"845dd1UL, 21);\n  MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fU"
-"L, 6);\n  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0UL, 10);"
-"\n  MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314UL, 15);\n  MD5S"
-"TEP(F4, b, c, d, a, in[13] + 0x4e0811a1UL, 21);\n  MD5STEP(F4"
-", a, b, c, d, in[4] + 0xf7537e82UL, 6);\n  MD5STEP(F4, d, a, "
-"b, c, in[11] + 0xbd3af235UL, 10);\n  MD5STEP(F4, c, d, a, b, "
-"in[2] + 0x2ad7d2bbUL, 15);\n  MD5STEP(F4, b, c, d, a, in[9] +"
-" 0xeb86d391UL, 21);\n  buf[0] += a;  buf[1] += b;  buf[2] += "
-"c;  buf[3] += d;\n}\n\n#undef F1\n#undef F2\n#undef F3\n#undef F4\n"
-"#undef MD5STEP\n\nvoid\nMD5_start (struct md5_ctx *ctx)\n{\n  int"
-" i;\n\n  ctx->buf[0] = 0x67452301UL;\n  ctx->buf[1] = 0xefcdab8"
-"9UL;\n  ctx->buf[2] = 0x98badcfeUL;\n  ctx->buf[3] = 0x1032547"
-"6UL;\n  ctx->bits[0] = 0;\n  ctx->bits[1] = 0;\n  for ( i=0 ; i"
-"<16 ; i++ )\n    ctx->in[i] = 0;\n  ctx->b = 0;\n}\n\nvoid\nMD5_fe"
-"ed (struct md5_ctx *ctx, unsigned char inb)\n{\n  int i;\n  uns"
-"igned long temp;\n\n  ctx->in[ctx->b/4] |= ((unsigned long)inb"
-") << ((ctx->b%4)*8);\n  if ( ++ctx->b >= 64 )\n    {\n      MD5"
-"_transform (ctx->buf, ctx->in);\n      ctx->b = 0;\n      for "
-"( i=0 ; i<16 ; i++ )\n\tctx->in[i] = 0;\n    }\n  temp = ctx->bi"
-"ts[0];\n  ctx->bits[0] += 8;\n  if ( (temp&0xffffffffUL) > (ct"
-"x->bits[0]&0xffffffffUL) )\n    ctx->bits[1]++;\n}\n\nvoid\nMD5_s"
-"top (struct md5_ctx *ctx, unsigned char digest[16])\n{\n  int "
-"i;\n  unsigned long bits[2];\n\n  for ( i=0 ; i<2 ; i++ )\n    b"
-"its[i] = ctx->bits[i];\n  MD5_feed (ctx, 0x80);\n  for ( ; ctx"
-"->b!=56 ; )\n    MD5_feed (ctx, 0);\n  for ( i=0 ; i<2 ; i++ )"
-"\n    {\n      MD5_feed (ctx, bits[i]&0xff);\n      MD5_feed (c"
-"tx, (bits[i]>>8)&0xff);\n      MD5_feed (ctx, (bits[i]>>16)&0"
-"xff);\n      MD5_feed (ctx, (bits[i]>>24)&0xff);\n    }\n  for "
-"( i=0 ; i<4 ; i++ )\n    {\n      digest[4*i] = ctx->buf[i]&0x"
-"ff;\n      digest[4*i+1] = (ctx->buf[i]>>8)&0xff;\n      diges"
-"t[4*i+2] = (ctx->buf[i]>>16)&0xff;\n      digest[4*i+3] = (ct"
-"x->buf[i]>>24)&0xff;\n    }\n}\n\f\n/* --- The core of the progra"
-"m --- */\n\n#include <stdio.h>\n#include <string.h>\n\n#define LA"
-"RGE_ENOUGH 16384\n\nchar buffer[LARGE_ENOUGH];\n\nint\nmain (int "
-"argc, char *argv[])\n{\n  unsigned int i;\n\n  buffer[0] = 0;\n  "
-"strcat (buffer, \"/* --- The data --- */\\n\\n\");\n  strcat (buf"
-"fer, \"const char data[] =\");\n  for ( i=0 ; data[i] ; i++ )\n "
-"   {\n      if ( i%60 == 0 )\n\tstrcat (buffer, \"\\n\\\"\");\n      "
-"switch ( data[i] )\n\t{\n\tcase '\\\\':\n\tcase '\"':\n\t  strcat (buff"
-"er, \"\\\\\");\n\t  buffer[strlen(buffer)+1] = 0;\n\t  buffer[strlen"
-"(buffer)] = data[i];\n\t  break;\n\tcase '\\n':\n\t  strcat (buffer"
-", \"\\\\n\");\n\t  break;\n\tcase '\\t':\n\t  strcat (buffer, \"\\\\t\");\n\t"
-"  break;\n\tcase '\\f':\n\t  strcat (buffer, \"\\\\f\");\n\t  break;\n\td"
-"efault:\n\t  buffer[strlen(buffer)+1] = 0;\n\t  buffer[strlen(bu"
-"ffer)] = data[i];\n\t}\n      if ( i%60 == 59 || !data[i+1] )\n\t"
-"strcat (buffer, \"\\\"\");\n    }\n  strcat (buffer, \";\\n\\f\\n\");\n "
-" strcat (buffer, data);\n  if ( argc >= 2 && strcmp (argv[1],"
-" \"xyzzy\") == 0 )\n    printf (\"%s\", buffer);\n  else\n    {\n   "
-"   struct md5_ctx ctx;\n      unsigned char digest[16];\n\n    "
-"  MD5_start (&ctx);\n      for ( i=0 ; buffer[i] ; i++ )\n\tMD5"
-"_feed (&ctx, buffer[i]);\n      MD5_stop (&ctx, digest);\n    "
-"  for ( i=0 ; i<16 ; i++ )\n\tprintf (\"%02x\", digest[i]);\n    "
-"  printf (\"\\n\");\n    }\n  return 0;\n}\n";
-
-
-#include "md5.h"
-
-
-/* --- The MD5 routines --- */
-
-/* MD5 routines, after Ron Rivest */
-/* Written by David Madore <david.madore@ens.fr>, with code taken in
- * part from Colin Plumb. */
-/* Public domain (1999/11/24) */
-
-/* Note: these routines do not depend on endianness. */
-
-/* === The header === */
-
-/* Put this in md5.h if you don't like having everything in one big
- * file. */
-
-
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-#define MD5STEP(f, w, x, y, z, data, s) \
-       { w += f (x, y, z) + data;  w = w<<s | (w&0xffffffffUL)>>(32-s); \
-         w += x; }
-
-void
-MD5_transform (unsigned long buf[4], const unsigned long in[16])
-{
-  register unsigned long a, b, c, d;
-
-  a = buf[0];  b = buf[1];  c = buf[2];  d = buf[3];
-  MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478UL, 7);
-  MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756UL, 12);
-  MD5STEP(F1, c, d, a, b, in[2] + 0x242070dbUL, 17);
-  MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceeeUL, 22);
-  MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafUL, 7);
-  MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aUL, 12);
-  MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613UL, 17);
-  MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501UL, 22);
-  MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8UL, 7);
-  MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7afUL, 12);
-  MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1UL, 17);
-  MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7beUL, 22);
-  MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122UL, 7);
-  MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193UL, 12);
-  MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eUL, 17);
-  MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821UL, 22);
-  MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562UL, 5);
-  MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340UL, 9);
-  MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51UL, 14);
-  MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aaUL, 20);
-  MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105dUL, 5);
-  MD5STEP(F2, d, a, b, c, in[10] + 0x02441453UL, 9);
-  MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681UL, 14);
-  MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8UL, 20);
-  MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6UL, 5);
-  MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6UL, 9);
-  MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87UL, 14);
-  MD5STEP(F2, b, c, d, a, in[8] + 0x455a14edUL, 20);
-  MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905UL, 5);
-  MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8UL, 9);
-  MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9UL, 14);
-  MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aUL, 20);
-  MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942UL, 4);
-  MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681UL, 11);
-  MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122UL, 16);
-  MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380cUL, 23);
-  MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44UL, 4);
-  MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9UL, 11);
-  MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60UL, 16);
-  MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70UL, 23);
-  MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6UL, 4);
-  MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faUL, 11);
-  MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085UL, 16);
-  MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05UL, 23);
-  MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039UL, 4);
-  MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5UL, 11);
-  MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8UL, 16);
-  MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665UL, 23);
-  MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244UL, 6);
-  MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97UL, 10);
-  MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7UL, 15);
-  MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039UL, 21);
-  MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3UL, 6);
-  MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92UL, 10);
-  MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47dUL, 15);
-  MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1UL, 21);
-  MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fUL, 6);
-  MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0UL, 10);
-  MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314UL, 15);
-  MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1UL, 21);
-  MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82UL, 6);
-  MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235UL, 10);
-  MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bbUL, 15);
-  MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391UL, 21);
-  buf[0] += a;  buf[1] += b;  buf[2] += c;  buf[3] += d;
-}
-
-#undef F1
-#undef F2
-#undef F3
-#undef F4
-#undef MD5STEP
-
-void
-MD5_start (struct md5_ctx *ctx)
-{
-  int i;
-
-  ctx->buf[0] = 0x67452301UL;
-  ctx->buf[1] = 0xefcdab89UL;
-  ctx->buf[2] = 0x98badcfeUL;
-  ctx->buf[3] = 0x10325476UL;
-  ctx->bits[0] = 0;
-  ctx->bits[1] = 0;
-  for ( i=0 ; i<16 ; i++ )
-    ctx->in[i] = 0;
-  ctx->b = 0;
-}
-
-void
-MD5_feed (struct md5_ctx *ctx, unsigned char inb)
-{
-  int i;
-  unsigned long temp;
-
-  ctx->in[ctx->b/4] |= ((unsigned long)inb) << ((ctx->b%4)*8);
-  if ( ++ctx->b >= 64 )
-    {
-      MD5_transform (ctx->buf, ctx->in);
-      ctx->b = 0;
-      for ( i=0 ; i<16 ; i++ )
-       ctx->in[i] = 0;
-    }
-  temp = ctx->bits[0];
-  ctx->bits[0] += 8;
-  if ( (temp&0xffffffffUL) > (ctx->bits[0]&0xffffffffUL) )
-    ctx->bits[1]++;
-}
-
-void
-MD5_stop (struct md5_ctx *ctx, unsigned char digest[16])
-{
-  int i;
-  unsigned long bits[2];
-
-  for ( i=0 ; i<2 ; i++ )
-    bits[i] = ctx->bits[i];
-  MD5_feed (ctx, 0x80);
-  for ( ; ctx->b!=56 ; )
-    MD5_feed (ctx, 0);
-  for ( i=0 ; i<2 ; i++ )
-    {
-      MD5_feed (ctx, bits[i]&0xff);
-      MD5_feed (ctx, (bits[i]>>8)&0xff);
-      MD5_feed (ctx, (bits[i]>>16)&0xff);
-      MD5_feed (ctx, (bits[i]>>24)&0xff);
-    }
-  for ( i=0 ; i<4 ; i++ )
-    {
-      digest[4*i] = ctx->buf[i]&0xff;
-      digest[4*i+1] = (ctx->buf[i]>>8)&0xff;
-      digest[4*i+2] = (ctx->buf[i]>>16)&0xff;
-      digest[4*i+3] = (ctx->buf[i]>>24)&0xff;
-    }
-}
-\f
-/* --- The core of the program --- */
-
-#include <stdio.h>
-#include <string.h>
-
-#define LARGE_ENOUGH 16384
-
-char buffer[LARGE_ENOUGH];
-
-/*
-int
-main (int argc, char *argv[])
-{
-  unsigned int i;
-
-  buffer[0] = 0;
-  strcat (buffer, \n\n");
-  strcat (buffer, "const char data[] =");
-  for ( i=0 ; data[i] ; i++ )
-    {
-      if ( i%60 == 0 )
-       strcat (buffer, "\n\"");
-      switch ( data[i] )
-       {
-       case '\\':
-       case '"':
-         strcat (buffer, "\\");
-         buffer[strlen(buffer)+1] = 0;
-         buffer[strlen(buffer)] = data[i];
-         break;
-       case '\n':
-         strcat (buffer, "\\n");
-         break;
-       case '\t':
-         strcat (buffer, "\\t");
-         break;
-       case '\f':
-         strcat (buffer, "\\f");
-         break;
-       default:
-         buffer[strlen(buffer)+1] = 0;
-         buffer[strlen(buffer)] = data[i];
-       }
-      if ( i%60 == 59 || !data[i+1] )
-       strcat (buffer, "\"");
-    }
-  strcat (buffer, ";\n\f\n");
-  strcat (buffer, data);
-  if ( argc >= 2 && strcmp (argv[1], "xyzzy") == 0 )
-    printf ("%s", buffer);
-  else
-    {
-      struct md5_ctx ctx;
-      unsigned char digest[16];
-
-      MD5_start (&ctx);
-      for ( i=0 ; buffer[i] ; i++ )
-       MD5_feed (&ctx, buffer[i]);
-      MD5_stop (&ctx, digest);
-      for ( i=0 ; i<16 ; i++ )
-       printf ("%02x", digest[i]);
-      printf ("\n");
-    }
-  return 0;
-}
-*/
diff --git a/OpenSRF/src/utils/md5.h b/OpenSRF/src/utils/md5.h
deleted file mode 100644 (file)
index 53dd2b1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* --- The MD5 routines --- */
-
-/* MD5 routines, after Ron Rivest */
-/* Written by David Madore <david.madore@ens.fr>, with code taken in
- * part from Colin Plumb. */
-/* Public domain (1999/11/24) */
-
-/* Note: these routines do not depend on endianness. */
-
-/* === The header === */
-
-/* Put this in md5.h if you don't like having everything in one big
- * file. */
-
-#ifndef _DMADORE_MD5_H
-#define _DMADORE_MD5_H
-
-struct md5_ctx {
-  /* The four chaining variables */
-  unsigned long buf[4];
-  /* Count number of message bits */
-  unsigned long bits[2];
-  /* Data being fed in */
-  unsigned long in[16];
-  /* Our position within the 512 bits (always between 0 and 63) */
-  int b;
-};
-
-void MD5_transform (unsigned long buf[4], const unsigned long in[16]);
-void MD5_start (struct md5_ctx *context);
-void MD5_feed (struct md5_ctx *context, unsigned char inb);
-void MD5_stop (struct md5_ctx *context, unsigned char digest[16]);
-
-#endif /* not defined _DMADORE_MD5_H */
-
diff --git a/OpenSRF/src/utils/sha.c b/OpenSRF/src/utils/sha.c
deleted file mode 100644 (file)
index 14791bd..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * 
- *  Gabber
- *  Copyright (C) 1999-2000 Dave Smith & Julian Missig
- */
-
-
-/* 
-   Implements the Secure Hash Algorithm (SHA1)
-
-   Copyright (C) 1999 Scott G. Miller
-
-   Released under the terms of the GNU General Public License v2
-   see file COPYING for details
-
-   Credits: 
-      Robert Klep <robert@ilse.nl>  -- Expansion function fix 
-         Thomas "temas" Muldowney <temas@box5.net>:
-                       -- shahash() for string fun
-                       -- Will add the int32 stuff in a few
-                       
-   ---
-   FIXME: This source takes int to be a 32 bit integer.  This
-   may vary from system to system.  I'd use autoconf if I was familiar
-   with it.  Anyone want to help me out?
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#ifdef MACOS
-#  include <string.h>
-#else
-#  include <sys/stat.h>
-#  include <sys/types.h>
-#endif
-
-#include <string.h>
-
-#ifndef WIN32
-#  include <unistd.h>
-#  define INT64 long long
-#else
-#  include <string.h>
-#  define snprintf _snprintf
-#  define INT64 __int64
-#endif
-
-#define switch_endianness(x) (x<<24 & 0xff000000) | \
-                             (x<<8  & 0x00ff0000) | \
-                             (x>>8  & 0x0000ff00) | \
-                             (x>>24 & 0x000000ff)
-
-/* Initial hash values */
-#define Ai 0x67452301 
-#define Bi 0xefcdab89
-#define Ci 0x98badcfe
-#define Di 0x10325476
-#define Ei 0xc3d2e1f0
-
-/* SHA1 round constants */
-#define K1 0x5a827999
-#define K2 0x6ed9eba1
-#define K3 0x8f1bbcdc 
-#define K4 0xca62c1d6
-
-/* Round functions.  Note that f2() is used in both rounds 2 and 4 */
-#define f1(B,C,D) ((B & C) | ((~B) & D))
-#define f2(B,C,D) (B ^ C ^ D)
-#define f3(B,C,D) ((B & C) | (B & D) | (C & D))
-
-/* left circular shift functions (rotate left) */
-#define rol1(x) ((x<<1) | ((x>>31) & 1))
-#define rol5(A) ((A<<5) | ((A>>27) & 0x1f))
-#define rol30(B) ((B<<30) | ((B>>2) & 0x3fffffff))
-
-/*
-  Hashes 'data', which should be a pointer to 512 bits of data (sixteen
-  32 bit ints), into the ongoing 160 bit hash value (five 32 bit ints)
-  'hash'
-*/
-int 
-sha_hash(int *data, int *hash)  
-{
-  int W[80];
-  unsigned int A=hash[0], B=hash[1], C=hash[2], D=hash[3], E=hash[4];
-  unsigned int t, x, TEMP;
-
-  for (t=0; t<16; t++) 
-    {
-#ifndef WORDS_BIGENDIAN
-      W[t]=switch_endianness(data[t]);
-#else 
-      W[t]=data[t];
-#endif
-    }
-
-
-  /* SHA1 Data expansion */
-  for (t=16; t<80; t++) 
-    {
-      x=W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16];
-      W[t]=rol1(x);
-    }
-
-  /* SHA1 main loop (t=0 to 79) 
-   This is broken down into four subloops in order to use
-   the correct round function and constant */
-  for (t=0; t<20; t++) 
-    {
-      TEMP=rol5(A) + f1(B,C,D) + E + W[t] + K1;
-      E=D;
-      D=C;
-      C=rol30(B);
-      B=A;
-      A=TEMP;
-    }
-  for (; t<40; t++) 
-    {
-      TEMP=rol5(A) + f2(B,C,D) + E + W[t] + K2;
-      E=D;
-      D=C;
-      C=rol30(B);
-      B=A;
-      A=TEMP;
-    }
-  for (; t<60; t++) 
-    {
-      TEMP=rol5(A) + f3(B,C,D) + E + W[t] + K3;
-      E=D;
-      D=C;
-      C=rol30(B);
-      B=A;
-      A=TEMP;
-    }
-  for (; t<80; t++) 
-    {
-      TEMP=rol5(A) + f2(B,C,D) + E + W[t] + K4;
-      E=D;
-      D=C;
-      C=rol30(B);
-      B=A;
-      A=TEMP;
-    }
-  hash[0]+=A; 
-  hash[1]+=B;
-  hash[2]+=C;
-  hash[3]+=D;
-  hash[4]+=E;
-  return 0;
-}
-
-/*
-  Takes a pointer to a 160 bit block of data (five 32 bit ints) and
-  intializes it to the start constants of the SHA1 algorithm.  This
-  must be called before using hash in the call to sha_hash
-*/
-int 
-sha_init(int *hash) 
-{
-  hash[0]=Ai;
-  hash[1]=Bi;
-  hash[2]=Ci;
-  hash[3]=Di;
-  hash[4]=Ei;
-  return 0;
-}
-
-int strprintsha(char *dest, int *hashval) 
-{
-       int x;
-       char *hashstr = dest;
-       for (x=0; x<5; x++) 
-       {
-               snprintf(hashstr, 9, "%08x", hashval[x]);
-               hashstr+=8;
-       }
-       //snprintf(hashstr++, 1, "\0");
-       hashstr[0] = '\0';
-       hashstr++;
-
-       return 0;
-}
-
-char *shahash(const char *str) 
-{
-       char read_buffer[65];
-       //int read_buffer[64];
-       int c=1, i;
-       
-       INT64 length=0;
-
-       int strsz;
-       static char final[40];
-       int *hashval;
-
-       hashval = (int *)malloc(20);
-
-       sha_init(hashval);
-
-       strsz = strlen(str);
-
-       if(strsz == 0) 
-       {
-            memset(read_buffer, 0, 65);
-            read_buffer[0] = 0x80;
-            sha_hash((int *)read_buffer, hashval);
-       }
-
-       while (strsz>0) 
-       {
-               memset(read_buffer, 0, 65);
-               strncpy((char*)read_buffer, str, 64);
-               c = strlen((char *)read_buffer);
-               length+=c;
-               strsz-=c;
-               if (strsz<=0) 
-               {
-                       length<<=3;     
-                       read_buffer[c]=(char)0x80;
-                       for (i=c+1; i<64; i++) 
-                               read_buffer[i]=0;
-                       if (c>55) 
-                       {
-                               /* we need to do an entire new block */
-                               sha_hash((int *)read_buffer, hashval);
-                               for (i=0; i<14; i++) 
-                                       ((int*)read_buffer)[i]=0;
-                       }      
-#ifndef WORDS_BIGENDIAN
-                       for (i=0; i<8; i++) 
-                       {
-                               read_buffer[56+i]=(char)(length>>(56-(i*8))) & 0xff;
-                       }
-#else  
-                       memcpy(read_buffer+56, &length, 8);
-#endif
-               }
-               
-               sha_hash((int *)read_buffer, hashval);
-               str+=64;
-       }
-
-       strprintsha((char *)final, hashval);
-       free(hashval);
-       return (char *)final;
-}
diff --git a/OpenSRF/src/utils/sha.h b/OpenSRF/src/utils/sha.h
deleted file mode 100644 (file)
index 6c3d2d4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// sha.h
-// Jabber client library
-//
-// Original Code Copyright (C) 1999-2001 Dave Smith (dave@jabber.org)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// 
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-// Contributor(s): Julian Missig
-//
-// This Original Code has been modified by IBM Corporation. Modifications 
-// made by IBM described herein are Copyright (c) International Business 
-// Machines Corporation, 2002.
-//
-// Date             Modified by     Description of modification
-// 01/20/2002       IBM Corp.       Updated to libjudo 1.1.1
-// 2002-03-05       IBM Corp.       Updated to libjudo 1.1.5
-// 2002-07-09       IBM Corp.       Added Roster::getSession()
-//
-// =====================================================================================
-
-
-//#ifdef WIN32
-     char* shahash(const char* str);
-//#else
-//extern "C" {
-//     char* shahash(const char* str);
-//}
-//#endif
-
diff --git a/OpenSRF/src/utils/socket_bundle.c b/OpenSRF/src/utils/socket_bundle.c
deleted file mode 100644 (file)
index 5441adf..0000000
+++ /dev/null
@@ -1,683 +0,0 @@
-#include "socket_bundle.h"
-
-/* -------------------------------------------------------------------- 
-       Test Code 
-       -------------------------------------------------------------------- */
-/*
-int count = 0;
-void printme(void* blob, socket_manager* mgr, 
-               int sock_fd, char* data, int parent_id) {
-
-       fprintf(stderr, "Got data from socket %d with parent %d => %s", 
-                       sock_fd, parent_id, data );
-
-       socket_send(sock_fd, data);
-
-       if(count++ > 2) {
-               socket_disconnect(mgr, sock_fd);
-               _socket_print_list(mgr);
-       }
-}
-
-int main(int argc, char* argv[]) {
-       socket_manager manager;
-       memset(&manager, 0, sizeof(socket_manager));
-       int port = 11000;
-       if(argv[1])
-               port = atoi(argv[1]);
-
-       manager.data_received = &printme;
-       socket_open_tcp_server(&manager, port);
-
-       while(1)
-               socket_wait_all(&manager, -1);
-
-       return 0;
-}
-*/
-/* -------------------------------------------------------------------- */
-
-
-
-socket_node* _socket_add_node(socket_manager* mgr, 
-               int endpoint, int addr_type, int sock_fd, int parent_id ) {
-
-       if(mgr == NULL) return NULL;
-       osrfLogInternal( OSRF_LOG_MARK, "Adding socket node with fd %d", sock_fd);
-       socket_node* new_node = safe_malloc(sizeof(socket_node));
-
-       new_node->endpoint      = endpoint;
-       new_node->addr_type     = addr_type;
-       new_node->sock_fd               = sock_fd;
-       new_node->next                  = NULL;
-       new_node->parent_id = 0;
-       if(parent_id > 0)
-               new_node->parent_id = parent_id;
-
-       new_node->next                  = mgr->socket;
-       mgr->socket                             = new_node;
-       return new_node;
-}
-
-/* creates a new server socket node and adds it to the socket set.
-       returns new socket fd on success.  -1 on failure.
-       socket_type is one of INET or UNIX  */
-int socket_open_tcp_server(socket_manager* mgr, int port, char* listen_ip) {
-
-       if( mgr == NULL ) {
-               osrfLogWarning( OSRF_LOG_MARK, "socket_open_tcp_server(): NULL mgr"); 
-               return -1;
-       }
-
-       int sock_fd;
-       struct sockaddr_in server_addr;
-
-       sock_fd = socket(AF_INET, SOCK_STREAM, 0);
-
-       if(sock_fd < 0) {
-               osrfLogWarning( OSRF_LOG_MARK, "tcp_server_connect(): Unable to create socket");
-               return -1;
-       }
-
-       server_addr.sin_family = AF_INET;
-
-       if(listen_ip != NULL) {
-               server_addr.sin_addr.s_addr = inet_addr(listen_ip);
-       } else {
-               server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
-       }
-
-       server_addr.sin_port = htons(port);
-
-       if(bind( sock_fd, (struct sockaddr*) &server_addr, sizeof(server_addr)) < 0) {
-               osrfLogWarning( OSRF_LOG_MARK, "tcp_server_connect(): cannot bind to port %d", port );
-               return -1;
-       }
-
-       if(listen(sock_fd, 20) == -1) {
-               osrfLogWarning( OSRF_LOG_MARK, "tcp_server_connect(): listen() returned error");
-               return -1;
-       }
-
-       _socket_add_node(mgr, SERVER_SOCKET, INET, sock_fd, 0);
-       return sock_fd;
-}
-
-int socket_open_unix_server(socket_manager* mgr, char* path) {
-       if(mgr == NULL || path == NULL) return -1;
-
-       osrfLogDebug( OSRF_LOG_MARK, "opening unix socket at %s", path);
-       int sock_fd;
-       struct sockaddr_un server_addr;
-
-       sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);
-       if(sock_fd < 0){
-               osrfLogWarning( OSRF_LOG_MARK, "socket_open_unix_server(): socket() failed");
-               return -1;
-       }
-
-       server_addr.sun_family = AF_UNIX;
-       strcpy(server_addr.sun_path, path);
-
-       if( bind(sock_fd, (struct sockaddr*) &server_addr, 
-                               sizeof(struct sockaddr_un)) < 0) {
-               osrfLogWarning( OSRF_LOG_MARK, 
-                       "socket_open_unix_server(): cannot bind to unix port %s", path );
-               return -1;
-       }
-
-       if(listen(sock_fd, 20) == -1) {
-               osrfLogWarning( OSRF_LOG_MARK, "socket_open_unix_server(): listen() returned error");
-               return -1;
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "unix socket successfully opened");
-       
-       int i = 1;
-
-       /* causing problems with router for some reason ... */
-       //osrfLogDebug( OSRF_LOG_MARK, "Setting SO_REUSEADDR");
-       //setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
-       
-       //osrfLogDebug( OSRF_LOG_MARK, "Setting TCP_NODELAY");
-       setsockopt(sock_fd, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i));
-
-       _socket_add_node(mgr, SERVER_SOCKET, UNIX, sock_fd, 0);
-       return sock_fd;
-}
-
-
-
-int socket_open_udp_server( 
-               socket_manager* mgr, int port, char* listen_ip ) {
-
-       int sockfd;
-       struct sockaddr_in server_addr;
-
-       if( (sockfd = socket( AF_INET, SOCK_DGRAM, 0 )) < 0 ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to create UDP socket");
-               return -1;
-       }
-
-       server_addr.sin_family = AF_INET;
-       server_addr.sin_port = htons(port);
-       if(listen_ip) server_addr.sin_addr.s_addr = inet_addr(listen_ip);
-       else server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-       if( (bind (sockfd, (struct sockaddr *) &server_addr,sizeof(server_addr))) ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to bind to UDP port %d", port);
-               return -1;
-       }
-
-       _socket_add_node(mgr, SERVER_SOCKET, INET, sockfd, 0);
-       return sockfd;
-}
-
-
-int socket_open_tcp_client(socket_manager* mgr, int port, char* dest_addr) {
-
-       struct sockaddr_in remoteAddr, localAddr;
-   struct hostent *hptr;
-   int sock_fd;
-
-   // ------------------------------------------------------------------
-   // Create the socket
-   // ------------------------------------------------------------------
-   if( (sock_fd = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
-      osrfLogWarning( OSRF_LOG_MARK,  "tcp_connect(): Cannot create socket" );
-      return -1;
-   }
-
-       int i = 1;
-       //osrfLogDebug( OSRF_LOG_MARK, "Setting TCP_NODELAY");
-       setsockopt(sock_fd, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i));
-
-
-   // ------------------------------------------------------------------
-   // Get the hostname
-   // ------------------------------------------------------------------
-   if( (hptr = gethostbyname( dest_addr ) ) == NULL ) {
-      osrfLogWarning(  OSRF_LOG_MARK, "tcp_connect(): Unknown Host => %s", dest_addr );
-      return -1;
-   }
-
-   // ------------------------------------------------------------------
-   // Construct server info struct
-   // ------------------------------------------------------------------
-   memset( &remoteAddr, 0, sizeof(remoteAddr));
-   remoteAddr.sin_family = AF_INET;
-   remoteAddr.sin_port = htons( port );
-   memcpy( (char*) &remoteAddr.sin_addr.s_addr,
-         hptr->h_addr_list[0], hptr->h_length );
-
-   // ------------------------------------------------------------------
-   // Construct local info struct
-   // ------------------------------------------------------------------
-   memset( &localAddr, 0, sizeof( localAddr ) );
-   localAddr.sin_family = AF_INET;
-   localAddr.sin_addr.s_addr = htonl( INADDR_ANY );
-   localAddr.sin_port = htons(0);
-
-   // ------------------------------------------------------------------
-   // Bind to a local port
-   // ------------------------------------------------------------------
-   if( bind( sock_fd, (struct sockaddr *) &localAddr, sizeof( localAddr ) ) < 0 ) {
-      osrfLogWarning(  OSRF_LOG_MARK, "tcp_connect(): Cannot bind to local port" );
-      return -1;
-   }
-
-   // ------------------------------------------------------------------
-   // Connect to server
-   // ------------------------------------------------------------------
-   if( connect( sock_fd, (struct sockaddr*) &remoteAddr, sizeof( struct sockaddr_in ) ) < 0 ) {
-      osrfLogWarning(  OSRF_LOG_MARK, "tcp_connect(): Cannot connect to server %s", dest_addr );
-      return -1;
-   }
-
-       _socket_add_node(mgr, CLIENT_SOCKET, INET, sock_fd, -1 );
-
-   return sock_fd;
-}
-
-
-int socket_open_udp_client( 
-               socket_manager* mgr, int port, char* dest_addr) {
-
-       int sockfd;
-       struct sockaddr_in client_addr, server_addr;
-       struct hostent* host;
-
-       if( (host = gethostbyname(dest_addr)) == NULL) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to resolve host: %s", dest_addr);
-               return -1;
-       }
-
-       server_addr.sin_family = host->h_addrtype;
-       memcpy((char *) &server_addr.sin_addr.s_addr,
-                            host->h_addr_list[0], host->h_length);
-       server_addr.sin_port = htons(port);
-
-       if( (sockfd = socket(AF_INET,SOCK_DGRAM,0)) < 0 ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to create UDP socket");
-               return -1;
-       }
-
-       client_addr.sin_family = AF_INET;
-       client_addr.sin_addr.s_addr = htonl(INADDR_ANY);
-       client_addr.sin_port = htons(0);
-
-       if( (bind(sockfd, (struct sockaddr *) &client_addr, sizeof(client_addr))) < 0 ) {
-               osrfLogWarning( OSRF_LOG_MARK, "Unable to bind UDP socket");
-               return -1;
-       }
-
-       _socket_add_node(mgr, CLIENT_SOCKET, INET, sockfd, -1 );
-
-       return sockfd;
-}
-
-
-int socket_open_unix_client(socket_manager* mgr, char* sock_path) {
-
-       int sock_fd, len;
-   struct sockaddr_un usock;
-
-   if( (sock_fd = socket( AF_UNIX, SOCK_STREAM, 0 )) < 0 ) {
-               osrfLogWarning(  OSRF_LOG_MARK, "Cannot create socket" );
-               return -1;
-       }
-
-   usock.sun_family = AF_UNIX;
-   strcpy( usock.sun_path, sock_path );
-
-   len = sizeof( usock.sun_family ) + strlen( usock.sun_path );
-
-   if( connect( sock_fd, (struct sockaddr *) &usock, len ) < 0 ) {
-      osrfLogWarning(  OSRF_LOG_MARK, "Error connecting to unix socket" );
-               return -1;
-       }
-
-       _socket_add_node(mgr, CLIENT_SOCKET, UNIX, sock_fd, -1 );
-
-   return sock_fd;
-}
-
-
-
-/* returns the socket_node with the given sock_fd */
-socket_node* socket_find_node(socket_manager* mgr, int sock_fd) {
-       if(mgr == NULL) return NULL;
-       socket_node* node = mgr->socket;
-       while(node) {
-               if(node->sock_fd == sock_fd)
-                       return node;
-               node = node->next;
-       }
-       return NULL;
-}
-
-/* removes the node with the given sock_fd from the list and frees it */
-void socket_remove_node(socket_manager* mgr, int sock_fd) {
-
-       if(mgr == NULL) return;
-
-       osrfLogDebug( OSRF_LOG_MARK, "removing socket %d", sock_fd);
-
-       socket_node* head = mgr->socket;
-       socket_node* tail = head;
-       if(head == NULL) return;
-
-       /* if removing the first node in the list */
-       if(head->sock_fd == sock_fd) {
-               mgr->socket = head->next;
-               free(head);
-               return;
-       }
-
-       head = head->next;
-
-       /* if removing any other node */
-       while(head) {
-               if(head->sock_fd == sock_fd) {
-                       tail->next = head->next;
-                       free(head);
-                       return;
-               }
-               tail = head;
-               head = head->next;
-       }
-}
-
-
-
-void _socket_print_list(socket_manager* mgr) {
-       if(mgr == NULL) return;
-       socket_node* node = mgr->socket;
-       osrfLogDebug( OSRF_LOG_MARK, "socket_node list: [");
-       while(node) {
-               osrfLogDebug( OSRF_LOG_MARK, "sock_fd: %d | parent_id: %d", 
-                               node->sock_fd, node->parent_id);
-               node = node->next;
-       }
-       osrfLogDebug( OSRF_LOG_MARK, "]");
-}
-
-/* sends the given data to the given socket */
-int socket_send(int sock_fd, const char* data) {
-       return _socket_send( sock_fd, data, 0);
-}
-
-
-int _socket_send(int sock_fd, const char* data, int flags) {
-
-       signal(SIGPIPE, SIG_IGN); /* in case a unix socket was closed */
-
-       size_t r = send( sock_fd, data, strlen(data), flags );
-
-       if( r == -1 ) {
-               osrfLogWarning( OSRF_LOG_MARK, "tcp_server_send(): Error sending data with return %d", r );
-               osrfLogWarning( OSRF_LOG_MARK, "Last Sys Error: %s", strerror(errno));
-               return -1;
-       }
-
-       return 0;
-}
-
-
-int socket_send_nowait( int sock_fd, const char* data) {
-       return _socket_send( sock_fd, data, MSG_DONTWAIT);
-}
-
-
-/*
- * Waits at most usecs microseconds for the send buffer of the given
- * socket to accept new data.  This does not guarantee that the 
- * socket will accept all the data we want to give it.
- */
-int socket_send_timeout( int sock_fd, const char* data, int usecs ) {
-
-       fd_set write_set;
-       FD_ZERO( &write_set );
-       FD_SET( sock_fd, &write_set );
-
-       int mil = 1000000;
-       int secs = (int) usecs / mil;
-       usecs = usecs - (secs * mil);
-
-       struct timeval tv;
-       tv.tv_sec = secs;
-       tv.tv_usec = usecs;
-
-       int ret = select( sock_fd + 1, NULL, &write_set, NULL, &tv);
-       if( ret > 0 ) return _socket_send( sock_fd, data, 0);
-
-       osrfLogError(OSRF_LOG_MARK, "socket_send_timeout(): "
-               "timed out on send for socket %d after %d secs, %d usecs", sock_fd, secs, usecs );
-
-       return -1;
-}
-
-
-/* disconnects the node with the given sock_fd and removes
-       it from the socket set */
-void socket_disconnect(socket_manager* mgr, int sock_fd) {
-       osrfLogInternal( OSRF_LOG_MARK, "Closing socket %d", sock_fd);
-       close( sock_fd );
-       socket_remove_node(mgr, sock_fd);
-}
-
-
-/* we assume that if select() fails, the socket is no longer valid */
-int socket_connected(int sock_fd) {
-       fd_set read_set;
-       FD_ZERO( &read_set );
-       FD_SET( sock_fd, &read_set );
-       if( select( sock_fd + 1, &read_set, NULL, NULL, NULL) == -1 ) 
-               return 0;
-       return 1;
-
-}
-
-/* this only waits on the server socket and does not handle the actual
-       data coming in from the client..... XXX */
-int socket_wait(socket_manager* mgr, int timeout, int sock_fd) {
-
-       int retval = 0;
-       fd_set read_set;
-       FD_ZERO( &read_set );
-       FD_SET( sock_fd, &read_set );
-
-       struct timeval tv;
-       tv.tv_sec = timeout;
-       tv.tv_usec = 0;
-
-       if( timeout < 0 ) {  
-
-               // If timeout is -1, we block indefinitely
-               if( (retval = select( sock_fd + 1, &read_set, NULL, NULL, NULL)) == -1 ) {
-                       osrfLogDebug( OSRF_LOG_MARK, "Call to select() interrupted: Sys Error: %s", strerror(errno));
-                       return -1;
-               }
-
-       } else if( timeout > 0 ) { /* timeout of 0 means don't block */
-
-               if( (retval = select( sock_fd + 1, &read_set, NULL, NULL, &tv)) == -1 ) {
-                       osrfLogDebug( OSRF_LOG_MARK, "Call to select() interrupted: Sys Error: %s", strerror(errno));
-                       return -1;
-               }
-       }
-
-       osrfLogInternal( OSRF_LOG_MARK, "%d active sockets after select()", retval);
-       return _socket_route_data_id(mgr, sock_fd);
-}
-
-
-int socket_wait_all(socket_manager* mgr, int timeout) {
-
-       if(mgr == NULL) {
-               osrfLogWarning( OSRF_LOG_MARK,  "tcp_wait(): null mgr" );
-               return -1;
-       }
-
-       int retval = 0;
-       fd_set read_set;
-       FD_ZERO( &read_set );
-
-       socket_node* node = mgr->socket;
-       int max_fd = 0;
-       while(node) {
-               osrfLogInternal( OSRF_LOG_MARK, "Adding socket fd %d to select set",node->sock_fd);
-               FD_SET( node->sock_fd, &read_set );
-               if(node->sock_fd > max_fd) max_fd = node->sock_fd;
-               node = node->next;
-       }
-       max_fd += 1;
-
-       struct timeval tv;
-       tv.tv_sec = timeout;
-       tv.tv_usec = 0;
-
-       if( timeout < 0 ) {  
-
-               // If timeout is -1, there is no timeout passed to the call to select
-               if( (retval = select( max_fd, &read_set, NULL, NULL, NULL)) == -1 ) {
-                       osrfLogWarning( OSRF_LOG_MARK, "Call to select interrupted (returned -1)");
-                       osrfLogWarning( OSRF_LOG_MARK, "Sys Error: %s", strerror(errno));
-                       return -1;
-               }
-
-       } else if( timeout != 0 ) { /* timeout of 0 means don't block */
-
-               if( (retval = select( max_fd, &read_set, NULL, NULL, &tv)) == -1 ) {
-                       osrfLogWarning( OSRF_LOG_MARK,  "Call to select interrupted (returned -1)" );
-                       osrfLogWarning( OSRF_LOG_MARK, "Sys Error: %s", strerror(errno));
-                       return -1;
-               }
-       }
-
-       osrfLogDebug( OSRF_LOG_MARK, "%d active sockets after select()", retval);
-       return _socket_route_data(mgr, retval, &read_set);
-}
-
-/* determines if we'er receiving a new client or data
-       on an existing client */
-int _socket_route_data(
-       socket_manager* mgr, int num_active, fd_set* read_set) {
-
-       if(!(mgr && read_set)) return -1;
-
-       int last_failed_id = -1;
-
-
-       /* come back here if someone yanks a socket_node from beneath us */
-       while(1) {
-
-               socket_node* node = mgr->socket;
-               int handled = 0;
-               int status = 0;
-               
-               while(node && (handled < num_active)) {
-       
-                       int sock_fd = node->sock_fd;
-                       
-                       if(last_failed_id != -1) {
-                               /* in case it was not removed by our overlords */
-                               osrfLogInternal( OSRF_LOG_MARK, "Attempting to remove last_failed_id of %d", last_failed_id);
-                               socket_remove_node( mgr, last_failed_id );
-                               last_failed_id = -1;
-                               status = -1;
-                               break;
-                       }
-       
-                       /* does this socket have data? */
-                       if( FD_ISSET( sock_fd, read_set ) ) {
-       
-                               osrfLogInternal( OSRF_LOG_MARK, "Socket %d active", sock_fd);
-                               handled++;
-                               FD_CLR(sock_fd, read_set);
-       
-                               if(node->endpoint == SERVER_SOCKET) 
-                                       _socket_handle_new_client(mgr, node);
-       
-                               else
-                                       status = _socket_handle_client_data(mgr, node);
-       
-                               /* someone may have yanked a socket_node out from under 
-                                       us...start over with the first socket */
-                               if(status == -1)  {
-                                       last_failed_id = sock_fd;
-                                       osrfLogInternal( OSRF_LOG_MARK, "Backtracking back to start of loop because "
-                                                       "of -1 return code from _socket_handle_client_data()");
-                               }
-                       }
-
-                       if(status == -1) break;
-                       node = node->next;
-
-               } // is_set
-
-               if(status == 0) break;
-               if(status == -1) status = 0;
-       } 
-
-       return 0;
-}
-
-
-int _socket_route_data_id( socket_manager* mgr, int sock_id) {
-       socket_node* node = socket_find_node(mgr, sock_id);     
-       int status = 0;
-
-       if(node) {
-               if(node->endpoint == SERVER_SOCKET) 
-                       _socket_handle_new_client(mgr, node);
-       
-               if(node->endpoint == CLIENT_SOCKET ) 
-                       status = _socket_handle_client_data(mgr, node);
-
-               if(status == -1) {
-                       socket_remove_node(mgr, sock_id);
-                       return -1;
-               }
-               return 0;
-       } 
-
-       return -1;
-}
-
-
-int _socket_handle_new_client(socket_manager* mgr, socket_node* node) {
-       if(mgr == NULL || node == NULL) return -1;
-
-       int new_sock_fd;
-       new_sock_fd = accept(node->sock_fd, NULL, NULL);
-       if(new_sock_fd < 0) {
-               osrfLogWarning( OSRF_LOG_MARK, "_socket_route_data(): accept() failed");
-               return -1;
-       }
-
-       if(node->addr_type == INET) {
-               _socket_add_node(mgr, CLIENT_SOCKET, INET, new_sock_fd, node->sock_fd);
-               osrfLogDebug( OSRF_LOG_MARK, "Adding new INET client for %d", node->sock_fd);
-
-       } else if(node->addr_type == UNIX) {
-               _socket_add_node(mgr, CLIENT_SOCKET, UNIX, new_sock_fd, node->sock_fd);
-               osrfLogDebug( OSRF_LOG_MARK, "Adding new UNIX client for %d", node->sock_fd);
-       }
-
-       return 0;
-}
-
-
-int _socket_handle_client_data(socket_manager* mgr, socket_node* node) {
-       if(mgr == NULL || node == NULL) return -1;
-
-       char buf[RBUFSIZE];
-       int read_bytes;
-       int sock_fd = node->sock_fd;
-
-       memset(buf, 0, RBUFSIZE);
-       set_fl(sock_fd, O_NONBLOCK);
-
-       osrfLogInternal( OSRF_LOG_MARK, "%d : Received data at %f\n", getpid(), get_timestamp_millis());
-
-       while( (read_bytes = recv(sock_fd, buf, RBUFSIZE-1, 0) ) > 0 ) {
-               osrfLogInternal( OSRF_LOG_MARK, "Socket %d Read %d bytes and data: %s", sock_fd, read_bytes, buf);
-               if(mgr->data_received)
-                       mgr->data_received(mgr->blob, mgr, sock_fd, buf, node->parent_id);
-
-               memset(buf, 0, RBUFSIZE);
-       }
-
-       if(socket_find_node(mgr, sock_fd)) {  /* someone may have closed this socket */
-               clr_fl(sock_fd, O_NONBLOCK); 
-               if(read_bytes < 0) { 
-                       if( errno != EAGAIN ) 
-                               osrfLogWarning( OSRF_LOG_MARK,  " * Error reading socket with errno %d", errno );
-               }
-
-       } else { return -1; } /* inform the caller that this node has been tampered with */
-
-       if(read_bytes == 0) {  /* socket closed by client */
-               if(mgr->on_socket_closed) {
-                       mgr->on_socket_closed(mgr->blob, sock_fd);
-               }
-               return -1;
-       }
-
-       return 0;
-
-}
-
-
-void socket_manager_free(socket_manager* mgr) {
-       if(mgr == NULL) return;
-       socket_node* tmp;
-       while(mgr->socket) {
-               tmp = mgr->socket->next;
-               socket_disconnect(mgr, mgr->socket->sock_fd);
-               mgr->socket = tmp;
-       }
-       free(mgr);
-
-}
diff --git a/OpenSRF/src/utils/socket_bundle.h b/OpenSRF/src/utils/socket_bundle.h
deleted file mode 100644 (file)
index d1f5fd7..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "utils.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#include "utils.h"
-#include "log.h"
-
-//---------------------------------------------------------------
-// Unix headers
-//---------------------------------------------------------------
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <sys/un.h>
-
-#include <signal.h>
-
-#ifndef SOCKET_BUNDLE_H
-#define SOCKET_BUNDLE_H
-
-
-#define SERVER_SOCKET                  1
-#define CLIENT_SOCKET                  2
-
-#define INET 10 
-#define UNIX 11 
-
-/* buffer used to read from the sockets */
-#define RBUFSIZE 1024 
-
-
-/* models a single socket connection */
-struct socket_node_struct {
-       int endpoint;           /* SERVER_SOCKET or CLIENT_SOCKET */
-       int addr_type;          /* INET or UNIX */
-       int sock_fd;
-       int parent_id;          /* if we're a new client for a server socket, 
-                                                               this points to the server socket we spawned from */
-       struct socket_node_struct* next;
-};
-typedef struct socket_node_struct socket_node;
-
-
-/* Maintains the socket set */
-struct socket_manager_struct {
-       /* callback for passing up any received data.  sock_fd is the socket
-               that read the data.  parent_id (if > 0) is the socket id of the 
-               server that this socket spawned from (i.e. it's a new client connection) */
-       void (*data_received) 
-               (void* blob, struct socket_manager_struct*, 
-                int sock_fd, char* data, int parent_id);
-
-       void (*on_socket_closed) (void* blob, int sock_fd);
-
-       socket_node* socket;
-       void* blob;
-};
-typedef struct socket_manager_struct socket_manager;
-
-void socket_manager_free(socket_manager* mgr);
-
-/* creates a new server socket node and adds it to the socket set.
-       returns socket id on success.  -1 on failure.
-       socket_type is one of INET or UNIX  */
-int socket_open_tcp_server(socket_manager*, int port, char* listen_ip );
-
-int socket_open_unix_server(socket_manager* mgr, char* path);
-
-int socket_open_udp_server( socket_manager* mgr, int port, char* listen_ip );
-
-/* creates a client TCP socket and adds it to the socket set.
-       returns 0 on success.  -1 on failure.  */
-int socket_open_tcp_client(socket_manager*, int port, char* dest_addr);
-
-/* creates a client UNIX socket and adds it to the socket set.
-       returns 0 on success.  -1 on failure.  */
-int socket_open_unix_client(socket_manager*, char* sock_path);
-
-int socket_open_udp_client( socket_manager* mgr, int port, char* dest_addr);
-
-/* returns the socket_node with the given sock_fd */
-socket_node* socket_find_node(socket_manager*, int sock_fd);
-
-/* removes the node with the given sock_fd from the list and frees it */
-void socket_remove_node(socket_manager*, int sock_fd);
-
-
-/* sends the given data to the given socket. returns 0 on success, -1 otherwise */
-int socket_send(int sock_fd, const char* data);
-
-/* utility method */
-int _socket_send(int sock_fd, const char* data, int flags);
-
-
-/* sends the given data to the given socket. 
- * sets the send flag MSG_DONTWAIT which will allow the 
- * process to continue even if the socket buffer is full
- * returns 0 on success, -1 otherwise */
-int socket_send_nowait( int sock_fd, const char* data);
-
-/* waits at most usecs microseconds for the socket buffer to
- * be available */
-int socket_send_timeout( int sock_fd, const char* data, int usecs );
-
-/* disconnects the node with the given sock_fd and removes
-       it from the socket set */
-void socket_disconnect(socket_manager*, int sock_fd);
-
-/* allocates and inserts a new socket node into the nodeset.
-       if parent_id is positive and non-zero, it will be set */
-socket_node*  _socket_add_node(socket_manager* mgr, 
-               int endpoint, int addr_type, int sock_fd, int parent_id );
-
-/* XXX This only works if 'sock_fd' is a client socket... */
-int socket_wait(socket_manager* mgr, int timeout, int sock_fd);
-
-/* waits on all sockets for incoming data.  
-       timeout == -1   | block indefinitely
-       timeout == 0    | don't block, just read any available data off all sockets
-       timeout == x    | block for at most x seconds */
-int socket_wait_all(socket_manager* mgr, int timeout);
-
-/* iterates over the sockets in the set and handles active sockets.
-       new sockets connecting to server sockets cause the creation
-       of a new socket node.
-       Any new data read is is passed off to the data_received callback
-       as it arrives */
-int _socket_route_data(socket_manager* mgr, int num_active, fd_set* read_set);
-
-/* routes data from a single known socket */
-int _socket_route_data_id( socket_manager* mgr, int sock_id);
-
-/* utility function for displaying the currently attached sockets */
-void _socket_print_list(socket_manager* mgr);
-
-int socket_connected(int sock_fd);
-
-
-int _socket_handle_new_client(socket_manager* mgr, socket_node* node);
-int _socket_handle_client_data(socket_manager* mgr, socket_node* node);
-
-
-#endif
diff --git a/OpenSRF/src/utils/socket_test.c b/OpenSRF/src/utils/socket_test.c
deleted file mode 100644 (file)
index 4bc7653..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "socket_bundle.h"
-
-int count = 0;
-void printme(void* blob, socket_manager* mgr, 
-               int sock_fd, char* data, int parent_id) {
-
-       fprintf(stderr, "Got data from socket %d with parent %d => %s", 
-                       sock_fd, parent_id, data );
-
-       socket_send(sock_fd, data);
-
-       if(count++ > 2) {
-//             socket_disconnect(mgr, sock_fd);
-               _socket_print_list(mgr);
-               socket_manager_free(mgr);
-               exit(0);
-       }
-}
-
-int main(int argc, char* argv[]) {
-       socket_manager* manager = safe_malloc(sizeof(socket_manager));
-       int port = 11000;
-       if(argv[1])
-               port = atoi(argv[1]);
-
-       manager->data_received = &printme;
-       socket_open_tcp_server(manager, port);
-
-       while(1)
-               socket_wait_all(manager, -1);
-
-       return 0;
-}
diff --git a/OpenSRF/src/utils/string_array.c b/OpenSRF/src/utils/string_array.c
deleted file mode 100644 (file)
index ee8c542..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "string_array.h"
-
-osrfStringArray* osrfNewStringArray(int size) {
-       return init_string_array(size);
-}
-
-string_array* init_string_array(int size) {
-       if(size > STRING_ARRAY_MAX_SIZE)
-               osrfLogError( OSRF_LOG_MARK, "init_string_array size is too large");
-
-       /*
-       string_array* arr = 
-               (string_array*) safe_malloc(sizeof(string_array));
-               */
-       string_array* arr;
-       OSRF_MALLOC( arr, sizeof(string_array));
-
-       //arr->array = (char**) safe_malloc(size * sizeof(char*));
-       OSRF_MALLOC(arr->array, size * sizeof(char*));
-
-       arr->size = 0;
-       arr->arr_size = size;
-       return arr;
-}
-
-
-void osrfStringArrayAdd(osrfStringArray* arr, char* string) {
-       string_array_add(arr, string);
-}
-
-void string_array_add(string_array* arr, char* str) {
-       if(arr == NULL || str == NULL ) return;
-       if( strlen(str) < 1 ) return;
-
-       arr->size++;
-
-       if( arr->size > STRING_ARRAY_MAX_SIZE ) 
-               osrfLogError( OSRF_LOG_MARK, "string_array_add size is too large");
-
-       /* if necessary, double capacity */
-       if(arr->size >= arr->arr_size) {
-               arr->arr_size *= 2;
-               //char** tmp = (char**) safe_malloc(arr->arr_size * sizeof(char*));
-               char** tmp;
-               OSRF_MALLOC( tmp, arr->arr_size * sizeof(char*));
-               int i;
-
-               /* copy the string pointers over */
-               for( i = 0; i!= arr->size; i++ ) 
-                       tmp[i] = arr->array[i];
-
-               free(arr->array);
-               arr->array = tmp;
-       }
-
-       arr->array[arr->size - 1] = strdup(str);
-}
-
-char* osrfStringArrayGetString(osrfStringArray* arr, int index) {
-       return string_array_get_string(arr, index);
-}
-
-char* string_array_get_string(string_array* arr, int index) {
-       if(!arr || index < 0 || index >= arr->size ) return NULL;
-       return arr->array[index]; 
-}
-
-
-void osrfStringArrayFree(osrfStringArray* arr) {
-       string_array_destroy(arr);
-}
-
-void string_array_destroy(string_array* arr) {
-       if(arr) {
-               int i = 0;
-               while( i < arr->size ) free(arr->array[i++]);
-               free(arr->array);
-               free(arr);
-       }
-}
-
-
-int osrfStringArrayContains( osrfStringArray* arr, char* string ) {
-       if(!(arr && string)) return 0;
-       
-       int i;
-       for( i = 0; i != arr->size; i++ ) {
-               char* str = osrfStringArrayGetString(arr, i);
-               if(str) {
-                       if(!strcmp(str, string)) return 1;
-               }
-       }
-
-       return 0;
-}
-
-void osrfStringArrayRemove( osrfStringArray* arr, char* tstr) {
-       if(!(arr && tstr)) return;
-       int i;
-       for( i = 0; i != arr->size; i++ ) {
-               char* str = osrfStringArrayGetString(arr, i);
-               if(str) {
-                       if(!strcmp(str, tstr)) {
-                               free(arr->array[i]);
-                               arr->array[i] = NULL;
-                               break;
-                       }
-               }
-       }
-       for( ; i != arr->size; i++ ) 
-               arr->array[i] = arr->array[i+1];
-
-       arr->size--;
-}
-
-
diff --git a/OpenSRF/src/utils/string_array.h b/OpenSRF/src/utils/string_array.h
deleted file mode 100644 (file)
index c235b93..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <stdio.h>
-
-#include "utils.h"
-#include "log.h"
-
-#define STRING_ARRAY_MAX_SIZE 1024
-
-#ifndef STRING_ARRAY_H
-#define STRING_ARRAY_H
-
-struct string_array_struct {
-               char** array;   
-               int size;
-               int arr_size;
-               int total_string_size;
-};
-typedef struct string_array_struct string_array;
-typedef struct string_array_struct osrfStringArray;
-
-osrfStringArray* init_string_array(int size);
-osrfStringArray* osrfNewStringArray(int size);
-
-void string_array_add(osrfStringArray*, char* string);
-void osrfStringArrayAdd(osrfStringArray*, char* string);
-
-char* string_array_get_string(osrfStringArray* arr, int index);
-char* osrfStringArrayGetString(osrfStringArray* arr, int index);
-
-/* returns true if this array contains the given string */
-int osrfStringArrayContains( osrfStringArray* arr, char* string );
-
-
-void string_array_destroy(osrfStringArray*);
-void osrfStringArrayFree(osrfStringArray*);
-
-/* total size of all included strings */
-int string_array_get_total_size(osrfStringArray* arr);
-
-void osrfStringArrayRemove( osrfStringArray* arr, char* str);
-
-#endif
diff --git a/OpenSRF/src/utils/utils.c b/OpenSRF/src/utils/utils.c
deleted file mode 100644 (file)
index bdeaa96..0000000
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#include "utils.h"
-#include <errno.h>
-
-inline void* safe_malloc( int size ) {
-       void* ptr = (void*) malloc( size );
-       if( ptr == NULL ) {
-               perror("safe_malloc(): Out of Memory" );
-               exit(99);
-       }
-       memset( ptr, 0, size );
-       return ptr;
-}
-
-
-char** __global_argv = NULL;
-int __global_argv_size = 0;
-
-int init_proc_title( int argc, char* argv[] ) {
-
-       __global_argv = argv;
-
-       int i = 0;
-       while( i < argc ) {
-               int len = strlen( __global_argv[i]);
-               bzero( __global_argv[i++], len );
-               __global_argv_size += len;
-       }
-
-       __global_argv_size -= 2;
-       return 0;
-}
-
-int set_proc_title( char* format, ... ) {
-       VA_LIST_TO_STRING(format);
-       bzero( *(__global_argv), __global_argv_size );
-       return snprintf( *(__global_argv), __global_argv_size, VA_BUF );
-}
-
-
-/* utility method for profiling */
-double get_timestamp_millis() {
-       struct timeval tv;
-       gettimeofday(&tv, NULL);
-       double time     = (int)tv.tv_sec        + ( ((double)tv.tv_usec / 1000000) );
-       return time;
-}
-
-
-/* setting/clearing file flags */
-int set_fl( int fd, int flags ) {
-       
-       int val;
-
-       if( (val = fcntl( fd, F_GETFL, 0) ) < 0 ) {
-               fprintf(stderr, "fcntl F_GETFL error");
-               return -1;
-       }
-
-       val |= flags;
-
-       if( fcntl( fd, F_SETFL, val ) < 0 ) {
-               fprintf(stderr, "fcntl F_SETFL error");
-               return -1;
-       }
-       return 0;
-}
-       
-int clr_fl( int fd, int flags ) {
-       
-       int val;
-
-       if( (val = fcntl( fd, F_GETFL, 0) ) < 0 ) {
-               fprintf(stderr, "fcntl F_GETFL error" );
-               return -1;
-       }
-
-       val &= ~flags;
-
-       if( fcntl( fd, F_SETFL, val ) < 0 ) {
-               fprintf( stderr, "fcntl F_SETFL error" );
-               return -1;
-       }
-       return 0;
-}
-
-long va_list_size(const char* format, va_list args) {
-       int len = 0;
-       len = vsnprintf(NULL, 0, format, args);
-       va_end(args);
-       len += 2;
-       return len;
-}
-
-
-char* va_list_to_string(const char* format, ...) {
-
-       long len = 0;
-       va_list args;
-       va_list a_copy;
-
-       va_copy(a_copy, args);
-
-       va_start(args, format);
-       len = va_list_size(format, args);
-
-       char buf[len];
-       memset(buf, 0, len);
-
-       va_start(a_copy, format);
-       vsnprintf(buf, len - 1, format, a_copy);
-       va_end(a_copy);
-       return strdup(buf);
-}
-
-// ---------------------------------------------------------------------------------
-// Flesh out a ubiqitous growing string buffer
-// ---------------------------------------------------------------------------------
-
-growing_buffer* buffer_init(int num_initial_bytes) {
-
-       if( num_initial_bytes > BUFFER_MAX_SIZE ) return NULL;
-
-       size_t len = sizeof(growing_buffer);
-
-       growing_buffer* gb;
-       OSRF_MALLOC(gb, len);
-
-       gb->n_used = 0;/* nothing stored so far */
-       gb->size = num_initial_bytes;
-       OSRF_MALLOC(gb->buf, gb->size + 1);
-
-       return gb;
-}
-
-
-int buffer_fadd(growing_buffer* gb, const char* format, ... ) {
-
-       if(!gb || !format) return 0; 
-
-       long len = 0;
-       va_list args;
-       va_list a_copy;
-
-       va_copy(a_copy, args);
-
-       va_start(args, format);
-       len = va_list_size(format, args);
-
-       char buf[len];
-       memset(buf, 0, len);
-
-       va_start(a_copy, format);
-       vsnprintf(buf, len - 1, format, a_copy);
-       va_end(a_copy);
-
-       return buffer_add(gb, buf);
-
-}
-
-
-int buffer_add(growing_buffer* gb, char* data) {
-       if(!(gb && data)) return 0;
-
-       int data_len = strlen( data );
-
-       if(data_len == 0) return 0;
-
-       int total_len = data_len + gb->n_used;
-
-       if( total_len >= gb->size ) {
-               while( total_len >= gb->size ) {
-                       gb->size *= 2;
-               }
-       
-               if( gb->size > BUFFER_MAX_SIZE ) {
-                       fprintf(stderr, "Buffer reached MAX_SIZE of %d", BUFFER_MAX_SIZE );
-                       buffer_free( gb );
-                       return 0;
-               }
-       
-               char* new_data;
-               OSRF_MALLOC(new_data, gb->size );
-       
-               strcpy( new_data, gb->buf );
-               free( gb->buf );
-               gb->buf = new_data;
-       }
-
-       strcat( gb->buf, data );
-       gb->n_used = total_len;
-       return total_len;
-}
-
-
-int buffer_reset( growing_buffer *gb){
-       if( gb == NULL ) { return 0; }
-       if( gb->buf == NULL ) { return 0; }
-       memset( gb->buf, 0, gb->size );
-       gb->n_used = 0;
-       return 1;
-}
-
-int buffer_free( growing_buffer* gb ) {
-       if( gb == NULL ) 
-               return 0;
-       free( gb->buf );
-       free( gb );
-       return 1;
-}
-
-char* buffer_data( growing_buffer *gb) {
-       return strdup( gb->buf );
-}
-
-
-/*
-#define OSRF_BUFFER_ADD_CHAR(gb, c)\
-       do {\
-               if(gb) {\
-                       if(gb->n_used < gb->size - 1)\
-                               gb->buf[gb->n_used++] = c;\
-                       else\
-                               buffer_add_char(gb, c);\
-               }\
-       }while(0)
-       */
-
-int buffer_add_char(growing_buffer* gb, char c) {
-       char buf[2];
-       buf[0] = c;
-       buf[1] = '\0';
-       buffer_add(gb, buf);
-       return 1;
-}
-
-
-
-char* uescape( const char* string, int size, int full_escape ) {
-
-       growing_buffer* buf = buffer_init(size + 64);
-       int clen = 0;
-       int idx = 0;
-       unsigned long int c = 0x0;
-
-       while (string[idx]) {
-
-               c = 0x0;
-
-               if ((unsigned char)string[idx] >= 0x80) { // not ASCII
-
-                       if ((unsigned char)string[idx] >= 0xC0 && (unsigned char)string[idx] <= 0xF4) { // starts a UTF8 string
-
-                               clen = 1;
-                               if (((unsigned char)string[idx] & 0xF0) == 0xF0) {
-                                       clen = 3;
-                                       c = (unsigned char)string[idx] ^ 0xF0;
-
-                               } else if (((unsigned char)string[idx] & 0xE0) == 0xE0) {
-                                       clen = 2;
-                                       c = (unsigned char)string[idx] ^ 0xE0;
-
-                               } else if (((unsigned char)string[idx] & 0xC0) == 0xC0) {
-                                       clen = 1;
-                                       c = (unsigned char)string[idx] ^ 0xC0;
-                               }
-
-                               for (;clen;clen--) {
-
-                                       idx++; // look at the next byte
-                                       c = (c << 6) | ((unsigned char)string[idx] & 0x3F); // add this byte worth
-
-                               }
-
-                               buffer_fadd(buf, "\\u%04x", c);
-
-                       } else {
-                               buffer_free(buf);
-                               return NULL;
-                       }
-
-               } else {
-                       c = string[idx];
-
-                       /* escape the usual suspects */
-                       if(full_escape) {
-                               switch(c) {
-                                       case '"':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, '"');
-                                               break;
-       
-                                       case '\b':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, 'b');
-                                               break;
-       
-                                       case '\f':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, 'f');
-                                               break;
-       
-                                       case '\t':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, 't');
-                                               break;
-       
-                                       case '\n':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, 'n');
-                                               break;
-       
-                                       case '\r':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, 'r');
-                                               break;
-
-                                       case '\\':
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               OSRF_BUFFER_ADD_CHAR(buf, '\\');
-                                               break;
-
-                                       default:
-                                               if( c < 32 ) buffer_fadd(buf, "\\u%04x", c);
-                                               else OSRF_BUFFER_ADD_CHAR(buf, c);
-                               }
-
-                       } else {
-                               OSRF_BUFFER_ADD_CHAR(buf, c);
-                       }
-               }
-
-               idx++;
-       }
-
-       char* d = buffer_data(buf);
-       buffer_free(buf);
-       return d;
-}
-
-
-// A function to turn a process into a daemon and set it's process name in ps/top
-int daemonize() {
-       int f = fork();
-
-       if (f == -1) {
-               perror("Failed to fork!");
-               return -1;
-
-       } else if (f == 0) { // We're in the child now...
-               setsid();
-               return 0;
-
-       } else { // We're in the parent...
-               exit(0);
-       }
-}
-
-
-/* Return 1 if the string represents an integer,  */
-/* as recognized by strtol(); Otherwise return 0. */
-
-int stringisnum(char* s) {
-       char* w;
-       strtol(s, &w, 10);
-       return *w ? 0 : 1;
-}
-       
-
-
-char* file_to_string(const char* filename) {
-
-       if(!filename) return NULL;
-
-       int len = 1024;
-       char buf[len];
-       bzero(buf, len);
-       growing_buffer* gb = buffer_init(len);
-
-       FILE* file = fopen(filename, "r");
-       if(!file) {
-               int l = strlen(filename) + 64;
-               char b[l];
-               snprintf(b,l,"Unable to open file [%s] in file_to_string()", filename);
-               perror(b);
-               return NULL;
-       }
-
-       while(fgets(buf, len - 1, file)) {
-               buffer_add(gb, buf);
-               bzero(buf, len);
-       }
-
-       fclose(file);
-
-       char* data = buffer_data(gb);
-       buffer_free(gb);
-       return data;
-}
-
-
-char* md5sum( char* text, ... ) {
-
-       struct md5_ctx ctx;
-       unsigned char digest[16];
-
-       MD5_start (&ctx);
-
-       VA_LIST_TO_STRING(text);
-
-       int i;
-       for ( i=0 ; i != strlen(VA_BUF) ; i++ )
-               MD5_feed (&ctx, VA_BUF[i]);
-
-       MD5_stop (&ctx, digest);
-
-       char buf[16];
-       memset(buf,0,16);
-
-       char final[256];
-       memset(final,0,256);
-
-       for ( i=0 ; i<16 ; i++ ) {
-               sprintf(buf, "%02x", digest[i]);
-               strcat( final, buf );
-       }
-
-       return strdup(final);
-
-}
-
-int osrfUtilsCheckFileDescriptor( int fd ) {
-
-       fd_set tmpset;
-       FD_ZERO(&tmpset);
-       FD_SET(fd, &tmpset);
-
-       struct timeval tv;
-       tv.tv_sec = 0;
-       tv.tv_usec = 0;
-
-       if( select(fd + 1, &tmpset, NULL, NULL, &tv) == -1 ) {
-               if( errno == EBADF ) return -1;
-       }
-
-       return 0;
-}
-
diff --git a/OpenSRF/src/utils/utils.h b/OpenSRF/src/utils/utils.h
deleted file mode 100644 (file)
index 671650f..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
-Copyright (C) 2005  Georgia Public Library Service 
-Bill Erickson <highfalutin@gmail.com>
-Mike Rylander <mrylander@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include "md5.h"
-
-
-//#define MKCHAR(__c) (char*) __c
-
-
-#define OSRF_MALLOC(ptr, size) \
-       ptr = (void*) malloc( size ); \
-       if( ptr == NULL ) { \
-               perror("OSRF_MALLOC(): Out of Memory" );\
-               exit(99); \
-       } \
-       memset( ptr, 0, size ); 
-
-
-#define OSRF_BUFFER_ADD(gb, data) \
-       do {\
-               int __tl; \
-               if(gb && data) {\
-                       __tl = strlen(data) + gb->n_used;\
-                       if( __tl < gb->size ) {\
-                               strcat(gb->buf, data);\
-                               gb->n_used = __tl; \
-                       } else { buffer_add(gb, data); }\
-               }\
-       } while(0)
-
-#define OSRF_BUFFER_ADD_CHAR(gb, c)\
-       do {\
-               if(gb) {\
-                       if(gb->n_used < gb->size - 1)\
-                               gb->buf[gb->n_used++] = c;\
-                       else\
-                               buffer_add_char(gb, c);\
-               }\
-       }while(0)
-
-       
-
-
-/* turns a va_list into a string */
-#define VA_LIST_TO_STRING(x) \
-       unsigned long __len = 0;\
-       va_list args; \
-       va_list a_copy;\
-       va_copy(a_copy, args); \
-       va_start(args, x); \
-       __len = vsnprintf(NULL, 0, x, args); \
-       va_end(args); \
-       __len += 2; \
-       char _b[__len]; \
-       bzero(_b, __len); \
-       va_start(a_copy, x); \
-       vsnprintf(_b, __len - 1, x, a_copy); \
-       va_end(a_copy); \
-       char* VA_BUF = _b; \
-
-/* turns a long into a string */
-#define LONG_TO_STRING(l) \
-       unsigned int __len = snprintf(NULL, 0, "%ld", l) + 2;\
-       char __b[__len]; \
-       bzero(__b, __len); \
-       snprintf(__b, __len - 1, "%ld", l); \
-       char* LONGSTR = __b;
-
-#define DOUBLE_TO_STRING(l) \
-       unsigned int __len = snprintf(NULL, 0, "%f", l) + 2; \
-       char __b[__len]; \
-       bzero(__b, __len); \
-       snprintf(__b, __len - 1, "%f", l); \
-       char* DOUBLESTR = __b;
-
-#define LONG_DOUBLE_TO_STRING(l) \
-       unsigned int __len = snprintf(NULL, 0, "%Lf", l) + 2; \
-       char __b[__len]; \
-       bzero(__b, __len); \
-       snprintf(__b, __len - 1, "%Lf", l); \
-       char* LONGDOUBLESTR = __b;
-
-
-#define INT_TO_STRING(l) \
-       unsigned int __len = snprintf(NULL, 0, "%d", l) + 2; \
-       char __b[__len]; \
-       bzero(__b, __len); \
-       snprintf(__b, __len - 1, "%d", l); \
-       char* INTSTR = __b;
-
-
-/*
-#define MD5SUM(s) \
-       struct md5_ctx ctx; \
-       unsigned char digest[16];\
-       MD5_start (&ctx);\
-       int i;\
-       for ( i=0 ; i != strlen(text) ; i++ ) MD5_feed (&ctx, text[i]);\
-       MD5_stop (&ctx, digest);\
-       char buf[16];\
-       memset(buf,0,16);\
-       char final[256];\
-       memset(final,0,256);\
-       for ( i=0 ; i<16 ; i++ ) {\
-               sprintf(buf, "%02x", digest[i]);\
-               strcat( final, buf );\
-       }\
-       char* MD5STR = final;
-       */
-
-
-       
-
-
-#define BUFFER_MAX_SIZE 10485760 
-
-/* these are evil and should be condemned 
-       ! Only use these if you are done with argv[].
-       call init_proc_title() first, then call
-       set_proc_title. 
-       the title is only allowed to be as big as the
-       initial process name of the process (full size of argv[]).
-       truncation may occurr.
- */
-int init_proc_title( int argc, char* argv[] );
-int set_proc_title( char* format, ... );
-
-
-int daemonize();
-
-void* safe_malloc(int size);
-
-// ---------------------------------------------------------------------------------
-// Generic growing buffer. Add data all you want
-// ---------------------------------------------------------------------------------
-struct growing_buffer_struct {
-       char *buf;
-       int n_used;
-       int size;
-};
-typedef struct growing_buffer_struct growing_buffer;
-
-growing_buffer* buffer_init( int initial_num_bytes);
-
-// XXX This isn't defined in utils.c!! removing for now...
-//int buffer_addchar(growing_buffer* gb, char c);
-
-int buffer_add(growing_buffer* gb, char* c);
-int buffer_fadd(growing_buffer* gb, const char* format, ... );
-int buffer_reset( growing_buffer* gb);
-char* buffer_data( growing_buffer* gb);
-int buffer_free( growing_buffer* gb );
-int buffer_add_char(growing_buffer* gb, char c);
-
-/* returns the size needed to fill in the vsnprintf buffer.  
-       * ! this calls va_end on the va_list argument*
-       */
-long va_list_size(const char* format, va_list);
-
-/* turns a va list into a string, caller must free the 
-       allocated char */
-char* va_list_to_string(const char* format, ...);
-
-
-/* string escape utility method.  escapes unicode embeded characters.
-       escapes the usual \n, \t, etc. 
-       for example, if you provide a string like so:
-
-       hello,
-               you
-
-       you would get back:
-       hello,\n\tyou
- */
-char* uescape( const char* string, int size, int full_escape );
-
-/* utility methods */
-int set_fl( int fd, int flags );
-int clr_fl( int fd, int flags );
-
-
-
-// Utility method
-double get_timestamp_millis();
-
-
-/* returns true if the whole string is a number */
-int stringisnum(char* s);
-
-/* reads a file and returns the string version of the file
-       user is responsible for freeing the returned char*
-       */
-char* file_to_string(const char* filename);
-
-
-
-/** 
-  Calculates the md5 of the text provided.
-  The returned string must be freed by the caller.
-  */
-char* md5sum( char* text, ... );
-
-
-/**
-  Checks the validity of the file descriptor
-  returns -1 if the file descriptor is invalid
-  returns 0 if the descriptor is OK
-  */
-int osrfUtilsCheckFileDescriptor( int fd );
-
-#endif
diff --git a/OpenSRF/src/utils/xml_utils.c b/OpenSRF/src/utils/xml_utils.c
deleted file mode 100644 (file)
index a33c36c..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "xml_utils.h"
-
-
-void recurse_doc( xmlNodePtr node ) {
-       if( node == NULL ) return;
-       printf("Recurse: %s =>  %s", node->name, node->content );
-       xmlNodePtr t = node->children;
-       while(t) {
-               recurse_doc(t);
-               t = t->next;
-       }
-}
-
-
-
-jsonObject* xmlDocToJSON(xmlDocPtr doc) {
-       if(!doc) return NULL;
-       return _xmlToJSON(xmlDocGetRootElement(doc), NULL);
-}
-
-jsonObject* _xmlToJSON(xmlNodePtr node, jsonObject* obj) {
-
-       if(!node) return NULL;
-       if(xmlIsBlankNode(node)) return NULL;
-       if(obj == NULL) obj = jsonNewObject(NULL);
-
-       if(node->type == XML_TEXT_NODE) {
-               jsonObjectSetString(obj, (char*) node->content);        
-
-       } else if(node->type == XML_ELEMENT_NODE || node->type == XML_ATTRIBUTE_NODE ) {
-
-               jsonObject* new_obj = jsonNewObject(NULL);
-
-               jsonObject* old;
-
-               /* do the duplicate node / array shuffle */
-               if( (old = jsonObjectGetKey(obj, (char*) node->name)) ) {
-                       if(old->type == JSON_ARRAY ) {
-                               jsonObjectPush(old, new_obj);
-                       } else {
-                               jsonObject* arr = jsonNewObject(NULL);
-                               jsonObjectPush(arr, jsonObjectClone(old));
-                               jsonObjectPush(arr, new_obj);
-                               jsonObjectSetKey(obj, (char*) node->name, arr);
-                       }
-               } else {
-                       jsonObjectSetKey(obj, (char*) node->name, new_obj);
-               }
-
-               xmlNodePtr child = node->children;
-               while(child) {
-                       _xmlToJSON(child, new_obj);
-                       child = child->next;
-               }       
-       }       
-
-       return obj;
-}
-
-
-char* xmlDocToString(xmlDocPtr doc, int full) {
-
-       if(!doc) return NULL;
-
-       char* xml;
-
-       if(full) {
-
-               xmlChar* xmlbuf;
-               int size;
-               xmlDocDumpMemory(doc, &xmlbuf, &size);
-               xml = strdup((char*) (xmlbuf));
-               xmlFree(xmlbuf);
-               return xml;
-
-       } else {
-
-               xmlBufferPtr xmlbuf = xmlBufferCreate();
-               xmlNodeDump( xmlbuf, doc, xmlDocGetRootElement(doc), 0, 0);
-               xml = strdup((char*) (xmlBufferContent(xmlbuf)));
-               xmlBufferFree(xmlbuf);
-               return xml;
-
-       }
-}
-
-
-
-
-char* xmlSaxAttr( const xmlChar** atts, char* name ) {
-       if( atts && name ) {
-               int i;
-               for(i = 0; (atts[i] != NULL); i++) {
-                       if(!strcmp( (char*)atts[i], name)) {
-                               if(atts[++i]) return (char*) atts[i];
-                       }
-               }
-       }
-       return NULL;
-}
-
-
-int xmlAddAttrs( xmlNodePtr node, const xmlChar** atts ) {
-       if( node && atts ) {
-               int i;
-               for(i = 0; (atts[i] != NULL); i++) {
-                       if(atts[i+1]) {
-                               xmlSetProp(node, atts[i], atts[i+1]);
-                               i++;
-                       }
-               }
-       }
-       return 0;
-}
-
diff --git a/OpenSRF/src/utils/xml_utils.h b/OpenSRF/src/utils/xml_utils.h
deleted file mode 100644 (file)
index 601057d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _XML_UTILS_H
-#define _XML_UTILS_H
-
-//#include "opensrf/osrf_json.h"
-#include "osrf_json.h"
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-jsonObject* xmlDocToJSON(xmlDocPtr doc);
-
-/* helper function */
-jsonObject* _xmlToJSON(xmlNodePtr node, jsonObject*);
-
-/* debug function, prints each node and content */
-void recurse_doc( xmlNodePtr node );
-
-
-/* turns an XML doc into a char*.  
-       User is responsible for freeing the returned char*
-       if(full), then we return the whole doc (xml declaration, etc.)
-       else we return the doc from the root node down
-       */
-char* xmlDocToString(xmlDocPtr doc, int full);
-
-
-/* Takes an xmlChar** from a SAX callback and returns the value
-       for the attribute with name 'name'
-       */
-char* xmlSaxAttr( const xmlChar** atts, char* name ); 
-
-/**
-  Sets the xml attributes from atts to the given dom node 
- */
-int xmlAddAttrs( xmlNodePtr node, const xmlChar** atts );
-
-
-#endif
diff --git a/OpenSRF/src/xinclude/Makefile b/OpenSRF/src/xinclude/Makefile
deleted file mode 100644 (file)
index ba537e9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-SO=mod_xinclude.so
-
-# --------------------------------------------------------
-TMPDIR = /tmp/ilstmp/opensrf
-LIBDIR = /openils/lib
-CC_OPTS = -Wall -O2 -fPIC -I /usr/include/libxml2 -I /opt/include
-LD_OPTS = -lxml2 
-APXS2 = /opt/bin/apxs
-# --------------------------------------------------------
-
-all: $(SO)
-
-install: 
-       cp $(TMPDIR)/$(SO) $(LIBDIR)/$(SO)
-       $(APXS2) -i -a -n xinclude $(LIBDIR)/$(SO)
-
-$(SO): mod_xinclude.c  
-       $(CC) -c $(CC_OPTS)  mod_xinclude.c
-       $(CC) $(LD_OPTS) -shared -W1 mod_xinclude.o -o $(TMPDIR)/$(SO)
-
-clean:
-       /bin/rm -f *.o *.so
diff --git a/OpenSRF/src/xinclude/mod_xinclude.c b/OpenSRF/src/xinclude/mod_xinclude.c
deleted file mode 100644 (file)
index 08fee22..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "httpd.h"
-#include "http_config.h"
-#include "http_core.h"
-#include "http_protocol.h"
-#include "apr_compat.h"
-#include "apr_strings.h"
-
-#include <libxml/parser.h>
-#include <libxml/xinclude.h>
-
-#define MODULE_NAME "xinclude_module"
-
-static int mod_xinclude_handler (request_rec *r) {
-
-       /* make sure we're needed first thing*/
-       if (strcmp(r->handler, MODULE_NAME )) 
-               return DECLINED;
-
-       /* set content type */
-       ap_set_content_type(r, "text/html");
-
-
-       /* which file are we parsing */
-       char* file = r->filename;
-
-       if(!file) { 
-               fprintf(stderr, "No XML file to parse");
-               fflush(stderr);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-
-       /* parse the doc */
-       xmlDocPtr doc = xmlParseFile(file);
-
-       if(!doc) {
-               fprintf(stderr, "Error parsing XML file %s\n", file);
-               fflush(stderr);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-
-       /* process the xincludes */
-       int status = xmlXIncludeProcess(doc);
-       
-       if(status < 0) {
-               fprintf(stderr, "Error processing XIncludes in  XML file %s\n", file);
-               fflush(stderr);
-               return HTTP_INTERNAL_SERVER_ERROR;
-       }
-
-       xmlBufferPtr xmlbuf = xmlBufferCreate();
-       xmlNodeDump( xmlbuf, doc, xmlDocGetRootElement(doc), 0, 0);
-       char* xml = (char*) (xmlBufferContent(xmlbuf));
-
-       ap_rputs(xml,r);
-
-       xmlBufferFree(xmlbuf);
-       xmlFreeDoc(doc);
-
-       return OK;
-}
-
-
-static void mod_xinclude_register_hooks (apr_pool_t *p) {
-       ap_hook_handler(mod_xinclude_handler, NULL, NULL, APR_HOOK_MIDDLE);
-}
-
-module AP_MODULE_DECLARE_DATA xinclude_module = {
-       STANDARD20_MODULE_STUFF,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       mod_xinclude_register_hooks,
-};
-
index e00bc2a..f1aeb78 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -80,6 +80,12 @@ function buildConfig {
        prompt "Libxml2 headers directory [$LIBXML2_HEADERS] "
        read X; if [ ! -z "$X" ]; then LIBXML2_HEADERS="$X"; fi;
 
+       prompt "OpenSRF headers directory [$OPENSRF_HEADERS] "
+       read X; if [ ! -z "$X" ]; then OPENSRF_HEADERS="$X"; fi;
+
+       prompt "OpenSRF libraries directory [$OPENSRF_LIBS] "
+       read X; if [ ! -z "$X" ]; then OPENSRF_LIBS="$X"; fi;
+
        prompt "Build targets [${TARGETS[@]:0}] "
        read X; if [ ! -z "$X" ]; then TARGETS=("$X"); fi;
 
@@ -135,6 +141,9 @@ function writeConfig {
        _write "APR_HEADERS=\"$APR_HEADERS\"";
        _write "LIBXML2_HEADERS=\"$LIBXML2_HEADERS\"";
 
+       _write "OPENSRF_HEADERS=\"$OPENSRF_HEADERS\"";
+       _write "OPENSRF_LIBS=\"$OPENSRF_LIBS\"";
+
        _write "WEBDIR=\"$WEBDIR\"";
        _write "TEMPLATEDIR=\"$TEMPLATEDIR\"";
        _write "ETCDIR=\"$ETCDIR\"";
@@ -151,7 +160,6 @@ function writeConfig {
        STR="$STR)";
        _write "$STR";
 
-       _write "OPENSRFDIR=\"OpenSRF/src/\"";
        _write "OPENILSDIR=\"Open-ILS/src/\"";
        _write "EVERGREENDIR=\"Evergreen/\"";
 
index c427d61..4303729 100644 (file)
 # --------------------------------------------------------------------
 # Build targets.  Options include:
 # 
-# opensrf_all          - builds all OpenSRF compenents
-# opensrf_jserver - custom 'single-domain' jabber server which may be used in place of jabberd2
-# opensrf_router  - jabber router.  
-# opensrf_gateway - mod_ils_gateway, Apache module for proxying API calls
-# opensrf_srfsh   - diagnostic shell interface to OpenSRF
-# opensrf_core         - install the OpenSRF perl modules and core files for running opensrf
-#
 # openils_all                  - builds all OpenILS compenents
 # openils_core                 - install the Open-ILS perl modules, and core files for running and openils server
 # openils_web                  - copies over the javascript and html templates to the web root directory for running the OPAC
 # evergreen_core               - builds core Evergreen components (does not build evergreen_xul_client!)
 # evergreen_xul_client   - client XUL application
 #
-# When running the server components of OpenSRF/OpenILS, the simplest
-# thing is to build 'opensrf' even if you 
-# don't use all of the components.  
 # Build marcdumper only if you need to convert MARC binary files to MARCXML.  
 # If you only want to build the client app, then just build evergreen_xul_client.
 # --------------------------------------------------------------------
 
-TARGETS=("opensrf_all" "openils_core" "openils_web" "openils_db");
+TARGETS=("openils_core" "openils_web" "openils_db");
 
 
 # --------------------------------------------------------------------
@@ -93,12 +83,18 @@ APR_HEADERS="/usr/include/apr-1.0/";
 LIBXML2_HEADERS="/usr/include/libxml2/";
 
 
+# --------------------------------------------------------------------
+# Directories where the OpenSRF headers and libraries are located.
+# You must build and install OpenSRF before OpenILS.
+# --------------------------------------------------------------------
+OPENSRF_HEADERS="/openils/include/"
+OPENSRF_LIBS="/openils/lib/"
+
 
 # --------------------------------------------------------------------
 # These point to the top level makefiles for each of the sub 
 # projects.  Only change these if you have relocated the directories.
 # --------------------------------------------------------------------
-OPENSRFDIR="OpenSRF/src/";
 OPENILSDIR="Open-ILS/src/";
 EVERGREENDIR="Evergreen/";
 
index 4769f68..91150cf 100755 (executable)
@@ -116,7 +116,7 @@ function runInstall {
                        APACHE2_HEADERS=$APACHE2_HEADERS LIBXML2_HEADERS=$LIBXML2_HEADERS DBPORT=$DBPORT\
                        BINDIR=$BINDIR LIBDIR=$LIBDIR PERLDIR=$PERLDIR INCLUDEDIR=$INCLUDEDIR \
                        WEBDIR=$WEBDIR TEMPLATEDIR=$TEMPLATEDIR ETCDIR=$ETCDIR REPORTERDIR=$REPORTERDIR\
-                       OPENSRFDIR=$OPENSRFDIR OPENILSDIR=$OPENILSDIR EVERGREENDIR=$EVERGREENDIR \
+                       OPENSRF_HEADERS=$OPENSRF_HEADERS OPENSRF_LIBS=$OPENSRF_LIBS OPENILSDIR=$OPENILSDIR EVERGREENDIR=$EVERGREENDIR \
                        CIRCRULESDIR=$CIRCRULESDIR CATALOGSCRIPTDIR=$CATALOGSCRIPTDIR CGIDIR=$CGIDIR \
                        DBDRVR=$DBDRVR DBHOST=$DBHOST DBVER=$DBVER DATADIR=$DATADIR ADMINDIR=$ADMINDIR\
                        PENALTYRULESDIR=$PENALTYRULESDIR DBNAME=$DBNAME DBUSER=$DBUSER DBPW=$DBPW XSLDIR=$XSLDIR NEW_OPAC_URL=$NEW_OPAC_URL \
@@ -125,39 +125,6 @@ function runInstall {
 
                case "$target" in
        
-                       # OpenSRF ---                   
-
-                       "opensrf_all")
-                               if building;    then $MAKE -C "$OPENSRFDIR" all; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" install; fi;
-                               ;;
-
-                       "opensrf_jserver" )
-                               if building;    then $MAKE -C "$OPENSRFDIR" "jserver"; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" "jserver-install"; fi;
-                               ;;      
-
-                       "opensrf_router" ) 
-                               if building;    then $MAKE -C "$OPENSRFDIR" "router"; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" "router-install"; fi;
-                               ;;
-
-                       "opensrf_gateway" )
-                               if building; then $MAKE -C "$OPENSRFDIR" "gateway"; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" "gateway-install"; fi;
-                               ;;
-
-                       "opensrf_srfsh" ) 
-                               if building;    then $MAKE -C "$OPENSRFDIR" "srfsh"; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" "srfsh-install"; fi;
-                               ;;
-
-                       "opensrf_core" )
-                               if building; then $MAKE -C "$OPENSRFDIR" libstack/opensrf; fi;
-                               if installing; then $MAKE -C "$OPENSRFDIR" "perl-install"; fi;
-                               ;;
-
-
                        # OpenILS ---                   
 
                        "openils_all" )
@@ -278,7 +245,6 @@ function checkParams {
 
 function cleanMe {
        loadConfig;
-       make "TMP=$TMP" -s -C "$OPENSRFDIR" clean;
        make "TMP=$TMP" -s -C "$OPENILSDIR"  clean;
        make "TMP=$TMP" -s -C "$EVERGREENDIR" clean;
 }