IDE Issue 6
From MemberWiki
Contents |
IDE Issue 6: Hooks for custom design-time user interface
Introduction
We need to decide on the markup for specifying custom editors within an IDE (and presumably customizing gadgets within a mashup editor).
Proposed approaches
Dreamweaver has some markup as described at (http://www.openajax.org/member/wiki/IDE_Survey#Adobe.2FMacromedia_Dreamweaver):
<widget...> ... <designtimeFile url="WidgetDesignTimeFileOnAServerSomewhere" /> <propertyInspectorFile url="PIFileOnAServerSomewhere" /> ... </widget>
The IBM Widgets Proposal (http://www.openajax.org/member/wiki/IBM_Widgets_proposal) proposes multiple <content> elements, one for runtime viewing of the gadget, one for editing the gadget, and one for getting help:
<content mode="view|edit|help" type="html|uri|frame"> ...gadget HTML... </content>
Analysis
Dreamweaver demonstrates that there is a need for at least three types of user interfaces for each "widget": the normal view (when running in the browser), the editing view (when the Web page is in editing/design mode), and the property inspector view (when the developer is configuring properties in the property inspector dialog).
The IBM Widgets Proposal identifies a 4th scenario, help, when content pertaining to the widget is needed.
The IBM Widgets Proposal demonstrates that the HTML content that represents the user interface can be embedded inline or externally referenced, and whether the content is suitable for being placed in the same document as its parent (e.g., within a DIV) or must be sandboxed from the parent (e.g., within an IFRAME).
Jon's proposed recommendation (updated to match 20080102 spec)
<customUI type="edit|help|propertyEditor" src="<uri>" sandbox="true|false">
...widget markup (if 'src' attribute is not present)...
...if HTML markup is used, usually needs to be bracketed within a CDATA...
</customUI>
A metadata file may have multiple <content> elements.
The meaning of the type attribute:
-
edit- This is an alternate rendering for when the tool is in edit mode, typically for the entire web application or entire mashup. Some tools do not have such a mode, in which case this content SHOULD be ignored. If there is not alternateeditcontent stream, then the tool might choose to use theviewcontent or an alternate representation, such as a raster image. -
propertyEditor- This is a snippet of interactive web content (e.g., HTML+JavaScript) that provides a custom user interface for editing the properties associated with the widget. Note that it is not a conformance requirement to support custom property editors. -
help- This is a snippet of interactive web content (e.g., HTML+JavaScript) that provides custom help information about the given widget. Note that some it is not a conformance requirement to support custom help information.
If the 'type' is not specified or is not recognized by the tool, then the element is ignored.
If 'src' is provided, then the referenced file is used as the content; otherwise, the textual content of the <content> element is used as the content. (More specifically, the concatenation of all Text node children and the textual content of all CDATA node children.)
If for some reason the file contains duplicate <customUI> elements for the same 'role', then conforming tools MUST use the last such <customUI> element.
Also, see related IDE Issue 5.
