Hi Michael,
The widget format is based on the Google Gadget specification,
modified to allow us to render these widget inline without the use of
iFrames. The main goal for these widgets is to make them highly
modular, allowing different people to easily contribute to the system
without treading on each other toes [1] and allowing the widgets to be
used in different places.
In terms of performance, I don't think it necessarily needs to hurt
the performance of the system. We are not directly injecting the
widget HTML into the page, but do something more intelligent where we
first strip out the references to CSS and JavaScript files, check
whether they have already been loaded and if not lazy load them into
the page. When a widget has been loaded once, its JavaScript and CSS
will be cached in the browser and no HTTP requests will need to be
made to load the widget.
[1] http://oae-widgets.sakaiproject.org
Hope that helps,
Nicolaas
On 9 Jul 2012, at 13:46, Darakananda, Apisak wrote:
Thank you guys for your answers; it clears up a lot of confusion.
Does any of you know the reason behind this "widget format"? It
seems to be a bit like playing the piano with gloves on. If I
understand correctly, this might also hurt the performance of the
website. Since you are effectively inserting a new HTML sub-page,
all javascripts local to that page needs to be parsed every time a
widget is used even if it has been used before.
Regards,
Michael
From: "Nicolaas Matthijs" <[email protected]>
To: "Bert Pareyn" <[email protected]>
Cc: "Apisak Darakananda" <[email protected]>, [email protected]
Sent: Monday, July 9, 2012 5:23:05 PM
Subject: Re: [oae-dev] A Question about Widgets
Hi Michael,
As Bert said, the config file is used to register your widget in the
application. It tells the application what the name of the widget
is, where it can be used, which languages it's available in, etc.
The HTML file is basically all of the HTML that the widget itself
will want to show on the screen, which can be as much or as little
as your widget requires. The application will take care of the
actual loading of your widget and putting it in the right place in
the UI, so there's no need to worry about that inside of your
widget. However, the application will pass in the unique id of the
container your widget will be loaded into, so you can always use
that in case you need it.
Hope that helps,
Nicolaas
On 9 Jul 2012, at 10:47, Bert Pareyn wrote:
Hi Michael,
You're right in saying that each widget needs its own folder with an
HTML, config and JavaScript file.
The widget HTML page contains the elements specific for that widget.
You will notice that the file does not have the usual structure
(with body, head, title,…) because widgets are injected into the
page later on (pages like /dev/index.html, /dev/
content_profile.html, …).
To load a widget into the page we create a div with a specific ID.
e.g.: <div id="widget_topnavigation" class="widget_inline"></div>.
This is picked up by the widget loading mechanism in
sakai.api.Widgets and the widget HTML is placed inside of the
container.
The configuration files for each widget tell the widget where it can
be placed, what the translations are, etc.
Hope that helps,
- Bert
On 8 Jul 2012, at 17:34, Darakananda, Apisak wrote:
Hello all,
Sorry if this has been discussed elsewhere; I have not been able to
find any documentation on it. I am planning to join the project at
GaTech this Fall, and I am trying to get a sense of how the project
is set up.
I am confused by the way the widgets. According to the Hello World
demo, each widget is supposed to get its own folder, HTML page, a
config file, among other things. I completely agree that a widget
should have its own folder, but I don't quite understand what the
HTML page and config file are for.
The way I currently see it, shouldn't it be enough for a widget to
have a method "getRootElement()"? (Of course, the name could be made
shorter!) That way to put a widget onto a page, we just need to
someContainer.appendChild(myWidget.getRootElement()).
Thank you for your help!
Michael
--
Apisak "Michael" Darakananda
[email protected]
"The bus station is where the bus stops. The train station is where
the train stops. On my desk, I have a workstation."
_______________________________________________
oae-dev mailing list
[email protected]
http://collab.sakaiproject.org/mailman/listinfo/oae-dev
_______________________________________________
oae-dev mailing list
[email protected]
http://collab.sakaiproject.org/mailman/listinfo/oae-dev
--
Apisak "Michael" Darakananda
[email protected]
"The bus station is where the bus stops. The train station is where
the train stops. On my desk, I have a workstation."
_______________________________________________
oae-dev mailing list
[email protected]
http://collab.sakaiproject.org/mailman/listinfo/oae-dev