2.2.4.19. Script

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

This plugin is used to add groovy scripts into the system.

To use the plugin in the component configuration, you must use the following target-component:


<target-component>org.exoplatform.services.cms.scripts.ScriptService</target-component>

The configuration is applied mainly in packaging/wcm/webapp/src/main/webapp/WEB-INF/conf/dms-extension/dms/dms-scripts-configuration.xml.

Sample configuration:


<external-component-plugins>
    <target-component>org.exoplatform.services.cms.scripts.ScriptService</target-component>
      <component-plugin>
        <name>manage.script.plugin</name>
        <set-method>addScriptPlugin</set-method>
        <type>org.exoplatform.services.cms.scripts.impl.ScriptPlugin</type>
        <description>Nothing</description>
        <init-params>
          <value-param>
            <name>autoCreateInNewRepository</name>
            <value>true</value>
          </value-param>
          <value-param>
            <name>predefinedScriptsLocation</name>
            <value>war:/conf/dms-extension/dms/artifacts</value>
          </value-param>
          <object-param>
            <name>predefined.scripts</name>
            <description>description</description>
            <object type="org.exoplatform.services.cms.impl.ResourceConfig">
              <field  name="resources">
                <collection type="java.util.ArrayList">
                  <!-- ecm-explorer/action -->
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Trash Document</string></field>
                      <field  name="name"><string>ecm-explorer/action/TrashFolder.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Enable Versioning</string></field>
                      <field  name="name"><string>ecm-explorer/action/EnableVersioning.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Auto Versioning</string></field>
                      <field  name="name"><string>ecm-explorer/action/AutoVersioning.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Add Metadata</string></field>
                      <field  name="name"><string>ecm-explorer/action/AddMetadata.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Add to Category</string></field>
                      <field  name="name"><string>ecm-explorer/action/AddToCategory.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Add to Favorites</string></field>
                      <field  name="name"><string>ecm-explorer/action/AddToFavorites.groovy</string></field>
                    </object>
                  </value>
                  <!-- ecm-explorer/widget -->
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Fill SelectBox With Metadatas</string></field>
                      <field  name="name"><string>ecm-explorer/widget/FillSelectBoxWithMetadatas.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Fill SelectBox With Workspaces</string></field>
                      <field  name="name"><string>ecm-explorer/widget/FillSelectBoxWithWorkspaces.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Fill SelectBox With Language</string></field>
                      <field  name="name"><string>ecm-explorer/widget/FillSelectBoxWithLanguage.groovy</string></field>
                    </object>
                  </value>
                  <!-- ecm-explorer/interceptor -->
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Pre Node Save Interceptor</string></field>
                      <field  name="name"><string>ecm-explorer/interceptor/PreNodeSaveInterceptor.groovy</string></field>
                    </object>
                  </value>
                  <value>
                    <object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
                      <field  name="description"><string>Post Node Save Interceptor</string></field>
                      <field  name="name"><string>ecm-explorer/interceptor/PostNodeSaveInterceptor.groovy</string></field>
                    </object>
                  </value>
                </collection>
              </field>
            </object>
          </object-param>
        </init-params>
       </component-plugin>
  </external-component-plugins>

In which:

Value-param Type Value Description
autoCreateInNewRepository Boolean true Enables/Disables the creation of the scripts in the newly created repository.
repository String repository The repository name.
predefinedScriptsLocation String war:/conf/dms-extension/dms/artifacts The location where the scripts are created.
Field Type Value Description
resource ArrayList {java.util.ArrayList} The resource name.
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus