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

Jim O'Leary joleary.public at gmail.com
Sat Feb 24 12:28:48 EST 2007


Has there been an answer to this question? Can you save a runtime map to the
repository?

I have a map to which a user can add a new layer to a given layer group
using the browser. My program can save the new layer to the repository using
SetResource(), and can add it to the given layer group in the runtime map.
Is there a way to programmatically save the runtime map with the new layer
to the repository?

Thanks



Robert Bray-2 wrote:
> 
> 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\ResourceServ
>> iceHandler.cpp
>> - MgOpSetResource.Execute line 109 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\OpSetResourc
>> e.cpp
>> - MgServerResourceService.SetResource line 712 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ServerResour
>> ceService.cpp
>> - MgRepositoryManager.SetResource line 867 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\RepositoryMa
>> nager.cpp
>> - MgRepositoryManager.UpdateResource line 1004 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\RepositoryMa
>> nager.cpp
>> - MgResourceDefinitionManager.UpdateResource line 261 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ResourceDefi
>> nitionManager.cpp
>> - MgResourceContentManager.UpdateDocument line 647 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ResourceCont
>> entManager.cpp
>> - MgResourceDefinitionManager.UpdateDocument line 601 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ResourceDefi
>> nitionManager.cpp
>> - MgResourceDefinitionManager.ValidateDocument line 429 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ResourceDefi
>> nitionManager.cpp
>> - MgResourceContentManager.ValidateDocument line 536 file
>> c:\build_tux_area\mgdev_opensource\server\src\services\resource\ResourceCont
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error%3A-Unable-to-Make-Permanent-Changes-to-Map-tf2482437s16610.html#a9135931
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list