Juice and Talis Prism 2

19 views
Skip to first unread message

Richard Wallis

unread,
Nov 11, 2009, 7:41:43 AM11/11/09
to juice-project-discuss
How you can embed Juice in to Prism 2 (and other OPACs and
interfaces), is a question that has been raised by several people,
both part of or just 'watching' developments in the Juice Project.

As you will see from the Getting Started page [http://juice-
project.org/GetStarted], there are some general steps to do this. At
the bottom of that page there is a [currently very short but soon to
get much longer] list of product specific examples of how to embed
Juice in your interface examples.

I shall be looking to add a Talis Prism 2 example in the near future.
In the spirit of the open source project, that Juice is, if anyone
wants to help with that, please let me know. Once Juice is in your
Prism 2 interface, you will then be able to take advantage of any of
the previously built extensions, and participate in creating /
enhancing others.

~Richard.

MJ

unread,
Nov 12, 2009, 10:48:31 AM11/12/09
to juice-project-discuss
That would be really useful Richard. i've had a play around with this
in Prism 2.1 in an attempt to get the Syndetic enhancement widgets to
work but I've not had any luck yet.

MJ

unread,
Nov 23, 2009, 6:51:27 AM11/23/09
to juice-project-discuss
I've got Juice working in Prism 2.1, but I'm currently fighting with
book jacket displays. I'm using the Syndetic widgets in an attempt to
display book jackets on full item records. I have tried putting the
code in various files, including Browse>SearchResults.jsp and various
SearchForm files. When a search term is entered and a list of results
is returned, a book jacket is displayed only for the first item in the
list, when a record is clicked (to display the single/full record a
book jacket is displayed a s expected. What I want is to either
display only the book jacket in full record view, or show the book
jackets (where available) for each item in list view. I hope this
makes sense. Given my limited knowledge of javascript I’m not quite
sure how to achieve this, can anyone give me any advice?

Richard Wallis

unread,
Nov 23, 2009, 9:56:21 AM11/23/09
to juice-proj...@googlegroups.com
Hi MJ,

I would suggest your starting point could be to firstly try implementing the AmazonJacket extension from Juice.

Firstly, it demonstrates that you do not have to edit any Prism .js files (beyond what you did in the header.js to introduce Juice in the first place).

Secondly, it demonstrates how an extension can be used to put a bookjacket on to a Prism2 full record display without destroying the layout. See the example image at the end of that page.

The example code, for including this extension, on the juice-project site is a bit generic - the actual code I used for a Prism2 test was this:

        new extendedbyJuice(juice);
        talis_prism2_metadef();
        if(juice.hasMeta('isbns')){
                var div = '<tr><td><div style="float: right; margin-bottom: -200px; margin-right: 10px;" id="jack"></div></td></tr>';

                //Find and label row containg Author detail line
                $jq($jq($jq("b:contains('Author')").parents('table')[0]).parents('tr')[0]).attr("id","jackrow");

                //Create insert before Author row
                var insert = new JuiceInsert(div,"#jackrow","before");
                new AmazonJackets(juice,insert,"jack");
        }


Having done that, the extension can be used as a starting point to introduce the Syndetics specific display in to the page.

~Richard.


--

You received this message because you are subscribed to the Google Groups "juice-project-discuss" group.
To post to this group, send email to juice-proj...@googlegroups.com.
To unsubscribe from this group, send email to juice-project-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juice-project-discuss?hl=.



Richard Wallis
Technology Evangelist, Talis
Tel: +44 (0)870 400 5422 (Direct)
Tel: +44 (0)870 400 5000 (Switchboard)
Tel: +44 (0)7767 886 005 (Mobile)

Skype: richard.wallis1





 

Please consider the environment before printing this email.


Find out more about Talis at www.talis.com

shared innovationTM


Any views or personal opinions expressed within this email may not be those of Talis Information Ltd or its employees. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.


Talis Information Ltd is a member of the Talis Group of companies and is registered in England No 3638278 with its registered office at Knights Court, Solihull Parkway, Birmingham Business Park, B37 7YB.

 
 

Godmar Back

unread,
Nov 23, 2009, 10:48:59 AM11/23/09
to juice-proj...@googlegroups.com
On Mon, Nov 23, 2009 at 6:51 AM, MJ <mark....@worc.ac.uk> wrote:
> I've got Juice working in Prism 2.1, but I'm currently fighting with
> book jacket displays.  I'm using the Syndetic widgets in an attempt to
> display book jackets on full item records.  I have tried putting the
> code in various files, including Browse>SearchResults.jsp and various
> SearchForm files.  When a search term is entered and a list of results
> is returned, a book jacket is displayed only for the first item in the
> list, when a record is clicked (to display the single/full record a


Are you talking about these widgets:
http://www.bowker.com/syndetics/plus/SP_instructions.pdf

They say:

"If more than one ISBN is listed, then the first ISBN found on the
page (from top to bottom)
is used for content retrieval."

so perhaps the behavior you're seeing is expected?

And none of this has anything to do with Juice unless you're planning
to contribute a Juice extension for Syndetics's widgets, or does it?
If you do the latter, you'll have to do some reverse engineering.

- Godmar

Richard Wallis

unread,
Nov 23, 2009, 11:10:07 AM11/23/09
to juice-proj...@googlegroups.com
Looking at the Syndetics code, I would expect that the extension would be not that difficult. - If there is an isbn on the page, insert the required syn_xxx div in the best place then use juice.loadJs to pull in their JavaScript.  As long as the required div is visible before the script is loaded, it should work.

Not having a clientcode to check this, I am of course assuming how it will work.

~Richard.

--

You received this message because you are subscribed to the Google Groups "juice-project-discuss" group.
To post to this group, send email to juice-proj...@googlegroups.com.
To unsubscribe from this group, send email to juice-project-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juice-project-discuss?hl=.



Richard Wallis
Technology Evangelist, Talis
Tel: +44 (0)870 400 5422 (Direct)
Tel: +44 (0)870 400 5000 (Switchboard)
Tel: +44 (0)7767 886 005 (Mobile)

Skype: richard.wallis1





Godmar Back

unread,
Nov 23, 2009, 11:42:50 AM11/23/09
to juice-proj...@googlegroups.com
Here's their response:

http://plus.syndetics.com/widget_response.php?id=YOURID&isbn=006073132X&upc=&oclc=&enhancements=syn_lc

returns:

jQuery("#syn_lc").html("<img class=\"syn_image\" alt=\"Cover image\"
src=\"http://plus.syndetics.com/index.php?isbn=006073132X/lc.gif&client=YOURID&upc=&oclc=\"
/> ");
$syndetics.truncate_enhancements(document);
$syndetics.match_type="isbn";
$syndetics.match_value="006073132X";

Note that the use of the id (as in #syn_lc) in their widgetization
fundamentally limits you to just one book jacket per page (if you use
their library). So don't.

The other problem with their library is that they use jQuery without
noconflict protection regardless of what else may be going on in the
page. That's bad design, too. And they pollute the global name space.

- Godmar

Richard Wallis

unread,
Nov 23, 2009, 11:57:12 AM11/23/09
to juice-proj...@googlegroups.com
It's a good job JQuery doesn't mind being loaded twice!

I agree it is poor design, limiting to one instance per page.

I'm guessing they use something like jQuery.ajax to pull the data back.  In which case it could theoretically be possible to replicate what it does but in a more useable way.

~Richard.

Godmar Back

unread,
Nov 23, 2009, 12:04:05 PM11/23/09
to juice-proj...@googlegroups.com
On Mon, Nov 23, 2009 at 11:57 AM, Richard Wallis
<richard...@talis.com> wrote:
> It's a good job JQuery doesn't mind being loaded twice!

There are many versions of jQuery. They are not interchangeable. If
you rely on, say 1.2.6 and someone loads 1.3.2, things will break.

Moreover, if you have prototype in your page, which uses $, things
will break also - all things ignored by Syndetics's developers!

> I agree it is poor design, limiting to one instance per page.
> I'm guessing they use something like jQuery.ajax to pull the data back.  In
> which case it could theoretically be possible to replicate what it does but
> in a more useable way.

What do you mean by "pull the data back"? The URL
(widget_response.php...) I quoted is loaded via $.getScript() and it
directly performs the DOM manipulation via the
jQuery("#syn_loc").html(...) call. Also, jQuery.ajax can't be used
for anything in this context anyway because of same-domain
restriction.

- Godmar

Richard Wallis

unread,
Nov 23, 2009, 12:20:58 PM11/23/09
to juice-proj...@googlegroups.com
Oh it's 'that' basic - I see.

I wonder how open the Syndetics team would be to a request for a RESTful Web Service API?

~Richard.

--

You received this message because you are subscribed to the Google Groups "juice-project-discuss" group.
To post to this group, send email to juice-proj...@googlegroups.com.
To unsubscribe from this group, send email to juice-project-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juice-project-discuss?hl=.



Richard Wallis
Technology Evangelist, Talis
Tel: +44 (0)870 400 5422 (Direct)
Tel: +44 (0)870 400 5000 (Switchboard)
Tel: +44 (0)7767 886 005 (Mobile)

Skype: richard.wallis1





Godmar Back

unread,
Nov 23, 2009, 12:31:23 PM11/23/09
to juice-proj...@googlegroups.com
On Mon, Nov 23, 2009 at 12:20 PM, Richard Wallis
<richard...@talis.com> wrote:
> Oh it's 'that' basic - I see.
> I wonder how open the Syndetics team would be to a request for a RESTful Web
> Service API?

I think they have that already, the widgets are just an additional
layer to simplify integration for non-programmers. I believe that
previous integration guidelines asked users to use the direct URL in
which the isbn is encoded as a GET parameter inside img.src
attributes. I don't believe that they could have possibly dropped that
and forced everybody to go widgets - for one, this doesn't comply with
accessibility guidelines.

Now that API is not strictly REST because the info is not encoded in
the URL, but the distinction is irrelevant in practice. And, in
addition, since they support isbn, oclc, and upc, all optionally, it
probably couldn't even be done cleanly with a REST-like URL structure.

Now if you're asking for a service that responds with metadata about
where their content can be accessed, that's probably a different issue
- but in fairness to Syndetics, that's not a service they sell.

- Godmar

Richard Wallis

unread,
Nov 23, 2009, 12:37:36 PM11/23/09
to juice-proj...@googlegroups.com
On 23 Nov 2009, at 17:31, Godmar Back wrote:

On Mon, Nov 23, 2009 at 12:20 PM, Richard Wallis
<richard...@talis.com> wrote:
Oh it's 'that' basic - I see.
I wonder how open the Syndetics team would be to a request for a RESTful Web
Service API?

I think they have that already, the widgets are just an additional
layer to simplify integration for non-programmers.  I believe that
previous integration guidelines asked users to use the direct URL in
which the isbn is encoded as a GET parameter inside img.src
attributes. I don't believe that they could have possibly dropped that
and forced everybody to go widgets - for one, this doesn't comply with
accessibility guidelines.

If that was still available, it would be snip to modify the AmazonJackets extension to give us what we wanted.

~Richard.

Richard Wallis
Technology Evangelist, Talis
Tel: +44 (0)870 400 5422 (Direct)
Tel: +44 (0)870 400 5000 (Switchboard)
Tel: +44 (0)7767 886 005 (Mobile)

Skype: richard.wallis1





MJ

unread,
Dec 1, 2009, 10:24:58 AM12/1/09
to juice-project-discuss
Has anyone had any experience of java hogging all the CPU and memory?
I've been using the Amazon book jacket Juice extension (which is
great), but looking at the output of top java can often be using 99.9%
of the CPU. After restarting httpd I've also noticed that the amount
of memory used by the same java process gradually increases from
around 7% until the system gridns to a halt and I have to restart
httpd. Does anyone know if this is due to polling or the javascript
looping, has anyone had any similar issues?

Godmar Back

unread,
Dec 1, 2009, 10:39:34 AM12/1/09
to juice-proj...@googlegroups.com
Interesting question. Javascript runs client-side, Java (likely)
server-side, and Apache is not Java. It seems you have a distributed
system here that consists of multiple interacting parts.

As for debugging Java, run the JVM with the -XX:-HeapDumpOnOutOfMemory
flag. When it runs out of memory, collect the heap dump file and load
it into SAP's Memory Analyzer. Report what you find.

- Godmar
> --
>
> You received this message because you are subscribed to the Google Groups "juice-project-discuss" group.
> To post to this group, send email to juice-proj...@googlegroups.com.
> To unsubscribe from this group, send email to juice-project-di...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/juice-project-discuss?hl=en.
>
>
>
Reply all
Reply to author
Forward
0 new messages