Пример #1
0
 /**
  * Return OAIIdentifier object from database row.
  * @param $row array
  * @return OAIIdentifier
  */
 function &_returnIdentifierFromRow(&$row)
 {
     $oaiRecord = new OAIRecord();
     $oaiRecord->identifier = $this->oai->recordIdToIdentifier($row['record_id']);
     $oaiRecord->datestamp = OAIUtils::UTCDate(strtotime($this->datetimeFromDB($row['datestamp'])));
     $oaiRecord->sets = array($row['archive_id']);
     return $oaiRecord;
 }
Пример #2
0
 /**
  * Return OAIIdentifier object from database row.
  * @param $row array
  * @return OAIIdentifier
  */
 function &_returnIdentifierFromRow(&$row)
 {
     $record = new OAIRecord();
     $conference =& $this->getConference($row['conference_id']);
     $schedConf =& $this->getSchedConf($row['sched_conf_id']);
     $track =& $this->getTrack($row['track_id']);
     $record->identifier = $this->oai->paperIdToIdentifier($row['paper_id']);
     $record->datestamp = OAIUtils::UTCDate(strtotime($this->datetimeFromDB($row['last_modified'])));
     $record->sets = array($conference->getPath() . ':' . $track->getLocalizedAbbrev());
     return $record;
 }
Пример #3
0
 /**
  * Common operations for OAIRecord and OAIIdentifier object data set.
  * @param $record OAIRecord/OAIIdentifier
  * @param $row array
  * @return OAIRecord/OAIIdentifier
  */
 function _doCommonOAIFromRowOperations($record, $row)
 {
     $record->datestamp = OAIUtils::UTCDate(strtotime($this->datetimeFromDB($row['last_modified'])));
     if (isset($row['tombstone_id'])) {
         $record->identifier = $row['oai_identifier'];
         $record->sets = array($row['set_spec']);
         $record->status = OAIRECORD_STATUS_DELETED;
     } else {
         $record->status = OAIRECORD_STATUS_ALIVE;
         $record = $this->setOAIData($record, $row, is_a($record, 'OAIRecord'));
     }
     return $record;
 }
Пример #4
0
 /**
  * Return OAIIdentifier object from database row.
  * @param $row array
  * @return OAIIdentifier
  */
 function &_returnIdentifierFromRow(&$row)
 {
     $journal =& $this->getJournal($row['journal_id']);
     $section =& $this->getSection($row['section_id']);
     $record = new OAIRecord();
     $record->identifier = $this->oai->articleIdToIdentifier($row['article_id']);
     $record->datestamp = OAIUtils::UTCDate(strtotime($this->datetimeFromDB($row['last_modified'])));
     $record->sets = array($journal->getPath() . ':' . $section->getLocalizedAbbrev());
     return $record;
 }
Пример #5
0
 /**
  * Output OAI response.
  * @param $response string text of response message.
  * @param $printParams boolean display request parameters
  */
 function response($response, $printParams = true)
 {
     header('Content-Type: text/xml');
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<?xml-stylesheet type=\"text/xsl\" href=\"" . PKPRequest::getBaseUrl() . "/lib/pkp/xml/oai2.xsl\" ?>\n" . "<OAI-PMH xmlns=\"http://www.openarchives.org/OAI/2.0/\"\n" . "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" . "\txsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/\n" . "\t\thttp://www.openarchives.org/OAI/2.0/OAI-PMH.xsd\">\n" . "\t<responseDate>" . OAIUtils::UTCDate() . "</responseDate>\n" . "\t<request";
     // print request params, if applicable
     if ($printParams) {
         foreach ($this->params as $k => $v) {
             echo " {$k}=\"" . OAIUtils::prepOutput($v) . "\"";
         }
     }
     echo ">" . OAIUtils::prepOutput($this->config->baseUrl) . "</request>\n" . $response . "</OAI-PMH>\n";
 }