Skip to content

Commit

Permalink
Fix bug when databasename have hyphen on name (changed internal separ…
Browse files Browse the repository at this point in the history
…ator for @). Removed unused files. Renamed search.xis for getrecord.xis
  • Loading branch information
viniciusandrade committed Jun 29, 2012
1 parent 6032319 commit 53c0abc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 126 deletions.
4 changes: 2 additions & 2 deletions htdocs/isis-oai-provider/lib/ISISDb.php
Expand Up @@ -23,8 +23,8 @@ function get_list($params){
return wxis_list($params);
}

function search($params, $key_length){
return utf8_encode ($this->wxis_document_get( $this->wxis_url("search.xis", $params, $key_length) ));
function getrecord($params, $key_length){
return utf8_encode ($this->wxis_document_get( $this->wxis_url("getrecord.xis", $params, $key_length) ));
}

function getidentifiers($params, $key_length){
Expand Down
8 changes: 4 additions & 4 deletions htdocs/isis-oai-provider/lib/ISISItem.php
Expand Up @@ -10,14 +10,14 @@ function ISISItem($ItemId, $datestamp = NULL, $SearchInfo = NULL)
# save ID for later use
$this->Id = $ItemId;
$this->datestamp = $datestamp;
$id_parts = explode('-', $ItemId);
$id_parts = explode('@', $ItemId);
$this->DBName = $id_parts[0];

$this->Resource = new ISISDb($this->DBName);
}

function GetId() {
return $this->Id;
function GetId() {
return str_replace('@', '-', $this->Id);
}

function GetDatestamp()
Expand All @@ -34,7 +34,7 @@ function GetMetadata($MetadataFormat)
$key_length = $DATABASES[$this->DBName]['isis_key_length'];
$id_field = $DATABASES[$this->DBName]['identifier_field'];

$record_xml = $this->Resource->search(
$record_xml = $this->Resource->getrecord(
array('expression' => $this->Id . "/($id_field)", 'metadata_format' => $MetadataFormat,
'mapping_file' => $mapping_file), $key_length);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/isis-oai-provider/wxis/getidentifiers.xis
Expand Up @@ -34,7 +34,7 @@
<loop>
<field action="import" tag="list">5004/5007</field>

<display><pft type="reload"><pft>`v5004'-'`,`v`v5006,`'^'`,`v`v5007,`'|'`</pft></pft></display>
<display><pft type="reload"><pft>`v5004'@'`,`v`v5006,`'^'`,`v`v5007,`'|'`</pft></pft></display>
</loop>
</do>

Expand Down
87 changes: 0 additions & 87 deletions htdocs/isis-oai-provider/wxis/getitem.xis

This file was deleted.

@@ -1,4 +1,4 @@
<IsisScript name="search">
<IsisScript name="getrecord">

<section name="search">
<!-- CGI environment -->
Expand All @@ -17,10 +17,11 @@
<display><pft>'Content-type: text/xml'/#</pft></display>
<do task="search">
<parm name="db"><pft>v6001</pft></parm>
<field action="replace" tag="6002" split="occ"><pft>proc('Gsplit/clean=6002=@')</pft></field>

<field action="replace" tag="6002" split="occ"><pft>proc('Gsplit/clean=6002=-')</pft></field>

<parm name="expression"><pft>v6002[2]</pft></parm>
<!-- search by id_number/(inverted field) OR ID=id_number OR ID_id_number -->
<parm name="expression"><pft>v6002[2], ' OR ID=',v6002[2],' OR ID_',v6002[2]</pft></parm>
<parm name="count">1</parm>

<flow action="jump"><pft>s(mpu,v6003,mpl)</pft></flow>

Expand Down
28 changes: 0 additions & 28 deletions htdocs/isis-oai-provider/wxis/list.xis

This file was deleted.

0 comments on commit 53c0abc

Please sign in to comment.