(Miguel Ferreira)

- Controlled vocabulary patch to provide search on classification terms, and
  addition of terms during submission.
  SF Patch: #1244559


git-svn-id: http://scm.dspace.org/svn/repo/trunk@1414 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Richard Jones
2006-02-08 14:41:08 +00:00
parent e79d5da5f8
commit 09b200a563
29 changed files with 5291 additions and 133 deletions

View File

@@ -1,5 +1,14 @@
1.4 alpha 1
===========
(Miguel Ferreira)
- Controlled vocabulary patch to provide search on classification terms, and
addition of terms during submission.
SF Patch: #1244559
(Richard Jones)
- Add 'visibility' element to input-forms.xml
SF Patch #1368160
(Martin Hald)
- Log4J enhancement to use XML configuration
SF Patch #1224389

View File

@@ -0,0 +1,14 @@
nsi.xml
=======
Norsk inndeling av vitenskapsdisipliner was created in 2003 for The Norwegian
Association of Higher Education Institutions.
--------------------------------------------------------------------------------
srsc.xml
========
Thanks to the Swedish Royal Librarys Department for National Co-ordination and
Development, BIBSAM, and the participating members in the SVEP project for
the permission to use the Swedish Research Subject Categories.

View File

@@ -0,0 +1,563 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The Norwegian Science Index
-->
<node id="VDP" label="VDP">
<isComposedBy>
<node id="000" label="Humaniora: 000">
<isComposedBy>
<node id="010" label="Språkvitenskapelige fag: 010">
<isComposedBy>
<node id="011" label="Allmenn språkvitenskap og fonetikk: 011" />
<node id="012" label="Anvendt språkvitenskap: 012" />
<node id="013" label="Tegnspråk: 013" />
<node id="018" label="Nordiske språk: 018" />
<node id="019" label="Norrøn filologi: 019" />
<node id="020" label="Engelsk språk: 020" />
<node id="021" label="Tysk språk: 021" />
<node id="022" label="Nederlandsk språk: 022" />
<node id="023" label="Andre germanske språk: 023" />
<node id="024" label="Fransk språk: 024" />
<node id="025" label="Italiensk språk: 025" />
<node id="026" label="Spansk språk: 026" />
<node id="027" label="Andre romanske språk: 027" />
<node id="028" label="Russisk språk: 028" />
<node id="029" label="Andre slaviske språk: 029" />
<node id="030" label="Finsk-ugriske språk: 030" />
<node id="031" label="Samisk språk: 031" />
<node id="032" label="Klassisk filologi: 032" />
<node id="033" label="Indoeuropeiske språk: 033" />
<node id="034" label="Østasiatiske språk: 034" />
<node id="035" label="Semittiske språk: 035" />
<node id="036" label="Afrikanske språk: 036" />
<node id="037" label="Stillehavsspråk: 037" />
<node id="038" label="Tyrkiske språk: 038" />
<node id="039" label="Andre språkvitenskapelige fag: 039" />
</isComposedBy>
</node>
<node id="040" label="Litteraturvitenskapelige fag: 040">
<isComposedBy>
<node id="041" label="Allmenn litteraturvitenskap: 041" />
<node id="042" label="Nordisk litteratur: 042" />
<node id="043" label="Engelsk litteratur: 043" />
<node id="044" label="Tysk litteratur: 044" />
<node id="045" label="Annen germansk litteratur: 045" />
<node id="046" label="Fransk litteratur: 046" />
<node id="047" label="Italiensk litteratur: 047" />
<node id="048" label="Spansk litteratur: 048" />
<node id="049" label="Annen romansk litteratur: 049" />
<node id="050" label="Russisk litteratur: 050" />
<node id="051" label="Annen slavisk litteratur: 051" />
<node id="052" label="Finsk litteratur: 052" />
<node id="053" label="Samisk litteratur: 053" />
<node id="054" label="Klassisk litteratur: 054" />
<node id="055" label="Indoeuropeisk litteratur: 055" />
<node id="056" label="Østasiatisk litteratur: 056" />
<node id="057" label="Semittisk litteratur: 057" />
<node id="058" label="Afrikansk litteratur: 058" />
<node id="059" label="Andre litteraturvitenskapelige fag: 059" />
</isComposedBy>
</node>
<node id="060" label="Kulturvitenskap: 060">
<isComposedBy>
<node id="061" label="Nordisk kulturvitenskap: 061" />
<node id="062" label="Germansk kulturvitenskap: 062" />
<node id="063" label="Romansk kulturvitenskap: 063" />
<node id="064" label="Slavisk kulturvitenskap: 064" />
<node id="065" label="Klassisk kulturvitenskap: 065" />
<node id="066" label="Indoeuropeisk kulturvitenskap: 066" />
<node id="067" label="Østasiatisk kulturvitenskap: 067" />
<node id="068" label="Angloamerikansk kulturvitenskap: 068" />
<node id="069" label="Annen kulturvitenskap: 069" />
</isComposedBy>
</node>
<node id="070" label="Historie: 070">
<isComposedBy>
<node id="071" label="Politisk historie: 071" />
<node id="072" label="Sosialhistorie: 072" />
<node id="073" label="Kvinnehistorie: 073" />
<node id="074" label="Økonomisk historie: 074" />
<node id="075" label="Kulturhistorie: 075" />
<node id="080" label="Oldtidens historie: 080" />
<node id="081" label="Middelalderhistorie: 081" />
<node id="082" label="Nyere tids historie (før 1800): 082" />
<node id="083" label="Moderne historie (etter 1800): 083" />
<node id="084" label="Samtidshistorie (etter 1945): 084" />
<node id="085" label="Ikke-europeisk/-vestlig historie: 085" />
<node id="089" label="Annen historie: 089" />
</isComposedBy>
</node>
<node id="090" label="Arkeologi: 090">
<isComposedBy>
<node id="091" label="Nordisk arkeologi: 091" />
<node id="092" label="Klassisk arkeologi: 092" />
<node id="099" label="Annen arkeologi: 099" />
</isComposedBy>
</node>
<node id="100" label="Folkloristikk, etnologi: 100">
<isComposedBy>
<node id="101" label="Folkloristikk: 101" />
<node id="102" label="Etnologi: 102" />
</isComposedBy>
</node>
<node id="110" label="Musikkvitenskap: 110">
<isComposedBy>
<node id="111" label="Musikkhistorie: 111" />
<node id="112" label="Musikkteori: 112" />
<node id="113" label="Musikkterapi: 113" />
<node id="114" label="Musikkpedagogikk: 114" />
<node id="119" label="Annen musikkvitenskap: 119" />
</isComposedBy>
</node>
<node id="120" label="Kunsthistorie: 120">
<isComposedBy>
<node id="121" label="Skulptur: 121" />
<node id="122" label="Maleri, tegning, grafikk: 122" />
<node id="123" label="Folkekunst, kunsthåndverk: 123" />
<node id="124" label="Konservering og restaurering: 124" />
<node id="125" label="Antikkens kunsthistorie: 125" />
<node id="126" label="Middelalderkunsthistorie: 126" />
<node id="127" label="Fra renessanse t.o.m. barokk: 127" />
<node id="128" label="Nyere tids kunsthistorie: 128" />
<node id="129" label="Moderne kunsthistorie: 129" />
<node id="130" label="Ikkeeuropeisk kunsthistorie: 130" />
<node id="139" label="Annen kunsthistorie: 139" />
</isComposedBy>
</node>
<node id="140" label="Arkitektur og design: 140">
<isComposedBy>
<node id="141" label="Arkitektur- og designhistorie: 141" />
<node id="142" label="Arkitektur- og designteori: 142" />
<node id="143" label="Prosjekterings og formgivningsmetodikk: 143" />
<node id="147" label="Landskapsarkitektur: 147" />
</isComposedBy>
</node>
<node id="150" label="Teologi og religionsvitenskap: 150">
<isComposedBy>
<node id="151" label="Teologi: 151" />
<node id="152" label="Kristendomskunnskap: 152" />
<node id="153" label="Religionsvitenskap, religionshistorie: 153" />
</isComposedBy>
</node>
<node id="160" label="Filosofiske fag: 160">
<isComposedBy>
<node id="161" label="Filosofi: 161" />
<node id="162" label="Idéhistorie: 162" />
<node id="163" label="Logikk: 163" />
<node id="164" label="Etikk: 164" />
<node id="169" label="Andre filosofiske fag: 169" />
</isComposedBy>
</node>
<node id="170" label="Film- og teatervitenskap: 170">
<isComposedBy>
<node id="171" label="Filmvitenskap: 171" />
<node id="172" label="Teatervitenskap: 172" />
</isComposedBy>
</node>
</isComposedBy>
</node>
<node id="200" label="Samfunnsvitenskap: 200">
<isComposedBy>
<node id="210" label="Økonomi: 210">
<isComposedBy>
<node id="212" label="Samfunnsøkonomi: 212" />
<node id="213" label="Bedriftsøkonomi: 213" />
<node id="214" label="Økonometri: 214" />
</isComposedBy>
</node>
<node id="230" label="Urbanisme og fysisk planlegging: 230">
<isComposedBy>
<node id="231" label="Planleggingshistorie, -teori og -metodikk: 231" />
<node id="234" label="Bebyggelses og reguleringsplanlegging: 234" />
<node id="236" label="Landskapsplanlegging: 236" />
<node id="237" label="Urbanisme: 237" />
<node id="238" label="Romlig, territoriell planlegging: 238" />
</isComposedBy>
</node>
<node id="240" label="Statsvitenskap og organisasjonsteori: 240">
<isComposedBy>
<node id="241" label="Sammenlignende politikk: 241" />
<node id="242" label="Offentlig og privat administrasjon: 242" />
<node id="243" label="Internasjonal politikk: 243" />
</isComposedBy>
</node>
<node id="260" label="Psykologi: 260">
<isComposedBy>
<node id="261" label="Biologisk psykologi: 261" />
<node id="262" label="Klinisk psykologi: 262" />
<node id="263" label="Sosial- og arbeidspsykologi: 263" />
<node id="264" label="Personlighetspsykologi: 264" />
<node id="265" label="Utviklingspsykologi: 265" />
<node id="267" label="Kognitiv psykologi: 267" />
<node id="268" label="Organisasjonspsykologi: 268" />
<node id="279" label="Andre psykologiske fag: 279" />
</isComposedBy>
</node>
<node id="280" label="Pedagogiske fag: 280">
<isComposedBy>
<node id="281" label="Allmennpedagogikk: 281" />
<node id="282" label="Spesialpedagogikk: 282" />
<node id="283" label="Fagdidaktikk: 283" />
<node id="289" label="Andre pedagogiske fag: 289" />
</isComposedBy>
</node>
<node id="320" label="Biblioteks- og informasjonsvitenskap: 320">
<isComposedBy>
<node id="321" label="Informasjons- og kommunikasjonssystemer: 321" />
<node id="322" label="Informasjonspolitikk: 322" />
<node id="323" label="Kunnskapsgjenfinning og organisering: 323" />
<node id="324" label="Bibliometri: 324" />
<node id="325" label="Dokumentasjonsvitenskap: 325" />
<node id="326" label="Arkivistikk: 326" />
</isComposedBy>
</node>
<node id="330" label="Samfunnsvitenskapelige idrettsfag: 330">
<isComposedBy>
<node id="331" label="Integreringsfag: 331" />
<node id="332" label="Aktivitetslære: 332" />
<node id="333" label="Idrettspedagogikk og -psykologi: 333" />
<node id="339" label="Andre idrettsfag: 339" />
</isComposedBy>
</node>
<node id="340" label="Rettsvitenskap: 340">
<isComposedBy>
<node id="341" label="Allmenn rettsvitenskap: 341" />
<node id="342" label="Privatrett: 342" />
<node id="343" label="Offentlig rett: 343" />
<node id="344" label="Folkerett: 344" />
<node id="346" label="Rettsinformatikk: 346" />
<node id="347" label="Miljørett: 347" />
<node id="348" label="Fiskerirett: 348" />
<node id="349" label="Andre rettsvitenskapelige fag: 349" />
</isComposedBy>
</node>
<node id="220" label="Sosiologi: 220" />
<node id="250" label="Sosialantropologi: 250" />
<node id="290" label="Samfunnsgeografi: 290" />
<node id="300" label="Demografi: 300" />
<node id="310" label="Medievitenskap og journalistikk: 310" />
<node id="350" label="Kriminologi: 350" />
<node id="360" label="Sosialt arbeid: 360" />
<node id="370" label="Kvinne- og kjønnsstudier: 370" />
</isComposedBy>
</node>
<node id="400" label="Matematikk og Naturvitenskap: 400">
<isComposedBy>
<node id="410" label="Matematikk: 410">
<isComposedBy>
<node id="411" label="Analyse: 411" />
<node id="412" label="Statistikk: 412" />
<node id="413" label="Anvendt matematikk: 413" />
<node id="414" label="Algebra/algebraisk analyse: 414" />
<node id="415" label="Topologi/geometri: 415" />
<node id="416" label="Logikk: 416" />
<node id="417" label="Forsikringsmatematikk og risikoanalyse: 417" />
</isComposedBy>
</node>
<node id="420" label="Informasjons- og kommunikasjonsvitenskap: 420">
<isComposedBy>
<node id="421" label="Teoretisk databehandling, programmeringsspråk og -teori: 421" />
<node id="422" label="Algoritmer og beregnbarhetsteori: 422" />
<node id="423" label="Kommunikasjon og distribuerte systemer: 423" />
<node id="424" label="Sikkerhet og sårbarhet: 424" />
<node id="425" label="Kunnskapsbaserte systemer: 425" />
<node id="426" label="Systemutvikling og arbeid: 426" />
<node id="427" label="Matematisk modellering og numeriske metoder: 427" />
<node id="428" label="Databaser og multimediasystemer: 428" />
<node id="429" label="Simulering, visualisering, signalbehandling, bildeanalyse: 429" />
</isComposedBy>
</node>
<node id="430" label="Fysikk: 430" >
<isComposedBy>
<node id="431" label="Kjerne- og elementærpartikkelfysikk: 431" />
<node id="433" label="Atomfysikk, molekylfysikk: 433" />
<node id="434" label="Elektromagnetisme, akustikk, optikk: 434" />
<node id="435" label="Elektronikk: 435" />
<node id="436" label="Kondenserte fasers fysikk: 436" />
<node id="437" label="Rom- og plasmafysikk: 437" />
<node id="438" label="Astrofysikk, astronomi: 438" />
</isComposedBy>
</node>
<node id="440" label="Kjemi: 440">
<isComposedBy>
<node id="441" label="Organisk kjemi: 441" />
<node id="442" label="Uorganisk kjemi: 442" />
<node id="443" label="Fysikalsk kjemi: 443" />
<node id="444" label="Teoretisk kjemi, kvantekjemi: 444" />
<node id="445" label="Analytisk kjemi: 445" />
<node id="446" label="Miljøkjemi, naturmiljøkjemi: 446" />
<node id="447" label="Kjernekjemi: 447" />
<node id="448" label="Legemiddelkjemi: 448" />
</isComposedBy>
</node>
<node id="450" label="Geofag: 450">
<isComposedBy>
<node id="451" label="Faste jords fysikk: 451" />
<node id="452" label="Oseanografi: 452" />
<node id="453" label="Meteorologi: 453" />
<node id="454" label="Hydrologi: 454" />
<node id="455" label="Naturgeografi: 455" />
<node id="456" label="Sedimentologi: 456" />
<node id="461" label="Stratigrafi og paleontologi: 461" />
<node id="462" label="Mineralogi, petrologi, geokjemi: 462" />
<node id="463" label="Tektonikk: 463" />
<node id="464" label="Petroleumsgeologi og -geofysikk: 464" />
<node id="465" label="Kvartærgeologi, glasiologi: 465" />
<node id="466" label="Marin geologi: 466" />
<node id="467" label="Hydrogeologi: 467" />
<node id="468" label="Geometrikk: 468" />
<node id="469" label="Andre geofag: 469" />
</isComposedBy>
</node>
<node id="470" label="Basale biofag: 470">
<isComposedBy>
<node id="471" label="Cellebiologi: 471" />
<node id="472" label="Generell mikrobiologi: 472" />
<node id="473" label="Molekylærbiologi: 473" />
<node id="474" label="Genetikk og genomikk: 474" />
<node id="475" label="Bioinformatikk: 475" />
<node id="476" label="Biokjemi: 476" />
<node id="477" label="Biofysikk: 477" />
<node id="478" label="Generell immunologi: 478" />
</isComposedBy>
</node>
<node id="480" label="Zoologiske og botaniske fag: 480">
<isComposedBy>
<node id="481" label="Zoologisk anatomi: 481" />
<node id="482" label="Embryologi: 482" />
<node id="483" label="Zoofysiologi og komparativ fysiologi: 483" />
<node id="484" label="Parasittologi: 484" />
<node id="485" label="Etologi: 485" />
<node id="486" label="Zoogeografi: 486" />
<node id="487" label="Systematisk zoologi: 487" />
<node id="488" label="Økologi: 488" />
<node id="489" label="Økotoksikologi: 489" />
<node id="491" label="Planteanatomi: 491" />
<node id="492" label="Plantefysiologi: 492" />
<node id="493" label="Systematisk botanikk: 493" />
<node id="495" label="Vegetasjonshistorie: 495" />
<node id="496" label="Plantegeografi: 496" />
<node id="497" label="Marinbiologi: 497" />
<node id="498" label="Limnologi: 498" />
</isComposedBy>
</node>
</isComposedBy>
</node>
<node id="500" label="Teknologi: 500">
<isComposedBy>
<node id="510" label="Berg og petroleumsfag: 510">
<isComposedBy>
<node id="511" label="Bergteknologi: 511" />
<node id="512" label="Petroleumsteknologi: 512" />
<node id="513" label="Geoteknikk: 513" />
<node id="519" label="Andre berg og petroleumsfagg: 519" />
</isComposedBy>
</node>
<node id="520" label="Materialteknologi: 520">
<isComposedBy>
<node id="521" label="Metallurgi: 521" />
<node id="522" label="Funksjonelle materialer: 522" />
<node id="523" label="Plast- og komposittmaterialer: 523" />
<node id="525" label="Bygningsmaterialer: 525" />
<node id="529" label="Annen materialteknologi: 529" />
</isComposedBy>
</node>
<node id="530" label="Bygningsfag: 530">
<isComposedBy>
<node id="531" label="Arkitektur og bygningsteknologi: 531" />
<node id="532" label="Bygg-, anleggs- og transportteknologi: 532" />
<node id="533" label="Konstruksjonsteknologi: 533" />
<node id="534" label="Kart og oppmåling: 534" />
<node id="535" label="Fysisk planlegging: 535" />
<node id="537" label="Geoteknologi: 537" />
<node id="538" label="Hydroteknologi: 538" />
</isComposedBy>
</node>
<node id="540" label="Elektrotekniske fag: 540">
<isComposedBy>
<node id="541" label="Elektronikk: 541" />
<node id="542" label="Elkraft: 542" />
<node id="549" label="Andre elektrotekniske fag: 549" />
</isComposedBy>
</node>
<node id="550" label="Informasjons- og kommunikasjonsteknologi: 550">
<isComposedBy>
<node id="551" label="Datateknologi: 551" />
<node id="552" label="Telekommunikasjon: 552" />
<node id="553" label="Teknisk kybernetikk: 553" />
<node id="555" label="Geografiske informasjonssystemer: 555" />
<node id="559" label="Annen informasjonsteknologi: 559" />
</isComposedBy>
</node>
<node id="560" label="Kjemisk teknologi: 560">
<isComposedBy>
<node id="561" label="Elektrokjemi: 561" />
<node id="562" label="Kjemisk prosessteknologi: 562" />
<node id="563" label="Kjemiteknikk: 563" />
<node id="568" label="Farmasøytisk formulering og teknologi: 568" />
<node id="569" label="Annen kjemisk teknologi: 569" />
</isComposedBy>
</node>
<node id="570" label="Maskinfag: 570">
<isComposedBy>
<node id="571" label="Maskinkonstruksjon og materialteknologi: 571" />
<node id="572" label="Produksjon og driftsteknologi: 572" />
<node id="573" label="Maskinteknisk energi- og miljøteknologi: 573" />
<node id="574" label="Mekaniske og strømningstekniske fag: 574" />
<node id="579" label="Andre maskinfag: 579" />
</isComposedBy>
</node>
<node id="580" label="Marin teknologi: 580" >
<isComposedBy>
<node id="581" label="Offshoreteknologi: 581" />
<node id="582" label="Skipsteknologi: 582" />
<node id="589" label="Annen marin teknologi: 589" />
</isComposedBy>
</node>
<node id="590" label="Bioteknologi: 590" />
<node id="600" label="Næringsmiddelteknologi: 600" />
<node id="610" label="Miljøteknologi: 610" />
<node id="620" label="Medisinsk teknologi: 620" />
<node id="630" label="Nanoteknologi: 630" />
<node id="640" label="Industri- og produktdesign: 640" />
</isComposedBy>
</node>
<node id="700" label="Medisinske Fag: 700">
<isComposedBy>
<node id="710" label="Basale medisinske, odontologiske og veterinærmedisinske fag: 710">
<isComposedBy>
<node id="711" label="Medisinsk molekylærbiologi: 711" />
<node id="714" label="Medisinsk genetikk: 714" />
<node id="715" label="Medisinsk mikrobiologi: 715" />
<node id="716" label="Medisinsk immunologi: 716" />
<node id="717" label="Anatomi, fysisk antropologi: 717" />
<node id="718" label="Human og veterinærmedisinsk fysiologi: 718" />
<node id="719" label="Generell patologi, patologisk anatomi: 719" />
<node id="720" label="Rettsmedisin, rettsodontologi: 720" />
<node id="721" label="Patofysiologi: 721" />
<node id="725" label="Klinisk kjemi: 725" />
<node id="726" label="Medisinsk biokjemi: 726" />
<node id="728" label="Farmakologi: 728" />
<node id="730" label="Toksikologi: 730" />
<node id="736" label="Biofarmasi: 736" />
<node id="738" label="Farmakognosi: 738" />
<node id="739" label="Klinisk farmakologi: 739" />
</isComposedBy>
</node>
<node id="750" label="Klinisk medisinske fag: 750" >
<isComposedBy>
<node id="751" label="Allmennmedisin: 751" />
<node id="752" label="Nevrologi: 752" />
<node id="753" label="Dermatologi og venerologi: 753" />
<node id="754" label="Oftalmologi: 754" />
<node id="755" label="Otorhinolaryngologi: 755" />
<node id="756" label="Gynekologi og obstetrikk: 756" />
<node id="757" label="Psykiatri, barnepsykiatri: 757" />
<node id="758" label="Rettspsykiatri: 758" />
<node id="759" label="Reumatologi: 759" />
<node id="760" label="Pediatri: 760" />
<node id="761" label="Tropemedisin: 761" />
<node id="762" label="Onkologi: 762" />
<node id="763" label="Radiologi og bildediagnostikk: 763" />
<node id="764" label="Fysikalsk medisin og rehabilitering: 764" />
<node id="765" label="Anestesiologi: 765" />
<node id="770" label="Generell indremedisin: 770" />
<node id="771" label="Kardiologi: 771" />
<node id="772" label="Nefrologi, urologi: 772" />
<node id="773" label="Gasteroenterologi: 773" />
<node id="774" label="Endokrinologi: 774" />
<node id="775" label="Hematologi: 775" />
<node id="776" label="Infeksjonsmedisin: 776" />
<node id="777" label="Lungesykdommer: 777" />
<node id="778" label="Geriatri: 778" />
<node id="780" label="Generell kirurgi: 780" />
<node id="781" label="Gasteroenterologisk kirurgi: 781" />
<node id="782" label="Kar- og thoraxkirurgi: 782" />
<node id="783" label="Traumatologi: 783" />
<node id="784" label="Ortopedisk kirurgi: 784" />
<node id="785" label="Plastisk kirurgi: 785" />
<node id="786" label="Nevrokirurgi: 786" />
<node id="787" label="Kjevekirurgi: 787" />
<node id="788" label="Endokrin kirurgi: 788" />
<node id="799" label="Andre klinisk medisinske fag: 799" />
</isComposedBy>
</node>
<node id="800" label="Helsefag: 800">
<isComposedBy>
<node id="801" label="Samfunnsmedisin, sosialmedisin: 801" />
<node id="802" label="Samfunnsodontologi: 802" />
<node id="803" label="Epidemiologi medisinsk og odontologisk statistikk: 803" />
<node id="804" label="Forebyggende medisin: 804" />
<node id="805" label="Medisinsk/odontologisk etikk, atferdsfag, historie: 805" />
<node id="806" label="Helsetjeneste- og helseadministrasjonsforskning: 806" />
<node id="807" label="Fysioterapi: 807" />
<node id="808" label="Sykepleievitenskap: 808" />
<node id="809" label="Yrkesmedisin: 809" />
<node id="810" label="Bedriftsmedisin: 810" />
<node id="811" label="Ernæring: 811" />
<node id="812" label="Samfunnsfarmasi: 812" />
<node id="813" label="Næringsmiddelhygiene: 813" />
<node id="829" label="Andre helsefag: 829" />
</isComposedBy>
</node>
<node id="830" label="Klinisk odontologiske fag: 830" >
<isComposedBy>
<node id="831" label="Konserverende tannpleie: 831" />
<node id="832" label="Protetikk og bitt funksjon: 832" />
<node id="833" label="Kjeveortopedi: 833" />
<node id="834" label="Barnetannpleie og kariesprofylakse: 834" />
<node id="835" label="Oral kirurgi: 835" />
<node id="835" label="Oral medisin: 835" />
<node id="836" label="Oral radiologi: 836" />
<node id="837" label="Periodonti: 837" />
<node id="849" label="Andre kliniske odontologiske fag: 849" />
</isComposedBy>
</node>
<node id="850" label="Idrettsmedisinske fag: 850" >
<isComposedBy>
<node id="851" label="Treningslære: 851" />
<node id="852" label="Bevegelseslære: 852" />
<node id="853" label="Doping/idrettsfarmakologi: 853" />
</isComposedBy>
</node>
</isComposedBy>
</node>
<node id="900" label="Landbruks- og Fiskerifag: 900">
<isComposedBy>
<node id="910" label="Landbruksfag: 910" >
<isComposedBy>
<node id="911" label="Planteforedling, hagebruk, plantevern, plantepatologi: 911" />
<node id="912" label="Husdyravl, oppdrett, forplantning: 912" />
<node id="913" label="Jordfag: 913" />
<node id="914" label="Naturressursforvaltning: 914" />
<node id="915" label="Skogbruk: 915" />
<node id="916" label="Landbruksteknologi: 916" />
<node id="918" label="Fôring: 918" />
<node id="919" label="Andre landbruksfag: 919" />
</isComposedBy>
</node>
<node id="920" label="Fiskerifag: 920" >
<isComposedBy>
<node id="921" label="Ressursbiologi: 921" />
<node id="922" label="Akvakultur: 922" />
<node id="923" label="Fiskehelse: 923" />
<node id="924" label="Fiskeriteknologi: 924" />
<node id="925" label="Fangst: 925" />
<node id="929" label="Andre fiskerifag: 929" />
</isComposedBy>
</node>
<node id="950" label="Klinisk veterinærmedisinske fag: 950" >
<isComposedBy>
<node id="951" label="Reproduksjon: 951" />
<node id="952" label="Obstetrikk: 952" />
<node id="953" label="Kirurgi: 953" />
<node id="954" label="Indremedisin: 954" />
</isComposedBy>
</node>
</isComposedBy>
</node>
</isComposedBy>
</node>

File diff suppressed because it is too large Load Diff

View File

@@ -507,6 +507,12 @@ webui.suggest.sender = A DSpace user
webui.suggest.recipient = colleague
#### Controlled Vocabulary Settings #####
# Enable or disable the controlled vocabulary add-on
# Warning: this feature is not compatible with WAI (it requires javascript to function)
#
# webui.controlledvocabulary.enable = true
#### Checksum Checker Settings ####
# Default dispatcher in case none specified
plugin.single.org.dspace.checker.BitstreamDispatcher=org.dspace.checker.SimpleDispatcher

View File

@@ -164,6 +164,7 @@ it, please enter the types and the actual numbers or codes below.</hint>
<input-type>twobox</input-type>
<hint> Enter appropriate subject keywords or phrases below. </hint>
<required></required>
<vocabulary>srsc</vocabulary>
</field>
<field>

View File

@@ -125,6 +125,25 @@ jsp.components.ldap-form.username-or-email = Username <br/>or Email address:
jsp.components.ldap-form.password = Password:
jsp.components.ldap-form.login.button = Log In
jsp.controlledvocabulary.controlledvocabulary.title = Subject Categories
jsp.controlledvocabulary.controlledvocabulary.trimbutton = Apply
jsp.controlledvocabulary.controlledvocabulary.clearbutton = Clear
jsp.controlledvocabulary.controlledvocabulary.closebutton = Close
jsp.controlledvocabulary.controlledvocabulary.trimmessage = Find a subject in the controlled vocabulary:
jsp.controlledvocabulary.controlledvocabularytag.noresults = No results
jsp.controlledvocabulary.controlledvocabulary.filter = Filter:
jsp.controlledvocabulary.controlledvocabulary.help-link = (Help on Subject Categories...)
jsp.controlledvocabulary.search.title = Subject Search
jsp.controlledvocabulary.search.heading = Subject Search
jsp.controlledvocabulary.search.on-page-help.para1 = Check the boxes next to the categories that you wish to search under, then hit "Search...". Categories can be expanded to refine the search terms, and as many categories can be selected as required.
jsp.controlledvocabulary.search.on-page-help.para2 = Filtering the list of categories will remove from the list below any categories that do not match the filter term. Expanding each category will show you which terms did match the filter.
jsp.controlledvocabulary.search.trimmessage = Find a subject in the controlled vocabulary:
jsp.controlledvocabulary.search.trimbutton = Apply
jsp.controlledvocabulary.search.clearbutton = Clear
jsp.controlledvocabulary.search.filter = Filter:
jsp.controlledvocabulary.search.searchbutton = Search...
jsp.controlledvocabulary.results.newsearch = Search other subject...
jsp.display-item.copyright = All items in DSpace are protected by copyright, with all rights reserved.
jsp.display-item.identifier =Please use this identifier to cite or link to this item:
jsp.display-item.license =Creative Commons License
@@ -530,6 +549,7 @@ jsp.layout.navbar-default.subjects = Subjects
jsp.layout.navbar-default.titles = Titles
jsp.layout.navbar-default.users = My DSpace
jsp.layout.navbar-default.users-authorized = <small>authorized users</small>
jsp.layout.navbar-default.subjectsearch = Subject Search
jsp.login.chooser.heading = Choose a Login Method
jsp.login.chooser.chooseyour = Choose one of these ways to login:
@@ -846,6 +866,7 @@ jsp.submit.edit-metadata.day = Day:
jsp.submit.edit-metadata.year = Year:
jsp.submit.edit-metadata.seriesname = Series Name
jsp.submit.edit-metadata.paperno = Report or Paper No.
jsp.submit.edit-metadata.controlledvocabulary = Subject Categories
jsp.submit.get-file-format.choose.button =Choose automatically-recognized type
jsp.submit.get-file-format.format =File Format:

View File

@@ -742,8 +742,100 @@ dstat-report-monthly
<p>The wording and layout of the email message is governed by the template file <code><i>[dspace]</i>/config/emails/suggest</code>. You may edit this file
to alter the language, layout, type, or amount of information contained in the email, but note that the values passed to the template are limited to those enumerated at the
top of the template file and represented in the body of the message with 'placeholders' {0}, {1}, etc. A general description of DSpace is included as
a footer to the email, which may be replaced with site-specific content.
a footer to the email, which may be replaced with site-specific content.</p>
<h2><a name="controlledvocabulary" id="controlledvocabulary">Configuring Controlled Vocabularies</a></h2>
<p>
DSpace now supports controlled vocabularies to confine the set of keywords that users can use
while describing items.
</p>
<p>
The need for a limited set of keywords is important since it eliminates the
ambiguity of a free description system, consequently simplifying the task of finding specific
items of information.
</p>
<p>
The controlled vocabulary add-on allows the user to choose from a defined set of keywords organised
in an tree (taxonomy) and then use these keywords to describe items while they are being submitted.
</p>
<p>
We have also developed a small search engine that displays the classification tree (or taxonomy)
allowing the user to select the branches that best describe the information that he/she seeks.
</p>
<p>
The taxonomies are described in XML following this (very simple) structure:
</p>
<code>
&lt;node id="acmccs98" label="ACMCCS98"&gt;<br/>
&nbsp; &lt;isComposedBy&gt;<br/>
&nbsp;&nbsp; &lt;node id="A." label="General Literature"&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;isComposedBy&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;node id="A.0" label="GENERAL"/&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;node id="A.1" label="INTRODUCTORY AND SURVEY"/&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp; ...<br/>
&nbsp;&nbsp;&nbsp; &lt;/isComposedBy&gt;<br/>
&nbsp;&nbsp; &lt;/node&gt;<br/>
&nbsp;&nbsp; ...<br/>
&nbsp; &lt;/isComposedBy&gt;<br/>
&lt;/node&gt;<br/>
</code>
<p>
Your are free to use any application you want to create your controlled vocabularies. A simple
text editor should be enough for small projects. Bigger projects will require more complex
tools. You may use Proteg&eacute; to create your taxonomies, save them as OWL and then use a
XML Stylesheet (XSLT) to transform your documents to the appropriate format. Future enhancements
to this add-on should make it compatible with standard schemas such as OWL or RDF.
</p>
<p>
In order to make DSpace compatible with WAI 2.0, the add-on is <b>turned off</b> by default
(the add-on relies strongly on Javascript to function).
It can be activated by setting the following property in <code>dspace.cfg</code>:
<p>
<code>
webui.controlledvocabulary.enable = true
</code>
</p>
<p>
New vocabularies should be placed in <code><i>[dspace]/config/controlled-vocabularies/</i></code> and must be
according to the structure described. A validation XML Schema can be downloaded <a href="controlledvocabulary.xsd">here</a>.
</p>
<p>
Vocabularies need to be associated with the correspondant DC metadata fields.
Edit the file <code><i>[dspace]/config/input-forms.xml</i></code> and place
a <code>"vocabulary"</code> tag under the <code>"field"</code> element that you
want to control. Set value of the <code>"vocabulary"</code> element to
the name of the file that contains the vocabulary, leaving out the extension
(the add-on will only load files with extension "*.xml").
For example:
</p>
<p>
<code>
&lt;field&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;dc-schema&gt;dc&lt;/dc-schema&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;dc-element&gt;subject&lt;/dc-element&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;dc-qualifier&gt;&lt;/dc-qualifier&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- An input-type of twobox MUST be marked as repeatable --&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;repeatable&gt;true&lt;/repeatable&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;label&gt;Subject Keywords&lt;/label&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;input-type&gt;twobox&lt;/input-type&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;hint&gt; Enter appropriate subject keywords or phrases below. &lt;/hint&gt;<br/>
&nbsp;&nbsp;&lt;required&gt;&lt;/required&gt;<br/>
<b>&nbsp;&nbsp;&lt;vocabulary&gt;nsi&lt;/vocabulary&gt;</b><br/>
&lt;/field&gt;<br/>
</code>
</p>
<p>
The following vocabularies are currently available by default:
</p>
<ul>
<!-- <li><strong>acmccs98-1.2.4</strong> - <em>acmccs98-1.2.4.xml</em> - ACM Computing Classification System</li> -->
<li><strong>nsi</strong> - <em>nsi.xml</em> - The Norwegian Science Index</li>
<li><strong>srsc</strong> - <em>srsc.xml</em> - Swedish Research Subject Categories</li>
</ul>
<h2><a name="checker">Checksum Checker</a></h2>
<p>There are two main aspects of the checksum checker's operation that can be configured. Firstly the strategy and duration of the checker's duration can be
@@ -848,6 +940,7 @@ bin/checker -L # Loops through the repository forever</pre>
<p>By default, these properties should go in dspace.cfg. By passing an argument to the -p option you can pass another properties file to the checker instead, for example: -</p>
<pre>bin/checker -lp temporaryRetentionPolicy.properties</pre>
>>>>>>> 1.18
<hr>
<address>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This Schema was created by the University of Minho <http://www.uminho.pt>, Department of Information Systems <http://www.dsi.uminho.pt>
for the Controlled-vocabulary Add-on of the HP/MIT's DSpace <http://www.dspace.org>.
For more information regarding this schema, please contact the authors:
Miguel Ferreira <mferreira@dsi.uminho.pt> and Ana Alice Baptista <analice@dsi.uminho.pt>;
or refer to the Web site http://dspace-dev.dsi.uminho.pt.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="node">
<xs:annotation>
<xs:documentation>Element that describes a concept</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="isComposedBy" minOccurs="0">
<xs:annotation>
<xs:documentation>Contains the children of this node.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="node" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="isRelatedTo" minOccurs="0">
<xs:annotation>
<xs:documentation>A list of related terms</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="node" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Link to an existing node</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="id" type="xs:IDREF" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="hasNote" minOccurs="0">
<xs:annotation>
<xs:documentation>A note related to this term</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="label" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -383,6 +383,18 @@
<servlet-class>org.dspace.app.webui.servlet.WorkspaceServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>controlledvocabulary</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.ControlledVocabularyServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>subject-search</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.ControlledVocabularySearchServlet</servlet-class>
</servlet>
<!-- Servlet Mappings -->
<servlet-mapping>
@@ -615,6 +627,17 @@
<url-pattern>/workspace</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>controlledvocabulary</servlet-name>
<url-pattern>/controlledvocabulary</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>subject-search</servlet-name>
<url-pattern>/subject-search</url-pattern>
</servlet-mapping>
<!-- Icon MIME type -->
<mime-mapping>
<extension>ico</extension>

View File

@@ -361,4 +361,46 @@
</attribute>
</tag>
<tag>
<name>controlledvocabulary</name>
<tagclass>org.dspace.app.webui.jsptag.ControlledVocabularyTag</tagclass>
<bodycontent>empty</bodycontent>
<info>
Lays out a html tree with a set of controlled vocabularies.
This tag receives 3 possible parameters:
- filter
A filter specification to prune branches of the loaded vocabularies
- allowMultipleSelection
Specifies if we want to be able the select multiple terms
from the taxonomy. This will diplay checkboxes close to the
vocabulary terms.
- vocabulary
The name of the vocabulary to be displayed. If no vocabulary
is provided, all existing taxonomies will be rendered and
displayed.
</info>
<attribute>
<name>filter</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>allowMultipleSelection</name>
<required>no</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>vocabulary</name>
<required>no</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>

View File

@@ -0,0 +1,177 @@
<%--
- controlledvocabulary.jsp
-
- Version: $Revision$
-
- Date: $Date$
-
- Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
- Institute of Technology. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Hewlett-Packard Company nor the name of the
- Massachusetts Institute of Technology nor the names of their
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
--%>
<%--
-- This jsp is reponsible for displaying controlled vocabularies in a
-- popup window during the description phases of submitted items.
-- This jsp holds the content of that popup window.
--%>
<%@ page language="java" contentType="text/html;charset=iso-8859-1" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<html>
<head>
<title><fmt:message key="jsp.controlledvocabulary.controlledvocabulary.title"/></title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon">
<link type="text/css" rel="stylesheet" href="<%= request.getContextPath() %>/styles.css.jsp">
<style type="text/css">
body {background-color: #ffffff}
</style>
<SCRIPT LANGUAGE="JavaScript" src="<%= request.getContextPath() %>/utils.js"></script>
<script type="text/javascript">
<%
if(request.getParameter("ID")!=null) {
session.setAttribute("controlledvocabulary.ID", request.getParameter("ID"));
}
%>
<%-- This function is not included in scripts file
because it has to be changed dynamically --%>
function sendBackToParentWindow(node) {
var resultPath = "";
var firstNode = 1;
var pathSeparator = "::";
while(node != null) {
if(firstNode == 1) {
resultPath = getTextValue(node);
firstNode = 0;
} else {
resultPath = getTextValue(node) + pathSeparator + resultPath;
}
node = getParentTextNode(node);
}
window.opener.document.edit_metadata.<%=session.getAttribute("controlledvocabulary.ID")%>.value= resultPath;
self.close();
return false;
}
</script>
</header>
<body>
<%
String filter = (String)session.getAttribute("controlledvocabulary.filter");
filter = filter==null?"":filter;
String ID = (String)session.getAttribute("controlledvocabulary.ID");
if(request.getParameter("vocabulary")!=null) {
session.setAttribute("controlledvocabulary.vocabulary", request.getParameter("vocabulary"));
}
String vocabulary = (String)session.getAttribute("controlledvocabulary.vocabulary");
%>
<br/>
<div style="margin-left:10px">
<fmt:message key="jsp.controlledvocabulary.controlledvocabulary.trimmessage"/>
<table>
<tr>
<td>
<fmt:message key="jsp.controlledvocabulary.controlledvocabulary.filter"/>
</td>
<td>
<form name="filterVocabulary"
method="post"
action="<%= request.getContextPath()%>/controlledvocabulary">
<input style="border-width:1px;border-style:solid;" name="filter" type="text" id="filter" size="35" value="<%= filter %>">
<input type="submit" name="submit" value="<fmt:message key='jsp.controlledvocabulary.controlledvocabulary.trimbutton'/>">
<input type="hidden" name="ID" value="<%= ID %>">
<input type="hidden" name="action" value="filter">
<input type="hidden" name="callerUrl" value="<%= request.getContextPath()%>/controlledvocabulary/controlledvocabulary.jsp">
</form>
</td>
<td>
<form name="clearFilter" method="post" action="<%= request.getContextPath() %>/controlledvocabulary">
<input type="hidden" name="ID" value="<%= ID %>">
<input type="hidden" name="filter" value=""/>
<input type="submit" name="submit" value="<fmt:message key='jsp.controlledvocabulary.controlledvocabulary.clearbutton'/>"/>
<input type="hidden" name="action" value="filter"/>
<input type="hidden" name="callerUrl" value="<%= request.getContextPath()%>/controlledvocabulary/controlledvocabulary.jsp">
</form>
</td>
</tr>
<tr>
<td colspan="3" class="submitFormHelpControlledVocabularies">
<object><dspace:popup page="/help/index.html#controlledvocabulary"><fmt:message key="jsp.controlledvocabulary.controlledvocabulary.help-link"/></dspace:popup></object>
</td>
</tr>
</table>
</div>
<h1><fmt:message key="jsp.controlledvocabulary.controlledvocabulary.title"/></h1>
<dspace:controlledvocabulary filter="<%= filter %>" vocabulary="<%= vocabulary %>"/>
<br/>
<center>
<input type="BUTTON" name="cancel" onClick="window.close();" value="<fmt:message key="jsp.controlledvocabulary.controlledvocabulary.closebutton"/>" >
</center>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<%--
- controlledvocabularyTag.jsp
-
- Version: $Revision$
-
- Date: $Date$
-
- Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
- Institute of Technology. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Hewlett-Packard Company nor the name of the
- Massachusetts Institute of Technology nor the names of their
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
--%>
<%--
-- This custom tag is used to display an HTML version of a
-- controlled vocabulary.
-- This jsp is called by ControlledVocabularyTag.java
--%>
<%@ page language="java" errorPage="/internal-error" contentType="text/html;charset=UTF-8" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
<%
String vocabulariesHTML = (String)session.getAttribute("controlledvocabulary.vocabularyHTML");
vocabulariesHTML = (vocabulariesHTML == null || vocabulariesHTML.length() == 0)?
LocaleSupport.getLocalizedMessage(pageContext,"jsp.controlledvocabulary.controlledvocabularytag.noresults"):
vocabulariesHTML;
%>
<%= vocabulariesHTML %>

View File

@@ -0,0 +1,230 @@
<%--
- results.jsp
-
- Version: $Revision$
-
- Date: $Date$
-
- Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
- Institute of Technology. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Hewlett-Packard Company nor the name of the
- Massachusetts Institute of Technology nor the names of their
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
--%>
<%--
- Display the results of a subject search
-
- Attributes to pass in:
-
- community - pass in if the scope of the search was a community
- or a collection in this community
- collection - pass in if the scope of the search was a collection
- community.array - if the scope of the search was "all of DSpace", pass
- in all the communities in DSpace as an array to
- display in a drop-down box
- collection.array - if the scope of a search was a community, pass in an
- array of the collections in the community to put in
- the drop-down box
- items - the results. An array of Items, most relevant first
- communities - results, Community[]
- collections - results, Collection[]
-
- query - The original query
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"
prefix="fmt" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="org.dspace.content.Community" %>
<%@ page import="org.dspace.content.Collection" %>
<%@ page import="org.dspace.content.Item" %>
<%@ page import="org.dspace.search.QueryResults" %>
<%
// Get the attributes
Community community = (Community ) request.getAttribute("community" );
Collection collection = (Collection ) request.getAttribute("collection");
Community[] communityArray = (Community[] ) request.getAttribute("community.array");
Collection[] collectionArray = (Collection[]) request.getAttribute("collection.array");
Item [] items = (Item[] )request.getAttribute("items");
Community [] communities = (Community[] )request.getAttribute("communities");
Collection[] collections = (Collection[])request.getAttribute("collections");
String query = (String) request.getAttribute("query");
QueryResults qResults = (QueryResults)request.getAttribute("queryresults");
int pageTotal = ((Integer)request.getAttribute("pagetotal" )).intValue();
int pageCurrent = ((Integer)request.getAttribute("pagecurrent")).intValue();
int pageLast = ((Integer)request.getAttribute("pagelast" )).intValue();
int pageFirst = ((Integer)request.getAttribute("pagefirst" )).intValue();
%>
<dspace:layout titlekey="jsp.search.results.title">
<%-- <h1>Search Results</h1> --%>
<h1><fmt:message key="jsp.search.results.title"/></h1>
<% if( qResults.getErrorMsg()!=null )
{
%>
<p align="center" class="submitFormWarn"><%= qResults.getErrorMsg() %></p>
<%
}
else if( qResults.getHitCount() == 0 )
{
%>
<%-- <p align="center">Search produced no results.</p> --%>
<p align="center"><fmt:message key="jsp.search.general.noresults"/></p>
<%
}
else
{
%>
<%-- <p align="center">Results <//%=qResults.getStart()+1%>-<//%=qResults.getStart()+qResults.getHitHandles().size()%> of --%>
<p align="center"><fmt:message key="jsp.search.results.results">
<fmt:param><%=qResults.getStart()+1%></fmt:param>
<fmt:param><%=qResults.getStart()+qResults.getHitHandles().size()%></fmt:param>
<fmt:param><%=qResults.getHitCount()%></fmt:param>
</fmt:message></p>
<% } %>
<% if (communities.length > 0 ) { %>
<%-- <h3>Community Hits:</h3> --%>
<h3><fmt:message key="jsp.search.results.comhits"/></h3>
<dspace:communitylist communities="<%= communities %>" />
<% } %>
<% if (collections.length > 0 ) { %>
<br/>
<%-- <h3>Collection hits:</h3> --%>
<h3><fmt:message key="jsp.search.results.colhits"/></h3>
<dspace:collectionlist collections="<%= collections %>" />
<% } %>
<% if (items.length > 0) { %>
<br/>
<%-- <h3>Item hits:</h3> --%>
<h3><fmt:message key="jsp.search.results.itemhits"/></h3>
<dspace:itemlist items="<%= items %>" />
<% } %>
<p align="center">
<%
// retain scope when navigating result sets
String searchScope = "";
if (community == null && collection == null) {
searchScope = "";
} else if (collection == null) {
searchScope = "/handle/" + community.getHandle();
} else {
searchScope = "/handle/" + collection.getHandle();
}
// create the URLs accessing the previous and next search result pages
String prevURL = request.getContextPath()
+ searchScope
+ "/simple-search?query="
+ URLEncoder.encode(query)
+ "&amp;start=";
String nextURL = prevURL;
prevURL = prevURL
+ (pageCurrent-2) * qResults.getPageSize();
nextURL = nextURL
+ (pageCurrent) * qResults.getPageSize();
if (pageFirst != pageCurrent)
{
%><a href="<%= prevURL %>"><fmt:message key="jsp.search.general.previous" /></a><%
};
for( int q = pageFirst; q <= pageLast; q++ )
{
String myLink = "<a href=\""
+ request.getContextPath()
+ searchScope
+ "/simple-search?query="
+ URLEncoder.encode(query)
+ "&amp;start=";
if( q == pageCurrent )
{
myLink = "" + q;
}
else
{
myLink = myLink
+ (q-1) * qResults.getPageSize()
+ "\">"
+ q
+ "</a>";
}
%>
<%= myLink %>
<%
}
if (pageTotal > pageCurrent)
{
%><a href="<%= nextURL %>"><fmt:message key="jsp.search.general.next" /></a><%
}
%>
<div align="center">
<a href="<%= request.getContextPath() %>/subject-search">
<fmt:message key="jsp.controlledvocabulary.results.newsearch"/>
</a>
</div>
</p>
</dspace:layout>

View File

@@ -0,0 +1,115 @@
<%--
- search.jsp
-
- Version: $Revision$
-
- Date: $Date$
-
- Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
- Institute of Technology. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Hewlett-Packard Company nor the name of the
- Massachusetts Institute of Technology nor the names of their
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
--%>
<%--
This jsp shows a search form with a controlled vocabulary tree.
The branches of the tree can be expanded/collapsed by means of javascript.
To be WAI compatible a new version of this jsp must be developed.
The add-on may be turn off in dspace.cfg
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String filter = (String)(session.getAttribute("conceptsearch.filter")
!= null?session.getAttribute("conceptsearch.filter"):"");
%>
<dspace:layout locbar="nolink" title='<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.title") %>'>
<h1><fmt:message key="jsp.controlledvocabulary.search.heading"/></h1>
<div align="right">
<dspace:popup page="/help/index.html#subjectsearch"><fmt:message key="jsp.help"/></dspace:popup>
</div>
<p><fmt:message key="jsp.controlledvocabulary.search.on-page-help.para1"/></p>
<p><fmt:message key="jsp.controlledvocabulary.search.on-page-help.para2"/></p>
<div style="margin-left:20px">
<div style="margin-left:20px">
<fmt:message key="jsp.controlledvocabulary.search.trimmessage"/>
<table>
<tr>
<td valign="middle">
<fmt:message key="jsp.controlledvocabulary.controlledvocabulary.filter"/>
</td>
<td>
<form name="filterVocabulary" method="post" action="<%= request.getContextPath() %>/subject-search">
<input style="border-width:1px;border-style:solid;"
name="filter" type="text" id="filter"
size="15" value="<%= filter %>"
title='<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimmessage") %>'>
<input type="submit" name="submit" value="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimbutton") %>">
<input type="hidden" name="action" value="filter">
</form>
</td>
<td>
<form name="clearFilter" method="post" action="<%= request.getContextPath() %>/subject-search">
<input type="hidden" name="filter" value=""/>
<input type="submit" name="submit" value="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.clearbutton") %>"/>
<input type="hidden" name="action" value="filter"/>
</form>
</td>
</tr>
</table>
</div>
<form action="<%= request.getContextPath() %>/subject-search" method="post">
<dspace:controlledvocabulary filter="<%= filter %>" allowMultipleSelection="true"/>
<br/>
<input type="hidden" name="action" value="search">
<input type="submit" name="submit" value="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.searchbutton") %>">
</form>
</div>
</dspace:layout>

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This stylesheet converts taxonomies from their XML representation to
an HTML tree. Its basically a preety-printer.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ************************************ -->
<xsl:output method="html" version="1.0" indent="yes" encoding="utf-8"/>
<!-- ************************************ -->
<xsl:param name="allowMultipleSelection"/>
<xsl:param name="contextPath"/>
<!--<xsl:variable name="allowMultipleSelection">no</xsl:variable> -->
<!-- ************************************ -->
<xsl:template match="/">
<ul class="controlledvocabulary">
<xsl:apply-templates/>
</ul>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="isComposedBy">
<xsl:apply-templates select="node"/>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="node">
<li>
<!--** place icon ** -->
<xsl:choose>
<xsl:when test="./isComposedBy/node">
<img class="controlledvocabulary">
<xsl:attribute name="src"><xsl:value-of select="$contextPath"/>/image/controlledvocabulary/p.gif</xsl:attribute>
<xsl:attribute name="onClick">ec(this, '<xsl:value-of select="$contextPath"/>');</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<img class="dummyclass">
<xsl:attribute name="src"><xsl:value-of select="$contextPath"/>/image/controlledvocabulary/f.gif</xsl:attribute>
</img>
</xsl:otherwise>
</xsl:choose>
<!--** place check box if necessary** -->
<xsl:choose>
<xsl:when test="$allowMultipleSelection='yes'">
<xsl:variable name="nodePath">
<xsl:call-template name="getNodePath"/>
</xsl:variable>
<xsl:variable name="checkBoxName">cb_<xsl:value-of select="generate-id()"/>
</xsl:variable>
<input class="controlledvocabulary" type="checkbox" name="{$checkBoxName}" value="{$nodePath}"/>
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:otherwise>
<a class="value" onClick="javascript: i(this);" href="javascript:void(null);">
<xsl:value-of select="@label"/>
</a>
</xsl:otherwise>
</xsl:choose>
<!--** render children ** -->
<xsl:if test="./isComposedBy/node">
<ul class="controlledvocabulary">
<xsl:apply-templates select="isComposedBy"/>
</ul>
</xsl:if>
</li>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="text"/>
<!-- ************************************ -->
<xsl:template match="text()" priority="-1"/>
<!-- ************************************ -->
<xsl:template name="getNodePath">
<xsl:for-each select="ancestor::node"><xsl:value-of select="@label"/>::</xsl:for-each><xsl:value-of select="@label"/>
</xsl:template>
<!-- ************************************ -->
</xsl:stylesheet>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This stylesheet prunnes out all the branches of
the taxonomy that don't instanciate with the param "filter", i.e. tha term
provided as parameter does not exist in any of its children.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ************************************ -->
<xsl:output method="xml" version="1.0" indent="yes" encoding="utf-8"/>
<!-- ************************************ -->
<xsl:param name="filter"/>
<!-- <xsl:variable name="filter">programming</xsl:variable> -->
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<!-- ************************************ -->
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="node">
<xsl:choose>
<xsl:when test="descendant-or-self::node[contains(translate(@label,$lcletters,$ucletters), translate($filter,$lcletters,$ucletters))]">
<node>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="label"><xsl:value-of select="normalize-space(@label)"/></xsl:attribute>
<xsl:apply-templates/>
</node>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="isComposedBy">
<xsl:choose>
<xsl:when test="descendant-or-self::node[contains(translate(@label,$lcletters,$ucletters), translate($filter,$lcletters,$ucletters))]">
<isComposedBy>
<xsl:apply-templates/>
</isComposedBy>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ************************************ -->
<xsl:template match="text()" priority="-1"/>
<!-- ************************************ -->
</xsl:stylesheet>

View File

@@ -19,6 +19,7 @@
<h5><a href="#browse">Browse</a></h5>
<h5><a href="#search">Search</a></h5>
<h5><a href="#advanced">Advanced Search</a></h5>
<h5><a href="#subjectsearch">Subject Category Search</a></h5>
<h5><a href="#communities">Communities</a></h5>
<h5><a href="#collections">Collections</a></h5>
<h5><a href="#login">Sign on to DSpace</a></h5>
@@ -198,6 +199,34 @@ order and allows you to see the subcommunities and collections within each commu
input boxes in order. If you leave the first one blank your search will not
work. </strong></p>
<hr />
<table>
<tr>
<td class="leftAlign"><a name="subjectsearch"></a><strong>SUBJECT CATEGORY SEARCH</strong></td>
<td class="rightAlign"><a href="#contents">top</a></td>
</tr>
</table>
<p>A controlled vocabulary is a set of terms which form a dictionary of descriptions
of particular types of content or subject matter. These are maintained by
standards bodies in order to standardise the way that similar materials are
categorised in archives. This aids searching by increasing the likelihood that
the relevant materials will be returned by the user's search.</p>
<p>Filtering the category list will remove from the list any terms which do not
match the filter. The remaining terms are any category or sub category which
contains the filter term anywhere in the heirarchy. Expanding each category
will show you which terms (or sub terms) did match the filter.</p>
<p>To search the archive items by the subject category, check as many boxes next
to the categories as necessary, before clicking "Search...". The search will
return all items that either match the categories selected exactly, or which
are categorised underneath a higher level category. Clicking on the "+" next
to the category will expand the tree to show you what refinements are available
for your selected category.</p>
<hr/>
<table>
<tr>
<td class="leftAlign"><a name="communities"></a><strong>COMMUNITIES</strong></td>
@@ -228,6 +257,7 @@ order and allows you to see the subcommunities and collections within each commu
entry page displaying information, news and links reflecting the interests of
that community, as well as a descriptive list of collections within the community.</p>
<hr />
<table>
<tr>
<td class="leftAlign"><a name="collections"></a><strong>COLLECTIONS</strong></td>
@@ -495,6 +525,39 @@ order and allows you to see the subcommunities and collections within each commu
<p>Click on the &quot;next&quot;
button to proceed, or &quot;cancel/save&quot; button to stop and save or cancel
your submission.</p>
<hr/>
<table>
<tr>
<td class="leftAlign"><a name="controlledvocabulary"></a><strong>SUBMIT: Controlled Vocabulary</strong></td>
<td class="rightAlign"><a href="#submit">top of submit</a></td>
<td class="rightAlign"><a href="#contents">top</a></td>
</tr>
</table>
<p>A controlled vocabulary is a set of terms which form a dictionary of descriptions
of particular types of content or subject matter. These are maintained by
standards bodies in order to standardise the way that similar materials are
categorised in archives.</p>
<p>Accurately categorising material using a controlled vocabulary increases the
likelihood that relevant results will be returned to users when searching
individual or multiple archives.</p>
<p>To enter a controlled vocabulary term in the form, select "Subject Categories"
from underneath the input field. This will open a window containing the
available vocabularies. You may filter the vocabulary lists as described above
in order to find the terms most relevant to your submission. Once you have found
the term that you wish to enter, simply click on it, and it will be
automatically entered into the submission form and the popup window will close.
You may add as many subject category terms as you like into the form. Use
"Add More" on the right to generate more input boxes.</p>
<p>Filtering the category list will remove from the list any terms which do not
match the filter. The remaining terms are any category or sub category which
contains the filter term anywhere in the heirarchy. Expanding each category
will show you which terms (or sub terms) did match the filter.</p>
<hr/>
<table>
@@ -558,6 +621,8 @@ order and allows you to see the subcommunities and collections within each commu
for each item, and click on the &quot;next&quot; button to proceed.</p>
<hr />
<hr/>
<table>
<tr>
<td class="leftAlign"><a name="formats"></a><strong>SUBMIT: File Formats</strong></td>

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

View File

@@ -40,13 +40,13 @@
<%--
- Default navigation bar
--%>
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
@@ -54,6 +54,8 @@
<%@ page import="org.dspace.content.Collection" %>
<%@ page import="org.dspace.content.Community" %>
<%@ page import="org.dspace.eperson.EPerson" %>
<%@ page import="org.dspace.core.ConfigurationManager" %>
<%
// Is anyone logged in?
@@ -106,6 +108,14 @@
<%-- <input type="text" name="query" id="tequery" size="10"/><input type=image border="0" src="<%= request.getContextPath() %>/image/search-go.gif" name="submit" alt="Go" value="Go"/> --%>
<input type="text" name="query" id="tequery" size="8"/><input type="submit" name="submit" value="<fmt:message key="jsp.layout.navbar-default.go"/>" />
<br/><a href="<%= request.getContextPath() %>/advanced-search"><fmt:message key="jsp.layout.navbar-default.advanced"/></a>
<%
if (ConfigurationManager.getBooleanProperty("webui.controlledvocabulary.enable"))
{
%>
<br/><a href="<%= request.getContextPath() %>/subject-search"><fmt:message key="jsp.layout.navbar-default.subjectsearch"/></A>
<%
}
%>
</td>
</tr>
</table>

View File

@@ -330,6 +330,7 @@ UL { font-family: "verdana", "Arial", "Helvetica", sans-serif;
font-size: 8pt;
text-align: center }
.submitFormWarn { margin-left: 10px;
margin-right: 10px;
font-family: "verdana", "Arial", "Helvetica", sans-serif;
@@ -588,3 +589,33 @@ UL { font-family: "verdana", "Arial", "Helvetica", sans-serif;
.help td.leftAlign{font-size:10pt;}
.help td.rightAlign{text-align:right;
font-size:10pt;}
<%-- The following rules are used by the controlled-vocabulary add-on --%>
ul.controlledvocabulary {
list-style-type:none; }
.controlledvocabulary ul li ul {
list-style-type:none;
display:none; }
input.controlledvocabulary {
border:0px; }
img.controlledvocabulary {
margin-right:8px ! important;
margin-left:11px ! important;
cursor:hand; }
.submitFormHelpControlledVocabularies {
margin-left: 10px;
margin-right: 10px;
font-family: "verdana", "Arial", "Helvetica", sans-serif;
font-size: 8pt;
text-align: left; }
.controlledVocabularyLink {
font-family: "verdana", "Arial", "Helvetica", sans-serif;
font-size: 8pt; }

View File

@@ -169,3 +169,118 @@ function removeSelected(sourceList)
}
}
}
//******************************************************
// Functions used by controlled vocabulary add-on
// There might be overlaping with existing functions
//******************************************************
function expandCollapse(node, contextPath) {
node = node.parentNode;
var childNode = (node.getElementsByTagName("ul"))[0];
if(!childNode) return false;
var image = node.getElementsByTagName("img")[0];
if(childNode.style.display != "block") {
childNode.style.display = "block";
image.src = contextPath + "/image/controlledvocabulary/m.gif";
} else {
childNode.style.display = "none";
image.src = contextPath + "/image/controlledvocabulary/p.gif";
}
return false;
}
function getAnchorText(ahref) {
if(isMicrosoft()) return ahref.childNodes.item(0).nodeValue;
else return ahref.text;
}
function getTextValue(node) {
if(node.nodeName == "A") {
return getAnchorText(node);
} else {
return "";
}
}
function getParentTextNode(node) {
var parentNode = node.parentNode.parentNode.parentNode;
var children = parentNode.childNodes;
var textNode;
for(var i=0; i< children.length; i++) {
var child = children.item(i);
if(child.className == "value") {
return child;
}
}
return null;
}
function ec(node, contextPath) {
expandCollapse(node, contextPath);
return false;
}
function i(node) {
return sendBackToParentWindow(node);
}
function getChildrenByTagName(rootNode, tagName) {
var children = rootNode.childNodes;
var result = new Array(0);
if(children == null) return result;
for(var i=0; i<children.length; i++) {
if(children[i].tagName == tagName) {
var elementArray = new Array(1);
elementArray[0] = children[i];
result = result.concat(elementArray);
}
}
return result;
}
function popUp(URL) {
var page;
page = window.open(URL, 'controlledvocabulary', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=450');
}
function isNetscape(v) {
return isBrowser("Netscape", v);
}
function isMicrosoft(v) {
return isBrowser("Microsoft", v);
}
function isMicrosoft() {
return isBrowser("Microsoft", 0);
}
function isBrowser(b,v) {
browserOk = false;
versionOk = false;
browserOk = (navigator.appName.indexOf(b) != -1);
if (v == 0) versionOk = true;
else versionOk = (v <= parseInt(navigator.appVersion));
return browserOk && versionOk;
}

View File

@@ -0,0 +1,402 @@
/*
* ControlledVocabularyTag.java
*
* Version: $Revision$
*
* Date: $Date$
*
* Copyright (c) 2002, Hewlett-Packard Company and Massachusetts Institute of
* Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: -
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. - Redistributions in binary
* form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided
* with the distribution. - Neither the name of the Hewlett-Packard Company nor
* the name of the Massachusetts Institute of Technology nor the names of their
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.dspace.app.webui.jsptag;
import java.io.File;
import java.io.FilenameFilter;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.log4j.Logger;
import org.dspace.app.webui.util.XMLUtil;
import org.dspace.core.ConfigurationManager;
import org.w3c.dom.Document;
/**
* A Tag to load and display controlled vocabularies
*
* @author Miguel Ferreira
* @version $Revision$
*
*/
public class ControlledVocabularyTag extends TagSupport
{
// path to the jsp that outputs the results of this tag
private static final String CONTROLLEDVOCABULARY_JSPTAG = "/controlledvocabulary/controlledvocabularyTag.jsp";
// the log
private static Logger log = Logger.getLogger(ControlledVocabularyTag.class);
// a tag attribute that contains the words used to trim the vocabulary tree
private String filter;
// a tag attribute that activates multiple selection of vocabulary terms
private boolean allowMultipleSelection;
// a tag attribute that specifies the vocabulary to be displayed
private String vocabulary;
// an hashtable containing all the loaded vocabularies
public Hashtable controlledVocabularies;
/**
* Process tag
*/
public int doStartTag() throws JspException
{
HttpServletRequest request = (HttpServletRequest) pageContext
.getRequest();
String vocabulariesPath = ConfigurationManager
.getProperty("dspace.dir")
+ "/config/controlled-vocabularies/";
String addonBaseDirectory = pageContext.getServletContext()
.getRealPath("")
+ "/controlledvocabulary/";
String vocabularyPrunningXSLT = addonBaseDirectory
+ "vocabularyprune.xsl";
String controlledVocabulary2HtmlXSLT = addonBaseDirectory
+ "vocabulary2html.xsl";
// Load vocabularies on startup
controlledVocabularies = (Hashtable) pageContext.getServletContext()
.getAttribute("controlledvocabulary.controlledVocabularies");
if (controlledVocabularies == null)
{
controlledVocabularies = loadControlledVocabularies(vocabulariesPath);
pageContext.getServletContext().setAttribute(
"controlledvocabulary.controlledVocabularies",
controlledVocabularies);
}
try
{
Hashtable prunnedVocabularies = needsFiltering() ? filterVocabularies(
controlledVocabularies, vocabularyPrunningXSLT)
: controlledVocabularies;
String html = "";
if (vocabulary != null && !vocabulary.equals(""))
{
html = renderVocabularyAsHTML((Document) prunnedVocabularies
.get(vocabulary + ".xml"),
controlledVocabulary2HtmlXSLT,
isAllowMultipleSelection(), request.getContextPath());
}
else
{
html = renderVocabulariesAsHTML(prunnedVocabularies,
controlledVocabulary2HtmlXSLT,
isAllowMultipleSelection(), request.getContextPath());
}
request.getSession().setAttribute(
"controlledvocabulary.vocabularyHTML", html);
pageContext.include(CONTROLLEDVOCABULARY_JSPTAG);
}
catch (Exception e)
{
log.warn("Exception", e);
}
return SKIP_BODY;
}
/**
* End processing tag
*/
public int doEndTag()
{
return EVAL_PAGE;
}
/**
* Do we gave a filter to apply to the controlled vocabularies?
*
* @return true if a filter was provided.
*/
private boolean needsFiltering()
{
return getFilter() != null && getFilter().length() > 0;
}
/**
* Converts a XML Vocabulary to a HTML tree
*
* @param vocabularies
* A hashtable with all the XML taxonomies/vocabularies loaded as
* values
* @param xslt
* the filename of the stylesheet to apply the XML taxonomies
* @param allowMultipleSelection
* include checkboxes next to the taxonomy terms
* @param contextPath
* The context path
* @return the HTML that represents the vocabularies
*/
private String renderVocabulariesAsHTML(Hashtable vocabularies,
String xslt, boolean allowMultipleSelection, String contextPath)
{
String result = "";
Iterator iter = vocabularies.values().iterator();
while (iter.hasNext())
{
Document controlledVocabularyXML = (Document) iter.next();
result += renderVocabularyAsHTML(controlledVocabularyXML, xslt,
allowMultipleSelection, contextPath);
}
return result;
}
/**
* Applies a filter to the vocabularies, i.e. it prunes the trees by
* removing all the branches that do not contain the words in the filter.
*
* @param vocabularies
* A hashtable with all the XML taxonomies/vocabularies loaded as
* values
* @param vocabularyPrunningXSLT
* the filename of the stylesheet that trimms the taxonomies
* @return An hashtable with all the filtered vocabularies
*/
private Hashtable filterVocabularies(Hashtable vocabularies,
String vocabularyPrunningXSLT)
{
Hashtable prunnedVocabularies = new Hashtable();
Enumeration enumeration = vocabularies.keys();
while (enumeration.hasMoreElements())
{
String controlledVocabularyKey = (String) enumeration.nextElement();
Document controlledVocabulary = (Document) vocabularies
.get(controlledVocabularyKey);
prunnedVocabularies.put(controlledVocabularyKey, filterVocabulary(
controlledVocabulary, vocabularyPrunningXSLT, getFilter()));
}
return prunnedVocabularies;
}
/**
* Renders a taxonomy as HTML by applying a stylesheet.
*
* @param vocabulary
* The XML document representing a taxonomy
* @param controlledVocabulary2HtmlXSLT
* The filename of the stylesheet that converts the taxonomy to
* HTML
* @param allowMultipleSelection
* include checkboxes next to the taxonomy terms
* @param contextPath
* The context path
* @return the provided taxonomy as HTML.
*/
public String renderVocabularyAsHTML(Document vocabulary,
String controlledVocabulary2HtmlXSLT,
boolean allowMultipleSelection, String contextPath)
{
if (vocabulary == null)
return "";
String result = "";
try
{
Hashtable parameters = new Hashtable();
parameters.put("allowMultipleSelection",
allowMultipleSelection ? "yes" : "no");
parameters.put("contextPath", contextPath);
result = XMLUtil.transformDocumentAsString(vocabulary, parameters,
controlledVocabulary2HtmlXSLT);
}
catch (Exception e)
{
e.printStackTrace();
}
return result;
}
/**
* Applies a filter to the provided vocabulary, i.e. it prunes the tree by
* removing all the branches that do not contain the words in the filter.
*
* @param vocabulary
* The vocabulary to be trimmed
* @param vocabularyPrunningXSLT
* The filename of the stylesheet that trims the vocabulary
* @param filter
* The filter to be applied
* @return The trimmed vocabulary.
*/
public Document filterVocabulary(Document vocabulary,
String vocabularyPrunningXSLT, String filter)
{
if (vocabulary == null)
return null;
try
{
Hashtable parameters = new Hashtable();
parameters.put("filter", filter);
Document prunnedVocabulary = XMLUtil.transformDocument(vocabulary,
parameters, vocabularyPrunningXSLT);
return prunnedVocabulary;
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
}
/**
* Loads into memory all the vocabularies found in the given directory. All
* files with .xml extension are considered to be controlled vocabularies.
*
* @param directory
* where the files are positioned
* @return an hashtable with the filenames of the vocabularies as keys and
* the XML documents representing the vocabularies as values.
*/
private static Hashtable loadControlledVocabularies(String directory)
{
Hashtable controlledVocabularies = new Hashtable();
File dir = new File(directory);
FilenameFilter filter = new FilenameFilter()
{
public boolean accept(File dir, String name)
{
return name.endsWith(".xml");
}
};
String[] children = dir.list(filter);
if (children != null && children.length > 0)
{
for (int i = 0; i < children.length; i++)
{
String filename = children[i];
try
{
Document controlledVocabulary = XMLUtil.loadXML(directory
+ filename);
controlledVocabularies.put(filename, controlledVocabulary);
log.warn("Loaded vocabulary: " + filename);
}
catch (Exception e)
{
log.warn("Failed to load vocabulary from " + filename, e);
}
}
}
else
{
log.warn("Could not find any vocabularies...");
}
return controlledVocabularies;
}
/**
* Gets the filter provided as parameter to the tag
*
* @return the filter
*/
public String getFilter()
{
return filter;
}
/**
* Sets the filter
*
* @param filter
* the filter
*/
public void setFilter(String filter)
{
this.filter = filter;
}
/**
* Returns the value of the multiple selection parameter
*
* @return true if the multiple selection was selected
*/
public boolean isAllowMultipleSelection()
{
return allowMultipleSelection;
}
/**
* Defines if we want to be able to select multiple terms of the taxonomy
*
* @param allowMultipleSelection
* true if we want to be able to select more than on term
*/
public void setAllowMultipleSelection(boolean allowMultipleSelection)
{
this.allowMultipleSelection = allowMultipleSelection;
}
/**
* Gets the name of the vocabulary to be displayed
*
* @return the name of the vocabulary
*/
public String getVocabulary()
{
return vocabulary;
}
/**
* Sets the name of the vocabulary to be displayed. If no name is provided,
* all vocabularies loaded will be rendered to the output
*
* @param vocabulary
* the name of the vocabulary to be selected
*/
public void setVocabulary(String vocabulary)
{
this.vocabulary = vocabulary;
}
}

View File

@@ -0,0 +1,390 @@
/*
* ConceptSearchServlet.java
*
* Version: $Revision$
*
* Date: $Date$
*
* Copyright (c) 2002, Hewlett-Packard Company and Massachusetts Institute of
* Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: -
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. - Redistributions in binary
* form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided
* with the distribution. - Neither the name of the Hewlett-Packard Company nor
* the name of the Massachusetts Institute of Technology nor the names of their
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.dspace.app.webui.servlet;
import java.io.IOException;
import java.net.URLEncoder;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.dspace.app.webui.util.JSPManager;
import org.dspace.app.webui.util.UIUtil;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.Collection;
import org.dspace.content.Community;
import org.dspace.content.Item;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.core.LogManager;
import org.dspace.handle.HandleManager;
import org.dspace.search.DSQuery;
import org.dspace.search.QueryArgs;
import org.dspace.search.QueryResults;
/**
* Servlet that provides funcionality for searching the repository using a
* controlled vocabulary as a basis for selecting the search keywords.
*
* @author Miguel Ferreira
* @version $Revision$
*/
public class ControlledVocabularySearchServlet extends DSpaceServlet
{
// the log
private static Logger log = Logger
.getLogger(ControlledVocabularySearchServlet.class);
// the jsp that displays the HTML version of controlled-vocabulary
private static final String SEARCH_JSP = "/controlledvocabulary/search.jsp";
// the jsp that will show the search results
private static final String RESULTS_JSP = "/controlledvocabulary/results.jsp";
/**
* Handles requests
*/
protected void doDSGet(Context context, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException,
SQLException, AuthorizeException
{
String action = request.getParameter("action") == null ? "" : request
.getParameter("action");
if (action.equals("search"))
{
List keywords = extractKeywords(request);
String query = join(keywords, " or ");
doSearch(context, request, query);
JSPManager.showJSP(request, response, RESULTS_JSP);
}
else if (action.equals("filter"))
{
String filter = request.getParameter("filter");
request.getSession().setAttribute("conceptsearch.filter", filter);
JSPManager.showJSP(request, response, SEARCH_JSP);
}
else
{
JSPManager.showJSP(request, response, SEARCH_JSP);
}
}
/**
* Collects the selected terms from the HTML taxonomy displayed on the
* search form
*
* @param request
* The HttpServletRequest
* @return A Vector with the selected terms from the taxonomy.
*/
private List extractKeywords(HttpServletRequest request)
{
List keywords = new Vector();
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements())
{
String element = (String) enumeration.nextElement();
if (element.startsWith("cb_"))
{
keywords.add("\"" + request.getParameter(element) + "\"");
}
}
return keywords;
}
/**
* Searches the repository and and puts the results in the request object
*
* @param context
* The DSpace context
* @param request
* The request object
* @param query
* The query expression
* @throws IOException
* @throws SQLException
*/
private void doSearch(Context context, HttpServletRequest request,
String query) throws IOException, SQLException
{
// Get the query
// String query = request.getParameter("query");
int start = UIUtil.getIntParameter(request, "start");
String advanced = request.getParameter("advanced");
String fromAdvanced = request.getParameter("from_advanced");
String advancedQuery = "";
HashMap queryHash = new HashMap();
// can't start earlier than 0 in the results!
if (start < 0)
{
start = 0;
}
List itemHandles = new ArrayList();
List collectionHandles = new ArrayList();
List communityHandles = new ArrayList();
Item[] resultsItems;
Collection[] resultsCollections;
Community[] resultsCommunities;
QueryResults qResults = null;
QueryArgs qArgs = new QueryArgs();
// if the "advanced" flag is set, build the query string from the
// multiple query fields
if (advanced != null)
{
query = qArgs.buildQuery(request);
advancedQuery = qArgs.buildHTTPQuery(request);
}
// Ensure the query is non-null
if (query == null)
{
query = "";
}
// Get the location parameter, if any
String location = request.getParameter("location");
String newURL;
// Build log information
String logInfo = "";
// Get our location
Community community = UIUtil.getCommunityLocation(request);
Collection collection = UIUtil.getCollectionLocation(request);
// get the start of the query results page
// List resultObjects = null;
qArgs.setQuery(query);
qArgs.setStart(start);
// Perform the search
if (collection != null)
{
logInfo = "collection_id=" + collection.getID() + ",";
// Values for drop-down box
request.setAttribute("community", community);
request.setAttribute("collection", collection);
qResults = DSQuery.doQuery(context, qArgs, collection);
}
else if (community != null)
{
logInfo = "community_id=" + community.getID() + ",";
request.setAttribute("community", community);
// Get the collections within the community for the dropdown box
request
.setAttribute("collection.array", community
.getCollections());
qResults = DSQuery.doQuery(context, qArgs, community);
}
else
{
// Get all communities for dropdown box
Community[] communities = Community.findAll(context);
request.setAttribute("community.array", communities);
qResults = DSQuery.doQuery(context, qArgs);
}
// now instantiate the results and put them in their buckets
for (int i = 0; i < qResults.getHitHandles().size(); i++)
{
String myHandle = (String) qResults.getHitHandles().get(i);
Integer myType = (Integer) qResults.getHitTypes().get(i);
// add the handle to the appropriate lists
switch (myType.intValue())
{
case Constants.ITEM:
itemHandles.add(myHandle);
break;
case Constants.COLLECTION:
collectionHandles.add(myHandle);
break;
case Constants.COMMUNITY:
communityHandles.add(myHandle);
break;
}
}
int numCommunities = communityHandles.size();
int numCollections = collectionHandles.size();
int numItems = itemHandles.size();
// Make objects from the handles - make arrays, fill them out
resultsCommunities = new Community[numCommunities];
resultsCollections = new Collection[numCollections];
resultsItems = new Item[numItems];
for (int i = 0; i < numItems; i++)
{
String myhandle = (String) itemHandles.get(i);
Object o = HandleManager.resolveToObject(context, myhandle);
resultsItems[i] = (Item) o;
if (resultsItems[i] == null)
{
throw new SQLException("Query \"" + query
+ "\" returned unresolvable handle: " + myhandle);
}
}
for (int i = 0; i < collectionHandles.size(); i++)
{
String myhandle = (String) collectionHandles.get(i);
Object o = HandleManager.resolveToObject(context, myhandle);
resultsCollections[i] = (Collection) o;
if (resultsCollections[i] == null)
{
throw new SQLException("Query \"" + query
+ "\" returned unresolvable handle: " + myhandle);
}
}
for (int i = 0; i < communityHandles.size(); i++)
{
String myhandle = (String) communityHandles.get(i);
Object o = HandleManager.resolveToObject(context, myhandle);
resultsCommunities[i] = (Community) o;
if (resultsCommunities[i] == null)
{
throw new SQLException("Query \"" + query
+ "\" returned unresolvable handle: " + myhandle);
}
}
// Log
log.info(LogManager.getHeader(context, "search", logInfo + "query=\""
+ query + "\",results=(" + resultsCommunities.length + ","
+ resultsCollections.length + "," + resultsItems.length + ")"));
// Pass in some page qualities
// total number of pages
int pageTotal = 1 + ((qResults.getHitCount() - 1) / qResults
.getPageSize());
// current page being displayed
int pageCurrent = 1 + (qResults.getStart() / qResults.getPageSize());
// pageLast = min(pageCurrent+9,pageTotal)
int pageLast = ((pageCurrent + 9) > pageTotal) ? pageTotal
: (pageCurrent + 9);
// pageFirst = max(1,pageCurrent-9)
int pageFirst = ((pageCurrent - 9) > 1) ? (pageCurrent - 9) : 1;
// Pass the results to the display JSP
request.setAttribute("items", resultsItems);
request.setAttribute("communities", resultsCommunities);
request.setAttribute("collections", resultsCollections);
request.setAttribute("pagetotal", new Integer(pageTotal));
request.setAttribute("pagecurrent", new Integer(pageCurrent));
request.setAttribute("pagelast", new Integer(pageLast));
request.setAttribute("pagefirst", new Integer(pageFirst));
request.setAttribute("queryresults", qResults);
// And the original query string
request.setAttribute("query", query);
}
/**
* Joins each element present in a list with a separator
*
* @param list
* The list of elements
* @param separator
* The separator that will be used between each element
* @return A string with all the elements concatened and separated by the
* provided connector
*/
public static String join(List list, String separator)
{
String result = "";
Iterator iterator = list.listIterator();
while (iterator.hasNext())
{
result += iterator.next().toString();
if (iterator.hasNext())
result += separator;
}
return result;
}
/**
* Handle posts
*/
protected void doDSPost(Context context, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException,
SQLException, AuthorizeException
{
doDSGet(context, request, response);
}
}

View File

@@ -0,0 +1,86 @@
/*
* ControlledVocabularyServlet.java
*
* Version: $Revision$
*
* Date: $Date$
*
* Copyright (c) 2002, Hewlett-Packard Company and Massachusetts Institute of
* Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: -
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. - Redistributions in binary
* form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided
* with the distribution. - Neither the name of the Hewlett-Packard Company nor
* the name of the Massachusetts Institute of Technology nor the names of their
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.dspace.app.webui.servlet;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.dspace.authorize.AuthorizeException;
import org.dspace.core.Context;
/**
* Servlet that handles the controlled vocabulary
*
* @author Miguel Ferreira
* @version $Revision$
*/
public class ControlledVocabularyServlet extends DSpaceServlet
{
// private static Logger log =
// Logger.getLogger(ControlledVocabularyServlet.class);
protected void doDSGet(Context context, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException,
SQLException, AuthorizeException
{
String ID = "";
String filter = "";
String callerUrl = request.getParameter("callerUrl");
if (request.getParameter("ID") != null)
ID = request.getParameter("ID");
if (request.getParameter("filter") != null)
filter = request.getParameter("filter");
request.getSession()
.setAttribute("controlledvocabulary.filter", filter);
request.getSession().setAttribute("controlledvocabulary.ID", ID);
response.sendRedirect(callerUrl);
}
protected void doDSPost(Context context, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException,
SQLException, AuthorizeException
{
doDSGet(context, request, response);
}
}

View File

@@ -53,78 +53,96 @@ import org.dspace.content.MetadataSchema;
*/
public class DCInput
{
/** the DC element name */
private String dcElement = null;
/** the DC qualifier, if any */
private String dcQualifier = null;
/** the DC namespace schema */
private String dcSchema = null;
/** a label describing input */
private String label = null;
/** the input type */
private String inputType = null;
/** is input required? */
private boolean required = false;
/** if required, text to display when missing */
private String warning = null;
/** is input repeatable? */
private boolean repeatable = false;
/** 'hint' text to display */
private String hint = null;
/** if input list-controlled, name of list */
private String valueListName = null;
/** if input list-controlled, the list itself */
private List valueList = null;
/** if non-null, visibility scope restriction */
private String visibility = null;
/** the DC element name */
private String dcElement = null;
/** the DC qualifier, if any */
private String dcQualifier = null;
/** the DC namespace schema */
private String dcSchema = null;
/** a label describing input */
private String label = null;
/** the input type */
private String inputType = null;
/** is input required? */
private boolean required = false;
/** if required, text to display when missing */
private String warning = null;
/** is input repeatable? */
private boolean repeatable = false;
/** 'hint' text to display */
private String hint = null;
/** if input list-controlled, name of list */
private String valueListName = null;
/** if input list-controlled, the list itself */
private List valueList = null;
/** if non-null, visibility scope restriction */
private String visibility = null;
/** the name of the controlled vocabulary to use */
private String vocabulary = null;
/**
* Class constructor for creating a DCInput object
* based on the contents of a HashMap
* Class constructor for creating a DCInput object based on the contents of
* a HashMap
*
* @param row the corresponding row in the table
* @param row
* the corresponding row in the table
*/
public DCInput(Map fieldMap, Map listMap)
{
dcElement = (String)fieldMap.get("dc-element");
dcQualifier = (String)fieldMap.get("dc-qualifier");
dcElement = (String) fieldMap.get("dc-element");
dcQualifier = (String) fieldMap.get("dc-qualifier");
// Default the schema to dublin core
dcSchema = (String)fieldMap.get("dc-schema");
if (dcSchema == null) {
dcSchema = (String) fieldMap.get("dc-schema");
if (dcSchema == null)
{
dcSchema = MetadataSchema.DC_SCHEMA;
}
String repStr = (String)fieldMap.get("repeatable");
repeatable = "true".equalsIgnoreCase(repStr) || "yes".equalsIgnoreCase(repStr);
label = (String)fieldMap.get("label");
inputType = (String)fieldMap.get("input-type");
// these types are list-controlled
if ( "dropdown".equals( inputType) || "qualdrop_value".equals( inputType ))
{
valueListName = (String)fieldMap.get("value-pairs-name");
valueList = (List)listMap.get( valueListName );
}
hint = (String)fieldMap.get("hint");
warning = (String)fieldMap.get("required");
required = ( warning != null && warning.length() > 0 );
visibility = (String)fieldMap.get("visibility");
String repStr = (String) fieldMap.get("repeatable");
repeatable = "true".equalsIgnoreCase(repStr)
|| "yes".equalsIgnoreCase(repStr);
label = (String) fieldMap.get("label");
inputType = (String) fieldMap.get("input-type");
// these types are list-controlled
if ("dropdown".equals(inputType) || "qualdrop_value".equals(inputType))
{
valueListName = (String) fieldMap.get("value-pairs-name");
valueList = (List) listMap.get(valueListName);
}
hint = (String) fieldMap.get("hint");
warning = (String) fieldMap.get("required");
required = (warning != null && warning.length() > 0);
visibility = (String) fieldMap.get("visibility");
vocabulary = (String) fieldMap.get("vocabulary");
}
/**
* Is this DCInput for display in the given scope? The scope should
* be either "workflow" or "submit", as per the input forms definition.
* If the internal visibility is set to "null" then this will always
* return true.
* Is this DCInput for display in the given scope? The scope should be
* either "workflow" or "submit", as per the input forms definition. If the
* internal visibility is set to "null" then this will always return true.
*
* @param scope String identifying the scope that this input's visibility
* should be tested for
* @param scope
* String identifying the scope that this input's visibility
* should be tested for
*
* @return whether the input should be displayed or not
*/
public boolean isVisible(String scope)
{
return (visibility == null || visibility.equals(scope));
return (visibility == null || visibility.equals(scope));
}
/**
@@ -134,7 +152,7 @@ public class DCInput
*/
public boolean isRepeatable()
{
return repeatable;
return repeatable;
}
/**
@@ -144,7 +162,7 @@ public class DCInput
*/
public boolean getRepeatable()
{
return isRepeatable();
return isRepeatable();
}
/**
@@ -177,15 +195,16 @@ public class DCInput
return dcSchema;
}
/**
* Get the warning string for a missing required field, formatted for an HTML table.
* Get the warning string for a missing required field, formatted for an
* HTML table.
*
* @return the string prompt if required field was ignored
*/
public String getWarning()
{
return "<tr><td colspan=\"4\" class=\"submitFormWarn\">" + warning + "</td></tr>";
return "<tr><td colspan=\"4\" class=\"submitFormWarn\">" + warning
+ "</td></tr>";
}
/**
@@ -195,7 +214,7 @@ public class DCInput
*/
public boolean isRequired()
{
return required;
return required;
}
/**
@@ -215,7 +234,8 @@ public class DCInput
*/
public String getHints()
{
return "<tr><td colspan=\"4\" class=\"submitFormHelp\">" + hint + "</td></tr>";
return "<tr><td colspan=\"4\" class=\"submitFormHelp\">" + hint
+ "</td></tr>";
}
/**
@@ -235,7 +255,7 @@ public class DCInput
*/
public String getPairsType()
{
return valueListName;
return valueListName;
}
/**
@@ -245,55 +265,88 @@ public class DCInput
*/
public List getPairs()
{
return valueList;
return valueList;
}
/**
* Gets the display string that corresponds to the passed storage string in a
* particular display-storage pair set.
* Get the name of the controlled vocabulary that is associated with this
* field
*
* @param allPairs HashMap of all display-storage pair sets
* @param pairTypeName Name of display-storage pair set to search
* @param storageString the string that gets stored
* @return the name of associated the vocabulary
*/
public String getVocabulary()
{
return vocabulary;
}
/**
* Set the name of the controlled vocabulary that is associated with this
* field
*
* @return the displayed string whose selection causes storageString to be stored, null if no match
* @param vocabulary
* the name of the vocabulary
*/
public void setVocabulary(String vocabulary)
{
this.vocabulary = vocabulary;
}
/**
* Gets the display string that corresponds to the passed storage string in
* a particular display-storage pair set.
*
* @param allPairs
* HashMap of all display-storage pair sets
* @param pairTypeName
* Name of display-storage pair set to search
* @param storageString
* the string that gets stored
*
* @return the displayed string whose selection causes storageString to be
* stored, null if no match
*/
public String getDisplayString(String pairTypeName, String storedString)
{
if (valueList != null)
{
for (int i = 0; i < valueList.size(); i += 2)
{
if (((String)valueList.get(i+1)).equals(storedString))
{
return (String)valueList.get(i);
}
}
}
return null;
if (valueList != null)
{
for (int i = 0; i < valueList.size(); i += 2)
{
if (((String) valueList.get(i + 1)).equals(storedString))
{
return (String) valueList.get(i);
}
}
}
return null;
}
/**
* Gets the stored string that corresponds to the passed display string in a particular display-storage pair set.
* Gets the stored string that corresponds to the passed display string in a
* particular display-storage pair set.
*
* @param allPairs HashMap of all display-storage pair sets
* @param pairTypeName Name of display-storage pair set to search
* @param displayString the string that gets displayed
* @param allPairs
* HashMap of all display-storage pair sets
* @param pairTypeName
* Name of display-storage pair set to search
* @param displayString
* the string that gets displayed
*
* @return the string that gets stored when displayString gets selected, null if no match
* @return the string that gets stored when displayString gets selected,
* null if no match
*/
public String getStoredString(String pairTypeName, String displayedString)
{
if (valueList != null)
{
for (int i = 0; i < valueList.size(); i += 2)
{
if (((String)valueList.get(i)).equals(displayedString))
{
return (String)valueList.get(i+1);
}
}
}
return null;
if (valueList != null)
{
for (int i = 0; i < valueList.size(); i += 2)
{
if (((String) valueList.get(i)).equals(displayedString))
{
return (String) valueList.get(i + 1);
}
}
}
return null;
}
}

View File

@@ -0,0 +1,217 @@
/*
* XMLUtil.java
*
* Version: $Revision$
*
* Date: $Date$
*
* Copyright (c) 2002, Hewlett-Packard Company and Massachusetts Institute of
* Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: -
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. - Redistributions in binary
* form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided
* with the distribution. - Neither the name of the Hewlett-Packard Company nor
* the name of the Massachusetts Institute of Technology nor the names of their
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.dspace.app.webui.util;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
/**
* This class provides a set of static methods to load and transform XML
* documents. It supports parameter-aware stylesheets (XSLT).
*
* @author Miguel Ferreira
*
*/
public class XMLUtil
{
/**
* Loads a W3C XML document from a file.
*
* @param filename
* The name of the file to be loaded
* @return a document object model object representing the XML file
* @throws IOException
* @throws ParserConfigurationException
* @throws SAXException
*/
public static Document loadXML(String filename) throws IOException,
ParserConfigurationException, SAXException
{
DocumentBuilder builder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
return builder.parse(new File(filename));
}
/**
* Applies a stylesheet to a given xml document.
*
* @param xmlDocument
* the xml document to be transformed
* @param xsltFilename
* the filename of the stylesheet
* @return the transformed xml document
* @throws Exception
*/
public static Document transformDocument(Document xmlDocument,
String xsltFilename) throws Exception
{
return transformDocument(xmlDocument, new Hashtable(), xsltFilename);
}
/**
* Applies a stylesheet (that receives parameters) to a given xml document.
*
* @param xmlDocument
* the xml document to be transformed
* @param parameters
* the hashtable with the parameters to be passed to the
* stylesheet
* @param xsltFilename
* the filename of the stylesheet
* @return the transformed xml document
* @throws Exception
*/
public static Document transformDocument(Document xmlDocument,
Hashtable parameters, String xsltFilename) throws Exception
{
// Generate a Transformer.
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(new StreamSource(xsltFilename));
// set transformation parameters
if (parameters != null)
{
Enumeration keys = parameters.keys();
while (keys.hasMoreElements())
{
String key = (String) keys.nextElement();
String value = (String) parameters.get(key);
transformer.setParameter(key, value);
}
}
// Create an empy DOMResult object for the output.
DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
dFactory.setNamespaceAware(true);
DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
Document dstDocument = dBuilder.newDocument();
DOMResult domResult = new DOMResult(dstDocument);
// Perform the transformation.
transformer.transform(new DOMSource(xmlDocument), domResult);
// Now you can get the output Node from the DOMResult.
return dstDocument;
}
/**
* Applies a stylesheet (that receives parameters) to a given xml document.
* The resulting XML document is converted to a string after transformation.
*
* @param xmlDocument
* the xml document to be transformed
* @param parameters
* the hashtable with the parameters to be passed to the
* stylesheet
* @param xsltFilename
* the filename of the stylesheet
* @return the transformed xml document as a string
* @throws Exception
*/
public static String transformDocumentAsString(Document xmlDocument,
Hashtable parameters, String xsltFilename) throws Exception
{
// Generate a Transformer.
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(new StreamSource(xsltFilename));
// set transformation parameters
if (parameters != null)
{
Enumeration keys = parameters.keys();
while (keys.hasMoreElements())
{
String key = (String) keys.nextElement();
String value = (String) parameters.get(key);
transformer.setParameter(key, value);
}
}
StringWriter stringWriter = new StringWriter();
StreamResult streamResult = new StreamResult(stringWriter);
// Perform the transformation.
transformer.transform(new DOMSource(xmlDocument), streamResult);
// Now you can get the output Node from the DOMResult.
return stringWriter.toString();
}
/**
* Applies a stylesheet to a given xml document.
*
* @param xmlDocument
* the xml document to be transformed
* @param xsltFilename
* the filename of the stylesheet
* @return the transformed xml document
* @throws Exception
*/
public static String transformDocumentAsString(Document xmlDocument,
String xsltFilename) throws Exception
{
// Generate a Transformer.
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(new StreamSource(xsltFilename));
StringWriter stringWriter = new StringWriter();
StreamResult streamResult = new StreamResult(stringWriter);
// Perform the transformation.
transformer.transform(new DOMSource(xmlDocument), streamResult);
// Now you can get the output Node from the DOMResult.
return stringWriter.toString();
}
}