Modified: portals/site-live/bridges/bridges-portletfilter/index.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-portletfilter/index.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-portletfilter/index.html (original) +++ portals/site-live/bridges/bridges-portletfilter/index.html Tue May 31 02:19:06 2022 @@ -1,305 +1,275 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - - - - - - - - - - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Apache Portals Bridges - About Apache Portals Portlet Filter</title> - <style type="text/css" media="all"> - @import url("../css/maven-base.css"); - @import url("../css/maven-theme.css"); - @import url("../css/site.css"); - </style> - <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> - </head> - <body class="composite"> - <div id="banner"> - <a href="http://portals.apache.org/" id="bannerLeft"> - - <img src="../images/apache-portals.gif" alt="" /> - - </a> - <a href="http://portals.apache.org/bridges/" id="bannerRight"> - - Apache Portals Bridges - - </a> - <div class="clear"> - <hr/> - </div> - </div> - <div id="breadcrumbs"> - - - - - - - - - <div class="xleft"> - Last Published: 29 September 2011 - </div> - <div class="xright"> <a href="http://portals.apache.org/" class="externalLink">Portals</a> - | - <a href="http://portals.apache.org/applications" class="externalLink">Applications</a> - | - <a href="http://portals.apache.org/jetspeed-2" class="externalLink">Jetspeed-2</a> - | - <a href="http://www.jcp.org/en/jsr/detail?id=168" class="externalLink">JSR-168</a> - | - <a href="http://www.jcp.org/en/jsr/detail?id=286" class="externalLink">JSR-286</a> - +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- Generated by Apache Maven Doxia Site Renderer 1.4 at 26 May 2022 --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Apache Portals Bridges - + About Apache Portals Portlet Filter</title> + <style type="text/css" media="all"> + @import url("../css/maven-base.css"); + @import url("../css/maven-theme.css"); + @import url("../css/site.css"); + </style> + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> + <meta name="Date-Revision-yyyymmdd" content="20220526" /> + <meta http-equiv="Content-Language" content="en" /> + + </head> + <body class="composite"> + <div id="banner"> + <a href="http://portals.apache.org/" id="bannerLeft"> + <img src="../images/apache-portals.gif" alt="Apache Software Foundation" /> + </a> + <a href="http://portals.apache.org/bridges/" id="bannerRight"> + Apache Portals Bridges + </a> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + + + <div class="xleft"> + <span id="publishDate">Last Published: 26 May 2022</span> + | <span id="projectVersion">Version: 1.0</span> + </div> + <div class="xright"> <a href="http://portals.apache.org/" class="externalLink" target="_nw" title="Portals">Portals</a> + | + <a href="http://portals.apache.org/applications" class="externalLink" target="_nw" title="Applications">Applications</a> + | + <a href="http://portals.apache.org/jetspeed-2" class="externalLink" target="_nw" title="Jetspeed-2">Jetspeed-2</a> + | + <a href="http://www.jcp.org/en/jsr/detail?id=168" class="externalLink" target="_nw" title="JSR-168">JSR-168</a> + | + <a href="http://www.jcp.org/en/jsr/detail?id=286" class="externalLink" target="_nw" title="JSR-286">JSR-286</a> + + + </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + + + <h5>Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../index.html" title="Overview">Overview</a> + </li> + <li class="none"> + <a href="../news.html" title="News and Status">News and Status</a> + </li> + </ul> + <h5>Current Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../bridges-common/index.html" title="Common Utilities and Interfaces">Common Utilities and Interfaces</a> + </li> + <li class="collapsed"> + <a href="../bridges-struts/index.html" title="Struts Bridge">Struts Bridge</a> + </li> + <li class="none"> + <a href="../bridges-velocity/index.html" title="Velocity Bridge">Velocity Bridge</a> + </li> + <li class="none"> + <a href="../bridges-script/index.html" title="Script Bridge">Script Bridge</a> + </li> + <li class="collapsed"> + <a href="../bridges-groovy/index.html" title="Groovy Bridge">Groovy Bridge</a> + </li> + </ul> + <h5>Archived Portals Bridges</h5> + <ul> + <li class="collapsed"> + <a href="../bridges-jsf/index.html" title="JSF Bridge">JSF Bridge</a> + </li> + <li class="collapsed"> + <a href="../bridges-php/index.html" title="PHP Bridge">PHP Bridge</a> + </li> + <li class="none"> + <a href="../bridges-perl/index.html" title="Perl Bridge">Perl Bridge</a> + </li> + <li class="none"> + <strong>Portlet Filter</strong> + </li> + </ul> + <h5>Get Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../download.html" title="Download">Download</a> + </li> + <li class="none"> + <a href="../release-notes.html" title="Release Notes">Release Notes</a> + </li> + </ul> + <h5>Support</h5> + <ul> + <li class="none"> + <a href="../team-list.html" title="Project Team">Project Team</a> + </li> + <li class="none"> + <a href="../license.html" title="Project License">Project License</a> + </li> + <li class="none"> + <a href="../mail-lists.html" title="Mailing List">Mailing List</a> + </li> + <li class="none"> + <a href="../issue-tracking.html" title="Issue Tracking">Issue Tracking</a> + </li> + </ul> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img class="poweredBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /> + </a> + + + </div> + </div> + <div id="bodyColumn"> + <div id="contentBox"> + <!-- Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. --> - - - - - - - </div> - <div class="clear"> - <hr/> - </div> - </div> - <div id="leftColumn"> - <div id="navcolumn"> - - - - - - - - - <h5>Portals Bridges</h5> - <ul> - - <li class="none"> - <a href="../index.html">Overview</a> - </li> - - <li class="none"> - <a href="../news.html">News and Status</a> - </li> - </ul> - <h5>Current Portals Bridges</h5> - <ul> - - <li class="none"> - <a href="../bridges-common/index.html">Common Utilities and Interfaces</a> - </li> - - - + <div class="section"> +<h2>About Apache Portals Portlet Filter<a name="About_Apache_Portals_Portlet_Filter"></a></h2> - - <li class="collapsed"> - <a href="../bridges-struts/index.html">Struts Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-velocity/index.html">Velocity Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-script/index.html">Script Bridge</a> - </li> - - - +<div class="section"> +<h3>Overview<a name="Overview"></a></h3> + +<p> + FilterPortlet enables you to add processes you want before and after accessing the target portlet. + The feature provided by FilterPortlet is like Servlet Filter. (Portlet Filter may be included in + the future Portlet Spec, but currently it's not included yet.) + </p> + </div> +<div class="section"> +<h3>Class and Interface<a name="Class_and_Interface"></a></h3> + +<p> + </p> +<table border="0" class="bodyTable"> + +<tr class="a"> + +<th>Class/Interface</th> + +<th>Description</th> + </tr> - +<tr class="b"> - <li class="collapsed"> - <a href="../bridges-groovy/index.html">Groovy Bridge</a> - </li> - </ul> - <h5>Archived Portals Bridges</h5> - <ul> +<td>FilterPortlet class</td> - - - +<td>FilterPortlet wraps the target portlet.</td> + </tr> - +<tr class="a"> - <li class="collapsed"> - <a href="../bridges-jsf/index.html">JSF Bridge</a> - </li> +<td>PortletFilter interface</td> - - - +<td>The process you want to add is implemented this interface.</td> + </tr> - - - - - <li class="collapsed"> - <a href="../bridges-php/index.html">PHP Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-perl/index.html">Perl Bridge</a> - </li> +<tr class="b"> - <li class="none"> - <strong>Portlet Filter</strong> - </li> - </ul> - <h5>Get Portals Bridges</h5> - <ul> +<td>PortletFilterChain class</td> - <li class="none"> - <a href="../download.html">Download</a> - </li> - - <li class="none"> - <a href="../release-notes.html">Release Notes</a> - </li> - </ul> - <h5>Support</h5> - <ul> - - <li class="none"> - <a href="../team-list.html">Project Team</a> - </li> - - <li class="none"> - <a href="../license.html">Project License</a> - </li> +<td> + This class is an object provided to the developer giving a view + into the invocation chain of a filtered request for a resource. + </td> + </tr> + +<tr class="a"> - <li class="none"> - <a href="../mail-lists.html">Mailing List</a> - </li> +<td>PortletFilterConfig class</td> - <li class="none"> - <a href="../issue-tracking.html">Issue Tracking</a> - </li> - </ul> - <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> - <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img> - </a> - - - - - - - - - </div> - </div> - <div id="bodyColumn"> - <div id="contentBox"> - <authors><person name="Shinsuke Sugaya" email="[email protected]"></authors><div class="section"><h2><a name="About_Apache_Portals_Portlet_Filter"></a>About Apache Portals Portlet Filter</h2> -<div class="section"><h3><a name="Overview"></a>Overview</h3> -<p> - FilterPortlet enables you to add processes you want before and after accessing the target portlet. - The feature provided by FilterPortlet is like Servlet Filter. (Portlet Filter may be included in - the future Portlet Spec, but currently it's not included yet.) - </p> -</div> -<div class="section"><h3><a name="Class_and_Interface"></a>Class and Interface</h3> -<p><table class="bodyTable"><tr class="a"><th>Class/Interface</th> -<th>Description</th> -</tr> -<tr class="b"><td>FilterPortlet class</td> -<td>FilterPortlet wraps the target portlet.</td> -</tr> -<tr class="a"><td>PortletFilter interface</td> -<td>The process you want to add is implemented this interface.</td> -</tr> -<tr class="b"><td>PortletFilterChain class</td> -<td> - This class is an object provided to the developer giving a view - into the invocation chain of a filtered request for a resource. - </td> -</tr> -<tr class="a"><td>PortletFilterConfig class</td> -<td> - A filter configuration object used by FilterPortlet to pass - information to a filter during initialization. - </td> -</tr> -</table> - - If you know how to use Servlet Filter, it's easy to use FilterPortlet. - </p> -</div> -<div class="section"><h3><a name="Example"></a>Example</h3> -<p> - For example, if you create "HelloWorldPortletFilter" as the portlet filter, portlet.xml is: - </p> -<p><div class="source"><pre> -<portlet-app id="helloworld" version="1.0"> - <portlet id="FilteredHelloWorld"> - <portlet-name>FilteredHelloWorld</portlet-name> - <display-name>Filtered Hello World</display-name> - <description>HelloWorld is a filtered portlet for testing</description> - <portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class> - <init-param> - <name>portlet-class</name> - <value>org.apache.portals.bridges.helloworld.HelloWorldPortlet</value> - </init-param> - <init-param> - <name>portlet-filters</name> - <value>org.apache.portals.bridges.helloworld.filter.HelloWorldPortletFilter</value> - </init-param> - <expiration-cache>-1</expiration-cache> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>VIEW</portlet-mode> - </supports> - <supported-locale>en</supported-locale> - <supported-locale>ja</supported-locale> - <resource-bundle>org.apache.portals.bridges.helloworld.resources.HelloWorldResources</resource-bundle> - <portlet-info> - <title>Filtered Hello World</title> - <short-title>This is a filtered portlet for testing</short-title> - <keywords>Hello,Test,PortletFilter</keywords> - </portlet-info> - </portlet> -</portlet-app> -</pre> -</div> -</p> -</div> -</div> - +<td> + A filter configuration object used by FilterPortlet to pass + information to a filter during initialization. + </td> + </tr> + </table> + If you know how to use Servlet Filter, it's easy to use FilterPortlet. + </div> - </div> - <div class="clear"> - <hr/> - </div> - <div id="footer"> - <div class="xright">© - 2004-2011 - - Apache Software Foundation - - - - - - - - - </div> - <div class="clear"> - <hr/> + +<div class="section"> +<h3>Example<a name="Example"></a></h3> + +<p> + For example, if you create "HelloWorldPortletFilter" as the portlet filter, portlet.xml is: + </p> + +<p> +</p> +<div class="source"> +<pre> +<portlet-app id="helloworld" version="1.0"> + <portlet id="FilteredHelloWorld"> + <portlet-name>FilteredHelloWorld</portlet-name> + <display-name>Filtered Hello World</display-name> + <description>HelloWorld is a filtered portlet for testing</description> + <portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class> + <init-param> + <name>portlet-class</name> + <value>org.apache.portals.bridges.helloworld.HelloWorldPortlet</value> + </init-param> + <init-param> + <name>portlet-filters</name> + <value>org.apache.portals.bridges.helloworld.filter.HelloWorldPortletFilter</value> + </init-param> + <expiration-cache>-1</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>ja</supported-locale> + <resource-bundle>org.apache.portals.bridges.helloworld.resources.HelloWorldResources</resource-bundle> + <portlet-info> + <title>Filtered Hello World</title> + <short-title>This is a filtered portlet for testing</short-title> + <keywords>Hello,Test,PortletFilter</keywords> + </portlet-info> + </portlet> +</portlet-app> +</pre></div> + </div> </div> - </body> -</html> + + + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + Copyright © 2004-2022 + <a href="http://www.apache.org/">Apache Software Foundation</a>. + All Rights Reserved. + + </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html>
Modified: portals/site-live/bridges/bridges-script/index.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-script/index.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-script/index.html (original) +++ portals/site-live/bridges/bridges-script/index.html Tue May 31 02:19:06 2022 @@ -1,647 +1,692 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - - - - - - - - - - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Apache Portals Bridges - Script Bridget Portlet Guide</title> - <style type="text/css" media="all"> - @import url("../css/maven-base.css"); - @import url("../css/maven-theme.css"); - @import url("../css/site.css"); - </style> - <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> - </head> - <body class="composite"> - <div id="banner"> - <a href="http://portals.apache.org/" id="bannerLeft"> - - <img src="../images/apache-portals.gif" alt="" /> - - </a> - <a href="http://portals.apache.org/bridges/" id="bannerRight"> - - Apache Portals Bridges - - </a> - <div class="clear"> - <hr/> - </div> - </div> - <div id="breadcrumbs"> - - - - - - - - - <div class="xleft"> - Last Published: 29 September 2011 - </div> - <div class="xright"> <a href="http://portals.apache.org/" class="externalLink">Portals</a> - | - <a href="http://portals.apache.org/applications" class="externalLink">Applications</a> - | - <a href="http://portals.apache.org/jetspeed-2" class="externalLink">Jetspeed-2</a> - | - <a href="http://www.jcp.org/en/jsr/detail?id=168" class="externalLink">JSR-168</a> - | - <a href="http://www.jcp.org/en/jsr/detail?id=286" class="externalLink">JSR-286</a> - - - - - - - - - </div> - <div class="clear"> - <hr/> - </div> - </div> - <div id="leftColumn"> - <div id="navcolumn"> - - - - - - +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- Generated by Apache Maven Doxia Site Renderer 1.4 at 26 May 2022 --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Apache Portals Bridges - + Script Bridget Portlet Guide</title> + <style type="text/css" media="all"> + @import url("../css/maven-base.css"); + @import url("../css/maven-theme.css"); + @import url("../css/site.css"); + </style> + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> + <meta name="Date-Revision-yyyymmdd" content="20220526" /> + <meta http-equiv="Content-Language" content="en" /> + + </head> + <body class="composite"> + <div id="banner"> + <a href="http://portals.apache.org/" id="bannerLeft"> + <img src="../images/apache-portals.gif" alt="Apache Software Foundation" /> + </a> + <a href="http://portals.apache.org/bridges/" id="bannerRight"> + Apache Portals Bridges + </a> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + + + <div class="xleft"> + <span id="publishDate">Last Published: 26 May 2022</span> + | <span id="projectVersion">Version: 1.0</span> + </div> + <div class="xright"> <a href="http://portals.apache.org/" class="externalLink" target="_nw" title="Portals">Portals</a> + | + <a href="http://portals.apache.org/applications" class="externalLink" target="_nw" title="Applications">Applications</a> + | + <a href="http://portals.apache.org/jetspeed-2" class="externalLink" target="_nw" title="Jetspeed-2">Jetspeed-2</a> + | + <a href="http://www.jcp.org/en/jsr/detail?id=168" class="externalLink" target="_nw" title="JSR-168">JSR-168</a> + | + <a href="http://www.jcp.org/en/jsr/detail?id=286" class="externalLink" target="_nw" title="JSR-286">JSR-286</a> + + + </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + + + <h5>Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../index.html" title="Overview">Overview</a> + </li> + <li class="none"> + <a href="../news.html" title="News and Status">News and Status</a> + </li> + </ul> + <h5>Current Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../bridges-common/index.html" title="Common Utilities and Interfaces">Common Utilities and Interfaces</a> + </li> + <li class="collapsed"> + <a href="../bridges-struts/index.html" title="Struts Bridge">Struts Bridge</a> + </li> + <li class="none"> + <a href="../bridges-velocity/index.html" title="Velocity Bridge">Velocity Bridge</a> + </li> + <li class="none"> + <strong>Script Bridge</strong> + </li> + <li class="collapsed"> + <a href="../bridges-groovy/index.html" title="Groovy Bridge">Groovy Bridge</a> + </li> + </ul> + <h5>Archived Portals Bridges</h5> + <ul> + <li class="collapsed"> + <a href="../bridges-jsf/index.html" title="JSF Bridge">JSF Bridge</a> + </li> + <li class="collapsed"> + <a href="../bridges-php/index.html" title="PHP Bridge">PHP Bridge</a> + </li> + <li class="none"> + <a href="../bridges-perl/index.html" title="Perl Bridge">Perl Bridge</a> + </li> + <li class="none"> + <a href="../bridges-portletfilter/index.html" title="Portlet Filter">Portlet Filter</a> + </li> + </ul> + <h5>Get Portals Bridges</h5> + <ul> + <li class="none"> + <a href="../download.html" title="Download">Download</a> + </li> + <li class="none"> + <a href="../release-notes.html" title="Release Notes">Release Notes</a> + </li> + </ul> + <h5>Support</h5> + <ul> + <li class="none"> + <a href="../team-list.html" title="Project Team">Project Team</a> + </li> + <li class="none"> + <a href="../license.html" title="Project License">Project License</a> + </li> + <li class="none"> + <a href="../mail-lists.html" title="Mailing List">Mailing List</a> + </li> + <li class="none"> + <a href="../issue-tracking.html" title="Issue Tracking">Issue Tracking</a> + </li> + </ul> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img class="poweredBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /> + </a> + + + </div> + </div> + <div id="bodyColumn"> + <div id="contentBox"> + <!-- Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. --> - - <h5>Portals Bridges</h5> - <ul> - - <li class="none"> - <a href="../index.html">Overview</a> - </li> - - <li class="none"> - <a href="../news.html">News and Status</a> - </li> - </ul> - <h5>Current Portals Bridges</h5> - <ul> - - <li class="none"> - <a href="../bridges-common/index.html">Common Utilities and Interfaces</a> - </li> - - - + <div class="section"> +<h2>Script Bridget Portlet Guide<a name="Script_Bridget_Portlet_Guide"></a></h2> - - <li class="collapsed"> - <a href="../bridges-struts/index.html">Struts Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-velocity/index.html">Velocity Bridge</a> - </li> - - <li class="none"> - <strong>Script Bridge</strong> - </li> - - - +<p> + This guide provides a tutorial for creating portlets with + <a class="externalLink" href="http://www.jcp.org/en/jsr/detail?id=223" target="_nw">JSR-223</a> + compliant scripting languages. + </p> +<div class="section"> +<h3>1. The ScriptPortlet<a name="a1._The_ScriptPortlet"></a></h3> + +<p> + The ScriptPortlet (org.apache.portals.bridges.script.ScriptPortlet) is the bridge portlet + which evaluates the scripted portlet source to initialize a portlet instance + and dispatch each invocation to the scripted portlet instance. + </p> + +<p> + In the portlet descriptor (portlet.xml), the ScriptPortlet is provided as portlet-class. + The ScriptPortlet is configured with some init parameters for script sources + which implement the real portlet or the real portlet preferences validator. + </p> + +<p> + <img src="../images/scriptload.png" alt="" /> + <br /> + </p> +<ol style="list-style-type: decimal"> + +<li>The ScriptPortlet initializes a ScriptEngine based on either engine name or the type of the script source.</li> +<li> + The ScriptPortlet evaluates the script source to load a scripted portlet. + If script preferences validator is also configured, it evaluates the validator script source to load a scripted preferences validator. + </li> + +<li> + The ScriptEngine returns an evaluated object to the ScriptPortlet. + Now, the ScriptPortlet dispatches all the invocations to the script objects. + <br /> + The evaluated object from the portlet script source must be either a javax.portlet.Portlet instance or a javax.portlet.Portlet class. + <br /> + Also, the evaluated object from the portlet script preferences validator must be either a javax.portlet.PreferencesValidator instance or a javax.portlet.PreferencesValidator class. + </li> + </ol> + + +<p> + With the ScriptPortlet bridge portlet, you can just provide your script sources. + The ScriptPortlet will care everything to create ScriptEngine and to use your script codes. + </p> + </div> - - <li class="collapsed"> - <a href="../bridges-groovy/index.html">Groovy Bridge</a> - </li> - </ul> - <h5>Archived Portals Bridges</h5> - <ul> - - - +<div class="section"> +<h3>2. Scripted 'Hello World!' Portlets with Groovy, JRuby, Jython, BeanShell and Rhino JavaScript<a name="a2._Scripted_Hello_World_Portlets_with_Groovy_JRuby_Jython_BeanShell_and_Rhino_JavaScript"></a></h3> + +<p>If you use a script language which is <a class="externalLink" href="http://www.jcp.org/en/jsr/detail?id=223" target="_nw">JSR-223</a> + compliant, then you can implement full-featured portlets with the script language.</p> + +<p>Here are "Hello, World!" example portlets implemented by Groovy, JRuby, Jython, BeanShell or Rhino JavaScript. You can choose any.</p> + + +<div class="section"> +<h4>Groovy example<a name="Groovy_example"></a></h4> + +<p> + In this example, HelloGroovy.groovy implements a simple portlet in Groovy. + </p> + +<p> + <b>Note:</b> The last statement creates a portlet instance to be passed + to the ScriptPortlet as script evaluation result via the ScriptEngine. + </p> + +<p> + </p> +<div class="source"> +<pre> +import javax.portlet.GenericPortlet; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; + +/** + * HelloGroovy.groovy + */ +public class HelloGroovy extends GenericPortlet +{ + public void doView(RenderRequest request, RenderResponse response) + { + String greeting = "<H1>Hello, Groovy!</H1>"; + response.getWriter().println(greeting); + } +} + +// Return portlet instance as a last evaluated object +// because ScriptPortlet expects the evaluated result object +// as a portlet class or non-initialized portlet instance. +new HelloGroovy(); + </pre></div> + + + </div> +<div class="section"> +<h4>JRuby example<a name="JRuby_example"></a></h4> + +<p> + In this example, HelloJRuby.rb implements a simple portlet in JRuby. + </p> + +<p> + <b>Note:</b> The last statement creates a portlet instance to be passed + to the ScriptPortlet as script evaluation result via the ScriptEngine. + </p> + +<p> + </p> +<div class="source"> +<pre> +require 'java' + +# +# HelloJRuby.rb +# +class HelloJRuby < javax.portlet.GenericPortlet + + def doView(request, response) + greeting = "<H1>Hello, JRuby!</H1>" + response.writer.println(greeting) + end + +end + +# Return portlet instance as a last evaluated object +# because ScriptPortlet expects the evaluated result object +# as a portlet class or non-initialized portlet instance. +HelloJRuby.new + </pre></div> + + + </div> +<div class="section"> +<h4>Jython example<a name="Jython_example"></a></h4> + +<p> + In this example, HelloJython.py implements a simple portlet in Jython. + </p> + +<p> + <b>Note:</b> The last statement creates a portlet instance to be passed + to the ScriptPortlet as script evaluation result via the ScriptEngine. + </p> + +<p> + </p> +<div class="source"> +<pre> +from javax.portlet import GenericPortlet + +# +# HelloJython.py +# +class HelloJython(GenericPortlet): + def doView(self, request, response): + greeting = "<H1>Hello, Jython!</H1>" + response.writer.println(greeting) + + + +# Return portlet instance as a last evaluated object +# because ScriptPortlet expects the evaluated result object +# as a portlet class or non-initialized portlet instance. +value = HelloJython() + </pre></div> + + + </div> +<div class="section"> +<h4>BeanShell example<a name="BeanShell_example"></a></h4> + +<p> + In this example, HelloBeanShell.bsh implements a simple portlet in BeanShell. + </p> + +<p> + <b>Note:</b> The last statement creates a portlet instance to be passed + to the ScriptPortlet as script evaluation result via the ScriptEngine. + </p> + +<p> + </p> +<div class="source"> +<pre> +import javax.portlet.GenericPortlet; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; + +/** + * HelloBeanShell.bsh + */ +class HelloBeanShell extends GenericPortlet +{ + public void doView(RenderRequest request, RenderResponse response) + { + String greeting = "<H1>Hello, BeanShell!</H1>"; + response.getWriter().println(greeting); + } +} + +// Return portlet instance as a last evaluated object +// because ScriptPortlet expects the evaluated result object +// as a portlet class or non-initialized portlet instance. +new HelloBeanShell(); + </pre></div> + + + </div> +<div class="section"> +<h4>Rhino JavaScript example<a name="Rhino_JavaScript_example"></a></h4> + +<p> + In this example, HelloRhino.js implements a simple portlet in Rhino JavaScript. + </p> + +<p> + <b>Note:</b> The last statement creates a portlet instance to be passed + to the ScriptPortlet as script evaluation result via the ScriptEngine. + </p> + +<p> + </p> +<div class="source"> +<pre> +importPackage(Packages.javax.portlet); + +/** + * HelloRhino.js + */ + +// Return portlet instance as a last evaluated object +// because ScriptPortlet expects the evaluated result object +// as a portlet class or non-initialized portlet instance. +new GenericPortlet( + { + doView: function(request, response) { + greeting = "<H1>Hello, Rhino JavaScript!</H1>"; + response.getWriter().println(greeting); + } + } +); + </pre></div> + + </div></div> - +<div class="section"> +<h3>3. The portlet.xml<a name="a3._The_portlet.xml"></a></h3> + +<p>Edit your portlet.xml like the following example.</p> + +<p>Please refer to the comments on each init parameter for details.</p> + +<p> + </p> +<div class="source"> +<pre> +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app id="velocitysimplest" version="1.0"> + + <portlet> + <portlet-name>HelloGroovy</portlet-name> + <display-name>Hello Groovy</display-name> + <portlet-class>org.apache.portals.bridges.script.ScriptPortlet</portlet-class> + + <!-- Optional init parameter for script engine + If this init parameter is not set, the ScriptPortlet will look up a script engine automatically + by the mimeType or the extension of the script source file. --> + <init-param> + <name>engine</name> + <!-- + Note: You can set other script engine which support JSR-223 ScriptEngine + such as 'groovy', 'jruby', 'jython'. + --> + <value>groovy</value> + </init-param> + + <!-- Optional init parameter for the key for portlet/preferencesValidator class or + portlet/preferencesValidator instance which is evaluated and returned by the script. + By default, when this init parameter is not set, ScriptPortlet retrieves + the last evaluated object from the script. + If you set this to 'value', then ScriptPortlet retrieves an object named 'value' + from the bindings of the script engine. + Depending on script engines, this init parameter should be properly configured + because some script engines do not return the last evaluated object. --> + <init-param> + <name>eval-key</name> + <value>value</value> + </init-param> + + <!-- Required init parameter for script source path --> + <init-param> + <name>source</name> + <!-- + Note: You can set script source in three ways. + The first is to use context relative path, + the second is to use file: url, + and the third is to classpath: uri. + Here are the examples for each way. + --> + <!-- + <value>/WEB-INF/groovy/HelloGroovy.groovy</value> + <value>file:/C:/Program Files/Tomcat/webapps/demo/WEB-INF/groovy/HelloGroovy.groovy</value> + <value>classpath:org/apache/portals/bridges/script/HelloGroovy.groovy</value> + --> + <value>classpath:org/apache/portals/bridges/script/HelloGroovy.groovy</value> + </init-param> + + <!-- Optional init parameter for script file content encoding. The default value is 'UTF-8'. --> + <init-param> + <name>encoding</name> + <value>UTF-8</value> + </init-param> + + <!-- Optional init parameter for auto-refresh option. + If auto-refresh is true, then a modification of script source can be refreshed automatically. + By default, this option is set to false. --> + <init-param> + <name>auto-refresh</name> + <value>true</value> + </init-param> + + <!-- Optional init parameter for refresh-delay option. + When auto-refresh is true, this init parameter sets the milliseconds of automatic refreshing interval. + By default, this option is set to 60000 milliseconds (a minute). --> + <init-param> + <name>refresh-delay</name> + <value>60000</value> + </init-param> + + <!-- Optional init parameter for script preferences validator path --> + <init-param> + <name>validator</name> + <!-- + Note: You can set script preferences validator source in three ways. + The first is to use context relative path, + the second is to use file: url, + and the third is to classpath: uri. + Here are the examples for each way. + --> + <!-- + <value>/WEB-INF/groovy/HelloGroovyPrefsValidator.groovy</value> + <value>file:/C:/Program Files/Tomcat/webapps/demo/WEB-INF/groovy/HelloGroovyPrefsValidator.groovy</value> + <value>classpath:org/apache/portals/bridges/script/HelloGroovyPrefsValidator.groovy</value> + --> + <value>classpath:org/apache/portals/bridges/script/HelloGroovyPrefsValidator.groovy</value> + </init-param> + + <!-- The followings are not special for ScriptPortlet, but normal configurations for a portlet. --> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + <portlet-mode>EDIT</portlet-mode> + <portlet-mode>HELP</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <portlet-info> + <title>Hello Groovy</title> + <short-title>Hello Groovy</short-title> + <keywords>demo,groovy</keywords> + </portlet-info> + <portlet-preferences> + <preference> + <name>message</name> + <value>Hello, Groovy!</value> + </preference> + <preferences-validator>org.apache.portals.bridges.script.ScriptPortletPreferencesValidator</preferences-validator> + </portlet-preferences> + + </portlet> + +</portlet-app> + </pre></div> + + </div> - - <li class="collapsed"> - <a href="../bridges-jsf/index.html">JSF Bridge</a> - </li> - - - +<div class="section"> +<h3>4. The Dependency JARs<a name="a4._The_Dependency_JARs"></a></h3> + +<p> + For simplicity, the following dependencies are provided for each script language. + </p> + +<div class="section"> +<h4>For Groovy Portlet Developers<a name="For_Groovy_Portlet_Developers"></a></h4> + +<p>You can add the following dependency only in your project to use ScriptPortlet with your preferred script langauge.</p> + +<p> + </p> +<div class="source"> +<pre> +<dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-script-dependencies-groovy</artifactId> + <version>2.0</version> + <type>pom</type> +</dependency> + </pre></div> + + </div> +<div class="section"> +<h4>For JRuby Portlet Developers<a name="For_JRuby_Portlet_Developers"></a></h4> + +<p>You can add the following dependency only in your project to use ScriptPortlet with your preferred script langauge.</p> + +<p> + </p> +<div class="source"> +<pre> +<dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-script-dependencies-jruby</artifactId> + <version>2.0</version> + <type>pom</type> +</dependency> + </pre></div> + + </div> +<div class="section"> +<h4>For Jython Portlet Developers<a name="For_Jython_Portlet_Developers"></a></h4> + +<p>You can add the following dependency only in your project to use ScriptPortlet with your preferred script langauge.</p> + +<p> + </p> +<div class="source"> +<pre> +<dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-script-dependencies-jython</artifactId> + <version>2.0</version> + <type>pom</type> +</dependency> + </pre></div> + + </div> +<div class="section"> +<h4>For BeanShell Portlet Developers<a name="For_BeanShell_Portlet_Developers"></a></h4> + +<p>You can add the following dependency only in your project to use ScriptPortlet with your preferred script langauge.</p> + +<p> + </p> +<div class="source"> +<pre> +<dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-script-dependencies-beanshell</artifactId> + <version>2.0</version> + <type>pom</type> +</dependency> + </pre></div> + + </div> +<div class="section"> +<h4>For Rhino JavaScript Portlet Developers<a name="For_Rhino_JavaScript_Portlet_Developers"></a></h4> + +<p>You can add the following dependency only in your project to use ScriptPortlet with your preferred script langauge.</p> + +<p> + </p> +<div class="source"> +<pre> +<dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-script-dependencies-rhino</artifactId> + <version>2.0</version> + <type>pom</type> +</dependency> + </pre></div> + + </div></div> - +<div class="section"> +<h3>5. Deploy the WAR file<a name="a5._Deploy_the_WAR_file"></a></h3> + +<p> + After building the war file, copy the war file of your portlet application to + <tt>$CATALINA_HOME/webapps/jetspeed/WEB-INF/deploy/</tt>. + Jetspeed-2 will deploy your portlet application automatically. + </p> + </div> - +<div class="section"> +<h3>6. The PSML<a name="a6._The_PSML"></a></h3> + +<p> + Add your script portlet into a portal page. + You must have the permission to add portlets into the page. + </p> + </div> - - <li class="collapsed"> - <a href="../bridges-php/index.html">PHP Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-perl/index.html">Perl Bridge</a> - </li> - - <li class="none"> - <a href="../bridges-portletfilter/index.html">Portlet Filter</a> - </li> - </ul> - <h5>Get Portals Bridges</h5> - <ul> - - <li class="none"> - <a href="../download.html">Download</a> - </li> - - <li class="none"> - <a href="../release-notes.html">Release Notes</a> - </li> - </ul> - <h5>Support</h5> - <ul> - - <li class="none"> - <a href="../team-list.html">Project Team</a> - </li> - - <li class="none"> - <a href="../license.html">Project License</a> - </li> - - <li class="none"> - <a href="../mail-lists.html">Mailing List</a> - </li> - - <li class="none"> - <a href="../issue-tracking.html">Issue Tracking</a> - </li> - </ul> - <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> - <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img> - </a> - - - - - - - - - </div> - </div> - <div id="bodyColumn"> - <div id="contentBox"> - <subtitle></subtitle><authors><person name="Woonsan Ko" email="[email protected]"></authors><div class="section"><h2><a name="Script_Bridget_Portlet_Guide"></a>Script Bridget Portlet Guide</h2> -<p> - This guide provides a tutorial for creating portlets with - <a href="http://www.jcp.org/en/jsr/detail?id=223" class="externalLink">JSR-223</a> - compliant scripting languages. - </p> -<div class="section"><h3><a name="a1._The_ScriptPortlet"></a>1. The ScriptPortlet</h3> -<p> - The <CODE>ScriptPortlet</CODE> (<CODE>org.apache.portals.bridges.script.ScriptPortlet</CODE>) is the bridge portlet - which evaluates the scripted portlet source to initialize a portlet instance - and dispatch each invocation to the scripted portlet instance. - </p> -<p> - In the portlet descriptor (portlet.xml), the <CODE>ScriptPortlet</CODE> is provided as portlet-class. - The <CODE>ScriptPortlet</CODE> is configured with some init parameters for script sources - which implement the real portlet or the real portlet preferences validator. - </p> -<p><img src="../images/scriptload.png" /><br /> -<ol type="1"><li>The <CODE>ScriptPortlet</CODE> initializes a <CODE>ScriptEngine</CODE> based on either engine name or the type of the script source.</li> -<li> - The <CODE>ScriptPortlet</CODE> evaluates the script source to load a scripted portlet. - If script preferences validator is also configured, it evaluates the validator script source to load a scripted preferences validator. - </li> -<li> - The <CODE>ScriptEngine</CODE> returns an evaluated object to the <CODE>ScriptPortlet</CODE>. - Now, the <CODE>ScriptPortlet</CODE> dispatches all the invocations to the script objects. - <br /> - - The evaluated object from the portlet script source must be either a <CODE>javax.portlet.Portlet</CODE> instance or a <CODE>javax.portlet.Portlet</CODE> class. - <br /> - - Also, the evaluated object from the portlet script preferences validator must be either a <CODE>javax.portlet.PreferencesValidator</CODE> instance or a <CODE>javax.portlet.PreferencesValidator</CODE> class. - </li> -</ol> -</p> -<p> - With the <CODE>ScriptPortlet</CODE> bridge portlet, you can just provide your script sources. - The <CODE>ScriptPortlet</CODE> will care everything to create <CODE>ScriptEngine</CODE> and to use your script codes. - </p> -</div> -<div class="section"><h3><a name="a2._Scripted_Hello_World_Portlets_with_Groovy_JRuby_Jython_BeanShell_and_Rhino_JavaScript"></a>2. Scripted 'Hello World!' Portlets with Groovy, JRuby, Jython, BeanShell and Rhino JavaScript</h3> -<p>If you use a script language which is <a href="http://www.jcp.org/en/jsr/detail?id=223" class="externalLink">JSR-223</a> - compliant, then you can implement full-featured portlets with the script language.</p> -<p>Here are "Hello, World!" example portlets implemented by Groovy, JRuby, Jython, BeanShell or Rhino JavaScript. You can choose any.</p> -<h4>Groovy example</h4> -<p> - In this example, <CODE>HelloGroovy.groovy</CODE> implements a simple portlet in Groovy. - </p> -<p><strong>Note:</strong> The last statement creates a portlet instance to be passed - to the <CODE>ScriptPortlet</CODE> as script evaluation result via the <CODE>ScriptEngine</CODE>. - </p> -<p><div class="source"><pre> -import javax.portlet.GenericPortlet; -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.EventRequest; -import javax.portlet.EventResponse; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.ResourceRequest; -import javax.portlet.ResourceResponse; - -/** - * HelloGroovy.groovy - */ -public class HelloGroovy extends GenericPortlet -{ - public void doView(RenderRequest request, RenderResponse response) - { - String greeting = "<H1>Hello, Groovy!</H1>"; - response.getWriter().println(greeting); - } -} - -// Return portlet instance as a last evaluated object -// because ScriptPortlet expects the evaluated result object -// as a portlet class or non-initialized portlet instance. -new HelloGroovy(); - </pre> -</div> -</p> -<h4>JRuby example</h4> -<p> - In this example, <CODE>HelloJRuby.rb</CODE> implements a simple portlet in JRuby. - </p> -<p><strong>Note:</strong> The last statement creates a portlet instance to be passed - to the <CODE>ScriptPortlet</CODE> as script evaluation result via the <CODE>ScriptEngine</CODE>. - </p> -<p><div class="source"><pre> -require 'java' - -# -# HelloJRuby.rb -# -class HelloJRuby < javax.portlet.GenericPortlet - - def doView(request, response) - greeting = "<H1>Hello, JRuby!</H1>" - response.writer.println(greeting) - end - -end - -# Return portlet instance as a last evaluated object -# because ScriptPortlet expects the evaluated result object -# as a portlet class or non-initialized portlet instance. -HelloJRuby.new - </pre> -</div> -</p> -<h4>Jython example</h4> -<p> - In this example, <CODE>HelloJython.py</CODE> implements a simple portlet in Jython. - </p> -<p><strong>Note:</strong> The last statement creates a portlet instance to be passed - to the <CODE>ScriptPortlet</CODE> as script evaluation result via the <CODE>ScriptEngine</CODE>. - </p> -<p><div class="source"><pre> -from javax.portlet import GenericPortlet - -# -# HelloJython.py -# -class HelloJython(GenericPortlet): - def doView(self, request, response): - greeting = "<H1>Hello, Jython!</H1>" - response.writer.println(greeting) - - - -# Return portlet instance as a last evaluated object -# because ScriptPortlet expects the evaluated result object -# as a portlet class or non-initialized portlet instance. -value = HelloJython() - </pre> -</div> -</p> -<h4>BeanShell example</h4> -<p> - In this example, <CODE>HelloBeanShell.bsh</CODE> implements a simple portlet in BeanShell. - </p> -<p><strong>Note:</strong> The last statement creates a portlet instance to be passed - to the <CODE>ScriptPortlet</CODE> as script evaluation result via the <CODE>ScriptEngine</CODE>. - </p> -<p><div class="source"><pre> -import javax.portlet.GenericPortlet; -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.EventRequest; -import javax.portlet.EventResponse; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.ResourceRequest; -import javax.portlet.ResourceResponse; - -/** - * HelloBeanShell.bsh - */ -class HelloBeanShell extends GenericPortlet -{ - public void doView(RenderRequest request, RenderResponse response) - { - String greeting = "<H1>Hello, BeanShell!</H1>"; - response.getWriter().println(greeting); - } -} - -// Return portlet instance as a last evaluated object -// because ScriptPortlet expects the evaluated result object -// as a portlet class or non-initialized portlet instance. -new HelloBeanShell(); - </pre> -</div> -</p> -<h4>Rhino JavaScript example</h4> -<p> - In this example, <CODE>HelloRhino.js</CODE> implements a simple portlet in Rhino JavaScript. - </p> -<p><strong>Note:</strong> The last statement creates a portlet instance to be passed - to the <CODE>ScriptPortlet</CODE> as script evaluation result via the <CODE>ScriptEngine</CODE>. - </p> -<p><div class="source"><pre> -importPackage(Packages.javax.portlet); - -/** - * HelloRhino.js - */ - -// Return portlet instance as a last evaluated object -// because ScriptPortlet expects the evaluated result object -// as a portlet class or non-initialized portlet instance. -new GenericPortlet( - { - doView: function(request, response) { - greeting = "<H1>Hello, Rhino JavaScript!</H1>"; - response.getWriter().println(greeting); - } - } -); - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a3._The_portlet.xml"></a>3. The portlet.xml</h3> -<p>Edit your portlet.xml like the following example.</p> -<p>Please refer to the comments on each init parameter for details.</p> -<p><div class="source"><pre> -<?xml version="1.0" encoding="UTF-8"?> -<portlet-app id="velocitysimplest" version="1.0"> - - <portlet> - <portlet-name>HelloGroovy</portlet-name> - <display-name>Hello Groovy</display-name> - <portlet-class>org.apache.portals.bridges.script.ScriptPortlet</portlet-class> - - <!-- Optional init parameter for script engine - If this init parameter is not set, the ScriptPortlet will look up a script engine automatically - by the mimeType or the extension of the script source file. --> - <init-param> - <name>engine</name> - <!-- - Note: You can set other script engine which support JSR-223 ScriptEngine - such as 'groovy', 'jruby', 'jython'. - --> - <value>groovy</value> - </init-param> - - <!-- Optional init parameter for the key for portlet/preferencesValidator class or - portlet/preferencesValidator instance which is evaluated and returned by the script. - By default, when this init parameter is not set, ScriptPortlet retrieves - the last evaluated object from the script. - If you set this to 'value', then ScriptPortlet retrieves an object named 'value' - from the bindings of the script engine. - Depending on script engines, this init parameter should be properly configured - because some script engines do not return the last evaluated object. --> - <init-param> - <name>eval-key</name> - <value>value</value> - </init-param> - - <!-- Required init parameter for script source path --> - <init-param> - <name>source</name> - <!-- - Note: You can set script source in three ways. - The first is to use context relative path, - the second is to use file: url, - and the third is to classpath: uri. - Here are the examples for each way. - --> - <!-- - <value>/WEB-INF/groovy/HelloGroovy.groovy</value> - <value>file:/C:/Program Files/Tomcat/webapps/demo/WEB-INF/groovy/HelloGroovy.groovy</value> - <value>classpath:org/apache/portals/bridges/script/HelloGroovy.groovy</value> - --> - <value>classpath:org/apache/portals/bridges/script/HelloGroovy.groovy</value> - </init-param> - - <!-- Optional init parameter for script file content encoding. The default value is 'UTF-8'. --> - <init-param> - <name>encoding</name> - <value>UTF-8</value> - </init-param> - - <!-- Optional init parameter for auto-refresh option. - If auto-refresh is true, then a modification of script source can be refreshed automatically. - By default, this option is set to false. --> - <init-param> - <name>auto-refresh</name> - <value>true</value> - </init-param> - - <!-- Optional init parameter for refresh-delay option. - When auto-refresh is true, this init parameter sets the milliseconds of automatic refreshing interval. - By default, this option is set to 60000 milliseconds (a minute). --> - <init-param> - <name>refresh-delay</name> - <value>60000</value> - </init-param> - - <!-- Optional init parameter for script preferences validator path --> - <init-param> - <name>validator</name> - <!-- - Note: You can set script preferences validator source in three ways. - The first is to use context relative path, - the second is to use file: url, - and the third is to classpath: uri. - Here are the examples for each way. - --> - <!-- - <value>/WEB-INF/groovy/HelloGroovyPrefsValidator.groovy</value> - <value>file:/C:/Program Files/Tomcat/webapps/demo/WEB-INF/groovy/HelloGroovyPrefsValidator.groovy</value> - <value>classpath:org/apache/portals/bridges/script/HelloGroovyPrefsValidator.groovy</value> - --> - <value>classpath:org/apache/portals/bridges/script/HelloGroovyPrefsValidator.groovy</value> - </init-param> - - <!-- The followings are not special for ScriptPortlet, but normal configurations for a portlet. --> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>VIEW</portlet-mode> - <portlet-mode>EDIT</portlet-mode> - <portlet-mode>HELP</portlet-mode> - </supports> - <supported-locale>en</supported-locale> - <portlet-info> - <title>Hello Groovy</title> - <short-title>Hello Groovy</short-title> - <keywords>demo,groovy</keywords> - </portlet-info> - <portlet-preferences> - <preference> - <name>message</name> - <value>Hello, Groovy!</value> - </preference> - <preferences-validator>org.apache.portals.bridges.script.ScriptPortletPreferencesValidator</preferences-validator> - </portlet-preferences> - - </portlet> - -</portlet-app> - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a4._The_Dependency_JARs"></a>4. The Dependency JARs</h3> -<p> - For simplicity, the following dependencies are provided for each script language. - </p> -<h4>For Groovy Portlet Developers</h4> -<p>You can add the following dependency only in your project to use <CODE>ScriptPortlet</CODE> with your preferred script langauge.</p> -<p><div class="source"><pre> -<dependency> - <groupId>org.apache.portals.bridges</groupId> - <artifactId>portals-bridges-script-dependencies-groovy</artifactId> - <version>2.0</version> - <type>pom</type> -</dependency> - </pre> -</div> -</p> -<h4>For JRuby Portlet Developers</h4> -<p>You can add the following dependency only in your project to use <CODE>ScriptPortlet</CODE> with your preferred script langauge.</p> -<p><div class="source"><pre> -<dependency> - <groupId>org.apache.portals.bridges</groupId> - <artifactId>portals-bridges-script-dependencies-jruby</artifactId> - <version>2.0</version> - <type>pom</type> -</dependency> - </pre> -</div> -</p> -<h4>For Jython Portlet Developers</h4> -<p>You can add the following dependency only in your project to use <CODE>ScriptPortlet</CODE> with your preferred script langauge.</p> -<p><div class="source"><pre> -<dependency> - <groupId>org.apache.portals.bridges</groupId> - <artifactId>portals-bridges-script-dependencies-jython</artifactId> - <version>2.0</version> - <type>pom</type> -</dependency> - </pre> -</div> -</p> -<h4>For BeanShell Portlet Developers</h4> -<p>You can add the following dependency only in your project to use <CODE>ScriptPortlet</CODE> with your preferred script langauge.</p> -<p><div class="source"><pre> -<dependency> - <groupId>org.apache.portals.bridges</groupId> - <artifactId>portals-bridges-script-dependencies-beanshell</artifactId> - <version>2.0</version> - <type>pom</type> -</dependency> - </pre> -</div> -</p> -<h4>For Rhino JavaScript Portlet Developers</h4> -<p>You can add the following dependency only in your project to use <CODE>ScriptPortlet</CODE> with your preferred script langauge.</p> -<p><div class="source"><pre> -<dependency> - <groupId>org.apache.portals.bridges</groupId> - <artifactId>portals-bridges-script-dependencies-rhino</artifactId> - <version>2.0</version> - <type>pom</type> -</dependency> - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a5._Deploy_the_WAR_file"></a>5. Deploy the WAR file</h3> -<p> - After building the war file, copy the war file of your portlet application to - <code>$CATALINA_HOME/webapps/jetspeed/WEB-INF/deploy/</code>. - Jetspeed-2 will deploy your portlet application automatically. - </p> -</div> -<div class="section"><h3><a name="a6._The_PSML"></a>6. The PSML</h3> -<p> - Add your script portlet into a portal page. - You must have the permission to add portlets into the page. - </p> -</div> -<div class="section"><h3><a name="a7._Additional_Notes"></a>7. Additional Notes</h3> -<p><em>Note:</em> You may need to increase the permanent generation size of your JVM to run script portlets without <CODE>OutOfMemoryError</CODE> errors. - <br /> - - Because JSR-223 Scripting Engine implementations depend on dynamic proxy solutions, it requires more permanent generation space. - By default, it is 64MB. Increasing it to be <CODE>-XX:MaxPermSize=128m</CODE> might be a good start. - <br /> - - Please see <a href="http://wiki.apache.org/tomcat/FAQ/Memory" class="externalLink">http://wiki.apache.org/tomcat/FAQ/Memory</a> for detail. - </p> -</div> -</div> - +<div class="section"> +<h3>7. Additional Notes<a name="a7._Additional_Notes"></a></h3> + +<p> + <i>Note:</i> You may need to increase the permanent generation size of your JVM to run script portlets without OutOfMemoryError errors. + <br /> + Because JSR-223 Scripting Engine implementations depend on dynamic proxy solutions, it requires more permanent generation space. + By default, it is 64MB. Increasing it to be -XX:MaxPermSize=128m might be a good start. + <br /> + Please see <a class="externalLink" href="http://wiki.apache.org/tomcat/FAQ/Memory">http://wiki.apache.org/tomcat/FAQ/Memory</a> for detail. + </p> </div> </div> - <div class="clear"> - <hr/> - </div> - <div id="footer"> - <div class="xright">© - 2004-2011 - - Apache Software Foundation - - - - - - - - </div> - <div class="clear"> - <hr/> - </div> - </div> - </body> -</html> + + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + Copyright © 2004-2022 + <a href="http://www.apache.org/">Apache Software Foundation</a>. + All Rights Reserved. + + </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html>
