[mapguide-users] UpdateFeatures and CLASS_NOTFOUND error
Andrew P
LordBritish2 at gmail.com
Thu Apr 1 08:03:59 EDT 2010
Hi all,
I am attempting to modify a selected feature based on the user input. The
code snippet below occurs after the user has provided the update to the
system. I am getting the following error and can not figure out how to fix
it, 'An exception occurred in FDO component. SDFPROVIDER_75_CLASS_NOTFOUND
Exception occurred in method MgServerUpdateFeatures.UpdateFeatures at line
97 in file ServerUpdateFeatures.cpp'. It appears to be related to either
the class name provided to the MgUpdateFeatures constructor or the feature
resource provided to UpdateFeatures function. However, since these are
built using the class name and feature resource (respectively) from the
layer on which the selected feature is located I don't understand how it
could not find the class, whatever that is. I am using SFD OSGeo provider
and MapGuide 2.0.
//////////Code Snippet - This is in PHP.//////////////////
setValues(&$values); //This gets the input from the user so it can be used.
$oldDeviceCode = $_POST["BASEDEVICECODE"];
$filter = "EVENT_DESC LIKE '" . $oldDeviceCode . "'";
$properties = new MgPropertyCollection();
//add here the property and value calls
$property = new MgStringProperty('EVENT_TYPE', $values["DeviceType"]);
$properties->Add($property);
$property = new MgStringProperty('EVENT_DESC', $values["DeviceCode"]);
$properties->Add($property);
$property = new MgStringProperty('COMMENTS', $values["SerialNumber"]);
$properties->Add($property);
$property = new MgStringProperty('LATITUDE', $values["LatCoor"]);
$properties->Add($property);
$property = new MgStringProperty('LONGITUDE', $values["LongCoor"]);
$properties->Add($property);
$property = new MgStringProperty('WATER_DPT', $values["Depth"]);
$properties->Add($property);
$property = new MgStringProperty('ISSUE_DATE', $values["ManDate"]);
$properties->Add($property);
$property = new MgStringProperty('MAINT', $values["ServiceDate"]);
$properties->Add($property);
$property = new MgStringProperty('RT_TTL_DST', $values["CumDist"]);
$properties->Add($property);
$property = new MgStringProperty('LINE_SEG', $values["Segment"]);
$properties->Add($property);
$property = new MgStringProperty('LINE_NAME', $values["SpanName"]);
$properties->Add($property);
$property = new MgStringProperty('CBL_TYPE', $values["CableType"]);
$properties->Add($property);
$property = new MgStringProperty('CBL_ID', $values["CableCode"]);
$properties->Add($property);
$mapName = $_POST['MAPNAME'];
$mgSessionId = $_POST['SESSION'];
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
$resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
$map = new MgMap();
$map->Open($resourceService, $mapName);
$layers = $map->GetLayers();
$layer = $layers->GetItem("Repeaters");
$className = $layer->GetName();
$resource = $layer->GetFeatureSourceId();
$featureSource = new MgResourceIdentifier($resource);
$commands = new MgFeatureCommandCollection();
$updateCommand = new MgUpdateFeatures($className, $properties, $filter);
$commands->Add($updateCommand);
$temp = new MgPropertyCollection();
$temp = $featureService->UpdateFeatures($featureSource, $commands, false);
echo $temp->GetItem(0)->GetValue();
--
-Andrew
--
View this message in context: http://n2.nabble.com/UpdateFeatures-and-CLASS-NOTFOUND-error-tp4836588p4836588.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list