240 likes | 445 Views
iLink@ULB. Sirsi Unicorn API Summit 2004 Halifax Public Library October 17-18th, 2004. Hicham El Kasmi Université Libre de Bruxelles (ULB) Brussels. Objectives. Better layout & an ergonomic interface A dynamic bar menu Improve navigation Bilingual interface
E N D
iLink@ULB Sirsi Unicorn API Summit 2004 Halifax Public Library October 17-18th, 2004 Hicham El Kasmi Université Libre de Bruxelles (ULB) Brussels
Objectives • Better layout & an ergonomic interface • A dynamic bar menu • Improve navigation • Bilingual interface • Provide valuable information to users as pop-up tooltip on some objects of the interface • Contextual help with PDF file
Tools • Graphic design • CSS & HTML • Sirsi ‘Shell_script’ element • Perl scripts • Javascript programs
Better layout & an ergonomic interface I Graphic design
Better layout & an ergonomic interface II CSS & HTML <style type="text/css"> …...viewmarctags { vertical-align: top; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 11px; background-color: #336699; /*757BA0*/ color: #EFEFEF;}.viewholdings { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 11px; background-color: #336699; /*757BA0*/ color: #EFEFEF;}.title { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 15px; font-weight: bold; letter-spacing: 2px; color: #336699; margin-left: 15px;}.tddefault { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 11px;}.tdallbordersearchsum { border-style: solid; border-color: #003366; border-width: 1px; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 11px; background-color: #EFEFEF; color: #000000; vertical-align: center;} ….. </style> Create : • new tables • Layers • Etc…
A dynamic bar menu II Javascript program • Get and customize a free popup menu script from Internet(more info : www.ncdesign.org )
<sirsi_shell_script> selascii field1|field2|…. A dynamic bar menu III Sirsi ‘Shell_script’ element & Perl script Sirsi status page (.pg, .h, etc…) Perl script Gateway file ELEMENT.x • HTML code • Javascript code • CSS code • etc…
Sirsi Shell_script element How to use it? • Define parameters <SIRSI_Set_Session Name="BINCUSTOM" Value="/us/sirsi/Unicorn/Bincustom"> <SIRSI_Assign Variable=TRACKPATH Session="BINCUSTOM" OPER="CONCAT" Lit_Value="/trackpath"> <SIRSI_Assign Variable=WEBCATURL Session="WEBCAT_URL"> <SIRSI_Assign Variable=SESSIONID Session="SESSION"> <SIRSI_Conditional IF NOT DC_COMP="Mf^"> <SIRSI_Set_Session Name=CURRENT_GATEWAY_NUMBER Value="$Mf"> <SIRSI_Assign Variable=ELEMENTNUMBER DC_Value="Mf"> <SIRSI_Conditional ELSE> <SIRSI_Assign Variable=ELEMENTNUMBER Session="CURRENT_GATEWAY_NUMBER"> </SIRSI_Conditional> <SIRSI_Assign Variable=GATEWAYNUMBER Environ="ILINK_GATEWAY_NUMBER"> <SIRSI_Assign Variable=SERVERPROTOCOL Environ="HTTP_PROTOCOL" OPER="CONCAT" LIT_VALUE="://"> <SIRSI_Assign Variable=SERVERADDRESS OTHER_VAR="SERVERPROTOCOL" OPER="CONCAT" Environ="HTTP_ADDRESS">
Sirsi Shell_script element How to use it? • Call Shell_script element <SIRSI_Shell_Script Command="perl -U #TRACKPATH #GATEWAYNUMBER #ELEMENTNUMBER #WEBCATURL #SESSIONID #SERVERADDRESS">
Perl script ….. chomp($language);$cmd = 'sirsiecho ' . "\'$non_translated_description\'" . '| translate -l' . $language;my $translated_description = `$cmd`;chomp($translated_description);$root_menu_code = $root_menu_code . 'addItem(\' <table border="0" width="100%" style="position: absolute; top:-5px; left: 0px;"><tr><td align="left" class="highText">' . $translated_description . '</td><td align="right" valign="top" width="10%"><img src="/WebCat_Images/French/Other/Miscil/arrow_down3.gif" border="0"> </td></tr></table>\', \'m' . $sorted_children[$i]{'id'} . '\', \'sm:\', null, 180);' . "\n";$translated_description . '\', \'m' . $sorted_children[$i]{'id'} . '\', \'sm:\', null, 165);' . "\n"; .….
Perl script ….. sub get_brothers { my $element_number = $_[0]; my $parent = get_parent($element_number); chomp($parent); my @brothers; my $work1_file = "$tmp_file.gatewayelementlist.work1"; my($rc) = system("selascii -c $gateway_file -s2 $parent -oF1F3F4F5F8 | /us/sirsi/Unicorn/Bincustom/Ansel2iso/ansel2iso >$work1_file 2>/dev/null"); if ($rc != 0) { printf '<br><font color=blue>' . $rc . '<br></font>'; printf '<font color=red> Unable to selascii ' . $gateway_file; printf ' Processing aborted.</font>'; my_exit(-1);}……
Perl script #!/bin/perl # # evaluates the hitlist number to be even or odd, and assigns # alternating CSS classes so that the hitlist alternates row colors # # sub write_style_class { $hitlist_number = $_[0];if (($hitlist_number%2) == 0) { $style_class_code = '"itemlisting"';}else { $style_class_code = '"itemlisting2"';}printf("%s", $style_class_code);} $hitlist_number = $ARGV[0]; write_style_class($hitlist_number);
Improve navigation II Sirsi ‘Shell_script’ element & Perl script …… sub get_parent { my $element_number = $_[0]; my($parent) = `selascii -c $gateway_file -s1 $element_number -oF2`; return($parent);}sub get_parents { my $work3_file = "$tmp_file.trackpath.work3"; my $element_number = $_[0]; my $parent; …… do { $parent = get_parent($element_number); chomp($parent); $rc = system("selascii -c $gateway_file -s1 $parent -oF1F3F4F5F8F90 | /us/sirsi/Unicorn/Bincustom/Ansel2iso/ansel2iso >>$work3_file 2>/dev/null"); if ($rc != 0) { printf '<br><font color=blue>' . $rc . '<br></font>'; printf '<font color=red> Unable to selascii ' . $gateway_file; printf ' Processing aborted.</font>'; my_exit(-1); } $element_number = $parent; } until ($parent == '0');..…
Bilingual interface • We are using one gateway for both languages (French & English) • We created when needed custom labels and messages for both languages • We modified entries’ names in the configuration of the formats (using Workflows or character based interface)
pop-up tooltip CSS, HTML & Javascript program • We used HTML layers • We created a javascript script to write and show layer of a tooltip on mouse hover event on objects
PDF Contextual help I We created named destinations in the PDF file We used the sirsi’s javascript functionput_help_button(‘file_name.pdf#ancho_name'); Example: put_help_button('aide_cible.pdf#advanced_search');
PDF Contextual help II • Create a PostScript file of the source document (DOC PDF PS) • Edit the PostScript file in NotePad or vi editor (save as text file format) • Put after the « EndSetup » line the Name Destination(s) following the syntax: [ /Dest name /Page pagenumber /View view /Dest pdfmark • Destill the PostScript file with Acrobat Destiller • Create the URL link(s) using the format:relative_path/myfile.pdf#anchor_name http://www.adobe.com/products/adobemag/archive/pdfs/9707qaac.pdf
PDF Contextual help III Dest : string = name of the anchor Page : string = name of the destination page View : array = link or bookmark’s destination on a page, and its fit type More information in the PDFMARK.PDF file in the Help folder of the Acrobat installation folder. Fit fit the page to the window FitB fit the bounding box of the page contents to the window FitH fit the width of the page to the window (one parameter top specifies the distance from the page origin to the top of the window) …..
PDF Contextual help IV <SCRIPT Language=javascript> <SIRSI_Conditional IF DC_Comp="mW^1" AND DC_Comp="mT^3"> put_help_button('aide_cible.pdf'); <SIRSI_Conditional ELSE_IF NOT DC_Comp="mT^2"> put_help_button('aide_cible.pdf#advanced_search'); <SIRSI_Conditional ELSE_IF DC_Comp="mW^2" AND DC_Comp="mT^2"> put_help_button('aide_cible.pdf#browse_index_search'); <SIRSI_Conditional ELSE> put_help_button('aide_cible.pdf#quick_search'); </SIRSI_Conditional> </SCRIPT>
Javascript programs • Get and customize a free popup menu script from Internet(more info : www.ncdesign.org ) • Develop a script to show a long pop-up tooltip on interface’s objects