Esempio n. 1
0
     completeListSize="' . $num_rows . '"
     cursor="' . $deliveredrecords . '">' . $token . "</resumptionToken>\n";
} elseif (isset($args['resumptionToken'])) {
    $restoken = '  <resumptionToken completeListSize="' . $num_rows . '"
     cursor="' . $deliveredrecords . '"></resumptionToken>' . "\n";
}
$maxrec = min(count($items) - $deliveredrecords, $MAXRECORDS);
// return records
$countrec = 0;
while ($countrec++ < $maxrec) {
    $element = $items[$countrec - 1];
    if (!$element instanceof ItemDao || !$itemModel->policyCheck($element, null, MIDAS_POLICY_READ)) {
        continue;
    }
    $identifier = $oaiprefix . $element->getUuid();
    $datestamp = formatDatestamp($element->getDateUpdate());
    $output .= '  <record>' . "\n";
    $output .= '   <header>' . "\n";
    $output .= xmlformat($identifier, 'identifier', '', 4);
    $output .= xmlformat($datestamp, 'datestamp', '', 4);
    // return the metadata record itself
    $folders = $element->getFolders();
    if (empty($folders)) {
        $errors .= oai_error('resourceIdDoesNotExist', '', $record[1]);
    }
    foreach ($folders as $folder) {
        $setspec = $setspecprefix . str_replace('/', '_', $folder->getUuid());
        $output .= xmlrecord($setspec, 'setSpec', '', 3);
    }
    $output .= '   </header>' . "\n";
    $revision = $itemModel->getLastRevision($element);
Esempio n. 2
0
// Record counter
$countrec = 0;
// Publish a batch to $maxrec number of records
$outputObj = new ANDS_Response_XML($args);
while ($countrec++ < $maxrec) {
    $record = $res->fetch(PDO::FETCH_ASSOC);
    //print_r($record);
    if ($record === false) {
        if (SHOW_QUERY_ERROR) {
            echo __FILE__ . "," . __LINE__ . "<br />";
            print_r($db->errorInfo());
            exit;
        }
    }
    $identifier = $record[$SQL['identifier']];
    $datestamp = formatDatestamp($record[$SQL['datestamp']]);
    $setspec = $record[$SQL['set']];
    // debug_var_dump('record', $record);
    if (isset($record[$SQL['deleted']]) && $record[$SQL['deleted']] === true && ($deletedRecord == 'transient' || $deletedRecord == 'persistent')) {
        $status_deleted = TRUE;
    } else {
        $status_deleted = FALSE;
    }
    //debug_var_dump('status_deleted', $status_deleted);
    if ($args['verb'] == 'ListRecords') {
        $cur_record = $outputObj->create_record();
        $cur_header = $outputObj->create_header($oaiprefix . '-' . $identifier, $datestamp, $setspec, $cur_record);
        // return the metadata record itself
        if (!$status_deleted) {
            debug_var_dump('inc_record', $inc_record);
            create_metadata($outputObj, $cur_record, $identifier, $setspec, $db);
Esempio n. 3
0
	$maxrec += $deliveredrecords;
}

// Publish a batch to $maxrec number of records
$outputObj = new ANDS_Response_XML($args);
while ($countrec++ < $maxrec) {
	$record = $res[$countrec-1];
	if ($record===false) {
		if (SHOW_QUERY_ERROR) {
			echo __FILE__.",". __LINE__."<br />";
			exit();
		}
	}

	$identifier = $oaiprefix.$record->{$SQL['identifier']};
	$datestamp = formatDatestamp($record->{$SQL['datestamp']});
	$setspec = $record->{$SQL['set']};
	
	// debug_var_dump('record', $record);
	if (isset($record->{$SQL['deleted']}) && (intval($record->{$SQL['deleted']}) === 1 ) &&
		($deletedRecord == 'transient' || $deletedRecord == 'persistent')) {
		$status_deleted = TRUE;
	} else {
		$status_deleted = FALSE;
	}
	
  //debug_var_dump('status_deleted', $status_deleted);
	if($args['verb']=='ListRecords') {
		$cur_record = $outputObj->create_record();
		$cur_header = $outputObj->create_header($identifier, $datestamp,$setspec,$cur_record);
	// return the metadata record itself