[mapguide-commits] r8220 - in sandbox/jng/v30: Doc/devguide/source Doc/samples/dotnetviewersample/findaddress Doc/samples/dotnetviewersample/plot Doc/samples/dotnetviewersample/query/classes Doc/samples/dotnetviewersample/theme/classes Doc/samples/javasamples/hello_map Doc/samples/javasamples/interacting_with_layers Doc/samples/javaviewersample/findaddress Doc/samples/javaviewersample/plot Doc/samples/javaviewersample/query/classes Doc/samples/javaviewersample/theme/classes Doc/samples/phpsamples/analyzing_features Doc/samples/phpsamples/common Doc/samples/phpsamples/custom_output Doc/samples/phpsamples/modifying_maps_and_layers Doc/samples/phpsamples/working_with_feature_data Doc/samples/phpviewersample Doc/samples/phpviewersample/findaddress Doc/samples/phpviewersample/plot Doc/samples/phpviewersample/query/classes Doc/samples/phpviewersample/theme/classes Doc/samples/phpviewersample/vendor Doc/samples/phpviewersample/vendor/composer Doc/samples/phpviewersample/vendor/lstrojny Doc/sa mples/phpviewersample/vendor/lstrojny/fxmlrpc Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value UnitTest/Common/DotNetWrappers UnitTest/WebTier/Php Web/src/mapadmin Web/src/mapviewerjava Web/src/mapviewernet Web/src/mapviewerphp

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Jun 14 17:22:20 PDT 2014


Author: jng
Date: 2014-06-14 17:22:20 -0700 (Sat, 14 Jun 2014)
New Revision: 8220

Added:
   sandbox/jng/v30/Doc/samples/phpviewersample/composer.json
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/autoload.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/ClassLoader.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_classmap.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_namespaces.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_psr4.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_real.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/installed.json
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.gitignore
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.travis.yml
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/README.md
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/build.xml
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/composer.json
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/package.json
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/phpunit.xml.dist
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/AbstractDecorator.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Client.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ClientInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator/XmlReaderParserBitmaskGenerator.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ExceptionInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/HttpException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/InvalidArgumentException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/MissingExtensionException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ResponseException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/RuntimeException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/SerializationException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TcpException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TransportException.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ExtensionSupportInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Multicall.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/NativeParser.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/ParserInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/XmlReaderParser.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Proxy.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/NativeSerializer.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/SerializerInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/XmlWriterSerializer.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/AbstractTimerBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/MonologTimerBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/Psr3TimerBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimerInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimingDecorator.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkOneTimerBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkTwoTimerBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/AbstractHttpTransport.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/BuzzBrowserBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/CurlTransport.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/GuzzleBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/HttpTransportInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/StreamSocketTransport.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/TransportInterface.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkOneHttpClientBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkTwoHttpClientBridge.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64.php
   sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64Interface.php
Removed:
   sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/kd_xmlrpc.php
Modified:
   sandbox/jng/v30/Doc/devguide/source/interacting_with_layers.rst
   sandbox/jng/v30/Doc/devguide/source/introduction.rst
   sandbox/jng/v30/Doc/devguide/source/modifying_maps_and_layers.rst
   sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/clearaddressresults.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddress.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddressmain.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plot.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plotmain.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/query/classes/query.aspx
   sandbox/jng/v30/Doc/samples/dotnetviewersample/theme/classes/theme.aspx
   sandbox/jng/v30/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp
   sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp
   sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/clearaddressresults.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddress.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/plot/plot.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/plot/plotmain.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/query/classes/query.jsp
   sandbox/jng/v30/Doc/samples/javaviewersample/theme/classes/theme.jsp
   sandbox/jng/v30/Doc/samples/phpsamples/analyzing_features/bufferfunctions.php
   sandbox/jng/v30/Doc/samples/phpsamples/common/common.php
   sandbox/jng/v30/Doc/samples/phpsamples/custom_output/createmapimage.php
   sandbox/jng/v30/Doc/samples/phpsamples/custom_output/eplot.php
   sandbox/jng/v30/Doc/samples/phpsamples/custom_output/multiplot.php
   sandbox/jng/v30/Doc/samples/phpsamples/custom_output/property_report.php
   sandbox/jng/v30/Doc/samples/phpsamples/modifying_maps_and_layers/create_new_line_layer_definition.php
   sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/queryfeatures.php
   sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/selectfeatures.php
   sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/clearaddressresults.php
   sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddress.php
   sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressfunctions.php
   sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressmain.php
   sandbox/jng/v30/Doc/samples/phpviewersample/plot/plot.php
   sandbox/jng/v30/Doc/samples/phpviewersample/plot/plotmain.php
   sandbox/jng/v30/Doc/samples/phpviewersample/query/classes/query.php
   sandbox/jng/v30/Doc/samples/phpviewersample/theme/classes/theme.php
   sandbox/jng/v30/UnitTest/Common/DotNetWrappers/CollectionTest.cs
   sandbox/jng/v30/UnitTest/WebTier/Php/MapLayerAPI.php
   sandbox/jng/v30/UnitTest/WebTier/Php/testAwSelection.php
   sandbox/jng/v30/Web/src/mapadmin/performanceReport_GetResult.php
   sandbox/jng/v30/Web/src/mapviewerjava/buffer.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/legend.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/mapframe.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/measure.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/quickplotgeneratepicture.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/search.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/selectwithin.jsp
   sandbox/jng/v30/Web/src/mapviewerjava/setselection.jsp
   sandbox/jng/v30/Web/src/mapviewernet/buffer.aspx
   sandbox/jng/v30/Web/src/mapviewernet/legend.aspx
   sandbox/jng/v30/Web/src/mapviewernet/mapframe.aspx
   sandbox/jng/v30/Web/src/mapviewernet/measure.aspx
   sandbox/jng/v30/Web/src/mapviewernet/quickplotgeneratepicture.aspx
   sandbox/jng/v30/Web/src/mapviewernet/search.aspx
   sandbox/jng/v30/Web/src/mapviewernet/selectwithin.aspx
   sandbox/jng/v30/Web/src/mapviewernet/setselection.aspx
   sandbox/jng/v30/Web/src/mapviewerphp/buffer.php
   sandbox/jng/v30/Web/src/mapviewerphp/legend.php
   sandbox/jng/v30/Web/src/mapviewerphp/mapframe.php
   sandbox/jng/v30/Web/src/mapviewerphp/measure.php
   sandbox/jng/v30/Web/src/mapviewerphp/quickplotgeneratepicture.php
   sandbox/jng/v30/Web/src/mapviewerphp/search.php
   sandbox/jng/v30/Web/src/mapviewerphp/selectwithin.php
   sandbox/jng/v30/Web/src/mapviewerphp/setselection.php
Log:
Now for the big one: MgMap and its family of deprecated APIs.

Before we do the actual API removal from MgMap, this submission includes modifications to various .net/PHP/Java sample code and actual code to no longer use MgMap's set of deprecated API. At the same time, various bits of sample code have been cleaned up to:

 - Use the recommended coding patterns when working with layers as suggested by MapGuide RFC9 (ie. Using the convenience methods of MgLayerBase and MgSelectionBase instead of going to the MgFeatureService directly)
 - Fix various PHP warnings due to now using PHP 5.5
 - Replace the broken kd_xmlrpc.php with fXmlRpc (https://github.com/lstrojny/fxmlrpc) for the PHP address search sample.

Even if the PSC has decided these APIs I'm currently removing in this sandbox should stay, this submission is still worth merging back into trunk and relevant branches as it updates the various sample code to reflect proper API usage.

Modified: sandbox/jng/v30/Doc/devguide/source/interacting_with_layers.rst
===================================================================
--- sandbox/jng/v30/Doc/devguide/source/interacting_with_layers.rst	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/devguide/source/interacting_with_layers.rst	2014-06-15 00:22:20 UTC (rev 8220)
@@ -285,9 +285,6 @@
 Example
 """""""
 
-.. todo::
-    Update code samples to not use MgMap() ctor. That is deprecated.
-
 The following example toggles the label of the Roads layer between Roads and
 Streets.
 
@@ -301,10 +298,8 @@
     $userInfo = new MgUserInformation($mgSessionId);
     $siteConnection = new MgSiteConnection();
     $siteConnection->Open($userInfo);
-    $resourceService =
-    $siteConnection->CreateService(MgServiceType::ResourceService);
-    $map = new MgMap();
-    $map->Open($resourceService, $mgMapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mgMapName);
     $layers = $map->GetLayers();
     $roadLayer = $layers->GetItem('Roads');
     $roadLabel = $roadLayer->GetLegendLabel();
@@ -316,7 +311,7 @@
     // You must save the updated map or the
     // changes will not be applied
     // Also be sure to refresh the map on page load.
-    $map->Save($resourceService);
+    $map->Save();
     
 **.net (C#)**
 
@@ -328,9 +323,8 @@
     MgUserInformation userInfo = new MgUserInformation(mgSessionId);
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
-    MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-    MgMap map = new MgMap();
-    map.Open(resourceService, mgMapName);
+    MgMap map = new MgMap(siteConnection);
+    map.Open(mgMapName);
     MgLayerCollection layers = map.GetLayers();
     MgLayer roadLayer = layers.GetItem("Roads");
     String roadLabel = roadLayer.GetLegendLabel();
@@ -341,7 +335,7 @@
     // You must save the updated map or the
     // changes will not be applied
     // Also be sure to refresh the map on page load.
-    map.Save(resourceService);
+    map.Save();
 
 **Java**
     
@@ -353,9 +347,8 @@
     MgUserInformation userInfo = new MgUserInformation(mgSessionId);
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
-    MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-    MgMap map = new MgMap();
-    map.Open(resourceService, mgMapName);
+    MgMap map = new MgMap(siteConnection);
+    map.Open(mgMapName);
     MgLayerCollection layers = map.GetLayers();
     MgLayer roadLayer = layers.GetItem("Roads");
     String roadLabel = roadLayer.GetLegendLabel();
@@ -366,7 +359,6 @@
     // You must save the updated map or the
     // changes will not be applied
     // Also be sure to refresh the map on page load.
-    map.Save(resourceService);
 
 .. index::
     single: Layers; Changing Visibility

Modified: sandbox/jng/v30/Doc/devguide/source/introduction.rst
===================================================================
--- sandbox/jng/v30/Doc/devguide/source/introduction.rst	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/devguide/source/introduction.rst	2014-06-15 00:22:20 UTC (rev 8220)
@@ -209,10 +209,15 @@
 .. highlight:: php
 .. code-block:: php
 
+    $siteConnection = new MgSiteConnection();
+    $userInfo = new MgUserInformation($sessionId);
+    $siteConnection->Open();
+    $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
+
     $mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
-    $map = new MgMap();
+    $map = new MgMap($siteConnection);
     $mapName = $mapDefId->GetName();
-    $map->Create($resourceService, $mapDefId, $mapName);
+    $map->Create($mapDefId, $mapName);
     $mapId = new MgResourceIdentifier("Session:$sessionId//$mapName." . MgResourceType::Map);
     $map->Save($resourceService, $mapId);
 
@@ -222,12 +227,16 @@
 .. code-block:: csharp
 
     //Note: This code fragment assumes you have imported the OSGeo.MapGuide namespace
+    MgSiteConnection siteConnection = new MgSiteConnection();
+    MgUserInformation userInfo = new MgUserInformation(sessionId);
+    siteConnection.Open(userInfo);
+    MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType::ResourceService);
 
     MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
-    MgMap map = new MgMap();
+    MgMap map = new MgMap(siteConnection);
     String mapName = mapDefId.GetName();
-    map.Create(resourceService, mapDefId, mapName);
-    MgResourceIdentifier mapId = new MgResourceIdentifier("Session:$sessionId//$mapName." + MgResourceType.Map);
+    map.Create(mapDefId, mapName);
+    MgResourceIdentifier mapId = new MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." + MgResourceType.Map);
     map.Save(resourceService, mapId);
     
 **Java**
@@ -236,12 +245,16 @@
 .. code-block:: java
 
     //Note: This code fragment assumes you have imported the org.osgeo.mapguide package
+    MgSiteConnection siteConnection = new MgSiteConnection();
+    MgUserInformation userInfo = new MgUserInformation(sessionId);
+    siteConnection.Open(userInfo);
+    MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType::ResourceService);
 
     MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
-    MgMap map = new MgMap();
+    MgMap map = new MgMap(siteConnection);
     String mapName = mapDefId.GetName();
-    map.Create(resourceService, mapDefId, mapName);
-    MgResourceIdentifier mapId = new MgResourceIdentifier("Session:$sessionId//$mapName." + MgResourceType.Map);
+    map.Create(mapDefId, mapName);
+    MgResourceIdentifier mapId = new MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." + MgResourceType.Map);
     map.Save(resourceService, mapId);
 
 .. index::
@@ -490,13 +503,9 @@
                 $siteConnection = new MgSiteConnection();
                 $siteConnection->Open($userInfo);
 
-                // Get an instance of the required service(s).
-                $resourceService = $siteConnection->
-                CreateService(MgServiceType::ResourceService);
-
                 // Display the spatial reference system used for the map.
-                $map = new MgMap();
-                $map->Open($resourceService, $mgMapName);
+                $map = new MgMap($siteConnection);
+                $map->Open($mgMapName);
                 $srs = $map->GetMapSRS();
                 echo 'Map <strong>' . $map->GetName() .
                 '</strong> uses this reference system: <br />' . $srs;

Modified: sandbox/jng/v30/Doc/devguide/source/modifying_maps_and_layers.rst
===================================================================
--- sandbox/jng/v30/Doc/devguide/source/modifying_maps_and_layers.rst	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/devguide/source/modifying_maps_and_layers.rst	2014-06-15 00:22:20 UTC (rev 8220)
@@ -92,8 +92,8 @@
 
     // (initialization etc. not shown here)
     // Open the map
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
     // --------------------------------------------------//
     // Load a layer from XML, and use the DOM to change it
     // Load the prototype layer definition into

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/clearaddressresults.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/clearaddressresults.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/clearaddressresults.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -50,20 +50,14 @@
 
     featureService.UpdateFeatures(addressMarkerDataResId, commands, false);
 
-    // Create a ReserviceService object and use it to open the Map
-    // object from the sessions repository. Use the Map object to hide
-    // the "ParcelMarker" layer and then save the updated Map back to
-    // the session.
+    MgMap map = new MgMap(siteConnection);
+    map.Open("Sheboygan");
 
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-    MgMap map = new MgMap();
-    map.Open(resourceService, "Sheboygan");
-
     MgLayer layer = GetLayerByName(map, "AddressMarker");
     layer.SetVisible(false);
     layer.ForceRefresh();
 
-    map.Save(resourceService);
+    map.Save();
 }
 catch (MgException mge)
 {

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddress.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddress.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddress.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -85,8 +85,8 @@
         MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
         MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
 
-        MgMap map = new MgMap();
-        map.Open(resourceService, "Sheboygan");
+        MgMap map = new MgMap(siteConnection);
+        map.Open("Sheboygan");
 
         // Check the map for the AddressMarker layer. If it does not
         // exist then create a feature source to store address results
@@ -129,7 +129,7 @@
         addressLayer.SetVisible(true);
         addressLayer.ForceRefresh();
 
-        map.Save(resourceService);
+        map.Save();
 
         success = true;
     }

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddressmain.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddressmain.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/findaddress/findaddressmain.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -31,12 +31,12 @@
     <script language="javascript">
     function Submit()
     {
-    	var addressForm = document.getElementById("addressForm");
-    	var addressValue = document.getElementById("addressValue");
-    	var addressInput = document.getElementById("addressInput");
-    	
-    	addressValue.value = addressInput.value;
-    	addressForm.submit();
+        var addressForm = document.getElementById("addressForm");
+        var addressValue = document.getElementById("addressValue");
+        var addressInput = document.getElementById("addressInput");
+        
+        addressValue.value = addressInput.value;
+        addressForm.submit();
     }
     </script>
 </head>
@@ -59,13 +59,8 @@
     siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
 
-    // Create a ReserviceService object and use it to open the Map
-    // object from the sessions repository. Use the Map object to
-    // determine if the "AddressMarker" layer is visible.
-
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-    MgMap map = new MgMap();
-    map.Open(resourceService, "Sheboygan");
+    MgMap map = new MgMap(siteConnection);
+    map.Open("Sheboygan");
     MgLayer addressLayer = GetLayerByName(map, "AddressMarker");
 
     if (addressLayer != null)

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plot.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plot.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plot.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -32,13 +32,9 @@
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
 
-    // Create an instance of ResourceService and use that to open the
-    // current map instance stored in session state.
+    MgMap map = new MgMap(siteConnection);
+    map.Open("Sheboygan");
 
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-    MgMap map = new MgMap();
-    map.Open(resourceService, "Sheboygan");
-
     // Now create an instance of MappingService and use it to plot the
     // current view of the map.
 

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plotmain.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plotmain.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/plot/plotmain.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -87,15 +87,9 @@
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
 
-    // Create a ReserviceService object and use it to open the Map
-    // object from the sessions repository. Use the Map object to
-    // determine the current scale of the map for display on this
-    // page.
+    MgMap map = new MgMap(siteConnection);
+    map.Open("Sheboygan");
 
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-    MgMap map = new MgMap();
-    map.Open(resourceService, "Sheboygan");
-
     viewCenter = map.GetViewCenter();
     viewScale = map.GetViewScale();
 }

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/query/classes/query.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/query/classes/query.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/query/classes/query.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -61,9 +61,8 @@
         
         public ArrayList GetMapLayerNames()
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayerCollection layers = map.GetLayers();
             ArrayList layerNames = new ArrayList();
 
@@ -86,17 +85,12 @@
         public ArrayList GetLayerProperties()
         {
             ArrayList properties = new ArrayList();
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(GetParameter(this.args, "LAYERNAME"));
 
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String[] schemaClass = layer.GetFeatureClassName().Split(new Char[]{':'});
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-
             for(int i=0; i<classDef.GetProperties().GetCount(); i++)
             {
                 MgPropertyDefinition propertyDef = classDef.GetProperties().GetItem(i);
@@ -117,9 +111,8 @@
         public bool ToggleSpatialFilter()
         {
             bool result = true;
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
 
             MgLayerCollection layers = map.GetLayers();
             if(layers.Contains("_QuerySpatialFilter"))
@@ -130,7 +123,7 @@
                 else
                     layer.SetVisible(false);
 
-                map.Save(resourceService);
+                map.Save();
             }
 
             return result;
@@ -146,8 +139,8 @@
 
             MgFeatureCommandCollection updateCommands = new MgFeatureCommandCollection();
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
 
             MgLayer layer = null;
             MgLayerCollection layers = map.GetLayers();
@@ -207,21 +200,19 @@
         public ArrayList Execute()
         {
             ArrayList result = new ArrayList();
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(GetParameter(this.args, "LAYERNAME"));
 
             MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
             MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String featureClass = layer.GetFeatureClassName();
             String featureGeometry = layer.GetFeatureGeometryName();
 
             // Initialize the coordinate system transform
 
             String[] schemaClass = layer.GetFeatureClassName().Split(new Char[]{':'});
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
+            MgClassDefinition classDef = layer.GetClassDefinition();
             MgGeometricPropertyDefinition geomProp = (MgGeometricPropertyDefinition) classDef.GetProperties().GetItem(featureGeometry);
             String spatialContext = geomProp.GetSpatialContextAssociation();
 
@@ -271,7 +262,7 @@
 
             int count = 0;
             MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();
-            MgFeatureReader featureReader = featureService.SelectFeatures(resId, layer.GetFeatureClassName(), queryOptions);
+            MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
             while(featureReader.ReadNext() && (queryMax <= 0 || count < queryMax))
             {
                 MgByteReader byteReader = featureReader.GetGeometry(featureGeometry);
@@ -289,17 +280,12 @@
         
         public String GetSelectionXML()
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(GetParameter(this.args, "LAYERNAME"));
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
             String featureClass = layer.GetFeatureClassName();
 
-            String[] schemaClass = layer.GetFeatureClassName().Split(new Char[]{':'});
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
             MgPropertyCollection properties = new MgPropertyCollection();
             MgDataPropertyDefinition dataPropDef = null;

Modified: sandbox/jng/v30/Doc/samples/dotnetviewersample/theme/classes/theme.aspx
===================================================================
--- sandbox/jng/v30/Doc/samples/dotnetviewersample/theme/classes/theme.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/dotnetviewersample/theme/classes/theme.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -56,23 +56,19 @@
         
         public ArrayList GetMapLayerNames()
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
             MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
             
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayerCollection layers = map.GetLayers();
             ArrayList layerNames = new ArrayList();
 
             for(int i=0; i<layers.GetCount(); i++)
             {
-            MgLayer layer = (MgLayer) layers.GetItem(i);
+                MgLayer layer = (MgLayer) layers.GetItem(i);
                 if(!layer.GetName().StartsWith("_") && !layer.GetFeatureSourceId().ToUpper().StartsWith("SESSION"))
                 {
-                    MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-                    String[] schemaClass = layer.GetFeatureClassName().Split(new Char[]{':'});
-
-                    MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
+                    MgClassDefinition classDef = layer.GetClassDefinition();
                     MgPropertyDefinition propDef = classDef.GetProperties().GetItem(layer.GetFeatureGeometryName());
                 
                     if(propDef.GetPropertyType() == MgFeaturePropertyType.GeometricProperty)
@@ -98,16 +94,12 @@
             
             MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
             
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(GetParameter(this.args, "LAYERNAME"));
 
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String[] schemaClass = layer.GetFeatureClassName().Split(new Char[]{':'});
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-
             for(int i=0; i<classDef.GetProperties().GetCount(); i++)
             {
                 MgPropertyDefinition propertyDef = classDef.GetProperties().GetItem(i);
@@ -167,15 +159,10 @@
         {
             ArrayList propertyMinMaxCount = new ArrayList();
             
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(GetParameter(this.args, "LAYERNAME"));
 
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            
             String minValue = null;
             String maxValue = null;
             int count = 0;
@@ -183,7 +170,7 @@
             MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
             queryOptions.AddFeatureProperty(GetParameter(this.args, "PROPERTYNAME"));
             
-            MgFeatureReader featureReader = featureService.SelectFeatures(resId, layer.GetFeatureClassName(), queryOptions);
+            MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
             while(featureReader.ReadNext())
             {
                 String value = GetFeaturePropertyValue(featureReader, GetParameter(this.args, "PROPERTYNAME"));
@@ -252,8 +239,8 @@
             MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
             MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, GetParameter(this.args, "MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(GetParameter(this.args, "MAPNAME"));
             MgLayerCollection layers = map.GetLayers();
             MgLayer layer = (MgLayer) layers.GetItem(GetParameter(this.args, "LAYERNAME"));
             
@@ -301,7 +288,7 @@
                 aggregateOptions.AddFeatureProperty(GetParameter(this.args, "PROPERTYNAME"));
                 aggregateOptions.SelectDistinct(true);
                 
-                MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);
+                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
                 while(dataReader.ReadNext())
                 {
                     value = GetFeaturePropertyValue(dataReader, GetParameter(this.args, "PROPERTYNAME"));
@@ -332,7 +319,7 @@
                 
                 aggregateOptions.AddComputedProperty("THEME_VALUE",
                     GetParameter(this.args, "DISTRO") + "(\"" + GetParameter(this.args, "PROPERTYNAME") + "\"," + GetParameter(this.args, "NUMRULES") + "," + GetParameter(this.args, "MINVALUE") + "," + GetParameter(this.args, "MAXVALUE") + ")");
-                MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);
+                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
                 while(dataReader.ReadNext())
                 {
                     value = GetFeaturePropertyValue(dataReader, "THEME_VALUE");
@@ -382,7 +369,7 @@
             newLayer.SetSelectable(layer.GetSelectable());
             layers.Insert(layers.IndexOf(layer), newLayer);
             
-            map.Save(resourceService);
+            map.Save();
 
             return uniqueName;
         }

Modified: sandbox/jng/v30/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -51,17 +51,13 @@
       MgSiteConnection siteConnection = new MgSiteConnection();
       siteConnection.Open(userInfo);
 
-      // Get an instance of the required service(s).
-      
-      MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
-
       // Finished basic initialization.
       // --------------------------------------------------//
       
       // Query the spatial reference system used for the map.
       
-      MgMap map = new MgMap();
-      map.Open(resourceService, mapName);
+      MgMap map = new MgMap(siteConnection);
+      map.Open(mapName);
       String srs = map.GetMapSRS();
       
       // Format it and display it in the task pane.

Modified: sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -47,14 +47,10 @@
       MgUserInformation userInfo = new MgUserInformation(sessionId);
       MgSiteConnection siteConnection = new MgSiteConnection();
       siteConnection.Open(userInfo);
-  
-      // Get an instance of the required service(s).
-      
-      MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
-  
-      MgMap map = new MgMap();
-      map.Open(resourceService, mapName);
 
+      MgMap map = new MgMap(siteConnection);
+      map.Open(mapName);
+
       MgLayerCollection layers = map.GetLayers(); // Get layer collection
       out.println("<p>Layers, in draw order:</p>");
       out.println("<table class=\"taskPane\" cellspacing=\"0\">");

Modified: sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -59,13 +59,9 @@
       MgUserInformation userInfo = new MgUserInformation(sessionId);
       MgSiteConnection siteConnection = new MgSiteConnection();
       siteConnection.Open(userInfo);
-  
-      // Get an instance of the required service(s).
-      
-      MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
 
-      MgMap map = new MgMap(); 
-      map.Open(resourceService, mapName);
+      MgMap map = new MgMap(siteConnection); 
+      map.Open(mapName);
 
       MgLayerCollection layers = map.GetLayers(); // Get layer collection
 
@@ -82,7 +78,7 @@
       // You must save the updated map or the
       // changes will not be applied
       // Also be sure to refresh the map on page load.
-      map.Save(resourceService);
+      map.Save();
 
       out.println("<p>Layer label has been changed to " + newLabel + ".</p>");
 

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/clearaddressresults.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/clearaddressresults.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/clearaddressresults.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -54,20 +54,14 @@
 
         featureService.UpdateFeatures(addressMarkerDataResId, commands, false);
 
-        // Create a ReserviceService object and use it to open the Map
-        // object from the sessions repository. Use the Map object to hide
-        // the "ParcelMarker" layer and then save the updated Map back to
-        // the session.
+        MgMap map = new MgMap(siteConnection);
+        map.Open("Sheboygan");
 
-        MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-        MgMap map = new MgMap();
-        map.Open(resourceService, "Sheboygan");
-
         MgLayer layer = GetLayerByName(map, "AddressMarker");
         layer.SetVisible(false);
         layer.ForceRefresh();
 
-        map.Save(resourceService);
+        map.Save();
     }
     catch (MgException e)
     {

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddress.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddress.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddress.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -84,8 +84,8 @@
             MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
             MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, "Sheboygan");
+            MgMap map = new MgMap(siteConnection);
+            map.Open("Sheboygan");
 
             // Check the map for the AddressMarker layer. If it does not
             // exist then create a feature source to store address results
@@ -128,7 +128,7 @@
             addressLayer.SetVisible(true);
             addressLayer.ForceRefresh();
 
-            map.Save(resourceService);
+            map.Save();
 
             success = true;
         }

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -34,12 +34,12 @@
     <script language="javascript">
     function Submit()
     {
-    	var addressForm = document.getElementById("addressForm");
-    	var addressValue = document.getElementById("addressValue");
-    	var addressInput = document.getElementById("addressInput");
-    	
-    	addressValue.value = addressInput.value;
-    	addressForm.submit();
+        var addressForm = document.getElementById("addressForm");
+        var addressValue = document.getElementById("addressValue");
+        var addressInput = document.getElementById("addressInput");
+        
+        addressValue.value = addressInput.value;
+        addressForm.submit();
     }
     </script>
 </head>
@@ -66,9 +66,8 @@
         // object from the sessions repository. Use the Map object to
         // determine if the "AddressMarker" layer is visible.
 
-        MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-        MgMap map = new MgMap();
-        map.Open(resourceService, "Sheboygan");
+        MgMap map = new MgMap(siteConnection);
+        map.Open("Sheboygan");
         MgLayer addressLayer = GetLayerByName(map, "AddressMarker");
 
         if (addressLayer != null)

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/plot/plot.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/plot/plot.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/plot/plot.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -39,13 +39,9 @@
         MgSiteConnection siteConnection = new MgSiteConnection();
         siteConnection.Open(userInfo);
 
-        // Create an instance of ResourceService and use that to open the
-        // current map instance stored in session state.
+        MgMap map = new MgMap(siteConnection);
+        map.Open("Sheboygan");
 
-        MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-        MgMap map = new MgMap();
-        map.Open(resourceService, "Sheboygan");
-
         // Now create an instance of MappingService and use it to plot the
         // current view of the map.
 

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/plot/plotmain.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/plot/plotmain.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/plot/plotmain.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -41,8 +41,8 @@
             useLayoutValue.value = "true";
         else
             useLayoutValue.value = "false";
-    	
-    	scaleValue.value = "0";
+        
+        scaleValue.value = "0";
         plotForm.submit();	
     }
     function SubmitAtScale()
@@ -95,9 +95,8 @@
         // determine the current scale of the map for display on this
         // page.
 
-        MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
-        MgMap map = new MgMap();
-        map.Open(resourceService, "Sheboygan");
+        MgMap map = new MgMap(siteConnection);
+        map.Open("Sheboygan");
 
         viewCenter = map.GetViewCenter();
         viewScale = map.GetViewScale();

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/query/classes/query.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/query/classes/query.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/query/classes/query.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -67,9 +67,8 @@
         
         public ArrayList<String> GetMapLayerNames() throws MgException
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayerCollection layers = map.GetLayers();
             ArrayList<String> layerNames = new ArrayList<String>();
 
@@ -90,17 +89,12 @@
         public ArrayList<Property> GetLayerProperties() throws MgException
         {
             ArrayList<Property> properties = new ArrayList<Property>();
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
 
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String[] schemaClass = layer.GetFeatureClassName().split(":");
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-
             for(int i=0; i<classDef.GetProperties().GetCount(); i++)
             {
                 MgPropertyDefinition propertyDef = classDef.GetProperties().GetItem(i);
@@ -121,9 +115,8 @@
         public boolean ToggleSpatialFilter() throws MgException
         {
             boolean result = true;
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
 
             MgLayerCollection layers = map.GetLayers();
             if(layers.Contains("_QuerySpatialFilter"))
@@ -134,7 +127,7 @@
                 else
                     layer.SetVisible(false);
 
-                map.Save(resourceService);
+                map.Save();
             }
 
             return result;
@@ -150,8 +143,8 @@
 
             MgFeatureCommandCollection updateCommands = new MgFeatureCommandCollection();
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
 
             MgLayer layer = null;
             MgLayerCollection layers = map.GetLayers();
@@ -200,7 +193,7 @@
             // Make the layer visible
 
             layer.SetVisible(true);
-            map.Save(resourceService);
+            map.Save();
 
             // Add the geometry to the filter feature source
 
@@ -221,21 +214,18 @@
         public ArrayList<Feature> Execute() throws MgException
         {
             ArrayList<Feature> result = new ArrayList<Feature>();
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
 
             MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
             MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String featureClass = layer.GetFeatureClassName();
             String featureGeometry = layer.GetFeatureGeometryName();
 
             // Initialize the coordinate system transform
 
-            String[] schemaClass = layer.GetFeatureClassName().split(":");
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
+            MgClassDefinition classDef = layer.GetClassDefinition();
             MgGeometricPropertyDefinition geomProp = (MgGeometricPropertyDefinition) classDef.GetProperties().GetItem(featureGeometry);
             String spatialContext = geomProp.GetSpatialContextAssociation();
 
@@ -286,7 +276,7 @@
 
             int count = 0;
             MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();
-            MgFeatureReader featureReader = featureService.SelectFeatures(resId, layer.GetFeatureClassName(), queryOptions);
+            MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
             String displayValue = null;
             while(featureReader.ReadNext() && (queryMax <= 0 || count < queryMax))
             {
@@ -351,18 +341,14 @@
 
         public String GetSelectionXML() throws MgException, JSONException
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
             MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
 
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
             String featureClass = layer.GetFeatureClassName();
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
-            String[] schemaClass = layer.GetFeatureClassName().split(":");
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-
             MgPropertyCollection properties = new MgPropertyCollection();
             MgDataPropertyDefinition dataPropDef = null;
             JSONObject json = new JSONObject(this.args.get("IDLIST"));

Modified: sandbox/jng/v30/Doc/samples/javaviewersample/theme/classes/theme.jsp
===================================================================
--- sandbox/jng/v30/Doc/samples/javaviewersample/theme/classes/theme.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/javaviewersample/theme/classes/theme.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -33,92 +33,84 @@
 <%!
     public class Theme
     {
-    	Map<String, String> args = null;
-    	private MgSiteConnection site = null;
-    	private String[] distNameArray = null;
-    	private String[] distValueArray = null;
-    	
-    	public Theme(Map<String, String> incomingArgs) throws MgException
-    	{
-    	    this.args = incomingArgs;
-    	    this.site = new MgSiteConnection();
-    	    this.site.Open(new MgUserInformation(this.args.get("SESSION")));
-    	    this.distNameArray = new String[] {"Individual", "Equal", "Standard Deviation", "Quantile", "Jenks (Natural Breaks)"};
-    	    this.distValueArray = new String[] {"INDIV_DIST", "EQUAL_DIST", "STDEV_DIST", "QUANT_DIST", "JENK_DIST"};
-    	}
-    	
-    	public String getNameArray()
-	{
-	    JSONArray jsonArray = new JSONArray();
-	    for(int i=0;i<5;i++)
-	    {
-		jsonArray.put(distNameArray[i]);
-	    }
-	    return jsonArray.toString();
-	}
-
-	public String getValueArray()
-	{
-	    JSONArray jsonArray = new JSONArray();
-	    for(int i=0;i<5;i++)
-	    {
-		jsonArray.put(distValueArray[i]);
-	    }
-	    return jsonArray.toString();
-	}
+        Map<String, String> args = null;
+        private MgSiteConnection site = null;
+        private String[] distNameArray = null;
+        private String[] distValueArray = null;
         
+        public Theme(Map<String, String> incomingArgs) throws MgException
+        {
+            this.args = incomingArgs;
+            this.site = new MgSiteConnection();
+            this.site.Open(new MgUserInformation(this.args.get("SESSION")));
+            this.distNameArray = new String[] {"Individual", "Equal", "Standard Deviation", "Quantile", "Jenks (Natural Breaks)"};
+            this.distValueArray = new String[] {"INDIV_DIST", "EQUAL_DIST", "STDEV_DIST", "QUANT_DIST", "JENK_DIST"};
+        }
+        
+        public String getNameArray()
+        {
+            JSONArray jsonArray = new JSONArray();
+            for(int i=0;i<5;i++)
+            {
+                jsonArray.put(distNameArray[i]);
+            }
+            return jsonArray.toString();
+        }
+
+        public String getValueArray()
+        {
+            JSONArray jsonArray = new JSONArray();
+            for(int i=0;i<5;i++)
+            {
+            jsonArray.put(distValueArray[i]);
+            }
+            return jsonArray.toString();
+        }
+            
         public ArrayList<String> GetMapLayerNames() throws MgException
-	{
-	    MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-	    MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-	    
-	    MgMap map = new MgMap();
-	    map.Open(resourceService, this.args.get("MAPNAME"));
-	    MgLayerCollection layers = map.GetLayers();
-	    ArrayList<String> layerNames = new ArrayList<String>();
+        {
+            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
+            
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
+            MgLayerCollection layers = map.GetLayers();
+            ArrayList<String> layerNames = new ArrayList<String>();
 
-	    for(int i=0; i<layers.GetCount(); i++)
-	    {
-		MgLayer layer = (MgLayer) layers.GetItem(i);
-		if(!layer.GetName().startsWith("_") && !layer.GetFeatureSourceId().toUpperCase().startsWith("SESSION"))
-		{
-		    MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-		    String[] schemaClass = layer.GetFeatureClassName().split(":");
-		
-		    MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-		    MgPropertyDefinition propDef = classDef.GetProperties().GetItem(layer.GetFeatureGeometryName());
-		    
-		    if(propDef.GetPropertyType() == MgFeaturePropertyType.GeometricProperty)
-		    {
-			MgGeometricPropertyDefinition geomPropDef = (MgGeometricPropertyDefinition) propDef;
-			
-			if(geomPropDef.GetGeometryTypes() == MgFeatureGeometricType.Surface)
-			    layerNames.add(layer.GetLegendLabel());
-		    }
-		}
-	    }
-	    Collections.sort(layerNames);
+            for(int i=0; i<layers.GetCount(); i++)
+            {
+                MgLayer layer = (MgLayer) layers.GetItem(i);
+                if(!layer.GetName().startsWith("_") && !layer.GetFeatureSourceId().toUpperCase().startsWith("SESSION"))
+                {
+                    MgClassDefinition classDef = layer.GetClassDefinition();
+                    MgPropertyDefinition propDef = classDef.GetProperties().GetItem(layer.GetFeatureGeometryName());
+                    
+                    if(propDef.GetPropertyType() == MgFeaturePropertyType.GeometricProperty)
+                    {
+                        MgGeometricPropertyDefinition geomPropDef = (MgGeometricPropertyDefinition) propDef;
+                        
+                        if(geomPropDef.GetGeometryTypes() == MgFeatureGeometricType.Surface)
+                            layerNames.add(layer.GetLegendLabel());
+                    }
+                }
+            }
+            Collections.sort(layerNames);
 
-	    return layerNames;
+            return layerNames;
         }
-        
-	public LayerInfo GetLayerInfo() throws MgException, ParserConfigurationException, IOException, SAXException
+            
+        public LayerInfo GetLayerInfo() throws MgException, ParserConfigurationException, IOException, SAXException
         {
             ArrayList<Property> properties = new ArrayList<Property>();
             ArrayList<String> scaleRanges = new ArrayList<String>();
             
             MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
             
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
 
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            String[] schemaClass = layer.GetFeatureClassName().split(":");
+            MgClassDefinition classDef = layer.GetClassDefinition();
 
-            MgClassDefinition classDef = featureService.GetClassDefinition(resId, schemaClass[0], schemaClass[1]);
-
             for(int i=0; i<classDef.GetProperties().GetCount(); i++)
             {
                 MgPropertyDefinition propertyDef = classDef.GetProperties().GetItem(i);
@@ -172,14 +164,9 @@
         {
             ArrayList<String> propertyMinMaxCount = new ArrayList<String>();
             
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-            
-            MgMap map = new MgMap();
-            map.Open(resourceService, this.args.get("MAPNAME"));
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
             MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
-
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
             
             String minValue = null;
             String maxValue = null;
@@ -189,7 +176,7 @@
             MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
             queryOptions.AddFeatureProperty(this.args.get("PROPERTYNAME"));
             
-            MgFeatureReader featureReader = featureService.SelectFeatures(resId, layer.GetFeatureClassName(), queryOptions);
+            MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
             while(featureReader.ReadNext())
             {
                 String value = this.GetFeaturePropertyValue(featureReader, this.args.get("PROPERTYNAME"));
@@ -256,12 +243,11 @@
         
         public String ApplyTheme() throws MgException, ParserConfigurationException, IOException, SAXException, TransformerConfigurationException, TransformerException
         {
-    	    MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
-    	    MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
+            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
 
-    	    MgMap map = new MgMap();
-    	    map.Open(resourceService, this.args.get("MAPNAME"));
-    	    MgLayerCollection layers = map.GetLayers();
+            MgMap map = new MgMap(this.site);
+            map.Open(this.args.get("MAPNAME"));
+            MgLayerCollection layers = map.GetLayers();
             MgLayer layer = (MgLayer) layers.GetItem(this.args.get("LAYERNAME"));
             
             MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
@@ -315,7 +301,7 @@
                 aggregateOptions.AddFeatureProperty(this.args.get("PROPERTYNAME"));
                 aggregateOptions.SelectDistinct(true);
                 
-                MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);
+                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
                 while(dataReader.ReadNext())
                 {
                     value = this.GetFeaturePropertyValue(dataReader, this.args.get("PROPERTYNAME"));
@@ -349,7 +335,7 @@
                 aggregateOptions.AddComputedProperty("THEME_VALUE",
                     this.args.get("DISTRO") + "(\"" + this.args.get("PROPERTYNAME") + "\"," + this.args.get("NUMRULES") + "," + this.args.get("MINVALUE") + "," + this.args.get("MAXVALUE") + ")");
                 
-                MgDataReader dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);
+                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
                 while(dataReader.ReadNext())
                 {
                     value = this.GetFeaturePropertyValue(dataReader, "THEME_VALUE");
@@ -377,7 +363,7 @@
 
                     areaNode = doc.importNode(areaDoc.getDocumentElement(), true);
                     areaTypeStyle.appendChild(areaNode);
-		                        
+                                
                     portion = portion + increment;
                 }
             }
@@ -409,7 +395,7 @@
             newLayer.SetSelectable(layer.GetSelectable());
             layers.Insert(layers.IndexOf(layer), newLayer);
             
-            map.Save(resourceService);
+            map.Save();
 
             return uniqueName;
         }

Modified: sandbox/jng/v30/Doc/samples/phpsamples/analyzing_features/bufferfunctions.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/analyzing_features/bufferfunctions.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/analyzing_features/bufferfunctions.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -56,7 +56,8 @@
     // modify its content to reference the temporary
     // feature source.
 
-    $doc = DOMDocument::load('bufferlayerdefinition.xml');
+    $doc = new DOMDocument();
+    $doc->load('bufferlayerdefinition.xml');
     $featureSourceNode = $doc->getElementsByTagName('ResourceId')->item(0);
     $featureSourceNode->nodeValue = $bufferFeatureResId->ToString();
 
@@ -125,7 +126,8 @@
     // modify its content to reference the temporary
     // feature source.
 
-    $doc = DOMDocument::load('parcelmarker.xml');
+    $doc = new DOMDocument();
+    $doc->load('parcelmarker.xml');
     $featureSourceNode = $doc->getElementsByTagName('ResourceId')->item(0);
     $featureSourceNode->nodeValue = $parcelMarkerDataResId->ToString();
 

Modified: sandbox/jng/v30/Doc/samples/phpsamples/common/common.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/common/common.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/common/common.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -19,10 +19,10 @@
 // -----------------------------------------------------------------------------------
 // Use the following for Windows installations
 // -----------------------------------------------------------------------------------
-$webExtensionsDirectory = 'C:\Program Files\OSGeo\MapGuide\Web\\';
-  
-$MapGuideServerDirectory = 'C:\Program Files\OSGeo\MapGuide\Server\\';
-  
+//$webExtensionsDirectory = 'C:\Program Files\OSGeo\MapGuide\Web\\';
+$webExtensionsDirectory = 'D:\mg-trunk\MgDev\Release\Web\\';
+//$MapGuideServerDirectory = 'C:\Program Files\OSGeo\MapGuide\Server\\';
+$MapGuideServerDirectory = 'D:\mg-trunk\MgDev\Release\Server\\';
 $viewerFilesDirectory = $webExtensionsDirectory . 'www\viewerfiles\\';
   
 $schemaDirectory = $MapGuideServerDirectory . 'Schema\\';

Modified: sandbox/jng/v30/Doc/samples/phpsamples/custom_output/createmapimage.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/custom_output/createmapimage.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/custom_output/createmapimage.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -43,15 +43,13 @@
 
   // Create the necessary services.
 
-  $resourceService = $siteConnection->
-    CreateService(MgServiceType::ResourceService);
   $renderingService = $siteConnection->
     CreateService(MgServiceType::RenderingService);
 
   // Open the map and get its SRS
 
-  $map = new MgMap();
-  $map->Open($resourceService, $mapName);
+  $map = new MgMap($siteConnection);
+  $map->Open($mapName);
   $srsWkt = $map->GetMapSRS();
   $coordinateSystemFactory = new MgCoordinateSystemFactory();
   $srs = $coordinateSystemFactory->Create($srsWkt);

Modified: sandbox/jng/v30/Doc/samples/phpsamples/custom_output/eplot.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/custom_output/eplot.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/custom_output/eplot.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -34,13 +34,9 @@
   $siteConnection = new MgSiteConnection();
   $siteConnection->Open($userInfo);
 
-  // Create an instance of ResourceService and use that to open the
-  // current map instance stored in session state.
+  $map = new MgMap($siteConnection);
+  $map->Open($mapName);
 
-  $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-  $map = new MgMap();
-  $map->Open($resourceService, $mapName);
-
   $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
 
   $dwfVersion = new MgDwfVersion("6.01", "1.2");

Modified: sandbox/jng/v30/Doc/samples/phpsamples/custom_output/multiplot.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/custom_output/multiplot.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/custom_output/multiplot.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -34,13 +34,9 @@
   $siteConnection = new MgSiteConnection();
   $siteConnection->Open($userInfo);
 
-  // Create an instance of ResourceService and use that to open the
-  // current map instance stored in session state.
+  $map = new MgMap($siteConnection);
+  $map->Open($mapName);
 
-  $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-  $map = new MgMap();
-  $map->Open($resourceService, $mapName);
-
   $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
 
   $dwfVersion = new MgDwfVersion("6.01", "1.2");
@@ -61,8 +57,8 @@
   // Create a second map for the second sheet in the DWF. This second sheet uses the print layout
   // to display a page title and legend.
 
-  $map2 = new MgMap();
-  $map2->Create($resourceService, $map->GetMapDefinition(), 'Sheet 2');
+  $map2 = new MgMap($siteConnection);
+  $map2->Create($map->GetMapDefinition(), 'Sheet 2');
   $plot2 = new MgMapPlot($map2, $plotSpec, $layout);
   $plot2->SetCenterAndScale($map->GetViewCenter()->GetCoordinate(), $map->GetViewScale());
   // $plot2 = new MgMapPlot($map2, $map->GetViewCenter()->GetCoordinate(), $map->GetViewScale(), $plotSpec, $layout);

Modified: sandbox/jng/v30/Doc/samples/phpsamples/custom_output/property_report.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/custom_output/property_report.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/custom_output/property_report.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -44,12 +44,10 @@
   // If any parcels have been selected, recenter the image on the first selected parcel.
   if ($xmlSelection != '')
   {
-    $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-    $featureService = $siteConnection->CreateService(MgServiceType::FeatureService);
     $queryOptions = new MgFeatureQueryOptions();
 
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
     $selection = new MgSelection($map, $xmlSelection);
     $layers = $selection->GetLayers();
@@ -65,22 +63,8 @@
         if ($layer && $layer->GetName() == 'Parcels')
         {
 
-          // Create a filter containing the IDs of the selected features on this layer
+          $featureReader = $selection->GetSelectedFeatures($layer, $layer->GetFeatureClassName(), false);
 
-          $layerClassName = $layer->GetFeatureClassName();
-          $selectionString = $selection->GenerateFilter($layer, $layerClassName);
-
-          // Get the feature resource for the selected layer
-
-          $layerFeatureId = $layer->GetFeatureSourceId();
-          $layerFeatureResource = new MgResourceIdentifier($layerFeatureId);
-
-          // Apply the filter to the feature resource for the selected layer. This returns
-          // an MgFeatureReader of all the selected features.
-
-          $queryOptions->SetFilter($selectionString);
-          $featureReader = $featureService->SelectFeatures($layerFeatureResource, $layerClassName, $queryOptions);
-
           // Create the report details using the first selected parcel. Position the image so the
           // centroid of the selected parcel is in the center of the map.
 

Modified: sandbox/jng/v30/Doc/samples/phpsamples/modifying_maps_and_layers/create_new_line_layer_definition.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/modifying_maps_and_layers/create_new_line_layer_definition.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/modifying_maps_and_layers/create_new_line_layer_definition.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -54,21 +54,21 @@
 
     // --------------------------------------------------//
     // Open the map
-    $map = new MgMap();
-    $map->Open($resourceService, $mapName);
+    $map = new MgMap($siteConnection);
+    $map->Open($mapName);
 
-	// ...
+    // ...
     //---------------------------------------------------//
     // Create a new layer
 
-	$factory = new LayerDefinitionFactory();
+    $factory = new LayerDefinitionFactory();
 
     // Create a line rule.
     $legendLabel = '';
     $filter = '';
     $color = 'FF0000FF';
-	$lineRule = $factory->CreateLineRule(
-	  $legendLabel, $filter, $color);
+    $lineRule = $factory->CreateLineRule(
+      $legendLabel, $filter, $color);
 
     // Create a line type style.
     $lineTypeStyle = $factory->
@@ -86,9 +86,9 @@
       . 'HydrographicLines.FeatureSource';
     $featureName = 'SHP_Schema:HydrographicLines';
     $geometry = 'SHPGEOM';
-	$layerDefinition = $factory->
-	  CreateLayerDefinition($featureClass, $featureName,
-	  $geometry, $lineScaleRange);
+    $layerDefinition = $factory->
+      CreateLayerDefinition($featureClass, $featureName,
+      $geometry, $lineScaleRange);
 
     //---------------------------------------------------//
     // ...
@@ -120,9 +120,9 @@
 }
 catch (MgException $e)
 {
-	echo "<script language=\"javascript\" type=\"text/javascript\"> \n";
-	echo "    alert(\" " . $e->GetExceptionMessage() . " \"); \n";
-	echo "</script> \n";
+    echo "<script language=\"javascript\" type=\"text/javascript\"> \n";
+    echo "    alert(\" " . $e->GetExceptionMessage() . " \"); \n";
+    echo "</script> \n";
 }
 ?>
 

Modified: sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/queryfeatures.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/queryfeatures.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/queryfeatures.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -56,13 +56,15 @@
       // Get the geometry for the boundaries of District 1
 
       $districtQuery = new MgFeatureQueryOptions();
-      $districtQuery->SetFilter("Autogenerated_SDF_ID = 1");
-
       $layer = $map->GetLayers()->GetItem('Districts');
+      $classDef = $layer->GetClassDefinition();
+      $clsIdProps = $classDef->GetIdentityProperties();
+      $idProp = $clsIdProps->GetItem(0);      
+      $districtQuery->SetFilter($idProp->GetName()." = 1");
+      
       $featureReader = $layer->SelectFeatures($districtQuery);
       $featureReader->ReadNext();
-      $districtGeometryData = $featureReader->
-      GetGeometry('Data');
+      $districtGeometryData = $featureReader->GetGeometry($layer->GetFeatureGeometryName());
 
       // Convert the AGF binary data to MgGeometry.
 
@@ -99,6 +101,7 @@
     }
     catch (MgException $e)
     {
+      echo $e->getTraceAsString();
       echo $e->GetExceptionMessage();
       echo $e->GetDetails();
     }

Modified: sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/selectfeatures.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/selectfeatures.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpsamples/working_with_feature_data/selectfeatures.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -55,13 +55,15 @@
       // Get the geometry for the boundaries of District 1
 
       $districtQuery = new MgFeatureQueryOptions();
-      $districtQuery->SetFilter("Autogenerated_SDF_ID = 1");
+      $layer = $map->GetLayers()->GetItem('Districts');
+      $classDef = $layer->GetClassDefinition();
+      $clsIdProps = $classDef->GetIdentityProperties();
+      $idProp = $clsIdProps->GetItem(0);      
+      $districtQuery->SetFilter($idProp->GetName()." = 1");
 
-      $layer = $map->GetLayers()->GetItem('Districts');
       $featureReader = $layer->SelectFeatures($districtQuery);
       $featureReader->ReadNext();
-      $districtGeometryData = $featureReader->
-      GetGeometry('Data');
+      $districtGeometryData = $featureReader->GetGeometry($layer->GetFeatureGeometryName());
 
       // Convert the AGF binary data to MgGeometry.
 

Added: sandbox/jng/v30/Doc/samples/phpviewersample/composer.json
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/composer.json	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/composer.json	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,5 @@
+{
+    "require": {
+        "lstrojny/fxmlrpc": "*"
+    }
+}

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/clearaddressresults.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/clearaddressresults.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/clearaddressresults.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -53,20 +53,14 @@
 
         $featureService->UpdateFeatures($addressMarkerDataResId, $commands, false);
 
-        // Create a ReserviceService object and use it to open the Map
-        // object from the sessions repository. Use the Map object to hide
-        // the "ParcelMarker" layer and then save the updated Map back to
-        // the session.
+        $map = new MgMap($siteConnection);
+        $map->Open('Sheboygan');
 
-        $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-        $map = new MgMap();
-        $map->Open($resourceService, 'Sheboygan');
-
         $layer = GetLayerByName($map, 'AddressMarker');
         $layer->SetVisible(false);
         $layer->ForceRefresh();
 
-        $map->Save($resourceService);
+        $map->Save();
     }
     catch (MgException $e)
     {

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddress.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddress.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddress.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -44,10 +44,8 @@
 <?php
     include '../utilityfunctions.php';
     include 'findaddressfunctions.php';
+    require_once '../vendor/autoload.php';
 
-    // Include the xmlrpc library.
-    require_once('kd_xmlrpc.php');
-
     $mgSessionId = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST['SESSION']: $_GET['SESSION'];
     $success = false;
     $long = 0; $lat = 0;
@@ -66,8 +64,10 @@
         $address = $_GET['address'] . ', Sheboygan, WI';
 
         // Make the request to geocoder.us passing the address.
-        list($success, $response) = XMLRPC_request('rpc.geocoder.us', '/service/xmlrpc', 'geocode', array(XMLRPC_prepare($address)));
-
+        $url = 'http://rpc.geocoder.us/service/xmlrpc';
+        $client = new fXmlRpc\Client($url);
+        $response = $client->call('geocode', array($address, true));
+        
         // Stuff the response into a new variable:
         $nested_array = $response;
 
@@ -81,13 +81,13 @@
         // we can't use this to check for errors. Instead, we'll check the values in the
         // array and deem success or failure based on that.
 
-        if (array_key_exists('lat', $geoarray) && array_key_exists('long', $geoarray))
+        if (NULL != $geoarray && array_key_exists('lat', $geoarray) && array_key_exists('long', $geoarray))
         {
             // The geocode successfully returned a location.
 
             $lat = $geoarray['lat'];
             $long = $geoarray['long'];
-
+            
             // Build an address1 and address2 variables from the result.
             $address1 = $geoarray['number'] . ' '
                 . (strlen($geoarray['prefix']) > 0 ? $geoarray['prefix'] . ' ' : '')
@@ -98,7 +98,7 @@
             $address2 = $geoarray['city']
                 . ', ' . $geoarray['state']
                 . '  ' . $geoarray['zip'];
-
+            
             echo '<tr><td><img src="../images/pushpinblue.jpg">';
             echo '<a href="gotopoint.php?X=' . $long . '&Y=' . $lat . '&Scale=2000" target="scriptFrame"> ' . $address1 . '</a></td></tr>';
             echo '<tr><td>' . $address2 . '</td></tr>';
@@ -113,8 +113,8 @@
             $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
             $featureService = $siteConnection->CreateService(MgServiceType::FeatureService);
 
-            $map = new MgMap();
-            $map->Open($resourceService, 'Sheboygan');
+            $map = new MgMap($siteConnection);
+            $map->Open('Sheboygan');
 
             // Check the map for the AddressMarker layer. If it does not
             // exist then create a feature source to store address results
@@ -157,7 +157,7 @@
             $addressLayer->SetVisible(true);
             $addressLayer->ForceRefresh();
 
-            $map->Save($resourceService);
+            $map->Save();
 
             $success = true;
         }

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressfunctions.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressfunctions.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressfunctions.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -101,7 +101,8 @@
     // modify it's content to reference the temporary
     // feature source.
 
-    $doc = DOMDocument::load(GetXmlPath());
+    $doc = new DOMDocument();
+    $doc->load(GetXmlPath());
     $featureSourceNode = $doc->getElementsByTagName('ResourceId')->item(0);
     $featureSourceNode->nodeValue = $addressMarkerDataResId->ToString();
 

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressmain.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressmain.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/findaddressmain.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -30,12 +30,12 @@
     <script language="javascript">
     function Submit()
     {
-    	var addressForm = document.getElementById("addressForm");
-    	var addressValue = document.getElementById("addressValue");
-    	var addressInput = document.getElementById("addressInput");
+        var addressForm = document.getElementById("addressForm");
+        var addressValue = document.getElementById("addressValue");
+        var addressInput = document.getElementById("addressInput");
 
-    	addressValue.value = addressInput.value;
-    	addressForm.submit();
+        addressValue.value = addressInput.value;
+        addressForm.submit();
     }
     </script>
 </head>
@@ -60,13 +60,8 @@
         $siteConnection = new MgSiteConnection();
         $siteConnection->Open($userInfo);
 
-        // Create a ReserviceService object and use it to open the Map
-        // object from the sessions repository. Use the Map object to
-        // determine if the "AddressMarker" layer is visible.
-
-        $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-        $map = new MgMap();
-        $map->Open($resourceService, 'Sheboygan');
+        $map = new MgMap($siteConnection);
+        $map->Open('Sheboygan');
         $addressLayer = GetLayerByName($map, 'AddressMarker');
 
         if ($addressLayer != null)

Deleted: sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/kd_xmlrpc.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/kd_xmlrpc.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/findaddress/kd_xmlrpc.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -1,498 +0,0 @@
-<?php
-/*
-An XML-RPC implementation by Keith Devens, version 2.5f.
-http://www.keithdevens.com/software/xmlrpc/
-
-Release history available at:
-http://www.keithdevens.com/software/xmlrpc/history/
-
-This code is Open Source, released under terms similar to the Artistic License.
-Read the license at http://www.keithdevens.com/software/license/
-
-Note: this code requires version 4.1.0 or higher of PHP.
-*/
-
-function & XML_serialize(&$data, $level = 0, $prior_key = NULL){
-    #assumes a hash, keys are the variable names
-    $xml_serialized_string = "";
-    while(list($key, $value) = each($data)){
-        $inline = false;
-        $numeric_array = false;
-        $attributes = "";
-        #echo "My current key is '$key', called with prior key '$prior_key'<br>";
-        if(!strstr($key, " attr")){ #if it's not an attribute
-            if(array_key_exists("$key attr", $data)){
-                while(list($attr_name, $attr_value) = each($data["$key attr"])){
-                    #echo "Found attribute $attribute_name with value $attribute_value<br>";
-                    $attr_value = &htmlspecialchars($attr_value, ENT_QUOTES);
-                    $attributes .= " $attr_name=\"$attr_value\"";
-                }
-            }
-
-            if(is_numeric($key)){
-                #echo "My current key ($key) is numeric. My parent key is '$prior_key'<br>";
-                $key = $prior_key;
-            }else{
-                #you can't have numeric keys at two levels in a row, so this is ok
-                #echo "Checking to see if a numeric key exists in data.";
-                if(is_array($value) and array_key_exists(0, $value)){
-                #   echo " It does! Calling myself as a result of a numeric array.<br>";
-                    $numeric_array = true;
-                    $xml_serialized_string .= XML_serialize($value, $level, $key);
-                }
-                #echo "<br>";
-            }
-
-            if(!$numeric_array){
-                $xml_serialized_string .= str_repeat("\t", $level) . "<$key$attributes>";
-
-                if(is_array($value)){
-                    $xml_serialized_string .= "\r\n" . XML_serialize($value, $level+1);
-                }else{
-                    $inline = true;
-                    $xml_serialized_string .= htmlspecialchars($value);
-                }
-
-                $xml_serialized_string .= (!$inline ? str_repeat("\t", $level) : "") . "</$key>\r\n";
-            }
-        }else{
-            #echo "Skipping attribute record for key $key<bR>";
-        }
-    }
-    if($level == 0){
-        $xml_serialized_string = "<?xml version=\"1.0\" ?>\r\n" . $xml_serialized_string;
-        return $xml_serialized_string;
-    }else{
-        return $xml_serialized_string;
-    }
-}
-
-class XML {
-    var $parser; #a reference to the XML parser
-    var $document; #the entire XML structure built up so far
-    var $current; #a pointer to the current item - what is this
-    var $parent; #a pointer to the current parent - the parent will be an array
-    var $parents; #an array of the most recent parent at each level
-
-    var $last_opened_tag;
-
-    function XML($data=null){
-        $this->parser = xml_parser_create();
-
-        xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, 0);
-        xml_set_object($this->parser, &$this);
-        xml_set_element_handler($this->parser, "open", "close");
-        xml_set_character_data_handler($this->parser, "data");
-#       register_shutdown_function(array(&$this, 'destruct'));
-    }
-
-    function destruct(){
-        xml_parser_free($this->parser);
-    }
-
-    function parse($data){
-        $this->document = array();
-        $this->parent = &$this->document;
-        $this->parents = array();
-        $this->last_opened_tag = NULL;
-        xml_parse($this->parser, $data);
-        return $this->document;
-    }
-
-    function open($parser, $tag, $attributes){
-        #echo "Opening tag $tag<br>\n";
-        $this->data = "";
-        $this->last_opened_tag = $tag; #tag is a string
-        if(array_key_exists($tag, $this->parent)){
-            #echo "There's already an instance of '$tag' at the current level ($level)<br>\n";
-            if(is_array($this->parent[$tag]) and array_key_exists(0, $this->parent[$tag])){ #if the keys are numeric
-                #need to make sure they're numeric (account for attributes)
-                $key = count_numeric_items($this->parent[$tag]);
-                #echo "There are $key instances: the keys are numeric.<br>\n";
-            }else{
-                #echo "There is only one instance. Shifting everything around<br>\n";
-                $temp = &$this->parent[$tag];
-                unset($this->parent[$tag]);
-                $this->parent[$tag][0] = &$temp;
-
-                if(array_key_exists("$tag attr", $this->parent)){
-                    #shift the attributes around too if they exist
-                    $temp = &$this->parent["$tag attr"];
-                    unset($this->parent["$tag attr"]);
-                    $this->parent[$tag]["0 attr"] = &$temp;
-                }
-                $key = 1;
-            }
-            $this->parent = &$this->parent[$tag];
-        }else{
-            $key = $tag;
-        }
-        if($attributes){
-            $this->parent["$key attr"] = $attributes;
-        }
-
-        $this->parent[$key] = array();
-        $this->parent = &$this->parent[$key];
-        array_unshift($this->parents, &$this->parent);
-    }
-
-    function data($parser, $data){
-        #echo "Data is '", htmlspecialchars($data), "'<br>\n";
-        if($this->last_opened_tag != NULL){
-            $this->data .= $data;
-        }
-    }
-
-    function close($parser, $tag){
-        #echo "Close tag $tag<br>\n";
-        if($this->last_opened_tag == $tag){
-            $this->parent = $this->data;
-            $this->last_opened_tag = NULL;
-        }
-        array_shift($this->parents);
-        $this->parent = &$this->parents[0];
-    }
-}
-
-function & XML_unserialize(&$xml){
-    $xml_parser = new XML();
-    $data = &$xml_parser->parse(&$xml);
-    $xml_parser->destruct();
-    return $data;
-}
-
-function & XMLRPC_parse(&$request){
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_parse', "<p>Received the following raw request:</p>" . XMLRPC_show($request, 'print_r', true));
-    }
-    $data = &XML_unserialize(&$request);
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_parse', "<p>Returning the following parsed request:</p>" . XMLRPC_show($data, 'print_r', true));
-    }
-    return $data;
-}
-
-function & XMLRPC_prepare($data, $type = NULL){
-    if(is_array($data)){
-        $num_elements = count($data);
-        if((array_key_exists(0, $data) or !$num_elements) and $type != 'struct'){ #it's an array
-            if(!$num_elements){ #if the array is empty
-                $returnvalue =  array('array' => array('data' => NULL));
-            }else{
-                $returnvalue['array']['data']['value'] = array();
-                $temp = &$returnvalue['array']['data']['value'];
-                $count = count_numeric_items($data);
-                for($n=0; $n<$count; $n++){
-                    $type = NULL;
-                    if(array_key_exists("$n type", $data)){
-                        $type = $data["$n type"];
-                    }
-                    $temp[$n] = XMLRPC_prepare(&$data[$n], $type);
-                }
-            }
-        }else{ #it's a struct
-            if(!$num_elements){ #if the struct is empty
-                $returnvalue = array('struct' => NULL);
-            }else{
-                $returnvalue['struct']['member'] = array();
-                $temp = &$returnvalue['struct']['member'];
-                while(list($key, $value) = each($data)){
-                    if(substr($key, -5) != ' type'){ #if it's not a type specifier
-                        $type = NULL;
-                        if(array_key_exists("$key type", $data)){
-                            $type = $data["$key type"];
-                        }
-                        $temp[] = array('name' => $key, 'value' => XMLRPC_prepare(&$value, $type));
-                    }
-                }
-            }
-        }
-    }else{ #it's a scalar
-        if(!$type){
-            if(is_int($data)){
-                $returnvalue['int'] = $data;
-                return $returnvalue;
-            }elseif(is_float($data)){
-                $returnvalue['double'] = $data;
-                return $returnvalue;
-            }elseif(is_bool($data)){
-                $returnvalue['boolean'] = ($data ? 1 : 0);
-                return $returnvalue;
-            }elseif(preg_match('/^\d{8}T\d{2}:\d{2}:\d{2}$/', $data, $matches)){ #it's a date
-                $returnvalue['dateTime.iso8601'] = $data;
-                return $returnvalue;
-            }elseif(is_string($data)){
-                $returnvalue['string'] = htmlspecialchars($data);
-                return $returnvalue;
-            }
-        }else{
-            $returnvalue[$type] = htmlspecialchars($data);
-        }
-    }
-    return $returnvalue;
-}
-
-function & XMLRPC_adjustValue(&$current_node){
-    if(is_array($current_node)){
-        if(isset($current_node['array'])){
-            if(!is_array($current_node['array']['data'])){
-                #If there are no elements, return an empty array
-                return array();
-            }else{
-                #echo "Getting rid of array -> data -> value<br>\n";
-                $temp = &$current_node['array']['data']['value'];
-                if(is_array($temp) and array_key_exists(0, $temp)){
-                    $count = count($temp);
-                    for($n=0;$n<$count;$n++){
-                        $temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]);
-                    }
-                    $temp = &$temp2;
-                }else{
-                    $temp2 = &XMLRPC_adjustValue(&$temp);
-                    $temp = array(&$temp2);
-                    #I do the temp assignment because it avoids copying,
-                    # since I can put a reference in the array
-                    #PHP's reference model is a bit silly, and I can't just say:
-                    # $temp = array(&XMLRPC_adjustValue(&$temp));
-                }
-            }
-        }elseif(isset($current_node['struct'])){
-            if(!is_array($current_node['struct'])){
-                #If there are no members, return an empty array
-                return array();
-            }else{
-                #echo "Getting rid of struct -> member<br>\n";
-                $temp = &$current_node['struct']['member'];
-                if(is_array($temp) and array_key_exists(0, $temp)){
-                    $count = count($temp);
-                    for($n=0;$n<$count;$n++){
-                        #echo "Passing name {$temp[$n][name]}. Value is: " . show($temp[$n][value], var_dump, true) . "<br>\n";
-                        $temp2[$temp[$n]['name']] = &XMLRPC_adjustValue(&$temp[$n]['value']);
-                        #echo "adjustValue(): After assigning, the value is " . show($temp2[$temp[$n]['name']], var_dump, true) . "<br>\n";
-                    }
-                }else{
-                    #echo "Passing name $temp[name]<br>\n";
-                    $temp2[$temp['name']] = &XMLRPC_adjustValue(&$temp['value']);
-                }
-                $temp = &$temp2;
-            }
-        }else{
-            $types = array('string', 'int', 'i4', 'double', 'dateTime.iso8601', 'base64', 'boolean');
-            $fell_through = true;
-            foreach($types as $type){
-                if(array_key_exists($type, $current_node)){
-                    #echo "Getting rid of '$type'<br>\n";
-                    $temp = &$current_node[$type];
-                    #echo "adjustValue(): The current node is set with a type of $type<br>\n";
-                    $fell_through = false;
-                    break;
-                }
-            }
-            if($fell_through){
-                $type = 'string';
-                #echo "Fell through! Type is $type<br>\n";
-            }
-            switch ($type){
-                case 'int': case 'i4': $temp = (int)$temp;    break;
-                case 'string':         $temp = (string)$temp; break;
-                case 'double':         $temp = (double)$temp; break;
-                case 'boolean':        $temp = (bool)$temp;   break;
-            }
-        }
-    }else{
-        $temp = (string)$current_node;
-    }
-    return $temp;
-}
-
-function XMLRPC_getParams($request){
-    if(!is_array($request['methodCall']['params'])){
-        #If there are no parameters, return an empty array
-        return array();
-    }else{
-        #echo "Getting rid of methodCall -> params -> param<br>\n";
-        $temp = &$request['methodCall']['params']['param'];
-        if(is_array($temp) and array_key_exists(0, $temp)){
-            $count = count($temp);
-            for($n = 0; $n < $count; $n++){
-                #echo "Serializing parameter $n<br>";
-                $temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]['value']);
-            }
-        }else{
-            $temp2[0] = &XMLRPC_adjustValue($temp['value']);
-        }
-        $temp = &$temp2;
-        return $temp;
-    }
-}
-
-function XMLRPC_getMethodName($methodCall){
-    #returns the method name
-    return $methodCall['methodCall']['methodName'];
-}
-
-function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_agent = NULL){
-    $site = explode(':', $site);
-    if(isset($site[1]) and is_numeric($site[1])){
-        $port = $site[1];
-    }else{
-        $port = 80;
-    }
-    $site = $site[0];
-
-    $data["methodCall"]["methodName"] = $methodName;
-    $param_count = count($params);
-    if(!$param_count){
-        $data["methodCall"]["params"] = NULL;
-    }else{
-        for($n = 0; $n<$param_count; $n++){
-            $data["methodCall"]["params"]["param"][$n]["value"] = $params[$n];
-        }
-    }
-    $data = XML_serialize($data);
-
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_request', "<p>Received the following parameter list to send:</p>" . XMLRPC_show($params, 'print_r', true));
-    }
-    $conn = fsockopen ($site, $port); #open the connection
-    if(!$conn){ #if the connection was not opened successfully
-        if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-            XMLRPC_debug('XMLRPC_request', "<p>Connection failed: Couldn't make the connection to $site.</p>");
-        }
-        return array(false, array('faultCode'=>10532, 'faultString'=>"Connection failed: Couldn't make the connection to $site."));
-    }else{
-        $headers =
-            "POST $location HTTP/1.0\r\n" .
-            "Host: $site\r\n" .
-            "Connection: close\r\n" .
-            ($user_agent ? "User-Agent: $user_agent\r\n" : '') .
-            "Content-Type: text/xml\r\n" .
-            "Content-Length: " . strlen($data) . "\r\n\r\n";
-
-        fputs($conn, "$headers");
-        fputs($conn, $data);
-
-        if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-            XMLRPC_debug('XMLRPC_request', "<p>Sent the following request:</p>\n\n" . XMLRPC_show($headers . $data, 'print_r', true));
-        }
-
-        #socket_set_blocking ($conn, false);
-        $response = "";
-        while(!feof($conn)){
-            $response .= fgets($conn, 1024);
-        }
-        fclose($conn);
-
-        #strip headers off of response
-
-        $responsesubstr = substr($response, strpos($response, "\r\n\r\n")+4);
-        $data = XML_unserialize($responsesubstr);
-
-        if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-            XMLRPC_debug('XMLRPC_request', "<p>Received the following response:</p>\n\n" . XMLRPC_show($response, 'print_r', true) . "<p>Which was serialized into the following data:</p>\n\n" . XMLRPC_show($data, 'print_r', true));
-        }
-        if(isset($data['methodResponse']['fault'])){
-            $return =  array(false, XMLRPC_adjustValue(&$data['methodResponse']['fault']['value']));
-            if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-                XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true));
-            }
-            return $return;
-        }else{
-            $return = array(true, XMLRPC_adjustValue(&$data['methodResponse']['params']['param']['value']));
-            if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-                XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true));
-            }
-            return $return;
-        }
-    }
-}
-
-function XMLRPC_response($return_value, $server = NULL){
-    $data["methodResponse"]["params"]["param"]["value"] = &$return_value;
-    $return = XML_serialize(&$data);
-
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_response', "<p>Received the following data to return:</p>\n\n" . XMLRPC_show($return_value, 'print_r', true));
-    }
-
-    header("Connection: close");
-    header("Content-Length: " . strlen($return));
-    header("Content-Type: text/xml");
-    header("Date: " . date("r"));
-    if($server){
-        header("Server: $server");
-    }
-
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_response', "<p>Sent the following response:</p>\n\n" . XMLRPC_show($return, 'print_r', true));
-    }
-    echo $return;
-}
-
-function XMLRPC_error($faultCode, $faultString, $server = NULL){
-    $array["methodResponse"]["fault"]["value"]["struct"]["member"] = array();
-    $temp = &$array["methodResponse"]["fault"]["value"]["struct"]["member"];
-    $temp[0]["name"] = "faultCode";
-    $temp[0]["value"]["int"] = $faultCode;
-    $temp[1]["name"] = "faultString";
-    $temp[1]["value"]["string"] = $faultString;
-
-    $return = XML_serialize($array);
-
-    header("Connection: close");
-    header("Content-Length: " . strlen($return));
-    header("Content-Type: text/xml");
-    header("Date: " . date("r"));
-    if($server){
-        header("Server: $server");
-    }
-    if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
-        XMLRPC_debug('XMLRPC_error', "<p>Sent the following error response:</p>\n\n" . XMLRPC_show($return, 'print_r', true));
-    }
-    echo $return;
-}
-
-function XMLRPC_convert_timestamp_to_iso8601($timestamp){
-    #takes a unix timestamp and converts it to iso8601 required by XMLRPC
-    #an example iso8601 datetime is "20010822T03:14:33"
-    return date("Ymd\TH:i:s", $timestamp);
-}
-
-function XMLRPC_convert_iso8601_to_timestamp($iso8601){
-    return strtotime($iso8601);
-}
-
-function count_numeric_items(&$array){
-    return is_array($array) ? count(array_filter(array_keys($array), 'is_numeric')) : 0;
-}
-
-function XMLRPC_debug($function_name, $debug_message){
-    $GLOBALS['XMLRPC_DEBUG_INFO'][] = array($function_name, $debug_message);
-}
-
-function XMLRPC_debug_print(){
-    if($GLOBALS['XMLRPC_DEBUG_INFO']){
-        echo "<table border=\"1\" width=\"100%\">\n";
-        foreach($GLOBALS['XMLRPC_DEBUG_INFO'] as $debug){
-            echo "<tr><th style=\"vertical-align: top\">$debug[0]</th><td>$debug[1]</td></tr>\n";
-        }
-        echo "</table>\n";
-        unset($GLOBALS['XMLRPC_DEBUG_INFO']);
-    }else{
-        echo "<p>No debugging information available yet.</p>";
-    }
-}
-
-function XMLRPC_show($data, $func = "print_r", $return_str = false){
-    ob_start();
-    $func($data);
-    $output = ob_get_contents();
-    ob_end_clean();
-    if($return_str){
-        return "<pre>" . htmlspecialchars($output) . "</pre>\n";
-    }else{
-        echo "<pre>", htmlspecialchars($output), "</pre>\n";
-    }
-}
-
-?>

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/plot/plot.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/plot/plot.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/plot/plot.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -35,15 +35,9 @@
     $siteConnection = new MgSiteConnection();
     $siteConnection->Open($userInfo);
 
-    $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
+    $map = new MgMap($siteConnection);
+    $map->Open('Sheboygan');
 
-    // Create an instance of ResourceService and use that to open the
-    // current map instance stored in session state.
-
-    $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-    $map = new MgMap();
-    $map->Open($resourceService, 'Sheboygan');
-
     // Now create an instance of MappingService and use it to plot the
     // current view of the map.
 

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/plot/plotmain.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/plot/plotmain.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/plot/plotmain.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -90,9 +90,8 @@
         // determine the current scale of the map for display on this
         // page.
 
-        $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
-        $map = new MgMap();
-        $map->Open($resourceService, 'Sheboygan');
+        $map = new MgMap($siteConnection);
+        $map->Open('Sheboygan');
 
         $viewCenter = $map->GetViewCenter();
         $viewScale = $map->GetViewScale();

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/query/classes/query.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/query/classes/query.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/query/classes/query.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -27,35 +27,33 @@
 
 class Query
 {
-	private $args = null;
-	private $site = null;
+    private $args = null;
+    private $site = null;
 
-	public $numOperators;
-	public $numExpressions;
-	public $strOperators;
-	public $strExpressions;
+    public $numOperators;
+    public $numExpressions;
+    public $strOperators;
+    public $strExpressions;
 
-	function __construct($args)
-	{
-		$this->args = $args;
-		$this->site = new MgSiteConnection();
-		$this->site->Open(new MgUserInformation($args['SESSION']));
+    function __construct($args)
+    {
+        $this->args = $args;
+        $this->site = new MgSiteConnection();
+        $this->site->Open(new MgUserInformation($args['SESSION']));
 
-		$this->numOperators = array('Equal to', 'Not equal to', 'Greater than', 'Greater than or equal to', 'Less than', 'Less than or equal to');
-		$this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s');
+        $this->numOperators = array('Equal to', 'Not equal to', 'Greater than', 'Greater than or equal to', 'Less than', 'Less than or equal to');
+        $this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s');
 
-		$this->strOperators = array('Begins with', 'Contains', 'Equal to');
-		$this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'");
-	}
+        $this->strOperators = array('Begins with', 'Contains', 'Equal to');
+        $this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'");
+    }
 
     function GetMapLayerNames()
     {
         $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++)
@@ -65,9 +63,9 @@
             //TODO: Exclude Raster and Drawing Layers???
 
             if((substr($layer->GetName(), 0, 1) != "_") && (substr(strtoupper($layer->GetFeatureSourceId()), 0, 7) != "SESSION"))
-		    {
-		        $layerNames[$layer->GetName()] = $layer->GetLegendLabel();
-		    }
+            {
+                $layerNames[$layer->GetName()] = $layer->GetLegendLabel();
+            }
         }
         asort($layerNames);
 
@@ -78,395 +76,383 @@
     {
         $properties = 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']);
         $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
 
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
-        $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-        $schemaClass = explode(':', $layer->GetFeatureClassName());
+        $classDef = $layer->GetClassDefinition();
+        $clsProps = $classDef->GetProperties();
 
-        $classDef = $featureService->GetClassDefinition($resId, $schemaClass[0], $schemaClass[1]);
-
-        for ($i = 0; $i < $classDef->GetProperties()->GetCount(); $i++)
+        for ($i = 0; $i < $clsProps->GetCount(); $i++)
         {
-            $propertyDef = $classDef->GetProperties()->GetItem($i);
+            $propertyDef = $clsProps->GetItem($i);
 
             if ($propertyDef->GetPropertyType() == MgFeaturePropertyType::DataProperty)
             {
-				$dataType = $propertyDef->GetDataType();
-				if ($this->IsValidDataType($dataType))
-				{
-	                array_push($properties, new Property($propertyDef->GetName(), $dataType == MgPropertyType::String));
-				}
+                $dataType = $propertyDef->GetDataType();
+                if ($this->IsValidDataType($dataType))
+                {
+                    array_push($properties, new Property($propertyDef->GetName(), $dataType == MgPropertyType::String));
+                }
             }
         }
         return $properties;
     }
 
-	function ToggleSpatialFilter()
-	{
-		$result = true;
+    function ToggleSpatialFilter()
+    {
+        $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'))
+        {
+            $layer = $layers->GetItem('_QuerySpatialFilter');
+            if ($this->args['VISIBLE'] == 'true')
+                $layer->SetVisible(true);
+            else
+                $layer->SetVisible(false);
 
-		$layers = $map->GetLayers();
-		if ($layers->Contains('_QuerySpatialFilter'))
-		{
-			$layer = $layers->GetItem('_QuerySpatialFilter');
-			if ($this->args['VISIBLE'] == 'true')
-				$layer->SetVisible(true);
-			else
-				$layer->SetVisible(false);
+            $map->Save();
+        }
 
-			$map->Save($resourceService);
-		}
+        return $result;
+    }
 
-		return $result;
-	}
+    function ShowSpatialFilter()
+    {
+        $result = true;
 
-	function ShowSpatialFilter()
-	{
-		$result = true;
+        $sdfResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//Filter.FeatureSource');
 
-		$sdfResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//Filter.FeatureSource');
+        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $featureService = $this->site->CreateService(MgServiceType::FeatureService);
 
-		$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
-
         $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();
-		if ($layers->Contains('_QuerySpatialFilter'))
-		{
-			$layer = $layers->GetItem('_QuerySpatialFilter');
+        $layer = null;
+        $layers = $map->GetLayers();
+        if ($layers->Contains('_QuerySpatialFilter'))
+        {
+            $layer = $layers->GetItem('_QuerySpatialFilter');
             $updateCommands->Add(new MgDeleteFeatures('Filter', "ID like '%'"));
-		}
-		else
-		{
-			// Create the Feature Source (SDF)
+        }
+        else
+        {
+            // Create the Feature Source (SDF)
 
-			$sdfSchema = $this->CreateFilterSchema();
-			$sdfParams = new MgFileFeatureSourceParams('OSGeo.SDF', 'MAPCS', $map->GetMapSRS(), $sdfSchema);
-			$featureService->CreateFeatureSource($sdfResId, $sdfParams);
+            $sdfSchema = $this->CreateFilterSchema();
+            $sdfParams = new MgFileFeatureSourceParams('OSGeo.SDF', 'MAPCS', $map->GetMapSRS(), $sdfSchema);
+            $featureService->CreateFeatureSource($sdfResId, $sdfParams);
 
-			// Create the Layer
+            // Create the Layer
 
-			$layerResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//Filter.LayerDefinition');
+            $layerResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//Filter.LayerDefinition');
 
-	        $layerDefinition = file_get_contents("templates/filterlayerdefinition.xml");
-    	    $layerDefinition = sprintf($layerDefinition, $sdfResId->ToString());
+            $layerDefinition = file_get_contents("templates/filterlayerdefinition.xml");
+            $layerDefinition = sprintf($layerDefinition, $sdfResId->ToString());
 
-			$byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));
-			$resourceService->SetResource($layerResId, $byteSource->GetReader(), null);
+            $byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));
+            $resourceService->SetResource($layerResId, $byteSource->GetReader(), null);
 
-			$layer = new MgLayer($layerResId, $resourceService);
+            $layer = new MgLayer($layerResId, $resourceService);
 
-			$layer->SetName('_QuerySpatialFilter');
-			$layer->SetLegendLabel('_QuerySpatialFilter');
-			$layer->SetDisplayInLegend(false);
-			$layer->SetSelectable(false);
+            $layer->SetName('_QuerySpatialFilter');
+            $layer->SetLegendLabel('_QuerySpatialFilter');
+            $layer->SetDisplayInLegend(false);
+            $layer->SetSelectable(false);
 
-			$layers->Insert(0, $layer);
-		}
+            $layers->Insert(0, $layer);
+        }
 
-		// Make the layer visible
+        // Make the layer visible
 
-		$layer->SetVisible(true);
-		$map->Save($resourceService);
+        $layer->SetVisible(true);
+        $map->Save();
 
-		// Add the geometry to the filter feature source
+        // Add the geometry to the filter feature source
 
-		$polygon = $this->CreatePolygonFromGeomText($this->args['GEOMTEXT']);
-		$agfWriter = new MgAgfReaderWriter();
-		$byteReader = $agfWriter->Write($polygon);
+        $polygon = $this->CreatePolygonFromGeomText($this->args['GEOMTEXT']);
+        $agfWriter = new MgAgfReaderWriter();
+        $byteReader = $agfWriter->Write($polygon);
 
-		$propertyValues = new MgPropertyCollection();
-		$propertyValues->Add(new MgGeometryProperty('Geometry', $byteReader));
+        $propertyValues = new MgPropertyCollection();
+        $propertyValues->Add(new MgGeometryProperty('Geometry', $byteReader));
 
-		$updateCommands->Add(new MgInsertFeatures('Filter', $propertyValues));
+        $updateCommands->Add(new MgInsertFeatures('Filter', $propertyValues));
 
-		$featureService->UpdateFeatures($sdfResId, $updateCommands, false);
+        $featureService->UpdateFeatures($sdfResId, $updateCommands, false);
 
-		return $result;
-	}
+        return $result;
+    }
 
-	function Execute()
-	{
-		$result = array();
+    function Execute()
+    {
+        $result = 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']);
         $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
 
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
+        $featureService = $this->site->CreateService(MgServiceType::FeatureService);
         $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-		$featureClass = $layer->GetFeatureClassName();
-		$featureGeometry = $layer->GetFeatureGeometryName();
+        $featureClass = $layer->GetFeatureClassName();
+        $featureGeometry = $layer->GetFeatureGeometryName();
 
-		// Initialize the coordinate system transform
+        // Initialize the coordinate system transform
 
-		$schemaAndClass = explode(":", $featureClass);
-		$classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
-		$geomProp = $classDef->GetProperties()->GetItem($featureGeometry);
-		$spatialContext = $geomProp->GetSpatialContextAssociation();
+        $schemaAndClass = explode(":", $featureClass);
+        $classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
+        $geomProp = $classDef->GetProperties()->GetItem($featureGeometry);
+        $spatialContext = $geomProp->GetSpatialContextAssociation();
 
-		$csTransform = null;
-		$csInverseTransform = null;
-		$coordSysFactory = new MgCoordinateSystemFactory();
+        $csTransform = null;
+        $csInverseTransform = null;
+        $coordSysFactory = new MgCoordinateSystemFactory();
 
-		$scReader = $featureService->GetSpatialContexts($resId, false);
-		while ($scReader->ReadNext() && $csTransform == null)
-		{
-			if ($scReader->GetName() == $spatialContext)
-			{
-				$source = $coordSysFactory->Create($scReader->GetCoordinateSystemWkt());
-				$target = $coordSysFactory->Create($map->GetMapSRS());
-				$csTransform = new MgCoordinateSystemTransform($source, $target);
-				$csInverseTransform = new MgCoordinateSystemTransform($target, $source);
-			}
-		}
-		$scReader->Close();
+        $scReader = $featureService->GetSpatialContexts($resId, false);
+        while ($scReader->ReadNext() && $csTransform == null)
+        {
+            if ($scReader->GetName() == $spatialContext)
+            {
+                $source = $coordSysFactory->Create($scReader->GetCoordinateSystemWkt());
+                $target = $coordSysFactory->Create($map->GetMapSRS());
+                $csTransform = $coordSysFactory->GetTransform($source, $target);
+                $csInverseTransform = $coordSysFactory->GetTransform($target, $source);
+            }
+        }
+        $scReader->Close();
 
-		// Execute the query
+        // Execute the query
 
-		$queryMax = (int) $this->args['QUERYMAX'];
-		$queryOptions = new MgFeatureQueryOptions();
+        $queryMax = (int) $this->args['QUERYMAX'];
+        $queryOptions = new MgFeatureQueryOptions();
 
-		if ($this->args['USEPROPERTYFILTER'] == 'true')
-		{
-			$propertyFilter = $this->args['PROPERTYNAME'];
-			if ($this->args['ISSTRING'] == 'true')
-				$propertyFilter .= sprintf($this->strExpressions[$this->args['OPERATOR']], $this->args['VALUE']);
-			else
-				$propertyFilter .= sprintf($this->numExpressions[$this->args['OPERATOR']], $this->args['VALUE']);
+        if ($this->args['USEPROPERTYFILTER'] == 'true')
+        {
+            $propertyFilter = $this->args['PROPERTYNAME'];
+            if ($this->args['ISSTRING'] == 'true')
+                $propertyFilter .= sprintf($this->strExpressions[$this->args['OPERATOR']], $this->args['VALUE']);
+            else
+                $propertyFilter .= sprintf($this->numExpressions[$this->args['OPERATOR']], $this->args['VALUE']);
 
-			$queryOptions->SetFilter($propertyFilter);
-		}
+            $queryOptions->SetFilter($propertyFilter);
+        }
 
-		if ($this->args['USESPATIALFILTER'] == 'true')
-		{
-			$polygon = $this->CreatePolygonFromGeomText($this->args['GEOMTEXT']);
-			$polygon = $polygon->Transform($csInverseTransform);
+        if ($this->args['USESPATIALFILTER'] == 'true')
+        {
+            $polygon = $this->CreatePolygonFromGeomText($this->args['GEOMTEXT']);
+            $polygon = $polygon->Transform($csInverseTransform);
 
-			$queryOptions->SetSpatialFilter($featureGeometry, $polygon, MgFeatureSpatialOperations::Intersects);
-		}
+            $queryOptions->SetSpatialFilter($featureGeometry, $polygon, MgFeatureSpatialOperations::Intersects);
+        }
 
-		$count = 0;
-		$geometryReaderWriter = new MgAgfReaderWriter();
-		$featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
-		while ($featureReader->ReadNext() && ($queryMax <= 0 || $count < $queryMax))
-		{
-			$displayValue = $this->GetFeaturePropertyValue($featureReader, $this->args['OUTPUTPROPERTY']);
+        $count = 0;
+        $geometryReaderWriter = new MgAgfReaderWriter();
+        $featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+        while ($featureReader->ReadNext() && ($queryMax <= 0 || $count < $queryMax))
+        {
+            $displayValue = $this->GetFeaturePropertyValue($featureReader, $this->args['OUTPUTPROPERTY']);
 
-			$byteReader = $featureReader->GetGeometry($featureGeometry);
+            $byteReader = $featureReader->GetGeometry($featureGeometry);
             $geometry = $geometryReaderWriter->Read($byteReader);
             $centerPoint = $geometry->GetCentroid();
-			$centerPoint = $centerPoint->Transform($csTransform);
+            $centerPoint = $centerPoint->Transform($csTransform);
 
-			$idList = $this->GetFeatureIdList($map, $layer, $featureReader);
+            $idList = $this->GetFeatureIdList($map, $layer, $featureReader);
 
-			array_push($result, new Feature($displayValue, $centerPoint, $idList));
-			$count++;
-		}
+            array_push($result, new Feature($displayValue, $centerPoint, $idList));
+            $count++;
+        }
 
-		return $result;
-	}
+        return $result;
+    }
 
-	function GetSelectionXML()
-	{
-	    $json = new Services_JSON();
-		$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
+    function GetSelectionXML()
+    {
+        $json = new Services_JSON();
 
-		$map = new MgMap();
-		$map->Open($resourceService, $this->args['MAPNAME']);
-		$layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-        $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-		$featureClass = $layer->GetFeatureClassName();
-		$schemaAndClass = explode(":", $featureClass);
-		$classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
+        $layer = $layers->GetItem($this->args['LAYERNAME']);
+        $featureClass = $layer->GetFeatureClassName();
+        $classDef = $layer->GetClassDefinition();
 
-		$properties = new MgPropertyCollection();
-		$idList = $json->decode($this->args['IDLIST']);
+        $properties = new MgPropertyCollection();
+        $idList = $json->decode($this->args['IDLIST']);
 
-		foreach ($idList as $key => $value)
-		{
-			switch($classDef->GetProperties()->GetItem($key)->GetDataType())
-			{
-				case MgPropertyType::Boolean :
-					$properties->Add(new MgBooleanProperty($key, $value));
-					break;
+        foreach ($idList as $key => $value)
+        {
+            switch($classDef->GetProperties()->GetItem($key)->GetDataType())
+            {
+                case MgPropertyType::Boolean :
+                    $properties->Add(new MgBooleanProperty($key, $value));
+                    break;
 
-				case MgPropertyType::Byte :
-					$properties->Add(new MgByteProperty($key, $value));
-					break;
+                case MgPropertyType::Byte :
+                    $properties->Add(new MgByteProperty($key, $value));
+                    break;
 
-				case MgPropertyType::Single :
-					$properties->Add(new MgSingleProperty($key, $value));
-					break;
+                case MgPropertyType::Single :
+                    $properties->Add(new MgSingleProperty($key, $value));
+                    break;
 
-				case MgPropertyType::Double :
-					$properties->Add(new MgDoubleProperty($key, $value));
-					break;
+                case MgPropertyType::Double :
+                    $properties->Add(new MgDoubleProperty($key, $value));
+                    break;
 
-				case MgPropertyType::Int16 :
-					$properties->Add(new MgInt16Property($key, $value));
-					break;
+                case MgPropertyType::Int16 :
+                    $properties->Add(new MgInt16Property($key, $value));
+                    break;
 
-				case MgPropertyType::Int32 :
-					$properties->Add(new MgInt32Property($key, $value));
-					break;
+                case MgPropertyType::Int32 :
+                    $properties->Add(new MgInt32Property($key, $value));
+                    break;
 
-				case MgPropertyType::Int64 :
-					$properties->Add(new MgInt64Property($key, $value));
-					break;
+                case MgPropertyType::Int64 :
+                    $properties->Add(new MgInt64Property($key, $value));
+                    break;
 
-				case MgPropertyType::String :
-					$properties->Add(new MgStringProperty($key, $value));
-					break;
+                case MgPropertyType::String :
+                    $properties->Add(new MgStringProperty($key, $value));
+                    break;
 
-				case MgPropertyType::DateTime :
-					$properties->Add(new MgDateTimeProperty($key, $value));
-					break;
+                case MgPropertyType::DateTime :
+                    $properties->Add(new MgDateTimeProperty($key, $value));
+                    break;
 
-				case MgPropertyType::Null :
-				case MgPropertyType::Blob :
-				case MgPropertyType::Clob :
-				case MgPropertyType::Feature :
-				case MgPropertyType::Geometry :
-				case MgPropertyType::Raster :
-					break;
-			}
-		}
+                case MgPropertyType::Null :
+                case MgPropertyType::Blob :
+                case MgPropertyType::Clob :
+                case MgPropertyType::Feature :
+                case MgPropertyType::Geometry :
+                case MgPropertyType::Raster :
+                    break;
+            }
+        }
 
-		$selection = new MgSelection($map);
-		$selection->AddFeatureIds($layer, $featureClass, $properties);
+        $selection = new MgSelection($map);
+        $selection->AddFeatureIds($layer, $featureClass, $properties);
 
-		return $selection->ToXml();
-	}
+        return $selection->ToXml();
+    }
 
-	private function GetFeaturePropertyValue($featureReader, $name)
-	{
-		$value = '';
-		$propertyType = $featureReader->GetPropertyType($name);
-		switch($propertyType)
-		{
-			case MgPropertyType::Boolean :
-				$value = $featureReader->GetBoolean($name);
-				break;
+    private function GetFeaturePropertyValue($featureReader, $name)
+    {
+        $value = '';
+        $propertyType = $featureReader->GetPropertyType($name);
+        switch($propertyType)
+        {
+            case MgPropertyType::Boolean :
+                $value = $featureReader->GetBoolean($name);
+                break;
 
-			case MgPropertyType::Byte :
-				$value = $featureReader->GetByte($name);
-				break;
+            case MgPropertyType::Byte :
+                $value = $featureReader->GetByte($name);
+                break;
 
-			case MgPropertyType::Single :
-				$value = $featureReader->GetSingle($name);
-				break;
+            case MgPropertyType::Single :
+                $value = $featureReader->GetSingle($name);
+                break;
 
-			case MgPropertyType::Double :
-				$value = $featureReader->GetDouble($name);
-				break;
+            case MgPropertyType::Double :
+                $value = $featureReader->GetDouble($name);
+                break;
 
-			case MgPropertyType::Int16 :
-				$value = $featureReader->GetInt16($name);
-				break;
+            case MgPropertyType::Int16 :
+                $value = $featureReader->GetInt16($name);
+                break;
 
-			case MgPropertyType::Int32 :
-				$value = $featureReader->GetInt32($name);
-				break;
+            case MgPropertyType::Int32 :
+                $value = $featureReader->GetInt32($name);
+                break;
 
-			case MgPropertyType::Int64 :
-				$value = $featureReader->GetInt64($name);
-				break;
+            case MgPropertyType::Int64 :
+                $value = $featureReader->GetInt64($name);
+                break;
 
-			case MgPropertyType::String :
-				$value = $featureReader->GetString($name);
-				break;
+            case MgPropertyType::String :
+                $value = $featureReader->GetString($name);
+                break;
 
-			case MgPropertyType::DateTime :
-			case MgPropertyType::Null :
-			case MgPropertyType::Blob :
-			case MgPropertyType::Clob :
-			case MgPropertyType::Feature :
-			case MgPropertyType::Geometry :
-			case MgPropertyType::Raster :
-				$value = '[unsupported data type]';
-				break;
-		}
-		return $value;
-	}
+            case MgPropertyType::DateTime :
+            case MgPropertyType::Null :
+            case MgPropertyType::Blob :
+            case MgPropertyType::Clob :
+            case MgPropertyType::Feature :
+            case MgPropertyType::Geometry :
+            case MgPropertyType::Raster :
+                $value = '[unsupported data type]';
+                break;
+        }
+        return $value;
+    }
 
-	private function GetFeatureIdList($map, $layer, $featureReader)
-	{
-		$classDef = $featureReader->GetClassDefinition();
-		$idProps = $classDef->GetIdentityProperties();
-		$idList = array();
+    private function GetFeatureIdList($map, $layer, $featureReader)
+    {
+        $classDef = $featureReader->GetClassDefinition();
+        $idProps = $classDef->GetIdentityProperties();
+        $idList = array();
 
-		for ($i = 0; $i < $idProps->GetCount(); $i++)
-		{
-			$idProp = $idProps->GetItem($i);
+        for ($i = 0; $i < $idProps->GetCount(); $i++)
+        {
+            $idProp = $idProps->GetItem($i);
 
-			switch($idProp->GetDataType()) {
-				case MgPropertyType::Boolean :
-					$idList[$idProp->GetName()] = $featureReader->GetBoolean($idProp->GetName());
-					break;
+            switch($idProp->GetDataType()) {
+                case MgPropertyType::Boolean :
+                    $idList[$idProp->GetName()] = $featureReader->GetBoolean($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Byte :
-					$idList[$idProp->GetName()] = $featureReader->GetByte($idProp->GetName());
-					break;
+                case MgPropertyType::Byte :
+                    $idList[$idProp->GetName()] = $featureReader->GetByte($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Single :
-					$idList[$idProp->GetName()] = $featureReader->GetSingle($idProp->GetName());
-					break;
+                case MgPropertyType::Single :
+                    $idList[$idProp->GetName()] = $featureReader->GetSingle($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Double :
-					$idList[$idProp->GetName()] = $featureReader->GetDouble($idProp->GetName());
-					break;
+                case MgPropertyType::Double :
+                    $idList[$idProp->GetName()] = $featureReader->GetDouble($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Int16 :
-					$idList[$idProp->GetName()] = $featureReader->GetInt16($idProp->GetName());
-					break;
+                case MgPropertyType::Int16 :
+                    $idList[$idProp->GetName()] = $featureReader->GetInt16($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Int32 :
-					$idList[$idProp->GetName()] = $featureReader->GetInt32($idProp->GetName());
-					break;
+                case MgPropertyType::Int32 :
+                    $idList[$idProp->GetName()] = $featureReader->GetInt32($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Int64 :
-					$idList[$idProp->GetName()] = $featureReader->GetInt64($idProp->GetName());
-					break;
+                case MgPropertyType::Int64 :
+                    $idList[$idProp->GetName()] = $featureReader->GetInt64($idProp->GetName());
+                    break;
 
-				case MgPropertyType::String :
-					$idList[$idProp->GetName()] = $featureReader->GetString($idProp->GetName());
-					break;
+                case MgPropertyType::String :
+                    $idList[$idProp->GetName()] = $featureReader->GetString($idProp->GetName());
+                    break;
 
-				case MgPropertyType::DateTime :
-					$idList[$idProp->GetName()] = $featureReader->GetDateTime($idProp->GetName());
-					break;
+                case MgPropertyType::DateTime :
+                    $idList[$idProp->GetName()] = $featureReader->GetDateTime($idProp->GetName());
+                    break;
 
-				case MgPropertyType::Null :
-				case MgPropertyType::Blob :
-				case MgPropertyType::Clob :
-				case MgPropertyType::Feature :
-				case MgPropertyType::Geometry :
-				case MgPropertyType::Raster :
-					break;
-			}
-		}
+                case MgPropertyType::Null :
+                case MgPropertyType::Blob :
+                case MgPropertyType::Clob :
+                case MgPropertyType::Feature :
+                case MgPropertyType::Geometry :
+                case MgPropertyType::Raster :
+                    break;
+            }
+        }
 
-		return $idList;
-	}
+        return $idList;
+    }
 
     private function IsValidDataType($type)
     {
@@ -475,77 +461,77 @@
         switch($type)
         {
             case MgPropertyType::Blob:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
             case MgPropertyType::Clob:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
             case MgPropertyType::Byte:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
             case MgPropertyType::Feature:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
             case MgPropertyType::Geometry:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
             case MgPropertyType::Null:
-				$valid = false;
-				break;
+                $valid = false;
+                break;
         }
         return $valid;
     }
 
-	private function CreateFilterSchema()
-	{
-		$filterSchema = new MgFeatureSchema();
-		$filterSchema->SetName('FilterSchema');
+    private function CreateFilterSchema()
+    {
+        $filterSchema = new MgFeatureSchema();
+        $filterSchema->SetName('FilterSchema');
 
-		$filterClass = new MgClassDefinition();
-		$filterClass->SetName('Filter');
-		$properties = $filterClass->GetProperties();
+        $filterClass = new MgClassDefinition();
+        $filterClass->SetName('Filter');
+        $properties = $filterClass->GetProperties();
 
-		$idProperty = new MgDataPropertyDefinition('ID');
-		$idProperty->SetDataType(MgPropertyType::Int32);
-		$idProperty->SetReadOnly(true);
-		$idProperty->SetNullable(false);
-		$idProperty->SetAutoGeneration(true);
-		$properties->Add($idProperty);
+        $idProperty = new MgDataPropertyDefinition('ID');
+        $idProperty->SetDataType(MgPropertyType::Int32);
+        $idProperty->SetReadOnly(true);
+        $idProperty->SetNullable(false);
+        $idProperty->SetAutoGeneration(true);
+        $properties->Add($idProperty);
 
-		$geometryProperty = new MgGeometricPropertyDefinition('Geometry');
-		$geometryProperty->SetGeometryTypes(MgFeatureGeometricType::Surface);
-		$geometryProperty->SetHasElevation(false);
-		$geometryProperty->SetHasMeasure(false);
-		$geometryProperty->SetReadOnly(false);
-		$geometryProperty->SetSpatialContextAssociation('MAPCS');
-		$properties->Add($geometryProperty);
+        $geometryProperty = new MgGeometricPropertyDefinition('Geometry');
+        $geometryProperty->SetGeometryTypes(MgFeatureGeometricType::Surface);
+        $geometryProperty->SetHasElevation(false);
+        $geometryProperty->SetHasMeasure(false);
+        $geometryProperty->SetReadOnly(false);
+        $geometryProperty->SetSpatialContextAssociation('MAPCS');
+        $properties->Add($geometryProperty);
 
-		$filterClass->GetIdentityProperties()->Add($idProperty);
-		$filterClass->SetDefaultGeometryPropertyName('Geometry');
+        $filterClass->GetIdentityProperties()->Add($idProperty);
+        $filterClass->SetDefaultGeometryPropertyName('Geometry');
 
-		$filterSchema->GetClasses()->Add($filterClass);
+        $filterSchema->GetClasses()->Add($filterClass);
 
-		return $filterSchema;
-	}
+        return $filterSchema;
+    }
 
-	private function CreatePolygonFromGeomText($geomText)
-	{
-		$geometryFactory = new MgGeometryFactory();
+    private function CreatePolygonFromGeomText($geomText)
+    {
+        $geometryFactory = new MgGeometryFactory();
 
-		$vertices = explode(',', $geomText);
-		$count = $vertices[0];
+        $vertices = explode(',', $geomText);
+        $count = $vertices[0];
 
-		$coords = new MgCoordinateCollection();
-		for ($i = 0; $i < $count; $i++)
-		{
-			$coord = $geometryFactory->CreateCoordinateXY((double) $vertices[($i * 2) + 1], (double) $vertices[($i * 2) + 2]);
-			$coords->Add($coord);
-		}
+        $coords = new MgCoordinateCollection();
+        for ($i = 0; $i < $count; $i++)
+        {
+            $coord = $geometryFactory->CreateCoordinateXY((double) $vertices[($i * 2) + 1], (double) $vertices[($i * 2) + 2]);
+            $coords->Add($coord);
+        }
 
-		$linearRing = $geometryFactory->CreateLinearRing($coords);
-		$polygon = $geometryFactory->CreatePolygon($linearRing, null);
+        $linearRing = $geometryFactory->CreateLinearRing($coords);
+        $polygon = $geometryFactory->CreatePolygon($linearRing, null);
 
-		return $polygon;
-	}
+        return $polygon;
+    }
 }
 ?>
\ No newline at end of file

Modified: sandbox/jng/v30/Doc/samples/phpviewersample/theme/classes/theme.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/theme/classes/theme.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/theme/classes/theme.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -27,49 +27,47 @@
 
 class Theme
 {
-	private $args = null;
-	private $site = null;
+    private $args = null;
+    private $site = null;
 
-	public $distNameArray = array("Individual", "Equal", "Standard Deviation", "Quantile", "Jenks (Natural Breaks)");
-	public $distValueArray = array("INDIV_DIST", "EQUAL_DIST", "STDEV_DIST", "QUANT_DIST", "JENK_DIST");
+    public $distNameArray = array("Individual", "Equal", "Standard Deviation", "Quantile", "Jenks (Natural Breaks)");
+    public $distValueArray = array("INDIV_DIST", "EQUAL_DIST", "STDEV_DIST", "QUANT_DIST", "JENK_DIST");
 
-	function __construct($args)
-	{
-		$this->args = $args;
-		$this->site = new MgSiteConnection();
-		$this->site->Open(new MgUserInformation($args['SESSION']));
-	}
+    function __construct($args)
+    {
+        $this->args = $args;
+        $this->site = new MgSiteConnection();
+        $this->site->Open(new MgUserInformation($args['SESSION']));
+    }
 
     function GetMapLayerNames()
     {
         $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++)
         {
             $layer = $layers->GetItem($i);
             if((substr($layer->GetName(), 0, 1) != "_") && (substr(strtoupper($layer->GetFeatureSourceId()), 0, 7) != "SESSION"))
-		    {
-        	    $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-			    $schemaClass = explode(':', $layer->GetFeatureClassName());
+            {
+                $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
+                $schemaClass = explode(':', $layer->GetFeatureClassName());
+                
+                $classDef = $layer->GetClassDefinition();
+                $clsProps = $classDef->GetProperties();
+                $propDef = $clsProps->GetItem($layer->GetFeatureGeometryName());
 
-			    $classDef = $featureService->GetClassDefinition($resId, $schemaClass[0], $schemaClass[1]);
-			    $propDef = $classDef->GetProperties()->GetItem($layer->GetFeatureGeometryName());
-
-			    if($propDef->GetPropertyType() == MgFeaturePropertyType::GeometricProperty)
-			    {
-					if ($propDef->GetGeometryTypes() == MgFeatureGeometricType::Surface)
-					{
-						$layerNames[$layer->GetName()] = $layer->GetLegendLabel();
-					}
-				}
-			}
+                if($propDef->GetPropertyType() == MgFeaturePropertyType::GeometricProperty)
+                {
+                    if ($propDef->GetGeometryTypes() == MgFeatureGeometricType::Surface)
+                    {
+                        $layerNames[$layer->GetName()] = $layer->GetLegendLabel();
+                    }
+                }
+            }
         }
         asort($layerNames);
 
@@ -79,76 +77,71 @@
     function GetLayerInfo()
     {
         $properties = array();
-		$scaleRanges = array();
+        $scaleRanges = array();
 
-		$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+        $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.
+        // First get a list of all of the Feature Class properties that can be used for theming.
+        $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);
 
             if ($propertyDef->GetPropertyType() == MgFeaturePropertyType::DataProperty)
             {
-				$dataType = $propertyDef->GetDataType();
-				$distroTypes = $this->GetDistributionsForDataType($dataType);
-				if (count($distroTypes) > 0)
-				{
-	                array_push($properties, new Property($propertyDef->GetName(), $dataType, $distroTypes));
-				}
+                $dataType = $propertyDef->GetDataType();
+                $distroTypes = $this->GetDistributionsForDataType($dataType);
+                if (count($distroTypes) > 0)
+                {
+                    array_push($properties, new Property($propertyDef->GetName(), $dataType, $distroTypes));
+                }
             }
         }
 
-		// Next get a list of all of the layers scale ranges.
+        // Next get a list of all of the layers scale ranges.
 
-		$layerDefResId = $layer->GetLayerDefinition();
-		$byteReader = $resourceService->GetResourceContent($layerDefResId);
+        $layerDefResId = $layer->GetLayerDefinition();
+        $byteReader = $resourceService->GetResourceContent($layerDefResId);
 
-		$doc = DOMDocument::loadXML($byteReader->ToString());
-		$nodeList = $doc->getElementsByTagName('VectorScaleRange');
+        $doc = new DOMDocument();
+        $doc->loadXML($byteReader->ToString());
+        $nodeList = $doc->getElementsByTagName('VectorScaleRange');
 
-		foreach ($nodeList as $node)
-		{
-			$range = null;
+        foreach ($nodeList as $node)
+        {
+            $range = null;
 
-			$minNodeList = $node->getElementsByTagName('MinScale');
-			if ($minNodeList->length > 0)
-				$range = $minNodeList->item(0)->nodeValue;
-			else
-				$range = '0';
+            $minNodeList = $node->getElementsByTagName('MinScale');
+            if ($minNodeList->length > 0)
+                $range = $minNodeList->item(0)->nodeValue;
+            else
+                $range = '0';
 
-			$maxNodeList = $node->getElementsByTagName('MaxScale');
-			if ($maxNodeList->length > 0)
-				$range .= ' - ' . $maxNodeList->item(0)->nodeValue;
-			else
-				$range .= ' - Infinity';
+            $maxNodeList = $node->getElementsByTagName('MaxScale');
+            if ($maxNodeList->length > 0)
+                $range .= ' - ' . $maxNodeList->item(0)->nodeValue;
+            else
+                $range .= ' - Infinity';
 
-			array_push($scaleRanges, $range);
-		}
+            array_push($scaleRanges, $range);
+        }
 
         return new LayerInfo($properties, $scaleRanges);
     }
 
-	function GetPropertyMinMaxCount()
-	{
-		$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-
-		$map = new MgMap();
-		$map->Open($resourceService, $this->args['MAPNAME']);
+    function GetPropertyMinMaxCount()
+    {
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
         $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
 
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
+        $featureService = $this->site->CreateService(MgServiceType::FeatureService);
         $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
 
 // Note: Should be able to do this:
@@ -174,249 +167,250 @@
 //
 // However due to a bug, Min/Max do not work on string types, so we have to do this:
 
-		unset($minValue);
-		unset($maxValue);
-		$count = 0;
+        unset($minValue);
+        unset($maxValue);
+        $count = 0;
 
-		$queryOptions = new MgFeatureQueryOptions();
-		$queryOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
+        $queryOptions = new MgFeatureQueryOptions();
+        $queryOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
 
-		$featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+        $featureReader = $layer->SelectFeatures($queryOptions);
 
-		while($featureReader->ReadNext())
-		{
-			$value = $this->GetFeaturePropertyValue($featureReader, $this->args['PROPERTYNAME']);
-			if ($value != null)
-			{
-				if(!isset($maxValue) && !isset($minValue))
-				{
-					$maxValue = $value;
-					$minValue = $value;
-				}
-				if($value > $maxValue)
-					$maxValue = $value;
-				if($value < $minValue)
-					$minValue = $value;
-			}
-			$count++;
-		}
-		$featureReader->Close();
+        while($featureReader->ReadNext())
+        {
+            $value = $this->GetFeaturePropertyValue($featureReader, $this->args['PROPERTYNAME']);
+            if ($value != null)
+            {
+                if(!isset($maxValue) && !isset($minValue))
+                {
+                    $maxValue = $value;
+                    $minValue = $value;
+                }
+                if($value > $maxValue)
+                    $maxValue = $value;
+                if($value < $minValue)
+                    $minValue = $value;
+            }
+            $count++;
+        }
+        $featureReader->Close();
 
-		if(!isset($maxValue) && !isset($minValue))
-		{
-			$maxValue="";
-			$minValue="";
-		}
+        if(!isset($maxValue) && !isset($minValue))
+        {
+            $maxValue="";
+            $minValue="";
+        }
 
-		return array($minValue, $maxValue, $count);
-	}
+        return array($minValue, $maxValue, $count);
+    }
 
-	function ApplyTheme()
-	{
-		$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-		$featureService = $this->site->CreateService(MgServiceType::FeatureService);
+    function ApplyTheme()
+    {
+        $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
 
-		$map = new MgMap();
-		$map->Open($resourceService, $this->args['MAPNAME']);
-		$layers = $map->GetLayers();
+        $map = new MgMap($this->site);
+        $map->Open($this->args['MAPNAME']);
+        $layers = $map->GetLayers();
         $layer = $layers->GetItem($this->args['LAYERNAME']);
 
-        $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-		$layerDefResId = $layer->GetLayerDefinition();
-		$byteReader = $resourceService->GetResourceContent($layerDefResId);
+        $layerDefResId = $layer->GetLayerDefinition();
+        $byteReader = $resourceService->GetResourceContent($layerDefResId);
 
-		// Load the Layer Definition and Navigate to the specified <VectorScaleRange>
+        // Load the Layer Definition and Navigate to the specified <VectorScaleRange>
 
-		$doc = DOMDocument::loadXML($byteReader->ToString());
-		$nodeList = $doc->getElementsByTagName('VectorScaleRange');
+        $doc = new DOMDocument();
+        $doc->loadXML($byteReader->ToString());
+        $nodeList = $doc->getElementsByTagName('VectorScaleRange');
 
-		$vectorScaleRangecElement = $nodeList->item($this->args['SCALERANGEINDEX']);
-		$areaTypeStyle = $vectorScaleRangecElement->getElementsByTagName('AreaTypeStyle')->item(0);
+        $vectorScaleRangecElement = $nodeList->item($this->args['SCALERANGEINDEX']);
+        $areaTypeStyle = $vectorScaleRangecElement->getElementsByTagName('AreaTypeStyle')->item(0);
 
-		// Remove any existing <AreaRule> elements.
+        // Remove any existing <AreaRule> elements.
 
-		$areaRuleList = $areaTypeStyle->getElementsByTagName('AreaRule');
-		$ruleCount = $areaRuleList->length;
-		for($index = 0; $index < $ruleCount; $index++)
-		{
-			$areaTypeStyle->removeChild($areaRuleList->item(0));
-		}
+        $areaRuleList = $areaTypeStyle->getElementsByTagName('AreaRule');
+        $ruleCount = $areaRuleList->length;
+        for($index = 0; $index < $ruleCount; $index++)
+        {
+            $areaTypeStyle->removeChild($areaRuleList->item(0));
+        }
 
-		// Now create the new <AreaRule> elements.
+        // Now create the new <AreaRule> elements.
 
-		$areaRuleTemplate = file_get_contents("templates/arearuletemplate.xml");
-		$aggregateOptions = new MgFeatureAggregateOptions();
+        $areaRuleTemplate = file_get_contents("templates/arearuletemplate.xml");
+        $aggregateOptions = new MgFeatureAggregateOptions();
 
-		$portion = 0.0;
-		$increment = ($this->args['NUMRULES'] > 1) ? $increment = 1.0 / ($this->args['NUMRULES'] - 1) : 1.0;
+        $portion = 0.0;
+        $increment = ($this->args['NUMRULES'] > 1) ? $increment = 1.0 / ($this->args['NUMRULES'] - 1) : 1.0;
 
-		if ($this->args['DISTRO'] == 'INDIV_DIST')
-		{
-			$aggregateOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
-			$aggregateOptions->SelectDistinct(true);
+        if ($this->args['DISTRO'] == 'INDIV_DIST')
+        {
+            $aggregateOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
+            $aggregateOptions->SelectDistinct(true);
 
-			$dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
-			while ($dataReader->ReadNext())
-			{
-				$value = $this->GetFeaturePropertyValue($dataReader, $this->args['PROPERTYNAME']);
+            $dataReader = $layer->SelectAggregate($aggregateOptions);
+            while ($dataReader->ReadNext())
+            {
+                $value = $this->GetFeaturePropertyValue($dataReader, $this->args['PROPERTYNAME']);
 
-				$filterText = '"' . $this->args['PROPERTYNAME'] . '" = ';
-				if ($this->args['DATATYPE'] == MgPropertyType::String)
-					$filterText .= "'" . $value . "'";
-				else
-					$filterText .= $value;
+                $filterText = '"' . $this->args['PROPERTYNAME'] . '" = ';
+                if ($this->args['DATATYPE'] == MgPropertyType::String)
+                    $filterText .= "'" . $value . "'";
+                else
+                    $filterText .= $value;
 
-	    	    $areaRuleXML = sprintf($areaRuleTemplate,
-					$this->args['PROPERTYNAME'] . ': ' . $value,
-					$filterText,
-					$this->InterpolateColor($portion, $this->args['FILLFROM'], $this->args['FILLTO'], $this->args['FILLTRANS']),
-					$this->InterpolateColor($portion, $this->args['LINEFROM'], $this->args['LINETO'], 0));
+                $areaRuleXML = sprintf($areaRuleTemplate,
+                    $this->args['PROPERTYNAME'] . ': ' . $value,
+                    $filterText,
+                    $this->InterpolateColor($portion, $this->args['FILLFROM'], $this->args['FILLTO'], $this->args['FILLTRANS']),
+                    $this->InterpolateColor($portion, $this->args['LINEFROM'], $this->args['LINETO'], 0));
 
-				$areaDoc = DOMDocument::loadXML($areaRuleXML);
-				$areaNode = $doc->importNode($areaDoc->documentElement, true);
-				$areaTypeStyle->appendChild($areaNode);
+                $areaDoc = new DOMDocument();
+                $areaDoc->loadXML($areaRuleXML);
+                $areaNode = $doc->importNode($areaDoc->documentElement, true);
+                $areaTypeStyle->appendChild($areaNode);
 
-				$portion += $increment;
-			}
-			$dataReader->Close();
-		}
-		else
-		{
-			$values = array();
+                $portion += $increment;
+            }
+            $dataReader->Close();
+        }
+        else
+        {
+            $values = array();
 
-			$aggregateOptions->AddComputedProperty('THEME_VALUE',
-				$this->args['DISTRO'] . '("' . $this->args['PROPERTYNAME'] . '",' . $this->args['NUMRULES'] . ',' . $this->args['MINVALUE'] . ',' . $this->args['MAXVALUE'] . ')');
+            $aggregateOptions->AddComputedProperty('THEME_VALUE',
+                $this->args['DISTRO'] . '("' . $this->args['PROPERTYNAME'] . '",' . $this->args['NUMRULES'] . ',' . $this->args['MINVALUE'] . ',' . $this->args['MAXVALUE'] . ')');
 
-			$dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
-			while ($dataReader->ReadNext())
-			{
-				$value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
-				array_push($values, $value);
-			}
-			$dataReader->Close();
+            $dataReader = $layer->SelectAggregate($aggregateOptions);
+            while ($dataReader->ReadNext())
+            {
+                $value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
+                array_push($values, $value);
+            }
+            $dataReader->Close();
 
-			for ($i = 0; $i < count($values) - 1; $i++)
-			{
-				$filterText = '"' . $this->args['PROPERTYNAME'] . '" >= ' . $values[$i] . ' AND "' . $this->args['PROPERTYNAME'];
-				if ($i == count($values) - 1)
-					$filterText .= '" <= ' . $values[$i + 1];
-				else
-					$filterText .= '" < ' . $values[$i + 1];
+            for ($i = 0; $i < count($values) - 1; $i++)
+            {
+                $filterText = '"' . $this->args['PROPERTYNAME'] . '" >= ' . $values[$i] . ' AND "' . $this->args['PROPERTYNAME'];
+                if ($i == count($values) - 1)
+                    $filterText .= '" <= ' . $values[$i + 1];
+                else
+                    $filterText .= '" < ' . $values[$i + 1];
 
-	    	    $areaRuleXML = sprintf($areaRuleTemplate,
-					$this->args['PROPERTYNAME'] . ': ' . $values[$i] . ' - ' . $values[$i + 1],
-					$filterText,
-					$this->InterpolateColor($portion, $this->args['FILLFROM'], $this->args['FILLTO'], $this->args['FILLTRANS']),
-					$this->InterpolateColor($portion, $this->args['LINEFROM'], $this->args['LINETO'], 0));
+                $areaRuleXML = sprintf($areaRuleTemplate,
+                    $this->args['PROPERTYNAME'] . ': ' . $values[$i] . ' - ' . $values[$i + 1],
+                    $filterText,
+                    $this->InterpolateColor($portion, $this->args['FILLFROM'], $this->args['FILLTO'], $this->args['FILLTRANS']),
+                    $this->InterpolateColor($portion, $this->args['LINEFROM'], $this->args['LINETO'], 0));
 
-				$areaDoc = DOMDocument::loadXML($areaRuleXML);
-				$areaNode = $doc->importNode($areaDoc->documentElement, true);
-				$areaTypeStyle->appendChild($areaNode);
+                $areaDoc = new DOMDocument();
+                $areaDoc->loadXML($areaRuleXML);
+                $areaNode = $doc->importNode($areaDoc->documentElement, true);
+                $areaTypeStyle->appendChild($areaNode);
 
-				$portion += $increment;
-			}
+                $portion += $increment;
+            }
 
-		}
+        }
 
-		// Now save our new layer definition to the session and add it to the map.
+        // Now save our new layer definition to the session and add it to the map.
 
-		$layerDefinition = $doc->saveXML();
-		$uniqueName = $this->MakeUniqueLayerName($map, $this->args['LAYERNAME'], $this->args['THEMENAME']);
-		$legendLabel = $layer->GetLegendLabel();
-		if (strlen(trim($this->args['THEMENAME'])) > 0 )
-			$legendLabel .= ' (' . $this->args['THEMENAME'] . ')';
+        $layerDefinition = $doc->saveXML();
+        $uniqueName = $this->MakeUniqueLayerName($map, $this->args['LAYERNAME'], $this->args['THEMENAME']);
+        $legendLabel = $layer->GetLegendLabel();
+        if (strlen(trim($this->args['THEMENAME'])) > 0 )
+            $legendLabel .= ' (' . $this->args['THEMENAME'] . ')';
 
-		$layerResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//' . $uniqueName . '.LayerDefinition');
+        $layerResId = new MgResourceIdentifier('Session:' . $this->args['SESSION'] . '//' . $uniqueName . '.LayerDefinition');
 
-		$byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));
-		$resourceService->SetResource($layerResId, $byteSource->GetReader(), null);
+        $byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));
+        $resourceService->SetResource($layerResId, $byteSource->GetReader(), null);
 
-		$newLayer = new MgLayer($layerResId, $resourceService);
-		$newLayer->SetName($uniqueName);
-		$newLayer->SetLegendLabel($legendLabel);
-		$newLayer->SetDisplayInLegend($layer->GetDisplayInLegend());
-		$newLayer->SetVisible(true);
-		$newLayer->SetSelectable($layer->GetLegendLabel());
-		$layers->Insert($layers->IndexOf($layer), $newLayer);
+        $newLayer = new MgLayer($layerResId, $resourceService);
+        $newLayer->SetName($uniqueName);
+        $newLayer->SetLegendLabel($legendLabel);
+        $newLayer->SetDisplayInLegend($layer->GetDisplayInLegend());
+        $newLayer->SetVisible(true);
+        $newLayer->SetSelectable($layer->GetLegendLabel());
+        $layers->Insert($layers->IndexOf($layer), $newLayer);
 
-		$map->Save($resourceService);
+        $map->Save();
 
-		return $uniqueName;
-	}
+        return $uniqueName;
+    }
 
 
-	private function InterpolateColor($portion, $startColor, $endColor, $percentTransparent)
-	{
-		$result = sprintf("%02x", 255 * (100 - $percentTransparent) / 100);
+    private function InterpolateColor($portion, $startColor, $endColor, $percentTransparent)
+    {
+        $result = sprintf("%02x", 255 * (100 - $percentTransparent) / 100);
 
-		if ($startColor == $endColor)
-			return $result . $startColor;
+        if ($startColor == $endColor)
+            return $result . $startColor;
 
-		$red = $this->CalculateRGB($portion, substr($startColor, 0, 2), substr($endColor, 0, 2));
-		$result = (strlen(dechex($red)) == 1) ? $result . "0" . dechex($red) : $result . dechex($red);
-		$green = $this->CalculateRGB($portion, substr($startColor, 2, 2), substr($endColor, 2, 2));
-		$result = (strlen(dechex($green)) == 1) ? $result . "0" . dechex($green) : $result . dechex($green);
-		$blue = $this->CalculateRGB($portion, substr($startColor, 4, 2), substr($endColor, 4, 2));
-		$result = (strlen(dechex($blue)) == 1) ? $result . "0" . dechex($blue) : $result . dechex($blue);
+        $red = $this->CalculateRGB($portion, substr($startColor, 0, 2), substr($endColor, 0, 2));
+        $result = (strlen(dechex($red)) == 1) ? $result . "0" . dechex($red) : $result . dechex($red);
+        $green = $this->CalculateRGB($portion, substr($startColor, 2, 2), substr($endColor, 2, 2));
+        $result = (strlen(dechex($green)) == 1) ? $result . "0" . dechex($green) : $result . dechex($green);
+        $blue = $this->CalculateRGB($portion, substr($startColor, 4, 2), substr($endColor, 4, 2));
+        $result = (strlen(dechex($blue)) == 1) ? $result . "0" . dechex($blue) : $result . dechex($blue);
 
-		return $result;
-	}
+        return $result;
+    }
 
-	private function CalculateRGB($portion, $startRGB, $endRGB)
-	{
-		return (hexdec($startRGB) + ($portion * (hexdec($endRGB) - hexdec($startRGB))));
-	}
+    private function CalculateRGB($portion, $startRGB, $endRGB)
+    {
+        return (hexdec($startRGB) + ($portion * (hexdec($endRGB) - hexdec($startRGB))));
+    }
 
-	private function GetFeaturePropertyValue($featureReader, $name)
-	{
-		$value = '';
-		$propertyType = $featureReader->GetPropertyType($name);
-		switch($propertyType)
-		{
-			case MgPropertyType::Boolean :
-				$value = $featureReader->GetBoolean($name);
-				break;
+    private function GetFeaturePropertyValue($featureReader, $name)
+    {
+        $value = '';
+        $propertyType = $featureReader->GetPropertyType($name);
+        switch($propertyType)
+        {
+            case MgPropertyType::Boolean :
+                $value = $featureReader->GetBoolean($name);
+                break;
 
-			case MgPropertyType::Byte :
-				$value = $featureReader->GetByte($name);
-				break;
+            case MgPropertyType::Byte :
+                $value = $featureReader->GetByte($name);
+                break;
 
-			case MgPropertyType::Single :
-				$value = $featureReader->GetSingle($name);
-				break;
+            case MgPropertyType::Single :
+                $value = $featureReader->GetSingle($name);
+                break;
 
-			case MgPropertyType::Double :
-				$value = $featureReader->GetDouble($name);
-				break;
+            case MgPropertyType::Double :
+                $value = $featureReader->GetDouble($name);
+                break;
 
-			case MgPropertyType::Int16 :
-				$value = $featureReader->GetInt16($name);
-				break;
+            case MgPropertyType::Int16 :
+                $value = $featureReader->GetInt16($name);
+                break;
 
-			case MgPropertyType::Int32 :
-				$value = $featureReader->GetInt32($name);
-				break;
+            case MgPropertyType::Int32 :
+                $value = $featureReader->GetInt32($name);
+                break;
 
-			case MgPropertyType::Int64 :
-				$value = $featureReader->GetInt64($name);
-				break;
+            case MgPropertyType::Int64 :
+                $value = $featureReader->GetInt64($name);
+                break;
 
-			case MgPropertyType::String :
-				$value = $featureReader->GetString($name);
-				break;
+            case MgPropertyType::String :
+                $value = $featureReader->GetString($name);
+                break;
 
-			case MgPropertyType::DateTime :
-			case MgPropertyType::Null :
-			case MgPropertyType::Blob :
-			case MgPropertyType::Clob :
-			case MgPropertyType::Feature :
-			case MgPropertyType::Geometry :
-			case MgPropertyType::Raster :
-				$value = '[unsupported data type]';
-				break;
-		}
-		return $value;
-	}
+            case MgPropertyType::DateTime :
+            case MgPropertyType::Null :
+            case MgPropertyType::Blob :
+            case MgPropertyType::Clob :
+            case MgPropertyType::Feature :
+            case MgPropertyType::Geometry :
+            case MgPropertyType::Raster :
+                $value = '[unsupported data type]';
+                break;
+        }
+        return $value;
+    }
 
     private function GetDistributionsForDataType($type)
     {
@@ -424,47 +418,47 @@
 
         switch($type)
         {
-			case MgPropertyType::String:
-				array_push($distros, 0);
-				break;
+            case MgPropertyType::String:
+                array_push($distros, 0);
+                break;
 
-			case MgPropertyType::Byte :
-			case MgPropertyType::Int16 :
-			case MgPropertyType::Int32 :
-			case MgPropertyType::Int64 :
-				array_push($distros, 0, 1, 2, 3, 4);
-				break;
+            case MgPropertyType::Byte :
+            case MgPropertyType::Int16 :
+            case MgPropertyType::Int32 :
+            case MgPropertyType::Int64 :
+                array_push($distros, 0, 1, 2, 3, 4);
+                break;
 
-			case MgPropertyType::Single :
-			case MgPropertyType::Double :
-				array_push($distros, 1, 2, 3, 4);
-				break;
+            case MgPropertyType::Single :
+            case MgPropertyType::Double :
+                array_push($distros, 1, 2, 3, 4);
+                break;
 
-			case MgPropertyType::Boolean:
-			case MgPropertyType::DateTime:
+            case MgPropertyType::Boolean:
+            case MgPropertyType::DateTime:
             case MgPropertyType::Blob:
             case MgPropertyType::Clob:
             case MgPropertyType::Byte:
             case MgPropertyType::Feature:
             case MgPropertyType::Geometry:
             case MgPropertyType::Null:
-				break;
+                break;
         }
         return $distros;
     }
 
-	private function MakeUniqueLayerName($map, $layerName, $themeName)
-	{
-		$desiredName = "_" . $layerName . $themeName;
-		$uniqueName = $desiredName;
-		$index = 1;
+    private function MakeUniqueLayerName($map, $layerName, $themeName)
+    {
+        $desiredName = "_" . $layerName . $themeName;
+        $uniqueName = $desiredName;
+        $index = 1;
 
-		while ($map->GetLayers()->Contains($uniqueName))
-		{
-			$uniqueName = $desiredName . $index;
-			$index++;
-		}
-		return $uniqueName;
-	}
+        while ($map->GetLayers()->Contains($uniqueName))
+        {
+            $uniqueName = $desiredName . $index;
+            $index++;
+        }
+        return $uniqueName;
+    }
 }
 ?>
\ No newline at end of file

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/autoload.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/autoload.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/autoload.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer' . '/autoload_real.php';
+
+return ComposerAutoloaderInit2e896c05cba741d2984a0f24380bfde2::getLoader();

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/ClassLoader.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/ClassLoader.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/ClassLoader.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,354 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman at naderman.de>
+ *     Jordi Boggiano <j.boggiano at seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0 class loader
+ *
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien at symfony.com>
+ * @author Jordi Boggiano <j.boggiano at seld.be>
+ */
+class ClassLoader
+{
+    // PSR-4
+    private $prefixLengthsPsr4 = array();
+    private $prefixDirsPsr4 = array();
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    private $prefixesPsr0 = array();
+    private $fallbackDirsPsr0 = array();
+
+    private $useIncludePath = false;
+    private $classMap = array();
+
+    public function getPrefixes()
+    {
+        return call_user_func_array('array_merge', $this->prefixesPsr0);
+    }
+
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array $classMap Class to filename map
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string       $prefix  The prefix
+     * @param array|string $paths   The PSR-0 root directories
+     * @param bool         $prepend Whether to prepend the directories
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string       $prefix  The prefix/namespace, with trailing '\\'
+     * @param array|string $paths   The PSR-0 base directories
+     * @param bool         $prepend Whether to prepend the directories
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    (array) $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string       $prefix The prefix
+     * @param array|string $paths  The PSR-0 base directories
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string       $prefix  The prefix/namespace, with trailing '\\'
+     * @param array|string $paths   The PSR-4 base directories
+     */
+    public function setPsr4($prefix, $paths) {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return bool|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            include $file;
+
+            return true;
+        }
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
+        if ('\\' == $class[0]) {
+            $class = substr($class, 1);
+        }
+
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php';
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . '.php';
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        // Remember that this class does not exist.
+        return $this->classMap[$class] = false;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_classmap.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_classmap.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_classmap.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_namespaces.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_namespaces.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_namespaces.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,10 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'fXmlRpc' => array($vendorDir . '/lstrojny/fxmlrpc/src'),
+);

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_psr4.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_psr4.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_psr4.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_real.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_real.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/autoload_real.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,48 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInit2e896c05cba741d2984a0f24380bfde2
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInit2e896c05cba741d2984a0f24380bfde2', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+        spl_autoload_unregister(array('ComposerAutoloaderInit2e896c05cba741d2984a0f24380bfde2', 'loadClassLoader'));
+
+        $vendorDir = dirname(__DIR__);
+        $baseDir = dirname($vendorDir);
+
+        $map = require __DIR__ . '/autoload_namespaces.php';
+        foreach ($map as $namespace => $path) {
+            $loader->set($namespace, $path);
+        }
+
+        $map = require __DIR__ . '/autoload_psr4.php';
+        foreach ($map as $namespace => $path) {
+            $loader->setPsr4($namespace, $path);
+        }
+
+        $classMap = require __DIR__ . '/autoload_classmap.php';
+        if ($classMap) {
+            $loader->addClassMap($classMap);
+        }
+
+        $loader->register(true);
+
+        return $loader;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/installed.json
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/installed.json	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/composer/installed.json	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,69 @@
+[
+    {
+        "name": "lstrojny/fxmlrpc",
+        "version": "0.9.2",
+        "version_normalized": "0.9.2.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/lstrojny/fxmlrpc.git",
+            "reference": "e18db5cdcf3130eb36d148e48ac42c46437d631a"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/lstrojny/fxmlrpc/zipball/e18db5cdcf3130eb36d148e48ac42c46437d631a",
+            "reference": "e18db5cdcf3130eb36d148e48ac42c46437d631a",
+            "shasum": ""
+        },
+        "require-dev": {
+            "ext-curl": "*",
+            "guzzle/guzzle": "*",
+            "internations/kodierungsregelwerksammlung": "dev-master",
+            "kriswallsmith/buzz": "*",
+            "lstrojny/hmmmath": "*",
+            "monolog/monolog": "*",
+            "php": ">=5.3.0",
+            "phpunit/phpunit": "~4",
+            "psr/log": "*",
+            "symfony/process": "~2",
+            "zendframework/zend-http": "~2",
+            "zendframework/zend-log": "~2",
+            "zendframework/zendframework1": "~1"
+        },
+        "suggest": {
+            "ext-http": "Use ext/http as HTTP client",
+            "guzzle/guzzle": "To integrate Guzzle as HTTP client",
+            "kriswallsmith/buzz": "To integrate Buzz as HTTP client",
+            "monolog/monolog": "To integrate monolog as logger",
+            "zendframework/zend-http": "To use ZF2 Zend\\Http\\Client as HTTP client",
+            "zendframework/zend-log": "To use ZF2 Zend\\Log\\Logger as a logger",
+            "zendframework/zendframework1": "To use ZF1 Zend_Http_Client as HTTP client"
+        },
+        "time": "2014-05-12 20:42:14",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "fXmlRpc": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Lars Strojny",
+                "email": "lstrojny at php.net",
+                "homepage": "http://usrportage.de"
+            }
+        ],
+        "description": "Fast and tiny XML/RPC client with bridges for various HTTP clients",
+        "keywords": [
+            "api",
+            "performance",
+            "rpc",
+            "xml",
+            "xmlrpc"
+        ]
+    }
+]

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.gitignore
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.gitignore	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.gitignore	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,5 @@
+/nbproject/
+/node_modules/
+/.idea/
+/atlassian-ide-plugin.xml
+/composer.lock

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.travis.yml
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.travis.yml	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/.travis.yml	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,16 @@
+language: php
+php:
+  - 5.4
+  - 5.5
+  - hhvm
+
+before_script:
+  - which pecl && echo yes | pecl install pecl_http || true
+  - composer install
+  - npm install
+
+script: phpunit
+
+matrix:
+  allow_failures:
+    - php: hhvm

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/README.md
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/README.md	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/README.md	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,180 @@
+# fxmlrpc: really fast XML/RPC for PHP [![Build Status](https://secure.travis-ci.org/lstrojny/fxmlrpc.svg)](http://travis-ci.org/lstrojny/fxmlrpc) [![Dependency Status](https://www.versioneye.com/user/projects/523ed7eb632bac1b0600bae8/badge.png)](https://www.versioneye.com/user/projects/523ed7eb632bac1b0600bae8)
+
+ - A convenient, object oriented API (similar to the XML/RPC client in Zend Framework)
+ - Very fast serializing and parsing of the XML payloads involved
+ - Stick to the HTTP client you already use: Buzz, ZF1/ZF2 HTTP client, Guzzle, PECL HTTP
+ - Licensed under the terms of the liberal MIT license
+ - Supports modern standards: easy installation via composer, fully PSR-0, PSR-1 and PSR-2 compatible
+ - Relentlessly unit- and integration tested
+ - Implements all known XML/RPC extensions
+
+## Latest improvements
+
+ - `[FEATURE]` Allow HTTP transport headers to be controlled
+ - `[FEATURE]` Allow transport content type and charset to be controlled (see #9)
+ - `[BC]` Removing outdated PeclHttpBridge
+ - `[BC]` Requiring PHP 5.4
+ - `[BUG]` Fixing huge issue in `XmlWriterSerializer` (see #4 for details)
+ - `[FEATURE]` Special API for multicall
+ - `[FEATURE]` Supports all Java XML/RPC extensions
+ - `[BC]` `fXmlRpc\AbstractDecorator` and `fXmlRpc\ClientInterface` now includes methods to prepend and append parameters
+ - `[BC]` `fXmlRpc\Client` is marked as final. Properties marked as private. Extend via decorator.
+ - `[BC]` Marked deprecated constructor of `fXmlRpc\Value\Base64` as private. Additionally, the value object is final now
+ - `[TESTING]` Integration test suite against Java XML/RPC and Python XML/RPC
+ - `[BUG]` Fixing implicit string type handling (where string is no child of value)
+ - `[IMPROVEMENT]` Improved exception handling
+ - `[BC]` Changing naming scheme to studly caps
+ - `[BUG]` Fixing various array/struct edge cases
+ - `[IMPROVEMENT]` Small memory and performance improvements for serializers and parsers
+ - `[BC]` Deprecated constructor of `fXmlRpc\Value\Base64` and introduced `::serialize()` an `::deserialize()` instead.
+ - `[FEATURE]` Adding `fXmlRpc\Client::prependParams()` and `fXmlRpc\Client::appendParams()` to set default params. This helps e.g. when you need to add authorization information for every call
+ - `[FEATURE]` Timing Loggers now support threshold based logging to ease controlling your servers responds in a certain time
+ - `[TESTING]` Travis now runs the test suite against various versions of supported HTTP clients and logging components.
+
+### How fast is it really?
+
+IO performance is out of reach from a userspace perspective, but parsing and
+serialization speed is what matters. How fast can we generate the XML payload
+from PHP data structures and how fast can we parse the servers response? fXmlRpc
+uses stream based XML writers/readers to achieve it’s performance and heavily
+optimizes (read uglifies) for it. As as result the userland version is only
+around 2x slower than the native C implementation (ext/xmlrpc).
+
+
+#### Parser
+```
+Zend\XmlRpc\Value (ZF2): 249.02972793579 sec
+Zend_XmlRpc_Value (ZF1): 253.88145494461 sec
+fXmlRpc\Parser\XmlReaderParser: 36.274516105652 sec
+fXmlRpc\Parser\NativeParser: 18.652323007584 sec
+```
+
+#### Serializer
+```
+Zend\XmlRpc\Request (ZF2): 52.004573106766 sec
+Zend_XmlRpc_Request (ZF1): 65.042532920837 sec
+fXmlRpc\Serializer\XmlWriterSerializer: 23.652673006058 sec
+fXmlRpc\Serializer\NativeSerializer: 9.0790779590607 sec
+```
+
+
+### Usage
+
+#### Basic Usage
+```php
+<?php
+$client = new fXmlRpc\Client('http://endpoint.com');
+$client->call('remoteMethod', array('arg1', true));
+```
+
+#### Using native (ext/xmlrpc based) serializer/parser (for even better performance)
+```php
+<?php
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    null,
+    new fXmlRpc\Parser\NativeParser(),
+    new fXmlRpc\Serializer\NativeSerializer()
+);
+$client->call('remoteMethod', array('arg1', true));
+```
+
+#### Prepending and appending arguments
+```php
+<?php
+$client = new fXmlRpc\Client('http://endpoint.com');
+$client->prependParams(array('username', 'password'));
+$client->appendParams(array('appended'));
+...
+```
+
+#### Using a convenient Proxy object
+```php
+<?php
+$proxy = new fXmlRpc\Proxy(new fXmlRpc\Client('http://endpoint.com'));
+// Call system.echo
+$proxy->system->echo('Hello World!');
+```
+
+### Helpful abstraction for multicall requests
+```php
+<?php
+$result = $client->multicall()
+    ->addCall('system.add', array(1, 2))
+    ->addCall(
+        'system.add',
+        array(2, 3),
+        function ($result) {
+            echo "Result was: " . $result;
+        },
+        function($result) {
+            echo "An error occured: " . var_export($result, true);
+        }
+    )
+    ->onSuccess(function ($result) {echo "Success";}) // Success handler for each call
+    ->onError(function ($result) {echo "Error";}) // Error handler for each call
+    ->execute();
+```
+
+#### Integration for various HTTP clients
+```php
+<?php
+/** Buzz (https://github.com/kriswallsmith/Buzz) */
+$browser = new Buzz\Browser();
+$browser->...();
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    new fXmlRpc\Transport\BuzzBrowserBridge($browser)
+);
+
+/** Zend Framework 1 (http://framework.zend.com/) */
+$httpClient = new Zend_Http_Client();
+$httpClient->...();
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    new fXmlRpc\Transport\ZF1HttpClientBridge($httpClient)
+);
+
+/** Zend Framework 2 (http://framework.zend.com/zf2) */
+$httpClient = new Zend\Http\Client();
+$httpClient->...();
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    new fXmlRpc\Transport\ZF2HttpClientBridge($httpClient)
+);
+
+/** Guzzle (http://guzzlephp.org/) */
+$httpClient = new Guzzle\Http\Client();
+$httpClient->...();
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    new fXmlRpc\Transport\GuzzleBridge($httpClient)
+);
+
+/** PECL HTTP (http://pecl.php.net/pecl_http) */
+$request = new HttpRequest();
+$request->...();
+$client = new fXmlRpc\Client(
+    'http://endpoint.com',
+    new fXmlRpc\Transport\PeclHttpBridge($request)
+);
+```
+
+#### Timing XML/RPC requests to find problematic calls
+fXmlRpc allows you to time your XML/RPC request, to find out which took how long. It provides a
+`fXmlRpc\Timing\TimingDecorator` which can be used with various timers implementing
+`fXmlRpc\Timing\TimerInterface`. Currently implemented are bridges for Monolog, Zend Framework 1
+`Zend_Log` and Zend Framework 2 `Zend\Log`.
+
+Usage:
+```php
+<?php
+$client = new fXmlRpc\Timing\TimingDecorator(
+    new fXmlRpc\Client(...),
+    new fXmlRpc\Timing\MonologTimerBridge(
+        $monolog,
+        Monolog\Logger::ALERT,
+        'My custom log message template %F'
+    )
+);
+```

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/build.xml
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/build.xml	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/build.xml	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<project name="fxmlrpc" default="build">
+    <target name="build" description="Run CI jobs" depends="clean,prepare,phpunit"/>
+
+    <target name="clean">
+        <delete dir="${basedir}/build/" includes="**/*" excludes="**/.gitkeep"/>
+        <mkdir dir="${basedir}/build/logs/"/>
+        <mkdir dir="${basedir}/build/coverage/"/>
+    </target>
+
+    <target name="prepare">
+        <get src="http://getcomposer.org/composer.phar" dest="build/composer.phar"/>
+        <exec executable="php" failonerror="true">
+            <arg value="build/composer.phar"/> 
+            <arg value="install"/>
+            <arg value="--dev"/>
+            <arg value="--prefer-dist"/>
+        </exec>
+        <exec executable="npm" failonerror="true">
+            <arg value="install"/>
+        </exec>
+    </target>
+
+    <target name="phpunit">
+        <exec executable="phpunit" failonerror="true"/>
+    </target>
+</project>

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/composer.json
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/composer.json	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/composer.json	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,40 @@
+{
+    "name": "lstrojny/fxmlrpc",
+    "description": "Fast and tiny XML/RPC client with bridges for various HTTP clients",
+    "keywords": ["xmlrpc", "xml", "api", "rpc", "performance"],
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Lars Strojny",
+            "email": "lstrojny at php.net",
+            "homepage": "http://usrportage.de"
+        }
+    ],
+    "require-dev": {
+        "php": ">=5.3.0",
+        "zendframework/zend-http": "~2",
+        "zendframework/zend-log": "~2",
+        "zendframework/zendframework1": "~1",
+        "kriswallsmith/buzz": "*",
+        "guzzle/guzzle": "*",
+        "monolog/monolog": "*",
+        "ext-curl": "*",
+        "psr/log": "*",
+        "phpunit/phpunit": "~4",
+        "symfony/process": "~2",
+        "lstrojny/hmmmath": "*",
+        "internations/kodierungsregelwerksammlung": "dev-master"
+    },
+    "suggest": {
+        "zendframework/zend-http": "To use ZF2 Zend\\Http\\Client as HTTP client",
+        "zendframework/zend-log": "To use ZF2 Zend\\Log\\Logger as a logger",
+        "zendframework/zendframework1": "To use ZF1 Zend_Http_Client as HTTP client",
+        "kriswallsmith/buzz": "To integrate Buzz as HTTP client",
+        "guzzle/guzzle": "To integrate Guzzle as HTTP client",
+        "monolog/monolog": "To integrate monolog as logger",
+        "ext-http": "Use ext/http as HTTP client"
+    },
+    "autoload": {
+        "psr-0": {"fXmlRpc": "src/"}
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/package.json
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/package.json	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/package.json	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,7 @@
+{
+    "name": "lstrojny-fxmlrpc",
+    "version": "0.0.1-dev",
+    "devDependencies": {
+        "node-xmlrpc": "git://github.com/baalexander/node-xmlrpc.git"
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/phpunit.xml.dist
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/phpunit.xml.dist	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/phpunit.xml.dist	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         convertErrorsToExceptions="true"
+         convertWarningsToExceptions="true"
+         convertNoticesToExceptions="true"
+         mapTestClassNameToCoveredClassName="true"
+         bootstrap="vendor/autoload.php"
+         verbose="false"
+         colors="true"
+         strict="true">
+
+    <testsuites>
+        <testsuite name="FXMLRPC">
+            <directory>./tests</directory>
+        </testsuite>
+    </testsuites>
+    <php>
+        <ini name="error_reporting" value="-1"/>
+    </php>
+</phpunit>

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/AbstractDecorator.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/AbstractDecorator.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/AbstractDecorator.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+/**
+ * Abstract base class for client decorators
+ *
+ * Extend this base class if you want to decorate functionality of the client
+ */
+abstract class AbstractDecorator implements ClientInterface
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $wrapped;
+
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct(ClientInterface $wrapped)
+    {
+        $this->wrapped = $wrapped;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setUri($uri)
+    {
+        return $this->wrapped->setUri($uri);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getUri()
+    {
+        return $this->wrapped->getUri();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function prependParams(array $params)
+    {
+        return $this->wrapped->prependParams($params);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getPrependParams()
+    {
+        return $this->wrapped->getPrependParams();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function appendParams(array $params)
+    {
+        return $this->wrapped->appendParams($params);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAppendParams()
+    {
+        return $this->wrapped->getAppendParams();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function call($methodName, array $arguments = [])
+    {
+        return $this->wrapped->call($methodName, $arguments);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function multicall()
+    {
+        return $this->wrapped->multicall();
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Client.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Client.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Client.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,174 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+use fXmlRpc\Transport\TransportInterface;
+use fXmlRpc\Transport\StreamSocketTransport;
+use fXmlRpc\Parser\ParserInterface;
+use fXmlRpc\Parser\XmlReaderParser;
+use fXmlRpc\Serializer\SerializerInterface;
+use fXmlRpc\Serializer\XmlWriterSerializer;
+use fXmlRpc\Exception\ResponseException;
+use fXmlRpc\Exception\InvalidArgumentException;
+
+final class Client implements ClientInterface
+{
+    /**
+     * @var string
+     */
+    private $uri;
+
+    /**
+     * @var Transport\TransportInterface
+     */
+    private $transport;
+
+    /**
+     * @var Parser\ParserInterface
+     */
+    private $parser;
+
+    /**
+     * @var Serializer\SerializerInterface
+     */
+    private $serializer;
+
+    /**
+     * @var array
+     */
+    private $prependParams = [];
+
+    /**
+     * @var array
+     */
+    private $appendParams = [];
+
+    /**
+     * Create new client instance
+     *
+     * If no specific transport, parser or serializer is passed, default implementations
+     * are used.
+     *
+     * @param string                         $uri
+     * @param Transport\TransportInterface   $transport
+     * @param Parser\ParserInterface         $parser
+     * @param Serializer\SerializerInterface $serializer
+     */
+    public function __construct(
+        $uri = null,
+        TransportInterface $transport = null,
+        ParserInterface $parser = null,
+        SerializerInterface $serializer = null
+    )
+    {
+        $this->uri = $uri;
+        $this->transport = $transport ?: new StreamSocketTransport();
+        $this->parser = $parser ?: new XmlReaderParser();
+        $this->serializer = $serializer ?: new XmlWriterSerializer();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setUri($uri)
+    {
+        if (!is_string($uri)) {
+            throw InvalidArgumentException::expectedParameter(0, 'string', $uri);
+        }
+
+        $this->uri = $uri;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getUri()
+    {
+        return $this->uri;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function prependParams(array $params)
+    {
+        $this->prependParams = $params;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getPrependParams()
+    {
+        return $this->prependParams;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function appendParams(array $params)
+    {
+        $this->appendParams = $params;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getAppendParams()
+    {
+        return $this->appendParams;
+    }
+
+    /**
+     * {@inheritdoc}
+     * @throws Exception\ResponseException
+     */
+    public function call($methodName, array $params = [])
+    {
+        if (!is_string($methodName)) {
+            throw InvalidArgumentException::expectedParameter(0, 'string', $methodName);
+        }
+
+        $params = array_merge($this->prependParams, $params, $this->appendParams);
+
+        $response = $this->parser->parse(
+            $this->transport->send($this->uri, $this->serializer->serialize($methodName, $params)),
+            $isFault
+        );
+
+        if ($isFault) {
+            throw ResponseException::fault($response);
+        }
+
+        return $response;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function multicall()
+    {
+        return new Multicall($this);
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ClientInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ClientInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ClientInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+interface ClientInterface
+{
+    /**
+     * Set endpoint URI
+     *
+     * @param string $uri
+     * @return null
+     */
+    public function setUri($uri);
+
+    /**
+     * Return endpoint URI
+     *
+     * @return string
+     */
+    public function getUri();
+
+    /**
+     * Set default params to be prepended for each call (e.g. authorization information)
+     *
+     * @param array $params
+     * @return null
+     */
+    public function prependParams(array $params);
+
+    /**
+     * @return array
+     */
+    public function getPrependParams();
+
+    /**
+     * Set default params to be appended for each call (e.g. authorization information)
+     *
+     * @param array $params
+     * @return null
+     */
+    public function appendParams(array $params);
+
+    /**
+     * @return array
+     */
+    public function getAppendParams();
+
+    /**
+     * Execute remote call
+     *
+     * @param string $methodName
+     * @param array  $params
+     * @return mixed
+     */
+    public function call($methodName, array $params = []);
+
+    /**
+     * Start sequence of multiccallss
+     *
+     * @return Multicall
+     */
+    public function multicall();
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator/XmlReaderParserBitmaskGenerator.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator/XmlReaderParserBitmaskGenerator.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/CodeGenerator/XmlReaderParserBitmaskGenerator.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace fXmlRpc\CodeGenerator;
+
+class XmlReaderParserBitmaskGenerator
+{
+    private $basicTypes = [
+        'methodResponse',
+        'params',
+        'fault',
+        'param',
+        'value',
+        'array',
+        'member',
+        'name',
+        '#text',
+        'string',
+        'struct',
+        'int',
+        'biginteger',
+        'i8',
+        'i4',
+        'i2',
+        'i1',
+        'boolean',
+        'double',
+        'float',
+        'bigdecimal',
+        'dateTime.iso8601',
+        'dateTime',
+        'base64',
+        'nil',
+        'dom',
+        'data',
+    ];
+
+    private $combinedTypes = [];
+
+    private $typeCount = 0;
+
+    private $values = [];
+
+    public function __construct()
+    {
+        $this->combinedTypes = [
+            'expectedForMethodResponse' => ['params', 'fault'],
+            'expectedForMember' => ['name', 'value'],
+            'expectedForSimpleType' => ['#text', 'value'],
+            'expectedForNil' => ['nil', 'value'],
+            'expectedForValue' => [
+                'string',
+                'array',
+                'struct',
+                'int',
+                'biginteger',
+                'i8',
+                'i4',
+                'i2',
+                'i1',
+                'boolean',
+                'double',
+                'float',
+                'bigdecimal',
+                'dateTime.iso8601',
+                'dateTime',
+                'base64',
+                'nil',
+                'dom',
+                '#text'
+            ],
+            'expectedForStruct' => ['member', 'struct', 'value'],
+            'expectedForData' => ['data', 'value', 'array'],
+            'expectedAfterValue' => [
+                'param',
+                'value',
+                'data',
+                'member',
+                'name',
+                'int',
+                'i4',
+                'i2',
+                'i1',
+                'base64',
+                'fault'
+            ],
+            'expectedAfterParam' => ['param', 'params'],
+            'expectedAfterName' => ['value', 'member'],
+            'expectedAfterMember' => ['struct', 'member'],
+            'allFlags' => $this->basicTypes,
+        ];
+
+        $this->typeCount = count($this->basicTypes);
+    }
+
+    private function createBitmaskVariable($type, $bitmask, $prefix = '')
+    {
+        $variableName = preg_match('/^\w+[\d\w_]*$/', $type)
+            ? 'static $' . $prefix . $type
+            : '${\'' . $prefix . $type . '\'}';
+        $this->values[$type] = $bitmask;
+
+        return $variableName . ' = 0b' . sprintf('%0' . $this->typeCount . 'b', $this->values[$type]) . ';';
+    }
+
+    public function generate()
+    {
+        $code = [];
+        $bitmask = 1;
+        foreach ($this->basicTypes as $type) {
+            $code[] = $this->createBitmaskVariable($type, $bitmask, 'flag');
+            $bitmask = $bitmask << 1;
+        }
+
+        foreach ($this->combinedTypes as $type => $combination) {
+            $value = 0;
+            foreach ($combination as $subType) {
+                $value |= $this->values[$subType];
+            }
+            $code[] = $this->createBitmaskVariable($type, $value);
+        }
+
+        $commentStart = <<<'EOS'
+// This following assignments are auto-generated using %s
+// Don’t edit manually
+EOS;
+
+        $commentStart = sprintf($commentStart, __CLASS__);
+
+        $commentEnd = '// End of auto-generated code';
+
+        return $commentStart . "\n" . implode("\n", $code) . "\n" . $commentEnd;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ExceptionInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ExceptionInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ExceptionInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+interface ExceptionInterface
+{
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/HttpException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/HttpException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/HttpException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+use Exception;
+
+class HttpException extends TransportException
+{
+    public static function httpError($message, $statusCode, Exception $previous = null)
+    {
+        return new static('An HTTP error occurred: ' . $message, $statusCode, $previous);
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/InvalidArgumentException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/InvalidArgumentException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/InvalidArgumentException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+use InvalidArgumentException as BaseInvalidArgumentException;
+
+class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
+{
+    public static function expectedParameter($position, $expected, $actualValue)
+    {
+        return new static(
+            sprintf(
+                'Expected parameter %d to be of type "%s", "%s" given',
+                $position,
+                $expected,
+                is_object($actualValue)
+                    ? sprintf('%s" of type "%s', gettype($actualValue), get_class($actualValue))
+                    : gettype($actualValue)
+            )
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/MissingExtensionException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/MissingExtensionException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/MissingExtensionException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+class MissingExtensionException extends RuntimeException
+{
+    public static function extensionMissing($extension)
+    {
+        return new static(
+            sprintf('PHP extension "ext/%s" is required but not installed', $extension)
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ResponseException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ResponseException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/ResponseException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+class ResponseException extends RuntimeException
+{
+    private $faultCode;
+
+    public static function fault($response)
+    {
+        $exception = new static(isset($response['faultString']) ? $response['faultString'] : 'Unknown');
+        $exception->faultCode = isset($response['faultCode']) ? $response['faultCode'] : 0;
+
+        return $exception;
+    }
+
+    public function getFaultString()
+    {
+        return $this->getMessage();
+    }
+
+    public function getFaultCode()
+    {
+        return $this->faultCode;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/RuntimeException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/RuntimeException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/RuntimeException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+use RuntimeException as BaseRuntimeException;
+
+class RuntimeException extends BaseRuntimeException implements ExceptionInterface
+{
+    public static function unexpectedTag($tagName, $elements, array $definedVariables, $depth, $xml)
+    {
+        $expectedElements = [];
+        foreach ($definedVariables as $variableName => $variable) {
+            if (substr($variableName, 0, 4) !== 'flag') {
+                continue;
+            }
+
+            if (($elements & $variable) === $variable) {
+                $expectedElements[] = substr($variableName, 4);
+            }
+        }
+
+        return new static(
+            sprintf(
+                'Invalid XML. Expected one of "%s", got "%s" on depth %d (context: "%s")',
+                implode('", "', $expectedElements),
+                $tagName,
+                $depth,
+                $xml
+            )
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/SerializationException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/SerializationException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/SerializationException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+class SerializationException extends InvalidArgumentException
+{
+    public static function invalidType($value)
+    {
+        return new static(
+            sprintf('Could not serialize %s of type "%s"', gettype($value), get_resource_type($value))
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TcpException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TcpException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TcpException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+use Exception;
+
+class TcpException extends TransportException
+{
+    public static function transportError($error)
+    {
+        $message = $error instanceof Exception ? $error->getMessage() : $error;
+        $previous = $error instanceof Exception ? $error : null;
+
+        return new static('A transport error occurred: ' . $message, null, $previous);
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TransportException.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TransportException.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Exception/TransportException.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Exception;
+
+class TransportException extends RuntimeException
+{
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ExtensionSupportInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ExtensionSupportInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/ExtensionSupportInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+interface ExtensionSupportInterface
+{
+    const EXTENSION_NIL = 'nil';
+
+    /**
+     * Enables extension
+     *
+     * @param  string $extension
+     * @return null
+     */
+    public function enableExtension($extension);
+
+    /**
+     * Disables extension
+     *
+     * @param  string $extension
+     * @return null
+     */
+    public function disableExtension($extension);
+
+    /**
+     * Returns true if an extension is enabled
+     *
+     * @param  string  $extension
+     * @return boolean
+     */
+    public function isExtensionEnabled($extension);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Multicall.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Multicall.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Multicall.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,181 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+use fXmlRpc\Exception\InvalidArgumentException;
+
+final class Multicall
+{
+    /**
+     * @var ClientInterface
+     */
+    private $client;
+
+    /**
+     * @var integer
+     */
+    private $index = 0;
+
+    /**
+     * @var array
+     */
+    private $calls = [];
+
+    /**
+     * @var array
+     */
+    private $handlers = [];
+
+    /**
+     * @var callable
+     */
+    private $onSuccess;
+
+    /**
+     * @var callable
+     */
+    private $onError;
+
+    /**
+     * @param ClientInterface $client
+     */
+    public function __construct(ClientInterface $client)
+    {
+        $this->client = $client;
+    }
+
+    /**
+     * Add a call to the sequence
+     *
+     * @param  string                   $methodName
+     * @param  array                    $params
+     * @param  callable                 $onSuccess
+     * @param  callable                 $onError
+     * @throws InvalidArgumentException
+     * @return self
+     */
+    public function addCall($methodName, array $params = [], $onSuccess = null, $onError = null)
+    {
+        if (!is_string($methodName)) {
+            throw InvalidArgumentException::expectedParameter(1, 'string', $methodName);
+        }
+
+        if ($onSuccess !== null && !is_callable($onSuccess)) {
+            throw InvalidArgumentException::expectedParameter(3, 'callable', $onSuccess);
+        }
+
+        if ($onError !== null && !is_callable($onError)) {
+            throw InvalidArgumentException::expectedParameter(4, 'callable', $onError);
+        }
+
+        $this->calls[$this->index] = compact('methodName', 'params');
+        $this->handlers[$this->index] = compact('onSuccess', 'onError');
+        ++$this->index;
+
+        return $this;
+    }
+
+    /**
+     * @param  callable                 $onSuccess
+     * @throws InvalidArgumentException
+     * @return self
+     */
+    public function onSuccess($onSuccess)
+    {
+        if (!is_callable($onSuccess)) {
+            throw InvalidArgumentException::expectedParameter(1, 'callable', $onSuccess);
+        }
+
+        $this->onSuccess = $onSuccess;
+
+        return $this;
+    }
+
+    /**
+     * @param  callable                 $onError
+     * @throws InvalidArgumentException
+     * @return self
+     */
+    public function onError($onError)
+    {
+        if (!is_callable($onError)) {
+            throw InvalidArgumentException::expectedParameter(1, 'callable', $onError);
+        }
+
+        $this->onError = $onError;
+
+        return $this;
+    }
+
+    /**
+     * Execute multicall request
+     *
+     * @return array
+     */
+    public function execute()
+    {
+        $results = $this->client->call('system.multicall', [$this->calls]);
+
+        foreach ($results as $index => $result) {
+            $this->processResult($this->handlers[$index], $result);
+        }
+
+        return $results;
+    }
+
+    /**
+     * @param array $handler
+     * @param mixed $result
+     */
+    protected function processResult(array $handler, $result)
+    {
+        $isError = is_array($result) && isset($result['faultCode']);
+
+        $this->invokeHandler($handler['onSuccess'], $handler['onError'], $isError, $result);
+        $this->invokeHandler($this->onSuccess, $this->onError, $isError, $result);
+    }
+
+    /**
+     * @param callable|null $onSuccess
+     * @param callable|null $onError
+     * @param boolean       $isError
+     * @param mixed         $result
+     */
+    protected function invokeHandler($onSuccess, $onError, $isError, $result)
+    {
+        if ($isError && $onError !== null) {
+            call_user_func($onError, $result);
+        } elseif ($onSuccess !== null) {
+            call_user_func($onSuccess, $result);
+        }
+    }
+
+    /**
+     * @return ClientInterface
+     */
+    public function getClient()
+    {
+        return $this->client;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/NativeParser.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/NativeParser.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/NativeParser.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace fXmlRpc\Parser;
+
+use DateTime;
+use DateTimeZone;
+use fXmlRpc\Exception\MissingExtensionException;
+use fXmlRpc\Value\Base64;
+
+class NativeParser implements ParserInterface
+{
+    public function __construct()
+    {
+        if (!extension_loaded('xmlrpc')) {
+            throw MissingExtensionException::extensionMissing('xmlrpc');
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function parse($xmlString, &$isFault)
+    {
+        $result = xmlrpc_decode($xmlString, 'UTF-8');
+
+        $isFault = false;
+
+        $toBeVisited = [&$result];
+        while (isset($toBeVisited[0]) && $value = &$toBeVisited[0]) {
+
+            $type = gettype($value);
+            if ($type === 'object') {
+                $xmlRpcType = $value->{'xmlrpc_type'};
+                if ($xmlRpcType === 'datetime') {
+                    $value = DateTime::createFromFormat(
+                        'Ymd\TH:i:s',
+                        $value->scalar,
+                        isset($timezone) ? $timezone : $timezone = new DateTimeZone('UTC')
+                    );
+
+                } elseif ($xmlRpcType === 'base64') {
+                    if ($value->scalar !== '') {
+                        $value = Base64::serialize($value->scalar);
+                    } else {
+                        $value = null;
+                    }
+                }
+
+            } elseif ($type === 'array') {
+                foreach ($value as &$element) {
+                    $toBeVisited[] = &$element;
+                }
+            }
+
+            array_shift($toBeVisited);
+        }
+
+        if (is_array($result)) {
+            reset($result);
+            $isFault = xmlrpc_is_fault($result);
+        }
+
+        return $result;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/ParserInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/ParserInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/ParserInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Parser;
+
+/**
+ * Parser to parse XML responses into its PHP representation
+ */
+interface ParserInterface
+{
+    /**
+     * Parse XML string into PHP representation
+     *
+     * @param  string  $xmlString
+     * @param  boolean $isFault
+     * @return string
+     */
+    public function parse($xmlString, &$isFault);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/XmlReaderParser.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/XmlReaderParser.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Parser/XmlReaderParser.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,359 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Parser;
+
+use fXmlRpc\Value\Base64;
+use XMLReader;
+use fXmlRpc\Exception\MissingExtensionException;
+use fXmlRpc\Exception\RuntimeException;
+use DateTime;
+use DateTimeZone;
+use DOMDocument;
+
+class XmlReaderParser implements ParserInterface
+{
+    public function __construct()
+    {
+        if (!extension_loaded('xmlreader')) {
+            throw MissingExtensionException::extensionMissing('xmlreader');
+        }
+    }
+
+    /**
+     * @throws RuntimeException
+     * {@inheritdoc}
+     */
+    public function parse($xmlString, &$isFault)
+    {
+        $useErrors = libxml_use_internal_errors(true);
+
+        $xml = new XMLReader();
+        $xml->xml($xmlString, 'UTF-8', LIBXML_COMPACT | LIBXML_NOCDATA | LIBXML_NOBLANKS);
+        $xml->setParserProperty(XMLReader::VALIDATE, false);
+        $xml->setParserProperty(XMLReader::LOADDTD, false);
+
+// This following assignments are auto-generated using fXmlRpc\CodeGenerator\XmlReaderParserBitmaskGenerator
+// Don’t edit manually
+        static $flagmethodResponse = 0b000000000000000000000000001;
+        static $flagparams = 0b000000000000000000000000010;
+        static $flagfault = 0b000000000000000000000000100;
+        static $flagparam = 0b000000000000000000000001000;
+        static $flagvalue = 0b000000000000000000000010000;
+        static $flagarray = 0b000000000000000000000100000;
+        static $flagmember = 0b000000000000000000001000000;
+        static $flagname = 0b000000000000000000010000000;
+        ${'flag#text'} = 0b000000000000000000100000000;
+        static $flagstring = 0b000000000000000001000000000;
+        static $flagstruct = 0b000000000000000010000000000;
+        static $flagint = 0b000000000000000100000000000;
+        static $flagbiginteger = 0b000000000000001000000000000;
+        static $flagi8 = 0b000000000000010000000000000;
+        static $flagi4 = 0b000000000000100000000000000;
+        static $flagi2 = 0b000000000001000000000000000;
+        static $flagi1 = 0b000000000010000000000000000;
+        static $flagboolean = 0b000000000100000000000000000;
+        static $flagdouble = 0b000000001000000000000000000;
+        static $flagfloat = 0b000000010000000000000000000;
+        static $flagbigdecimal = 0b000000100000000000000000000;
+        ${'flagdateTime.iso8601'} = 0b000001000000000000000000000;
+        static $flagdateTime = 0b000010000000000000000000000;
+        static $flagbase64 = 0b000100000000000000000000000;
+        static $flagnil = 0b001000000000000000000000000;
+        static $flagdom = 0b010000000000000000000000000;
+        static $flagdata = 0b100000000000000000000000000;
+// End of auto-generated code
+
+        $aggregates = [];
+        $depth = 0;
+        $nextExpectedElements = 0b000000000000000000000000001;
+        $i = 0;
+        while ($xml->read()) {
+            $i++;
+            $nodeType = $xml->nodeType;
+
+            if (($nodeType === XMLReader::COMMENT || $nodeType === XMLReader::DOC_TYPE) ||
+                (
+                   $nodeType === XMLReader::SIGNIFICANT_WHITESPACE &&
+                   ($nextExpectedElements & 0b000000000000000000100000000) !== 0b000000000000000000100000000)
+                ) {
+                continue;
+            }
+
+            if ($nodeType === XMLReader::ENTITY_REF) {
+                return '';
+            }
+
+            $tagName = $xml->localName;
+            if ($nextExpectedElements !== null &&
+                ($flag = isset(${'flag' . $tagName}) ? ${'flag' . $tagName} : -1) &&
+                ($nextExpectedElements & $flag) !== $flag) {
+                throw RuntimeException::unexpectedTag(
+                    $tagName,
+                    $nextExpectedElements,
+                    get_defined_vars(),
+                    $xml->depth,
+                    $xml->readOuterXml()
+                );
+            }
+
+            processing:
+            switch ($nodeType) {
+                case XMLReader::ELEMENT:
+                    switch ($tagName) {
+                        case 'methodResponse':
+                            // Next: params, fault
+                            $nextExpectedElements = 0b000000000000000000000000110;
+                            break;
+
+                        case 'params':
+                            // Next: param
+                            $nextExpectedElements = 0b000000000000000000000001000;
+                            $aggregates[$depth] = [];
+                            $isFault = false;
+                            break;
+
+                        case 'fault':
+                            $isFault = true;
+                            // Break intentionally omitted
+                        case 'param':
+                            // Next: value
+                            $nextExpectedElements = 0b000000000000000000000010000;
+                            break;
+
+                        case 'array':
+                            $aggregates[++$depth] = [];
+                            // Break intentionally omitted
+                        case 'data':
+                            // Next: array, data, value
+                            $nextExpectedElements = 0b100000000000000000000110000;
+                            break;
+
+                        case 'struct':
+                            // Next: struct, member, value
+                            $nextExpectedElements = 0b000000000000000010001010000;
+                            $aggregates[++$depth] = [];
+                            break;
+
+                        case 'member':
+                            // Next: name, value
+                            $nextExpectedElements = 0b000000000000000000010010000;
+                            $aggregates[++$depth] = [];
+                            break;
+
+                        case 'name':
+                            // Next: #text
+                            $nextExpectedElements = 0b000000000000000000100000000;
+                            $type = 'name';
+                            break;
+
+                        case 'value':
+                            $nextExpectedElements = 0b011111111111111111100100000;
+                            $type = 'value';
+                            break;
+
+                        case 'base64':
+                        case 'string':
+                        case 'biginteger':
+                        case 'i8':
+                        case 'dateTime.iso8601':
+                        case 'dateTime':
+                            // Next: value, $tagName, #text
+                            $nextExpectedElements = 0b000000000000000000100010000 | ${'flag' . $tagName};
+                            $type = $tagName;
+                            $aggregates[$depth + 1] = '';
+                            break;
+
+                        case 'nil':
+                            // Next: value, $tagName
+                            $nextExpectedElements = 0b001000000000000000000010000 | ${'flag' . $tagName};
+                            $type = $tagName;
+                            $aggregates[$depth + 1] = null;
+                            break;
+
+                        case 'int':
+                        case 'i4':
+                        case 'i2':
+                        case 'i1':
+                            // Next: value, #text, $tagName
+                            $nextExpectedElements = 0b000000000000000000100010000 | ${'flag' . $tagName};
+                            $type = $tagName;
+                            $aggregates[$depth + 1] = 0;
+                            break;
+
+                        case 'boolean':
+                            // Next: value, #text, $tagName
+                            $nextExpectedElements = 0b000000000000000000100010000 | ${'flag' . $tagName};
+                            $type = 'boolean';
+                            $aggregates[$depth + 1] = false;
+                            break;
+
+                        case 'double':
+                        case 'float':
+                        case 'bigdecimal':
+                            // Next: value, #text, $tagName
+                            $nextExpectedElements = 0b000000000000000000100010000 | ${'flag' . $tagName};
+                            $type = $tagName;
+                            $aggregates[$depth + 1] = 0.0;
+                            break;
+
+                        case 'dom':
+                            $type = 'dom';
+                            // Disable type checking
+                            $nextExpectedElements = null;
+                            $aggregates[$depth + 1] = $xml->readInnerXml();
+                            break;
+                    }
+                    break;
+
+                case XMLReader::END_ELEMENT:
+                    switch ($tagName) {
+                        case 'params':
+                        case 'fault':
+                            break 3;
+
+                        case 'param':
+                            // Next: params, param
+                            $nextExpectedElements = 0b000000000000000000000001010;
+                            break;
+
+                        case 'value':
+                            $nextExpectedElements = 0b100100000011100100011011100;
+                            $aggregates[$depth][] = $aggregates[$depth + 1];
+                            break;
+
+                        case 'array':
+                        case 'struct':
+                            --$depth;
+                            // Break intentionally omitted
+                        case 'string':
+                        case 'int':
+                        case 'biginteger':
+                        case 'i8':
+                        case 'i4':
+                        case 'i2':
+                        case 'i1':
+                        case 'boolean':
+                        case 'double':
+                        case 'float':
+                        case 'bigdecimal':
+                        case 'dateTime.iso8601':
+                        case 'dateTime':
+                        case 'base64':
+                        case 'nil':
+                            // Next: value
+                            $nextExpectedElements = 0b000000000000000000000010000;
+                            break;
+
+                        case 'data':
+                            // Next: array
+                            $nextExpectedElements = 0b000000000000000000000100000;
+                            break;
+
+                        case 'name':
+                            // Next: value, member
+                            $nextExpectedElements = 0b000000000000000000001010000;
+                            $aggregates[$depth]['name'] = $aggregates[$depth + 1];
+                            break;
+
+                        case 'member':
+                            // Next: struct, member
+                            $nextExpectedElements = 0b000000000000000010001000000;
+                            $aggregates[$depth - 1][$aggregates[$depth]['name']] = $aggregates[$depth][0];
+                            unset($aggregates[$depth], $aggregates[$depth + 1]);
+                            --$depth;
+                            break;
+                    }
+                    break;
+
+                case XMLReader::TEXT:
+                case XMLReader::SIGNIFICANT_WHITESPACE:
+                    switch ($type) {
+                        case 'int':
+                        case 'i4':
+                        case 'i2':
+                        case 'i1':
+                            $value = (int) $xml->value;
+                            break;
+
+                        case 'boolean':
+                            $value = $xml->value === '1';
+                            break;
+
+                        case 'double':
+                        case 'float':
+                        case 'bigdecimal':
+                            $value = (float) $xml->value;
+                            break;
+
+                        case 'dateTime.iso8601':
+                            $value = DateTime::createFromFormat(
+                                'Ymd\TH:i:s',
+                                $xml->value,
+                                isset($timezone) ? $timezone : $timezone = new DateTimeZone('UTC')
+                            );
+                            break;
+
+                        case 'dateTime':
+                            $value = DateTime::createFromFormat(
+                                'Y-m-d\TH:i:s.uP',
+                                $xml->value,
+                                isset($timezone) ? $timezone : $timezone = new DateTimeZone('UTC')
+                            );
+                            break;
+
+                        case 'base64':
+                            $value = Base64::deserialize($xml->value);
+                            break;
+
+                        case 'dom':
+                            $doc = new DOMDocument('1.0', 'UTF-8');
+                            $doc->loadXML($aggregates[$depth + 1]);
+                            $value = $doc;
+                            break;
+
+                        default:
+                            $value = &$xml->value;
+                            break;
+                    }
+
+                    $aggregates[$depth + 1] = $value;
+                    if ($nextExpectedElements === null) {
+                        break;
+                    }
+                    // Next: any
+                    $nextExpectedElements = 0b111111111111111111111111111;
+                    break;
+            }
+
+            if ($xml->isEmptyElement && $nodeType !== XMLReader::END_ELEMENT) {
+                $nodeType = XMLReader::END_ELEMENT;
+                goto processing;
+            }
+        }
+
+        libxml_use_internal_errors($useErrors);
+
+        return $aggregates ? array_pop($aggregates[0]) : null;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Proxy.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Proxy.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Proxy.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc;
+
+class Proxy
+{
+    /**
+     * @var ClientInterface
+     */
+    private $client;
+
+    /**
+     * @var string
+     */
+    private $namespace;
+
+    /**
+     * @var string
+     */
+    private $namespaceSeparator = '.';
+
+    /**
+     * @var Proxy[string]
+     */
+    private $proxies = [];
+
+    /**
+     * @param ClientInterface $client
+     * @param string          $namespaceSeparator
+     * @param string          $namespace
+     */
+    public function __construct(ClientInterface $client, $namespaceSeparator = '.', $namespace = null)
+    {
+        $this->client = $client;
+        $this->namespaceSeparator = $namespaceSeparator;
+        $this->namespace = $namespace;
+    }
+
+    /**
+     * Invokes remote command
+     *
+     * @param  string $method
+     * @param  array  $parameters
+     * @return mixed
+     */
+    public function __call($method, array $parameters)
+    {
+        return $this->client->call($this->prependNamespace($method), $parameters);
+    }
+
+    /**
+     * Returns namespace specific Proxy instance
+     *
+     * @param  string $namespace
+     * @return Proxy
+     */
+    public function __get($namespace)
+    {
+        $namespace = $this->prependNamespace($namespace);
+        if (!isset($this->proxies[$namespace])) {
+            $this->proxies[$namespace] = new static($this->client, $this->namespaceSeparator, $namespace);
+        }
+
+        return $this->proxies[$namespace];
+    }
+
+    /**
+     * Prepend namespace if set
+     *
+     * @param  string $string
+     * @return string
+     */
+    protected function prependNamespace($string)
+    {
+        if ($this->namespace === null) {
+            return $string;
+        }
+
+        return $this->namespace . $this->namespaceSeparator . $string;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/NativeSerializer.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/NativeSerializer.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/NativeSerializer.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Serializer;
+
+use DateTime;
+use fXmlRpc\Value\Base64Interface;
+use fXmlRpc\Exception\SerializationException;
+use fXmlRpc\Exception\MissingExtensionException;
+
+class NativeSerializer implements SerializerInterface
+{
+    public function __construct()
+    {
+        if (!extension_loaded('xmlrpc')) {
+            throw MissingExtensionException::extensionMissing('xmlrpc');
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function serialize($method, array $params = [])
+    {
+        $toBeVisited = [&$params];
+        while (isset($toBeVisited[0]) && $value = &$toBeVisited[0]) {
+
+            $type = gettype($value);
+            if ($type === 'array') {
+                foreach ($value as &$child) {
+                    $toBeVisited[] = &$child;
+                }
+
+            } elseif ($type === 'object') {
+                if ($value instanceof DateTime) {
+                    $value = $value->format('Ymd\TH:i:s');
+                    xmlrpc_set_type($value, 'datetime');
+                } elseif ($value instanceof Base64Interface) {
+                    $value = $value->getDecoded();
+                    xmlrpc_set_type($value, 'base64');
+                } else {
+                    $value = get_object_vars($value);
+                }
+            } elseif ($type === 'resource') {
+                throw SerializationException::invalidType($value);
+            }
+
+            array_shift($toBeVisited);
+        }
+
+        return xmlrpc_encode_request(
+            $method,
+            $params,
+            ['encoding' => 'UTF-8', 'escaping' => 'markup', 'verbosity' => 'no_white_space']
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/SerializerInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/SerializerInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/SerializerInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Serializer;
+
+/**
+ * Serializer creates XML from native PHP types
+ */
+interface SerializerInterface
+{
+    /**
+     * Serialize XML/RPC method name and params into XML representation
+     *
+     * @param  string $method
+     * @param  array  $params
+     * @return string
+     */
+    public function serialize($method, array $params = []);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/XmlWriterSerializer.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/XmlWriterSerializer.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Serializer/XmlWriterSerializer.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,228 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Serializer;
+
+use XMLWriter;
+use Closure;
+use DateTime;
+use fXmlRpc\Value\Base64Interface;
+use fXmlRpc\ExtensionSupportInterface;
+use fXmlRpc\Exception\SerializationException;
+use fXmlRpc\Exception\MissingExtensionException;
+
+class XmlWriterSerializer implements SerializerInterface, ExtensionSupportInterface
+{
+    /**
+     * @var XMLWriter
+     */
+    private $writer;
+
+    /**
+     * @var array
+     */
+    private $extensions = [];
+
+    public function __construct()
+    {
+        if (!extension_loaded('xmlwriter')) {
+            throw MissingExtensionException::extensionMissing('xmlwriter');
+        }
+
+        $this->writer = new XMLWriter();
+        $this->writer->openMemory();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function enableExtension($extension)
+    {
+        $this->extensions[$extension] = true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function disableExtension($extension)
+    {
+        $this->extensions[$extension] = false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function isExtensionEnabled($extension)
+    {
+        return isset($this->extensions[$extension]) ? $this->extensions[$extension] : true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function serialize($methodName, array $params = [])
+    {
+        $writer = $this->writer;
+
+        $writer->startDocument('1.0', 'UTF-8');
+        $writer->startElement('methodCall');
+        $writer->writeElement('methodName', $methodName);
+        $writer->startElement('params');
+
+        $endNode = static function () use ($writer) {
+            $writer->endElement();
+        };
+        $valueNode = static function () use ($writer) {
+            $writer->startElement('value');
+        };
+        $paramNode = static function () use ($writer) {
+            $writer->startElement('param');
+        };
+
+        $toBeVisited = [];
+        foreach (array_reverse($params) as $param) {
+            $toBeVisited[] = $endNode;
+            $toBeVisited[] = $param;
+            $toBeVisited[] = $paramNode;
+        }
+
+        $nilTagName = $this->isExtensionEnabled(ExtensionSupportInterface::EXTENSION_NIL) ? 'nil' : 'string';
+
+        while ($toBeVisited) {
+            $node = array_pop($toBeVisited);
+            $type = gettype($node);
+
+            if ($type === 'string') {
+                $writer->startElement('value');
+                $writer->writeElement('string', $node);
+                $writer->endElement();
+
+            } elseif ($type === 'integer') {
+                $writer->startElement('value');
+                $writer->writeElement('int', $node);
+                $writer->endElement();
+
+            } elseif ($type === 'double') {
+                if (!isset($precision)) {
+                    $precision = ini_get('precision');
+                }
+
+                $writer->startElement('value');
+                $writer->writeElement('double', $node);
+                $writer->endElement();
+
+            } elseif ($type === 'boolean') {
+                $writer->startElement('value');
+                $writer->writeElement('boolean', $node ? '1' : '0');
+                $writer->endElement();
+
+            } elseif ($type === 'NULL') {
+                $writer->startElement('value');
+                $writer->writeElement($nilTagName);
+                $writer->endElement();
+
+            } elseif ($type === 'array') {
+                /** Find out if it is a struct or an array */
+                $min = 0;
+                foreach ($node as $min => &$child) {
+                    break;
+                }
+                $isStruct = false;
+                $length = count($node) + $min;
+                for ($a = $min; $a < $length; ++$a) {
+                    if (!isset($node[$a])) {
+                        $isStruct = true;
+                        break;
+                    }
+                }
+
+                if (!$isStruct) {
+                    $toBeVisited[] = $endNode;
+                    $toBeVisited[] = $endNode;
+                    $toBeVisited[] = $endNode;
+                    foreach (array_reverse($node) as $value) {
+                        $toBeVisited[] = $value;
+                    }
+                    $toBeVisited[] = static function () use ($writer) {
+                        $writer->startElement('array');
+                        $writer->startElement('data');
+                    };
+                    $toBeVisited[] = $valueNode;
+
+                } else {
+                    struct:
+                    $toBeVisited[] = $endNode;
+                    $toBeVisited[] = $endNode;
+                    foreach (array_reverse($node, true) as $key => $value) {
+                        $toBeVisited[] = $endNode;
+                        $toBeVisited[] = $value;
+                        $toBeVisited[] = static function () use ($writer, $key) {
+                            $writer->writeElement('name', $key);
+                        };
+                        $toBeVisited[] = static function () use ($writer) {
+                            $writer->startElement('member');
+                        };
+                    }
+                    $toBeVisited[] = static function () use ($writer) {
+                        $writer->startElement('struct');
+                    };
+                    $toBeVisited[] = $valueNode;
+                }
+
+            } elseif ($type === 'object') {
+
+                if ($node instanceof Closure) {
+                    $node();
+
+                } elseif ($node instanceof DateTime) {
+                    $writer->startElement('value');
+                    $writer->writeElement('dateTime.iso8601', $node->format('Ymd\TH:i:s'));
+                    $writer->endElement();
+
+                } elseif ($node instanceof Base64Interface) {
+                    $writer->startElement('value');
+                    $writer->writeElement('base64', $node->getEncoded() . "\n");
+                    $writer->endElement();
+
+                } else {
+                    $node = get_object_vars($node);
+                    goto struct;
+                }
+            } elseif ($type === 'resource') {
+                throw SerializationException::invalidType($node);
+            }
+        }
+
+        $writer->endElement();
+        $writer->endElement();
+
+        $xml = $writer->flush(true);
+
+        // NativeSerializer does not inject a newline after the declaration
+        if ($xml[38] === "\n") {
+            $xml = substr($xml, 0, 38) . substr($xml, 39);
+        }
+
+        return $xml;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/AbstractTimerBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/AbstractTimerBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/AbstractTimerBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Timing;
+
+/**
+ * Base class for timing bridges
+ *
+ * Base class for bridging between timing information and various logger
+ * implementations.
+ */
+abstract class AbstractTimerBridge implements TimerInterface
+{
+    /**
+     * @var object
+     */
+    protected $logger;
+
+    /**
+     * @var array|integer
+     */
+    protected $level;
+
+    /**
+     * @var string
+     */
+    protected $messageTemplate = 'fXmlRpc call took %01.10Fs';
+
+    /**
+     * Set log level
+     *
+     * @param mixed $level
+     * @param mixed $default
+     */
+    protected function setLevel($level, $default)
+    {
+        if (is_array($level)) {
+            krsort($level);
+        }
+
+        $this->level = $level ?: $default;
+    }
+
+    /**
+     * Get log level by callTime
+     *
+     * @param  float $callTime
+     * @return integer
+     */
+    protected function getLevel($callTime)
+    {
+        if (!is_array($this->level)) {
+            return $this->level;
+        }
+
+        foreach ($this->level as $threshold => $level) {
+            if ($callTime >= $threshold) {
+                return $level;
+            }
+        }
+
+        return $level;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/MonologTimerBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/MonologTimerBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/MonologTimerBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Timing;
+
+use Monolog\Logger;
+
+class MonologTimerBridge extends AbstractTimerBridge
+{
+    /**
+     * Create new monolog bridge
+     *
+     * Allows passing custom log level and message template (with sprintf() control characters) for log message
+     * customization
+     *
+     * @param Logger     $logger
+     * @param null|array $level
+     * @param null       $messageTemplate
+     */
+    public function __construct(Logger $logger, $level = null, $messageTemplate = null)
+    {
+        $this->logger = $logger;
+        $this->setLevel($level, Logger::DEBUG);
+        $this->messageTemplate = $messageTemplate ?: $this->messageTemplate;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function recordTiming($callTime, $method, array $arguments)
+    {
+        $level = $this->getLevel($callTime);
+
+        $this->logger->addRecord(
+            $level,
+            sprintf($this->messageTemplate, $callTime),
+            ['xmlrpcMethod' => $method, 'xmlrpcArguments' => $arguments]
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/Psr3TimerBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/Psr3TimerBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/Psr3TimerBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Timing;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+
+class Psr3TimerBridge extends AbstractTimerBridge
+{
+    /**
+     * Create new bridge or a PSR-3 compatible logger
+     *
+     * Allows passing custom log level and message template (with sprintf() control characters) for log message
+     * customization
+     *
+     * @param LoggerInterface $logger
+     * @param integer         $level
+     * @param string          $messageTemplate
+     */
+    public function __construct(LoggerInterface $logger, $level = null, $messageTemplate = null)
+    {
+        $this->logger = $logger;
+        $this->setLevel($level, LogLevel::DEBUG);
+        $this->messageTemplate = $messageTemplate ?: $this->messageTemplate;
+    }
+
+    public function recordTiming($callTime, $method, array $arguments)
+    {
+        $this->logger->log(
+            $this->getLevel($callTime),
+            sprintf($this->messageTemplate, $callTime),
+            ['xmlrpcMethod' => $method, 'xmlrpcArguments' => $arguments]
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimerInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimerInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimerInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Timing;
+
+interface TimerInterface
+{
+    /**
+     * Records a timing information
+     *
+     * @param float  $callTime
+     * @param string $method
+     * @param array  $arguments
+     * @return null
+     */
+    public function recordTiming($callTime, $method, array $arguments);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimingDecorator.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimingDecorator.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/TimingDecorator.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Timing;
+
+use fXmlRpc\ClientInterface;
+use fXmlRpc\AbstractDecorator;
+use fXmlRpc\Timing\TimerInterface;
+
+class TimingDecorator extends AbstractDecorator
+{
+    /**
+     * @var TimerInterface
+     */
+    private $timer;
+
+    /**
+     * Create new client decorator to record timing information
+     *
+     * @param ClientInterface $wrapped
+     * @param TimerInterface  $timer
+     */
+    public function __construct(ClientInterface $wrapped, TimerInterface $timer)
+    {
+        parent::__construct($wrapped);
+        $this->timer = $timer;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function call($methodName, array $arguments = [])
+    {
+        $startTime = microtime(true);
+        $result = parent::call($methodName, $arguments);
+        $this->timer->recordTiming(microtime(true) - $startTime, $methodName, $arguments);
+
+        return $result;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkOneTimerBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkOneTimerBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkOneTimerBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace fXmlRpc\Timing;
+
+use Zend_Log as Log;
+
+class ZendFrameworkOneTimerBridge extends AbstractTimerBridge
+{
+    /**
+     * Create new Zend_Log bridge
+     *
+     * Allows passing custom log level and message template (with sprintf() control characters) for log message
+     * customization
+     *
+     * @param Log $logger
+     * @param integer  $level
+     * @param string   $messageTemplate
+     */
+    public function __construct(Log $logger, $level = null, $messageTemplate = null)
+    {
+        $this->logger = $logger;
+        $this->setLevel($level, Log::DEBUG);
+        $this->messageTemplate = $messageTemplate ?: $this->messageTemplate;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function recordTiming($callTime, $method, array $arguments)
+    {
+        $this->logger->log(
+            sprintf($this->messageTemplate, $callTime),
+            $this->getLevel($callTime),
+            ['xmlrpcMethod' => $method, 'xmlrpcArguments' => $arguments]
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkTwoTimerBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkTwoTimerBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Timing/ZendFrameworkTwoTimerBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace fXmlRpc\Timing;
+
+use Zend\Log\LoggerInterface;
+
+class ZendFrameworkTwoTimerBridge extends AbstractTimerBridge
+{
+    /**
+     * Create new Zend\Log\LoggerInterface bridge
+     *
+     * Allows passing custom log level and message template (with sprintf() control characters) for log message
+     * customization
+     *
+     * @param LoggerInterface $logger
+     * @param string          $method
+     * @param string          $messageTemplate
+     */
+    public function __construct(LoggerInterface $logger, $method = null, $messageTemplate = null)
+    {
+        $this->logger = $logger;
+        $this->setLevel($method, 'debug');
+        $this->messageTemplate = $messageTemplate ?: $this->messageTemplate;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function recordTiming($callTime, $method, array $arguments)
+    {
+        $level = $this->getLevel($callTime);
+        $this->logger->{$level}(
+            sprintf($this->messageTemplate, $callTime),
+            ['xmlrpcMethod' => $method, 'xmlrpcArguments' => $arguments]
+        );
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/AbstractHttpTransport.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/AbstractHttpTransport.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/AbstractHttpTransport.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+abstract class AbstractHttpTransport implements HttpTransportInterface
+{
+    /** @var array */
+    private $headers = [];
+
+    /** @var string */
+    private $contentType = 'text/xml';
+
+    /** @var string */
+    private $charset = 'UTF-8';
+
+    /** {@inheritdoc} */
+    public function setHeader($header, $value)
+    {
+        $this->headers[$header] = $value;
+
+        return $this;
+    }
+
+    /** {@inheritdoc} */
+    public function setHeaders(array $headers)
+    {
+        $this->headers = array_replace($this->headers, $headers);
+
+        return $this;
+    }
+
+    /** {@inheritdoc} */
+    public function setContentType($contentType)
+    {
+        $this->contentType = $contentType === null ? 'text/xml' : $contentType;
+
+        return $this;
+    }
+
+    /** {@inheritdoc} */
+    public function setCharset($charset)
+    {
+        $this->charset = $charset;
+
+        return $this;
+    }
+
+    /**
+     * Return content type header string
+     *
+     * @return string
+     */
+    private function getContentTypeHeader()
+    {
+        if ($this->charset === null) {
+            return $this->contentType;
+        }
+
+        return sprintf('%s; charset=%s', $this->contentType, $this->charset);
+    }
+
+    /**
+     * Get header array
+     *
+     * @param bool $filterNullValues Filter null values from headers
+     * @return array
+     */
+    protected function getHeaders($filterNullValues = false)
+    {
+        $headers = $this->headers;
+
+        if ($filterNullValues) {
+            $headers = array_filter($headers, static function ($v) {return $v !== null;});
+        }
+
+        $headers['Content-Type'] = $this->getContentTypeHeader();
+
+        return $headers;
+    }
+
+    /**
+     * Get headers as string
+     *
+     * @return string
+     */
+    protected function getHeadersString()
+    {
+        $headerString = '';
+        foreach ($this->getHeaders(true) as $header => $value) {
+
+            $headerString .= $header . ': ' . $value . "\r\n";
+        }
+
+        return $headerString;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/BuzzBrowserBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/BuzzBrowserBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/BuzzBrowserBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use Buzz\Browser;
+use Buzz\Message\Response;
+use RuntimeException;
+use fXmlRpc\Exception\TcpException;
+use fXmlRpc\Exception\HttpException;
+
+class BuzzBrowserBridge extends AbstractHttpTransport
+{
+    /** @var Browser */
+    private $browser;
+
+    public function __construct(Browser $browser)
+    {
+        $this->browser = $browser;
+    }
+
+    /** {@inheritdoc} */
+    public function send($uri, $payload)
+    {
+        try {
+            /** @var $response Response */
+            $response = $this->browser->post($uri, $this->getHeaders(true), $payload);
+        } catch (RuntimeException $e) {
+            throw TcpException::transportError($e);
+        }
+
+        if ($response->getStatusCode() !== 200) {
+            throw HttpException::httpError($response->getReasonPhrase(), $response->getStatusCode());
+        }
+
+        return $response->getContent();
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/CurlTransport.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/CurlTransport.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/CurlTransport.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * cryptocompress <cryptocompress at googlemail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TcpException;
+
+final class CurlTransport extends AbstractHttpTransport
+{
+    /** @var resource */
+    private $handle;
+
+    public function __construct()
+    {
+        $this->handle = curl_init();
+
+        curl_setopt_array(
+            $this->handle,
+            [
+                CURLOPT_RETURNTRANSFER    => true,
+                CURLOPT_HEADER            => true,
+                CURLOPT_MAXREDIRS         => 5,
+                CURLOPT_TIMEOUT_MS        => 5000,
+                CURLOPT_CONNECTTIMEOUT_MS => 5000,
+                CURLOPT_POST              => true,
+            ]
+        );
+    }
+
+    public function __destruct()
+    {
+        if (is_resource($this->handle)) {
+            curl_close($this->handle);
+        }
+    }
+
+    /** {@inheritdoc} */
+    public function send($uri, $payload)
+    {
+        curl_setopt_array(
+            $this->handle,
+            [
+                CURLOPT_URL        => $uri,
+                CURLOPT_POSTFIELDS => $payload,
+                CURLOPT_HTTPHEADER => explode("\r\n", $this->getHeadersString()),
+            ]
+        );
+
+        $response = curl_exec($this->handle);
+        if ($response === false || strlen($response) < 1) {
+            throw TcpException::transportError(curl_error($this->handle));
+        }
+
+        $code = curl_getinfo($this->handle, CURLINFO_HTTP_CODE);
+        if ($code !== 200) {
+            throw HttpException::httpError(curl_error($this->handle), $code);
+        }
+
+        return substr($response, curl_getinfo($this->handle, CURLINFO_HEADER_SIZE));
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/GuzzleBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/GuzzleBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/GuzzleBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use Guzzle\Http\Client;
+use Guzzle\Http\Message\BadResponseException;
+use Guzzle\Http\Exception\ClientErrorResponseException;
+use Guzzle\Http\Exception\ServerErrorResponseException;
+use Guzzle\Http\Curl\CurlException as CompatCurlException;
+use Guzzle\Http\Exception\CurlException;
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TcpException;
+
+final class GuzzleBridge extends AbstractHttpTransport
+{
+    /** @var Client */
+    private $client;
+
+    /** @param Client $client */
+    public function __construct(Client $client)
+    {
+        $this->client = $client;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function send($uri, $payload)
+    {
+        try {
+            $response = $this->client
+                ->post($uri, $this->getHeaders(true), $payload)
+                ->send();
+        } catch (CurlException $e) {
+            throw TcpException::transportError($e);
+        } catch (CompatCurlException $e) {
+            throw TcpException::transportError($e);
+        } catch (BadResponseException $e) {
+            throw HttpException::httpError($e->getMessage(), $e->getResponse()->getStatusCode(), $e);
+        } catch (ServerErrorResponseException $e) {
+            throw HttpException::httpError($e->getMessage(), $e->getResponse()->getStatusCode(), $e);
+        } catch (ClientErrorResponseException $e) {
+            throw HttpException::httpError($e->getMessage(), $e->getResponse()->getStatusCode(), $e);
+        }
+
+        return $response->getBody(true);
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/HttpTransportInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/HttpTransportInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/HttpTransportInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+/**
+ * Transport interface for HTTP based transports
+ */
+interface HttpTransportInterface extends TransportInterface
+{
+    /**
+     * Set a key value array of headers
+     *
+     * @param array $headers
+     * @return self
+     */
+    public function setHeaders(array $headers);
+
+    /**
+     * Set a single header
+     *
+     * @param string $header
+     * @param string $value
+     * @return self
+     */
+    public function setHeader($header, $value);
+
+    /**
+     * Set transport content type
+     *
+     * @param string $contentType
+     * @return self
+     */
+    public function setContentType($contentType);
+
+    /**
+     * Set transport charset
+     *
+     * @param string $charset
+     * @return self
+     */
+    public function setCharset($charset);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/StreamSocketTransport.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/StreamSocketTransport.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/StreamSocketTransport.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TcpException;
+
+class StreamSocketTransport extends AbstractHttpTransport
+{
+    /** {@inheritdoc} */
+    public function send($uri, $payload)
+    {
+        $context = stream_context_create(
+            [
+                'http' => [
+                    'method'  => 'POST',
+                    'header'  => $this->getHeadersString(),
+                    'content' => $payload,
+                ]
+            ]
+        );
+
+        $response = @file_get_contents($uri, false, $context);
+        if ($response === false) {
+            $error = error_get_last();
+
+            if (strpos($error['message'], 'HTTP request failed')) {
+                $matched = preg_match('|HTTP/1.[0-1]\s+(?<code>\d+)|', $error['message'], $matches);
+                throw HttpException::httpError($error['message'], $matched ? $matches['code'] : null);
+            }
+
+            throw TcpException::transportError($error['message']);
+        }
+
+        return $response;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/TransportInterface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/TransportInterface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/TransportInterface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TransportException;
+
+/**
+ * Transport interface
+ *
+ * This interface is implemented by transports to provide means to send
+ * requests over the wire.
+ */
+interface TransportInterface
+{
+    /**
+     * Send XML/RPC request
+     *
+     * @param  string             $uri
+     * @param  string             $payload
+     * @throws HttpException      If an HTTP exception occurred
+     * @throws TransportException If a transport error occurred
+     * @return string
+     */
+    public function send($uri, $payload);
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkOneHttpClientBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkOneHttpClientBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkOneHttpClientBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use Zend_Http_Client as HttpClient;
+use Zend_Http_Client_Adapter_Exception as HttpClientAdapterException;
+use Zend_Http_Client_Exception as HttpClientException;
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TcpException;
+
+class ZendFrameworkOneHttpClientBridge extends AbstractHttpTransport
+{
+    /**
+     * @var HttpClient
+     */
+    private $client;
+
+    /**
+     * @param HttpClient $client
+     */
+    public function __construct(HttpClient $client)
+    {
+        $this->client = $client;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function send($url, $payload)
+    {
+        try {
+            $response = $this->client
+                ->setUri($url)
+                ->setHeaders($this->getHeaders())
+                ->setRawData($payload)
+                ->request('POST');
+        } catch (HttpClientAdapterException $e) {
+            throw TcpException::transportError($e);
+        } catch (HttpClientException $e) {
+            throw TcpException::transportError($e);
+        }
+
+        if ($response->getStatus() !== 200) {
+            throw HttpException::httpError($response->getMessage(), $response->getStatus());
+        }
+
+        return $response->getBody();
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkTwoHttpClientBridge.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkTwoHttpClientBridge.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Transport/ZendFrameworkTwoHttpClientBridge.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Transport;
+
+use Zend\Http\Client;
+use Zend\Http\Client\Adapter\Exception\RuntimeException;
+use fXmlRpc\Exception\HttpException;
+use fXmlRpc\Exception\TcpException;
+
+class ZendFrameworkTwoHttpClientBridge extends AbstractHttpTransport
+{
+    /**
+     * @var Client
+     */
+    private $client;
+
+    /**
+     * @param Client $client
+     */
+    public function __construct(Client $client)
+    {
+        $this->client = $client;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function send($url, $payload)
+    {
+        try {
+            $response = $this->client
+                ->setMethod('POST')
+                ->setUri($url)
+                ->setRawBody($payload)
+                ->setHeaders($this->getHeaders(true))
+                ->send();
+        } catch (RuntimeException $e) {
+            throw TcpException::transportError($e);
+        }
+
+        if ($response->getStatusCode() !== 200) {
+            throw HttpException::httpError($response->getReasonPhrase(), $response->getStatusCode());
+        }
+
+        return $response->getBody();
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Value;
+
+final class Base64 implements Base64Interface
+{
+    /**
+     * @var string
+     */
+    private $encoded;
+
+    /**
+     * @var string
+     */
+    private $decoded;
+
+    /**
+     * @param string $encoded
+     * @param string $decoded
+     */
+    private function __construct($encoded, $decoded)
+    {
+        $this->encoded = $encoded;
+        $this->decoded = $decoded;
+    }
+
+    /**
+     * Return new base64 value object by encoded value
+     *
+     * @param  string $string
+     * @return Base64
+     */
+    public static function serialize($string)
+    {
+        $value = new static(null, $string);
+
+        return $value;
+    }
+
+    /**
+     * Return new base64 value by string
+     *
+     * @param  string $value
+     * @return Base64
+     */
+    public static function deserialize($value)
+    {
+        $value = new static(trim($value), null);
+
+        return $value;
+    }
+
+    /**
+     * Get bas64 value as base64 string
+     *
+     * @return string
+     */
+    public function getEncoded()
+    {
+        if ($this->encoded === null) {
+            $this->encoded = base64_encode($this->decoded);
+        }
+
+        return $this->encoded;
+    }
+
+    /**
+     * Get base64 value as string
+     *
+     * @return string
+     */
+    public function getDecoded()
+    {
+        if ($this->decoded === null) {
+            $this->decoded = base64_decode($this->encoded);
+        }
+
+        return $this->decoded;
+    }
+}

Added: sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64Interface.php
===================================================================
--- sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64Interface.php	                        (rev 0)
+++ sandbox/jng/v30/Doc/samples/phpviewersample/vendor/lstrojny/fxmlrpc/src/fXmlRpc/Value/Base64Interface.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Copyright (C) 2012-2013
+ * Lars Strojny, InterNations GmbH <lars.strojny at internations.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+namespace fXmlRpc\Value;
+
+interface Base64Interface
+{
+    public function getEncoded();
+
+    public function getDecoded();
+}

Modified: sandbox/jng/v30/UnitTest/Common/DotNetWrappers/CollectionTest.cs
===================================================================
--- sandbox/jng/v30/UnitTest/Common/DotNetWrappers/CollectionTest.cs	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/UnitTest/Common/DotNetWrappers/CollectionTest.cs	2014-06-15 00:22:20 UTC (rev 8220)
@@ -448,15 +448,16 @@
         [Test]
         public void MapCollection()
         {
+            MgSiteConnection conn = new MgSiteConnection();
             string coordsys = "GEOGCS[\"LL84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]";
             MgEnvelope env = new MgEnvelope(10,10,20,20);
-            MgMap map1 = new MgMap();
+            MgMap map1 = new MgMap(conn);
             map1.Create(coordsys, env, "map1");
-            MgMap map2 = new MgMap();
+            MgMap map2 = new MgMap(conn);
             map2.Create(coordsys, env, "map2");
-            MgMap map3 = new MgMap();
+            MgMap map3 = new MgMap(conn);
             map3.Create(coordsys, env, "map3");
-            MgMap map4 = new MgMap();
+            MgMap map4 = new MgMap(conn);
             map4.Create(coordsys, env, "map4");
 
             MgMapCollection coll = new MgMapCollection();
@@ -481,15 +482,16 @@
         [Test]
         public void MapPlotCollection()
         {
+            MgSiteConnection conn = new MgSiteConnection();
             string coordsys = "GEOGCS[\"LL84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]";
             MgEnvelope env = new MgEnvelope(10,10,20,20);
-            MgMap map1 = new MgMap();
+            MgMap map1 = new MgMap(conn);
             map1.Create(coordsys, env, "map1");
 
-            MgMap map2 = new MgMap();
+            MgMap map2 = new MgMap(conn);
             map2.Create(coordsys, env, "map2");
 
-            MgMap map3 = new MgMap();
+            MgMap map3 = new MgMap(conn);
             map3.Create(coordsys, env, "map3");
 
             MgPlotSpecification spec = new MgPlotSpecification((float)8.0, (float)11.0, "in", (float)0.0, (float)0.0, (float)5.0, (float)5.0);

Modified: sandbox/jng/v30/UnitTest/WebTier/Php/MapLayerAPI.php
===================================================================
--- sandbox/jng/v30/UnitTest/WebTier/Php/MapLayerAPI.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/UnitTest/WebTier/Php/MapLayerAPI.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -503,8 +503,8 @@
         }
 
         $mapDefId = new MgResourceIdentifier($mapName);
-        $this->map = new MgMap();
-        $this->map->Create($this->resSrvc, $mapDefId, $mapDefId->GetName());
+        $this->map = new MgMap($this->site);
+        $this->map->Create($mapDefId, $mapDefId->GetName());
     }
 }
 ?>

Modified: sandbox/jng/v30/UnitTest/WebTier/Php/testAwSelection.php
===================================================================
--- sandbox/jng/v30/UnitTest/WebTier/Php/testAwSelection.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/UnitTest/WebTier/Php/testAwSelection.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -211,8 +211,8 @@
     $fsvc->UpdateFeatures($id, $cmdColl, false);
 
     $mapId = new MgResourceIdentifier("Library://TrevorWekel/NewSdf.MapDefinition");
-    $map = new MgMap();
-    $map->Create($rsvc, $mapId, "NewMap");
+    $map = new MgMap($site);
+    $map->Create($mapId, "NewMap");
 
     echo "Building Selection from Add()\n";
     $sel = new MgSelection($map);

Modified: sandbox/jng/v30/Web/src/mapadmin/performanceReport_GetResult.php
===================================================================
--- sandbox/jng/v30/Web/src/mapadmin/performanceReport_GetResult.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapadmin/performanceReport_GetResult.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -198,7 +198,6 @@
         $siteConn = new MgSiteConnection();
         $siteConn->Open($userInfo);
 
-        $resourceService = $siteConn->CreateService(MgServiceType::ResourceService);
         $profilingService = $siteConn->CreateService(MgServiceType::ProfilingService);
 
         //the profiling result is saved as xml file, the file name is unique
@@ -207,8 +206,8 @@
 
         $resourceID = new MgResourceIdentifier($mapResourceId);
         // Get a runtime map from a map definition
-        $map = new MgMap();
-        $map->Create($resourceService, $resourceID, $newXmlFileId);
+        $map = new MgMap($siteConn);
+        $map->Create($resourceID, $newXmlFileId);
 
         //The result will not show base layers
         RemoveBaseLayers($map);

Modified: sandbox/jng/v30/Web/src/mapviewerjava/buffer.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/buffer.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/buffer.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -101,8 +101,8 @@
 
         //load the map runtime state
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         //locate the buffer layer in the map. It might or might not already exist
         //
@@ -351,7 +351,7 @@
         // Save the new map state
         //
         layer.ForceRefresh();
-        map.Save(resourceSrvc);
+        map.Save();
 
         //build report message
         String title = MgLocalizer.GetString("BUFFERREPORTTITLE", locale);

Modified: sandbox/jng/v30/Web/src/mapviewerjava/legend.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/legend.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/legend.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -100,8 +100,8 @@
 
     //Load the map runtime state.
     //
-    MgMap map = new MgMap();
-    map.Open(resourceSrvc, mapName);
+    MgMap map = new MgMap(site);
+    map.Open(mapName);
 
     int updateType = -1;
 

Modified: sandbox/jng/v30/Web/src/mapviewerjava/mapframe.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/mapframe.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/mapframe.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -98,10 +98,10 @@
 
         MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
 
-        MgMap map = new MgMap();
+        MgMap map = new MgMap(site);
         MgResourceIdentifier resId = new MgResourceIdentifier(mapDefinition);
         String mapName = resId.GetName();
-        map.Create(resourceSrvc, resId, mapName);
+        map.Create(resId, mapName);
 
         //create an empty selection object and store it in the session repository
         MgSelection sel = new MgSelection(map);

Modified: sandbox/jng/v30/Web/src/mapviewerjava/measure.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/measure.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/measure.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -96,8 +96,8 @@
 
         //load the map runtime state and locate the measure layer
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
         MgLayerCollection layers = map.GetLayers();
         srs = GetMapSrs(map);
 
@@ -242,7 +242,7 @@
 
         if(layer != null)
             layer.ForceRefresh();
-        map.Save(resourceSrvc);
+        map.Save();
     }
     catch(MgException exc)
     {

Modified: sandbox/jng/v30/Web/src/mapviewerjava/quickplotgeneratepicture.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/quickplotgeneratepicture.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/quickplotgeneratepicture.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -110,11 +110,10 @@
     MgUserInformation userInfo = new MgUserInformation(sessionId);
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
-    MgResourceService resourceService = (MgResourceService) siteConnection.CreateService(MgServiceType.ResourceService);
     MgRenderingService renderingService = (MgRenderingService) siteConnection.CreateService(MgServiceType.RenderingService);
 
-    MgMap map = new MgMap();
-    map.Open(resourceService, mapName);
+    MgMap map = new MgMap(siteConnection);
+    map.Open(mapName);
 
     MgSelection selection = new MgSelection(map);
 

Modified: sandbox/jng/v30/Web/src/mapviewerjava/search.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/search.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/search.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -87,13 +87,11 @@
         //connect to the site and get a feature service and a resource service instances
         MgSiteConnection site = new MgSiteConnection();
         site.Open(cred);
-        MgFeatureService featureSrvc = (MgFeatureService)site.CreateService(MgServiceType.FeatureService);
-        MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
 
         //Create a temporary map runtime object, locate the layer
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
         MgLayerCollection layers = map.GetLayers();
         int i, j;
         MgLayer layer = null;
@@ -119,8 +117,7 @@
         MgFeatureQueryOptions opts = new MgFeatureQueryOptions();
         opts.SetFilter(filter);
         String featureClassName = layer.GetFeatureClassName();
-        MgResourceIdentifier srcId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-        features = featureSrvc.SelectFeatures(srcId, featureClassName, opts);
+        features = layer.SelectFeatures( opts);
         boolean hasResult = features.ReadNext();
 
         if(hasResult)

Modified: sandbox/jng/v30/Web/src/mapviewerjava/selectwithin.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/selectwithin.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/selectwithin.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -52,12 +52,11 @@
         site.Open(cred);
         MgFeatureService featureSrvc = (MgFeatureService)site.CreateService(MgServiceType.FeatureService);
         MgRenderingService renderingSrvc = (MgRenderingService)site.CreateService(MgServiceType.RenderingService);
-        MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
 
         //load the map runtime state
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         String[] layersList = layers.split(",");
         if(layersList.length > 0)

Modified: sandbox/jng/v30/Web/src/mapviewerjava/setselection.jsp
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerjava/setselection.jsp	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerjava/setselection.jsp	2014-06-15 00:22:20 UTC (rev 8220)
@@ -59,8 +59,8 @@
 
     //load the map runtime state
     //
-    MgMap map = new MgMap();
-    map.Open(resourceSrvc, mapName);
+    MgMap map = new MgMap(site);
+    map.Open(mapName);
 
     // Create the selection set and save it
     MgSelection sel = new MgSelection(map);

Modified: sandbox/jng/v30/Web/src/mapviewernet/buffer.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/buffer.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/buffer.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -79,8 +79,8 @@
 
         //load the map runtime state
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         //locate the buffer layer in the map. It might or might not already exist
         //
@@ -333,7 +333,7 @@
         // Save the new map state
         //
         layer.ForceRefresh();
-        map.Save(resourceSrvc);
+        map.Save();
 
         //build report message
         String title = MgLocalizer.GetString("BUFFERREPORTTITLE", locale);

Modified: sandbox/jng/v30/Web/src/mapviewernet/legend.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/legend.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/legend.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -93,8 +93,8 @@
 
         //Load the map runtime state.
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         int updateType = -1;
 

Modified: sandbox/jng/v30/Web/src/mapviewernet/mapframe.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/mapframe.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/mapframe.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -103,10 +103,10 @@
 
             MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
 
-            MgMap map = new MgMap();
+            MgMap map = new MgMap(site);
             MgResourceIdentifier resId = new MgResourceIdentifier(mapDefinition);
             String mapName = resId.GetName();
-            map.Create(resourceSrvc, resId, mapName);
+            map.Create(resId, mapName);
 
             //create an empty selection object and store it in the session repository
             MgSelection sel = new MgSelection(map);

Modified: sandbox/jng/v30/Web/src/mapviewernet/measure.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/measure.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/measure.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -74,8 +74,8 @@
 
             //load the map runtime state and locate the measure layer
             //
-            MgMap map = new MgMap();
-            map.Open(resourceSrvc, mapName);
+            MgMap map = new MgMap(site);
+            map.Open(mapName);
             MgLayerCollection layers = map.GetLayers();
             srs = GetMapSrs(map);
 
@@ -221,7 +221,7 @@
 
             if (layer != null)
                 layer.ForceRefresh();
-            map.Save(resourceSrvc);
+            map.Save();
         }
         catch (MgException exc)
         {

Modified: sandbox/jng/v30/Web/src/mapviewernet/quickplotgeneratepicture.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/quickplotgeneratepicture.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/quickplotgeneratepicture.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -109,11 +109,10 @@
     MgUserInformation userInfo = new MgUserInformation(sessionID);
     MgSiteConnection siteConnection = new MgSiteConnection();
     siteConnection.Open(userInfo);
-    MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
     MgRenderingService renderingService = siteConnection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
 
-    MgMap map = new MgMap();
-    map.Open(resourceService, mapName);
+    MgMap map = new MgMap(siteConnection);
+    map.Open(mapName);
 
     MgSelection selection = new MgSelection(map);
 

Modified: sandbox/jng/v30/Web/src/mapviewernet/search.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/search.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/search.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -75,12 +75,10 @@
             //connect to the site and get a feature service and a resource service instances
             MgSiteConnection site = new MgSiteConnection();
             site.Open(cred);
-            MgFeatureService featureSrvc = site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
-            MgResourceService resourceSrvc = site.CreateService(MgServiceType.ResourceService) as MgResourceService;
 
             //Create a temporary map runtime object, locate the layer
-            MgMap map = new MgMap();
-            map.Open(resourceSrvc, mapName);
+            MgMap map = new MgMap(site);
+            map.Open(mapName);
             MgLayerCollection layers = map.GetLayers();
             int i = 0;
             MgLayer layer = null;
@@ -108,8 +106,7 @@
             MgFeatureQueryOptions opts = new MgFeatureQueryOptions();
             opts.SetFilter(filter);
             String featureClassName = layer.GetFeatureClassName();
-            MgResourceIdentifier srcId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            features = featureSrvc.SelectFeatures(srcId, featureClassName, opts);
+            features = layer.SelectFeatures(opts);
             bool hasResult = features.ReadNext();
 
             if (hasResult)

Modified: sandbox/jng/v30/Web/src/mapviewernet/selectwithin.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/selectwithin.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/selectwithin.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -50,12 +50,11 @@
         site.Open(cred);
         MgFeatureService featureSrvc = site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
         MgRenderingService renderingSrvc = site.CreateService(MgServiceType.RenderingService) as MgRenderingService;
-        MgResourceService resourceSrvc = site.CreateService(MgServiceType.ResourceService) as MgResourceService;
 
         //load the map runtime state
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         String [] layersList = layers.Split(',');
         if(layersList.Length > 0)

Modified: sandbox/jng/v30/Web/src/mapviewernet/setselection.aspx
===================================================================
--- sandbox/jng/v30/Web/src/mapviewernet/setselection.aspx	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewernet/setselection.aspx	2014-06-15 00:22:20 UTC (rev 8220)
@@ -52,8 +52,8 @@
 
         //load the map runtime state
         //
-        MgMap map = new MgMap();
-        map.Open(resourceSrvc, mapName);
+        MgMap map = new MgMap(site);
+        map.Open(mapName);
 
         // Create the selection set and save it
         MgSelection sel = new MgSelection(map);

Modified: sandbox/jng/v30/Web/src/mapviewerphp/buffer.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/buffer.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/buffer.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -69,8 +69,8 @@
 
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
 
         //locate the buffer layer in the map. It might or might not already exist
         //
@@ -317,7 +317,7 @@
         // Save the new map state
         //
         $layer->ForceRefresh();
-        $map->Save($resourceSrvc);
+        $map->Save();
 
         //build report message
         $title = GetLocalizedString( "BUFFERREPORTTITLE", $locale );

Modified: sandbox/jng/v30/Web/src/mapviewerphp/legend.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/legend.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/legend.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -79,8 +79,8 @@
 
         //Load the map runtime state.
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
 
         $layerMap = null;
         $tree = BuildLayerTree($map, $resourceSrvc);

Modified: sandbox/jng/v30/Web/src/mapviewerphp/mapframe.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/mapframe.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/mapframe.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -82,10 +82,10 @@
 
         $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
 
-        $map = new MgMap();
+        $map = new MgMap($site);
         $resId = new MgResourceIdentifier($mapDefinition);
         $mapName = $resId->GetName();
-        $map->Create($resourceSrvc, $resId, $mapName);
+        $map->Create($resId, $mapName);
 
         //create an empty selection object and store it in the session repository
         $sel = new MgSelection($map);

Modified: sandbox/jng/v30/Web/src/mapviewerphp/measure.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/measure.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/measure.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -65,8 +65,8 @@
 
         //load the map runtime state and locate the measure layer
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
         $layers = $map->GetLayers();
         $srs = GetMapSrs($map);
 
@@ -209,7 +209,7 @@
 
         if($layer != null)
             $layer->ForceRefresh();
-        $map->Save($resourceSrvc);
+        $map->Save();
     }
     catch(MgException $e)
     {

Modified: sandbox/jng/v30/Web/src/mapviewerphp/quickplotgeneratepicture.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/quickplotgeneratepicture.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/quickplotgeneratepicture.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -84,11 +84,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);
 

Modified: sandbox/jng/v30/Web/src/mapviewerphp/search.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/search.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/search.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -60,11 +60,10 @@
         $site = new MgSiteConnection();
         $site->Open($cred);
         $featureSrvc = $site->CreateService(MgServiceType::FeatureService);
-        $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
 
         //Create a temporary map runtime object, locate the layer
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
         $layers = $map->GetLayers();
         $layer = null;
         for($i = 0; $i < $layers->GetCount(); $i++)
@@ -107,8 +106,7 @@
         $opts = new MgFeatureQueryOptions();
         $opts->SetFilter($filter);
         $featureClassName = $layer->GetFeatureClassName();
-        $srcId = new MgResourceIdentifier($layer->GetFeatureSourceId());
-        $features = $featureSrvc->SelectFeatures($srcId, $featureClassName, $opts);
+        $features = $layer->SelectFeatures($opts);
         $hasResult = $features->ReadNext();
 
         if($hasResult)

Modified: sandbox/jng/v30/Web/src/mapviewerphp/selectwithin.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/selectwithin.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/selectwithin.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -42,12 +42,11 @@
         $site->Open($cred);
         $featureSrvc = $site->CreateService(MgServiceType::FeatureService);
         $renderingSrvc = $site->CreateService(MgServiceType::RenderingService);
-        $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
 
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
 
         $layers = explode(",", $layers);
         if(count($layers) > 0)

Modified: sandbox/jng/v30/Web/src/mapviewerphp/setselection.php
===================================================================
--- sandbox/jng/v30/Web/src/mapviewerphp/setselection.php	2014-06-14 21:47:05 UTC (rev 8219)
+++ sandbox/jng/v30/Web/src/mapviewerphp/setselection.php	2014-06-15 00:22:20 UTC (rev 8220)
@@ -43,8 +43,8 @@
 
         //load the map runtime state
         //
-        $map = new MgMap();
-        $map->Open($resourceSrvc, $mapName);
+        $map = new MgMap($site);
+        $map->Open($mapName);
 
         // Create the selection set and save it
         $sel = new MgSelection($map);



More information about the mapguide-commits mailing list