<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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:ns0 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR><!--[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 name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[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 vLink=purple link=blue bgColor=#ffffff>
<DIV><FONT size=2>Hi</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>why dont you set <FONT size=3>displayExtendedSelection=true
and customize the template to display a dropdown menu instead of a list of
checkbox ?</FONT></FONT></DIV>
<DIV><FONT size=2>that way you should be able to query only one layer using the
existing query tool</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=karsten@terragis.net href="mailto:karsten@terragis.net">karsten
vennemann</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=cartoweb-users@lists.maptools.org
href="mailto:cartoweb-users@lists.maptools.org">cartoweb-users@lists.maptools.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, November 28, 2007 7:33
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Cartoweb-users] RE: customize
query tool and new tool in general</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Regarding 2.)
below<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">Query
plugin<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">o
query_layer - layer to look for IDs<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">o
query_select - IDs of objects to add to
selection<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">o
query_unselect - IDs of objects to remove from
selection<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">o
query_policy - selection policy: 'POLICY_XOR', 'POLICY_UNION'
or<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">'POLICY_INTERSECTION',
default is 'POLICY_XOR'<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">attributes
other than IDs.<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">results.<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><I><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-STYLE: italic; FONT-FAMILY: Arial">o
query_clear - '0' or '1', default is '0'. If
'1',<o:p></o:p></SPAN></FONT></I></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">By the way - Is there
a way to retrieve all layers that have </SPAN></FONT><FONT face=Arial
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">"id_attribute_string"
and<BR>"query_returned_attributes". defined</SPAN></FONT><FONT face=Arial
color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">
somehow?<o:p></o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><FONT
face=Verdana color=navy size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: navy; FONT-FAMILY: Verdana">Karsten</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; 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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<H4><B><FONT face=Arial size=2><SPAN
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-FAMILY: Arial">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 face=Arial size=2><SPAN
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Cheers<BR>Karsten<o:p></o:p></SPAN></FONT></B></H4>
<P><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; 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 face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">class ClientFilterIdrecenter extends ClientPlugin<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> implements FilterProvider {<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> public function filterPostRequest(FilterRequestModifier $request) {}<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> public function filterGetRequest(FilterRequestModifier $request) {<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $id = $request->getValue('id');<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> if (!is_null($id)) {<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $layer = 'grid_classhilight';<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $request->setValue('query_layer', $layer);<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $request->setValue('query_maskmode', '1');<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $request->setValue('query_select', $id);<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $request->setValue('id_recenter_layer', $layer); <o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> $request->setValue('id_recenter_ids', $id);<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> }<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> }<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></FONT></PRE>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; 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
face=Verdana size=2><SPAN
style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana">Karsten
</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></BLOCKQUOTE></BODY></HTML>