[OpenAjaxIDE] Macro substitution details

Jon Ferraiolo jferrai at us.ibm.com
Fri Aug 15 11:12:13 PDT 2008

As we have been implementing the spec, it became clear that there are some
abiguities about the exact rules for when macro substitution takes place.
Here is what the spec says now:
2008-04-24: Tentatively approved. We have agreed to supporting macro
expansion per Lori's proposal, where macro expansion looks for every
property "p" and replaces all occurrences in the content of @@p@@ with the
property value.
2008-04-29: Tentatively approved. We decided that we would support macro
expansion from both the property bag and from the localization files, but
that we would use different syntax for the two in order to prevent
collisions. Use @@foo@@ for property expansion and %%bar%% for localization
2008-06-24: We accepted the Gadgets TF recommendation the following: "A
processing engine MUST apply localization transformation to <content>,
<javascript>, <description>, <title>, <remarks>, <example>, <license>,
<author>. The <include> element references an external file whose content
is to be transcluded into the current document; therefore included content
MUST also be processed following the same localization transformations."
Also our new elements <aboutMe> and <quote>
2008-08-12: Tentatively approved Variable substitution also applies to
preload, postload and inline require.
2008-08-12: Jon needs to make a proposal for how to indicate that a
variable such as @@foo@@ requires HTML encoding or JS quote escaping.
Editor: need to make sure there are appropriate warnings about XSS in
property values and other user-entered strings.
Editor: need to include text about __WID__ macro expansion, where __WID__
holds the name of the JavaScript object for the widget instance object. For
example, "__WID__" might become "wid004682988", where the numeric part is a
random number.

The above notes are fairly clear about what elements are subject to
localization transformations, but there isn't a definitive list of which
elements are subject to property substitution and which elements support
macro expansion of __WID__ with the widget's object name.

Here is a proposal for how to clarify the abiguities (the proposal comes
mainly from Javier):

Localization substitutions:
      inline <content>
      inline <javascript>
      inline <require>
      <preload> (always inline):
      <postload> (always inline)
      <include> (i.e., after the inclusion, then process the included

Property substitutions and __WID__ substitution:
      inline <content>
      inline <javascript>
      inline <require>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080815/001b57c2/attachment-0001.html 

More information about the IDE mailing list