Platform Explorer / Nuxeo Platform 11.3

Component org.nuxeo.automation.scripting.internals.AutomationScriptingComponent

Documentation

Automation Scripting is a Nuxeo module which provides ability to create and contribute Automation chain/operation in JavaScript.

For backward compatibility with version prior to 9.1, you may want to inline the context in the scripting parameters by contributing the extension

    <extension point="configuration" target="org.nuxeo.runtime.ConfigurationService">
        <property name="nuxeo.automation.scripting.inline-context-in-params">true</property>
    </extension>

Requirements

Resolution Order

576
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

522
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.automation.scripting.internals.AutomationScriptingComponent

Services

Extension Points

Contributions

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.automation.scripting.internals.AutomationScriptingComponent" version="1.0">

   <documentation>
    Automation Scripting is a Nuxeo module which provides ability to create and contribute Automation chain/operation in JavaScript.

    For backward compatibility with version prior to 9.1, you may want to inline the context in the scripting parameters by contributing the
    extension
    <code>
      <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
        <property name="nuxeo.automation.scripting.inline-context-in-params">true</property>
      </extension>
    </code>
  </documentation>

  <require>org.nuxeo.ecm.core.operation.OperationServiceComponent</require>

  <implementation class="org.nuxeo.automation.scripting.internals.AutomationScriptingComponent" />

  <service>
      <provide interface="org.nuxeo.automation.scripting.api.AutomationScriptingService" />
  </service>

   <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
     <documentation>
       Configuration property for enabling backward compatibility with scripting parameters where
       context variables were inlined.
     </documentation>
     <property name="nuxeo.automation.scripting.inline-context-in-params">false</property>
   </extension>

  <extension-point name="operation">
    <documentation>
      <code>
      <scriptedOperation id="Scripting.HelloWorld">
        <inputType>string</inputType>
        <outputType>string</outputType>
        <param name="lang" type="string"/>
        <script>
          function run(input, params) {
          if (params.lang === "fr") {
          return "Bonjour " + input;
          } else {
          return "Hello " + input;
          }
          }
        </script>
      </scriptedOperation>
      </code>
    </documentation>

    <object
      class="org.nuxeo.automation.scripting.internals.ScriptingOperationDescriptor" />
  </extension-point>

  <extension-point name="classFilter">
    <documentation>
      This can be used to allow additional classes to be accessible by the scripting engine.
      The deny element can be used to disallow classes allowed by previous contributions.
      By default, no classes are allowed.

      @since 10.2
      <code>
        <classFilter>
          <allow>java.util.ArrayList</allow>
          <allow>java.util.UUID</allow>
          <deny>java.io.File</deny>
          <deny>java.lang.Class</deny>
        </classFilter>
      </code>

      To deny everything from previous contributions and only allow specific classes, use:
      <code>
        <classFilter>
          <deny>*</deny>
          <allow>java.util.ArrayList</allow>
        </classFilter>
      </code>

    </documentation>

    <object class="org.nuxeo.automation.scripting.internals.ClassFilterDescriptor" />
  </extension-point>

</component>