code/pagetypes/BrowseCataloguePage.php
/**
     * Parses the response from the catalogue and extracts the information we want from DC type records.
     *
     * @param  DOMDocument  $doc
     * @return Array
     */
Parses the response from the catalogue and extracts the information we want from DC type records.
@param  DOMDocument  $doc
@return Array
Parses the response from the catalogue and extracts the information we want from DC type records . @param DOMDocument $doc @return Array
protected function parseSummaryDC($doc)
    {
        $response = $doc->getElementsByTagNameNS('http://www.opengis.net/cat/csw/2.0.2', "GetRecordsResponse");
        $status = $response->item(0)->getElementsByTagName("SearchResults");
        $numberOfRecordsMatched = $status->item(0)->getAttribute('numberOfRecordsMatched');
        $numberOfRecordsReturned = $status->item(0)->getAttribute('numberOfRecordsReturned');
        $nextRecord = $status->item(0)->getAttribute('nextRecord');
        $metadata = $response->item(0)->getElementsByTagName("Record");
        $mdArray = array();
        foreach ($metadata as $item) {
            $mdItem = array();
            foreach ([
                'identifier' => 'fileIdentifier',
                'title' => 'MDTitle',
                'description' => 'MDAbstract',
            ] as $tag => $prop) {
                $element = $item->getElementsByTagName($tag);
                if ($element->length > 0) {
                    $mdItem[$prop] = $element->item(0)->nodeValue;
                }
            }
            $mdArray[] = ArrayData::create($mdItem);
        }
        return array($numberOfRecordsMatched, $nextRecord, $mdArray);
    }
protected function parseSummaryDC ( $ doc ) { $ response = $ doc -> getElementsByTagNameNS ( 'http://www.opengis.net/cat/csw/2.0.2' , " GetRecordsResponse " ) ; $ status = $ response -> item ( 0 ) -> getElementsByTagName ( " SearchResults " ) ; $ numberOfRecordsMatched = $ status -> item ( 0 ) -> getAttribute ( 'numberOfRecordsMatched' ) ; $ numberOfRecordsReturned = $ status -> item ( 0 ) -> getAttribute ( 'numberOfRecordsReturned' ) ; $ nextRecord = $ status -> item ( 0 ) -> getAttribute ( 'nextRecord' ) ; $ metadata = $ response -> item ( 0 ) -> getElementsByTagName ( " Record " ) ; $ mdArray = array ( ) ; foreach ( $ metadata as $ item ) { $ mdItem = array ( ) ; foreach ( [ 'identifier' => 'fileIdentifier' , 'title' => 'MDTitle' , 'description' => 'MDAbstract' , ] as $ tag => $ prop ) { $ element = $ item -> getElementsByTagName ( $ tag ) ; if ( $ element -> length > 0 ) { $ mdItem [ $ prop ] = $ element -> item ( 0 ) -> nodeValue ; } } $ mdArray [ ] = ArrayData :: create ( $ mdItem ) ; } return array ( $ numberOfRecordsMatched , $ nextRecord , $ mdArray ) ; }
Parses the response from the catalogue and extracts the information we want from DC type records.
Parses the response from the catalogue and extracts the information we want from DC type records .
// get search summary