Improving Juice info & assistance on GBSEmbed

5 views
Skip to first unread message

Georgina

unread,
Aug 3, 2009, 9:23:13 AM8/3/09
to juice-project-discuss
I hope this is the best place to ask for help, and give feedback on
Juice. I'm guessing most of the members so far here are more technical
than me with knowledge of Javascript but I understand the aims of
Juice to be a mashup facility that's simpler to use for librarians
than learning every other API needed, so I hope comments from me (as a
librarian first and geek second) are useful. I know Juice isn’t a
formal purchased and supported product so the documentation is in its
earliest stages, but maybe my comments will help shape that…

So, on the general front: Having inserted a nice Juice panel on our
opac with links out to COPAC etc, I wanted to get fancier with the
GBSEmbed.js extension but can't get this to display at all. The
http://code.google.com/p/juice-project/wiki/ExtensionGBSEmbed page is
helpful, but does not give a full example of the juice-server.js file
that would be used, or exactly what to change the constructor
arguments to in GBSEmbed.js. These facts are probably obvious to most
of you, but as Juice is an excellent idea for people who are less
technically-able, it would be great to have the process spelled out.
Maybe a full example for each extension would be useful (and easy, as
each extension is presumably tested), as a full tutorial like the
excellent Hello World walk-through is asking a lot. The page equally
doesn’t say whether the extension should be in an insert or panel (it
still hasn’t become obvious to me when you’d use which), but I assumed
from the page that it was an insert.

On the specific problem: I now think I've tested every combination of
the variables and have had no luck getting this working so wondering
if anyone can assist...?

The [webserver docs directory]/Juice/Extensions/GBSEmbed.js file
begins with
function GBSEmbedJuice(ju,insert,targetDiv){
id = "GBSSel";
this.targetDiv = targetDiv

and I've tested changing targetDiv to body, "body", GBSViewer, and
"GBSViewer" (wasn’t clear on whether the div had to match the one in
the juice-server.js file). I also tested changing the 'ju' to 'juice'
as I'm not sure why this is 'ju'.

My server file ../Juice/juice-mara.js now looks like this:
jQuery(document).ready(function () {
juice.setDebug(true);
juice.loadJs("http://mara.brunel.ac.uk:8080/Juice/Metadefs/
symphony_metadef.js");
juice.loadJs("http://mara.brunel.ac.uk:8080/Juice/Extensions/
JuiceSimpleInsert.js");
juice.loadJs("http://mara.brunel.ac.uk:8080/Juice/Extensions/
GBSEmbed.js");
juice.onJsLoaded(runExtensions);
});

function runExtensions(){
symphony_metadef();
if(juice.hasMeta()){
buildGBSPanel();
new GBSEmbedJuice(juice,insert,"GBSViewer");
}
}

function buildGBSPanel(){
var div = '<div id="GBSPanel" style="display: block; width:
100%">' +
'<br/><h2>Look Inside</h2>' +
'<div id="GBSViewer" style="width: 100%; height:
800px"></div>' +
'</div>';
var insert = new JuiceInsert(div,"body","append");
}

But nothing displays on the page. I tried moving the new GBSEmbedJuice
line to the end (before final brace) but that made no difference – and
each test I’ve done in combination with the juice vs ju test and body
vs GBSViewer test so I have been thorough. I’ve also tried rewriting
juice-mara.js to use a ListPanel (I haven’t yet come across any info
on using BasicPanel) in the same way as my panel of links out to COPAC
etc (which works using juiceListPanel.js), just in case it should be a
panel, but this hasn’t helped so far. Maybe it is entirely independent
of an Insert or Panel file, as the web page does suggest that the only
prerequisite is the GBSEmbed.js file itself – I could be completely up
the wrong tree!?

So, I've replaced juice-mara.js with a version just using a
simpleinsert (or my panel of links), which works. I've checked
permissions and ownership on GBSEmbed.js and juice-mara.js. I've
checked (with the simpleinsert version) that there is an isbns value
for the item examples I've looked at. I've now run out of ideas on how
to troubleshoot this. Does anyone have any hints? My apologies if I’ve
missed some obvious documentation page that would solve this.

I’d add that I’ve also failed on adding a Carousel extension so there
must be something straightforward in the set up of these
“advanced” (!) inserts that hasn’t clicked. Hopefully one full example/
tutorial would solve this for me and others :) Whilst I've managed to
pick up all the rest including metadefs from the existing
documentation, I just haven’t found enough examples in action to be
able to grasp this stage.

I realise this is a long post now with dozens of questions in it, but
I do think Juice is a very promising project and would be keen to get
over the initial difficulties; I’m sure there are other keen semi-
techies who would appreciate more help on grasping the basics so it’s
easier to take Juice further. I'm equally sure my problem will be
something basic that I will soon be highly embarrassed about and will
look back on this post and pity myself! But, better to ask and appear
stupid than to give up, right?

Thanks!

Richard Wallis

unread,
Aug 3, 2009, 9:58:06 AM8/3/09
to juice-proj...@googlegroups.com
Hi Georgina,

This is exactly the place to ask these questions - hopefully we will grow a community with a healthy spectrum of those who just want to use it, though to those who understand its innermost workings.

As often is the case with open source projects like Juice, the implementation has got ahead of the simple, howto style, documentation.  I hope to launch an extension boutique section of the web site which will include screen shots, howtouses, and hopefully videos for each extension.  In practice, you shouldn't have to to look in to the internal code on an extension to be able to use it.

A quick scan of your code highlights nothing obvious - on the presumption that the you are identifying isbns from the page that Google Book Search has a preview of.

In the short term would it be possible to view your interface [email me directly if you do not want it's address broadcast directly - richard...@talis.com] so that I can see what is going on.

~Richard.


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.

 
 

Georgina

unread,
Aug 3, 2009, 11:35:50 AM8/3/09
to juice-project-discuss
Hi Richard,

This sounds great, and hopefully when I've got past this stage I'll be
able to contribute to the web site more with examples and info. I'm an
obsessive documenter and it's good to give back to communities that
have taught me :)

I did use the same titles in testing that provided correct links into
an ISBN search in COPAC via Juice so I do hope it's nothing as simple
as missing data!

I'm using our test server at http://mara.brunel.ac.uk:8080/uhtbin/webcat
so the files are http://mara.brunel.ac.uk:8080/Juice/Extensions/GBSEmbed.js
etc in the recommended structure; I've replaced our working
'alternative sources' box (now Juice/juice-mara.js.altsrcs) with the
juice-mara.js file that would in theory provide an insert of the GBS
preview.

Thanks for your help,

Georgina

On Aug 3, 2:58 pm, "Richard Wallis" <richard.wal...@talis.com> wrote:
> Hi Georgina,
>
> This is exactly the place to ask these questions - hopefully we will  
> grow a community with a healthy spectrum of those who just want to use  
> it, though to those who understand its innermost workings.
>
> As often is the case with open source projects like Juice, the  
> implementation has got ahead of the simple, howto style,  
> documentation.  I hope to launch an extension boutique section of the  
> web site which will include screen shots, howtouses, and hopefully  
> videos for each extension.  In practice, you shouldn't have to to look  
> in to the internal code on an extension to be able to use it.
>
> A quick scan of your code highlights nothing obvious - on the  
> presumption that the you are identifying isbns from the page that  
> Google Book Search has a preview of.
>
> In the short term would it be possible to view your interface [email  
> me directly if you do not want it's address broadcast directly - richard.wal...@talis.com
> ] so that I can see what is going on.
>
> ~Richard.
>
> On 3 Aug 2009, at 14:23, Georgina wrote:
>
>
>
>
>
> > I hope this is the best place to ask for help, and give feedback on
> > Juice. I'm guessing most of the members so far here are more technical
> > than me with knowledge of Javascript but I understand the aims of
> > Juice to be a mashup facility that's simpler to use for librarians
> > than learning every other API needed, so I hope comments from me (as a
> > librarian first and geek second) are useful. I know Juice isn’t a
> > formal purchased and supported product so the documentation is in its
> > earliest stages, but maybe my comments will help shape that…
>
> > So, on the general front: Having inserted a nice Juice panel on our
> > opac with links out to COPAC etc, I wanted to get fancier with the
> > GBSEmbed.js extension but can't get this to display at all. The
> >http://code.google.com/p/juice-project/wiki/ExtensionGBSEmbedpage is
> >     juice.loadJs("http://mara.brunel.ac.uk:8080/Juice/Metadefs/
> 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)
> Fax: +44 (0)870 400 5001
>
> Linkedin:http://www.linkedin.com/in/richardwallis
> Skype: richard.wallis1
> IM: rjw3...@hotmail.com

Richard Wallis

unread,
Aug 4, 2009, 7:32:03 AM8/4/09
to juice-proj...@googlegroups.com
Hi Georgina,

I can see an obvious problem within your code.

In your runExtensions function you pass a variable 'insert' to the GBS Extension: new GBSEmbedJuice(juice,insert,"GBSViewer");

Unfortunately you define that variable in the buildGBSPanel function so it is not available to use (in scope) in the first function.  If you move the 'new GBSEmbedJuice' to the end of your build function, it should work.

As an aside, I recommend the FireBug add-on for Firefox as a wonderful aid to tracking such problems down. [https://addons.mozilla.org/en-US/firefox/addon/1843] It immediately threw up a 'insert is not defined' error when I turned it on and viewed your site.

Let me know how you get on....

~Richard.

Georgina

unread,
Aug 5, 2009, 7:01:43 AM8/5/09
to juice-project-discuss
Hello,

Thanks for the info. In fact I already use the FireBug add-on for
trying to clean up our CSS and page customisation, but I hadn't delved
into its console/script side - I've had a look at that and will
certainly find this useful, good tip!

The problem almost makes sense to me now... but even if I move the new
GBSEmbedJuice line from the function runExtensions section to the
function builGBSPanel section (at the end), I stop getting the
Javascript error but still no panel displays.

This was actually one of the things I'd tested, as I wasn't sure which
section was meant to include the new GBS... line. I can see why it
should go later now :) but sadly no panel still... (I did immediately
put the alt sources box back in to triple-check I get an isbns value
out on my example, which I did.)

Cheers,

Georgina

On Aug 4, 12:32 pm, "Richard Wallis" <richard.wal...@talis.com> wrote:
> Hi Georgina,
>
> I can see an obvious problem within your code.
>
> In your runExtensions function you pass a variable 'insert' to the GBS  
> Extension: new GBSEmbedJuice(juice,insert,"GBSViewer");
>
> Unfortunately you define that variable in the buildGBSPanel function  
> so it is not available to use (in scope) in the first function.  If  
> you move the 'new GBSEmbedJuice' to the end of your build function, it  
> should work.
>
> As an aside, I recommend the FireBug add-on for Firefox as a wonderful  
> aid to tracking such problems down. [https://addons.mozilla.org/en-US/firefox/addon/1843
> ] It immediately threw up a 'insert is not defined' error when I  
> turned it on and viewed your site.
>
> Let me know how you get on....
>
> ~Richard.
>
> On 3 Aug 2009, at 16:35, Georgina wrote:
>
>
>
>
>
> > Hi Richard,
>
> > This sounds great, and hopefully when I've got past this stage I'll be
> > able to contribute to the web site more with examples and info. I'm an
> > obsessive documenter and it's good to give back to communities that
> > have taught me :)
>
> > I did use the same titles in testing that provided correct links into
> > an ISBN search in COPAC via Juice so I do hope it's nothing as simple
> > as missing data!
>
> > I'm using our test server athttp://mara.brunel.ac.uk:8080/uhtbin/webcat
> > so the files arehttp://mara.brunel.ac.uk:8080/Juice/Extensions/GBSEmbed.js
> Tel: +44 (0)870 400 5422 ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages