Hi Dennis-Jan, I already mentioned on this list that the search functionality is surely a typical field for customizations. I tried to keep the search functions generic. The main reason why there's a distinction between shape and PostGIS layers was based on modifications in Mapserver 4 where the queryByAttribute() could just use 1 field. That's not valid any more but I stayed on that approach.
The search possibilities that you describe are for me really intended for quite advanced users, using the application a bit as a lightweight GIS. In principle one could also allow the user to choose OR/AND selections and you can get quite complex queries. But I think most users not used to complicated query definitions are a bit overloaded with this kind of search tool. Think of Google, just one search entry. So I will stay for the normal p.mapper at the current settings where an administrator predefines the search functions. For me, 2 fields are the maximum I find that make sense. In customized applications I use more fine-grained search functions for single layers, but also pre-defined which fields to search. Typically combined with PostGIS layers because searching a DB is much more flexible and you are not restricted to the somewhat strange query definition in Mapserver (just SQL instead of regex). In pmapper 2 the search functions are created by Javascript. So you will probably have to use XMLHttp requests to get the information via PHP calls or write the search fields at the beginning to JS arrays/objects via PHP. If you would like to provide a more advanced search capability you can post it and I will put it on the server for download. The easiest way to get the fields of a layer in p.mapper is to use the entry from the METADATA "RESULT_FIELDS" definition (combined with the "RESULT_HEADERS" for display of field names to the user). Normally you will just allow queries on fields that are also displayed in the query results, so this approach seems most obvious to me. Otherwise you could define a separate METADATA entry for it. For PostGIS layers you could use a query to system tables, for shapefiles maybe the PHP dBase functions. I guess that in MapScript you only get the field names when you actually query a dataset, ie. the fields are in a resulting array. Best regards Armin DJ Broerse wrote: > Hello Armin > > The migration from 0.9.2 to 1.9.4 is done, with a small amount of > changes. :) > Well I have an idea to improve the searc capabilities of pmapper. > I have a simple screen design included, so it wil give you an impression. > The idea is that the user can dynamicly create a searchquestion, at the > moment the searchquestion is hard coded in the source. > The idea will be improved later, such as searching in different layers > at the same time, but first things first. > > So I am looking for some functions, maybe you say: "you have to look > there, there can you find the requested functions" or maybe "you have to > write the function by yourself but you can use this snippet to accomplish". > I have to collect all the layers from a map and from a layer i have to > collect all the columns from the dbf-files. > I know there is a function getLayers and getLayerName but is there a > function getColumnName or something like that? > > If you like I can contribute it to you when there is a stable version. > > All tips are welcome and Iwill stay in touch. > > With best regards, > > Dennis-Jan > >
