[mapguide-users] Getting FeatureSource className without Layer

Jackie Ng jumpinjackie at gmail.com
Mon Nov 10 19:22:48 EST 2008


MgFeatureService has GetSchemas() and GetClasses() methods to help you
enumerate schemas and classes (respectively) of a given feature source.

- Jackie


JamieG wrote:
> 
> 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.FeatureServ
> ice);
> 
>  
> 
>             // Specify the FeatureSource to used for creating the new
> layer
> 
>             MgResourceIdentifier resId = new
> MgResourceIdentifier("Library://Samples/Sheboygan/Data/Trees.FeatureSour
> ce");
> 
>  
> 
>             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
> 
> 

-- 
View this message in context: http://n2.nabble.com/Getting-FeatureSource-className-without-Layer-tp1482792p1483042.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list