[OPEN-ILS-DEV] Staff Client - Custom HTML page functionality(howto)

Whalen, Liam Liam.Whalen at NRCan-RNCan.gc.ca
Thu Aug 4 16:22:38 EDT 2011


> > We'd like to point the Record ID column to the actual OPAC 
> record details:
> > <td><a
> > 
> href="http://catalogue.nrcan.gc.ca/opac/en-CA/skin/default/xml/rdetail
> > .xml?r=7961854">7961854</a></td>
> <snip>
> > What kind of additional markup do we need to include in 
> this page so 
> > that we get this record id link "smart" to being in the 
> staff client, 
> > rather than simply calling up a 'dumb' rdetail page?
> 
> Do something like
> 
> var record_id = 7961854;
> 
> var content_params = {
>     'session' : ses(),
>     'authtime' : ses('authtime'),
>     'opac_url' : xulG.url_prefix(
>           urls.opac_rdetail
>     ) + '?r=' + record_id;
> };
> 
> xulG.new_tab( // or xulG.set_tab
>     xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
>     {'tab_name': 'Retrieving title...' },
>     content_params
> );

I know I need to include some javascript files to get this running, and
I have been trying to figure out which ones for a bit now.  Is there a
website somewhere that explains what I need to do to get a valid xulG
object?  Currently, I have an a link that uses onclick to execute the
code provided above, but it gives me the following error: 'TypeError:
xulG.url_prefix is not a function'.

I have included all the Javascript files from
/openils/var/web/xul/rel_2_0_6/server/OpenILS/util_overlay.xml.  I just
cut and past the following <script> tags from that file and modified
that last line to point to the correct directory. This is what I am
including in my file:

<script>dump('starting openils_util_overlay in ' + location.href +
'\n');</script>
<script>var djConfig = { 'baseUrl' : '/js/dojo/dojo/',parseOnLoad:
true,isDebug:false };</script>
<script type="text/javascript" src="/js/dojo/dojo/dojo.js" />
<script type="text/javascript" src="/IDL2js" />
<script>try { dojo.require('fieldmapper.AutoIDL'); } catch(E) {
alert(E); }</script>
<script>try { dojo.require('dojo.date.locale'); } catch(E) { alert(E);
}</script>
<script>try { dojo.require('dojo.date.stamp'); } catch(E) { alert(E);
}</script>
<script type="text/javascript"
src="/xul/rel_2_0_6/server/main/constants.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/OpenILS/data.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/barcode.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/browser.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/clipboard.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/controller.js" />
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/date.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/deck.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/error.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/exec.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/file.js"
/>
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/fm_utils.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/functional.js" />
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/list.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/money.js"
/>
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/mozilla.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/network.js" />
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/print.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/sound.js"
/>
<script type="text/javascript" src="/xul/rel_2_0_6/server/util/text.js"
/>
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/widgets.js" />
<script type="text/javascript"
src="/xul/rel_2_0_6/server/util/window.js" />
<script type="text/javascript" src="/xul/rel_2_0_6/server/main/JSAN.js"
/>
<script type="text/javascript"
src="/xul/rel_2_0_6/server/OpenILS/global_util.js" />

Liam
NRCan Library


More information about the Open-ils-dev mailing list