[OpenAjaxIDE] Inline, macro-expanded content within <requires> element

Jon Ferraiolo jferrai at us.ibm.com
Thu Aug 7 09:14:40 PDT 2008

Hi Kin & everyone,

Wayne Vicknair completed his analysis of whether it is OK within dynamic
mashup scenarios for macro-expansion transformations (properties,
localization, etc.) to be applied to inline content that is placed into the
HEAD. His answer, fortunately, is that there is no apparent problem with
doing this. Therefore, it looks like there should be no problem addressing
the requirement that Kin mentioned earlier this week.

Some of the open source contributors batted some ideas around. Here is my
proposal (with slight differences from what was last discussed with the
open source guys) for how the metadata markup should look.

[1] <requires>
[2]   <require type=... src=.../>   <!-- For referenced files and folders
[3]   <javascript>...</javascript>  <!-- For inline JS that is placed in
the head -->
[4]   <style>...</style>            <!-- For inline CSS that is placed in
the head -->
[5] </requires>.


* The <requires> element now has 3 possible children: <require>,
<javascript>, and <style>.
* The order of the sub-elements to <requires> determines the order in which
things are placed into the HEAD.
* You must have a <requires> element around any <require> elements.
(Currently, <requires> is optional, but after introducing a <javascript>
sub-element, it is cleaner and simpler to force peopel to have a <requires>

* <require> would now have two required attributes, 'type' and 'src'.
Previously, only 'type' was required, but by introducing <javascript> and a
new <style> element, then we will have removed the inline cases for

* The <javascript> element within <require> would be the same element as
the <javascript> element outside of <require>. In all cases (i.e., inside
of <requires> or not), the <javascript> element would be subject to
macro-expansion transformations. However, there would be a couple of
differences for <javascript> when used inside of <require>
==> The "this" object would not be set to the widget wrapper object because
that's not what happens with inline JS in the head
==> The 'src' attribute would be disallowed - only inline JS would be
allowed inside of <require>

NOTE: By allowing the <javascript> element within <require>, we can get rid
of the <preload> and <postload> elements.

* The <style> element allows for inline CSS that is inserted into the HEAD.
It would be subject to macro-expansion processing, although people probably
won't use variables very often with their CSS style declarations.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080807/617c46ff/attachment.html 

More information about the IDE mailing list