CartoWeb3

# Class: WmsServerManager Source Location: /plugins/wmsBrowser/client/WmsServerManager.php
### Class Overview
| ### Variables $log $maxExecutionTime | ### Methods __construct addServer buildServersList createWmsLayer fetchLayerAbstract fetchLayerBbox fetchLayerMetadatas fetchLayerSrs fetchLayerStyle flushServer getCapabilities getServerByUrl normalizeString parseCapabilities refreshServer removeServer setServerStatus testServer updateServer validateUrl
### Class Details [line 45] [ Top ] ### Class Variables #### $log = [line 51] Logger #### Tags:
access: | private
Type: | string
[ Top ] #### $maxExecutionTime = [line 57] Execution time (seconds) #### Tags:
access: | protected
Type: | int
[ Top ] ### Class Methods ### constructor __construct [line 62]
`WmsServerManager __construct( [mixed $maxExecutionTime = 300])`
Constructor #### Tags:
access: | public
[ Top ] ### method addServer [line 123]
`boolean addServer( string $serverName, string $serverUrl, string $serverComment)`
Adds a server to the server database. #### Tags:
return: | true if successful, false else
access: | public
#### Parameters:
string | $serverName | name of the server.
string | $serverUrl | url of the server.
string | $serverComment | user comment.
[ Top ] ### method buildServersList [line 93]
`array buildServersList( [boolean $fileStatus = false])`
Opens the server database and returns all records as an array. #### Tags:
return: | server record as an associative array
access: | public
#### Parameters:
boolean | $fileStatus | if true, push in array capabilities file modification time
[ Top ] ### method createWmsLayer [line 626]
`object the createWmsLayer( string $serverUrl, string $layerName)`
Fetches layer data for the given server url and layer name and returns a new layerOverlay object based on this data. #### Tags:
return: | new layerOverlay object.
access: | public
#### Parameters:
string | $serverUrl | server url
string | $layerName | wms layer name
[ Top ] ### method fetchLayerAbstract [line 460]
`string fetchLayerAbstract( integer $serverId, integer $abstractId)`
Opens abstract file and fetch the abstract for the layer #### Tags:
return: | layer abstract if exist else empty string
access: | protected
#### Parameters:
integer | $serverId | server id
integer | $abstractId | abstract id
[ Top ] ### method fetchLayerBbox [line 429]
`string fetchLayerBbox( integer $bboxId)`
Opens bbox database and fetch the bbox(es) for the layer #### Tags:
return: | list of bbox(es)
access: | protected
#### Parameters:
integer | $bboxId | first bbox id in bbox database
[ Top ] ### method fetchLayerMetadatas [line 550]
`array fetchLayerMetadatas( array $serverRec, array $capabRec, [boolean $boundingbox = false], [boolean $style = false], [boolean $abstract = false], [boolean $metadata = false])`
Fetches layer's metadatas from a server database record and a capabilities database record #### Tags:
return: | array of layer's metadatas properties
access: | public
#### Parameters:
array | $serverRec | server database record
array | $capabRec | capabilities database record
boolean | $boundingbox | if true, fetch abstract metadata
boolean | $style | if true, fetch boundingbox metadata
boolean | $abstract | if true, fetch styles metadatas
boolean | $metadata | if true, fetch metadataURL metadatas
[ Top ] ### method fetchLayerSrs [line 481]
`string fetchLayerSrs( integer $serverId, string $srsIds)`
Opens srs file and fetch the srs for the layer #### Tags:
return: | one space delimited list of SRS or empty string if no found
access: | protected
#### Parameters:
integer | $serverId | server id
string | $srsIds | comma-delimited list of srs record ids
[ Top ] ### method fetchLayerStyle [line 502]
`array fetchLayerStyle( integer $styleId)`
Opens style database and fetch the styles for the layer #### Tags:
return: | array of parameters : first style name styles names list array of sld url for each style
access: | protected
#### Parameters:
integer | $styleId | style id in style database
[ Top ] ### method flushServer [line 209]
`void flushServer( integer $dbServer, string $serverUrl)`
Clears out data related to a server record. #### Tags:
access: | protected
#### Parameters:
integer | $dbServer | the identifier for the server database (must be open)
string | $serverUrl | server url
[ Top ] ### method getCapabilities [line 353]
`void getCapabilities( string $onlineResource, string $capabilitiesFile)`
Executes a getcapabilities call against the server at the url and the results are saved an xml file. #### Tags:
access: | protected
#### Parameters:
string | $onlineResource | url to fetch from.
string | $capabilitiesFile | xml file to write to.
[ Top ] ### method getServerByUrl [line 75]
`array getServerByUrl( integer $dbServer, string $serverUrl, [boolean $strict = true])`
Returns the server record in the server database whose url is passed. #### Tags:
return: | server database record
access: | public
#### Parameters:
integer | $dbServer | identifier for the server database
string | $serverUrl | server url
boolean | $strict | if true (default), throws exception if server isn't ever registred in database
[ Top ] ### method normalizeString [line 420]
`string normalizeString( string $string)`
Replaces all special characters in the given string. e.g. "http://my.host.com/cgi-bin/mywms?" becomes "http___my_host_com_cgi_bin_mywms_" #### Tags:
return: | converted
access: | protected
#### Parameters:
string | $string | string to convert.
[ Top ] ### method parseCapabilities [line 389]
`boolean parseCapabilities( string $capabilitiesFile, integer $serverId)`
Parses an xml capabilities file and populate dbase files from it. #### Tags:
return: | true if successful, false if not.
access: | protected
#### Parameters:
string | $capabilitiesFile | capabilities file to use as input.
integer | $serverId | server id.
[ Top ] ### method refreshServer [line 281]
`boolean refreshServer( string $serverUrl)`
Refreshs a server entry by removing all related records and re-downloading/parsing the capabilities file. If something went wrong removes server from the server database and all references to it. #### Tags:
return: | true if successful, false if not.
access: | public
#### Parameters:
string | $serverUrl | server url
[ Top ] ### method removeServer [line 190]
`void removeServer( string $serverUrl)`
Removes a server from the server database and all references to it. #### Tags:
access: | public
#### Parameters:
string | $serverUrl | server url
[ Top ] ### method setServerStatus [line 178]
`void setServerStatus( string $serverUrl, integer $status)`
Sets the given server's status to the given value #### Tags:
access: | public
#### Parameters:
string | $serverUrl | url of the server to update.
integer | $status | status value to update to. 0: disconnected 1: connected
[ Top ] ### method testServer [line 372]
`boolean testServer( string $onlineResource)`
Tests the availablility of a server. #### Tags:
return: | true if available, false if not.
access: | public
#### Parameters:
string | $onlineResource | url to fetch from.
[ Top ] ### method updateServer [line 153]
`void updateServer( string $serverUrl, string $newServerName, string $newServerUrl, string $userComment)`
Updates given server with the specified information. #### Tags:
access: | public
#### Parameters:
string | $serverUrl | server url
string | $newServerName | new name
string | $newServerUrl | new url
string | $userComment | new user comment
[ Top ] ### method validateUrl [line 330]
`string validateUrl( string $url, [boolean $capabilities = false])`
Validates url #### Tags:
return: | validated server url
access: | public
#### Parameters:
string | $url | server url
boolean | $capabilities | if true, add connection parameters for getCapabilities request
[ Top ] Documentation generated on Mon, 16 Jul 2007 13:32:42 +0200 by phpDocumentor 1.3.0RC3