MCPcopy Create free account
hub / github.com/MapServer/MapServer / FLTPreParseFilterForAlias

Function FLTPreParseFilterForAlias

mapogcfilter.c:3404–3441  ·  view source on GitHub ↗

/ FLTPreParseFilterForAlias */ / Utility function to replace aliased' attributes with their */ real name. */ /

Source from the content-addressed store, hash-verified

3402/* real name. */
3403/************************************************************************/
3404void FLTPreParseFilterForAlias(FilterEncodingNode *psFilterNode,
3405 mapObj *map, int i, const char *namespaces)
3406{
3407 layerObj *lp=NULL;
3408 char szTmp[256];
3409 const char *pszFullName = NULL;
3410
3411#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR)
3412
3413 if (psFilterNode && map && i>=0 && i<map->numlayers)
3414 {
3415 /*strip name speces befor hand*/
3416 FLTStripNameSpacesFromPropertyName(psFilterNode);
3417
3418 lp = GET_LAYER(map, i);
3419 if (msLayerOpen(lp) == MS_SUCCESS && msLayerGetItems(lp) == MS_SUCCESS)
3420 {
3421 for(i=0; i<lp->numitems; i++)
3422 {
3423 if (!lp->items[i] || strlen(lp->items[i]) <= 0)
3424 continue;
3425 snprintf(szTmp, sizeof(szTmp), "%s_alias", lp->items[i]);
3426 pszFullName = msOWSLookupMetadata(&(lp->metadata), namespaces, szTmp);
3427 if (pszFullName)
3428 {
3429 FLTReplacePropertyName(psFilterNode, pszFullName,
3430 lp->items[i]);
3431 }
3432 }
3433 msLayerClose(lp);
3434 }
3435 }
3436#else
3437 msSetError(MS_MISCERR, "OWS support is not available.",
3438 "FLTPreParseFilterForAlias()");
3439
3440#endif
3441}
3442
3443
3444#ifdef USE_LIBXML2

Callers 3

msSLDParseNamedLayerFunction · 0.85
msWFSGetFeatureFunction · 0.85
msSOSGetObservationFunction · 0.85

Calls 7

msLayerOpenFunction · 0.85
msLayerGetItemsFunction · 0.85
msOWSLookupMetadataFunction · 0.85
FLTReplacePropertyNameFunction · 0.85
msLayerCloseFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected