46 | | The following projects in `Oem` will be removed: |
47 | | |
48 | | * `Oem/SwigEx` |
49 | | * `Oem/SQLite` |
50 | | |
51 | | Vanilla SWIG is now a build requirement. On Windows, pre-compiled binaries of the expected version of SWIG will be provided for convenience. |
| 48 | The following projects/directories will be removed as a result of being obsoleted by this new bindings: |
| 49 | |
| 50 | * `Oem/SwigEx` (SWIG will now be acquired externally through official channels and is assumed to exist before building) |
| 51 | * `Oem/SQLite` (Proof-of-concept SWIG binding to SQLite and legacy Web API test administration tools) |
| 52 | * `BuildTools/CC.Net` (unused CI configuration) |
| 53 | * `BuildTools/WebTools/IMake` (relocated to new top-level `Bindings` directory) |
| 54 | * `Web/src/JavaApi` (legacy "crufty" Java binding) |
| 55 | * `Web/src/JavaApiEx` (legacy "non-crufty" Java binding) |
| 56 | * `Web/src/PhpApi` (legacy PHP 5.6 binding) |
| 57 | * `Web/src/PhpMapGuideApiEnvConfig` (support library for the legacy PHP 5.6 binding) |
| 58 | |
| 59 | Vanilla SWIG is now a build requirement. On Windows, pre-compiled binaries of the expected version of SWIG will be provided for convenience. On Linux, the build scripts will acquire and build SWIG source from the github repo if the expected version of SWIG is not present. |
66 | | * Refer to the table below for how to migrate your exception handling code for your target language |
67 | | |
68 | | [TODO: Insert before/after table] |
| 81 | * If you used to catch specific `MgException` subclass types, refer to the example below for how to migrate your exception handling code for your target language |
| 82 | |
| 83 | Before (PHP): |
| 84 | {{{#!php |
| 85 | try { |
| 86 | ... |
| 87 | } catch (MgUnauthorizedAccessException $e) { |
| 88 | ... |
| 89 | } |
| 90 | }}} |
| 91 | |
| 92 | After (PHP): |
| 93 | {{{#!php |
| 94 | try { |
| 95 | ... |
| 96 | } catch (MgException $e) { |
| 97 | if ($e->GetExceptionCode() == MgExceptionCodes::MgUnauthorizedAccessException) { |
| 98 | ... |
| 99 | } |
| 100 | } |
| 101 | }}} |
| 102 | |
| 103 | Before (Java): |
| 104 | {{{#!java |
| 105 | try { |
| 106 | ... |
| 107 | } catch (MgUnauthorizedAccessException e) { |
| 108 | ... |
| 109 | } |
| 110 | }}} |
| 111 | |
| 112 | After (Java): |
| 113 | {{{#!java |
| 114 | try { |
| 115 | ... |
| 116 | } catch (MgException e) { |
| 117 | if (e.getExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException) { |
| 118 | ... |
| 119 | } |
| 120 | } |
| 121 | }}} |
| 122 | |
| 123 | Before (C#/.net): |
| 124 | {{{#!csharp |
| 125 | try { |
| 126 | ... |
| 127 | } catch (MgUnauthorizedAccessException e) { |
| 128 | ... |
| 129 | } |
| 130 | }}} |
| 131 | |
| 132 | After (C#/.net): |
| 133 | {{{#!csharp |
| 134 | try { |
| 135 | ... |
| 136 | } catch (MgException e) { |
| 137 | if (e.GetExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException) { |
| 138 | ... |
| 139 | } |
| 140 | } |
| 141 | }}} |
| 142 | |
| 143 | After (C#/.net alternative method): |
| 144 | {{{#!csharp |
| 145 | try { |
| 146 | ... |
| 147 | } catch (MgException e) when (e.GetExceptionCode() == MgExceptionCodes.MgUnauthorizedAccessException) { |
| 148 | ... |
| 149 | } |
| 150 | }}} |
| 163 | In addition to the above changes, several public APIs are renamed specifically in the PHP binding to avoid incompatible signatures due to how overloaded/inherited methods are handled in PHP 8. |
| 164 | |
| 165 | `MgCoordinateSystemMeasure` |
| 166 | |
| 167 | The following method signatures in `MgCoordinateSystemMeasure` are renamed with a `Simple` suffix added. |
| 168 | |
| 169 | * `double GetDistance(double x1, double y1, double x2, double y2)` (now called `GetDistanceSimple`) |
| 170 | * `double GetAzimuth(double lon1, double lat1, double lon2, double lat2)` (now called `GetAzimuth`) |
| 171 | * `MgCoordinate GetCoordinate(double lon, double lat, double azimuth, double distance)` (now called `GetCoordinateSimple`) |
| 172 | |
| 173 | `MgMap` |
| 174 | |
| 175 | The new overload of `Create` introduced in [wiki:MapGuideRfc157 MapGuide RFC 157] has been renamed to `CreateStateless` |
| 176 | |
85 | | This wrapper is based on and replaces the previous `MapGuideJavaApiEx` variant of the official Java binding (first introduced in [wiki:MapGuideRfc129]) and is once again called `MapGuideApi.jar` |
| 179 | The new Java binding carries all the enhancements from the previous `MapGuideJavaApiEx` binding, whose changes will be repeated here: |
| 180 | |
| 181 | All method names now adopt `camelCase` instead of `PascalCase` to match Java naming conventions. |
| 182 | |
| 183 | Proxies for various collection classes implement the `java.util.Collection` interface allowing for greater interoperability with existing Java code that works with such interfaces: |
| 184 | |
| 185 | These classes include: |
| 186 | |
| 187 | * `MgClassDefinitionCollection` (as `Collection<MgClassDefinition>`) |
| 188 | * `MgFeatureSchemaCollection` (as `Collection<MgFeatureSchema>`) |
| 189 | * `MgPropertyDefinitionCollection` (as `Collection<MgPropertyDefinition>`) |
| 190 | * `MgPropertyCollection` (as `Collection<MgProperty>`) |
| 191 | * `MgStringCollection` (as `Collection<java.lang.String>`) |
| 192 | * `MgLayerCollection` (as `Collection<MgLayerBase>`) |
| 193 | * `MgLayerGroupCollection` (as `Collection<MgLayerGroup>`) |
| 194 | |
| 195 | The following collection classes do not implement the `java.util.Collection` interface due to disparity in interface and implementation |
| 196 | |
| 197 | * `MgIntCollection` (`int` is not an object in Java) |
| 198 | * `MgBatchPropertyCollection` (can't implement as `Collection<MgPropertyCollection>` due to a different `contains()` API) |
| 199 | |
| 200 | The following proxy classes implement `java.util.Iterable` |
| 201 | |
| 202 | * `MgReadOnlyLayerCollection` |
| 203 | |
| 204 | Classes that implement `java.util.Collection` or `java.lang.Iterable` can be iterated with java's enhanced for loop like so: |
| 205 | |
| 206 | {{{#!java |
| 207 | MgClassDefinitionCollection classes = ... |
| 208 | for (MgClassDefinition clsDef : classes) { |
| 209 | ... |
| 210 | } |
| 211 | }}} |
| 212 | |
| 213 | As a result of adopting `camelCase` naming conventions along with some classes implementing special Java interfaces, various methods in the MapGuide API have been renamed specifically for Java: |
| 214 | |
| 215 | * The converted `MgException.getStackTrace()` conflicts with `java.lang.Throwable.getStackTrace()` |
| 216 | * The converted `MgPropertyDefinition.delete()` conflicts with the SWIG-generated `delete()` method for finalization |
| 217 | * The converted `MgClassDefinition.delete()` conflicts with the SWIG-generated `delete()` method for finalization |
| 218 | * The converted `MgFeatureSchema.delete()` conflicts with the SWIG-generated `delete()` method for finalization |
| 219 | * The converted `add()` method of any MapGuide collection class conflicts with the `add()` method as specified in the `java.util.Collection` interface (MapGuide's `add()` returns `void`, `java.util.Collection`'s `add()` returns `boolean`) |
| 220 | |
| 221 | The conflicting methods are renamed in the wrapper as so: |
| 222 | |
| 223 | * `MgException::getStackTrace()` will become `MgException.getExceptionStackTrace()` |
| 224 | * `MgPropertyDefinition.delete()` will become `MgPropertyDefinition.markAsDeleted()` |
| 225 | * `MgClassDefinition.delete()` will become `MgClassDefinition.markAsDeleted()` |
| 226 | * `MgFeatureSchema.delete()` will become `MgFeatureSchema.markAsDeleted()` |
| 227 | * The `add()` method of any MapGuide collection class implementing `java.util.Collection` will become `addItem()` |
106 | | Ability to target [.net Core/.net 5+] on Linux TBD |
107 | | |
108 | | == Impact summary for deployments == |
| 248 | Refer to deployment impact summary below for remarks around .net deployment. |
| 249 | |
| 250 | As part of this RFC, we will offer experimental support to target [.net Core/.net 5+] on Linux. This is achieved by adding support in our Linux build system for building the "common libs subset". This subset consists of: |
| 251 | |
| 252 | * Internal Thirdparty Libraries |
| 253 | * ACE |
| 254 | * GEOS |
| 255 | * JsonCpp |
| 256 | * Xerces-C |
| 257 | * CS-Map |
| 258 | * MapGuide Common Libraries |
| 259 | * Foundation |
| 260 | * Geometry |
| 261 | * PlatformBase |
| 262 | * MapGuideCommon |
| 263 | * Web Tier common libraries |
| 264 | * HttpHandler |
| 265 | * WebApp |
| 266 | * WebSupport |
| 267 | |
| 268 | Along with the .net SWIG interop glue libraries. Once this subset is built, all the `.so` library files will be copied over to a Windows build environment, where such files will be bundled into the resulting NuGet packages we create for the MapGuide API for .net |
| 269 | |
| 270 | For maximum portability on Linux, the "common libs subset" should be built against internal Thirdparty libraries on a Linux distro with the oldest supported version of glibc. On adoption of this RFC, is is expected that this subset will be built in a CentOS 7 environment. |
| 271 | |
| 272 | For a full end-to-end build of MapGuide for both Windows/Linux, the recommended build order will be: |
| 273 | |
| 274 | 1. Common libs subset on a CentOS 7 environment |
| 275 | 2. Copy/transfer the compiled `.so` libraries from the CentOS 7 environment to the Windows environment |
| 276 | 3. Build MapGuide on Windows |
| 277 | 4. Build MapGuide on supported Linux distros |
| 278 | |
| 279 | Despite now being a `netstandard2.0` library, Mac OSX is not a supported runtime environment |
| 280 | |
| 281 | == Impact summary for deployments (Windows) == |
| 282 | |
| 283 | === PHP === |
| 287 | Barring the required migrations in your PHP codebase, the deployment process/experience should remain the same. |
| 288 | |
| 289 | === Java === |
| 290 | |
| 291 | The bundled version of Tomcat is 9.0.37. Refer to the Tomcat documentation for any migration/configuration/breaking changes from previous Tomcat versions |
| 292 | |
| 293 | === .net === |
| 294 | |
| 295 | The MapGuide web tier installation will still assume the default of IIS and .net Framework 4.8 for the .net configuration. |
| 296 | |
| 297 | If you are intending to deploy an ASP.net core MapGuide application to your MapGuide Web Tier, refer to the [https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-6.0&tabs=visual-studio Microsoft-recommended deployment process] for deploying to IIS |
| 298 | |
| 299 | == Impact summary for deployments (Linux) == |
| 300 | |
| 301 | === PHP === |
| 302 | |
| 303 | Bundled PHP support does not use FastCGI like Windows. It still uses `mod_php` |
| 304 | |
| 305 | === Java === |
| 306 | |
| 307 | The bundled version of Tomcat is 9.0.37. Refer to the Tomcat documentation for any migration/configuration/breaking changes from previous Tomcat versions |
| 308 | |
| 309 | === .net === |
| 310 | |
| 311 | If you are intending to take advantage of the experimental Linux support of the .net binding, you should follow the [https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-apache?view=aspnetcore-6.0 Microsoft-recommended deployment process] for deploying an ASP.net core application to Linux with Apache as the web server, and make the necessary adjustments so that |
| 312 | |