Export Records plug-in can be used to export one or more records in specified formats to specified destinations.
Currently supported (or under development) are export of RIS and SP records and lists of permanent URL's. These outputs can so far be exported by email or file download.
The record(s) to be exported can come from the record cache (see RecordCachePlugin) or from the current search results or a currently displayed record.
Assuming the plug-in has been mapped to the exportrecords chain (see configuration) it is invoked with:
GET /service-proxy/?command=exportrecords
Valid parameters are action, source, output, id, emailfrom, emailto, windowid
Specifies the channel to use for the export. Possible values so far are:
The parameter source specifies where Service Proxy should look for the record(s) to export. The parameter is mandatory and possible values are:
For exports of an individual record in a merged set of records, a location number can be provided to pick the desired (sub-)record. Currently this will only affect RIS exports. If a location number is provided, that (sub-)record will be used to populate the RIS file. If no location number is given, the RIS formatter will randomly choose the first location.
The first location in the merged set will have location number '1'.
Specifies the format of the records to export. The parameter is mandatory and possible values are:
Multiple outputs can be requested in one export command.
If the source is show, a record id must be provided on the request.
If the source is basket, a record id can be provided to export just one record.
The email address that should appear as from-address on e-mails.
This address can be set in the Service Proxy configuration as well. If it is not defined in the configuration then it is a mandatory request parameter. If it is provided in both places then the request parameter will take precedence.
The email address to which the exported records should be e-mailed. It is mandatory when action is sendmail.
Must be provided if the sites runs multiple parallel Pazpar2 sessions by means of browser window names
Examples:
Export a record for a search result as a file for download, output format SP XML. GET /service-proxy/?command=exportrecords&action=getfile&source=show&id=[pazpar2 recid]&output=sp&windowid=mkid_1234 Export a file from a record as a RIS file attached to an email. GET /service-proxy/?command=recordrecords&action=sendmail&source=record&emailfrom=some@mail.com&emailto=some@mail.com&output=ris&windowid=mkid_1234 Export all records in the basket as a list of URLs, by email. GET /service-proxy/?command=recordrecords&action=sendmail&source=basket&emailfrom=some@mail.com&emailto=some@mail.com&output=url&windowid=mkid_1234 Export all records in the basket as a list of URLs and a number of attached RIS files by email. The URL list HTML formatted. GET /service-proxy/?command=recordrecords&action=sendmail&source=basket&emailfrom=some@mail.com&emailto=some@mail.com&output=url&output=ris&windowid=mkid_1234 Export all records in the basket as a list of URLs (HTML file) and a number of RIS files, packed in a Zip file GET /service-proxy/?command=recordrecords&action=getfile&source=basket&output=url&output=ris&windowid=mkid_1234
This plug-in is configured in service-proxy.properties or equivalent as follows:
plugins.exportrecords = com.indexdata.serviceproxy.plugins.ExportRecordsPlugin
The plug-in currently only maps to its own chain.
chains.exportrecords = exportrecords
exportrecords.BRANDING = Custom Discovery # Text to appear in e-mails etc. # Optional. Default "MasterKey" exportrecords.EMAIL_FROM = person@indexdata.com # Optional. Overridden by # request parameter 'emailfrom' # if present. # Email configuration - without authentication exportrecords.SMTP_HOST_NAME = unauth.indexdata.com # Mandatory. exportrecords.SMTP_SSL = false # Optional. Default false. exportrecords.SMTP_PORT = 25 # Mandatory exportrecords.SMTP_AUTH = false # Optional. Default false. # Email configuration - with authentication and encryption exportrecords.SMTP_HOST_NAME = auth.indexdata.com # Mandatory. exportrecords.SMTP_SSL = true # Optional. Default false; exportrecords.SMTP_PORT = 465 # Mandatory. exportrecords.SMTP_AUTH = true # Optional. Default false. exportrecords.SMTP_AUTH_AES = cred # Optional. Default "no-key" # If set it must point to # an AES file for decrypting # user name and password. # The file must be present in # the SP configuration directory # for the site. exportrecords.SMTP_AUTH_USER = BJ13aVq6Rb2tMffYyr8nYw== # User name # Mandatory if SMTP_AUTH is true, # otherwise ignored. # If SMTP_AUTH_AES is not set, # this should be clear text instead. exportrecords.SMTP_AUTH_PWD = NDtpmZ+4uAo/KdQDbLteqw== # Password # Mandatory if SMTP_AUTH is true, # otherwise ignored. # If SMTP_AUTH_AES is not set, # this should be clear text instead. exportrecords.PERMALINK_PROTOCOL = http # The protocol to use in exported # record URL's. # Optional. Default "http" exportrecords.PERMALINK_DOMAIN = ${thisHost} # The domain to use in exported # record URL's. # Optional. Defaults to the host to # which the export request was made # (which would be the same as # ${thisHost}) exportrecords.PERMALINK_PATH = item.html # The path to use in the exported # record URL. # Mandatory. exportrecords.PERMALINK_REC_ID= prefixrecid=rec_${recid} # The format of the record ID # parameter as it must be provided # to the given path. # Mandatory. exportrecords.RIS_FIELD_MAP = IS=md-issue, XY=md-somefield, UR= # Comma separated list of mappings that # will override, add to, or hide the # plug-in's default mappings of pazpar2 # fields to RIS tags. # # The format is: # # [RIS tag name]=[pazpar2 field name] # # TO ommit a default field: # # [RIS tag name]= # # Optional parameter. Default: No mappings # beyond the defaults in the plug-in. # # RIS tags that are handled by default # mappings in the plug-in are: # TY,TI,AU,Y1,SP,EP,SN, # JF,VL,PB,IS,KW,UR,ER exportrecords.RIS_MEDIUM_TY_MAP = book=MYBOOK, book (electronic)=MYEBOOK # Overrides and/or adds extra mappings # from md-medium values to TY values. # # The default values in the plug-in are: # # picture - ART # book (electronic) - EBOOK # book - BOOK # electronic - ELEC # electronicresource - ELEC # web (electronic) - ELEC # web - ELEC # microform - GEN # other - GEN # realia - GEN # article (electronic) - EJOUR # article - JOUR # journal (electronic) - EJOUR # journal - JOUR # map (electronic) - MAP # map - MAP # music-score (electronic)- MUSIC # music-score - MUSIC # newspaper (electronic) - NEWS # newspaper - NEWS # recording (electronic) - SOUND # recording - SOUND # recording-cassette - SOUND # recording-cd - SOUND # recording-vinyl - SOUND # soundrecording - SOUND # thesis (electronic) - THES # thesis - THES # video (electronic) - VIDEO # video - VIDEO # video-blu-ray - MPCT # video-dvd - MPCT # videorecording - VIDEO # video-vhs - MPCT