public interface Common
WE_API.CommonExamples:
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); }
);
Modifier and Type | Interface and Description |
---|---|
static interface |
Common.NavigationChangeListener
Listener for events about changes of the navigation.
|
static interface |
Common.PreviewElementListener
Listener for events about changes of the current Preview-Element.
|
static interface |
Common.PreviewRequestHandler
Listener for events about requests for new elements to be displayed
|
static interface |
Common.WorkflowTransitionInfo
JavaScriptObject which is passed over to the WorkflowTransitionListeners when a workflow transition happens.
|
static interface |
Common.WorkflowTransitionListener
Listener for events about workflow transitions in this websession
|
Modifier and Type | Method and Description |
---|---|
void |
addItemsPlugin(String type,
ClientItemsPlugin provider)
Registers a provider for actions in the given context type.
|
void |
addNavigationChangeListener(Common.NavigationChangeListener listener)
Registers a listener for events about changes regarding the project's sitestore/navigation.
|
void |
addPreviewElementListener(Common.PreviewElementListener listener)
Registers a listener for events about changes of the current Preview-Element.
|
void |
addPreviewRequestHandler(Common.PreviewRequestHandler listener)
Registers a listener for events about requests for changes of the current Preview-Element.
|
void |
addWorkflowTransitionListener(Common.WorkflowTransitionListener listener)
Registers a listener for events about workflow transitions in this websession
Listener registration in JavaScript might look like:
...addWorkflowTransitionListener(function(workflowTransitionInfo){...}) |
Dialog |
createDialog()
Returns an empty, yet invisible WebEdit style dialog.
|
void |
execute(String identifier,
JavaScriptObject params,
JavaScriptObject callback)
Executes a project script or an executable.
|
String |
getDisplayLanguage()
Returns the abbreviation of the current display language.
|
String |
getLocale()
Provides the locale with which the webedit UI is localized.
|
FSID |
getPreviewElement()
Returns current visible element.
|
void |
jumpTo(FSID fsid)
Jumps to the given target
fsid . |
void |
jumpTo(JavaScriptObject fsid)
Jumps to the given target.
|
void |
jumpTo(JavaScriptObject fsid,
String language)
Jumps to the given target.
|
void |
setPreviewElement(JavaScriptObject fsid)
Sets the current visible element.
|
void |
showMessage(String text)
Shows the given
text in a simple message box. |
void |
showMessage(String title,
String text)
Shows the given
text in a simple message box with the given title . |
Dialog createDialog()
Dialog.show()
FSID getPreviewElement()
void setPreviewElement(JavaScriptObject fsid)
The given attribute object specifies the element.
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.
fsid
- element to be set to visiblevoid addPreviewElementListener(Common.PreviewElementListener listener)
Registers a listener for events about changes of the current Preview-Element.
Listener registration in JavaScript might look like:
...addPreviewElementListener(function(fsid){...});
listener
- listener to informvoid addPreviewRequestHandler(Common.PreviewRequestHandler listener)
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){...});
listener
- listener to informvoid addNavigationChangeListener(Common.NavigationChangeListener listener)
Registers a listener for events about changes regarding the project's sitestore/navigation.
Listener registration in JavaScript might look like:
...addNavigationChangeListener(function(fsid){...});
listener
- listener to informString getLocale()
String getDisplayLanguage()
void execute(@NotNull String identifier, JavaScriptObject params, JavaScriptObject callback)
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.void jumpTo(FSID fsid)
fsid
.fsid
- target element.void jumpTo(JavaScriptObject fsid)
Jumps to the given target. The given attribute object specifies the target element.
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.
fsid
- attributes object to identify the target element.void addWorkflowTransitionListener(Common.WorkflowTransitionListener listener)
Registers a listener for events about workflow transitions in this websession
Listener registration in JavaScript might look like:
...addWorkflowTransitionListener(function(workflowTransitionInfo){...});
listener
- the listener to be registeredvoid jumpTo(JavaScriptObject fsid, String language)
Jumps to the given target. The given attribute object specifies the target element.
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.
fsid
- attributes object to identify the target element.language
- target language to jump to, or null
for current languagevoid showMessage(String text)
text
in a simple message box.text
- to show.void showMessage(String title, String text)
text
in a simple message box with the given title
.title
- to use.text
- to show.void addItemsPlugin(String type, ClientItemsPlugin provider)
ClientItemsPlugin
:
// RegisterClientItemsPlugin
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); });
type
- The context type to register actions for.provider
- The provider for the actions.Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210