<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><P>Hi All,</P>
<P>&nbsp;</P>
<P>&nbsp;Finally i able to manage to get going with <STRONG>Dynamic query task</STRONG> , previously i did some online backup repositries as well as <STRONG>restore</STRONG> and all from MGOS 1.2 and was unable to select features using dynamic query ,but once i removed all the previous versions and installed the MGOS2.0.1 with some modifications in the <STRONG>query.php</STRONG> code as per my previous mail , i able to get going with my Windows Server2003+Php+Apache .</P>
<P>&nbsp;</P>
<P>Don give a try !!</P>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Cheers</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Max !!<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Rahul &lt;unicorn_admirer@yahoo.com&gt;<BR>To: MapGuide Users Mail List &lt;mapguide-users@lists.osgeo.org&gt;<BR>Sent: Thursday, May 29, 2008 10:05:39 AM<BR>Subject: Re: [mapguide-users] Dynamic Query Task Fails in MGOS 2.0.1<BR><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<P>Hi Don,</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Regarding the Dynamic query Task you can change the query.php file in the <U>D:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\phpviewersample\query\classes</U>&nbsp; as there is some change due to the RFC35 and have to use --&gt;</P>
<P>&nbsp;</P>
<P><EM>MgCoordinateSystemFactory::GetTransform should be used instead of the deleted MgCoordinateSystemTransform constructor,</EM></P>
<P>&nbsp;</P>
<P>So your code in the <STRONG>Function Execute</STRONG> will be --</P>
<P>&nbsp;</P>
<P>function Execute()<BR>&nbsp;{<BR>&nbsp;&nbsp;$result = array();</P>
<P>&nbsp;&nbsp;$resourceService = $this-&gt;site-&gt;CreateService(MgServiceType::ResourceService);</P>
<P>&nbsp;&nbsp;$map = new MgMap();<BR>&nbsp;&nbsp;$map-&gt;Open($resourceService, $this-&gt;args['MAPNAME']);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $layer = $map-&gt;GetLayers()-&gt;GetItem($this-&gt;args['LAYERNAME']);</P>
<P>&nbsp;&nbsp;$featureService = $this-&gt;site-&gt;CreateService(MgServiceType::FeatureService);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $resId = new MgResourceIdentifier($layer-&gt;GetFeatureSourceId());<BR>&nbsp;&nbsp;$featureClass = $layer-&gt;GetFeatureClassName();<BR>&nbsp;&nbsp;$featureGeometry = $layer-&gt;GetFeatureGeometryName();</P>
<P>&nbsp;&nbsp;// Initialize the coordinate system transform</P>
<P>&nbsp;&nbsp;$schemaAndClass = explode(":", $featureClass);<BR>&nbsp;&nbsp;$classDef = $featureService-&gt;GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);<BR>&nbsp;&nbsp;$geomProp = $classDef-&gt;GetProperties()-&gt;GetItem($featureGeometry);<BR>&nbsp;&nbsp;$spatialContext = $geomProp-&gt;GetSpatialContextAssociation();</P>
<P>&nbsp;&nbsp;$csTransform = null;<BR>&nbsp;&nbsp;$csInverseTransform = null;<BR>&nbsp;&nbsp;<EM>$coordSysFactory = new MgCoordinateSystemFactory();</EM></P>
<P>&nbsp;&nbsp;$scReader = $featureService-&gt;GetSpatialContexts($resId, false);<BR>&nbsp;&nbsp;while ($scReader-&gt;ReadNext() &amp;&amp; $csTransform == null)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if ($scReader-&gt;GetName() == $spatialContext)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;$source = $coordSysFactory-&gt;Create($scReader-&gt;GetCoordinateSystemWkt());<BR>&nbsp;&nbsp;&nbsp;&nbsp;$target = $coordSysFactory-&gt;Create($map-&gt;GetMapSRS());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>$csTransform=$coordSysFactory-&gt;GetTransform($source, $target);<BR>&nbsp;&nbsp;&nbsp;&nbsp;$csInverseTransform=$coordSysFactory-&gt;GetTransform($target, $source);</STRONG></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;//$csTransform = new MgCoordinateSystemTransform($source, $target);<BR>&nbsp;&nbsp;&nbsp;&nbsp;//$csInverseTransform = new MgCoordinateSystemTransform($target, $source);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</P>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">This allow me to query and get the results but the stranged thing is happening that in one machine with <STRONG>(Windows XP+Apache+PHP)</STRONG> , I can query and select the results while in the other machine with <STRONG>Windows2003+Apache+Php</STRONG>, I can query but unable to select the features and use to get the error in the apache log file.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Uncaught exception 'mgobjectnotfoundexception' in Unknown on line 0,&nbsp;referer:<BR>&nbsp;<A  href="http://10.0.x.xx:8008/mapguide/phpviewersample/query/querymain.php" target=_blank rel=nofollow><FONT color=#0000ff>http://10.0.x.xx:8008/mapguide/phpviewersample/query/querymain.php</FONT></A><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Anyway Don you can give a try and i hope it will work for you if u r using windows XP +Apache+Php..</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Max!!<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Don C. MacGregor &lt;sir_sunkee@yahoo.ca&gt;<BR>To: mapguide-users@lists.osgeo.org<BR>Sent: Wednesday, May 28, 2008 9:08:52 PM<BR>Subject: Re: [mapguide-users] Dynamic Query Task Fails in MGOS 2.0.1<BR><BR><BR>Hi Max,<BR>I was too busy to research so I restored my MGOS 1.2 installation.<BR><BR><BR>max_samart wrote:<BR>&gt; <BR>&gt; Hi All,<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Finally&nbsp; I able to manage toperform search and get results using<BR>&gt; the phpviewersample Query Task after changing few lines of codes from the<BR>&gt; original one, but once i use the Select Button ,it doesn't use to select<BR>&gt; feature and in the Apache Error.log file use to give the following error.<BR>&gt; -------------------------------------------------------------------------------------------------------<BR>&gt; [Wed May 28 16:45:06 2008]
 [error] [client 10.0.x.xx] PHP Fatal error: <BR>&gt; Uncaught exception 'mgobjectnotfoundexception' in Unknown on line 0,<BR>&gt; referer:<BR>&gt; <A  href="http://10.0.x.xx:8008/mapguide/phpviewersample/query/querymain.php" target=_blank rel=nofollow>http://10.0.x.xx:8008/mapguide/phpviewersample/query/querymain.php</A><BR>&gt; --------------------------------------------------------------------------------------------------------<BR>&gt; <BR>&gt; Can anybody tell me how to move forward or can give any kind of idea for<BR>&gt; the possible cause of error.Hey Don have you got going with your custom<BR>&gt; scripts in MGOS2.0.1 ,which was previously working with MGOS1.2.<BR>&gt; Thks<BR>&gt; Max !!<BR>&gt; <BR>&gt; ----- Original Message ----<BR>&gt; From: Rahul &lt;<A href="mailto:unicorn_admirer@yahoo.com" target=_blank rel=nofollow ymailto="mailto:unicorn_admirer@yahoo.com">unicorn_admirer@yahoo.com</A>&gt;<BR>&gt; To: MapGuide Users Mail List &lt;<A
 href="mailto:mapguide-users@lists.osgeo.org" target=_blank rel=nofollow ymailto="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>&gt;<BR>&gt; Sent: Tuesday, May 27, 2008 10:23:57 AM<BR>&gt; Subject: [mapguide-users] Dynamic Query Task Fails in MGOS 2.0.1<BR>&gt; <BR>&gt; <BR>&gt; Hi All,<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I downloaded theMGOS 2.0.1 and tried with the sample<BR>&gt; data-Shebogyan.mgp&nbsp; with&nbsp; the supplied phpviewersample for MGOS2.0.1 ,but<BR>&gt; I unable to perform the query task on the&nbsp; sample data.I am using Win2K3,<BR>&gt; Apache and PHP. Can anybody confirm about this or its just happening on my<BR>&gt; setup or i am missing something/configured something wrong.<BR>&gt;&nbsp; <BR>&gt; Thks<BR>&gt; Max<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; mapguide-users mailing list<BR>&gt; <A
 href="mailto:mapguide-users@lists.osgeo.org" target=_blank rel=nofollow ymailto="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A><BR>&gt; <A href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target=_blank rel=nofollow>http://lists.osgeo.org/mailman/listinfo/mapguide-users</A><BR>&gt; <BR>&gt; <BR><BR>-- <BR>View this message in context: <A href="http://www.nabble.com/Dynamic-Query-Task-Fails-in-MGOS-2.0.1-tp17482346p17513475.html" target=_blank rel=nofollow>http://www.nabble.com/Dynamic-Query-Task-Fails-in-MGOS-2.0.1-tp17482346p17513475.html</A><BR>Sent from the MapGuide Users mailing list archive at <A href="http://nabble.com/" target=_blank rel=nofollow>Nabble.com</A>.<BR><BR>_______________________________________________<BR>mapguide-users mailing list<BR><A href="mailto:mapguide-users@lists.osgeo.org" target=_blank rel=nofollow
 ymailto="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A><BR><A href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target=_blank rel=nofollow>http://lists.osgeo.org/mailman/listinfo/mapguide-users</A><BR></DIV></DIV><BR></DIV></div><br>



      </body></html>