| 39 | An additioanl OEM component has been added to the source -- jsoncpp. Jsoncpp is a C++ implementation of the JSON specification (http://sourceforge.net/projects/jsoncpp/). |
| 40 | |
| 41 | Two additional classes have been added to assist the JSON implementation in MapGuide: |
| 42 | 1) The MgJsonDoc Class |
| 43 | - MgJsonDoc is a wrapper over the jsoncpp implementation. MgJsonDoc provides many easy-to-use interfaces, such as Begin* and End*, for creating JSON documents from an XML perspective. For example, to create as JSON document for the corresponding XML content---<Node>Text</Node>---, one would call BeginObject("Node"), SetValue("Text"), and EndObject() subsequently. |
| 44 | |
| 45 | 2) The MgXmlJsonConvert Class |
| 46 | - MgXmlJsonConvert converts an XML document into a JSON formatted document. |
| 47 | |
| 48 | The following Web-tier to Server APIs are affected: |
| 49 | |
| 50 | Coordinate System |
| 51 | |
| 52 | # EnumerateCategories (1) |
| 53 | # EnumerateCoordinateSystems (1) |
| 54 | |
| 55 | Resource |
| 56 | |
| 57 | # EnumerateResourceReferences (3) |
| 58 | # EnumerateResources (3) |
| 59 | # GetResourceContent (3) |
| 60 | # GetResourceHeader (3) |
| 61 | # EnumerateResourceData (3) |
| 62 | # GetResourceData (3) |
| 63 | # EnumerateUnmanagedData (3) |
| 64 | |
| 65 | Feature |
| 66 | |
| 67 | # GetFeatureProviders (3) |
| 68 | # GetCapabilities (3) |
| 69 | # GetConnectPropertyValues (1) |
| 70 | # DescribeSchema (4) |
| 71 | # SelectFeatures (2) |
| 72 | # SelectAggregates (1) |
| 73 | # GetSpatialContexts (1) |
| 74 | # GetLongTransactions (1) |
| 75 | # EnumerateDataStores (3) |
| 76 | # GetSchemaMapping (3) |
| 77 | # GetSchemas (1) |
| 78 | # GetClasses (1) |
| 79 | # GetClassDefinition (2) |
| 80 | # GetIdentityProperties (1) |
| 81 | # ExecuteSqlQuery (1) |
| 82 | # GetFdoCacheInfo (4) |
| 83 | |
| 84 | Rendering |
| 85 | |
| 86 | # GetVisibleMapExtent (1) |
| 87 | |
| 88 | where the appended labeling scheme indicates the different implementation considerations: |
| 89 | (1) Web-tier changes -- every ToXml function is matched with an ToJson function implementation that creates a JSON document in place, |
| 90 | (2) Web-tier changes -- utilizes the MgXmlJsonConvert class to convert XML documents to JSON documents. |
| 91 | (3) Server changes -- an extra parameter "CREFSTRING format" has been added to the respective API call; the MgXmlJsonConvert class is used if format equals to the JSON MIME type. |
| 92 | (4) Server changes -- an extra API has been added matching the respective API call (e.g. DescribeSchemaAsXml has DescribeSchemaAsJson as its counter part, and GetFDOCacheInfo has GetFDOCacheInfoAsJson as its JSON specific implementation); this is because the original APIs return "STRING" and could not be efficiently adapted by the conversion process within the MgXmlJsonConvert class implementation; and for the affected APIs, the MgByteReader* is returned instead. |
| 93 | |