From liglio.pessoal at nexxa.com.br Wed Jun 3 10:59:19 2026 From: liglio.pessoal at nexxa.com.br (liglio.pessoal at nexxa.com.br) Date: Wed, 3 Jun 2026 14:59:19 -0300 Subject: [mapguide-users] Modify the map definition and web layout flexible definition of a session Message-ID: Hi, Is it possible to read and modify the map definition and web layout flexible definition of a session ? I tried serveral combinations of map names for the resource ID, with no success. Example:: resourceID = new MgResourceIdentifier("Session:" + sessionId + "//" + "Mapa GIS - Fusion" + "." + MgResourceType.MapDefinition); Regards, Liglio Cavalcante -------------- next part -------------- An HTML attachment was scrubbed... URL: From gordon.luckett at arrowgeomatics.com Wed Jun 3 11:25:42 2026 From: gordon.luckett at arrowgeomatics.com (Gordon Luckett) Date: Wed, 3 Jun 2026 14:25:42 -0400 Subject: [mapguide-users] Modify the map definition and web layout flexible definition of a session In-Reply-To: References: Message-ID: If you have the Session and MapName you should be able to modify the map without needing the MgResourceIdenifier. On Wed, Jun 3, 2026 at 2:06?PM Liglio Cavalcante via mapguide-users < mapguide-users at lists.osgeo.org> wrote: > Hi, > > > > Is it possible to read and modify the map definition and web layout > flexible definition of a session ? > > > > I tried serveral combinations of map names for the resource ID, with no > success. > > Example:: resourceID = new MgResourceIdentifier("Session:" + sessionId + > "//" + "Mapa GIS - Fusion" + "." + MgResourceType.MapDefinition); > > > > Regards, > > > > Liglio Cavalcante > > > _______________________________________________ > mapguide-users mailing list > mapguide-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapguide-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From liglio.pessoal at nexxa.com.br Wed Jun 3 12:51:10 2026 From: liglio.pessoal at nexxa.com.br (liglio.pessoal at nexxa.com.br) Date: Wed, 3 Jun 2026 16:51:10 -0300 Subject: [mapguide-users] RES: Modify the map definition and web layout flexible definition of a session In-Reply-To: References: Message-ID: Hi Gordon, This is part of a code. I have Session and MapName and I can?t read the map object of a session. public class UtilMap : IDisposable private string strSessionMap; private string strMapDefinition; private MgSiteConnection siteConnection; private MgUserInformation userInfo; private MgFeatureService featureService; private MgResourceService resourceService; private MgMap map; private string mapName; private string strTempLayerSufix; /// /// Constructor of class to manipulate the RunTime Mapguide Map /// /// Map Session ID /// Map Library Definition public UtilMap(string pstrSessionMap, string pstrMapDefinition) { try { this.strSessionMap = pstrSessionMap; this.strMapDefinition = pstrMapDefinition; this.strTempLayerSufix = "-" + strSessionMap; this.siteConnection = new MgSiteConnection(); this.userInfo = new MgUserInformation(this.strSessionMap); try { this.siteConnection.Open(this.userInfo); } catch (Exception ex) { throw new Exception("Erro UtilMap SiteConnection Open: " + ex.Message); } this.featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService); this.resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); this.mapName = this.strMapDefinition; // if mapName is empty, I just want to work with session repository, no map session operations if (!string.IsNullOrEmpty(this.mapName)) { this.map = new MgMap(this.siteConnection); try { this.map.Open(this.resourceService, this.mapName); } catch (Exception ex) { throw new Exception("Error UtilMap Map Open: " + ex.Message); } } } catch (Exception ex) { // Cleans internal references, if implemented correctly if (this.siteConnection != null){this.siteConnection.Dispose(); this.siteConnection = null;} if (this.userInfo != null){this.userInfo.Dispose(); this.userInfo = null;} if (this.featureService != null){this.featureService.Dispose(); this.featureService = null;} if (this.resourceService != null){this.resourceService.Dispose(); this.resourceService = null;} if (this.map != null){this.map.Dispose(); this.map = null;} throw new Exception("Error UtilMap criation: pstrSessionMap = " + pstrSessionMap + ", pstrMapDefinition = " + pstrMapDefinition + " :: Mensagem : "+ ex.Message); } } public void SetFusionViewerInitialView(string webLayoutDefinition, double dblX, double dblY, double dblScale) { MgResourceIdentifier resourceID = null; MgByteReader reader = null; string strXml = string.Empty; try { // IT DOES NOT WORK resourceID = this.map.GetMapDefinition(); reader = this.resourceService.GetResourceContent(resourceID); strXml = reader.ToString(); // I CAN NOT FIND THE MAP OBJECT //resourceID = new MgResourceIdentifier("Session:" + this.strSessionMap + "//" + this.mapName + "." + MgResourceType.MapDefinition); resourceID = new MgResourceIdentifier("Session:" + this.strSessionMap + "//" + this.mapName + this.strTempLayerSufix + "." + MgResourceType.MapDefinition); reader = this.resourceService.GetResourceContent(resourceID); strXml = reader.ToString(); } catch (Exception ex) { throw new Exception(System.Reflection.MethodInfo.GetCurrentMethod().Name + "::" + ex.Message); } finally { if (resourceID != null) { resourceID.Dispose(); resourceID = null; } if (reader != null) { reader.Dispose(); reader = null; } } } } Regards, Liglio Cavalcante De: Gordon Luckett Enviada em: quarta-feira, 3 de junho de 2026 15:26 Para: MapGuide Users Mail List Cc: liglio.pessoal at nexxa.com.br Assunto: Re: [mapguide-users] Modify the map definition and web layout flexible definition of a session If you have the Session and MapName you should be able to modify the map without needing the MgResourceIdenifier. On Wed, Jun 3, 2026 at 2:06?PM Liglio Cavalcante via mapguide-users > wrote: Hi, Is it possible to read and modify the map definition and web layout flexible definition of a session ? I tried serveral combinations of map names for the resource ID, with no success. Example:: resourceID = new MgResourceIdentifier("Session:" + sessionId + "//" + "Mapa GIS - Fusion" + "." + MgResourceType.MapDefinition); Regards, Liglio Cavalcante _______________________________________________ mapguide-users mailing list mapguide-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapguide-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From gordon.luckett at arrowgeomatics.com Fri Jun 5 07:45:22 2026 From: gordon.luckett at arrowgeomatics.com (Gordon Luckett) Date: Fri, 5 Jun 2026 10:45:22 -0400 Subject: [mapguide-users] Modify the map definition and web layout flexible definition of a session In-Reply-To: References: Message-ID: Using PHP (sorry my default code) I can get the MapDefinition (from a simple InvokeURL widget - note the lower-case mapname and session) Open($userInfo); $featureService = $siteConnection->CreateService(2); $resourceService = $siteConnection->CreateService(0); $map = new MgMap($siteConnection); $map->Open($mapName); $mapDef = $map->GetMapDefinition(); echo $mapDef->ToString(); $reader = $resourceService->GetResourceContent($mapDef); echo $reader->ToString(); ?> On Wed, Jun 3, 2026 at 3:51?PM wrote: > Hi Gordon, > > > > This is part of a code. I have Session and MapName and I can?t read the > map object of a session. > > > > public class UtilMap : IDisposable > > > > private string strSessionMap; > > private string strMapDefinition; > > private MgSiteConnection siteConnection; > > private MgUserInformation userInfo; > > private MgFeatureService featureService; > > private MgResourceService resourceService; > > private MgMap map; > > private string mapName; > > private string strTempLayerSufix; > > > > /// > > /// Constructor of class to manipulate the RunTime Mapguide Map > > /// > > /// Map Session ID > > /// Map Library Definition > > public UtilMap(string pstrSessionMap, string pstrMapDefinition) > > { > > try > > { > > this.strSessionMap = pstrSessionMap; > > this.strMapDefinition = pstrMapDefinition; > > this.strTempLayerSufix = "-" + strSessionMap; > > > > this.siteConnection = new MgSiteConnection(); > > this.userInfo = new MgUserInformation(this.strSessionMap); > > > > try > > { > > this.siteConnection.Open(this.userInfo); > > } > > catch (Exception ex) > > { > > throw new Exception("Erro UtilMap SiteConnection Open: " + > ex.Message); > > } > > this.featureService = > (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService); > > this.resourceService = > (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); > > > > this.mapName = this.strMapDefinition; > > > > // if mapName is empty, I just want to work with session > repository, no map session operations > > if (!string.IsNullOrEmpty(this.mapName)) > > { > > this.map = new MgMap(this.siteConnection); > > try > > { > > this.map.Open(this.resourceService, this.mapName); > > } > > catch (Exception ex) > > { > > throw new Exception("Error UtilMap Map Open: " + > ex.Message); > > } > > } > > > > } > > catch (Exception ex) > > { > > // Cleans internal references, if implemented correctly > > if (this.siteConnection != > null){this.siteConnection.Dispose(); this.siteConnection = null;} > > if (this.userInfo != null){this.userInfo.Dispose(); > this.userInfo = null;} > > if (this.featureService != > null){this.featureService.Dispose(); this.featureService = null;} > > if (this.resourceService != > null){this.resourceService.Dispose(); this.resourceService = null;} > > if (this.map != null){this.map.Dispose(); this.map = null;} > > > > throw new Exception("Error UtilMap criation: pstrSessionMap = > " + pstrSessionMap + ", pstrMapDefinition = " + pstrMapDefinition + " :: > Mensagem : "+ ex.Message); > > } > > } > > > > public void SetFusionViewerInitialView(string webLayoutDefinition, > double dblX, double dblY, double dblScale) > > { > > MgResourceIdentifier resourceID = null; > > MgByteReader reader = null; > > string strXml = string.Empty; > > try > > { > > // IT DOES NOT WORK > > resourceID = this.map.GetMapDefinition(); > > reader = > this.resourceService.GetResourceContent(resourceID); > > strXml = reader.ToString(); > > > > // I CAN NOT FIND THE MAP OBJECT > > //resourceID = new MgResourceIdentifier("Session:" > + this.strSessionMap + "//" + this.mapName + "." + > MgResourceType.MapDefinition); > > resourceID = new > MgResourceIdentifier("Session:" + this.strSessionMap + "//" + this.mapName > + this.strTempLayerSufix + "." + MgResourceType.MapDefinition); > > reader = > this.resourceService.GetResourceContent(resourceID); > > strXml = reader.ToString(); > > } > > catch (Exception ex) > > { > > throw new > Exception(System.Reflection.MethodInfo.GetCurrentMethod().Name + "::" + > ex.Message); > > } > > finally > > { > > if (resourceID != null) { resourceID.Dispose(); > resourceID = null; } > > if (reader != null) { reader.Dispose(); reader = > null; } > > } > > } > > } > > > > Regards, > > > > Liglio Cavalcante > > > > *De:* Gordon Luckett > *Enviada em:* quarta-feira, 3 de junho de 2026 15:26 > *Para:* MapGuide Users Mail List > *Cc:* liglio.pessoal at nexxa.com.br > *Assunto:* Re: [mapguide-users] Modify the map definition and web layout > flexible definition of a session > > > > If you have the Session and MapName you should be able to modify the map > without needing the MgResourceIdenifier. > > > > > > > > On Wed, Jun 3, 2026 at 2:06?PM Liglio Cavalcante via mapguide-users < > mapguide-users at lists.osgeo.org> wrote: > > Hi, > > > > Is it possible to read and modify the map definition and web layout > flexible definition of a session ? > > > > I tried serveral combinations of map names for the resource ID, with no > success. > > Example:: resourceID = new MgResourceIdentifier("Session:" + sessionId + > "//" + "Mapa GIS - Fusion" + "." + MgResourceType.MapDefinition); > > > > Regards, > > > > Liglio Cavalcante > > > > _______________________________________________ > mapguide-users mailing list > mapguide-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapguide-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: