Source for file FileService.php

Documentation is available at FileService.php

  1. <?php
  2. /**
  3. * File service type
  4. *
  5. * PHP versions 5
  6. @category  PHP
  7. @package   GeoPrisma
  8. @author    Alexandre Dube
  9. @copyright 2010, Centre de Geomatique du Quebec
  10. @license   http://www.geoprisma.org/license BSD License
  11. @link      http://www.geoprisma.org
  12. */
  13.  
  14. /**
  15. * File service type
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage Service
  19. @author     Alexandre Dube
  20. */
  21. {
  22.     const WMS_SERVICE = 'file';
  23.     const TYPE = 'file';
  24.     const TYPE_ID = 8;
  25.  
  26.     /**
  27.     * Creates a new instance of org_geoprisma_service_FileService
  28.     * 
  29.     * @param array $pobjArray Config array
  30.     * 
  31.     * @return org_geoprisma_service_FileService 
  32.     */
  33.     public function __construct($pobjArray
  34.     {
  35.         if (isset($pobjArray['id'])) 
  36.         {
  37.             $strName = (string)$pobjArray['id'];
  38.         }
  39.         else
  40.         {
  41.             $strName = (string)$pobjArray['name'];
  42.         }
  43.  
  44.         $strSource = (string)$pobjArray['source'];
  45.         
  46.         parent::__construct($strName$strSourceself::TYPE$pobjArray);
  47.     }
  48.  
  49.     /**
  50.     * Return the OpenLayers.Layer default options using this type of service.
  51.     * Since this service won't create any layers, it returns an empty array.
  52.     * 
  53.     * @param org_geoprisma_config_Config &$pobjConfig Config object
  54.     *
  55.     * @return array 
  56.     */
  57.     public function getDefaultLayerOptions(&$pobjConfig)
  58.     {
  59.         return array();
  60.     }
  61.     
  62.     /**
  63.     * Add current service in XML document.
  64.     * 
  65.     * @param DOMElement  &$pobjDomElementServices XML node where this service
  66.     *                                              must be added
  67.     * @param DOMDocument &$pobjDomDocument        DOMDocument XMl used to create
  68.     *                                              new nodes.
  69.     * 
  70.     * @return void 
  71.     */
  72.     public function insertIntoXML(
  73.         DOMElement &$pobjDomElementServices,
  74.         DOMDocument &$pobjDomDocument
  75.     {
  76.         $objDomElementService $pobjDomDocument->createElement('service')
  77.         $pobjDomElementServices->appendChild($objDomElementService);        
  78.         $objDomElementType $pobjDomDocument->createElement('type'self::WMS_SERVICE);
  79.         $objDomElementName $pobjDomDocument->createElement('name'$this->getName());
  80.         $objDomElementService->appendChild($objDomElementType);
  81.         $objDomElementService->appendChild($objDomElementName)
  82.  
  83.         // options node
  84.         $objDomElementService->appendChild(
  85.             $this->getDomElements(
  86.                 'options'$this->getOptions()$pobjDomDocument
  87.             )
  88.         );
  89.     }
  90. }
  91.   
  92. ?>

Documentation generated on Thu, 19 Jan 2012 00:08:32 +0400 by phpDocumentor 1.4.1