[fusion-users] Problems with starting a new application.
Paul Spencer
pspencer at dmsolutions.ca
Tue May 13 20:23:52 EDT 2008
Tómas,
That's about it. The basic structure of a Widget's javascript file is
pretty straightforward:
/**
* <standard comment header stripped for clarity>
*/
Fusion.Widget.MyWidget = OpenLayers.Class(Fusion.Widget,
Fusion.Tool.ButtonBase, {
/**
* widget attributes are listed here
*/
/*
* Constructor: MyWidget
*
* Parameters:
*
* widgetTag - JSON node for this widget from the Application
definition
*
*/
initialize : function(widgetTag) {
Fusion.Widget.prototype.initialize.apply(this, [widgetTag,
true]);
Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
/* other initialization */
},
/**
* Function: execute
*
* called by ButtonBase when the user clicks the button
*/
execute : function() {
}
});
There are some options for deriving widgets from some common base
classes like ButtonBase that give you some built in behaviour which
would need to be documented as well. And some standard patterns for
doing server side stuff.
The Widget.xml file in widgetinfo is used by MapGuide Studio and also
to generate documentation for the wiki (Thanks Jason) but is not
actually used at runtime.
Cheers
Paul
On 13-May-08, at 9:57 AM, Tómas Guðmundsson wrote:
> Paul,
>
> Thank you very much for this. This totally helped me out.
>
> As I will be continuing the development for Snertill in Iceland
> I hope this can be a place to find answers to my and other
> peoples problems.
>
> To programmatically add a widget. Besides having a Widget.js and
> Widget.xml in the widgets/ and widgetinfo/ folders, what else is
> needed so that Fusion will recognize it?
>
> Thanks very much for your time guys.
> Tomas
>
> -----Original Message-----
> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
> Sent: 13. maí 2008 13:39
> To: Tómas Guðmundsson
> Cc: Kenneth Skovhede, GEOGRAF A/S; fusion-users at lists.osgeo.org
> Subject: Re: [fusion-users] Problems with starting a new application.
>
> Tómas,
>
> If you do not specify ApplicationDefinition= in the url to a template,
> Fusion will assume that you have a file called
> ApplicationDefinition.xml in the same place as your template and will
> automatically attempt to load it. If you do specify
> ApplicationDefinition= then it will look to see if the path starts
> with either Library:// or Session:// - if it does then it will contact
> the mapguide server to load the ApplicationDefinition, otherwise it
> will assume you have pointed it to another file and will attempt to
> load it using HTTP.
>
> You may have more than one MapGroup in your ApplicationDefinition.
> Each one has an ID. The ID is used to match with a MapWidget tag
> inside a WidgetSet. It is perfectly valid to have two (or more)
> WidgetSet tags each having a MapWidget tag that points to a different
> MapGroup. You will find that if you change the ID in the MapGroup,
> you will need to search for the MapWidget tag and update it to match.
>
> Hope this helps!
>
> Cheers
>
> Paul
>
> On 13-May-08, at 9:01 AM, Tómas Guðmundsson wrote:
>
>> Yes, that does help me, thank you very much.
>> However I did find a way to make Fusion read my
>> ApplicationDefinition.xml
>> (by leaving no extra URL parameters like ApplicationDefinition)
>> however, I
>> do not understand how and why. When I modify the MapGroup in the
>> ApplicationDefinition, that if I change the id from sheboygan
>> something else,
>> It doesn't work. But if use another map resource and keep the
>> Sheboygan id for
>> the mapgroup it works perfectly ? Is this a bug within fusion and
>> should it be
>> reported or is there a setting defining a map with ID='sheboygan'
>> somewhere
>> I don't know about ?
>> Rgds
>> tomas
>>
>> From: Kenneth Skovhede, GEOGRAF A/S [mailto:ks at geograf.dk]
>> Sent: 13. maí 2008 13:04
>> To: Tómas Guðmundsson
>> Subject: Re: [fusion-users] Problems with starting a new application.
>>
>> I'm not all up to date on Fusion, so I might be wrong.
>> Fusion can either use a standalone ApplicationDefinition.xml, or
>> read the equvalent xml from the MapGuide server.
>> When you use Studio, it modifies the xml in the MapGuide server.
>> Normally, Fusion will load the xml from the MapGuide server, rather
>> than from a file.
>> You cannot load xml into MapGuide via. Studio, but you can save a
>> copy of the Xml to your disc, and manually insert it into the server.
>>
>> Does that help you?
>>
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>> Tómas Guðmundsson skrev:
>> Hello all.
>>
>> I wanted to ask this list if they can help me understand something
>> more about fusion. If there is some more documentation than on the
>> osgeo webpage I would be verey happy if someone could point me to
>> that resource. I'm hoping somebody on this list can answer several
>> aspects I have not yet wrapped my head around. I am using Mapguide
>> Server and Studio Enterprise 2009 and the Fusion that came bundled
>> with that CD. All my modifications and testing took place in the
>> folder mapguide2009/fusion/templates/mapguide/newtemplate/ where
>> newtemplate was indeed just a copy of another template which I
>> modified so I wouldn't overwrite the original copy.
>>
>> ApplicationDefinition.xml. To what ApplicationDefinition does fusion
>> listen to or parse? I modified the one in the same directory, to
>> hopefully include my mapdefinition but nothing happens. It still
>> went with the default Sheboygan sample data or when it didn't do
>> that it told me (via firebug) that mapGroup has no properties in
>> Map.js. Maybe I'm referencing it wrong? Where can I find the
>> MapDefinition for a weblayout or a map I have ? Also, when I removed
>> a whole section of let's say, ContextMenu, nothing changed. Even
>> with the right map (now given as a paramter in the URL) the same
>> default ContextMenu popped up.
>>
>>
>> I know there are several ways to add your own stuff to the fusion
>> application, but as a programmer I want to everything by hand. When
>> I add something with a point and click via Mapguide Studio it
>> sometimes works but I would like to know the best way, and in what
>> order I should add the xml definition of a widget, the javascript
>> implementation of that widget, and then the xml snippet inside the
>> applicationdefinition? (Which as point a) made, did not work for me
>> when I changed the ApplicationDefinition).
>>
>>
>> How do I get fusion to execute my code? I tried with my own widgets
>> or components and just the simple javascript command "alert('I say,
>> Hello Fusion!');" does not seem to execute in my own widgets. Other
>> widgets modified, like in the most simple one, About widget. Just
>> before I would open the about window, I entered that line and
>> nothing happened. A colleague of mine told me to move it up 4 lines,
>> on line 67 in About.js, which seems totally random to me but hey, I
>> got my About button to say Hello Fusion so it worked.
>>
>> So these are my main points of not understanding how Fusion works,
>> so I would appreciate it greatly if somebody could help me
>> understand these points.
>>
>> Regards,
>> Tomas, Programmer for
>> Snertill, Iceland.
>>
>>
>>
>>
>> _______________________________________________
>> fusion-users mailing list
>> fusion-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>
>> _______________________________________________
>> fusion-users mailing list
>> fusion-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>
> __________________________________________
>
> Paul Spencer
> Chief Technology Officer
> DM Solutions Group Inc
> http://www.dmsolutions.ca/
>
__________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://www.dmsolutions.ca/
More information about the fusion-users
mailing list