Interface Common

All Superinterfaces:
org.timepedia.exporter.client.Exportable

public interface Common extends org.timepedia.exporter.client.Exportable
FirstSpirit WebEdit Javascript Common API, accessible via
    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
  • 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.

      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

      void setPreviewElement(FSID fsid)
      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

      void 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){...});

      Parameters:
      listener - listener to inform
      Since:
      5.2.1301
    • addPreviewRequestHandler

      void 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){...});

      Parameters:
      listener - listener to inform
      Since:
      5.2.2002
    • addNavigationChangeListener

      void 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){...});

      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

      void jumpTo(FSID fsid)
      Jumps to the given target fsid.
      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.

      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

      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){...});

      Parameters:
      listener - the listener to be registered
      Since:
      5.2.2007
    • jumpTo

      void jumpTo(com.google.gwt.core.client.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.

      Parameters:
      fsid - attributes object to identify the target element.
      language - target language to jump to, or null for current language
      Since:
      5.2.7
    • showMessage

      void showMessage(String text)
      Shows the given text in a simple message box.
      Parameters:
      text - to show.
      Since:
      5.0.106
    • showMessage

      void showMessage(String title, String text)
      Shows the given text in a simple message box with the given title.
      Parameters:
      title - to use.
      text - to show.
      Since:
      5.2.1503
    • addItemsPlugin

      void addItemsPlugin(String type, ClientItemsPlugin provider)
      Registers a provider for actions in the given context type. Available context types are: Example for the registration of a ClientItemsPlugin:
           // 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