Adding Juice to a Talis Prism 2 Installation

  This should be read in conjunction with the Get Started Document.
Juice has to be first loaded on to the system.

  • Create a juice sub-directory in the /usr/opt/til/talisie/Webapp/Views/Javascript directory
  • Unzip the Juice distribution inside this new directory
  • Create an extend-talisP2.js file - see attached example
  • If basic distribution is used, and you are using extensions that need values from the item details page, you will need to create a medatef JavaSript file in a metadefs sub-directory - see attached example
  • Load any required extension files in the juice/extensions

Next, the call to Juice needs to be added to the header.js script in the /usr/opt/til/talisie/Webapp/Views/Javascript directory.  As the calls are being added to a JavaScript file, there is some additional code required to ensure that all code has been loaded in to the browser before any extension functionality is called.  Add the following code to the end of the header.js file:
 
//Javascript loading function
function myloadjs(file){
        var juhead = document.getElementsByTagName('head')[0];
        var juins = document.createElement('script');
        juins.type = 'text/javascript';
        juins.src = file;
        juhead.appendChild(juins);
}
 
myloadjs("/TalisPrism/Views/Javascript/juice/jquery-1.3.2.min.js");
myloadjs("/TalisPrism/Views/Javascript/juice/juice.js");
 
//Do not load extension script until jQuery & Juice loaded in to browser
function whenJuiceLoaded(){
        if(typeof juice != 'undefined' && typeof jQuery != 'undefined'){
                myloadjs("/TalisPrism/Views/Javascript/juice/extend-talisP2.js");
        }else{
                setTimeout(function(){whenJuiceLoaded();},10);
        }
}
 
whenJuiceLoaded();
 
 
 

AttachmentSize
extend-talisP2.js.txt1.45 KB
talis_prism2_metadef.js.txt305 bytes