Source of file GenerateISO19139XMLCommand.php
Size: 1,296 Bytes - Last Modified: 2021-12-23T10:31:40+00:00
/var/www/docs.ssmods.com/process/src/code/commands/GenerateISO19139XMLCommand.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | <?php /** * @author Rainer Spittel (rainer at silverstripe dot com) * @package geocatalog * @subpackage commands */ /** * Create a ISO19139 Metadata XML file * * This command generates a ISO19139 metadata XML file. */ class GenerateISO19139XMLCommand extends ControllerCommand { /** * @var string $templatename template to generate a valid OGC update request. */ public static $templatename = 'cswISO19139_xml'; /** * Command execute * * Generate the ISO19139 metadata XML and return it. */ public function execute() { $data = $this->getParameters(); if (! isset($data['MDMetadata'])) { throw new GenerateISO19139XMLCommand_Exception("No data-object given"); } $MDMetadata = $data['MDMetadata']; if (! is_a($MDMetadata, 'MDMetadata')) { throw new GenerateISO19139XMLCommand_Exception("data-object is not a MDMetadata"); } $requestXML = self::$templatename; $obj = new ViewableData(); $obj->customise($MDMetadata); $data = $obj->renderWith($requestXML); return $data; } } /** * Customised exception class */ class GenerateISO19139XMLCommand_Exception extends Exception { } |