Ejemplo n.º 1
0
 def metadata(self):
     model = get_bod_model(self.lang)
     results = computeHeader(self.mapName)
     query = self.request.db.query(model).filter(model.maps.ilike('%%%s%%' % self.mapName))
     query = self._geodata_staging_filter(query, model.staging)
     query = self._full_text_search(query, [model.fullTextSearch])
     layers = [layer.layerMetadata() for layer in query]
     results['layers'].append(layers)
     return results
Ejemplo n.º 2
0
def metadata(request):
    params = LayersParams(request)
    model = get_bod_model(params.lang)
    query = params.request.db.query(model)
    query = _filter_on_chargeable_attr(params, query, model)
    if params.searchText is not None:
        query = full_text_search(query, [model.fullTextSearch, model.layerBodId, model.idGeoCat], params.searchText)
    results = computeHeader(params.mapName)
    for layer in get_layers_metadata_for_params(params, query, model):
        results["layers"].append(layer)
    return results
Ejemplo n.º 3
0
def metadata(request):
    params = BaseLayersValidation(request)
    model = get_bod_model(params.lang)
    query = params.request.db.query(model)
    query = _filter_on_chargeable_attr(params, query, model)
    if params.searchText is not None:
        query = full_text_search(
            query, [model.fullTextSearch, model.layerBodId, model.idGeoCat],
            params.searchText)
    results = computeHeader(params.mapName, params.srid)
    for layer in get_layers_metadata_for_params(params, query, model):
        results['layers'].append(layer)
    return results
Ejemplo n.º 4
0
 def mapservice(self):
     model = get_bod_model(self.lang)
     results = computeHeader(self.mapName)
     query = self.request.db.query(model)
     query = self._map_name_filter(query, model.maps)
     query = self._geodata_staging_filter(query, model.staging)
     query = self._full_text_search(query, [
         model.fullTextSearch,
         model.idBod,
         model.idGeoCat
     ])
     for q in query:
         layer = q.layerMetadata()
         results['layers'].append(layer)
     return results