[mapguide-users] Error: Unable to Make Permanent Changes to Map

Steve Dang steve.dang at autodesk.com
Mon Oct 23 11:54:31 EDT 2006


It's to confirm that the MgMap runtime object can only be stored in a
session and can not be saved to the Library repository.

Steve.

-----Original Message-----
From: Robert Bray [mailto:rbray at robertbray.net] 
Sent: Sunday, October 22, 2006 12:45 AM
To: users at mapguide.osgeo.org
Subject: Re: [mapguide-users] Error: Unable to Make Permanent Changes to
Map

Stephen,

There are two distinctly different object types at play here and I 
suspect you might be confusing them. MapGuide Studio creates what we 
refer to as a MapDefintion. It is defined by an XML document and 
primarily contains a coordinate system, extent, background color, and 
layer and group lists.

The MgMap object represents something slightly different.  MgMap 
represents an instance or run time representation of a MapDefinition. 
Each client through the viewer has it's own copy of an MgMap that is 
usually stored in a session. I'll have to check, but I am not sure an 
MgMap can be saved to the Library repository (that is the software may 
prevent them from being saved in Library://). Like I said I'll need to 
check on that.

Assuming it is allowed, the problem below may be because you are trying 
to save an MgMap using a resource identifier with type 'MapDefinition'. 
Before you go any further however, you should think about whether you 
are really trying to create an MgMap or a MapDefinition.

Hope this helps...
Bob

Stephen Park wrote:
> I am unable to save a map permanently to the repository when the map
has
> been opened via the MgMap.Create(.) API. I have seen 2 or 3 back-posts
about
> this issue but no resolution. Could use some insite. 
>
> Win2k3 Server
> MGOS 1.0.1
> MapGuideDotNetApi
>
> Repro: 
> Open an  existing map via MgMap.Create(.) API 
> 	//Resource Id is of form Library://./MyMap.MapDefinition
> Add layer created previously via Studio 2K7 R1 to the map 
> 	MgMap.GetLayers().Add(newLayer);
> Save the Map back to the repository: 
> 	MgMap.Save(_resourceService, resourceId); 
> 		**Exception Here**
>
> If I use the .Save method that accepts a single argument (resource
service)
> I get a null reference exception. Adding the same layer to the same
map via
> MapGuide Studio works correctly. Any hints?
>
> Exception Information: 
>
> OSGeo.MapGuide.MgXmlParserException: An exception occurred in the XML
> parser.
> - MgResourceServiceHandler.ProcessOperation line 80 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Serv
> iceHandler.cpp
> - MgOpSetResource.Execute line 109 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\OpSetRes
ourc
> e.cpp
> - MgServerResourceService.SetResource line 712 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\ServerRe
sour
> ceService.cpp
> - MgRepositoryManager.SetResource line 867 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Reposito
ryMa
> nager.cpp
> - MgRepositoryManager.UpdateResource line 1004 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Reposito
ryMa
> nager.cpp
> - MgResourceDefinitionManager.UpdateResource line 261 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Defi
> nitionManager.cpp
> - MgResourceContentManager.UpdateDocument line 647 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Cont
> entManager.cpp
> - MgResourceDefinitionManager.UpdateDocument line 601 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Defi
> nitionManager.cpp
> - MgResourceDefinitionManager.ValidateDocument line 429 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Defi
> nitionManager.cpp
> - MgResourceContentManager.ValidateDocument line 536 file
>
c:\build_tux_area\mgdev_opensource\server\src\services\resource\Resource
Cont
> entManager.cpp
>
>
> ---------------------------------------------------------------------
> 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






More information about the Mapguide_users mailing list