[mapguide-users] REST Broken Parts or being Used Incorrectly? Jackie?

Flipper scotth at mpowerinnovations.com
Wed Nov 18 12:30:42 PST 2015


I add this in the mapcontroller.php file from the GITHUB repository (not the
RC2 download)
else if ($featureNode->tagName == "Feature") {
    ...
} else if ($featureNode->tagName == "FDOFilter")
{
try {
	$filter = urldecode($featureNode->nodeValue);
	if ($filter != null) {
		$featSvc = $siteConn->CreateService(MgServiceType::FeatureService);
		$layerFeatureId = $layer->GetFeatureSourceId();
		$layerFeatureResource = new MgResourceIdentifier($layerFeatureId);
		$layerClassName = $layer->GetFeatureClassName();
		$relQuery = new MgFeatureQueryOptions();
		$relQuery->SetFilter($filter);
		$relReader = $featSvc->SelectFeatures($layerFeatureResource,
$layerClassName, $relQuery);
		$sel->AddFeatures($layer, $relReader, 0);
	}
} catch (MgException $ex) {
	throw new Exception($this->app->localizer->getText("E_QUERY_SETUP",
$relFilter, $ex->GetDetails()));
}
//NO CLUE IF I NEED TO DO DISPOSAL TO KEEP MEMORY LOW OR HOW IT WORKS IN PHP
}
It will work in this format
<SelectionUpdate>
    <Layer>
        <Name>g_hydrants</Name>
	<FDOFilter>ogr_fid = 7 OR ogr_fid = 8</FDOFilter>
        <Feature>
             <ID>
                  <Name>ogr_fid</Name>
                  <Value>1</Value>
             </ID>
        </Feature>
        <Feature>
             <ID>
                  <Name>ogr_fid</Name>
                  <Value>2</Value>
             </ID>
        </Feature>
    </Layer>
</SelectionUpdate>
in this scenario it will return 4 records ogr_fid = 7, 8, 1, 2
I haven't fully tested it yet...and I am not a PHP programmer so us at your
own peril.
You can Not include the Feature Portion or the FDOFilter portion of the XML
and it will work

******NOTE: FDOFilter should get URLENCODED in the XML because of special
characters Like < % etc that can be used in an FDO Query



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/REST-Broken-Parts-or-being-Used-Incorrectly-Jackie-tp5236035p5237273.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list