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

Rich Thompson richt2 at us.ibm.com
Thu Aug 7 10:39:21 PDT 2008

At most the order of elements in the requires can suggest an ordering 
within the head. The possibility of multiple references to the same files 
in different orders is too high to think the spec/widget can mandate a 
particular ordering.


Jon Ferraiolo/Menlo Park/IBM at IBMUS
ide at openajax.org
08/07/2008 12:35 PM
[OpenAjaxIDE] Inline,   macro-expanded content within <requires> element

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> element.)

* <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.


IDE mailing list
IDE at openajax.org

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

More information about the IDE mailing list