ECM Scripts
Overview
As you probably already seen, there exist many different types of ECM groovy scripts. Indeed, if they all implements the CmsScript interface, there behavior is quite different. Therefor in the ECM Admin section dedicated to script management we have split the arganization in several areas.package org.exoplatform.services.cms.scripts; public interface CmsScript { public void execute(Object context); public void setParams(String[] params); }
ECM explorer scripts
There are three different types of scripts:- the Action ones: which will be launched when an ECM action trigger them (refer to "Actions Concept" section for more information on those).
- the Interceptor ones: which can be triggered before or after a JCR node creation or edition. They are used to either validate the user input from the form or to manipulate the newly created node (to map it with a forum thread or any other type of discussion areas)
- the Widget ones: which are used to fill widgets - such as selectbox - in a dynamic way.
Browse Content Portlet Scripts
The Browse Content portlet is used to provide to the end user several ways to extract the content from the JCR. One of that way is to use a Groovy script that will be responsible of the extraction. Note that the scripts are stored directly in the JCR tree under the production workspace at the path /jcr:system/exo:ecm/scripts. The scripts are Groovy ones and the JCR path there can be seen as the classpath as we modified the default Groovy classloader to look for the scripts directly in the relative JCR path. Each time a script is modified then the groovy classloader is reset.Manage script service
Script service manage groovy scripts.<component>
<key>org.exoplatform.services.cms.scripts.ScriptService</key>
<type>org.exoplatform.services.cms.scripts.ScriptServiceImpl</type>
.....................
</component><init-params>
<object-param>
<name>predefined.scripts</name>
<description>description</description>
<object type="org.exoplatform.services.cms.impl.ResourceConfig">
<field name="workspace"><string>production</string></field>
<field name="resources">
<collection type="java.util.ArrayList">
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<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="name"><string>ecm-explorer/action/SendMailScript.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>ecm-explorer/action/RSSScript.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>ecm-explorer/widget/SetJCRBrowserForProductionWorkspaceAndRulesPath.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>ecm-explorer/widget/SetJCRBrowserForProductionWorkspaceAndScriptsPath.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>ecm-explorer/widget/FillSelectBoxWithNodeChildren.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>ecm-explorer/action/TransformBinaryChildrenToTextScript.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<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="name"><string>ecm-explorer/interceptor/PostNodeSaveInterceptor.groovy</string></field>
</object>
</value>
<value>
<object type="org.exoplatform.services.cms.impl.ResourceConfig$Resource">
<field name="name"><string>content-browser/GetDocumentsFromWorkspaceAndPath.groovy</string></field>
</object>
</value>
</collection>
</field>
</object>
</object-param>
</init-params>
on 23/05/2007 at 09:09