<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="urn:schemas-microsoft-com:office:smarttags">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h4
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.terra, li.terra, div.terra
        {margin:0in;
        margin-bottom:.0001pt;
        line-height:15.0pt;
        font-size:11.0pt;
        font-family:Arial;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I got only a tiny bit further towards my
goal over the last several days regarding my first message below.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regarding 2.) below<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I modified the tpl template and was able
to reformat and place the query results for a layer elsewhere on the page. I
still could not really figure out how to approach creating/or modifying a query
tool to return the attributes for just one selected layer and not all that are
selected in the themes tab.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>From the documentation in Chapter 2.4.2.3 it
seems that I just can use these parameters for a query:<o:p></o:p></span></font></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>Query
plugin<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_layer - layer to look for IDs<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_select - IDs of objects to add to selection<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_unselect - IDs of objects to remove from selection<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_policy - selection policy: 'POLICY_XOR', 'POLICY_UNION' or<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>'POLICY_INTERSECTION',
default is 'POLICY_XOR'<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_maskmode - '0' or '1', default is '0'. If '1', will show selection as a
mask.<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_hilight - '0' or '1', default is '1'. If '0', won't shows selection
hilighted.<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_return_attributes - '0' or '1', default is '1'. If '0', won't return<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>attributes
other than IDs.<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_return_table - '0' or '1', default is '1'. If '0', won't return any table<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>results.<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy;font-style:italic'>o
query_clear - '0' or '1', default is '0'. If '1',<o:p></o:p></span></font></i></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>How can I make a new tool and trigger such
a query. Do I need to create a modified/new plugin?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>For example if I had a list of layers (in
a dropdown box) all that I wanted to be able to run a query on. How would I
trigger a query on the selected layer from a new tool button? I guess
javascript calling php, but how would I get the button from the new plugin to
show up in the template …<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>By the way - Is there a way to retrieve all
layers that have </span></font><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>"id_attribute_string" and<br>
"query_returned_attributes". defined</span></font><font size=2
color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'> somehow?<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Verdana><span style='font-size:11.0pt;font-family:Verdana;
color:navy'>Karsten</span></font><o:p></o:p></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> karsten
vennemann [mailto:karsten@terragis.net] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, November 23, 2007
00:10<br>
<b><span style='font-weight:bold'>To:</span></b> '<st1:PersonName w:st="on">cartoweb-users@lists.maptools.org</st1:PersonName>'<br>
<b><span style='font-weight:bold'>Subject:</span></b> customize query tool and
new tool in general</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<h4><b><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial;
font-weight:normal'>Hi all,<br>
I’m working on customizing the tools for my cartoweb3.4 project. I
started off with the CartoWeb3 Demo and added my data and metadata for the
layers I wanted to enable queries for. However, with this projects
template/set-up the queries always seem to run onto all layers - no matter
whether I check the “query all layers” checkbox. Thus I usually get
an error since some of my layers (which I didn’t configure with metadata
and didn’t intend to use for queries) don’t have values for<br>
"id_attribute_string" and<br>
"query_returned_attributes".<br>
My goal is to have a dropdown list of all queriable layers and the user can
select the layer she wants to query, then click on the map to query by point.
Only the attributes of the user selected layer should be returned and
displayed.<br>
My questions are<br>
1. How and where would I start doing this modification. At this point I’m
not sure whether that functionality is readily available or need some
customization of the query/and table plugin? And as well as for the smarty
template to change the location where the results are displayed?.<br>
2. How would I include a new tool in the template – I guess that would be
a javascript calling a php function? Is there a place where the other tools and
their js code is located?<br>
3. I found the example below in the documentation (
2.4.2.3. Example)– copied below. This seems like a class I could
modify to suit my need and send a request from a new tool to ?<o:p></o:p></span></font></b></h4>
<h4><b><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial;
font-weight:normal'>Cheers<br>
Karsten<o:p></o:p></span></font></b></h4>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The
following class implements a filter which allows to recenter on an object while
hilighting it: <o:p></o:p></span></font></p>
<pre><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>class ClientFilterIdrecenter extends ClientPlugin<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> implements FilterProvider {<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> <o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> public function filterPostRequest(FilterRequestModifier $request) {}<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> <o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> public function filterGetRequest(FilterRequestModifier $request) {<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> <o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $id = $request->getValue('id');<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> if (!is_null($id)) {<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $layer = 'grid_classhilight';<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $request->setValue('query_layer', $layer);<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $request->setValue('query_maskmode', '1');<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $request->setValue('query_select', $id);<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $request->setValue('id_recenter_layer', $layer); <o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> $request->setValue('id_recenter_ids', $id);<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> }<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> }<o:p></o:p></span></font></pre><pre><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>}<o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face=Verdana><span style='font-size:11.0pt;font-family:Verdana'>Karsten </span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face=Arial><span style='font-size:12.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>