code/pagetypes/BrowseCataloguePage.php
/**
     * From the geocatalogue module, parses the response from the catalogue and extracts the information
     * we want from MCP ISO type records. This has not been altered in any way from the geocatalogue module function.
     *
     * @param  DOMDocument  $doc
     * @return Array
     */
From the geocatalogue module, parses the response from the catalogue and extracts the information
we want from MCP ISO type records. This has not been altered in any way from the geocatalogue module function.

@param  DOMDocument  $doc
@return Array
From the geocatalogue module parses the response from the catalogue and extracts the information we want from MCP ISO type records . This has not been altered in any way from the geocatalogue module function . @param DOMDocument $doc @return Array
protected function parseSummaryISO($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)->getElementsByTagNameNS("http://bluenet3.antcrc.utas.edu.au/mcp", "MD_Metadata");
        $mdArray = array();
        $gmd = 'http://www.isotc211.org/2005/gmd';
        $gco = 'http://www.isotc211.org/2005/gco';
        foreach ($metadata as $item) {
            $mdItem = array();
            $element = $item->getElementsByTagNameNS($gmd, "fileIdentifier");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gco, 'CharacterString');
                $mdItem['fileIdentifier'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "metadataStandardName");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gco, 'CharacterString');
                $mdItem['metadataStandardName'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "metadataStandardVersion");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gco, 'CharacterString');
                $mdItem['metadataStandardVersion'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "parentIdentifier");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gco, 'CharacterString');
                $mdItem['parentIdentifier'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "hierarchyLevel");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gmd, 'MD_ScopeCode');
                $mdItem['hierarchyLevel'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "hierarchyLevelName");
            if ($element->length > 0) {
                $node = $element->item(0)->getElementsByTagNameNS($gco, 'CharacterString');
                $mdItem['hierarchyLevelName'] = isset($node) ? $node->item(0)->nodeValue : '';
            }
            $element = $item->getElementsByTagNameNS($gmd, "identificationInfo");
            if ($element->length > 0) {
                $mcp_element = $element->item(0)->getElementsByTagNameNS('http://bluenet3.antcrc.utas.edu.au/mcp', "MD_DataIdentification");
                $item = $mcp_element->item(0)->getElementsByTagNameNS($gmd, 'citation');
                $item = $item->item(0)->getElementsByTagNameNS($gmd, 'CI_Citation');
                $item = $item->item(0)->getElementsByTagNameNS($gmd, 'title');
                $mdItem['MDTitle'] = isset($item) ? trim($item->item(0)->nodeValue) : '';
                $item = $mcp_element->item(0)->getElementsByTagNameNS($gmd, 'abstract');
                $mdItem['MDAbstract'] = isset($item) ? trim($item->item(0)->nodeValue) : '';
                $item = $mcp_element->item(0)->getElementsByTagNameNS($gmd, 'topicCategory');
                $mdItem['MDTopicCategory'] = isset($item) ? trim($item->item(0)->nodeValue) : '';
            }
            $mdArray[] = ArrayData::create($mdItem);
        }
        return array($numberOfRecordsMatched, $nextRecord, $mdArray);
    }
protected function parseSummaryISO ( $ 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 ) -> getElementsByTagNameNS ( " http://bluenet3.antcrc.utas.edu.au/mcp " , " MD_Metadata " ) ; $ mdArray = array ( ) ; $ gmd = 'http://www.isotc211.org/2005/gmd' ; $ gco = 'http://www.isotc211.org/2005/gco' ; foreach ( $ metadata as $ item ) { $ mdItem = array ( ) ; $ element = $ item -> getElementsByTagNameNS ( $ gmd , " fileIdentifier " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gco , 'CharacterString' ) ; $ mdItem [ 'fileIdentifier' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " metadataStandardName " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gco , 'CharacterString' ) ; $ mdItem [ 'metadataStandardName' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " metadataStandardVersion " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gco , 'CharacterString' ) ; $ mdItem [ 'metadataStandardVersion' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " parentIdentifier " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gco , 'CharacterString' ) ; $ mdItem [ 'parentIdentifier' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " hierarchyLevel " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'MD_ScopeCode' ) ; $ mdItem [ 'hierarchyLevel' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " hierarchyLevelName " ) ; if ( $ element -> length > 0 ) { $ node = $ element -> item ( 0 ) -> getElementsByTagNameNS ( $ gco , 'CharacterString' ) ; $ mdItem [ 'hierarchyLevelName' ] = isset ( $ node ) ? $ node -> item ( 0 ) -> nodeValue : '' ; } $ element = $ item -> getElementsByTagNameNS ( $ gmd , " identificationInfo " ) ; if ( $ element -> length > 0 ) { $ mcp_element = $ element -> item ( 0 ) -> getElementsByTagNameNS ( 'http://bluenet3.antcrc.utas.edu.au/mcp' , " MD_DataIdentification " ) ; $ item = $ mcp_element -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'citation' ) ; $ item = $ item -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'CI_Citation' ) ; $ item = $ item -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'title' ) ; $ mdItem [ 'MDTitle' ] = isset ( $ item ) ? trim ( $ item -> item ( 0 ) -> nodeValue ) : '' ; $ item = $ mcp_element -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'abstract' ) ; $ mdItem [ 'MDAbstract' ] = isset ( $ item ) ? trim ( $ item -> item ( 0 ) -> nodeValue ) : '' ; $ item = $ mcp_element -> item ( 0 ) -> getElementsByTagNameNS ( $ gmd , 'topicCategory' ) ; $ mdItem [ 'MDTopicCategory' ] = isset ( $ item ) ? trim ( $ item -> item ( 0 ) -> nodeValue ) : '' ; } $ mdArray [ ] = ArrayData :: create ( $ mdItem ) ; } return array ( $ numberOfRecordsMatched , $ nextRecord , $ mdArray ) ; }
From the geocatalogue module, parses the response from the catalogue and extracts the information
 we want from MCP ISO type records.
From the geocatalogue module parses the response from the catalogue and extracts the information we want from MCP ISO type records .
// get search summary // Pop these in vars so code below is less lenghty.