Defining an URL editor in blueprint
URL-editors must be exported as an OSGi service with an urlEditorRole service property like follows. Multiple editors can propagate the same role. Consuming applications should therefore provide users with a selection possiblity.
Discovery of registered URL editors
All IExternalURlEditor services are registered by the ExternalUrlEditorRegistry provided by the serializable-entities bundle. All IExternalUrlEditor instances for a given urlEditorRole my be discovered by the following URL (locale information is optional)
This URL returns a JSON array in the following form:
Communication between URL editor and a consuming application
A URL editor provides the user with a graphical user interface to select which data is to be provided as a JSON-stream by the data-URL. The editor is conceived as a standalone application hosted under a different url to the consuming application, which should embed the editor using an IFRAME. The components communicate via fields and events in an invisible form embedded in the URL editor's html (org.clazzes.gwt.extras.iframe.ForeignForm).
To ensure the communication to work, the consuming application must know the id of the form and fields used by the URL editor to transmit information, and implement SubmitHandler to catch the form's submit-events. It can then call the getValue(String) or setValue(String,String) methods to exchange data with the editor.
Known URL editor roles
expected result of the data URL
Image data with an appropriate Content-Type like image/png or image/jpeg
A JSON result set a specified in Scientific DataSetUrl JSON Result format
form field resultType "org.clazzes.sketch.richtext.base.ITextEntity": A JSON-formatted richtext entity .
form field resultType "org.clazzes.sketch.scientific.entities.data.RemoteRichtext": A map of JSON-formatted richtext entites and timestamp keys see Scientific time-keyed Richtext Map Result Format