[mapguide-users] Fusion - one AppDef many maps best approach?

Andy Morsell amorsell at spatialgis.com
Tue May 13 20:22:21 EDT 2008


Paul,
It's all managed in an existing database in MySQL and a PHP application.  I
am doing nothing with MGOS logins.  Basically, the user logs in to the
application and SQL returns the map name.  Because the folder structure in
the library is standardized, the map resource string can be programmatically
assembled based on the site the user is accessing and the specific map name.
I establish an MGOS session based on a global application MGOS user.   

>From there, the Fusion template needs to be opened (within the existing
application framework, in this case as an iframe) with the correct map.
It's very easy to do if I have a flexible layout defined in the repository
for the maps and simply set that as the src for the iframe.  But I don't
want the map authors to have to create a layout for every map as that is
just extra work.  In the end, I just want the single Fusion application
definition on the file system that I can programmatically pump any map into.


Andy 

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Paul Spencer
Sent: Tuesday, May 13, 2008 5:06 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Fusion - one AppDef many maps best approach?

Kenneth, this is close, but I think it is unnecessary overhead to write it
back to the server when you already have the exact info you need on the
client side.

Andy, I'd like to understand how you associate users to maps - is this done
on the server somehow?  How are the maps organized, are they somehow named
or stored in a path that varies only by user name?

Paul

On 13-May-08, at 4:37 PM, Kenneth Skovhede, GEOGRAF A/S wrote:

> Maybe I misunderstood the problem, but wouldn't it be possible to do 
> it like this:
>
> 1. Ask user to log on
> 2. Determine correct map resourceID
> 3. Download ApplicationDefinition Xml from server 4. Update Xml, set 
> resourceID to the one found in step 2.
> 5. Write the Xml back into the session repository 6. Start regular 
> fusion, but point to session ApplicationDefinitio instead
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> Mike Adair skrev:
>> Around line 532 of lib/ApplicationDefinition.js there is an over- 
>> ride of the mapid by a query param.  You should be able to do 
>> something similar there, or else just above that in the 
>> Fusion.Lib.ApplicationDefinition.Map where it extracts the resourceId 
>> from the MapGroup.
>>
>> Patches like this would be welcome.  Just create a ticket first and 
>> attach the patch to it.
>>
>> Mike
>>
>> Andy Morsell wrote:
>>> Thanks for the MapMenu widget possibility.  That may work out okay 
>>> pointing to a library folder, and I'll have to figure out how to 
>>> hide the widget itself from the end-user.
>>>
>>> Yes, having a URL parameter that points to a mapResource would be 
>>> perfect.
>>> I will look at modifying Fusion.  Any quick clues as to which Fusion 
>>> files I should start looking at?
>>>
>>> Thanks again.
>>>
>>>
>>> Andy
>>> -----Original Message-----
>>> From: mapguide-users-bounces at lists.osgeo.org
>>> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Mike 
>>> Adair
>>> Sent: Tuesday, May 13, 2008 11:56 AM
>>> To: MapGuide Users Mail List
>>> Subject: Re: [mapguide-users] Fusion - one AppDef many maps best 
>>> approach?
>>>
>>> Andy,
>>>
>>> Fusion doesn't support that use-case right now although you might be 
>>> able to look at the MapMenu widget to see if that might fit your 
>>> needs, or you may be able to customize it to suit. The MapMenu 
>>> supports loading a list of Map definitions from a MapGuide folder 
>>> resource, i.e point it at a MapGuide Library://some/folder and it 
>>> will enumerate all the MapDefinition items and list them in the 
>>> menu.
>>>
>>> The other approach would be to modify Fusion to accept a 
>>> 'mapResource' URL parameter that would override the ResourceId 
>>> pointer in a MapGroup, in this case the <MapGroup><Map> element in 
>>> AppDef would represent a template.
>>>
>>> Mike
>>>
>>> Andy Morsell wrote:
>>>
>>>> Hi,
>>>> I'm trying to use Fusion on a new project and still wrapping my 
>>>> head around everything.  I have a an application with potentially 
>>>> hundreds of map definitions in the MGOS repository.  I would like 
>>>> ONE Fusion ApplicationDefinition for the entire application.
>>>>
>>>> From what I understand  the map definition must be defined in the 
>>>> ApplicationDefinition.xml file in the MapSet tag, MapGroup 
>>>> container, Map tag.  Further, the MapGroup ID is then referenced by 
>>>> the MapWidget.
>>>>
>>>> To avoid having a huge and difficult to maintain 
>>>> ApplicationDefinition file with all of my maps, what would be the 
>>>> best approach for my needs?  The map will be determined by the 
>>>> application at run-time after the user logs in, and I need to
>>>> then load the Fusion layout with that map (a MGOS map resource).   
>>>> I see that the loadMap() method in the Fusion command API will do 
>>>> what I need, but the map definition must exist in the AppDef first.
>>>>
>>>> Any suggestions are greatly appreciated.  Thank you.
>>>>
>>>> Andy Morsell, P.E.
>>>> Spatial Integrators, Inc.
>>>> _http://www.SpatialGIS.com_
>>>>
>>>> -------------------------------------------------------------------
>>>> ---
>>>> --
>>>>
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>>
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




More information about the mapguide-users mailing list