Proposal and Spec 2.0 cleanup - Variable substitution standardize on EL syntax

5 views
Skip to first unread message

goosemanjack

unread,
Apr 4, 2011, 11:29:05 AM4/4/11
to OpenSocial and Gadgets Specification Discussion

When the spec adopted data pipelining in the 0.9 version of the spec,
we added support for an expression language syntax loosely based on
JSP EL. This also included overlapping support for features covered
by the existing variable substitution syntax, such as message bundle
syntax.

The older variable substitution syntax uses the format
__<TYPE>_<key>__ whereas the EL syntax uses ${Key.Property} and a
number of reserved keys.

The EL syntax is more powerful, flexible, and easier to type. I'd
like to see the spec deprecate the older and more limited double-
underscore syntax for variables and standardize on the EL syntax.
Also, the parts of the spec that deal with EL are scattered, so the
specs should consolidate most of them into the Core Gadget spec,
leaving the remaining template-specific sections in the templating
spec.


== Older variable substitution section ==
http://opensocial-resources.googlecode.com/svn/spec/2.0/Core-Gadget.xml#VariableSubstitution


== Newer EL syntax sections ==
(expressions in templates)
http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Templating.xml#rfc.section.7

(EL access to meta-data from data pipeline tags)
http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Templating.xml#rfc.section.8

(Special EL variables in templates)
http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Templating.xml#rfc.section.9

(Dynamic Parameters in Data Pipeline tags and ViewParams)
http://opensocial-resources.googlecode.com/svn/spec/2.0/Core-Gadget.xml#rfc.section.13.8

(Localization and ${Msg} variable)
http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Templating.xml#rfc.section.16

rbaxter85

unread,
Apr 4, 2011, 8:03:15 PM4/4/11
to OpenSocial and Gadgets Specification Discussion
+1 Chris.

One thing though....do we use the old variable substitution for
preferences as well? So with your proposed change we would use EL
syntax instead?

On Apr 4, 11:29 am, goosemanjack <cc...@myspace.com> wrote:
> When the spec adopted data pipelining in the 0.9 version of the spec,
> we added support for an expression language syntax loosely based on
> JSP EL.  This also included overlapping support for features covered
> by the existing variable substitution syntax, such as message bundle
> syntax.
>
> The older variable substitution syntax uses the format
> __<TYPE>_<key>__ whereas the EL syntax uses ${Key.Property} and a
> number of reserved keys.
>
> The EL syntax is more powerful, flexible, and easier to type.  I'd
> like to see the spec deprecate the older and more limited double-
> underscore syntax for variables and standardize on the EL syntax.
> Also, the parts of the spec that deal with EL are scattered, so the
> specs should consolidate most of them into the Core Gadget spec,
> leaving the remaining template-specific sections in the templating
> spec.
>
> == Older variable substitution section ==http://opensocial-resources.googlecode.com/svn/spec/2.0/Core-Gadget.x...
>
> == Newer EL syntax sections ==
> (expressions in templates)http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Te...
>
> (EL access to meta-data from data pipeline tags)http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Te...
>
> (Special EL variables in templates)http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Te...
>
> (Dynamic Parameters in Data Pipeline tags and ViewParams)http://opensocial-resources.googlecode.com/svn/spec/2.0/Core-Gadget.x...
>
> (Localization and ${Msg} variable)http://opensocial-resources.googlecode.com/svn/spec/2.0/OpenSocial-Te...

goosemanjack

unread,
Apr 4, 2011, 10:38:39 PM4/4/11
to OpenSocial and Gadgets Specification Discussion
I'd like a global change. Any lingering things tied to the older
variable syntax, like user prefs, should be tied to a reserved
variable of the same/similar name. Current pattern is Inital Caps/
CamelCase. So user prefs would be ${UserPrefs.foo}

rbaxter85

unread,
Apr 5, 2011, 2:32:57 PM4/5/11
to OpenSocial and Gadgets Specification Discussion
Sounds good Chris, I like this.

Mark W.

unread,
Apr 6, 2011, 7:47:34 AM4/6/11
to opensocial-an...@googlegroups.com
+1 for me as well.
If you open an issue, I'll create a line in the scope document and we'll get it up for vote

goosemanjack

unread,
Apr 7, 2011, 2:29:04 PM4/7/11
to OpenSocial and Gadgets Specification Discussion

goosemanjack

unread,
Apr 20, 2011, 7:22:54 PM4/20/11
to OpenSocial and Gadgets Specification Discussion
Call to vote -

Patch applied - revision 1387.

http://code.google.com/p/opensocial-resources/source/detail?r=1387




On Apr 7, 11:29 am, goosemanjack <cc...@myspace.com> wrote:
> Specification-scope votinghttp://code.google.com/p/opensocial-resources/source/detail?r=1374
>
> Tracking issue 1164http://code.google.com/p/opensocial-resources/issues/detail?id=1164
Reply all
Reply to author
Forward
0 new messages