[mapguide-commits] r9857 - in trunk/MgDev/Doc/samples/javasamples: . hello_map interacting_with_layers

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jun 18 03:39:37 PDT 2021


Author: jng
Date: 2021-06-18 03:39:36 -0700 (Fri, 18 Jun 2021)
New Revision: 9857

Modified:
   trunk/MgDev/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp
   trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp
   trunk/MgDev/Doc/samples/javasamples/main.jsp
Log:
#2839: Fix up devguid samples to work against MapGuideApiEx.jar

Modified: trunk/MgDev/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp	2021-06-17 16:49:08 UTC (rev 9856)
+++ trunk/MgDev/Doc/samples/javasamples/hello_map/display_spatial_reference.jsp	2021-06-18 10:39:36 UTC (rev 9857)
@@ -42,7 +42,7 @@
       // --------------------------------------------------//
       // Basic initialization needs to be done every time.
       
-      MapGuideJavaApi.MgInitializeWebTier(webconfigFilePath);
+      MapGuideJavaApiEx.MgInitializeWebTier(webconfigFilePath);
 
       // Get the user information using the session id,
       // and set up a connection to the site server.
@@ -49,7 +49,7 @@
       
       MgUserInformation userInfo = new MgUserInformation(sessionId);
       MgSiteConnection siteConnection = new MgSiteConnection();
-      siteConnection.Open(userInfo);
+      siteConnection.open(userInfo);
 
       // Finished basic initialization.
       // --------------------------------------------------//
@@ -57,12 +57,12 @@
       // Query the spatial reference system used for the map.
       
       MgMap map = new MgMap(siteConnection);
-      map.Open(mapName);
-      String srs = map.GetMapSRS();
+      map.open(mapName);
+      String srs = map.getMapSRS();
       
       // Format it and display it in the task pane.
       
-      out.println("<p>Map <strong>" + map.GetName() + "</strong> uses this reference system: </p>");
+      out.println("<p>Map <strong>" + map.getName() + "</strong> uses this reference system: </p>");
       Integer lineLength = 30;
       out.println("<pre style=\"padding: 2px; border: 1px solid black; background-color: #eee\">");
       while (srs.length() > lineLength)
@@ -76,7 +76,7 @@
     catch (MgException e)
     {
     out.println("<p><strong>Error:</strong> ");
-    out.println(e.GetDetails());
+    out.println(e.getDetails());
     out.println("</p>");
     }
   %>

Modified: trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp	2021-06-17 16:49:08 UTC (rev 9856)
+++ trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/layer_visibility.jsp	2021-06-18 10:39:36 UTC (rev 9857)
@@ -39,7 +39,7 @@
 
     try
     {
-      MapGuideJavaApi.MgInitializeWebTier(webconfigFilePath);
+      MapGuideJavaApiEx.MgInitializeWebTier(webconfigFilePath);
 
       // Get the user information using the session id,
       // and set up a connection to the site server.
@@ -46,21 +46,21 @@
       
       MgUserInformation userInfo = new MgUserInformation(sessionId);
       MgSiteConnection siteConnection = new MgSiteConnection();
-      siteConnection.Open(userInfo);
+      siteConnection.open(userInfo);
 
       MgMap map = new MgMap(siteConnection);
-      map.Open(mapName);
+      map.open(mapName);
 
-      MgLayerCollection layers = map.GetLayers(); // Get layer collection
+      MgLayerCollection layers = map.getLayers(); // Get layer collection
       out.println("<p>Layers, in draw order:</p>");
       out.println("<table class=\"taskPane\" cellspacing=\"0\">");
-      out.println("<tr><th class=\"rowHead\">Layer</th><th>GetVisible()</th><th>IsVisible()</th></tr>");
-      Integer count = layers.GetCount(); 
+      out.println("<tr><th class=\"rowHead\">Layer</th><th>getVisible()</th><th>isVisible()</th></tr>");
+      Integer count = layers.getCount(); 
       for (Integer i = 0; i < count; i++)
       {
-        MgLayer layer = (MgLayer) layers.GetItem(i);
-        out.println("<tr><td class=\"rowHead\">" + layer.GetName() + 
-        "</td><td>" + (layer.GetVisible() ? "on" : "off") + "</td><td>" + (layer.IsVisible() ? "on" : "off") + "</td></tr>\n");
+        MgLayer layer = (MgLayer) layers.getItem(i);
+        out.println("<tr><td class=\"rowHead\">" + layer.getName() + 
+        "</td><td>" + (layer.getVisible() ? "on" : "off") + "</td><td>" + (layer.isVisible() ? "on" : "off") + "</td></tr>\n");
       }
       out.println("</table>");
     }
@@ -67,12 +67,12 @@
     catch (MgException e)
     {
       out.println("<p><strong>Error:</strong> ");
-      out.println(e.GetDetails());
+      out.println(e.getDetails());
       out.println("</p>");
     }
     %>
-    <p><code>GetVisible()</code> returns the state of the visibility flag for a given layer (the check box in the
-      Layers pane). <code>IsVisible()</code> returns the actual visibility of a layer, based on its visibility flag, 
+    <p><code>getVisible()</code> returns the state of the visibility flag for a given layer (the check box in the
+      Layers pane). <code>isVisible()</code> returns the actual visibility of a layer, based on its visibility flag, 
       the visibility flag of any groups that include the layer, and whether the layer has a defined style for the 
     current view scale.</p>
 </body>

Modified: trunk/MgDev/Doc/samples/javasamples/main.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javasamples/main.jsp	2021-06-17 16:49:08 UTC (rev 9856)
+++ trunk/MgDev/Doc/samples/javasamples/main.jsp	2021-06-18 10:39:36 UTC (rev 9857)
@@ -30,36 +30,36 @@
     // Initialize web tier with the site configuration file.  The config
     // file should be in the same folder as this script.
     String configPath =  realpath + "webconfig.ini";
-    MapGuideJavaApi.MgInitializeWebTier( configPath );
+    MapGuideJavaApiEx.MgInitializeWebTier( configPath );
 
     MgUserInformation userInfo = new MgUserInformation("Author", "author");
     MgSite site = new MgSite();
 
-    site.Open(userInfo);
+    site.open(userInfo);
 
-    String sessionId = site.CreateSession();
+    String sessionId = site.createSession();
     String title = "JSP Samples";
     String webLayout = "Library://Samples/Layouts/JavaSamples.WebLayout";
     
     MgSiteConnection siteConn = new MgSiteConnection();
-    siteConn.Open(userInfo);
+    siteConn.open(userInfo);
     
     // We check for the existence of the specified WebLayout 
     //
     // If it doesn't exist, we load a copy from the WebLayout.xml on disk. This is a basic example 
     // of programmatically loading resource content into to the repository.
-    MgResourceService resSvc = (MgResourceService)siteConn.CreateService(MgServiceType.ResourceService);
+    MgResourceService resSvc = (MgResourceService)siteConn.createService(MgServiceType.ResourceService);
     MgResourceIdentifier wlResId = new MgResourceIdentifier(webLayout);
-    if (!resSvc.ResourceExists(wlResId)) {
+    if (!resSvc.resourceExists(wlResId)) {
         String xmlPath =  realpath + File.separator + "/javasamples/WebLayout.xml";
         MgByteSource wlByteSource = new MgByteSource(xmlPath);
-        MgByteReader wlByteReader = wlByteSource.GetReader();
+        MgByteReader wlByteReader = wlByteSource.getReader();
         // NOTE: The Author account generally has write access into the site repository
         // which is why we're doing it like this.
         // If this was an Anonymous user, they can't write into the session repository. We would normally 
         // load our content into a session-based repository and modify $webLayout to point to our 
         // session loaded resource
-        resSvc.SetResource(wlResId, wlByteReader, null);
+        resSvc.setResource(wlResId, wlByteReader, null);
     }
 %>
 <html>



More information about the mapguide-commits mailing list