[mapguide-users] Problem opening a webLayout with predefined
selection
Bruno Scott
bscott at geomapgis.com
Wed Dec 17 04:07:42 EST 2008
I could propose a patch to fix that problem
The idea would be to verify if the Session://...MapDefinition exist
If it already exist, do not overwrite
Something like this
bool mapStateIdExist = true;
MgResourceIdentifier mapStateId = new
MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." +
MgResourceType.Map);
try
{
MgByteReader tmpReader =
resourceSrvc.GetResourceContent(mapStateId);
}
catch(MgException mge)
{
mapStateIdExist = false;
}
Then use the mapStateIdExist flag
//if MapStateId exist, we should not erase the selection
if(!mapStateIdExist)
{
//create an empty selection object and store it in the session
repository
MgSelection sel = new MgSelection(map);
sel.Save(resourceSrvc, mapName);
}
and
//if MapStateId exist, we should not overwrite it
if(!mapStateIdExist)
{
map.Save(resourceSrvc, mapStateId);
}
--
View this message in context: http://www.nabble.com/Problem-opening-a-webLayout-with-predefined-selection-tp21035935p21049538.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list