Author: fortim
Date: Sun Sep 27 14:38:23 2009
New Revision: 3557

Log:
Only show published records in OAI

Modified:
   trunk/apps/qubit/modules/oai/actions/listRecordsComponent.class.php
   trunk/apps/qubit/modules/oai/templates/_listRecords.xml.php
   trunk/apps/qubit/modules/oai/templates/oaiSuccess.xml.php

Modified: trunk/apps/qubit/modules/oai/actions/listRecordsComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/oai/actions/listRecordsComponent.class.php Sun Sep 
27 14:07:51 2009        (r3556)
+++ trunk/apps/qubit/modules/oai/actions/listRecordsComponent.class.php Sun Sep 
27 14:38:23 2009        (r3557)
@@ -72,7 +72,15 @@
 
     //Get the records according to the limit dates and collection
     $this->records = QubitInformationObject::getUpdatedRecords($this->from, 
$this->until, $collection);
-    $this->recordsCount = count($this->records);
+    $this->publishedRecords = array();
+    foreach ($this->records as $record)
+    {
+      if ($record->getPublicationStatus()->statusId == 
QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID)
+      {
+        $this->publishedRecords[] = $record;
+      }
+    }
+    $this->recordsCount = count($this->publishedRecords);
     $this->path = $request->getUriPrefix().$request->getPathInfo();
 
     $this->attributesKeys = array_keys($this->attributes);

Modified: trunk/apps/qubit/modules/oai/templates/_listRecords.xml.php
==============================================================================
--- trunk/apps/qubit/modules/oai/templates/_listRecords.xml.php Sun Sep 27 
14:07:51 2009        (r3556)
+++ trunk/apps/qubit/modules/oai/templates/_listRecords.xml.php Sun Sep 27 
14:38:23 2009        (r3557)
@@ -2,7 +2,7 @@
   <error code="noRecordsMatch">The combination of the values of the from, 
until, set and metadataPrefix arguments results in an empty list.</error>
 <?php else:?>
   <ListRecords>
-  <?php foreach($records as $record): ?>
+<?php foreach($publishedRecords as $record): ?>
 <?php $requestname->setAttribute('informationObject', $record) ?>
    <record>
     <header>

Modified: trunk/apps/qubit/modules/oai/templates/oaiSuccess.xml.php
==============================================================================
--- trunk/apps/qubit/modules/oai/templates/oaiSuccess.xml.php   Sun Sep 27 
14:07:51 2009        (r3556)
+++ trunk/apps/qubit/modules/oai/templates/oaiSuccess.xml.php   Sun Sep 27 
14:38:23 2009        (r3557)
@@ -2,5 +2,5 @@
 <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ 
http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd";>
   <responseDate><?php echo $date ?></responseDate>
   <request<?php echo $sf_data->getRaw('requestAttributes')?>><?php echo 
$sf_data->getRaw('path') ?></request>
-          <?php eval(include_component('oai', $verb)) ?>
-</OAI-PMH>
+<?php eval(include_component('oai', $verb)) ?>
+</OAI-PMH>
\ No newline at end of file

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to