Interface Common
- All Superinterfaces:
org.timepedia.exporter.client.Exportable
WE_API.Common
Examples:
WE_API.Common.showMessage
("A big hello from the new FirstSpirit Web Client 5!"); // Hello World!
WE_API.Common.execute
( "script:myexample", // calls the project script "myexample" {param1:42, param2:"test"}, // an integer and a string as parameter function(result) { // callback function after the script execution is finished alert("script result: " + result); }
);
- Since:
- 5.0.106
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Listener for events about changes of the navigation.static interface
Listener for events about changes of the current Preview-Element.static interface
Listener for events about requests for new elements to be displayedstatic interface
JavaScriptObject which is passed over to the WorkflowTransitionListeners when a workflow transition happens.static interface
Listener for events about workflow transitions in this websession -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemsPlugin
(String type, ClientItemsPlugin provider) Registers a provider for actions in the given context type.void
Registers a listener for events about changes regarding the project's sitestore/navigation.void
Registers a listener for events about changes of the current Preview-Element.void
Registers a listener for events about requests for changes of the current Preview-Element.void
Registers a listener for events about workflow transitions in this websessionReturns an empty, yet invisible WebEdit style dialog.void
execute
(@NotNull String identifier, com.google.gwt.core.client.JavaScriptObject params, com.google.gwt.core.client.JavaScriptObject callback) Executes a project script or an executable.Returns the abbreviation of the current display language.Provides the locale with which the webedit UI is localized.Returns current visible element.void
jumpTo
(com.google.gwt.core.client.JavaScriptObject fsid) Jumps to the given target.void
Jumps to the given target.void
Jumps to the given targetfsid
.void
setPreviewElement
(com.google.gwt.core.client.JavaScriptObject fsid) Sets the current visible element.void
setPreviewElement
(FSID fsid) Sets the current visible element.void
showMessage
(String text) Shows the giventext
in a simple message box.void
showMessage
(String title, String text) Shows the giventext
in a simple message box with the giventitle
.
-
Method Details
-
createDialog
Dialog createDialog()Returns an empty, yet invisible WebEdit style dialog.- Returns:
- new invisible dialog.
- Since:
- 5.0.106
- See Also:
-
getPreviewElement
FSID getPreviewElement()Returns current visible element.- Returns:
- current visible element.
- Since:
- 5.0.106
-
setPreviewElement
void setPreviewElement(com.google.gwt.core.client.JavaScriptObject fsid) Sets the current visible element. May only be used when preview is in App Mode!The given attribute object specifies the element.
- {"id":42, "store":"MEDIASTORE"})
- {"contentId":146, "pageref":51})
- {"contentId":146, "content2":854})
- {"contentId":146, "template":216})
The values of "id", "pageref", "content2" and "template" are expected to be the unique ID of the related IDProvider. The UID is not supported at this point.
- Parameters:
fsid
- element to be set to visible- Since:
- 5.2.2002
-
setPreviewElement
Sets the current visible element. May only be used when preview is in App Mode!- Parameters:
fsid
- element to be set to visible- Since:
- 5.2.2002
-
addPreviewElementListener
Registers a listener for events about changes of the current Preview-Element.
Listener registration in JavaScript might look like:
...addPreviewElementListener(function(fsid){...});
- Parameters:
listener
- listener to inform- Since:
- 5.2.1301
-
addPreviewRequestHandler
Registers a listener for events about requests for changes of the current Preview-Element. May only be used when preview is in App Mode!
A new preview element may be requested e.g. when an element in the report is clicked.
Listener registration in JavaScript might look like:
...addPreviewRequestHandler(function(fsid){...});
- Parameters:
listener
- listener to inform- Since:
- 5.2.2002
-
getLocale
String getLocale()Provides the locale with which the webedit UI is localized.- Returns:
- The client's locale.
- Since:
- 5.2.609
-
getDisplayLanguage
String getDisplayLanguage()Returns the abbreviation of the current display language.- Returns:
- display language
- Since:
- 5.2.7
-
execute
void execute(@NotNull @NotNull String identifier, com.google.gwt.core.client.JavaScriptObject params, com.google.gwt.core.client.JavaScriptObject callback) Executes a project script or an executable.- Parameters:
identifier
- script ("script:script_uid"
) or executable ("class:full.qualified.executable.ClassName"
).params
- js object with parameters (e.g.{"param1":42, "param2":"text"}
).callback
- single-parameter function that is called with the script result.- Since:
- 5.0.106
-
jumpTo
Jumps to the given targetfsid
.- Parameters:
fsid
- target element.- Since:
- 5.0.106
-
jumpTo
void jumpTo(com.google.gwt.core.client.JavaScriptObject fsid) Jumps to the given target. The given attribute object specifies the target element.
- {"id":42, "store":"MEDIASTORE"})
- {"contentId":146, "pageref":51})
- {"contentId":146, "content2":854})
- {"contentId":146, "template":216})
The values of "id", "pageref", "content2" and "template" are expected to be the unique ID of the related IDProvider. The UID is not supported at this point.
- Parameters:
fsid
- attributes object to identify the target element.- Since:
- 5.0.106
-
addWorkflowTransitionListener
Registers a listener for events about workflow transitions in this websession
Listener registration in JavaScript might look like:
...addWorkflowTransitionListener(function(workflowTransitionInfo){...});
- Parameters:
listener
- the listener to be registered- Since:
- 5.2.2007
-
jumpTo
Jumps to the given target. The given attribute object specifies the target element.
- {"id":42, "store":"MEDIASTORE"})
- {"contentId":146, "pageref":51})
- {"contentId":146, "content2":854})
- {"contentId":146, "template":216})
The values of "id", "pageref", "content2" and "template" are expected to be the unique ID of the related IDProvider. The UID is not supported at this point.
- Parameters:
fsid
- attributes object to identify the target element.language
- target language to jump to, ornull
for current language- Since:
- 5.2.7
-
showMessage
Shows the giventext
in a simple message box.- Parameters:
text
- to show.- Since:
- 5.0.106
-
showMessage
Shows the giventext
in a simple message box with the giventitle
.- Parameters:
title
- to use.text
- to show.- Since:
- 5.2.1503
-
addItemsPlugin
Registers a provider for actions in the given context type. Available context types are: Example for the registration of aClientItemsPlugin
:// Register
ClientItemsPlugin
for buttons in FS_INDEX editor WE_API.Common.addItemsPlugin("index", function clientItemsPlugin(context, receiver) { // context:ClientItemContext
// receiver: function(result: Array<ClientItem
>) var items = []; items.push(context.createItem
("iconUrl", "title", function clientItemPerformable() { // Perform action })); // Send performable items to the FS_INDEX editor receiver(items); });- Parameters:
type
- The context type to register actions for.provider
- The provider for the actions.- Since:
- 5.2.181105
-