/ msBuildRequestParms */ / Build the params object based on the metadata */ information. This object will be used when building the Get */ and Post requsests. */ Note : Verify the connection string to extract some values */ for backward compatiblity. (It is though depricated). */ This will also
| 62 | /* */ |
| 63 | /************************************************************************/ |
| 64 | static wfsParamsObj *msBuildRequestParams(mapObj *map, layerObj *lp, |
| 65 | rectObj *bbox_ret) |
| 66 | { |
| 67 | wfsParamsObj *psParams = NULL; |
| 68 | rectObj bbox; |
| 69 | const char *pszTmp; |
| 70 | int nLength, i = 0; |
| 71 | char *pszVersion, *pszTypeName = NULL; |
| 72 | |
| 73 | if (!map || !lp || !bbox_ret) |
| 74 | return NULL; |
| 75 | |
| 76 | if (lp->connection == NULL) |
| 77 | return NULL; |
| 78 | |
| 79 | psParams = msWFSCreateParamsObj(); |
| 80 | pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "version"); |
| 81 | if (pszTmp) |
| 82 | psParams->pszVersion = msStrdup(pszTmp); |
| 83 | else |
| 84 | { |
| 85 | pszTmp = strstr(lp->connection, "VERSION="); |
| 86 | if (!pszTmp) |
| 87 | pszTmp = strstr(lp->connection, "version="); |
| 88 | if (pszTmp) |
| 89 | { |
| 90 | pszVersion = strchr(pszTmp, '=')+1; |
| 91 | if (strncmp(pszVersion, "0.0.14", 6) == 0) |
| 92 | psParams->pszVersion = msStrdup("0.0.14"); |
| 93 | else if (strncmp(pszVersion, "1.0.0", 5) == 0) |
| 94 | psParams->pszVersion = msStrdup("1.0.0"); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /*the service is always set to WFS : see bug 1302 */ |
| 99 | psParams->pszService = msStrdup("WFS"); |
| 100 | |
| 101 | /* |
| 102 | pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "service"); |
| 103 | if (pszTmp) |
| 104 | psParams->pszService = msStrdup(pszTmp); |
| 105 | else |
| 106 | { |
| 107 | pszTmp = strstr(lp->connection, "SERVICE="); |
| 108 | if (!pszTmp) |
| 109 | pszTmp = strstr(lp->connection, "service="); |
| 110 | if (pszTmp) |
| 111 | { |
| 112 | pszService = strchr(pszTmp, '=')+1; |
| 113 | if (strncmp(pszService, "WFS", 3) == 0) |
| 114 | psParams->pszService = msStrdup("WFS"); |
| 115 | } |
| 116 | } |
| 117 | */ |
| 118 | |
| 119 | pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "typename"); |
| 120 | if (pszTmp) |
| 121 | psParams->pszTypeName = msStrdup(pszTmp); |
no test coverage detected