Ticket #24 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Setting displayed attributes on query

Reported by: aboudreault Owned by: aboudreault@…
Priority: P2 Milestone: 1.1
Component: MapServer Version: 1.0.4
Severity: Major Keywords:
Cc: jlacroix@…, dmorissette@…, madair@…, pspencer@…, yassefa@… External ID:
state: Approved Browser: All
Operating System: All

Description

We was searching a way to control the attributes displayed in a query result. After a moment of reflection, we decided to include specifics metadatas names inside the mapfile for displayed attributes. (ie. query_include_items, query_exclude_items and query_[item]_alias for alias) This would follow the approach used in configuring WMS and WFS services. If you have a better prefix in mind than "query_*" then send your ideas along. We decided this solution because we do not want modify any widget for this mapserver feature and we do not want to expose mapfile information to the client (JavaScript?? code) as a good practice for security reasons.(ie. the metadata name for the attributes to be displayed)

Change History

Changed 4 years ago by pagameba

  • version changed from 1.0.3 to 1.0.4
  • milestone changed from 1.0.4 to 1.0.5

Changed 4 years ago by aboudreault

  • cc yassefa@… added

This is almost done. Is anyone can review/comment it for commiting to the trunk? At the moment it's commited into aboudreault sandbox. Only /MapServer/php/Query.php is the file modified for this ticket.

Changed 4 years ago by jfournier

I have checked out your sandbox and have the MapServer standard sample working. Do you have some basic instructions on how I should be testing this new functionality? I see that Query.php is getting called:

{"hasSelection":true,"layers":park?,"park":{"featureCount":2},"queryFile":"d:/ms4w/tmp/sess_47f0ffc815ff3

/query.qry"}

so it's working. I'm just unsure of how to configure the results. What's the metadata syntax for queryable items?

Changed 4 years ago by anonymous

Alan,

I personally like the idea. I think this same meta data idea could be extended to add things like _item_type (and maybe validity) to allow building a more "intelligent" search widget for MapServer. I do not any reason not to commit this.

Changed 4 years ago by pagameba

(In [1354]) Re #24, minor reformatting for code style consistency.

Changed 4 years ago by pagameba

  • state changed from New to Approved
  • milestone changed from 1.0.5 to 1.1

Alan, I've reviewed and the changes look fine. I've updated Query.php with some minor formatting changes:

  • I would like to keep bracketing consistent and most of fusion uses the style of keeping the opening { bracket on the same line as the code that starts the block
  • I prefer that all blocks be bracketed so I've added them around one-line if statements even though they aren't strictly required.

Please feel free to commit to trunk referencing this ticket. Along with this commit, I would like you to update the wiki with docs on how to use this new feature.

Changed 4 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

(In [1361]) closes #24: setting displayed attributes on query

Note: See TracTickets for help on using tickets.