[Chameleon] Re: SQLQuery widget

Julien-Samuel Lacroix jlacroix at dmsolutions.ca
Wed Jun 22 16:47:20 EDT 2005


Note that you may get faster response via the Chameleon mailing-list. 
And also more help on various subject.

Currently there's no way to access map information in the SQLQuery 
widget. However, it should not be hard to develop a new widget from the 
SQLQuery that will allow keywords in your requests. You may try to use 
the URL values in your query by using the preprocessing tags 
[$var_name|default_value$] though. For example, normally the 
MAP_EXTENT_MINX vairable is usually in the URL. It will give you:
XMIN > [$MAP_EXTENTS_MINX|38.249202$] AND ...

Next, you can use the %INDEX% tag in your BODY section. This will print 
the current row.

On a related note, the Table widget can handle big SQLQuery array by 
using multiple "pages". For example, if your SQLQuery returned 17 rows 
and you only want to show 10 of them in your page, you can use a COUNT 
of 10 in your Table widget and put %NEXT_PAGE% and %PREVIOUS_PAGE% tags 
in the HEADER or FOOTER section. This will add a next and previous 
button that will allow you to navigate your table. For more info, you 
can look at the code or ask the mailing-list.


On 06/22/2005 08:27 AM, Jan Jansen wrote:
> Dear Julien-Samuel,
> thanks a lot for your usefull comments on SQLQuery and Table widgets. I 
> have two additional questions on the code below:
> <cwc2 type="SQLQuery" SQLQUERY ="Select * from ecw where *...*"  
> ="user"   PASSWORD ="password">
>      </cwc2>
>      <cwc2 type="Table" sharedresourcename="SQLQuery" start="0" 
> *count="101*">
>      <TEMPLATE name="HEADER" Content="&lt;Select 
> onchange='changeQuickZoom(this)'&gt;&lt;OPTION VALUE=''&gt;Choose ECW 
> file:&lt;/OPTION&gt;"/>
>      <TEMPLATE name="BODY" Content="&lt;Option 
> value='%XMIN%,%YMIN%;%XMAX%,%YMAX%|epsg:28992'&gt;%IMAGE%&lt;/option&gt;"/>
>      <TEMPLATE name="FOOTER" Content="&lt;/Select&gt;"/>
>      </cwc2>
> Is it possible somehow to pass parameters from the current map view in 
> the SQLQUERY parameter? I want the query to select only the records that 
> fall within the current map view (DB table contains XMIN, XMIN, XMAX , 
> XMAX ) So the query would look something like
> where %MAP_EXTENTS_MAXX% refers to the current MAXX of the map?
> And how do I dynamically address the 'count' attribute in the 
> Table-widget, so it refers to the actual found columns? Ommitting this 
> attribute give back only 10 records in each query...
> Thank you very much in advance,
> Kind regards,
> Jan Jansen

Julien-Samuel Lacroix            jlacroix at dmsolutions.ca
DM Solutions Group               http://www.dmsolutions.ca/

More information about the Chameleon mailing list