[fusion-commits] r2848 - in branches/fusion-mg26: . layers/MapGuide/php widgets/BufferPanel widgets/FeatureInfo/classes widgets/Query/classes widgets/QuickPlot widgets/Redline/classes widgets/Search widgets/SelectWithin widgets/Theme/classes

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Jun 17 05:45:14 PDT 2014


Author: jng
Date: 2014-06-17 05:45:14 -0700 (Tue, 17 Jun 2014)
New Revision: 2848

Modified:
   branches/fusion-mg26/
   branches/fusion-mg26/layers/MapGuide/php/Buffer.php
   branches/fusion-mg26/layers/MapGuide/php/ClearSelection.php
   branches/fusion-mg26/layers/MapGuide/php/GetSelectionProperties.php
   branches/fusion-mg26/layers/MapGuide/php/LayerInfo.php
   branches/fusion-mg26/layers/MapGuide/php/Legend.php
   branches/fusion-mg26/layers/MapGuide/php/LoadMap.php
   branches/fusion-mg26/layers/MapGuide/php/LoadScaleRanges.php
   branches/fusion-mg26/layers/MapGuide/php/Measure.php
   branches/fusion-mg26/layers/MapGuide/php/Query.php
   branches/fusion-mg26/layers/MapGuide/php/SaveMap.php
   branches/fusion-mg26/layers/MapGuide/php/SaveSelection.php
   branches/fusion-mg26/layers/MapGuide/php/Selection.php
   branches/fusion-mg26/layers/MapGuide/php/SetLayers.php
   branches/fusion-mg26/layers/MapGuide/php/Utilities.php
   branches/fusion-mg26/widgets/BufferPanel/Buffer.php
   branches/fusion-mg26/widgets/FeatureInfo/classes/featureinfo.php
   branches/fusion-mg26/widgets/Query/classes/query.php
   branches/fusion-mg26/widgets/QuickPlot/GenerateLegend.php
   branches/fusion-mg26/widgets/QuickPlot/GeneratePicture.php
   branches/fusion-mg26/widgets/Redline/classes/markupeditor.php
   branches/fusion-mg26/widgets/Redline/classes/markupmanager.php
   branches/fusion-mg26/widgets/Search/Search.php
   branches/fusion-mg26/widgets/SelectWithin/SelectWithin.php
   branches/fusion-mg26/widgets/Theme/classes/theme.php
Log:
Merged revision(s) 2847 from trunk:
This submission includes the following changes:
 - Remove usage of deprecated APIs.
    - MgMap() constructor and related methods (replaced with MgMap(MgSiteConnection) and related methods)
    - MgCreateSdfParams (replaced with MgFileFeatureSourceParams)
 - Fix PHP warnings in Selection.php
........



Property changes on: branches/fusion-mg26
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/fusion-mg24:2560
/sandbox/createruntimemap:2699-2708
/sandbox/jxlib-3.0:1957-2248
/sandbox/ol213:2801-2803
/sandbox/robust_error_handling:2818-2825
   + /branches/fusion-mg24:2560
/sandbox/createruntimemap:2699-2708
/sandbox/jxlib-3.0:1957-2248
/sandbox/ol213:2801-2803
/sandbox/robust_error_handling:2818-2825
/trunk:2847

Modified: branches/fusion-mg26/layers/MapGuide/php/Buffer.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Buffer.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Buffer.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -60,8 +60,8 @@
 
     $schemaName = 'BufferSchema';
 
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     /* Get the map SRS - we use this to convert distances */
     $srsFactory = new MgCoordinateSystemFactory();
@@ -268,7 +268,7 @@
     }
     $result = $featureService->UpdateFeatures($featureSourceId, $oCommandsColl, false);
     $layer->ForceRefresh();
-    $map->Save($resourceService);
+    $map->Save();
     echo "<Buffer>";
     echo "<Layer>".$layerId->ToString();
     echo "</Layer>";

Modified: branches/fusion-mg26/layers/MapGuide/php/ClearSelection.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/ClearSelection.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/ClearSelection.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -39,8 +39,8 @@
 {
     $resourceSrvc = $siteConnection->CreateService(MgServiceType::ResourceService);
 
-    $map = new MgMap();
-    $map->Open($resourceSrvc, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     $sel = new MgSelection($map);
 

Modified: branches/fusion-mg26/layers/MapGuide/php/GetSelectionProperties.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/GetSelectionProperties.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/GetSelectionProperties.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -40,8 +40,8 @@
     {
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         // Create the selection set
         $selection = new MgSelection($map);
         if($selText != "") {

Modified: branches/fusion-mg26/layers/MapGuide/php/LayerInfo.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/LayerInfo.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/LayerInfo.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -49,8 +49,8 @@
 }
 
 //Get a runtime map from a map definition
-$map = new MgMap();
-$map->Open($resourceService, $mapName);
+$map = new MgMap($siteConnection);
+$map->Open($mapName);
 
 //Get the layer
 $layerCollection=$map->GetLayers();
@@ -68,7 +68,7 @@
         } else {
             $layer->SetSelectable(false);
         }
-        $map->Save($resourceService);
+        $map->Save();
     }
 
     //property mappings from the session

Modified: branches/fusion-mg26/layers/MapGuide/php/Legend.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Legend.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Legend.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -46,9 +46,9 @@
 }
 
 //Get a runtime map from a map definition
-$map = new MgMap();
+$map = new MgMap($siteConnection);
 
-$map->Open($resourceService, $mapName);
+$map->Open($mapName);
 
 //Get layer collection as xml
 header('content-type: text/xml');

Modified: branches/fusion-mg26/layers/MapGuide/php/LoadMap.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/LoadMap.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/LoadMap.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -48,11 +48,11 @@
     if (isset($_REQUEST['mapid']))
     {
         $mapid = $_REQUEST['mapid'];
-        $resourceID = new  MgResourceIdentifier($mapid);
-        $map = new MgMap();
+        $resourceID = new MgResourceIdentifier($mapid);
+        $map = new MgMap($siteConnection);
         $mapTitle = $resourceID->GetName();
 
-        $map->Create($resourceService, $resourceID, $mapTitle);
+        $map->Create($resourceID, $mapTitle);
 
         $mapName = uniqid($mapTitle);
         $mapStateId = new MgResourceIdentifier("Session:" . $sessionID . "//" . $mapName . "." . MgResourceType::Map);
@@ -65,8 +65,8 @@
 
         $map->Save($resourceService, $mapStateId);
     } else {
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         $mapTitle = $map->GetName();
         $mapid = $map->GetMapDefinition()->ToString();
     }

Modified: branches/fusion-mg26/layers/MapGuide/php/LoadScaleRanges.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/LoadScaleRanges.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/LoadScaleRanges.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -59,8 +59,8 @@
 
 $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
 
-$map = new MgMap();
-$map->Open($resourceService, $mapName);
+$map = new MgMap($siteConnection);
+$map->Open($mapName);
 $layers=$map->GetLayers();
 
 $scaleObj = new stdClass();

Modified: branches/fusion-mg26/layers/MapGuide/php/Measure.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Measure.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Measure.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -50,8 +50,8 @@
     $y1 = $_REQUEST['y1'];
     $x2 = $_REQUEST['x2'];
     $y2 = $_REQUEST['y2'];
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
     $srsFactory = new MgCoordinateSystemFactory();
     $srs = GetMapSRS($map);
     $srsMap = $srsFactory->Create($srs);

Modified: branches/fusion-mg26/layers/MapGuide/php/Query.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Query.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Query.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -76,8 +76,8 @@
 
     /* open the map from the session using the provided map name.  The map was
        previously created by calling LoadMap. */
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     /* add the features to the map selection and save it*/
     $selection = new MgSelection($map);

Modified: branches/fusion-mg26/layers/MapGuide/php/SaveMap.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/SaveMap.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/SaveMap.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -45,8 +45,8 @@
 {
     $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
     $renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     $selection = new MgSelection($map);
     $selection->Open($resourceService, $mapName);

Modified: branches/fusion-mg26/layers/MapGuide/php/SaveSelection.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/SaveSelection.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/SaveSelection.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -42,8 +42,8 @@
     {
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         // Create the selection set and save it
         $selection = new MgSelection($map);
         if($selText != "") {

Modified: branches/fusion-mg26/layers/MapGuide/php/Selection.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Selection.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Selection.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -38,7 +38,7 @@
 include('../../../common/php/Utilities.php');
 include('Utilities.php');
 
-$result = NULL;
+$result = new stdClass();
 $result->layers = array();
 
 if (isset($_SESSION['selection_array']))
@@ -69,7 +69,7 @@
     $aSelectedLayers = $properties->layers;
     if (count($aSelectedLayers) > 0)
     {
-        $result->extents = NULL;
+        $result->extents = new stdClass();
         $result->extents->minx = $properties->extents->minx;
         $result->extents->miny = $properties->extents->miny;
         $result->extents->maxx = $properties->extents->maxx;
@@ -84,6 +84,7 @@
                 $properties->$layerNameInProperties->numelements > 0)
             {
                 array_push($result->layers, $layerName);
+                $result->$layerName = new stdClass();
                 $result->$layerName->propertynames = $properties->$layerNameInProperties->propertynames;
                 $result->$layerName->propertyvalues = $properties->$layerNameInProperties->propertyvalues;
                 $result->$layerName->propertytypes = $properties->$layerNameInProperties->propertytypes;

Modified: branches/fusion-mg26/layers/MapGuide/php/SetLayers.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/SetLayers.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/SetLayers.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -54,8 +54,8 @@
 
     /* open the map from the session using the provided map name.  The map was
        previously created by calling LoadMap. */
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
     $mapLayers = $map->GetLayers();
 
 
@@ -99,7 +99,7 @@
     }
     */
 
-    $map->Save($resourceService);
+    $map->Save();
     echo "success: true";
 }
 catch (MgException $e)

Modified: branches/fusion-mg26/layers/MapGuide/php/Utilities.php
===================================================================
--- branches/fusion-mg26/layers/MapGuide/php/Utilities.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/layers/MapGuide/php/Utilities.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -56,7 +56,7 @@
     $schema->GetClasses()->Add($classDef);
 
     //finally, creation of the feature source
-    $params = new MgCreateSdfParams("LatLong", GetMapSRS($map), $schema);
+    $params = new MgFileFeatureSourceParams("OSGeo.SDF", "LatLong", GetMapSRS($map), $schema);
     $featureService->CreateFeatureSource($dataSourceId, $params);
 }
 

Modified: branches/fusion-mg26/widgets/BufferPanel/Buffer.php
===================================================================
--- branches/fusion-mg26/widgets/BufferPanel/Buffer.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/BufferPanel/Buffer.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -80,8 +80,8 @@
 
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
 
         //locate the buffer layer in the map. It might or might not already exist
         //
@@ -147,7 +147,7 @@
             $schema->GetClasses()->Add($classDef);
 
             //finally, creation of the feature source
-            $sdfParams = new MgCreateSdfParams("LatLong", $srsDefMap, $schema);
+            $sdfParams = new MgFileFeatureSourceParams("OSGeo.SDF", "LatLong", $srsDefMap, $schema);
             $featureSrvc->CreateFeatureSource($dataSourceId, $sdfParams);
 
             //Add layer to map
@@ -325,7 +325,7 @@
         // Save the new map state
         //
         $layer->ForceRefresh();
-        $map->Save($resourceSrvc);
+        $map->Save();
 
         //build report message
         $title = GetLocalizedString( "BUFFERREPORTTITLE", $locale );

Modified: branches/fusion-mg26/widgets/FeatureInfo/classes/featureinfo.php
===================================================================
--- branches/fusion-mg26/widgets/FeatureInfo/classes/featureinfo.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/FeatureInfo/classes/featureinfo.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -38,8 +38,8 @@
 
         $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $layers = $map->GetLayers();
 
         for ($i = 0; $i < $layers->GetCount(); $i++)

Modified: branches/fusion-mg26/widgets/Query/classes/query.php
===================================================================
--- branches/fusion-mg26/widgets/Query/classes/query.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/Query/classes/query.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -67,10 +67,8 @@
     {
         $layerNames = array();
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $layers = $map->GetLayers();
 
         for ($i = 0; $i < $layers->GetCount(); $i++)
@@ -93,18 +91,13 @@
     {
         $properties = array();
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-        $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
+        $classDef = $layer->GetClassDefinition();
 
-        $featureService = $this->site->CreateService(MgServiceType::FeatureService);
-        $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-        $schemaClass = explode(':', $layer->GetFeatureClassName());
-
-        $classDef = $featureService->GetClassDefinition($resId, $schemaClass[0], $schemaClass[1]);
-
         for ($i = 0; $i < $classDef->GetProperties()->GetCount(); $i++)
         {
             $propertyDef = $classDef->GetProperties()->GetItem($i);
@@ -125,11 +118,9 @@
     {
         $result = true;
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-
         $layers = $map->GetLayers();
         if ($layers->Contains('_QuerySpatialFilter'))
         {
@@ -139,7 +130,7 @@
             else
                 $layer->SetVisible(false);
 
-            $map->Save($resourceService);
+            $map->Save();
         }
 
         return $result;
@@ -156,8 +147,8 @@
 
         $updateCommands = new MgFeatureCommandCollection();
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
         $layer = null;
         $layers = $map->GetLayers();
@@ -171,7 +162,7 @@
             // Create the Feature Source (SDF)
 
             $sdfSchema = $this->CreateFilterSchema();
-            $sdfParams = new MgCreateSdfParams('MAPCS', $map->GetMapSRS(), $sdfSchema);
+            $sdfParams = new MgFileFeatureSourceParams('OSGeo.SDF', 'MAPCS', $map->GetMapSRS(), $sdfSchema);
             $featureService->CreateFeatureSource($sdfResId, $sdfParams);
 
             // Create the Layer
@@ -197,7 +188,7 @@
         // Make the layer visible
 
         $layer->SetVisible(true);
-        $map->Save($resourceService);
+        $map->Save();
 
         // Add the geometry to the filter feature source
 
@@ -219,12 +210,11 @@
     {
         $result = array();
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-        $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
         $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
         $featureClass = $layer->GetFeatureClassName();
@@ -233,9 +223,9 @@
 
         // Initialize the coordinate system transform
 
-        $schemaAndClass = explode(":", $featureClass);
-        $classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
-        $geomProp = $classDef->GetProperties()->GetItem($featureGeometry);
+        $classDef = $layer->GetClassDefinition();
+        $clsProps = $classDef->GetProperties();
+        $geomProp = $clsProps->GetItem($featureGeometry);
         $spatialContext = $geomProp->GetSpatialContextAssociation();
 
         $csTransform = null;
@@ -296,7 +286,7 @@
 
         $count = 0;
         $geometryReaderWriter = new MgAgfReaderWriter();
-        $featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+        $featureReader = $layer->SelectFeatures($queryOptions);
         while ($featureReader->ReadNext() && ($queryMax <= 0 || $count < $queryMax))
         {
             $displayValue = $this->GetFeaturePropertyValue($featureReader, $this->args['OUTPUTPROPERTY']);
@@ -319,16 +309,14 @@
     function GetSelectionXML()
     {
         $json = new Services_JSON();
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-        $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-        $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
         $featureClass = $layer->GetFeatureClassName();
-        $schemaAndClass = explode(":", $featureClass);
-        $classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
+        $classDef = $layer->GetClassDefinition();
 
         $properties = new MgPropertyCollection();
         $idList = $json->decode($this->args['IDLIST']);

Modified: branches/fusion-mg26/widgets/QuickPlot/GenerateLegend.php
===================================================================
--- branches/fusion-mg26/widgets/QuickPlot/GenerateLegend.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/QuickPlot/GenerateLegend.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -190,8 +190,8 @@
         $resourceService  = $siteConnection->CreateService(MgServiceType::ResourceService);
         $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
         
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         $scale = $map->GetViewScale();
         
         CompileVisibleLayerCount($map);

Modified: branches/fusion-mg26/widgets/QuickPlot/GeneratePicture.php
===================================================================
--- branches/fusion-mg26/widgets/QuickPlot/GeneratePicture.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/QuickPlot/GeneratePicture.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -94,11 +94,10 @@
         $userInfo         = new MgUserInformation($sessionID);
         $siteConnection   = new MgSiteConnection();
         $siteConnection->Open($userInfo);
-        $resourceService  = $siteConnection->CreateService(MgServiceType::ResourceService);
         $renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
         
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         
         $selection        = new MgSelection($map);
     
@@ -117,14 +116,14 @@
         $color = new MgColor($colorString);
 
         $mgReader = $renderingService->RenderMap($map, 
-                                                $selection, 
-                                                $center,
-                                                $scaleDenominator, 
-                                                $toSize->width, 
-                                                $toSize->height,
-                                                $color,
-                                                "PNG",
-                                                false);
+                                                 $selection, 
+                                                 $center,
+                                                 $scaleDenominator, 
+                                                 $toSize->width, 
+                                                 $toSize->height,
+                                                 $color,
+                                                 "PNG",
+                                                 false);
         $tempImage = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "mgo" . uniqid();
 
         $mgReader->ToFile($tempImage);


Property changes on: branches/fusion-mg26/widgets/QuickPlot/GeneratePicture.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/fusion-mg24/widgets/QuickPlot/GeneratePicture.php:2560
/sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php:2488-2498
/sandbox/createruntimemap/widgets/QuickPlot/GeneratePicture.php:2699-2708
/sandbox/jxlib-3.0/widgets/QuickPlot/GeneratePicture.php:1957-2248
/sandbox/ol213/widgets/QuickPlot/GeneratePicture.php:2801-2803
/sandbox/redline_advanced_stylization/widgets/QuickPlot/GeneratePicture.php:2773-2783
/sandbox/robust_error_handling/widgets/QuickPlot/GeneratePicture.php:2818-2825
/trunk/widgets/QuickPlot/GeneratePicture.php:2469-2487
   + /branches/fusion-mg24/widgets/QuickPlot/GeneratePicture.php:2560
/sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php:2488-2498
/sandbox/createruntimemap/widgets/QuickPlot/GeneratePicture.php:2699-2708
/sandbox/jxlib-3.0/widgets/QuickPlot/GeneratePicture.php:1957-2248
/sandbox/ol213/widgets/QuickPlot/GeneratePicture.php:2801-2803
/sandbox/redline_advanced_stylization/widgets/QuickPlot/GeneratePicture.php:2773-2783
/sandbox/robust_error_handling/widgets/QuickPlot/GeneratePicture.php:2818-2825
/trunk/widgets/QuickPlot/GeneratePicture.php:2469-2487,2847

Modified: branches/fusion-mg26/widgets/Redline/classes/markupeditor.php
===================================================================
--- branches/fusion-mg26/widgets/Redline/classes/markupeditor.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/Redline/classes/markupeditor.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -77,7 +77,6 @@
     function GetTransform()
     {
         $coordSysFactory = new MgCoordinateSystemFactory();
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
         $featureSourceId = $this->GetFeatureSource();
@@ -89,8 +88,8 @@
             $wkt = $scReader->GetCoordinateSystemWkt();
         $scReader->Close();
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
         if (null == $wkt)
             return null; //It's bunk. Assume map SRS
@@ -285,10 +284,8 @@
 
     function GetSelectionXML()
     {
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $markupLayer = $map->GetLayers()->GetItem('_' . $this->GetMarkupName());
 
         $selection = new MgSelection($map);

Modified: branches/fusion-mg26/widgets/Redline/classes/markupmanager.php
===================================================================
--- branches/fusion-mg26/widgets/Redline/classes/markupmanager.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/Redline/classes/markupmanager.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -344,8 +344,8 @@
     {
         $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
         // Create the Layer Groups
 
@@ -375,23 +375,21 @@
         $markupLayer->SetGroup($markupGroup);
         $map->GetLayers()->Insert(0, $markupLayer);
 
-        $map->Save($resourceService);
+        $map->Save();
     }
 
     function CloseMarkup()
     {
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-
         // Add the Markup Layer
 
         $markupLayerResId = new MgResourceIdentifier($this->args['OPENMARKUP']);
         $index = $map->GetLayers()->IndexOf('_' . $markupLayerResId->GetName());
         $map->GetLayers()->RemoveAt($index);
 
-        $map->Save($resourceService);
+        $map->Save();
     }
 
     function UniqueMarkupName(&$markupName)
@@ -695,8 +693,8 @@
         $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
         $featureSourceId = "";
         $bUpdate = array_key_exists("EDITMARKUPLAYER", $this->args) && array_key_exists("MARKUPLAYERNAME", $this->args) && array_key_exists("EDITFEATURESOURCE", $this->args);
@@ -1135,11 +1133,9 @@
     {
         $openMarkup = array();
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-
         $layerGroups = $map->GetLayerGroups();
         if ($layerGroups->Contains('_Markup'))
         {

Modified: branches/fusion-mg26/widgets/Search/Search.php
===================================================================
--- branches/fusion-mg26/widgets/Search/Search.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/Search/Search.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -67,8 +67,8 @@
         $featureSrvc = $siteConnection->CreateService(MgServiceType::FeatureService);
 
         //Create a temporary map runtime object, locate the layer
-        $map = new MgMap();
-        $map->Open($resourceService, $mapName);
+        $map = new MgMap($siteConnection);
+        $map->Open($mapName);
         $layers = $map->GetLayers();
         $layer = null;
         //fwrite($logHandle,"found layers:".$layers->GetCount()."\n");

Modified: branches/fusion-mg26/widgets/SelectWithin/SelectWithin.php
===================================================================
--- branches/fusion-mg26/widgets/SelectWithin/SelectWithin.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/SelectWithin/SelectWithin.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -46,8 +46,8 @@
     $renderingSrvc = $siteConnection->CreateService(MgServiceType::RenderingService);
 
     //load the map runtime state
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     //object to hold response
     $result = NULL;

Modified: branches/fusion-mg26/widgets/Theme/classes/theme.php
===================================================================
--- branches/fusion-mg26/widgets/Theme/classes/theme.php	2014-06-17 11:56:07 UTC (rev 2847)
+++ branches/fusion-mg26/widgets/Theme/classes/theme.php	2014-06-17 12:45:14 UTC (rev 2848)
@@ -40,11 +40,10 @@
     {
         $layerNames = array();
 
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $layers = $map->GetLayers();
 
         for ($i = 0; $i < $layers->GetCount(); $i++)
@@ -89,9 +88,10 @@
 
         $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-        $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
         
 
         // First get a list of all of the Feature Class properties that can be used for theming.
@@ -150,13 +150,11 @@
 
     function GetPropertyMinMaxCount()
     {
-        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
-        $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-
-        $featureService = $this->site->CreateService(MgServiceType::FeatureService);
         $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
         
         $filter = $layer->GetFilter();
@@ -193,7 +191,7 @@
         if($filter != '')
             $queryOptions->SetFilter($filter);
 
-        $featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+        $featureReader = $layer->SelectFeatures($queryOptions);
 
         while($featureReader->ReadNext())
         {
@@ -228,8 +226,8 @@
         $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
         $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
-        $map = new MgMap();
-        $map->Open($resourceService, $this->args['MAPNAME']);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $layers = $map->GetLayers();
         $layer = $layers->GetItem($this->args['LAYERNAME']);
 
@@ -317,7 +315,7 @@
             $aggregateOptions->AddComputedProperty('THEME_VALUE', 'UNIQUE("' . $this->args['PROPERTYNAME'] . '")');
             if($filter != '')
                 $aggregateOptions->SetFilter($filter);
-            $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
+            $dataReader = $layer->SelectAggregate($aggregateOptions);
             while ($dataReader->ReadNext())
             {
                 $value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
@@ -377,7 +375,7 @@
             if($filter != '')
                 $aggregateOptions->SetFilter($filter);
 
-            $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
+            $dataReader = $layer->SelectAggregate($aggregateOptions);
             while ($dataReader->ReadNext())
             {
                 $value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
@@ -446,7 +444,7 @@
         $newLayer->SetSelectable($layer->GetLegendLabel());
         $layers->Insert($layers->IndexOf($layer), $newLayer);
 
-        $map->Save($resourceService);
+        $map->Save();
 
         return $uniqueName;
     }



More information about the fusion-commits mailing list