<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:courier, monaco, monospace, sans-serif;font-size:8pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div><font size="2"><span style="font-family: courier,monaco,monospace,sans-serif;">Jason,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">I understand what your hinting at and the motivation behind it. Session parameter is the one by means of which a server can, on its own, persist connection specific information, such as layout, map definitin, view related infrmation (extent, zom scale), etc. I know at least two commercially available map servers which use this approach. The client just passes on the session id, and the server is able to recall pertinent infrmation, as long as session has not
 expired. (In that case, actually speaking, the session id is not a long hex number, but rather embeds encoded session information, which gets kicked between client and the server at each interaction). The following app is developed using this technique:<br><br><span><a target="_blank" href="http://www.travelpost.com/EU/France/Other/Paris/map/6216585">http://www.travelpost.com/EU/France/Other/Paris/map/6216585</a></span><br><br style="font-family: courier,monaco,monospace,sans-serif;"></span><span style="font-family: courier,monaco,monospace,sans-serif;">Probably such an approach is not possible in MGOS because it not designed that way. But even without it, it should be possible to bookmark maps using MapAgent parameters in the url, right?</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">Kaarigar</span><br style="font-family:
 courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">==============</span><br style="font-family: courier,monaco,monospace,sans-serif;"></font><br><br>----- Original Message ----<br>From: Jason Birch &lt;Jason.Birch@nanaimo.ca&gt;<br>To: users@mapguide.osgeo.org<br>Sent: Thursday, March 30, 2006 5:21:21 PM<br>Subject: RE: [mapguide-users] MapAgent parameters<br><br><div><br>Is there a way of persist these runtime map definitions?&nbsp;&nbsp;Either in a<br>defined area of the server repository, or as an xml definition in an FDO<br>data store that could be recovered at will?&nbsp;&nbsp;Or some other way (manually<br>iterating all of the session's properties for storage and recovery as<br>needed - ick)?<br><br>I could see using this for something like bookmarks, but I'm also<br>thinking along the lines of providing a "history" tool that would allow<br>users to open a dialog with a scrolling set of thumbnails showing
 their<br>last n queries/zooms/whatever.&nbsp;&nbsp;We've had history lists in the web<br>browser for quite some time, it would be nice to see a graphical history<br>list in a geo browser.<br><br>Jason<br><br>-----Original Message-----<br>From: Trevor Wekel [mailto:trevor.wekel@autodesk.com] <br>Sent: Thursday, March 30, 2006 16:37<br>To: users@mapguide.osgeo.org<br>Subject: RE: [mapguide-users] MapAgent parameters<br><br>Hi Andy, Hi list,<br><br>As you have found out USERNAME, PASSWORD, and SESSION are all valid HTTP<br>request arguments.&nbsp;&nbsp;USERNAME and PASSWORD are not "officially" supported<br>since they are clear text arguments but I am checking with the team to<br>see if we should support it officially.&nbsp;&nbsp;Obviously it is quite useful.<br><br>The SESSION argument is very powerful.&nbsp;&nbsp;When an authenticated user<br>creates a session identifier (through Studio, the Viewers, API, etc), a<br>temporary data store is created for the
 user.&nbsp;&nbsp;This datastore is called<br>the session repository.&nbsp;&nbsp;Virtually anything could be stored there using<br>the MgResourceService APIs - either via HTTP, or via php/aspx/jsp<br>script.&nbsp;&nbsp;The session identifier is a guid similar to<br>"923e3fff-ffff-ffff-8000-005056c00008"<br><br>When a map is displayed through the viewers, a temporary runtime object<br>is created in the session repository for that map.&nbsp;&nbsp;This runtime object<br>can be manipulated from script or HTTP calls to change the view state of<br>the map.&nbsp;&nbsp;The view state includes the visible layers, the scale factor,<br>the map center point, etc.&nbsp;&nbsp;Walt gave a short introduction to modifying<br>the state via HTTP in his email.<br><br>For additional information on modifying the runtime map via script, take<br>a look at the buffer.php/aspx/jsp script in the mapviewerphp/net/java<br>folders.&nbsp;&nbsp;It does some manipulation on MgMap.&nbsp;&nbsp;MgMap is the
 API object<br>that gives access to the runtime map.&nbsp;&nbsp;Here's a short snippet of PHP<br>code with some interesting bits.<br><br>$cred = new MgUserInformation($sessionId);<br><br>$site = new MgSiteConnection();<br>$site-&gt;Open($cred);<br>$resourceSrvc = $site-&gt;CreateService(MgServiceType::ResourceService);<br><br>//load the map runtime state<br>$map = new MgMap();<br>$map-&gt;Open($resourceSrvc, $mapName);<br><br>By default, runtime maps are created at the root of the user's session<br>repository using the basename of the resource identifier for the map.<br>For example, if your map definition is located at<br><br>Library://ProfessionalDeveloper/ExcellentMap.MapDefinition<br><br>Then the $mapName argument should be "ExcellentMap".&nbsp;&nbsp;MgMap.Open will<br>use the session identifier specified in the call to<br>MgSiteConnection.Open.&nbsp;&nbsp;Just as an example, the full resource identifier<br>for the runtime map will be
 "Session:(guid)//ExcellentMap.Map".<br>MgMap.Open creates this resource identifier using the $mapName and<br>sessionId.<br><br>You can use<br><br>$map-&gt;GetLayers()<br><br>to get a list of the layers on the map, manipulate the layers, and then<br>save the new runtime state back to the session repository using<br><br>$map-&gt;Save($resourceSrvc);<br><br><br>The script you are building may also need to "kick" the viewer side to<br>force an update on the map.&nbsp;&nbsp;This is accomplished by sending some<br>JavaScript back in the HTTP response.<br><br>&lt;html&gt;<br>&lt;/body onload="parent.mapFrame.Refresh()"&gt;&lt;/body&gt;<br>&lt;/html&gt;<br><br><br>Selection is stored as a separate object in the session repository under<br>"Session:(guid)//ExcellentMap.Selection"<br><br>Selection can be programmatically accessed and modified via<br><br>MgSelection.Open($resourceSrvc, $mapName);<br>MgSelection.Save($resourceSrvc, $mapName);<br><br><br><br>-----Original
 Message-----<br>From: Andy Morsell [mailto:amorsell@spatialgis.com]<br>Sent: Thursday, March 30, 2006 11:59 AM<br>To: users@mapguide.osgeo.org<br>Subject: RE: [mapguide-users] MapAgent parameters<br><br>Another cool thing I just discovered along these lines.&nbsp;&nbsp;If you have<br>programmatically created a selection object on the server as part of a<br>session, if you pass the SESSION at the URL, it will draw the selection.<br>In this case, since the session is already validated, you do not need to<br>pass username or password nor are you prompted for it.<br><br><br>Andy <br><br>-----Original Message-----<br>From: Jason Birch [mailto:Jason.Birch@nanaimo.ca]<br>Sent: Thursday, March 30, 2006 10:17 AM<br>To: users@mapguide.osgeo.org<br>Subject: RE: [mapguide-users] MapAgent parameters<br><br>Hey,&nbsp;&nbsp;what do you know...&nbsp;&nbsp;<br><br>I tried adding USERNAME=Anonymous to the request and it worked (because<br>the password is blank).&nbsp;&nbsp;I then tried
 adding USERNAME=Administrator and<br>it prompted for authentication.&nbsp;&nbsp;I then tried adding<br>PASSWORD=mysupersecretpassword to the request and this bypassed<br>authentication.<br><br>I had tried this earlier, but guessed USER instead of USERNAME...<br><br>Jason<br><br>-----Original Message-----<br>From: Jason Birch [mailto:Jason.Birch@nanaimo.ca]<br>Sent: Thursday, March 30, 2006 10:06<br>To: users@mapguide.osgeo.org<br>Subject: RE: [mapguide-users] MapAgent parameters<br><br>Thanks James,<br><br>I had thought about that, but passing authentication info in the link is<br>so broken (especially in Internet Explorer:<br><a target="_blank" href="http://support.microsoft.com/kb/834489">http://support.microsoft.com/kb/834489</a>) that it's not really useful.<br>This is just a "nice-to-have" until I get to the point of redeveloping<br>my reports in asp.net or php.&nbsp;&nbsp;I could see it being useful for providing<br>access to map images on sites that do not have one
 of the supported<br>languages installed though.<br><br>Jason<br><br>-----Original Message-----<br>From: James Card [mailto:james.card@calcad.com]<br>Sent: Thursday, March 30, 2006 09:06<br>To: users@mapguide.osgeo.org<br>Subject: Re: [mapguide-users] MapAgent parameters<br><br>On Wed, 29 Mar 2006 20:44:05 -0800, Jason Birch &lt;Jason.Birch@nanaimo.ca&gt;<br>wrote:<br><br>&gt; It's cool to be able to just call something like this: &lt;URL:&nbsp;&nbsp;<br>&gt; <a target="_blank" href="http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE">http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE</a><br>&gt; &amp;VERSION=1.0.0&amp;MAPNAME=Sheboygan&amp;LOCALE=en&amp;MAPDEFINITION=Library%3A%2F<br>&gt; %2FSamples%2FSheboygan%2FMaps%2FSheboygan.MapDefinition&amp;FORMAT=PNG&amp;SET<br>&gt; VIEWCENTERX=-87.73&amp;SETVIEWCENTERY=43.74&amp;SETVIEWSCALE=5000&amp;SETDISPLAYDP<br>&gt; I=300&amp;SETDISPLAYWIDTH=3000&amp;SETDISPLAYHEIGHT=2100<br>&gt;
 &gt;<br>&gt;<br>&gt; It would be nice if I could specify a userid on that line and have the<br><br>&gt; agent authenticate using that user with a blank password.&nbsp;&nbsp;I would be <br>&gt; lazy enough to use this to enhance some existing cold fusion reports.<br><br>You can do this by embedding the user credentials in the URL, like this:<br><br>&lt;URL:<br><a target="_blank" href="http://UserID:Password@localhost/mapguide/mapagent/mapagent.fcgi">http://UserID:Password@localhost/mapguide/mapagent/mapagent.fcgi</a>?...&nbsp;&nbsp;<br>&gt;. However, some browsers block this or prompt the user with a<br>confirmation dialog before submitting the request to the server, so it<br>may still not do exactly what you'd hoped for.<br><br>--<br>James Card<br>California CAD Solutions, Inc.<br>209 578-5580 Voice<br>209 521-6493 FAX<br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org<br>For
 additional commands, e-mail: users-help@mapguide.osgeo.org<br><br><br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org<br>For additional commands, e-mail: users-help@mapguide.osgeo.org<br><br><br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org<br>For additional commands, e-mail: users-help@mapguide.osgeo.org<br><br><br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org<br>For additional commands, e-mail: users-help@mapguide.osgeo.org<br><br><br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org<br>For additional commands, e-mail: users-help@mapguide.osgeo.org<br><br></div></div></div></div></body></html>