Procedural File: oai20.php
Source Location: /lodel/src/oai20.php
Page Details
Fichier OAI - script du dépot OAI
Ce fichier reçoit les commande OAI et fait renvoit le XML associé Mostly taken and often adapted from OAI V2 Data-Provider, Heinrich Stamerjohanns, stamer@uni-oldenburg.de, http://physnet.uni-oldenburg.de/oai Code fortement repris/inspire de celui d''OAI V2 Data-Provider' par Heinrich Stamerjohanns : stamer@uni-oldenburg.de, http://physnet.uni-oldenburg.de/oai PHP versions 4 et 5 LODEL - Logiciel d'Edition ELectronique. Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse Home page: http://www.lodel.org E-Mail: lodel@lodel.org All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
| Author: | Loïc Bontonou |
| Author: | Jean Lamy |
| Author: | Ghislain Picard |
| Author: | Bruno Cénou |
| Version: | CVS:$Id: |
| Copyright: | 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou |
| Copyright: | 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse |
| Filesource: | Source Code for this file |
Includes
If error messages were generated, they are displayed and the program ends.
Si des messages d'erreur ont ete generes, ils sont affiches et l'execution du programme se termine.
List of OAI-referenced entities.
Construit la liste des entites referencees par l'OAI.
Displays the response.
Affichage de la reponse.
Functions
check_identifier [line 624]
void check_identifier(
string $val
)
|
|
Tests the 'Identifier' argument.
Verifie la validite de l'information liee a l'argument 'Identifier'.
Parameters:
|
string |
$val: |
la valeur de l'identifier OAI |
void check_mdp(
string $val
)
|
|
Tests the 'metadataPrefix' argument.
Verifie la validite de l'information liee a l'argument 'metadataPrefix'.
Parameters:
|
string |
$val: |
la valeur à vérifier |
ListRecords and ListIdentifiers accept the same parameters, the shared tests are regrouped in this function.
ListRecords et ListIdentifiers acceptent les meme parametres, les tests communs sont donc regroupes dans cette fonction.
clean_expired_tokens [line 264]
void clean_expired_tokens(
)
|
|
Deletes outdated tokens from table oaitokens.
Supprime les tokens dont la date de validite est depassee.
la dc_rename(
string $str
)
|
|
dc types are defined in lodel's database using the template : "dc.name" to fit the OAI protocol, we have to rename them using the template "dc:name"
les types dc sont definis dans la base de donnees en utilisant la forme "dc.nom", on les renomme en "dc:nom" pour coller au protocole OAI
Parameters:
|
string |
$str: |
la chaine à modifier |
API Tags:
rien del_token(
string $token
)
|
|
Deletes a token from table oaitokens once it has been used.
Une fois un token exploite, il est retire de la table oaitokens.
Parameters:
get_dc_description [line 337]
un get_dc_description(
integer $id
)
|
|
Uses $id_class_fields to get the name of an entity's dc.description field, extract its content from the database and return it.
A partir de la table mettant en relation un id d'entite avec le nom de sa classe et celui du champ dc.description correspondant, on renvoit le contenu de ce champ dc.descrition.
Parameters:
|
integer |
$id: |
l'identifiant de l'entité |
API Tags:
get_dc_language [line 365]
un get_dc_language(
integer $id
)
|
|
Uses $id_class_fields to get the name of an entity's dc.language field, extract its content from the database and return it.
A partir de la table mettant en relation un id d'entite avec le nom de sa classe et celui du champ dc.language correspondant, on renvoit le contenu de ce champ dc.language.
Parameters:
|
integer |
$id: |
l'identifiant de l'entité |
API Tags:
get_token_info [line 206]
un get_token_info(
string $token
)
|
|
Extracts a token's infos from the database.
If the token doesn't exist, the error is handled in the 'verbs_processing' function. Extrait de la bd les infos concernant le token. Si le token n'existe pas, l'erreur est traitee par la suite dans la fonction "verbs_processing".
Parameters:
API Tags:
illegal_parameters [line 646]
void illegal_parameters(
)
|
|
Tests for illegal parameters and generate the appropriate error messages.
Traite la presence d'arguments illegaux en generant le message d'erreur approprie.
void insert_token(
string $token, string $where, string $metadataprefix, integer $deliveredrecords, datetime $expirationdatetime
)
|
|
Inserts new token in table oaitokens.
Insere un nouveau token dans la table oaitokens.
Parameters:
|
string |
$token: |
le token |
|
string |
$where: |
la clause where |
|
string |
$metadataprefix: |
le format de métadonnées de la requête |
|
integer |
$deliveredrecords: |
le nombre d'enregistrements délivrés |
|
datetime |
$expirationdatetime: |
le datetime d'expiration du token. |
void log_access(
$hostname, [ $denied = 0]
)
|
|
Parameters:
une oai_error(
string $code, [string $argument = ''], [string $value = '']
)
|
|
Generates OAI error messages.
Genere les messages d'erreur OAI.
Parameters:
|
string |
$code: |
le code d'erreur |
|
string |
$argument: |
l'argument passé. Par défaut vide |
|
string |
$value: |
la valeur de l'argument. Par défaut vide |
API Tags:
| Return: | chaine xml d'erreur <error code="">message</error> |
le sql2TS(
string $date
)
|
|
Transforme une date SQL en timestamp unix
Parameters:
|
string |
$date: |
la date au format datetime de MySQL |
API Tags:
la strip_amp(
string $str
)
|
|
Remplace les & par des & dans une chaine
Parameters:
|
string |
$str: |
la chaine à modifier |
API Tags:
la strip_set(
string $str
)
|
|
Only a limited set of characters is available for sets' names.
This filter replaces the unapropriate characters by valid ones. Les noms de sets ne peuvent comporter qu'un ensemble limite de caracteres. Ce filtre remplace les caracteres inappropries.
Parameters:
|
string |
$str: |
la chaine à modifier |
API Tags:
verbs_processing [line 384]
Tests the 'verb' argument.
la xmlstr(
string $string, [string $charset = 'utf-8'], [boolean $xmlescaped = false]
)
|
|
Transforme une chaine pour l'inclure dans un fichier XML
Parameters:
|
string |
$string: |
la chaine de caractères |
|
string |
$charset: |
le jeu de caractère de la chaine (utf-8 par défaut). |
|
boolean |
$xmlescaped: |
un boolean indiquant si le xml doit être échappé ou non. Par défaut à false. |
API Tags:
|
|