| 1 | = !MapGuide RFC 103 - Client needs to get WMS/WFS config info = |
| 2 | |
| 3 | This page contains an change request (RFC) for the !MapGuide Open Source project. |
| 4 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 5 | |
| 6 | |
| 7 | == Status == |
| 8 | |
| 9 | ||RFC Template Version||(1.0)|| |
| 10 | ||Submission Date||(July 13, 2010)|| |
| 11 | ||Last Modified||(Christine Bao Tue July 13 05:23:00 2010)|| |
| 12 | ||Author||Christine Bao|| |
| 13 | ||RFC Status||Ready for Review|| |
| 14 | ||Implementation Status||Not Implemented|| |
| 15 | ||Proposed Milestone||2.3|| |
| 16 | ||Assigned PSC guide(s)||Tom Fukushima|| |
| 17 | ||'''Voting History'''|| |
| 18 | |
| 19 | == Overview == |
| 20 | |
| 21 | This RFC exposes GetDocument() API through HTTP Handler to allow client such as Studio to access WMS/WFS configuration file. |
| 22 | |
| 23 | == Motivation == |
| 24 | |
| 25 | When user uses client application such as Studio to publish WMS/WFS, (s)he wants to use some customized EPSG code which is defined in configuration file. For example, user can define an EPSG code mapping to a WKT if this EPSG code is not supported by MapGuide's coordinate system. |
| 26 | |
| 27 | {{{ |
| 28 | <!-- This definition allows a site to override the behavior of --> |
| 29 | <!-- the SRS= parameter of requests. --> |
| 30 | <!-- Add translate elements here to map any particularly --> |
| 31 | <!-- troublesome SRS to some appropriate WKT. --> |
| 32 | <Define item="SRS.WKT.map"> |
| 33 | <!-- This example fixes a problem with EPSG:21781 not |
| 34 | finding the WKT for EPSG:21781 in the CS library. |
| 35 | --> |
| 36 | <translate from="EPSG:21781">PROJCS["CH1903.LV03/01",GEOGCS["LLCH1903",DATUM["CH-1903",SPHEROID["BESSEL",6377397.155,299.15281535],TOWGS84[660.0770,13.5510,369.3440,0.804816,0.577692,0.952236,5.66000000]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Swiss_Oblique_Cylindrical"],PARAMETER["false_easting",600000.000],PARAMETER["false_northing",200000.000],PARAMETER["latitude_of_origin",46.95240555555556],PARAMETER["central_meridian",7.43958333333333],UNIT["Meter",1.00000000000000]]</translate> |
| 37 | |
| 38 | </Define> |
| 39 | |
| 40 | </Definitions> |
| 41 | }}} |
| 42 | |
| 43 | This EPSG code should be available in Studio for user to choose, however there is no way to get the config infomation so far. This RFC will provide a way to read WMS/WFS config file in client. |
| 44 | |
| 45 | == Proposed Solution == |
| 46 | |
| 47 | There is an API in ServerAdminService which can get the information.[[BR]] |
| 48 | |
| 49 | {{{ |
| 50 | |
| 51 | MgByteReader* GetDocument(CREFSTRING identifier); |
| 52 | |
| 53 | }}} |
| 54 | [[BR]] |
| 55 | |
| 56 | It's not published through HTTP. A solution is to expose it through HTTP by adding HttpGetDocument in HttpHandler.[[BR]] |
| 57 | |
| 58 | {{{ |
| 59 | #ifndef _S_GET_DOCUMENT_H |
| 60 | #define _S_GET_DOCUMENT_H |
| 61 | |
| 62 | class MgHttpGetDocument : public MgHttpRequestResponseHandler |
| 63 | { |
| 64 | HTTP_DECLARE_CREATE_OBJECT() |
| 65 | |
| 66 | public: |
| 67 | /// <summary> |
| 68 | /// Initializes the common parameters of the request. |
| 69 | /// </summary> |
| 70 | /// <param name="name">Input |
| 71 | /// MgHttpRequest |
| 72 | /// This contains all the parameters of the request. |
| 73 | /// </param> |
| 74 | /// <returns> |
| 75 | /// nothing |
| 76 | /// </returns> |
| 77 | MgHttpGetDocument(MgHttpRequest *hRequest); |
| 78 | |
| 79 | /// <summary> |
| 80 | /// Executes the specific request. |
| 81 | /// </summary> |
| 82 | /// <param name="hResponse">Input |
| 83 | /// This contains the response (including MgHttpResult and StatusCode) from the server. |
| 84 | /// </param> |
| 85 | void Execute(MgHttpResponse& hResponse); |
| 86 | |
| 87 | private: |
| 88 | |
| 89 | STRING m_identifier; |
| 90 | |
| 91 | }; |
| 92 | |
| 93 | #endif |
| 94 | }}} |
| 95 | [[BR]] |
| 96 | Then client can send HTTP request to get the document, for example: http://<IP>/mapguide2011/mapagent/mapagent.fcgi?Operation=GetDocument&Version=1.0.0&Identifier=Wms:OgcWmsService.config |
| 97 | |
| 98 | == Implications == |
| 99 | |
| 100 | This new added API won't affect existing application. |
| 101 | |
| 102 | == Test Plan == |
| 103 | |
| 104 | Test publish WMS/WFS in Studio, checking the customized EPSG code is available. |
| 105 | |
| 106 | == Funding/Resources == |
| 107 | |
| 108 | Supplied by Autodesk. |