[OPEN-ILS-DEV] Shorter URLs for the OPAC?

Mike Rylander mrylander at gmail.com
Wed Jul 11 23:24:47 EDT 2007


I'm going to preface this response with the fact that Bill and I are
both itching to start over on the OPAC.  The idea is to combine the
best ideas from the current main OPAC (client side templates + AJAX
(before it was called AJAX)) and the slimpac (OpenSearch + unAPI + XML
+ server side XSLT) into some sort of gracefully degrading unholy
union of search POWER.

That being said, I think investigation like this that Dan is doing is
very, very important -- there's a lot of good (and not quite as good)
code in there, and we've learned a lot building the current OPAC.  In
short, there's a ton of project memory locked up in there, and we'd be
ill advised to throw it away, or indeed stop working on it.

As our ideas solidify we'll be bringing a full proposal to the table,
but don't let that stop anyone else from working with what's there.
It will be around for a while, I'm sure, so please, have at it!

With that out of the way, pre-thanks to Dan, and now my response ... ;)

On 7/8/07, Dan Scott <denials at gmail.com> wrote:
> Hi:
>
> Now that 1.2.0-rc1 has been released, I've been experimenting a little
> more with the OPAC.

Gooood.

>
> The first thing that I was looking at was persistent URL links for a
> given title - for example, shortening the link for a given title
> resulting from searching for "dogs" and clicking on the first link
> from:
>   * http://dev.gapines.org/opac/en-US/skin/default/xml/rdetail.xml?r=1544641&t=dogs&tp=keyword&d=0&hc=2989&rt=keyword
>
> to:
>
>  * http://dev.gapines.org/opac/en-US/skin/default/xml/rdetail.xml?r=1544641
>
> Three observations here:
>
> 1) I think it should be possible to shorten the URL even further,
> perhaps through mod_rewrite , to something like:
>
> http://dev.gapines.org/rdetail/1544641 (defaulting to en_US locale)
> and / or
> http://dev.gapines.org/ll_LL/rdetail/1544641 (where ll_LL represents
> the desired locale)
>

While not localizable today (and not well advertised), this exists as
a redirection service in supercat for both records:

http://gapines.org/opac/extras/supercat/retrieve/opac/record/1544641

and metarecords:

http://gapines.org/opac/extras/supercat/retrieve/opac/metarecord/436136

Of course, if you replace the opac part with mods or atom (or any
other supported format) then you'll get that back instead.  This was
built almost immediately before the unapi spec was first proposed, and
so I built the unapi server on top of it.

> 2) When I eliminate all of the parameters from the URL other than
> "?r=1544641", the resulting details page still includes a "My title
> results" section in the sidebar (which will get underlined if you
> hover over it, but the mouse pointer doesn't change and if you click
> it, it results in no action).
>
> 3) I took a quick look at Open-ILS/web/opac/common/js/opac_utils.js
> and Open-ILS/web/opac/skin/default/js/sidebar.js, but didn't see an
> obvious way of saying "don't unhide sidebar_title_results if GET parm
> 't' is null or does not exist". Would anyone in the know be willing to
> walk through the OPAC architecture to help solve this problem, as a
> way of making the process explicit for other people interested in
> hacking (err, contributing to the further development of...) the OPAC?
>

You'll also want to look at the "ss" param here.  I /think/ what
you're looking for is initSideBar() in
web/opac/skin/default/js/sidebar.js, specifically the unHideMe() calls
under

 if( page == RDETAIL ) {

Similar treatment would be good for the record and metarecord list
pages when there is not "t" or "ss" param.

> Apart from minor modifications as proposed here, I'm toying, for
> example, with the idea of generating RSS & Atom feeds for searches to
> complement the OpenSearch support that you've already got going.
>

That should be simple for the basic searches (param called 't' exists)
to generate opensearch-based <link rel="alternate"
type="application/rss+xml"/> tags using DOM and shove them into the
<head>.  Advanced search, not so much.  Not until we teach the main
opac about the slimpac's super-duper search syntax.

Good stuff, fun times. :)

--miker

> Many thanks!
>
> --
> Dan Scott
> Laurentian University
>


More information about the Open-ils-dev mailing list