<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.5730.11" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi Valerio</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>you have two possibilities: </FONT></DIV>
<DIV><FONT size=2>extend the table plugin to output an extra variable to the
template after a query. In this case the selection will appear
once.</FONT></DIV>
<DIV><FONT size=2>or use tableTrules, to add an extra column in the query result
table, containing the selection coordinate.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Since the coordinates are the same for all the results, I
think the first option is better, but feel free to experiment ^_^</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>option 1:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>create a new plugin,</FONT></DIV>
<DIV><FONT size=2><PRE class=programlisting>class ClientMyProjectTables extends ClientTables {</PRE><PRE class=programlisting> $coordinates;
public function replacePlugin() {
return 'tables';
}
public function handleHttpPostRequest($request) {<BR><DIV><FONT size=2> if (isset($request['selection_coords']) {</FONT></DIV><DIV><FONT size=2> $this->coordinates = $request['selection_coords'];</FONT></DIV><DIV><FONT size=2> }</FONT><BR> }</DIV><DIV> </DIV><DIV><FONT face=Arial> protected function renderFormPrepare() {<BR> <BR> $smarty = new Smarty_Plugin($this->getCartoclient(), $this);<BR> $smarty->assign('tables', $this->tableGroups);</FONT></DIV><DIV><FONT face=Arial></FONT> </DIV><DIV><FONT face=Arial> $smarty->assign('queryCoordinates', $this-><FONT face="Courier New">coordinates</FONT>);<BR> <BR> $this->assignExportCsv($smarty);<BR> <BR> return $smarty->fetch('tables.tpl');<BR> }</FONT></DIV><DIV>}</DIV></PRE></FONT></DIV>
<DIV><FONT size=2>and, if it is not already donw, overload the table template in
your project (copy tables.tpl in /yourproject/coreplugins/tables/templates/) and
add the new smarty variable inside {$queryCoordinates}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>option 2:</FONT></DIV>
<DIV><FONT size=2>to add extra info in a query result, you can use the
tableRules system in cartoweb.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>basically, it is a special kind of plugin that contain query
result modifications</FONT></DIV>
<DIV><FONT size=2>I have attached an exemple file, containing a basic
modification (adding a html link in the query result table)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>in the initialize() function, you define the type of action.
In the exemple "addCellFilter" which will add new data in an extra cell in each
row of the query result table . For a complet list of possible action,
see: <A
href="http://www.cartoweb.org/doc/cw3.3/xhtml/dev.newplugin.html#dev.newplugin.special.tables">http://www.cartoweb.org/doc/cw3.3/xhtml/dev.newplugin.html#dev.newplugin.special.tables</A></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><PRE class=programlisting>public function addCellFilter($groupId, $tableId, $columnId,
$inputColumnIds, $callback)</PRE><PRE class=programlisting>$groupId is usualy 'query', $tableId is the name of the layer queried, $columnId is the name of the column, $inputColumnIds is an array containing the IDs of the columns you want to have at disposal when applying modification, $callback is an array containing a reference to the current tableRule class and the function where the modification will be done.</PRE><PRE class=programlisting>this modification function must be declared static public. It receive as parameters ($tableId, $columnId, $inputValues)</PRE><PRE class=programlisting>$tableId and $columnId are the same as described above. $inputValues is an associative array containing the values of the selected columns you passed with $inputColumnIds.</PRE><PRE class=programlisting>then you can simply generate the content of the new cell. For exemple recovering the selection coordinates as I told you in my last email.</PRE></DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE dir=ltr
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=valerionoti@yahoo.it href="mailto:valerionoti@yahoo.it">Valerio
Noti</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=oliver.christen@camptocamp.com
href="mailto:oliver.christen@camptocamp.com">Oliver Christen</A> ; <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> Friday, February 09, 2007 9:53
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Cartoweb-users] retrieve
map coordinates with query tool</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Oliver,</FONT></DIV>
<DIV><FONT face=Arial size=2>I added:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT size=2>if (isset($request['selection_coords']) {</FONT></DIV>
<DIV><FONT size=2> $this->coordinates =
$request['selection_coords'];</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV> </DIV>
<DIV>in handleHttpPostRequest in
coreplugins/query/client/ClientQuery.php file (is the right file?)</DIV>
<DIV> </DIV>
<DIV>How can I call coordinates string from tables.tpl file if I want to
display them with other query results?</DIV>
<DIV> </DIV>
<DIV>Thank you</DIV>
<DIV> </DIV>
<DIV>Valerio</DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>/*<BR>Valerio Noti<BR><A
href="mailto:valerionoti@yahoo.it">valerionoti@yahoo.it</A><BR>*/</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=oliver.christen@camptocamp.com
href="mailto:oliver.christen@camptocamp.com">Oliver Christen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=valerionoti@yahoo.it
href="mailto:valerionoti@yahoo.it">Valerio Noti</A> ; <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> Thursday, February 08, 2007 7:42
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Cartoweb-users] retrieve
map coordinates with query tool</DIV>
<DIV><BR></DIV>
<DIV><FONT size=2>Hi Valerio,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>yes, each query return the coordinate of the point or
selection on the map.</FONT></DIV>
<DIV><FONT size=2>you can retrieve the data from the
handleHttpPostRequest ( or filterPostRequest, depending what you want to do
with the values)</FONT></DIV>
<DIV><FONT size=2>the variable name is "selection_coords"</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>for exemple, in handleHttpPostRequest :</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>if (isset($request['selection_coords']) {</FONT></DIV>
<DIV><FONT size=2> $this->coordinates =
$request['selection_coords'];</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>or in filterPostRequest :</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>if ($request->getValue('selection_coords') &&
!empty($request->getValue('selection_coords'))) {</FONT></DIV>
<DIV><FONT size=2> this->coordinates =
$request->getValue('selection_coords');</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>the coordinates are a string like this 'x,y' for point or
'xmin,ymin;xmax,ymax;...' for box</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</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=valerionoti@yahoo.it href="mailto:valerionoti@yahoo.it">Valerio
Noti</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, February 07, 2007
3:23 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Cartoweb-users] retrieve
map coordinates with query tool</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>hello,</FONT></DIV>
<DIV><FONT face=Arial size=2>is it possible to retrieve map coordinates
where user clicked with query tool?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Valerio</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>/*<BR>Valerio Noti<BR><A
href="mailto:valerionoti@yahoo.it">valerionoti@yahoo.it</A><BR>*/</DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing list<BR><A
href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</A><BR><A
href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</A><BR></BLOCKQUOTE>
<P>
<HR>
<P></P>No virus found in this incoming message.<BR>Checked by AVG Free
Edition.<BR>Version: 7.5.432 / Virus Database: 268.17.29/673 - Release Date:
06/02/07 17.52<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>