Presentation laddar. Vänta.

Presentation laddar. Vänta.

Daniel Forsman European EndUser 2005 Örebro universitetsbibliotek WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS STRENGTH.

Liknande presentationer


En presentation över ämnet: "Daniel Forsman European EndUser 2005 Örebro universitetsbibliotek WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS STRENGTH."— Presentationens avskrift:

1 Daniel Forsman European EndUser 2005 Örebro universitetsbibliotek WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS STRENGTH

2 Agenda Background information About PHP and Voyager Examples - MINITRUE - ACQ Origin - ACQ Status - Journals - New books Questions The bitter end

3 Orebro University 1300 staff students 2002/ full time University Library 50 Staff 2 Systems librarians 3 System technicans Items Bibs Windows 2K Terminal - Server Linux clients

4 GSLG Voyager Consortia Kalmar University Orebro University The Stockholm Institute of Education University College of Boras Vaxjo University mutual Systems librarian 1 Database server 2 Application servers Stockholm University National Library

5 Systems librarian - Problem solving - Application handling - Development - Teaching 4 Years at Orebro No previous programming/systems background Simple librarian with a interest If I can do this, so can you! Who? Me?

6 Voyager & Reports • Several tools available for managing reports: Access, ColdFusion, PERL … • PHP is just another tool that you can use. • PHP combines some of the best features of the ”other” tools

7 PHP? PHP : Hypertext Preprocessor Used to be Personal Home Page Server side scripting language which can be embedded in HTML or as a standalone binary similar to ASP, ColdFusion, JSP Official module to Apache HTTP server Runs on *nix and Window platforms Current version : PHP5, object oriented and more C++ like then the previous PHP4 (still available as 4.3.8).

8 Our set up • Local webserver: with MySQL, Apache 2.x, running the library webpages, DoD etc. PHP GD, JPgraphics, PHP/SWF, LDAP … • Database server: Solaris / Oracle • Solaris application server: apache 1.3.x, PHP PHP important security update

9 Things you can do • Extended webbased Voyager functionality • Statistics & Data mining • Collection management - list of journals, video... Whatever...

10 MINITRUE WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS STRENGTH

11 varför Ideen Hur det fungerar Resultat Utveckling Kod The problem Voyager offers no authority control of individual fields When doing reports based on a specific MARC field, Human errors distort the data

12 Example : how much has the shelfs grown during the last year select count(*), ala2iso(getsubfield('852','h','mfhd',mi.mfhd_id)) as shelf from bib_text bt, bib_mfhd bm, mfhd_item mi, item i, mfhd_master mm where bt.bib_id = bm.bib_id and bm.mfhd_id = mi.mfhd_id and mi.item_id = i.item_id and mm.mfhd_id = mi.mfhd_id and i.create_date >= to_date(' ','YYYY-MM-DD') and i.create_date <= to_date(' ','YYYY-MM-DD') group by ala2iso(getsubfield('852','h','mfhd',mi.mfhd_id))

13 Returns all unique 852 h including errors 852 |h Uppsats 852 |h Upppsats 852 |h Upsatts 852 |h Uppsats Andersson|i Endless possibilites Makes it hard to use the 852 h field when Working with a lot of data for migration, export, Import etc. Messing up statistics Where there is human input there is room for error

14 How to solve the problem? Make a script that looks at all the modified MFHD 852 h Fields, compare the input with a authority list, if it matches Then all is well if not there is a problem. the operator who made the change with information

15 CRONTAB Daily ORACLEOPERATORCAT Uppst.txt List of valid entries to 852 h MFHD Update.php Webform to update Uppst.txt, password restricted Check2.php Compares modified 852 h fields During the day with the list of Approved 852 h fields in uppst.txt If the field is found in in uppst.txt All is OK, if not there is a problem The operator of the modified mfhd receives a with MFHD ID, BIB ID and The entered 852 h field If the entry is correct but missing From the uppst.txt file they Are encouraged to update the Uppst.txt file online with Update.php. check.log All ”errors” Are logged.

16 Select all mfhd_id that has been modified during the day Loop through and select the data we need. select distinct bt.bib_id as bib_id, ala2iso(getsubfield('852','h','mfhd',mi.mfhd_id)) as h, ala2iso(getsubfield('852','i','mfhd',mi.mfhd_id)) as i, o.operator_id as op from bib_text bt, bib_mfhd bm, mfhd_item mi, item i, operator o, mfhd_history mh where bm.mfhd_id = mh.mfhd_id and bt.bib_id = bm.bib_id and bm.mfhd_id = mi.mfhd_id and mi.item_id = i.item_id and o.operator_id = mh.operator_id and mh.mfhd_id = $id and mh.action_date >= to_date('$date','YYYY-MM-DD' //Define the file to validate against. $rfile = "uppst.txt"; //Parse through the file, each line = one valid call number $hyllor = file($rfile);

17 while(list(,$hylla) = each ($hyllor)) { //Trim any whitespace from the textfile $h = trim($h); $hylla = trim($hylla); if($hylla == $h || "REF $hylla" == $h || "$hylla br" == $h || "$hylla(p)" == $h || "$hylla(x)" == $h || "$hylla(s)" == $h || "$hylla fol" == $h || "REF $hylla(x)" == $h || "REF $hylla(p)") { //If there is a match between the H field ($h) and the valid Call number ($hylla) //Then there is no need to do anything. The entry is valid. //Break the loop, and go on to next //If there is no match then operator

18 Hej! ändrade/skapade operator *gunn* hylluppställningen* EDC Qad *för post med MFHD_ID: BIB_ID: EDC Qad finns inte med bland de 2860 auktoriserade uppställningarna. Om det är en giltig hylluppställning bör denna läggas till hylluppställningsplanen. Om den är felaktig bör du ändra. Vid frågor, kontakta ansvarig för hylluppställningsplanen. Om du misstänker att denna automatiska kontroll är felaktig kontakta Aktuell uppställningsplan hittar du på: MINITRUE : WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS

19 MFHDs modified/created: [before , 21:30:01] 1: REF Okc(p) is not one of the 2530 validated CALL NUMBERS! MFHD ID: BIB ID: h:REF Okc(p) 852 i:Socialförsäkringsboken OPERATOR: gunn … 11:Produkten REF Qcab is not one of the 2530 validated CALL NUMBERS! MFHD ID: BIB ID: h:Produkten REF Qcab 852 i:Jefferson OPERATOR: ann 142 mfhds checked in total MFHDs modified/created: [before , 21:30:04] 4 mfhds checked in total

20 Let’s look at the script in action! A modified version with.html output. Extended functionality 1)852 h => Authority control 2) Item type => 852 check If there is a item with a certain item type then that should be reflected in the 852 h field Example: A 852 h field called VIDEO should have items with item type VIDEO associated. 3)852 b => 852 h check If 852 h is something then the location is expected to be something. Example: 852 h is a shelf located on a ”closed” shelf then the location should not be the default location. More to come …

21 ACQ origin Bakgrund varför Ideen Hur det fungerar Resultat Utveckling Kod Codes are entered into line item note in ACQ module Who requested the book Monitor the level of user oriented purchases Monitor the circulation of materials based upon purchase request

22 ORACLE Line_item. Line_item_notes OPERATORACQ Acq_origin_diagram.php JPGRAPH class ACQ_ORIGIN_START.php Start & End date Select categories Acq_origin.php Select count code While count Select historical_charges Group by historical charges

23 $sqlY1 = "select count(*) as Y1, i.historical_charges as hc1, it.item_type_name as it1 from line_item_notes, line_item, item i, bib_item bi, item_type it where line_item.create_date > TO_DATE('$startdate','YYYY-MM-DD') and line_item.create_date ";

24 Jpgraph graphics $v1 = $HTTP_GET_VARS["v1"]; include ("jpgraph/src/jpgraph.php"); include ("jpgraph/src/jpgraph_bar.php"); $datax = array("Y1","Y2","Y3","Y4","Y5","Y6"); $datay=array($v1,$v2,$v3,$v4,$v5,$v6); // Create the graph. These two calls are always required $graph = new Graph(400,300,"auto"); $graph->SetScale("textlin"); // Add a drop shadow $graph->SetShadow(); // Adjust the margin a bit to make more room for titles $graph->img->SetMargin(50,40,30,50); // Create a bar pot $bplot = new BarPlot($datay); $graph->Add($bplot); //Displays the X labels $graph->xaxis->SetTickLabels($datax); //Displays the values on top of bars $bplot->value->Show(); // Center the values in the bar //$bplot->SetValuePos('center'); // Make the bar a little bit wider $bplot->SetWidth(0.7); //Displays values on top of bars // Setup the titles $graph->title->Set("Förvärvsursprung"); $graph->xaxis->title->Set("Ursprung"); $graph->yaxis->title->Set("Antal"); $graph->title->SetFont(FF_FONT1,FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph ->legend->Pos( 0.05,0.5,"right","center"); // Display the graph $graph->Stroke();

25 Look at the script in action

26 ACQ origin – OriginCount Y1 : Librarian3082 Y2 : ILL394 Y3 : Teacher1658 Y4 : Student82 Y5 : Lost181 Y6 : Other545 Total5942

27 Circulation, acq origin librarian (31%) of the books purchased During 2004 has never circulated. 643 (21%) has circulated once. LånItemIT 0965Lån 1643Lån 2357Lån 3190Lån 4119Lån 572Lån 648Lån 736Lån 823Lån 912Lån 1011Lån 113Lån 122Lån 133Lån 142Lån 171Lån 201Lån 211Lån 411Lån Is there a difference in Swedish and English conten?

28 0884Lån 1492Lån 2379Lån 3240Lån 4189Lån 5143Lån 6108Lån 753Lån 859Lån 935Lån 1040Lån 1127Lån 1232Lån 1314Lån 1410Lån 1514Lån 165Lån 175Lån 184Lån 191Lån 203Lån 212Lån 223Lån 321Lån 0422Lån 1381Lån 2265Lån 3157Lån 4109Lån 552Lån 643Lån 716Lån 813Lån 910Lån 107Lån 113Lån 125Lån 133Lån 141Lån 171Lån Inköp på initativ av bibliotekarie 2003 Inköp på iniativ av lärare % av förvärvade normallån på initativ av bibliotekarie 2003, har ej lånats ut sedan de införskaffades var siffran 31%. 28% av förvärvade normallån På initativ av lärare 2003, har Ej lånats ut sedan de införskaffades var siffran 47%. Förvärvar en lärare lika bra/dåligt som en bibliotekarie?

29 Script idea: display and count line items grouped by status. Items selected through fund plan hyperlink select ledger, select status, select fund, display items with that status and fund with purchase order info and bibliographic data ACQ status ACQ module hostile to non ACQ staff Librarians want to track their orders Webbased interface to ACQ purchase orders.

30 ORACLE BIB PO LINE ITEM ACQ OPERATOR ACQ / CAT Order_status.php 1.Choose ledger 2.Choose status (invoiced, approved etc.) 3.Review Ledger hierarchy – choose ledger 4.Info on associated items •Title / Author / ISBN •PO NO •Status date •ACQ operator •# copies Subject librarian

31 //Ask for ledger // create connection $connection = odbc_connect("$user", "", "") or die("arrrrrg, kan inte ansluta"); $ledger_sql = "select ledger_id as ledger_id, ledger_name as ledger from ledger order by create_date"; $exe_led = odbc_exec($connection, $ledger_sql) or die("Ledger sql died : $ledger_sql"); while(odbc_fetch_row($exe_led)){ $ledger_id = odbc_result($exe_led, 'ledger_id'); $ledger = odbc_result($exe_led, 'ledger'); $options.= " $ledger "; } echo " Välj ledger "; echo " "; echo ' '; echo " "; echo "$options"; echo " "; echo ' '; echo " "; odbc_close($connection);

32 $status_sql = "select line_item_status, line_item_status_desc from line_item_status order by line_item_status_desc"; $sql = "select fund_name, fund_id, parent_fund from fund where ledger_id='$led2' and parent_fund='0'"; echo " $fund_name [$count] ";

33 $sql_select = "select li.quantity as antal, li.create_date as skapad, op.first_name as fnamn, op.last_name as enamn, po.po_number as po, ala2iso(bib.title) as tit, bib.isbn as isbn, bib.issn as issn from line_item li, operator op, purchase_order po, bib_text bib, line_item_copy_status lis, line_item_funds lf where lis.line_item_id = li.line_item_id and lis.line_item_status = '$s' and lf.ledger_id = '$l' and fund_id = '$f' and lis.copy_id = lf.copy_id and li.create_opid = op.operator_id and li.po_id = po.po_id and bib.bib_id = li.bib_id";

34 Look at the script in action

35 Make a list of journals in A separate interface All journals are given a Item type One item type for printed journals One item type for electronic journals Journals

36 //Convert search term to lower $str = strtolower($term); $sql1 = "select distinct ala2iso(bt.title) as jn, bt.bib_id as bib, i.item_type_id as itid from bib_text bt, bib_mfhd bm, mfhd_item mi, item i where bt.bib_id = bm.bib_id and bm.mfhd_id = mi.mfhd_id and mi.item_id = i.item_id $ite and ala2iso(translate(bt.title_brief, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ','abcdefghijklmnopqrstuvwxyzåäö')) like '%$str%' order by jn";

37 Look at script in action

38 New books is fine, separate new books from OPAC Display new books on webpage Offer RSS channels with new book Criteria is based on Received complete and Fund hierarchy New books

39 User Nytt.html Choose subject & $date > RSS.php Received complete Status date > $date String search for fund name Array push If array  For each echo Title and link to OPAC RSS feed *.xsql Create_RSS.php Time conversion Same SQL as RSS.php Array for each Fund Write to file instead of screen Crontab Daily

40 //idag $now = strftime("%Y-%m-%d"); //Antal sekunder på en vecka $w1 = 7 * 86400; //antalet sekunder på två veckor $w2 = 14 * 86400; //antalet sekunder på två veckor $w3 = 21 * 86400; //konvertera dagens datum till sekunder $ctime = strtotime($now); //subtrahera dagens sekunder med veckosekunder för att få reda på datumet för en vecka sedan $w11 = $ctime - $w1; //subtrahera dagens sekunder med veckosekunder för att få reda på datumet för två veckor sedan $w22 = $ctime - $w2; //subtrahera dagens sekunder med veckosekunder för att få reda på datumet för två veckor sedan $w33 = $ctime - $w3; //konvertera sekunder till timestamp $envecka = date("Y-m-d", $w11); //konvertera sekunder till timestamp $tvavecka = date("Y-m-d", $w22); //konvertera sekunder till timestamp $trevecka = date("Y-m-d", $w33);

41 $sql = "select unique ala2iso(bt.title_brief) as titel, f.fund_name as fund from line_item_copy_status ls, bib_mfhd bm, bib_text bt, fund f, line_item_copy lc where ls.line_item_status = '1' and status_date > TO_DATE('$datum','YYYY-MM-DD') and ls.mfhd_id = bm.mfhd_id and bm.bib_id = bt.bib_id and ls.line_item_id = lc.line_item_id and lc.use_fund = f.fund_id order by titel";

42 $teknikarrayT = array(); //Konvertera konto-sträng till lowercase $fund_low = strtolower($fund); $findteknik = "teknik"; if(strstr($fund_low, $findteknik)) { array_push($teknikarrayT, "$title"); }

43 if($teknik){ $uteknikarrayT = array_unique($teknikarrayT); $cteknik = count($uteknikarrayT); echo " Teknik nyförvärv sedan $datum "; echo " Antal nyförvärv:$cteknik "; $iteknik = "1"; foreach ($uteknikarrayT as $tekniktitle) { echo "$iteknik. "; $iteknik++; $pteknik = explode(" ", $tekniktitle); echo ' '.$tekniktitle.' '; } }"http://oru.sub.su.se/cgi-bin/Pwebrecon.cgi?DB=local&Search_Arg='.$pteknik[0].'+'.$pteknik[1].'+'.$pteknik[2].'+'.$pteknik[3].'&Search_Code=TALL&CNT=25&HIST=1"

44 if($teknik){ $uteknikarrayT = array_unique($teknikarrayT); $cteknik = count($uteknikarrayT); $lteknikfile = "teknikrss.xsql"; if (is_writable($lteknikfile)) { if (!$handleteknik = fopen($lteknikfile, 'w+')) { exit; } $h1teknik = ' Nyanlända böcker Teknik - Örebro universitetsbibliotek Nya böcker på Örebro universitetsbibliotek, Teknik sedan '.$datum.'. Antal nyförvärv:'.$cteknik.' sv-se reference/libraries '; if (fwrite($handleteknik, $h1teknik) === FALSE) { echo "Cannot write to file ($lteknikfile)"; exit; } $iteknik = "1"; foreach ($uteknikarrayT as $tekniktitle) { $iteknik++; $pteknik = explode(" ", $tekniktitle); $contentteknik = ' '.$tekniktitle.' Med största sannolikhet har boken ännu inte kommit ut på hyllan. Kontakta bibliotekets information för att reservera boken. '.$now.' '; if (fwrite($handleteknik, $contentteknik) === FALSE) { exit; } } $closeteknik = ' '; if (fwrite($handleteknik, $closeteknik) === FALSE) { echo "Cannot write to file ($lteknikfile)"; exit; }else{ echo "Updated Teknik RSS \n"; } fclose($handleteknik); } else { echo "The file $lteknikfile is not writable"; } }"http://purl.org/dc/elements/1.1/""http://www.w3.org/2001/XMLSchema-instance"http://www.ub.oru.se/voyager/teknikrss.xsql"http://dmoz.org/"http://oru.sub.su.se

45 Look at script in action

46 References • • • • PHP5 and MySQL bible : Converse, Park & Morgan • PHP Functions - essential reference : Greant, Merall, Wilson & Michlitsch • PHP and MySQL Web Development : Wellington & Thomson Contact

47 [The bitter end] If you want any of the code let me know.


Ladda ner ppt "Daniel Forsman European EndUser 2005 Örebro universitetsbibliotek WAR IS PEACE, FREEDOM IS SLAVERY, IGNORANCE IS STRENGTH."

Liknande presentationer


Google-annonser