Class ScriptExecutorController

  • All Implemented Interfaces:
    com.hybris.cockpitng.core.WidgetController, com.hybris.cockpitng.dnd.WidgetDragAndDropAware, com.hybris.cockpitng.engine.WidgetInstanceManagerAware, java.io.Serializable, org.zkoss.zk.ui.event.EventListener, org.zkoss.zk.ui.event.SerializableEventListener, org.zkoss.zk.ui.util.ComponentActivationListener, org.zkoss.zk.ui.util.ComponentCloneListener, org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>, org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>

    public class ScriptExecutorController
    extends com.hybris.cockpitng.util.DefaultWidgetController
    Widget controller of a Script Executor widget. With this widget it's possible to run a script content using platforms {#ScriptingLanguagesService}.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String INPUT_SOCKET_DATA  
      static java.lang.String SETTING_SCRIPT_CONTENT  
      static java.lang.String SETTING_SCRIPT_CONTENT_LANG  
      static java.lang.String SETTING_SCRIPT_URI  
      static java.lang.String SOCKET_OUTPUT_ERROR  
      static java.lang.String SOCKET_OUTPUT_SUCCESS  
      • Fields inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer

        _separator, application, applicationScope, arg, componentScope, desktop, desktopScope, execution, page, pageScope, param, requestScope, self, session, sessionScope, spaceOwner, spaceScope
      • Fields inherited from class org.zkoss.zk.ui.util.GenericComposer

        _applied
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ScriptExecutionResult executeScript​(ScriptExecutable executable, java.lang.Object data)  
      protected void executeScriptByURI​(java.lang.Object data, java.lang.String scriptId)  
      protected void executeScriptWithInlineContent​(java.lang.Object data, java.lang.String scriptContent, java.lang.String scriptContentLang)  
      protected ScriptingLanguagesService getScriptingLanguagesService()  
      void input​(java.lang.Object data)
      Method runs the script based on it's widget settings.
      • Methods inherited from class com.hybris.cockpitng.util.DefaultWidgetController

        doAfterCompose, doBeforeCompose, doBeforeComposeChildren, executeOperation, getDragAndDropStrategy, getLabel, getLabel, getModel, getValue, getWidgetDragAndDropStrategyRepository, getWidgetInstanceManager, getWidgetRoot, getWidgetSettings, getWidgetslot, getWidgetTitle, getWidgetUtils, initDragAndDropAwareness, initialize, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitle
      • Methods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer

        scanEventListeners
      • Methods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer

        alert, didActivate, getPage, willClone, willPassivate
      • Methods inherited from class org.zkoss.zk.ui.util.GenericComposer

        doCatch, doFinally
      • Methods inherited from class org.zkoss.zk.ui.event.GenericEventListener

        bindComponent, getController, onEvent, unbindComponent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INPUT_SOCKET_DATA

        public static final java.lang.String INPUT_SOCKET_DATA
        See Also:
        Constant Field Values
      • SETTING_SCRIPT_URI

        public static final java.lang.String SETTING_SCRIPT_URI
        See Also:
        Constant Field Values
      • SETTING_SCRIPT_CONTENT

        public static final java.lang.String SETTING_SCRIPT_CONTENT
        See Also:
        Constant Field Values
      • SETTING_SCRIPT_CONTENT_LANG

        public static final java.lang.String SETTING_SCRIPT_CONTENT_LANG
        See Also:
        Constant Field Values
      • SOCKET_OUTPUT_SUCCESS

        public static final java.lang.String SOCKET_OUTPUT_SUCCESS
        See Also:
        Constant Field Values
      • SOCKET_OUTPUT_ERROR

        public static final java.lang.String SOCKET_OUTPUT_ERROR
        See Also:
        Constant Field Values
    • Constructor Detail

      • ScriptExecutorController

        public ScriptExecutorController()
    • Method Detail

      • input

        public void input​(java.lang.Object data)
        Method runs the script based on it's widget settings.
        Parameters:
        data - the data which is accessible in the script under the "data" variable name.
      • executeScriptWithInlineContent

        protected void executeScriptWithInlineContent​(java.lang.Object data,
                                                      java.lang.String scriptContent,
                                                      java.lang.String scriptContentLang)
      • executeScriptByURI

        protected void executeScriptByURI​(java.lang.Object data,
                                          java.lang.String scriptId)