The MashupHub framework constructs a client-side plug-in object whenever IEditor.renderEditor
is first invoked on the server.
The client instance exists for the duration of editing, until one of the following events occur:
- The user closes the tab containing the wizard.
- The user cancels the wizard.
- The user leaves the wizard from the landing page.
method completes or cancels the plug-in editor. The method looks at the action attribute of the given params object to determine what action to take. If the value of action is the string save, the save page is shown. If the value is cancel, the plug-in editor ends after prompting for confirmation and the user returns to an appropriate page.
method shows another screen in the plug-in editor. The html is the screen to render. The wizard will place the new screen after the current screen and will show the new screen immediately. This method is typically called in a response from the server.
method requests that the wizard show the next screen. If the wizard already has a valid cached copy the next screen, it shows that screen and hides the current one. If the next screen is not cached or is no longer valid, it invokes the provided function. Typically, the provided function generates a request to IEditor.handleAjax
on the server to submit some data and fetch the HTML of the next screen.
method requests that the wizard show the previous screen. This method always hides the current screen and shows the previous one. No request to the server is generated.
function getScreenState(screen, index)
method returns an object that MashupHub can use to compare whether the state of this screen has changed since the user last visited it. If not implemented (raises an error), then MashupHub uses its own logic to save state, namely getting values from all named elements in the first form on the screen. Override this method only if form field checks will not work for this plug-in. The screen parameter contains the DOM node for the screen whose state is needed. The index
parameter is the index of the screen, including screens shown before the plug-in's first screen.
method returns the MashupHub Object ID for the object, such as the feed
method returns the MashupHub Plugin ID for the plug-in of the currently running editor.
function showMessage(msg, typ)
method displays a message in a pop-up window. The message content is contained in the msg
parameter. The typ
parameter indicates the type of the message:
- I for information
- W for warning
- E for error
class inherits all of the methods from hub.managers.Plugin
function invokeServer(method, data, transport)
method executes a method on a server-side instance of the plug-in's editor component. The data
parameter is any object that can be expressed in JSON format. The transport
parameter is either the string xhr
(the default, if nothing is specified) or iframe
. The XHR transport should be used in most cases, but Iframe transport is necessary when uploading files to the server.
The response from the server is not returned synchronously by this method. Instead, the server-side InvokePlugin
uses a JSONAJAXResponseViewBean
to specify what client-side method should be asynchronously invoked when the response from the server is available.
method returns the URL that can be used to invoke an AJAX method on the server side plug-in component. The method
parameter is the string name of the method to invoke. This parameter is needed when the default invokeServer
function cannot be used, such as when iframes are used.
Parent topic: Browser component interfaces: imc3