[mapguide-users] Getting FeatureSource className without Layer
Kenneth Skovhede, GEOGRAF A/S
ks at geograf.dk
Tue Nov 11 04:04:12 EST 2008
I can see that you are looking for the "DescribeSchema" call:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service_8694a4d43db189a32c9b2ec3171e4ece.htm#8694a4d43db189a32c9b2ec3171e4ece
Beware that a resource can have multiple schemas and classes.
Regards, Kenneth Skovhede, GEOGRAF A/S
Greenhough, Jamie skrev:
>
> Hello everyone! I'm trying to find out the className of a
> FeatureSource without referencing a layer. Here's the code I'm using
> so far:
>
>
>
> String realPath =
> Request.ServerVariables["APPL_PHYSICAL_PATH"];
>
> String configPath = realPath + "..\\webconfig.ini";
>
> MapGuideApi.MgInitializeWebTier(configPath);
>
>
>
> // Connect to the site.
>
> MgUserInformation userInfo = new MgUserInformation(sessionId);
>
> MgSiteConnection siteConnection = new MgSiteConnection();
>
> siteConnection.Open(userInfo);
>
>
>
> // Create Resource and Feature Service
>
> MgFeatureService featureService =
> (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
>
>
>
> // Specify the FeatureSource to used for creating the new
> layer
>
> MgResourceIdentifier resId = new
> MgResourceIdentifier("Library://Samples/Sheboygan/Data/Trees.FeatureSource");
>
>
>
> MgFeatureReader featureReader =
> featureService.SelectFeatures(resId, "Schema:Trees", null);
>
>
>
> So the value I need is "Schema:Trees" but I don't want to hardcode
> this value. I can access the Class Name if I get it from a layer, but
> I'm trying to add a LayerDefinition to the repository, and I don't
> have a layer to reference yet. It looks like SchemaName:ClassName. Any
> suggests?
>
> ----Notice Regarding Confidentiality----
> This email, including any and all attachments, (this "Email") is
> intended only for the party to whom it is addressed and may contain
> information that is confidential or privileged. Sierra Systems Group
> Inc. and its affiliates accept no responsibility for any loss or
> damage suffered by any person resulting from any unauthorized use of
> or reliance upon this Email. If you are not the intended recipient,
> you are hereby notified that any dissemination, copying or other use
> of this Email is prohibited. Please notify us of the error in
> communication by return email and destroy all copies of this Email.
> Thank you.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20081111/4222d9d7/attachment.html
More information about the mapguide-users
mailing list