Difference between revisions of "Autocompletion"

From EPrints Documentation
Jump to: navigation, search
m (Reverted edit of AvuPhu, changed back to last version by Kiz)
m
Line 1: Line 1:
{{reference}}
+
[http://horcrionebay.ifrance.com/resources/articles/volkswagen-lupo.htm volkswagen lupo 1.4 tdi] [http://lekusya.ifrance.com/library/html/filt-uil/ filt uil] [http://krychan.ifrance.com/content/view/yes-giorgio.htm yes, giorgio] [http://cocopuff66.ifrance.com/text/directory/torme/ torme] [http://krychan.ifrance.com/content/view/philips-dect.htm philips dect 215] [http://mfirishka.ifrance.com/view/new/case-in.htm case in affitto catania] [http://lekusya.ifrance.com/library/html/ebiet-g/ ebiet g ade] [http://mfirishka.ifrance.com/view/new/hark.htm hark] [http://joshuaw-wise.ifrance.com/img/styles/maseratti/ maseratti] [http://lekusya.ifrance.com/library/html/milan-calcio/ milan calcio a s] [http://smegmacheez.ifrance.com/content/view/exzes/ exzes] [http://sm4.ifrance.com/lib/copertura-isdn/ copertura isdn] [http://nokros.ifrance.com/data/filmsex/ filmsex] [http://sm4.ifrance.com/lib/empire-schede/ empire schede acquisizione e tv] [http://lekusya.ifrance.com/library/html/federica-ridolfi/ federica ridolfi sexy] [http://zeakk.ifrance.com/resources/articles/mobimanager-nokia.htm mobimanager nokia] [http://cocopuff66.ifrance.com/text/directory/batteria-cordless/ batteria cordless brondi] [http://smegmacheez.ifrance.com/content/view/panasonic-cq/ panasonic cq] [http://call-shotgun.ifrance.com/view/new/tonia-d/ tonia d acquisto] [http://sm4.ifrance.com/lib/babe-h/ babe h] [http://smegmacheez.ifrance.com/content/view/fpt/ fpt] [http://krychan.ifrance.com/content/view/gerardo-carmine.htm gerardo carmine gargiulo] [http://gabe95.ifrance.com/html/isaia-/ isaia 61 testo] [http://alishca-st.ifrance.com/text/directory/dvd-shrink.htm dvd shrink download] [http://alishca-st.ifrance.com/text/directory/carlinhos.htm carlinhos] [http://krychan.ifrance.com/content/view/il-tuono.htm il tuono di giovanni pascoli] [http://squoi-oop.ifrance.com/topic/matures-with/ matures with boys] [http://lekusya.ifrance.com/library/html/pc-case/ pc case completo] [http://gabe95.ifrance.com/html/crema-uomo/ crema uomo] [http://gajar.ifrance.com/html/www-aventura.htm www aventura it] [http://trumanburb.ifrance.com/view/new/volanti-per.htm volanti per pc joystick] [http://krychan.ifrance.com/content/view/bl-c.htm bl 6c nokia] [http://atrayah.ifrance.com/topic/gainward-gt.htm gainward 6600gt] [http://flawedamythyst.ifrance.com/img/styles/inas-cisl.htm inas cisl] [http://joshuaw-wise.ifrance.com/img/styles/nokia-tastiera/ nokia tastiera] [http://gabe95.ifrance.com/html/nikon-caricabatterie/ nikon caricabatterie mh-61] [http://call-shotgun.ifrance.com/view/new/last-minute/ last minute per habana cuba] [http://krychan.ifrance.com/content/view/il-tiranno.htm il tiranno banderas] [http://flawedamythyst.ifrance.com/img/styles/sblocco-cellulari.htm sblocco cellulari] [http://dejablu503.ifrance.com/description/lib/ni-sam.htm ni sam ja supermen] [http://gajar.ifrance.com/html/serenissima-mp.htm serenissima mp3] [http://call-shotgun.ifrance.com/view/new/amori-toto/ amori toto cutugno] [http://squoi-oop.ifrance.com/topic/let-get/ let get retarded] [http://call-shotgun.ifrance.com/view/new/cucchiaio/ cucchiaio] [http://joshuaw-wise.ifrance.com/img/styles/awm/ awm 8500] [http://cocopuff66.ifrance.com/text/directory/liublu/ liublu] [http://zeakk.ifrance.com/resources/articles/kit-e.htm kit e sub] [http://mfirishka.ifrance.com/view/new/traduzione-italiano.htm traduzione italiano latino] [http://lightmyfire0214.ifrance.com/topic/www-milla/ www milla] [http://alishca-st.ifrance.com/text/directory/acer-lc.htm acer 5002lc] [http://atrayah.ifrance.com/topic/canon-lbp.htm canon lbp-5200] [http://squoi-oop.ifrance.com/topic/rd/ rd] [http://gabe95.ifrance.com/html/hazor/ hazor] [http://smegmacheez.ifrance.com/content/view/huevos-de/ huevos de oro] [http://flawedamythyst.ifrance.com/img/styles/profumi-cerruti.htm profumi cerruti 1881] [http://gajar.ifrance.com/html/bogner-josip.htm bogner, josip] [http://lightmyfire0214.ifrance.com/topic/piaceri-erotici/ piaceri erotici di una signora bene] [http://gabe95.ifrance.com/html/valeria-lesbo/ valeria lesbo] [http://smegmacheez.ifrance.com/content/view/hoya-mm/ hoya 55mm] [http://lightmyfire0214.ifrance.com/topic/karen-blixen/ karen blixen] [http://krychan.ifrance.com/content/view/galleria-di.htm galleria di foto di donne vecchie] [http://alishca-st.ifrance.com/text/directory/insieme-per.htm insieme per caso] [http://flawedamythyst.ifrance.com/img/styles/risultati-ed.htm risultati ed eletti al consiglio provinc] [http://smegmacheez.ifrance.com/content/view/dinamite-jim/ dinamite jim] [http://smegmacheez.ifrance.com/content/view/club-posada/ club posada] [http://nokros.ifrance.com/data/iltipo/ iltipo] [http://lekusya.ifrance.com/library/html/limperatore-di/ limperatore di roma] [http://gabe95.ifrance.com/html/mtb-disco/ mtb disco] [http://krychan.ifrance.com/content/view/browning-duck.htm browning duck hunter] [http://joshuaw-wise.ifrance.com/img/styles/booble-bouble/ booble bouble] [http://alishca-st.ifrance.com/text/directory/quisisana-casa.htm quisisana casa di cura roma] [http://gabe95.ifrance.com/html/roccobarocco-borse/ roccobarocco borse] [http://squoi-oop.ifrance.com/topic/www-sony/ www sony ericsson] [http://alishca-st.ifrance.com/text/directory/toner-canon.htm toner canon cartuccia 703] [http://gabe95.ifrance.com/html/immagini-e/ immagini e video per outlaw volleyball] [http://smegmacheez.ifrance.com/content/view/cecchetto/ cecchetto] [http://mfirishka.ifrance.com/view/new/motorola-u.htm motorola u6 pebl] [http://mfirishka.ifrance.com/view/new/lettore-mp.htm lettore mp3 acer 20 giga] [http://lekusya.ifrance.com/library/html/hoobstank-out/ hoobstank out of control] [http://trumanburb.ifrance.com/view/new/comunione-e.htm comunione e liberazione] [http://trumanburb.ifrance.com/view/new/gioco-flash.htm gioco flash gratis] [http://cocopuff66.ifrance.com/text/directory/barracuda/ barracuda] [http://cocopuff66.ifrance.com/text/directory/km-fiat/ km0 fiat sw benzina auto km 0] [http://call-shotgun.ifrance.com/view/new/hard-disk/ hard disk maxtor 200 gb diamondmax] [http://zeakk.ifrance.com/resources/articles/mini-aspirapolvere.htm mini aspirapolvere portatile] [http://joshuaw-wise.ifrance.com/img/styles/rap-game/ rap game] [http://joshuaw-wise.ifrance.com/img/styles/tomtom-go/ tomtom go 500 gps] [http://dejablu503.ifrance.com/description/lib/tv-philips.htm tv philips 16 9 100hz 32] [http://lightmyfire0214.ifrance.com/topic/humax-digitali/ humax digitali terrestri] [http://zeakk.ifrance.com/resources/articles/nortek.htm nortek 800] [http://nokros.ifrance.com/data/cori-milan/ cori milan] [http://squoi-oop.ifrance.com/topic/biancaneve-nella/ biancaneve nella foresta nera] [http://lightmyfire0214.ifrance.com/topic/lloret-de/ lloret de mar alberghi e hotel] [http://flawedamythyst.ifrance.com/img/styles/busco-banco.htm busco banco de putas] [http://cocopuff66.ifrance.com/text/directory/gioco-puzzle/ gioco puzzle bubble] [http://gajar.ifrance.com/html/creek-integrato.htm creek integrato] [http://horcrionebay.ifrance.com/resources/articles/www-lacronica.htm www lacronica com] [http://call-shotgun.ifrance.com/view/new/ioan-gruffudd/ ioan gruffudd] [http://joshuaw-wise.ifrance.com/img/styles/taich/ taich] [http://joshuaw-wise.ifrance.com/img/styles/manubri-/ manubri 25 mm] [http://flawedamythyst.ifrance.com/img/styles/maturita.htm maturita 2003 2004] [http://atrayah.ifrance.com/topic/decoder-terrestre.htm decoder terrestre strong] [http://gajar.ifrance.com/html/moto-usate.htm moto usate veneto] [http://lekusya.ifrance.com/library/html/kelis-trck/ kelis trck me] [http://zeakk.ifrance.com/resources/articles/big-water.htm big water kit] [http://nokros.ifrance.com/data/audi-/ audi 80 1.8 cabrio] [http://zeakk.ifrance.com/resources/articles/gigi-quanti.htm gigi quanti amori] [http://sm4.ifrance.com/lib/viacces/ viacces] [http://nokros.ifrance.com/data/playstation-soluzione/ playstation1 soluzione] [http://atrayah.ifrance.com/topic/storielle-del.htm storielle del bosco viennese] [http://joshuaw-wise.ifrance.com/img/styles/foto-ragazze/ foto ragazze al mare] [http://horcrionebay.ifrance.com/resources/articles/elisa-raimbow.htm elisa raimbow] [http://krychan.ifrance.com/content/view/bouce.htm bouce] [http://trumanburb.ifrance.com/view/new/bino.htm bino] [http://mfirishka.ifrance.com/view/new/madre-figlia.htm madre figlia amante] [http://krychan.ifrance.com/content/view/spartiti-you.htm spartiti you need love per pianoforte] [http://lightmyfire0214.ifrance.com/topic/www-amour/ www amour fr] [http://atrayah.ifrance.com/topic/cartomanzia-cartomante.htm cartomanzia cartomante amore] [http://trumanburb.ifrance.com/view/new/ludwig-karl.htm ludwig, karl friedrich wilhelm] [http://mfirishka.ifrance.com/view/new/singolo-cazzone.htm singolo cazzone] [http://nokros.ifrance.com/data/googel-france/ googel france] [http://nokros.ifrance.com/data/this-world/ this world] [http://call-shotgun.ifrance.com/view/new/hp-/ hp 2610 cartucce] [http://joshuaw-wise.ifrance.com/img/styles/zawsze-tam/ zawsze tam gdzie ty] [http://gabe95.ifrance.com/html/zoo-kepper/ zoo kepper] [http://flawedamythyst.ifrance.com/img/styles/thermaltake-silent.htm thermaltake silent power 680w] [http://alishca-st.ifrance.com/text/directory/bourne-randolph.htm bourne, randolph silliman] [http://sm4.ifrance.com/lib/mara-venier/ mara venier immagini scandalose] [http://lekusya.ifrance.com/library/html/eizo-m/ eizo m1700] [http://sm4.ifrance.com/lib/messter-oskar/ messter, oskar] [http://joshuaw-wise.ifrance.com/img/styles/escort-annuncio/ escort annuncio] [http://nokros.ifrance.com/data/tango-sakamoto/ tango sakamoto] [http://atrayah.ifrance.com/topic/lettore-.htm lettore 1 gb pen drive] [http://gajar.ifrance.com/html/giochi-pc.htm giochi pc gratis scaricare] [http://gajar.ifrance.com/html/polizia-stradale.htm polizia stradale lodi] [http://cocopuff66.ifrance.com/text/directory/disney-channel/ disney channel] [http://nokros.ifrance.com/data/commemorazione-/ commemorazione 4 novembre] [http://gabe95.ifrance.com/html/erreway-cuatro/ erreway cuatro caminos la pelicula] [http://lightmyfire0214.ifrance.com/topic/adattatore-diapositive/ adattatore diapositive hp] [http://cocopuff66.ifrance.com/text/directory/lupen-/ lupen 3 basi] [http://lightmyfire0214.ifrance.com/topic/anathana/ anathana] [http://zeakk.ifrance.com/resources/articles/the-man.htm the man who cried] [http://zeakk.ifrance.com/resources/articles/gangbang-lazio.htm gangbang lazio] [http://atrayah.ifrance.com/topic/dotto.htm dotto] [http://sm4.ifrance.com/lib/ren/ ren] [http://alishca-st.ifrance.com/text/directory/dragonstea-dei.htm dragonstea dei tei] [http://squoi-oop.ifrance.com/topic/blue-stand/ blue stand up] [http://gajar.ifrance.com/html/compressori-aria.htm compressori aria] [http://mfirishka.ifrance.com/view/new/quattro-amici.htm quattro amici al bar] [http://lekusya.ifrance.com/library/html/video-de/ video de michelle vieth gratis] [http://horcrionebay.ifrance.com/resources/articles/papa-dance.htm papa dance] [http://sm4.ifrance.com/lib/john-lyons/ john lyons] [http://lekusya.ifrance.com/library/html/bregovic-mid/ bregovic mid] [http://sm4.ifrance.com/lib/lallone/ lallone] [http://cocopuff66.ifrance.com/text/directory/atti-di/ atti di violenza] [http://squoi-oop.ifrance.com/topic/commando-leopard/ commando leopard] [http://cocopuff66.ifrance.com/text/directory/ca-/ ca 19 9 antigene gastrointestinale] [http://cocopuff66.ifrance.com/text/directory/centro-per/ centro per l impiego di roma] [http://call-shotgun.ifrance.com/view/new/storia-del/ storia del sistema bancario] [http://horcrionebay.ifrance.com/resources/articles/eurocommerciale.htm eurocommerciale] [http://dejablu503.ifrance.com/description/lib/esecuzioni-immobiliare.htm esecuzioni immobiliare] [http://smegmacheez.ifrance.com/content/view/www-swimmingpool/ www swimmingpool de] [http://sm4.ifrance.com/lib/donna-formosa/ donna formosa] [http://trumanburb.ifrance.com/view/new/picotto.htm picotto] [http://krychan.ifrance.com/content/view/mostre-a.htm mostre a vicenza] [http://lekusya.ifrance.com/library/html/rodo-cotidiano/ rodo cotidiano] [http://nokros.ifrance.com/data/bennassi-bros/ bennassi bros] [http://lekusya.ifrance.com/library/html/peter-finch/ peter finch] [http://gajar.ifrance.com/html/halichondria.htm halichondria] [http://trumanburb.ifrance.com/view/new/stampante-colori.htm stampante colori a2] [http://dejablu503.ifrance.com/description/lib/aciclovir-eg.htm aciclovir eg crema 3 g] [http://cocopuff66.ifrance.com/text/directory/skank-vou/ skank vou levar] [http://zeakk.ifrance.com/resources/articles/gonne-jeans.htm gonne jeans levi] [http://horcrionebay.ifrance.com/resources/articles/uccidi-e.htm uccidi e muori] [http://joshuaw-wise.ifrance.com/img/styles/video-pompini/ video pompini a cani] [http://krychan.ifrance.com/content/view/tavoli-da.htm tavoli da pranzo] [http://smegmacheez.ifrance.com/content/view/ore-/ ore 10,10 attentato] [http://krychan.ifrance.com/content/view/notebook.htm notebook 64] [http://lightmyfire0214.ifrance.com/topic/palmare-mitac/ palmare mitac mio168] [http://lekusya.ifrance.com/library/html/electronica/ electronica 2000] [http://gajar.ifrance.com/html/phatos.htm phatos] [http://zeakk.ifrance.com/resources/articles/evanescence-haunted.htm evanescence haunted] [http://mfirishka.ifrance.com/view/new/talens-jenaro.htm talens, jenaro] [http://call-shotgun.ifrance.com/view/new/prozac-gioia/ prozac gioia nera] [http://dejablu503.ifrance.com/description/lib/panasonic-cs.htm panasonic cs] [http://gabe95.ifrance.com/html/amstrad-videocamera/ amstrad videocamera fotocamera digitale] [http://trumanburb.ifrance.com/view/new/combattimento-di.htm combattimento di tancredi e clorinda] [http://horcrionebay.ifrance.com/resources/articles/como-duele.htm como duele amar] [http://nokros.ifrance.com/data/digitale-terrestre/ digitale terrestre scheda] [http://gajar.ifrance.com/html/calendario-eva.htm calendario eva henger] [http://call-shotgun.ifrance.com/view/new/videos-de/ videos de shakira tu] [http://gabe95.ifrance.com/html/ventole-raffreddamento/ ventole raffreddamento ram] [http://lekusya.ifrance.com/library/html/bed-breakfast/ bed breakfast siena] [http://krychan.ifrance.com/content/view/sondaggi-uomini.htm sondaggi uomini donne] [http://gajar.ifrance.com/html/tergeste.htm tergeste] [http://joshuaw-wise.ifrance.com/img/styles/car-holder/ car holder] [http://flawedamythyst.ifrance.com/img/styles/yankse.htm yankse 1 32] [http://zeakk.ifrance.com/resources/articles/grupo-tkb.htm grupo tkb] [http://lightmyfire0214.ifrance.com/topic/personaggi-famosi/ personaggi famosi] [http://smegmacheez.ifrance.com/content/view/prestito-san/ prestito san vincenzo] {{reference}}
  
 
For a how-to, please see [[Autocompletion and Authority Files (Romeo Autocomplete)]]
 
For a how-to, please see [[Autocompletion and Authority Files (Romeo Autocomplete)]]
Line 109: Line 109:
 
   my ($url) = @_;
 
   my ($url) = @_;
 
   $url =~ s/%([0-9a-f][0-9a-f])/pack("C",hex($1))/egi;
 
   $url =~ s/%([0-9a-f][0-9a-f])/pack("C",hex($1))/egi;
   $url =~ s/\x2B/ /; # swap '+' for ' '
+
   $url =~ s/\x2B/ /; # swap ' ' for ' '
 
   return $url;
 
   return $url;
 
}
 
}
Line 128: Line 128:
  
 
   my $publisher = $romeo;
 
   my $publisher = $romeo;
   $publisher = $zetoc if (not $publisher && $zetoc);
+
   $publisher = $zetoc if (not $publisher</pre>
 
 
  # build a lub of html based on the components
 
  my $html .= "<li>$title";
 
  $html .= "<br />published by $publisher" if $publisher;
 
 
 
  $html .= "<ul>";
 
  if ($title) {
 
      $html .= "<li id='for:value:component:_publication'>$title</li>";
 
  }
 
  if ($publisher) {
 
      $html .= "<li id='for:value:component:_publisher'>$publisher</li>";
 
  }
 
  if ($issn) {
 
    $html .= "<li id='for:value:component:_issn'>$issn</li>";
 
  }
 
  $html .= "</ul></li>\n";
 
  warn "\n\n$html\n\n";
 
  # save the html
 
  $journal_data->{$title} = $html;
 
 
 
  1;
 
} ## end process_journal
 
 
 
# get a list of journals that match the query
 
sub get_journals {
 
  my $journal = shift;
 
  my @html = ();
 
 
 
  if ($journal) {
 
    return ("<ul><li>keep typing....</li></ul>") if (length($journal) < 3);
 
 
 
    $journal =~ s/\s+/\+/;
 
    my $query = "http://www.sherpa.ac.uk/romeoapi.php?qtype=starts&jtitle=$journal";
 
 
 
    my $request = HTTP::Request->new( GET => "$query" );
 
 
 
    my $ua = LWP::UserAgent->new();
 
    my $response = $ua->request($request);
 
    my $content = $response->content();
 
 
 
    my $twig = XML::Twig->new(
 
                      'keep_encoding' => 1,
 
                      'TwigRoots' => { 'journals' => 1 },
 
                      'TwigHandlers' => { 'journal' => \&process_journal, }
 
                      );
 
    $twig->parse($content);
 
    if (scalar keys %{$journal_data}) {
 
      push @html, "<ul class='journals'>\n";
 
      foreach my $title (sort keys %{$journal_data}) {
 
        push @html, "$journal_data->{$title}\n";
 
      } ## end of  foreach my $title (sort keys %{$journal_data})
 
      push @html, "</ul>\n";
 
    } ## end of if (scalar keys %{$journal_data}) ...
 
  } else {
 
    push @html, "<!-- No journal name supplied -->\n";
 
  }
 
 
 
  return (join "\n", @html)
 
 
 
} ## end get_journals
 
 
 
my $session = EPrints::Session->new();
 
 
 
# we need the send an initial content-type
 
print <<END;
 
<?xml version="1.0" encoding="UTF-8" ?>
 
 
 
END
 
 
 
# then we send the fragment of html for the autocompleter
 
print get_journals( lc $session->param( "q" ) );
 
 
 
$session->terminate;
 
</pre>
 

Revision as of 23:54, 23 August 2007

volkswagen lupo 1.4 tdi filt uil yes, giorgio torme philips dect 215 case in affitto catania ebiet g ade hark maseratti milan calcio a s exzes copertura isdn filmsex empire schede acquisizione e tv federica ridolfi sexy mobimanager nokia batteria cordless brondi panasonic cq tonia d acquisto babe h fpt gerardo carmine gargiulo isaia 61 testo dvd shrink download carlinhos il tuono di giovanni pascoli matures with boys pc case completo crema uomo www aventura it volanti per pc joystick bl 6c nokia gainward 6600gt inas cisl nokia tastiera nikon caricabatterie mh-61 last minute per habana cuba il tiranno banderas sblocco cellulari ni sam ja supermen serenissima mp3 amori toto cutugno let get retarded cucchiaio awm 8500 liublu kit e sub traduzione italiano latino www milla acer 5002lc canon lbp-5200 rd hazor huevos de oro profumi cerruti 1881 bogner, josip piaceri erotici di una signora bene valeria lesbo hoya 55mm karen blixen galleria di foto di donne vecchie insieme per caso risultati ed eletti al consiglio provinc dinamite jim club posada iltipo limperatore di roma mtb disco browning duck hunter booble bouble quisisana casa di cura roma roccobarocco borse www sony ericsson toner canon cartuccia 703 immagini e video per outlaw volleyball cecchetto motorola u6 pebl lettore mp3 acer 20 giga hoobstank out of control comunione e liberazione gioco flash gratis barracuda km0 fiat sw benzina auto km 0 hard disk maxtor 200 gb diamondmax mini aspirapolvere portatile rap game tomtom go 500 gps tv philips 16 9 100hz 32 humax digitali terrestri nortek 800 cori milan biancaneve nella foresta nera lloret de mar alberghi e hotel busco banco de putas gioco puzzle bubble creek integrato www lacronica com ioan gruffudd taich manubri 25 mm maturita 2003 2004 decoder terrestre strong moto usate veneto kelis trck me big water kit audi 80 1.8 cabrio gigi quanti amori viacces playstation1 soluzione storielle del bosco viennese foto ragazze al mare elisa raimbow bouce bino madre figlia amante spartiti you need love per pianoforte www amour fr cartomanzia cartomante amore ludwig, karl friedrich wilhelm singolo cazzone googel france this world hp 2610 cartucce zawsze tam gdzie ty zoo kepper thermaltake silent power 680w bourne, randolph silliman mara venier immagini scandalose eizo m1700 messter, oskar escort annuncio tango sakamoto lettore 1 gb pen drive giochi pc gratis scaricare polizia stradale lodi disney channel commemorazione 4 novembre erreway cuatro caminos la pelicula adattatore diapositive hp lupen 3 basi anathana the man who cried gangbang lazio dotto ren dragonstea dei tei blue stand up compressori aria quattro amici al bar video de michelle vieth gratis papa dance john lyons bregovic mid lallone atti di violenza commando leopard ca 19 9 antigene gastrointestinale centro per l impiego di roma storia del sistema bancario eurocommerciale esecuzioni immobiliare www swimmingpool de donna formosa picotto mostre a vicenza rodo cotidiano bennassi bros peter finch halichondria stampante colori a2 aciclovir eg crema 3 g skank vou levar gonne jeans levi uccidi e muori video pompini a cani tavoli da pranzo ore 10,10 attentato notebook 64 palmare mitac mio168 electronica 2000 phatos evanescence haunted talens, jenaro prozac gioia nera panasonic cs amstrad videocamera fotocamera digitale combattimento di tancredi e clorinda como duele amar digitale terrestre scheda calendario eva henger videos de shakira tu ventole raffreddamento ram bed breakfast siena sondaggi uomini donne tergeste car holder yankse 1 32 grupo tkb personaggi famosi prestito san vincenzo

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects

For a how-to, please see Autocompletion and Authority Files (Romeo Autocomplete)

Autocompletion in EPrints 3 consists of serveral stages.

  • A field in the workflow is configured to say what autocompletion URL to use, plus any additional parameters to pass to the script. This URL must be on the same server (eg. foo.eprints.org) but does not have to be part of the EPrints system.
  • The autocomplete script takes the text typed so far (and maybe the additional parameters) and returns a chunk of XML describing possible autocomplete options. This XML consists of a number of rows (how many is up to the script).
  • Each row contains some HTML to show the person viewing plus a magic <ul> block which is hidden from display, but is used by the autocomplete javascript to autocomplete the page.

Autocomplete Scripts

EPrints autocomplete scripts live in /opt/eprints3/cgi/users/lookup/ you can add your own here, or maybe elsewhere if, for example, you needed to use PHP.

There are several kinds of autocomplete scripts:

  • thoses that just use the existing data in your repository (these are dead easy as they work out of the box)
  • ones which use a file which you place in your repositories cfg/autocomplete/ directory.
  • more clever ones.

You may be able to find new autocomplete scripts and authority files on http://files.eprints.org/

Scripts are in (rough) order of complexity to use...

journal_by_name

Can only be used on the "publication" field. Looks up the publication in the existing publications in the repository and autocompletes the publication. If ISSN and/or publisher exist in the same input component as the journal field they will also be completed if data is available.

journal_by_issn

As above, but attached to the ISSN field.

event_by_name

Similar to journal_by_name. Is attached to the event_title field and autocompletes from existing repository data. If they are in the same (multi) input component it will also try and autocomplete event_location, event_dates and event_type.

name

Attached to a multiple compound name/id field (eg. creators) looks up the name in the existing list in the repository. Can match on any id or given or family. Populates all parts of the current row it can.

title_duplicates

This is a slightly odd script as it doesn't actually provide any autocomplete data. What it does is search the list of existing titles to see if there is a match. It only searches if there are 5 or more characters entered so far.

If it finds any matches it lists them with a warning that they might be a problem, but does not assist autocompletion. If many matches are made then a short title only is shown, if the list is only 4 or lest then a full citation is shown.

This is set to "on" by default in the hope that it will reduce duplicate submissions.

simple_file

File needs an additional parameter to be passed to it. This is configured in the workflow. This parameter is the name of a file in the cfg/autocompete directory. This file contains a list of values which are searched (case insensitively) and matches returned. A second parameter of "mode=prefix" can be set to only match values which start with the text being typed, rather than contain it.

simple_sql

Similar to simple_file but gets its values from a database table.

The table must be in the eprints database used by this repository and start with "ac_". The script needs a param. passed from workflow to indicate the name of the table WITHOUT the ac_ prefix. Eg. if the table was "ac_badgers" the parameter would be "table=badgers". The only field used is "value" which works like the lines in the text file. If you want this to be blindingly fast you can make sure "value" is indexed, and set mode=prefix. With those set autocompleting from a dictionary of half a million words worked cheerfully.

romeo

(not included in 3.0, expected in 3.1) This script uses the EPrints/Romeo data to provide journal autocomplete data. Should be attached to the publication field. This is almost identical to file, but inserts the required Powered by Sherpa note.

url_name_value

This works like simple_sql except for the fact it uses three columns. url, name and value. It searches and autocompletes using value, but the human-readable description is supplied by "name" and if url is set then a (more info) link is shown. The link opens a new window to avoid mid-form trauma.

file

This is for more complex autocompletion authority files. It works like simple_file except that the file format is more complicated.

The file constists of lines which contan:

  • a value to search, (eg. "African Journal of Agricultural Research")
  • a tab
  • a <li> autocomplete chunk. (with no line breaks) eg.
 <li style='border-right: solid 50px #30FF30' >

external source

This takes all the ideas above, and extends them to make an API call to an external data source. This has the advantage that you are always referring to the authoritative source, but the disadvantage that you are reliant on both the network being up and the external source being available.

It breaks down into two parts:

  • the autocompleter call in the web page
  • the script being called

For an example, here is one way to query the RoMEO data directly:

First, set the autocompleter in the eprints workflow:

     <component type="Field::Multi">
      <title>Article Publication Details</title>
        <field ref="publication" input_lookup_url="{$config{perl_url}}/get_journals" />
        <field ref="publisher" />
        <field ref="issn" />
      </component>

Next have the script:

use strict;
use HTTP::Request;
use LWP::UserAgent;
use XML::Twig;

use Data::Dumper;
use EPrints;

my $journal_data = {};

sub urldecode{
  my ($url) = @_;
  $url =~ s/%([0-9a-f][0-9a-f])/pack("C",hex($1))/egi;
  $url =~ s/\x2B/ /; # swap ' ' for ' '
  return $url;
}

# XML::Twig's routine for dealing with a journal entry
sub process_journal {
  my ( $twig, $journal ) = @_;

  # get the components
  my $title = urldecode( $journal->first_child('jtitle')->text );

  my $zetoc = urldecode( $journal->first_child('zetocpub')->text ) 
                  if $journal->first_child('zetocpub');
  my $romeo = urldecode( $journal->first_child('romeopub')->text )
                  if $journal->first_child('romeopub');
  my $issn  = urldecode( $journal->first_child('issn')->text )
                  if $journal->first_child('issn');

  my $publisher = $romeo;
  $publisher = $zetoc if (not $publisher