[mapguide-commits] r9953 - in sandbox/jng/vanilla_swig: . Bindings Bindings/src/Bindings Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Aug 9 09:39:12 PDT 2022


Author: jng
Date: 2022-08-09 09:39:11 -0700 (Tue, 09 Aug 2022)
New Revision: 9953

Added:
   sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom/
   sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom/Localizer.cs
   sandbox/jng/vanilla_swig/clean.bat
Removed:
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/mapadmin/
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/mapviewerphp/
Modified:
   sandbox/jng/vanilla_swig/Bindings/TODO.txt
   sandbox/jng/vanilla_swig/Bindings/src/Bindings/Bindings.sln
   sandbox/jng/vanilla_swig/build.bat
Log:
- Remove monolithic .net binding projects from Bindings.sln. Files to be physically removed at a later time.
- Remove stub mapadmin/mapviewerphp directories as we no longer generate constants.php that would go into these directories.
- Add missing .net implementation of MgLocalizer to our MapGuideCommon .net project
- Copy generated nuget packages to $INSTALL\Web\nuget so a MG installation will always carry these files
- Add helper clean.bat to delete what needs deleting to ensure the next build actually (re-)builds
- Update TODO.txt

Modified: sandbox/jng/vanilla_swig/Bindings/TODO.txt
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/TODO.txt	2022-08-09 14:19:25 UTC (rev 9952)
+++ sandbox/jng/vanilla_swig/Bindings/TODO.txt	2022-08-09 16:39:11 UTC (rev 9953)
@@ -60,12 +60,13 @@
    - [x] Make sure we can throw MgException
    - [ ] Clean MgException stack trace formatting to match its PHP exception counterpart
    - [x] Make sure that caught MgException instances are properly released
-   - [ ] Get our binding building against the NTS (non-thread-safe) profile so it can be used in both IIS and Apache (via mod_fcgid)
-   - [ ] Review the usage of our monkey-patched PHP traits and see whether they're still necessary
-      - [ ] Especially the custom dtor for MgException-derived classes since there is now only one MgException class with no subclasses
+   - [x] Get our binding building against the NTS (non-thread-safe) profile so it can be used in both IIS and Apache (via mod_fcgid)
+   - [x] Review the usage of our monkey-patched PHP traits and see whether they're still necessary
+      - [x] Especially the custom dtor for MgException-derived classes since there is now only one MgException class with no subclasses
    - [~] SKIP: Put all the generated code under a OSGeo\MapGuide namespace
    - [ ] Get it building (Linux)
-   - [ ] Verify test suite still passes (Windows)
+   - [~] Verify test suite still passes (Windows)
+      - There is 1 failing test that sounds inconsequential, but should still be fixed
    - [ ] Verify test suite still passes (Linux)
    - It should be possible to now get rid of constants.php and define our various constants in the PHP extension itself!
       - [x] Pivot IMake to instead generate a SWIG interface file of constant class defns to be included in the main SWIG interface file
@@ -81,15 +82,23 @@
           - Suspect that the 3rd param (MgCoordinateXY) is not passing as its parent (MgCoordinate)
           - Need to setup the same parameter tests in a debuggable PHP script to find out
       
-   - [ ] schemareport
+   - [x] schemareport
    - [x] mapadmin
    - [x] fusion
    - [ ] mapviewernet
+      - It looks like mapviewernet *can* work with the netstandard2.0 package, but there is some setup work required first
+        - [ ] Create a new stub net48 project that consumes the created nuget packages
+        - [ ] Perform a framework-dependent publish of this project as part of build (do this after the .net bindings are built)
+        - [ ] Tools like buffer are throwing "potentially dangerous Request.Form" errors. Need to find the right setting to apply to revert to legacy behavior.
+        - Copy the publish output into the mapviewernet/bin directory on install layout preparation. We expect this to have
+           - The OSGeo.* assemblies
+           - The supporting native dlls
+           - netstandard.dll
      - If raw .aspx files cannot consume our netstandard2.0 package, retian Oem/SwigEx for the purpose of building "legacy" .net bindings
         - ( ) If this is indeed the case, replace the NMake-based .net projects (that call csc.exe) with SDK-style csproj files that target net48
-   - [ ] MapGuide Developer's Guide
+   - [x] MapGuide Developer's Guide
    - [x] viewer samples (PHP)
-   - [ ] viewer samples (Java)
+   - [x] viewer samples (Java)
    - [ ] viewer samples (.net)
      - Give the .net viewer samples the same migration plan as mapviewernet
  - Revise API documentation strategy

Modified: sandbox/jng/vanilla_swig/Bindings/src/Bindings/Bindings.sln
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Bindings/Bindings.sln	2022-08-09 14:19:25 UTC (rev 9952)
+++ sandbox/jng/vanilla_swig/Bindings/src/Bindings/Bindings.sln	2022-08-09 16:39:11 UTC (rev 9953)
@@ -3,18 +3,6 @@
 # Visual Studio Version 17
 VisualStudioVersion = 17.0.31912.275
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DotNetUnmanagedApi", "DotNet\DotNetUnmanagedApi.vcxproj", "{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{795B1B0E-4EC8-469D-B641-E26324266FBF} = {795B1B0E-4EC8-469D-B641-E26324266FBF}
-		{78619D0E-D3F9-4DDF-B90E-F99CB03DFC44} = {78619D0E-D3F9-4DDF-B90E-F99CB03DFC44}
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4} = {F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}
-		{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {B601F04C-0D42-4AFC-A092-B31185E2EA8C}
-		{B797917B-6842-467C-8B14-E00B76A91247} = {B797917B-6842-467C-8B14-E00B76A91247}
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425} = {A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}
-		{5287A594-4D4F-43FE-A281-E279AB708CF1} = {5287A594-4D4F-43FE-A281-E279AB708CF1}
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0} = {D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}
-	EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMake", "..\IMake\IMake.vcxproj", "{B601F04C-0D42-4AFC-A092-B31185E2EA8C}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8B6FBCB3-F11C-4AB9-AEE5-6A272E31EA7F}"
@@ -32,13 +20,6 @@
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {B601F04C-0D42-4AFC-A092-B31185E2EA8C}
 	EndProjectSection
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapGuideDotNetApi", "..\Managed\DotNet\MapGuideDotNetApi\MapGuideDotNetApi.csproj", "{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E} = {FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "monolith", "monolith", "{59509894-F4A9-4C44-8B39-8B5115384DD0}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FoundationApi", "DotNet\Foundation\FoundationApi.vcxproj", "{73C62FF2-C188-4A61-929E-2F112D7E17AA}"
 	ProjectSection(ProjectDependencies) = postProject
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {B601F04C-0D42-4AFC-A092-B31185E2EA8C}
@@ -100,7 +81,6 @@
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {B601F04C-0D42-4AFC-A092-B31185E2EA8C}
 		{B994F673-EB8E-4C65-8884-B56AB8783115} = {B994F673-EB8E-4C65-8884-B56AB8783115}
 		{B797917B-6842-467C-8B14-E00B76A91247} = {B797917B-6842-467C-8B14-E00B76A91247}
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4} = {4A3F2DA2-F53F-48EE-9505-8285F3E089D4}
 		{73C62FF2-C188-4A61-929E-2F112D7E17AA} = {73C62FF2-C188-4A61-929E-2F112D7E17AA}
 		{42FC41FD-742B-4AED-816E-C211F1B07F3F} = {42FC41FD-742B-4AED-816E-C211F1B07F3F}
 	EndProjectSection
@@ -160,12 +140,6 @@
 		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x64.ActiveCfg = Debug|x64
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x64.Build.0 = Debug|x64
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Debug|x86.ActiveCfg = Debug|x64
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x64.ActiveCfg = Release|x64
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x64.Build.0 = Release|x64
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E}.Release|x86.ActiveCfg = Release|x64
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug|x64.ActiveCfg = Debug|x64
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Debug|x86.ActiveCfg = Debug|x64
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.ActiveCfg = Release|x64
@@ -178,14 +152,6 @@
 		{C02F44CB-D916-428D-A1A5-04E225A2A4EC}.Release|x64.ActiveCfg = Release|x64
 		{C02F44CB-D916-428D-A1A5-04E225A2A4EC}.Release|x64.Build.0 = Release|x64
 		{C02F44CB-D916-428D-A1A5-04E225A2A4EC}.Release|x86.ActiveCfg = Release|x64
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Debug|x64.Build.0 = Debug|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Debug|x86.Build.0 = Debug|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Release|x64.ActiveCfg = Release|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Release|x64.Build.0 = Release|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Release|x86.ActiveCfg = Release|Any CPU
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4}.Release|x86.Build.0 = Release|Any CPU
 		{73C62FF2-C188-4A61-929E-2F112D7E17AA}.Debug|x64.ActiveCfg = Debug|x64
 		{73C62FF2-C188-4A61-929E-2F112D7E17AA}.Debug|x64.Build.0 = Debug|x64
 		{73C62FF2-C188-4A61-929E-2F112D7E17AA}.Debug|x86.ActiveCfg = Debug|x64
@@ -389,11 +355,8 @@
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
-		{FDC09E9D-72BB-4C74-B88B-727D9D1D6C4E} = {59509894-F4A9-4C44-8B39-8B5115384DD0}
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C} = {99132700-5CAD-4540-9939-7502C1A448EA}
 		{C02F44CB-D916-428D-A1A5-04E225A2A4EC} = {664329B8-67BD-4D38-AE4B-A2920B038C09}
-		{4A3F2DA2-F53F-48EE-9505-8285F3E089D4} = {59509894-F4A9-4C44-8B39-8B5115384DD0}
-		{59509894-F4A9-4C44-8B39-8B5115384DD0} = {A9257857-9844-4CEA-AF02-A7D8AB8F46AB}
 		{73C62FF2-C188-4A61-929E-2F112D7E17AA} = {025034E6-A625-427B-AA99-5158095ED5F9}
 		{120AC2A9-5EBE-4512-9FF7-54EA04192196} = {025034E6-A625-427B-AA99-5158095ED5F9}
 		{B994F673-EB8E-4C65-8884-B56AB8783115} = {025034E6-A625-427B-AA99-5158095ED5F9}

Added: sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom/Localizer.cs
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom/Localizer.cs	                        (rev 0)
+++ sandbox/jng/vanilla_swig/Bindings/src/Managed/DotNet/OSGeo.MapGuide.MapGuideCommon/custom/Localizer.cs	2022-08-09 16:39:11 UTC (rev 9953)
@@ -0,0 +1,158 @@
+/*
+  Copyright (C) 2004-2011 by Autodesk, Inc.
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of version 2.1 of the GNU Lesser
+  General Public License as published by the Free Software Foundation.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+using System;
+using System.Text;
+using System.Collections;
+using System.IO;
+
+namespace OSGeo.MapGuide
+{
+
+public class MgLocalizer
+{
+    protected static String english = "en";
+    protected static String localizationPath = "";
+    protected static Hashtable languages = new Hashtable();
+
+    public static void SetLocalizedFilesPath(String path)
+    {
+        localizationPath = path;
+    }
+
+    public static String Localize(String text, String locale, int os)
+    {
+        String fontSuffix = (os == 0 ? "Windows" : (os == 1 ? "Macintosh" : "Linux"));
+        Hashtable sb = null;
+        try
+        {
+            sb = GetStringBundle(locale);
+        }
+        catch (Exception)
+        {
+            return "";
+        }
+        int len = text.Length;
+
+        for (int i = 0; i < len; )
+        {
+            int pos1 = text.IndexOf("__#", i);
+            if (pos1 != -1)
+            {
+                int pos2 = text.IndexOf("#__", pos1 + 3);
+                if (pos2 != -1)
+                {
+                    String id = text.Substring(pos1 + 3, pos2 - pos1 - 3);
+                    String locStr;
+                    locStr = (String)sb[id == "@font" || id == "@fontsize" ? id + fontSuffix : id];
+                    if (locStr == null)
+                        locStr = "";
+                    int locLen = locStr.Length;
+
+                    String begin, end;
+                    if (pos1 > 0)
+                        begin = text.Substring(0, pos1);
+                    else
+                        begin = "";
+                    end = text.Substring(pos2 + 3);
+                    text = begin + locStr + end;
+
+                    len = len - 6 - id.Length + locLen;
+                    i = pos1 + locLen;
+                }
+                else
+                    i = len;
+            }
+            else
+                i = len;
+        }
+        return text;
+    }
+
+    public static String GetString(String id, String locale)
+    {
+        Hashtable sb = null;
+        try
+        {
+            sb = GetStringBundle(locale);
+        }
+        catch (Exception)
+        {
+            return "";
+        }
+        String s = (String)sb[id];
+        if (s == null)
+            return "";
+        return s;
+    }
+
+    protected static Hashtable GetStringBundle(String locale)
+    {
+        if (locale.Equals(""))
+            locale = english;
+        else
+            locale = locale.ToLower();
+
+        if (!languages.ContainsKey(locale))
+        {
+            StreamReader sr = null;
+            String fname = localizationPath + locale;
+            try
+            {
+                if (!File.Exists(fname))
+                {
+                    // requested locale is not supported, default to English
+                    if (languages.ContainsKey(english))
+                        return (Hashtable)languages[english];
+                    fname = localizationPath + english;
+                }
+                sr = new StreamReader(fname, Encoding.UTF8);
+                string line;
+                Hashtable sb = new Hashtable();
+                while ((line = sr.ReadLine()) != null)
+                {
+                    line = line.Trim();
+                    if (line.Equals("") || line[0] == '#')
+                        continue;
+                    int sep = line.IndexOf('=');
+                    if (sep == -1)
+                        continue;
+                    String key = line.Substring(0, sep).Trim();
+                    if (key.Equals(""))
+                        continue;
+                    sb[key] = line.Substring(sep + 1).Trim();
+                }
+                languages[locale] = sb;
+            }
+            catch (Exception)
+            {
+                return null;
+            }
+            finally
+            {
+                if (sr != null)
+                {
+                    try { sr.Close(); }
+                    catch (Exception) { }
+                }
+            }
+        }
+        return (Hashtable)languages[locale];
+    }
+
+}
+
+}

Modified: sandbox/jng/vanilla_swig/build.bat
===================================================================
--- sandbox/jng/vanilla_swig/build.bat	2022-08-09 14:19:25 UTC (rev 9952)
+++ sandbox/jng/vanilla_swig/build.bat	2022-08-09 16:39:11 UTC (rev 9953)
@@ -369,6 +369,8 @@
 %XCOPY_SINGLE% "%CD%\packages\Java\%CONFIGURATION%\x64\*.dll" "%MG_OUTPUT_WEB%\Tomcat\bin"
 echo [install]: Web Tier - .net Bindings
 %XCOPY% "%CD%\packages\DotNet\%CONFIGURATION%\netstandard2.0" "%MG_OUTPUT_WEB%\www\mapviewernet\bin"
+if not exist "%MG_OUTPUT_WEB%\nuget" mkdir "%MG_OUTPUT_WEB%\nuget"
+copy /Y "%CD%\packages\DotNet\%CONFIGURATION%\*.nupkg" "%MG_OUTPUT_WEB%\nuget"
 REM Required for Web Tier unit tests
 echo [build]: Web Tier - Clean fusion
 call %ANT% clean -f "%MG_OEM%\fusion\build.xml"

Added: sandbox/jng/vanilla_swig/clean.bat
===================================================================
--- sandbox/jng/vanilla_swig/clean.bat	                        (rev 0)
+++ sandbox/jng/vanilla_swig/clean.bat	2022-08-09 16:39:11 UTC (rev 9953)
@@ -0,0 +1,32 @@
+ at echo off
+echo [clean]: Oem
+if exist Oem\ACE\ACE_wrappers\lib64 rd /S /Q Oem\ACE\ACE_wrappers\lib64
+if exist Oem\ACE\ACE_wrappers\obj64 rd /S /Q Oem\ACE\ACE_wrappers\obj64
+if exist Oem\CppUnit-1.9.14\lib64 rd /S /Q Oem\CppUnit-1.9.14\lib64
+if exist Oem\CppUnit-1.9.14\src\cppunit\Release64 rd /S /Q Oem\CppUnit-1.9.14\src\cppunit\Release64
+if exist Oem\CppUnit-1.9.14\src\obj64 rd /S /Q Oem\CppUnit-1.9.14\src\obj64
+if exist Oem\CsMap\CsMapDev\bin160 rd /S /Q Oem\CsMap\CsMapDev\bin160
+if exist Oem\CsMap\CsMapDev\lib160 rd /S /Q Oem\CsMap\CsMapDev\lib160
+if exist Oem\CsMap\CsMapDev\obj160 rd /S /Q Oem\CsMap\CsMapDev\obj160
+echo [clean]: Packages
+if exist packages\DotNet rd /S /Q packages\DotNet
+if exist packages\Java rd /S /Q packages\Java
+if exist packages\Php rd /S /Q packages\Php
+echo [clean]: Common
+if exist Common\bin rd /S /Q Common\bin
+if exist Common\lib rd /S /Q Common\lib
+if exist Common\obj rd /S /Q Common\obj
+echo [clean]: Server
+if exist Server\bin rd /S /Q Server\bin
+if exist Server\lib rd /S /Q Server\lib
+if exist Server\obj rd /S /Q Server\obj
+echo [clean]: Web
+if exist Web\bin rd /S /Q Web\bin
+if exist Web\lib rd /S /Q Web\lib
+if exist Web\obj rd /S /Q Web\obj
+echo [clean]: Portable
+if exist Portable\bin rd /S /Q Portable\bin
+if exist Portable\lib rd /S /Q Portable\lib
+if exist Portable\obj rd /S /Q Portable\obj
+echo [clean]: Doc
+if exist Doc\MgOpensource_WebAPIReference rd /S /Q Doc\MgOpensource_WebAPIReference
\ No newline at end of file



More information about the mapguide-commits mailing list