[open-ils-commits] r8418 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers/acq lib/acq public/oils/media/css/skin/default
public/oils/media/css/theme/default templates/oils/default/acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jan 18 11:19:07 EST 2008
Author: erickson
Date: 2008-01-18 10:53:17 -0500 (Fri, 18 Jan 2008)
New Revision: 8418
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html
Log:
added my-picklist display, started cleaning up search
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py 2008-01-18 15:53:17 UTC (rev 8418)
@@ -8,29 +8,41 @@
class AcqContext(SubContext):
def __init__(self):
+
+ # -------------------------------------------------------------
+ # URL params
self.query = ContextItem(cgi_name='acq.q')
self.search_class = ContextItem(cgi_name='acq.sc', multi=True)
self.search_source = ContextItem(cgi_name='acq.ss', multi=True)
self.picked_records = ContextItem(cgi_name='acq.sr', multi=True)
- self.search_cache_key = ContextItem(cgi_name='acq.sk')
+ self.offset = ContextItem(cgi_name='acq.os', default_value=0)
+ self.limit = ContextItem(cgi_name='acq.li', default_value=10)
+
+ #self.search_cache_key = ContextItem(cgi_name='acq.sk')
#self.record_id = ContextItem(cgi_name='acq.ri')
#self.record = ContextItem(cgi_name='acq.r')
#self.picklist_item = ContextItem(cgi_name='acq.pi', multi=True)
+
+ # -------------------------------------------------------------
+ # shared objects and data
self.prefix = ContextItem()
self.z39_sources = ContextItem()
self.search_classes = ContextItem()
self.search_classes_sorted = ContextItem()
- #self.picklist_id = ContextItem(cgi_name='acq.pl')
- self.picklist = ContextItem()
- self.picklist_entry = ContextItem()
- self.offset = ContextItem(cgi_name='acq.os', default_value=0)
- self.limit = ContextItem(cgi_name='acq.li', default_value=10)
- self.extract_bib_field = ContextItem(default_value=oilsweb.lib.acq.search.extract_bib_field)
- self.find_entry_attr = ContextItem(default_value=oilsweb.lib.acq.picklist.PicklistMgr.find_entry_attr)
+ self.picklist = ContextItem() # picklist object
+ self.picklist_list = ContextItem() # list of picklist objects
+ self.picklist_entry = ContextItem() # picklist_entry object
+
+ # -------------------------------------------------------------
+ # utility functions
+ self.find_entry_attr = ContextItem(
+ default_value=oilsweb.lib.acq.picklist.PicklistMgr.find_entry_attr)
+
self.picklist_entry_marc_html = ContextItem()
def postinit(self):
self.prefix = "%s/acq" % Context.getContext().core.prefix
Context.applySubContext('acq', AcqContext)
+
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py 2008-01-18 15:53:17 UTC (rev 8418)
@@ -28,6 +28,13 @@
r.ctx.acq.picklist_entry_marc_html = oilsweb.lib.bib.marc_to_html(entry.marc())
return r.render('acq/picklist/view_entry.html')
+ def list(self):
+ r = RequestMgr()
+ pl_manager = oilsweb.lib.acq.picklist.PicklistMgr(r)
+ r.ctx.acq.picklist_list = pl_manager.retrieve_list()
+ return r.render('acq/picklist/view_list.html')
+
+
def search(self):
return 'search interface'
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py 2008-01-18 15:53:17 UTC (rev 8418)
@@ -42,6 +42,15 @@
self.picklist.entries(entries)
+ def retrieve_list(self):
+ ''' Returns my list of picklist objects '''
+ list = self.ses.request(
+ 'open-ils.acq.picklist.user.retrieve',
+ self.request_mgr.ctx.core.authtoken).recv().content()
+ oils.event.Event.parse_and_raise(list)
+ return list
+
+
def retrieve_entry(self, entry_id, **kwargs):
args = {'flesh': kwargs.get('flesh')}
entry = self.ses.request(
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py 2008-01-18 15:53:17 UTC (rev 8418)
@@ -18,18 +18,10 @@
'open-ils.search', EG_Z39_SOURCES, ctx.core.authtoken)
return _z_sources
-def flatten_record(marcxml):
- import pylons
- xslFile = os.path.join(os.getcwd(), pylons.config['oils_xsl_prefix'], pylons.config['oils_xsl_acq_bib'])
- xformed = oilsweb.lib.util.apply_xsl(marcxml, xslFile)
- return osrf.xml_obj.XMLFlattener(xformed, True).parse()
-
def multi_search(ctx, search):
ses = osrf.ses.ClientSession(oils.const.OILS_APP_SEARCH)
req = ses.request(EG_Z39_SEARCH, ctx.core.authtoken, search)
- cache_id = 0
- results = []
while not req.complete:
resp = req.recv(60)
if not resp:
@@ -44,22 +36,3 @@
return results, cache_search(search, results)
-def cache_search(search, results):
- key = md5.new()
- key.update(unicode(search))
- key = key.hexdigest()
- osrf.cache.CacheClient().put(key, results, pylons.config.get('oils_bib_cache_time', 900))
- return key
-
-def extract_bib_field(rec, field, all=False):
- f = rec['extracts'].get("bibdata." + field)
- if not f: return ""
- obj = osrf.json.to_object(f)
- if isinstance(obj, list):
- if all:
- return obj
- else:
- return obj[0]
- else:
- return obj
-
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css 2008-01-18 15:53:17 UTC (rev 8418)
@@ -23,7 +23,12 @@
#oils-acq-search-fields-label { margin-bottom: 10px; }
#oils-acq-search-fields-submit-block { margin: 5px; text-align: center;}
-/* bib search results / picklist builder interface */
+/* list of picklists */
+#oils-acq-picklist-list-table {width: 100%;}
+#oils-acq-picklist-list-table td {padding: 3px;}
+
+/* a single picklist */
+#oils-acq-picklist-table { width: 100%; }
#oils-acq-picklist-header { padding: 4px; margin-bottom: 20px; }
.oils-acq-picklist-records-jacket-td { width: 46px; }
.oils-acq-picklist-records-jacket { width: 42px; height: 54px; padding-left: 0px; }
@@ -32,6 +37,7 @@
.oils-acq-picklist-records-phys_desc-row td { padding-left: 30px; }
.oils-acq-picklist-records-phys_desc-row {}
+/* picklist entry page */
#oils-acq-picklist-entry-header { padding: 4px; margin-bottom: 20px; }
#oils-acq-picklist-entry-summary {}
#oils-acq-picklist-entry-summary td {padding: 2px;}
@@ -39,9 +45,7 @@
.oils-acq-picklist-entry-attr-type {}
.oils-acq-picklist-entry-attr-name {}
.oils-acq-picklist-entry-attr-value {}
-
#oils-acq-picklist-entry-marc-block { margin-top: 10px; padding: 6px; }
-#oils-acq-picklist-table { width: 100%; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css 2008-01-18 15:53:17 UTC (rev 8418)
@@ -11,6 +11,11 @@
#oils-acq-search-subsources-label { font-weight: bold; }
#oils-acq-search-fields-submit-block { border: 2px solid #A1A1A1; }
+/* list of picklists */
+#oils-acq-picklist-list-table {width: 100%;}
+#oils-acq-picklist-list-table thead td {font-weight:bold;}
+
+/* picklist display */
#oils-acq-picklist-table thead tr { border: 1px solid #A1A1A1; }
#oils-acq-picklist-header {border: 1px solid #85C777;}
#oils-acq-picklist-entry-header {border: 1px solid #85C777;}
@@ -21,6 +26,5 @@
.oils-acq-picklist-picklist-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; }
.oils-acq-picklist-records-service-td { font-size: 85%; }
-.oils-acq-picklist-entry-attr-name {}
-
+/* entry display */
#oils-acq-picklist-entry-marc-block { border: 1px solid #6BA160; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html 2008-01-18 15:19:18 UTC (rev 8417)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/navigate.html 2008-01-18 15:53:17 UTC (rev 8418)
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
<span><a href='${c.oils.core.prefix}/acq/base/index'>${_('Acquisitions Home')}</a></span>
<span><a href='${c.oils.core.prefix}/acq/picklist/search'>${_('Bib Search')}</a></span>
+<span><a href='${c.oils.core.prefix}/acq/picklist/list'>${_('My Picklists')}</a></span>
More information about the open-ils-commits
mailing list