"badArgument":"The request includes illegal arguments, is missing required arguments, includes a repeated argument, or values for arguments have an illegal syntax:",
"badResumptionToken":"The value of the resumptionToken argument is invalid or expired:",
"badVerb":"Value of the verb argument is not a legal OAI-PMH verb, the verb argument is missing, or the verb argument is repeated:",
"cannotDisseminateFormat":"The metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository:",
"idDoesNotExist":"The value of the identifier argument is unknown or illegal in this repository:",
"noRecordsMatch":"The combination of the values of the from, until, set and metadataPrefix arguments results in an empty list:",
"noMetadataFormats":"There are no metadata formats available for the specified item:",
"noSetHierarchy":"The repository does not support sets:"
Gets list of field 'field' for the record with 'recid' system number.
"""
digit=field[0:2]
bibbx="bib%sx"%digit
bibx="bibrec_bib%sx"%digit
query="SELECT bx.value FROM %s AS bx, %s AS bibx WHERE bibx.id_bibrec=%%s AND bx.id=bibx.id_bibxxx AND bx.tag=%%s"%(wash_table_column_name(bibbx),wash_table_column_name(bibx))
"""Returns the first database BIB ID for the OAI identifier 'identifier', if it exists."""
recid=None
ifidentifier:
query="SELECT DISTINCT(bb.id_bibrec) FROM bib%sx AS bx, bibrec_bib%sx AS bb WHERE bx.tag=%%s AND bb.id_bibxxx=bx.id AND bx.value=%%s"%(CFG_OAI_ID_FIELD[0:2],CFG_OAI_ID_FIELD[0:2])
res=run_sql(query,(CFG_OAI_ID_FIELD,identifier))
forrowinres:
recid=row[0]
returnrecid
defget_set_last_update(set_spec=""):
"""
Returns the last_update of a given set (or of all sets) in UTC
"""
ifset_spec:
last_update=run_sql("SELECT DATE_FORMAT(MAX(last_updated),'%%Y-%%m-%%d %%H:%%i:%%s') FROM oaiREPOSITORY WHERE setSpec=%s",(set_spec,))[0][0]
else:
last_update=run_sql("SELECT DATE_FORMAT(MAX(last_updated),'%Y-%m-%d %H:%i:%s') FROM oaiREPOSITORY")[0][0]