SlacSpiresForms

There are 4 Inspire forms that currently use SLAC resources to send data into the workflow and add to Inspire:

  • https://inspirehep.net/person/update?IRN=1045039 Hepnames corrections oops, I was told that this was all in Inspire. It's not. The data for the form is being grabbed from Inspire (whew), but the form action goes to http://www.slac.stanford.edu/cgi-bin/form-mail.pl form-mail.pl is a standard SLAC script that has a template at /afs/slac/www/spires/hepnames/hepnames_msgupd. and the perl script replaces the template with data in the received url. Javascript on Inspire sends the form posting to slaclib2 again as above, and again emails the content to hepnames@slac for processing.

SlacSpiresWeb

you need to be inside SLAC.

SLACs webpages for HEP and the variety of library applications live in the directories at /afs/slac/www/spires or /afs/slac/www/library or /afs/slac/www/archives

Searches on the spires databases that serve these pages are served via SLAC's websystem from a cgi-script here:/afs/slac/g/library/cgi-bin/spiface.pl I believe this script runs on whatever the SLAC web server machine is.

SLAC's httpd.conf has a ScriptAlias that invokes this perl script: when the url is /afs/slac/www/spires/find/

ScriptAlias /spires/find /cgi-bin/spiface.pl

From that script, the requests are tweaked and sent off to spires servers listening on ports mostly on sunspi4.slac.stanford.edu More details in the wiki link above.

Currently, the hep suite of searches are being sent to deadend, with status 404. This is done in spiface.pl, specifically for the HEP suite of databases, allowing the library and archive dbs to search normally.

Sunspi4 down!

If Sunspi4 goes down, the databases can't be reached from the web. You can switch everything to sunspi5 which will be at most 24 hrs behind.

  • go to /afs/slac/g/library/cgi-bin/spiface.pl modify this line: $spiresServer = "sunspi4"; to $spiresServer = "sunspi5";

/u/lw/webspi1/bin/spires_server -rl -p allweb -t web -d web

/afs/slac/g/library/bin/spires_server -rlA

and also do the authenticated post server:

/afs/slac/g/library/bin/spires_server -rl -p allauth -tauth -dauth

This series of commands puts all the backup files in action. If sunspi4 is going to come back up soon, it might be wise NOT to start the webspi1 server and the spiauth server (1 and 3) as those servers will post updates to records on Sunspi5, which may not be desirable.

SlacSpiresPerlExpect

What follows is the POD for our current Perl<->SPIRES API, from which some of our tools are built, and from which others could be built. This may (or may not) be of interest for designing ComparisonSlacFermilabDesyCernEnrichmentScripts and the Toolset for Inspire. Note that batch and merge are internal SPIRES commands that basically can do updates to the db. Batch allows significant control over replacement of elements, appending, or overwriting, on either a record or element level. Merge is basically the same at a element-only level. Those are the only updating methods here.


DESCRIPTION
       This class inherits from Expect.pm, so you can also use the object as a
           regular Expect.pm object (see CPAN, or local man pages for further info.)

       Methods


       new()
           Takes a hash argument

            my $spires=Expect::Spires->new(
             timeout=>300,
             program=>'/u3/spisys/spires',
             debug=>'0',
            );

           timeout
               Timeout in seconds for the SPIRES process.  If this timeout is exceeded, your spires session will be lost.  The
               default is 300 seconds, which should be more than enough.

           program
               Program to talk to defaults to '/u3/spisys/spires'

          debug
               debug settings defaults to 0

           TOflag
               true if last "ask" was a timeout,reset to flase on each ask.

           Note that height will be set to 0 and set nostop is issued.  Other than that, all setup is your responsibility via ask

       ask
            $spires->ask(@commands)

           Takes 1 argument a list of commands to be sent on separate lines

           This function returns an array of the results from each command.  $results[0] is the full output (with newlines, etc)
           from spires from the first command, and so on for any further commands.  The command itself is not returned (?), based
           ont he policy that you should know because you
               asked! Commands need not be terminated by a newline.

           In scalar context returns the results of the *first* command

       number
            $spires->number(@commands)

           performs ask(@commands) finds the first line in the output containing "result" and returns the
               number on that line. Returns 0 if "Zero result" is found.  Returns
               null if no matching line is found.  Also works with Stacking commands

           Should accurately return the number of results found by the first search
               in @commands
      element
            $spires->element(@elementname)

           performs  ask("typ elemname") and extracts the values from the resulting output

           if called in array context returns array of arrays where the outer array
               is looping over the records, and the inner is looping over multiple
               occs  (tested)  both arrays start at 0.

           if called in scalar context returns the first occ of the first record (that has a non-null value for  element) (tested)

           (currently can't do multiple elems, but should soon make a new method for that...)

           Values returned are not terminated by semicolon, and are not preceded by elem names

           Returns null if there is no element, or if there is no result

       asHash
             $spires->asHash(key=><key>,db=>db)

           outputs a single record as a hash of arrays of elements, structures are arrays of hashes of arrays key and db are
           optional, otherwise outputs the first record of current result.  Ill clear any format set and not reset them!

       list
            $spires->list(elementname)

           performs  ask("typ elemname") and extracts the values from the resulting output

         in array context returns array of all values of the element, 1 entry per element value _no_ separation for diff records

           in scalar context returns first occuring element

           Note that this method is well suited for singly occuring elements since there will be one entry per record

           (currently can't do multiple elems, but should soon make a new method for that...)

           Values returned are not terminated by semicolon, and are not preceded by elem names

           Returns null if there is no element, or if there is no result

       merge
           $spi->merge($string,<$key>)

           Merges the given string into all records in the current result, unless $key is supplied in which case it merges into
           only $key.  Returns 0 if key is not found, or if no current result.

           Uses a temporary text file, so no spires size limits apply.

           Uses currently selsected db

           Returns the number of successful merges.   It compares this with the requested merges and carps if there is a differ-
           ence, but still returns number of succ.

       db
            $spi->db("hep")

           performd $spi->ask("sel hep")

       batch
           $spi->batch($string,<db>)

           batches the given string after selecting db (otherwise uses current)

           Uses a temporary text file, so no spires size limits apply.

           Returns the number of successful merges+adds.   It compares this with the requested merges/adds and carps if there is a
           difference, but still returns number of succ.

       close
            $spires->close()

           attempts to exit and do an expect soft close;

AUTHOR
       Travis C. Brooks  travis@SLAC.stanford.edu

-- TravisBrooks - 19 Oct 2007
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2015-04-11 - MikeSullivan
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Inspire All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback