[mapguide-users] RE: Load Procedures via a script examples?

Andy Morsell amorsell at spatialgis.com
Thu Oct 4 12:42:20 EDT 2007


Hi Jim,
The Studio API is .NET only so I don't think you will be able to work with
it directly in PHP. 


Andy 

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Jim O'Leary
Sent: Thursday, October 04, 2007 9:15 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] RE: Load Procedures via a script examples?


Has anyone got a PHP version of the loadprocedure code below? The first
problem is that PHP can't load the dll. This code finds the dll:

// from php\ext directory...
dl('..\..\..\..\Autodesk\MapGuideStudio2007\Autodesk.MapGuide.Studio.Load.dl
l');

...but PHP replies:

Warning: dl() [function.dl]: Invalid library (maybe not a PHP library)

Adding the Studio directory to the path does not help.

Thanks

Bill Dhimitri wrote:
> 
> Scott,
> 
> I think you are asking about using the MG Studio API that allows you 
> to programmatically load an SDF, SHP, DWF, or raster file directly to 
> a MG server.
> 
> I have pasted some code below to show a simple example of how to use 
> this API.  Just to clarify, the Studio API allows you to create a 
> package (.mgp) file (via the PackageWriter class).  That's not what I 
> am talking about.  I am talking about classes like SdfLoadProcedure 
> and ShpLoadProcedure.  These classes do not create .mgp files.  
> Instead, they provide a programmatic way to do what the MG Studio Load 
> Procedure UI's let's you do.
> 
> Note that if you use the Studio API, you must place your .exe file 
> into the MG Studio installation folder and run it from there.  
> Otherwise, your .exe file will not be able to load/run the necessary 
> DLLs, and you will get an error message at run time stating that a 
> module/file could not be found.
> 
> Bill
> 
>         using Autodesk.MapGuide.Studio.Load;
>         using Autodesk.MapGuide.Studio.Site;
> 
>         void Test()
>         {
>             LoadSdfFile("C:\\parcels.sdf");
>         }
> 
>         void LoadSdfFile(string sdfFilePath)
>         {
>             SiteManager siteManager = SiteManager.GetInstance();
>             ConnectionStatus connStatus;
>             SiteConnection siteConn = siteManager.CreateConnection(
>                 "http://localhost/mapguide",
>                 "Author", "author", out connStatus);
>             if (connStatus != ConnectionStatus.Success)
>                 return;
> 
>             SdfLoadProcedure sdfLoading = new SdfLoadProcedure();
>             sdfLoading.SourceFiles.Add(sdfFilePath);
>             sdfLoading.RootPath = "Library://Test";
>             sdfLoading.Execute(siteConn);
>         }
> 
>  
> 
> -----Original Message-----
> From: Jason Birch [mailto:Jason.Birch at nanaimo.ca]
> Sent: Wednesday, August 09, 2006 1:05 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] Load Procedures via a script examples?
> 
> Hi Scott,
> 
> I'm not entirely sure what you're asking.
> 
> I put up a couple sample scripts for making packages from existing 
> server-side resources, and loading the same.  Is that what you're 
> looking for?
> 
> http://tinyurl.com/qesur
> 
> I don't think that anyone has figured out how to build packages 
> externally to Autodesk MapGuide Studio yet.
> 
> My current plan is to load the initial packages through Studio, and 
> then use FME (there is SDF support in 2006GB) to refresh the data 
> source directly in the repository.
> 
> Jason
> 
> -----Original Message-----
> From: Scott Reisdorf [mailto:reisdorf1 at llnl.gov]
> Sent: Wednesday, August 09, 2006 09:33
> To: users at mapguide.osgeo.org
> Subject: [mapguide-users] Load Procedures via a script examples?
> 
> Does anyone have examples of executing a Load Procedure (i.e. loading 
> data from an XML file) via a script?
> I cant seem to find any examples in the Dev Guide on how to do this.  
> Any sample code would be of assistance.
> Thanks,
> 
> -scott
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Load-Procedures-via-a-script-examples--tf2079844s16610
.html#a13043324
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




More information about the mapguide-users mailing list