[OpenAjaxIDE] an odd object case

Lori Hylan-Cho lori at avocado8.com
Mon Jul 20 14:26:31 PDT 2009


Hi All
Kin came across a case last week of a widget constructor that takes three
arguments: a string, an object or array, and a config object. We spoke at
length over IM about the second argument and how to specify it in the
metadata in a way that would be useful to an IDE in generating a user
interface for that argument. The datatype is fairly straightforward; it's

datatype="[String]|Object"

The spec says that <property> tags are only allowed as children of
<parameter> or other <property> tags if the datatype is Object. I assumed
that since the argument can be an Object, we could use <property> tags to
describe the object's properties without violating the spec's rules, and
that IDEs would need to be smart enough to know that this information was
for the Object case only.

>From there it gets a bit trickier. The problem is that the Object in
question does not have named properties. It has one or more properties
(which are themselves Objects) that are identified by Strings of format url
(relative or absolute file path). The Object that the String identifies
*does* have named properties that must be specified in the metadata in order
for the IDE to know what kind of UI to present.

For example, the Object version of the argument in question could be
specified as follows:

{'1.jpg': {caption: 'Keylin', href: 'keylin.html'}, '2.jpg': {caption:
'Gustavo', href: 'gustavo.html'}, '3.jpg': {caption: 'Amalia', href:
'amalia.html'}};

Kin's and my question is: How do we specify such a hash-like thing in the
metadata so that it's clear to the IDE what the important pieces of
information are? As people, we can read the example code and see that the
labels are Strings representing the image path and that the corresponding
Objects have two properties: caption and href (it turns out that there's
also a third, thumbnail). But how do we specify the Object's properties in
the metadata while also describing the datatype and format of the Object's
label in lieu of a fixed property name?

Thoughts appreciated.

cheers,
Lori
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090720/2c2b5de6/attachment.html 


More information about the IDE mailing list