Advertisement
eremaijala

Sample Config for OAI-PMH Provider for Voyager

Jun 10th, 2014
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 8.31 KB | None | 0 0
  1. # Settings
  2. return
  3. {
  4.   # Database settings
  5.   'ORACLE_SID' => 'VGER',
  6.   'ORACLE_HOME' => '/oracle/app/oracle/product/11.2.0.3/db_1',
  7.   'db_params' => 'host=localhost;sid=VGER',
  8.   'db_username' => '',
  9.   'db_password' => '',
  10.   # If needed, the tablespace can be set to for example xxxdb
  11.   'db_tablespace' => '',
  12.   # Keyword server address and port. Only used if the set specification contains a keyword term.
  13.   'keyword_host' => 'localhost',
  14.   'keyword_port' => '11460',
  15.  
  16.   # Debug mode (0=off, 1=on, 2=verbose). Writes some debugging information into Apache error log.
  17.   'debug' => 1,
  18.  
  19.   'repository_name' => 'Test repository',
  20.   'base_url' => 'http://server.nowhere.com/cgi-bin/oai-pmh.cgi',
  21.   # Link to original record. {ID} is replaced with the record ID.
  22.   'link_url' => 'http://server.nowhere.com/cgi-bin/Pwebrecon.cgi?DB=local&v1=1&Search_Arg=001A+{ID}&Search_Code=CMD&CNT=10',
  23.   # Whether links as above will be created in the records.
  24.   # 0 = no
  25.   # 1 = yes
  26.   'create_links' => 1,
  27.   # Repository id and delimiter used to create OAI-PMH style identifiers from the record id (e.g. oai:server.nowhere.com:12345)
  28.   'repository_id' => 'server.nowhere.com',
  29.   'id_delimiter' => ':',
  30.   'admin_email' => 'nobody@nowhere.com',
  31.  
  32.   # Allowed IP addresses (leave empty [] for no limitations)
  33.   # Delimiter for ranges is dash e.g. '192.168.0.1-192.168.0.5'
  34.   'allowed_ips' => ['127.0.0.1', '127.0.0.2'],
  35.  
  36.   # Deletion files (e.g. /m1/voyager/xxxdb/rpt/deleted.bib.marc)
  37.   'deleted_bib_file' => ['/m1/voyager/xxxdb/rpt/deleted.bib.marc', '/m1/voyager/xxxdb/local/rpt/deleted.bib.marc'],
  38.   # Deleted MFHD file is only needed when include_holdings below is > 0 and file name is customized.
  39.   # Normally not needed as it is determined from the path of deleted.bib.marc.
  40.   #'deleted_mfhd_file' => ['/m1/voyager/xxxdb/rpt/deleted.mfhd.marc', '/m1/voyager/xxxdb/local/rpt/deleted.mfhd.marc'],
  41.   'deleted_auth_file' => '/m1/voyager/xxxdb/rpt/deleted.auth.marc',
  42.   # Whether to return metadata for deleted records
  43.   # 0 = no metadata is returned (standard-compliant)
  44.   # 1 = metadata is returned (not standard-compliant)
  45.   'return_deleted_metadata' => 0,
  46.  
  47.   # Whether to return anything when a set is not specified
  48.   # 0 = do not return anything
  49.   # 1 = return all records
  50.   'return_all_for_empty_set' => 0,
  51.   # Maximum number of records returned for a single query (next set can be requested with the resumptionToken)
  52.   'max_records' => 300,
  53.   # How often the script will send the client a line feed to keep the connection from timing out if the query takes a long time.
  54.   'keep_alive_interval' => 30,
  55.  
  56.   # Which fields to strip from the records
  57.   # (wildcard = #, e.g 100 = complete field, 100d = just subfield d of field 100, 9## = all fields beginning with 9)
  58.   'strip_fields' => ['903', '999'],
  59.  
  60.   # Whether to include holdings and availability information in the returned (bibliographic) records
  61.   # 0 = don't include holdings information
  62.   # 1 = include holdings information
  63.   # 2 = include holdings and availability information (for Primo)
  64.   'include_holdings' => 0,
  65.  
  66.   # Whether to include suppressed holdings (0 = no, 1 = yes)
  67.   'include_suppressed_holdings' => 0,
  68.  
  69.   # Institution code in the holdings information (e.g. the database name xxxdb)
  70.   'holdings_institution_code' => 'xxxdb',
  71.  
  72.   # Sets
  73.   # id: the set spec
  74.   # name: description
  75.   # record_type: A = authority records
  76.   #              B = bibliographic records (default)
  77.   #
  78.   # The rules below are only available for bibliographic records with the exception of filter procedure.
  79.   #
  80.   # rec_formats: Comma-separated list of types of record and bibliographic levels (leader positions 6-7,
  81.   #              for example 'am' for monographic material).
  82.   #              Either character can be replaced with _ (underscore) to indicate any value.
  83.   #              Prepend an entry with ! to make it NOT match the given format.
  84.   # locations:   Comma-separated list of location id's.
  85.   #              Prepend an entry with ! to make it NOT match the given location.
  86.   # create_locations: Comma-separated list of happening location id's of record creation.
  87.   #              Prepend an entry with ! to make it NOT match the given location.
  88.   # happening_locations: Comma-separated list of happening location id's of record manipulation (any event in BIB_HISTORY).
  89.   #              Prepend an entry with ! to make it NOT match the given location.
  90.   #              Note: As this matches any action type, it is typically only usable with further filtering in filter procedure.
  91.   # keyword:     A keysrv word search command. Examples:
  92.   #              IN("FIN","041A")
  93.   #              IN("ELE*","036A")
  94.   #              AND(IN("ELE*","036A"),IN("ELE*","036A"))
  95.   #              IN(PHRASE("1600","LUKU"),"650A") # ("1600-luku")
  96.   #              Special characters: Å = \xC3\x80, Ä = \xC3\x81, Ö = \xC3\x82
  97.   #              Note that the commands must not include extra spaces etc. keysrv is very strict with the syntax.
  98.   # filter:      A procedure that's executed for each record. The procedure must return 1 if the record is accepted.
  99.   #              The procedure will get three parameters: marc data, bib ID and database connection handle.
  100.   # mfhd_callno: NORMALIZED call number.
  101.   # pub_places:  Comma-separated list of publication places (008 positions 15-17).
  102.   #              Wildcards _ (single character) and % (any number of characters) can be used.
  103.   #              Prepend an entry with ! to make it NOT match the given publication place.
  104.   # languages:   Comma-separated list of languages (008 positions 35-37).
  105.   #              Wildcards _ (single character) and % (any number of characters) can be used.
  106.   #              Prepend an entry with ! to make it NOT match the given language.
  107.   # suppressed:  0 = records suppressed in OPAC are not returned
  108.   #              any other value = records suppressed in OPAC are returned
  109.   #
  110.   # component_parts: 0 = fetch component parts if they match other rules
  111.   #                  1 = fetch component parts if their host items match the keyword rule
  112.   #                  2 = fetch component parts for all matching host items
  113.   #
  114.   # rule_operator: and = all of rec_formats, locations, mfhd_callno, pub_places, languages in the set must match
  115.   #                or = any of rec_formats, locations, mfhd_callno, pub_places, languages in the set must match
  116.   #
  117.   # Example:
  118.   # id => 'elektra', name => 'Elektra collection', rec_formats => '', locations => '', keyword => 'IN("ELE*","036A")',
  119.   #    filter => sub {
  120.   #      my ($marcdata, $rec_id, $dbh) = @_;
  121.   #      my $f041a = get_subfield(get_field($marcdata, '041'), 'a');
  122.   #      return ($f041a && $f041a =~ /^FIN$/i) ? 1 : 0;
  123.   #    },
  124.   #    component_parts => 0
  125.  
  126.   'sets' => [
  127.     {id => 'ethesis', name => 'Electronic thesis', record_type => 'B', rec_formats => '', locations => '259', keyword => '', filter => undef, mfhd_callno => '', component_parts => 0},
  128.     {id => 'elektra', name => 'Elektra collection', record_type => 'B', rec_formats => '', locations => '',
  129.       keyword => 'OR(IN("ELE0*","036A"),IN("ELE1*","036A"),IN("ELE2*","036A"),IN("ELE3*","036A"),IN("ELE4*","036A"),IN("ELE5*","036A"),IN("ELE6*","036A"),IN("ELE7*","036A"),IN("ELE8*","036A"),IN("ELE9*","036A"))',
  130.       filter => undef, mfhd_callno => '', component_parts => 0},
  131.     {id => 'auth', name => 'Authority records', record_type => 'A'},
  132.     {id => 'serials', name => 'Serials', rec_formats => '_b,_s', locations => '',
  133.       keyword => '', filter => undef, mfhd_callno => '', component_parts => 0},
  134.     {id => 'books', name => 'Books', rec_formats => 'a_,t_,!_b,!_s', locations => '',
  135.       keyword => '', filter => undef, mfhd_callno => '', component_parts => 0},
  136.     {id => 'books:arabic', name => 'Arabic books', rec_formats => 'a_,t_,!_b,!_s', locations => '',
  137.       keyword => 'IN("DCLN*","035A")', filter => undef, mfhd_callno => '', component_parts => 0},
  138.     {id => 'books:us', name => 'U.S. books', rec_formats => 'a_,t_,!_b,!_s', locations => '',
  139.       keyword => '', filter => undef, mfhd_callno => '', pub_places => 'uc,up,us,vi,__u', component_parts => 0},
  140.     {id => 'books:us:eng', name => 'U.S. books in English', rec_formats => 'a_,t_,!_b,!_s', locations => '',
  141.       keyword => '', filter => undef, mfhd_callno => '', pub_places => 'uc,up,us,vi,__u', languages => 'eng', component_parts => 0},
  142.   ],
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement