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!