From 11ba2f1173964046db15ad277e8bfaf522c88407 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 15 Jan 2008 23:29:10 +0000 Subject: [PATCH] updated to match opensrf and ils api changes git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8388 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/oilsweb/oilsweb/controllers/admin.py | 2 +- Open-ILS/web/oilsweb/oilsweb/lib/__init__.py | 8 +++++--- Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py | 2 +- Open-ILS/web/oilsweb/oilsweb/lib/util.py | 10 ++++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py b/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py index df1ae22317..466b098cf4 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/admin.py @@ -27,7 +27,7 @@ class AdminController(BaseController): meta = r.ctx.adm.object_meta = oils.utils.idl.IDLParser.get_class(obj_type) if obj_id is not None: - r.ctx.adm.object = osrf.ses.AtomicRequest( + r.ctx.adm.object = osrf.ses.ClientSession.atomic_request( 'open-ils.cstore', 'open-ils.cstore.direct.%s.retrieve' % meta.fieldmapper.replace('::', '.'), obj_id) diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py b/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py index d3bfe1fb14..3e23557ea5 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/__init__.py @@ -11,6 +11,10 @@ class AuthException(Exception): class CoreContext(SubContext): + + # cache the authenticated user info + _auth_cache = {} + def __init__(self): self.prefix = ContextItem() # web prefix self.media_prefix = ContextItem() # media prefix @@ -23,7 +27,6 @@ class CoreContext(SubContext): self.page = ContextItem() # the current page def postinit(self): - import pylons.config self.prefix = pylons.config['oils_prefix'] self.media_prefix = pylons.config['oils_media_prefix'] self.ac_prefix = pylons.config['oils_added_content_prefix'] @@ -33,7 +36,6 @@ class CoreContext(SubContext): self.fetchUser() - _auth_cache = {} def fetchUser(self): ''' Grab the logged in user and their workstation ''' if self.authtoken: @@ -43,7 +45,7 @@ class CoreContext(SubContext): self.workstation = CoreContext._auth_cache[self.authtoken]['workstation'] return - self.user = osrf.ses.AtomicRequest( + self.user = osrf.ses.ClientSession.atomic_request( 'open-ils.auth', 'open-ils.auth.session.retrieve', self.authtoken) diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py index a334fa3f04..9fc5c4a5ab 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py @@ -14,7 +14,7 @@ def fetch_z39_sources(ctx): global _z_sources if _z_sources: return _z_sources - _z_sources = osrf.ses.AtomicRequest( + _z_sources = osrf.ses.ClientSession.atomic_request( 'open-ils.search', EG_Z39_SOURCES, ctx.core.authtoken) return _z_sources diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/util.py b/Open-ILS/web/oilsweb/oilsweb/lib/util.py index 2acb62f3c9..9428d743c7 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/util.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/util.py @@ -1,6 +1,5 @@ import pylons.config, pylons.templating import libxml2, libxslt -#import oils.utils.utils def childInit(): ''' Global child-init handler. @@ -9,12 +8,15 @@ def childInit(): 2. Parses the IDL file ''' - import oils.system, osrf.system - oils.system.oilsConnect(pylons.config['osrf_config'], pylons.config['osrf_config_ctxt']) - osrf.system.connect_cache() + import oils.system + oils.system.System.connect( + config_file = pylons.config['osrf_config'], + config_context = pylons.config['osrf_config_ctxt'], + connect_cache = True) _parsedSheets = {} def apply_xsl(xmlStr, xslFile, xslParams={}): + ''' Applies xslFile to xmlStr and returns the string result ''' doc = libxml2.parseDoc(xmlStr) stylesheet = _parsedSheets.get(xslFile) -- 2.11.0