Modified: portals/site-live/bridges/bridges-groovy/prefvalidate.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-groovy/prefvalidate.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-groovy/prefvalidate.html (original) +++ portals/site-live/bridges/bridges-groovy/prefvalidate.html Tue May 31 02:19:06 2022 @@ -1,374 +1,325 @@ -<!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 - How to use Groovy PreferencesValidator</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"> - - - - - - - - - <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> - +<!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 - + How to use Groovy PreferencesValidator</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="expanded"> + <a href="../bridges-groovy/index.html" title="Groovy Bridge">Groovy Bridge</a> + <ul> + <li class="none"> + <strong>Groovy PreferencesValidator Guide</strong> + </li> + <li class="none"> + <a href="../bridges-groovy/headersupport.html" title="Jetspeed HeaderPhase Support Guide">Jetspeed HeaderPhase Support Guide</a> + </li> + </ul> + </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. --> + + <div class="section"> +<h2>Jetspeed Groovy PreferencesValidator Guide<a name="Jetspeed_Groovy_PreferencesValidator_Guide"></a></h2> + +<p> + This guide provides a tutorial for creating a Groovy Preferences Validator. + </p> + +<div class="section"> +<h3>1. The Groovy PreferencesValidator Class<a name="a1._The_Groovy_PreferencesValidator_Class"></a></h3> - - - - <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> - +<p>Create the file HelloGroovyValidator.groovy in a directory called groovy-simplest/WEB-INF/classes: + </p> +<div class="source"> +<pre> +import javax.portlet.PortletPreferences; +import javax.portlet.PreferencesValidator; +import javax.portlet.ValidatorException; + +public class HelloGroovyValidator implements PreferencesValidator +{ + public void validate(PortletPreferences preferences) + { + String message = preferences.getValue("message", null); + + if (message == null || "".equals(message.trim())) + { + def failedKeys = [ "message" ]; + throw new ValidatorException("message must be set!", failedKeys); + } + } +} </pre></div> - - - - - - <li class="expanded"> - <a href="../bridges-groovy/index.html">Groovy Bridge</a> - <ul> - - <li class="none"> - <strong>Groovy PreferencesValidator Guide</strong> - </li> - - <li class="none"> - <a href="../bridges-groovy/headersupport.html">Jetspeed HeaderPhase Support Guide</a> - </li> - </ul> - </li> - </ul> - <h5>Archived Portals Bridges</h5> - <ul> - + </div> + +<div class="section"> +<h3>2. The portlet.xml<a name="a2._The_portlet.xml"></a></h3> + +<p> + Edit the file portlet.xml in the groovy-simplest/WEB-INF directory to add Groovy PreferencesValidator. In this case, <portlet-preferences> element is added to the previous example. + </p> +<div class="source"> +<pre> +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app id="velocitysimplest" version="1.0"> + <portlet id="HelloGroovy"> + <portlet-name>HelloGroovy</portlet-name> + <display-name>Hello Groovy Display Name</display-name> + <portlet-class>org.apache.portals.bridges.groovy.GroovyPortlet</portlet-class> + <init-param> + <name>script-source</name> + <!-- Note: You can set script source in three ways. + The first is to use relative path uri, + the second is to use file: url, + and the last is to classpath: uri --> + <!-- + <value>/WEB-INF/groovy/HelloGroovy.groovy</value> + <value>file:/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/demo/WEB-INF/groovy/HelloGroovy.groovy</value> + --> + <value>classpath:HelloGroovy.groovy</value> + </init-param> + <!-- If auto-refresh is true, then a modification of script source applies instantly. --> + <init-param> + <name>auto-refresh</name> + <value>true</value> + </init-param> + <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</title> + <short-title>Hello Groovy Short Title</short-title> + </portlet-info> + <portlet-preferences> + <preference> + <name>validator-script-source</name> + <!-- Note: You can set script source in two ways. + The first is to use classpath: path uri, + and the other is to file: url. + Note that relative path uri is not supported for preferences validator. --> + <value>classpath:HelloGroovyValidator.groovy</value> + <!-- + <value>file:/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/demo/WEB-INF/groovy/HelloGroovyValidator.groovy</value> + --> + <read-only>true</read-only> + </preference> + <preference> + <name>validator-auto-refresh</name> + <!-- If validator-auto-refresh is true, + then a modification of script source applies instantly. --> + <value>true</value> + <read-only>true</read-only> + </preference> + <preferences-validator>org.apache.portals.bridges.groovy.GroovyPreferencesValidator</preferences-validator> + </portlet-preferences> + </portlet> +</portlet-app> + </pre></div> + + </div> + +<div class="section"> +<h3>3. How to handle validation exception<a name="a3._How_to_handle_validation_exception"></a></h3> + +<p>If you set a preferences validator, you should handle a validation exception in your portlet code like the following example. The HelloGroovy.groovy in the previous example now handles validation exception during PortletPreferences.store() call. + </p> +<div class="source"> +<pre> + public void processAction(ActionRequest request, ActionResponse response) + { + String message = request.getParameter("message"); + + PortletPreferences prefs = request.getPreferences(); + prefs.setValue("message", message); + + try { + prefs.store(); + } catch (ValidatorException e) { + // send this error information to the rendering phase. + response.setRenderParameter("errorMessage", e.getMessage()); + } + } + </pre></div> - - + </div> - - - <li class="collapsed"> - <a href="../bridges-jsf/index.html">JSF Bridge</a> - </li> - +<div class="section"> +<h3>4. Additional Notes<a name="a4._Additional_Notes"></a></h3> - - - - - - - - <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="Jetspeed_Groovy_PreferencesValidator_Guide"></a>Jetspeed Groovy PreferencesValidator Guide</h2> -<p> - This guide provides a tutorial for creating a Groovy Preferences Validator. - </p> -<div class="section"><h3><a name="a1._The_Groovy_PreferencesValidator_Class"></a>1. The Groovy PreferencesValidator Class</h3> -<p>Create the file HelloGroovyValidator.groovy in a directory called groovy-simplest/WEB-INF/classes: - <div class="source"><pre> -import javax.portlet.PortletPreferences; -import javax.portlet.PreferencesValidator; -import javax.portlet.ValidatorException; +<p>In groovy, you can use powerful regular expressions like the following example: + </p> +<div class="source"> +<pre> + public void validate(PortletPreferences preferences) + { + // Let's assume that we have a preference for an email address. + String email = preferences.getValue("email", ""); + + if (!(email ==~ /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/)) + { + def failedKeys = [ "email" ]; + throw new ValidatorException("message must be set!", failedKeys); + } + } + </pre></div> + + </div> + </div> + -public class HelloGroovyValidator implements PreferencesValidator -{ - public void validate(PortletPreferences preferences) - { - String message = preferences.getValue("message", null); - - if (message == null || "".equals(message.trim())) - { - def failedKeys = [ "message" ]; - throw new ValidatorException("message must be set!", failedKeys); - } - } -} </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a2._The_portlet.xml"></a>2. The portlet.xml</h3> -<p> - Edit the file portlet.xml in the groovy-simplest/WEB-INF directory to add Groovy PreferencesValidator. In this case, <portlet-preferences> element is added to the previous example. - <div class="source"><pre> -<?xml version="1.0" encoding="UTF-8"?> -<portlet-app id="velocitysimplest" version="1.0"> - <portlet id="HelloGroovy"> - <portlet-name>HelloGroovy</portlet-name> - <display-name>Hello Groovy Display Name</display-name> - <portlet-class>org.apache.portals.bridges.groovy.GroovyPortlet</portlet-class> - <init-param> - <name>script-source</name> - <!-- Note: You can set script source in three ways. - The first is to use relative path uri, - the second is to use file: url, - and the last is to classpath: uri --> - <!-- - <value>/WEB-INF/groovy/HelloGroovy.groovy</value> - <value>file:/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/demo/WEB-INF/groovy/HelloGroovy.groovy</value> - --> - <value>classpath:HelloGroovy.groovy</value> - </init-param> - <!-- If auto-refresh is true, then a modification of script source applies instantly. --> - <init-param> - <name>auto-refresh</name> - <value>true</value> - </init-param> - <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</title> - <short-title>Hello Groovy Short Title</short-title> - </portlet-info> - <portlet-preferences> - <preference> - <name>validator-script-source</name> - <!-- Note: You can set script source in two ways. - The first is to use classpath: path uri, - and the other is to file: url. - Note that relative path uri is not supported for preferences validator. --> - <value>classpath:HelloGroovyValidator.groovy</value> - <!-- - <value>file:/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/demo/WEB-INF/groovy/HelloGroovyValidator.groovy</value> - --> - <read-only>true</read-only> - </preference> - <preference> - <name>validator-auto-refresh</name> - <!-- If validator-auto-refresh is true, - then a modification of script source applies instantly. --> - <value>true</value> - <read-only>true</read-only> - </preference> - <preferences-validator>org.apache.portals.bridges.groovy.GroovyPreferencesValidator</preferences-validator> - </portlet-preferences> - </portlet> -</portlet-app> - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a3._How_to_handle_validation_exception"></a>3. How to handle validation exception</h3> -<p>If you set a preferences validator, you should handle a validation exception in your portlet code like the following example. The HelloGroovy.groovy in the previous example now handles validation exception during PortletPreferences.store() call. - <div class="source"><pre> - public void processAction(ActionRequest request, ActionResponse response) - { - String message = request.getParameter("message"); - - PortletPreferences prefs = request.getPreferences(); - prefs.setValue("message", message); - - try { - prefs.store(); - } catch (ValidatorException e) { - // send this error information to the rendering phase. - response.setRenderParameter("errorMessage", e.getMessage()); - } - } - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a4._Additional_Notes"></a>4. Additional Notes</h3> -<p>In groovy, you can use powerful regular expressions like the following example: - <div class="source"><pre> - public void validate(PortletPreferences preferences) - { - // Let's assume that we have a preference for an email address. - String email = preferences.getValue("email", ""); - - if (!(email ==~ /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/)) - { - def failedKeys = [ "email" ]; - throw new ValidatorException("message must be set!", failedKeys); - } - } - </pre> -</div> -</p> -</div> -</div> - - </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>
Modified: portals/site-live/bridges/bridges-jsf/guide.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-jsf/guide.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-jsf/guide.html (original) +++ portals/site-live/bridges/bridges-jsf/guide.html Tue May 31 02:19:06 2022 @@ -1,422 +1,393 @@ -<!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 - Jetspeed Simple JSF 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"> - - - - - - - - - <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> - - - - - - <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> - - - - - - - - <li class="collapsed"> - <a href="../bridges-groovy/index.html">Groovy Bridge</a> - </li> - </ul> - <h5>Archived Portals Bridges</h5> - <ul> - - - - - - - - <li class="expanded"> - <a href="../bridges-jsf/index.html">JSF Bridge</a> - <ul> - - <li class="none"> - <strong>Guide</strong> - </li> - - <li class="none"> - <a href="../bridges-jsf/myfaces-demo.html">MyFaces Demo</a> - </li> - </ul> - </li> - - - - - - - - - - <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="David Le Strat" email="[email protected]"><person name="Philip Mark Donaghy" email="[email protected]"></authors><div class="section"><h2><a name="Jetspeed_Simple_JSF_Portlet_Guide"></a>Jetspeed Simple JSF Portlet Guide</h2> -<p> - This guide provides a tutorial for creating a very - simple JSF portlet with one template in the portlet view mode. - </p> -<div class="section"><h3><a name="a1._The_Portlet_Class"></a>1. The Portlet Class</h3> -<p> - Create the file JSFSimplest.java in a directory called - jsf-simplest/WEB-INF/classes: - <div class="source"><pre> -public class JSFSimplest extends org.apache.portals.bridges.jsf.FacesPortlet -{ - - public void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) - throws javax.portlet.PortletException, java.io.IOException - { - super.doView(request, response); - } -} - </pre> -</div> -</p> -<p> - Compile the class in the jsf-simplest/WEB-INF/classes directory using the command, - <div class="source"><pre> -javac -cp portlet-api-1.0.jar:portals-bridges-jsf-1.0.jar:portals-bridges-common-1.0.jar JSFSimplest.java - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a2._The_portlet.xml"></a>2. The portlet.xml</h3> -<p> - Create the file portlet.xml in the jsf-simplest/WEB-INF directory. - <div class="source"><pre> -<?xml version="1.0" encoding="UTF-8"?> -<portlet-app id="jsfsimplest" version="1.0"> - <portlet id="JSFSimplest"> - <portlet-name>JSFSimplestPortlet</portlet-name> - <display-name>JSF Simplest Display Name</display-name> - <portlet-class>JSFSimplest</portlet-class> - <init-param> - <name>ViewPage</name> - <value>/WEB-INF/view/view.jsp</value> - </init-param> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>VIEW</portlet-mode> - </supports> - <supported-locale>en</supported-locale> - <supported-locale>fr</supported-locale> - <portlet-info> - <title>JSF Simplest Title</title> - <short-title>JSF Simplest Short Title</short-title> - </portlet-info> - </portlet> -</portlet-app> - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a3._The_web.xml"></a>3. The web.xml</h3> -<p> - Create the file web.xml in the jsf-simplest/WEB-INF directory. - <div class="source"><pre> -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> -<web-app> - <display-name>JSF Simplest</display-name> - <description>The world's simplest JSF portlet</description> - - <!-- Faces Config --> - <context-param> - <param-name>javax.faces.application.CONFIG_FILES</param-name> - <param-value>/WEB-INF/faces-config.xml</param-value> - </context-param> - - <!-- Faces Servlet --> - <servlet> - <servlet-name>Faces Servlet</servlet-name> - <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> - </servlet> +<!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 - + Jetspeed Simple JSF 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"> + <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="expanded"> + <a href="../bridges-jsf/index.html" title="JSF Bridge">JSF Bridge</a> + <ul> + <li class="none"> + <strong>Guide</strong> + </li> + <li class="none"> + <a href="../bridges-jsf/myfaces-demo.html" title="MyFaces Demo">MyFaces Demo</a> + </li> + </ul> + </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. --> + + <div class="section"> +<h2>Jetspeed Simple JSF Portlet Guide<a name="Jetspeed_Simple_JSF_Portlet_Guide"></a></h2> + +<p> + This guide provides a tutorial for creating a very + simple JSF portlet with one template in the portlet view mode. + </p> + +<div class="section"> +<h3>1. The Portlet Class<a name="a1._The_Portlet_Class"></a></h3> + +<p> + Create the file JSFSimplest.java in a directory called + jsf-simplest/WEB-INF/classes: + </p> +<div class="source"> +<pre> +public class JSFSimplest extends org.apache.portals.bridges.jsf.FacesPortlet +{ + + public void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) + throws javax.portlet.PortletException, java.io.IOException + { + super.doView(request, response); + } +} + </pre></div> + + +<p> + Compile the class in the jsf-simplest/WEB-INF/classes directory using the command, + </p> +<div class="source"> +<pre> +javac -cp portlet-api-1.0.jar:portals-bridges-jsf-1.0.jar:portals-bridges-common-1.0.jar JSFSimplest.java + </pre></div> + + </div> + +<div class="section"> +<h3>2. The portlet.xml<a name="a2._The_portlet.xml"></a></h3> + +<p> + Create the file portlet.xml in the jsf-simplest/WEB-INF directory. + </p> +<div class="source"> +<pre> +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app id="jsfsimplest" version="1.0"> + <portlet id="JSFSimplest"> + <portlet-name>JSFSimplestPortlet</portlet-name> + <display-name>JSF Simplest Display Name</display-name> + <portlet-class>JSFSimplest</portlet-class> + <init-param> + <name>ViewPage</name> + <value>/WEB-INF/view/view.jsp</value> + </init-param> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>fr</supported-locale> + <portlet-info> + <title>JSF Simplest Title</title> + <short-title>JSF Simplest Short Title</short-title> + </portlet-info> + </portlet> +</portlet-app> + </pre></div> + + </div> + +<div class="section"> +<h3>3. The web.xml<a name="a3._The_web.xml"></a></h3> + +<p> + Create the file web.xml in the jsf-simplest/WEB-INF directory. + </p> +<div class="source"> +<pre> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> + <display-name>JSF Simplest</display-name> + <description>The world's simplest JSF portlet</description> + + <!-- Faces Config --> + <context-param> + <param-name>javax.faces.application.CONFIG_FILES</param-name> + <param-value>/WEB-INF/faces-config.xml</param-value> + </context-param> + + <!-- Faces Servlet --> + <servlet> + <servlet-name>Faces Servlet</servlet-name> + <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> + </servlet> + + <!-- Faces extension mapping --> + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>*.jsf</url-pattern> + </servlet-mapping> +</web-app> + </pre></div> + + </div> + +<div class="section"> +<h3>4. The View<a name="a4._The_View"></a></h3> + +<p> + Create the view.jsp file in the jsf-simplest/WEB-INF/view directory. +</p> +<div class="source"> +<pre> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix='portlet'%> +<portlet:defineObjects/> +<f:view> + <h2>A JSF Portlet</h2> + Hello + <% if ( renderRequest.getUserPrincipal() == null ) { %> + guest + <% } else { %> + <%=renderRequest.getUserPrincipal().getName()%> + <% } %>! +</f:view> +</pre></div> + + </div> + +<div class="section"> +<h3>5. The faces-config.xml<a name="a5._The_faces-config.xml"></a></h3> + +<p> + Create a faces-config.xml file in the jsf-simplest/WEB-INF directory. +</p> +<div class="source"> +<pre> +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE faces-config PUBLIC + "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" + "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> + +<faces-config> + + <application> + <locale-config> + <default-locale>en</default-locale> + <supported-locale>fr</supported-locale> + </locale-config> + </application> + +</faces-config> +</pre></div> + + </div> + +<div class="section"> +<h3>6. The Dependency JARs<a name="a6._The_Dependency_JARs"></a></h3> + +<p> + Copy the dependencies to the WEB-INF/lib directory. + These jars should be in your Maven repository. If so executing these commands in the lib + directory will set up the dependencies for you. +</p> +<div class="source"> +<pre> +ln -s ~/.maven/repository/commons-beanutils/jars/commons-beanutils-1.7.0.jar +ln -s ~/.maven/repository/commons-collections/jars/commons-collections-3.1.jar +ln -s ~/.maven/repository/commons-digester/jars/commons-digester-1.7.jar +ln -s ~/.maven/repository/myfaces/jars/myfaces-api-1.1.0.jar +ln -s ~/.maven/repository/myfaces/jars/myfaces-impl-1.1.0.jar +ln -s ~/.maven/repository/myfaces/jars/tomahawk-1.1.0.jar +ln -s ~/.maven/repository/org.apache.portals.bridges/jars/portals-bridges-jsf-1.0.jar +ln -s ~/.maven/repository/xerces/jars/xerces-2.4.0.jar +ln -s ~/.maven/repository/xml-apis/jars/xml-apis-2.0.2.jar +</pre></div> + + </div> + +<div class="section"> +<h3>7. The WAR file<a name="a7._The_WAR_file"></a></h3> + +<p> + From the directory jsf-simplest combine the files above into a war file using the command, + </p> +<div class="source"> +<pre> +jar cvf ../jsfsimplest.war . + </pre></div> + + </div> + +<div class="section"> +<h3>8. Deploy the WAR file<a name="a8._Deploy_the_WAR_file"></a></h3> + +<p> + Copy the war file to <tt>$CATALINA_HOME/webapps/jetspeed/WEB-INF/deploy</tt>. + Jetspeed-2 will deploy the webapp. + </p> + </div> + +<div class="section"> +<h3>9. The PSML<a name="a9._The_PSML"></a></h3> + +<p> + Create the PSML page using the Jetspeed portlet chooser. Login and click on the + edit page icon. Click on the add portlet icon. + Checkbox and add the JSFSimplestPortlet to your page. + Your user must have the permission to edit pages. The user <tt>admin</tt> + password + <tt>admin</tt> has permission to edit all pages. + </p> + </div> + </div> + - <!-- Faces extension mapping --> - <servlet-mapping> - <servlet-name>Faces Servlet</servlet-name> - <url-pattern>*.jsf</url-pattern> - </servlet-mapping> -</web-app> - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a4._The_View"></a>4. The View</h3> -<p> - Create the view.jsp file in the jsf-simplest/WEB-INF/view directory. -<div class="source"><pre> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix='portlet'%> -<portlet:defineObjects/> -<f:view> - <h2>A JSF Portlet</h2> - Hello - <% if ( renderRequest.getUserPrincipal() == null ) { %> - guest - <% } else { %> - <%=renderRequest.getUserPrincipal().getName()%> - <% } %>! -</f:view> -</pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a5._The_faces-config.xml"></a>5. The faces-config.xml</h3> -<p> - Create a faces-config.xml file in the jsf-simplest/WEB-INF directory. -<div class="source"><pre> -<?xml version='1.0' encoding='UTF-8'?> -<!DOCTYPE faces-config PUBLIC - "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" - "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> - -<faces-config> - - <application> - <locale-config> - <default-locale>en</default-locale> - <supported-locale>fr</supported-locale> - </locale-config> - </application> - -</faces-config> -</pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a6._The_Dependency_JARs"></a>6. The Dependency JARs</h3> -<p> - Copy the dependencies to the WEB-INF/lib directory. - These jars should be in your Maven repository. If so executing these commands in the lib - directory will set up the dependencies for you. -<div class="source"><pre> -ln -s ~/.maven/repository/commons-beanutils/jars/commons-beanutils-1.7.0.jar -ln -s ~/.maven/repository/commons-collections/jars/commons-collections-3.1.jar -ln -s ~/.maven/repository/commons-digester/jars/commons-digester-1.7.jar -ln -s ~/.maven/repository/myfaces/jars/myfaces-api-1.1.0.jar -ln -s ~/.maven/repository/myfaces/jars/myfaces-impl-1.1.0.jar -ln -s ~/.maven/repository/myfaces/jars/tomahawk-1.1.0.jar -ln -s ~/.maven/repository/org.apache.portals.bridges/jars/portals-bridges-jsf-1.0.jar -ln -s ~/.maven/repository/xerces/jars/xerces-2.4.0.jar -ln -s ~/.maven/repository/xml-apis/jars/xml-apis-2.0.2.jar -</pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a7._The_WAR_file"></a>7. The WAR file</h3> -<p> - From the directory jsf-simplest combine the files above into a war file using the command, - <div class="source"><pre> -jar cvf ../jsfsimplest.war . - </pre> -</div> -</p> -</div> -<div class="section"><h3><a name="a8._Deploy_the_WAR_file"></a>8. Deploy the WAR file</h3> -<p> - Copy the war file to <code>$CATALINA_HOME/webapps/jetspeed/WEB-INF/deploy</code>. - Jetspeed-2 will deploy the webapp. - </p> -</div> -<div class="section"><h3><a name="a9._The_PSML"></a>9. The PSML</h3> -<p> - Create the PSML page using the Jetspeed portlet chooser. Login and click on the - edit page icon. Click on the add portlet icon. - Checkbox and add the JSFSimplestPortlet to your page. - Your user must have the permission to edit pages. The user <code>admin</code> - password - <code>admin</code> has permission to edit all pages. - </p> -</div> -</div> - - </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> Modified: portals/site-live/bridges/bridges-jsf/index.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-jsf/index.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-jsf/index.html (original) +++ portals/site-live/bridges/bridges-jsf/index.html Tue May 31 02:19:06 2022 @@ -1,5 +1,5 @@ <!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 1 May 2015 --> +<!-- 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" /> @@ -11,7 +11,7 @@ @import url("../css/site.css"); </style> <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> - <meta name="Date-Revision-yyyymmdd" content="20150501" /> + <meta name="Date-Revision-yyyymmdd" content="20220526" /> <meta http-equiv="Content-Language" content="en" /> </head> @@ -31,7 +31,7 @@ <div class="xleft"> - <span id="publishDate">Last Published: 1 May 2015</span> + <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> @@ -137,96 +137,96 @@ </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 class="section"> -<h2>About Apache Portals JSF Bridge<a name="About_Apache_Portals_JSF_Bridge"></a></h2> - -<p> - The JSF Bridge allows <a class="externalLink" href="http://java.sun.com/j2ee/javaserverfaces/">Java Server Faces</a> to be run - as <a class="externalLink" href="http://www.jcp.org/en/jsr/detail?id=168">JSR-168</a> compliant Portlets with very little change - made to the JSF application. - </p> - -<p> - Existing or new JSF Applications can be transparently deployed as Portlet Application or - Web Application.<br /> - </p> - -<p> - The latest release of Portals JSF Bridge is <a class="externalLink" href="http://www.apache.org/dyn/closer.cgi/portals/bridges/sources/portals-bridges-jsf-1.1-source-release.zip">version 1.1</a> - </p> - -<p> - For examples of how to use the JSF bridge, please go to the - <a href="../jsf-demo/index.html">JSF Portlet Demo</a> application which J2's JSF Portlet Bridge. - </p> - -<p> - J2's portlet bridge provides a generic JSF portlet that can be extended by your custom application or configured - in <i>portlet.xml</i> in order to run a JSF application. - </p> - -<p> - The <i><init-param></i> element of the <i>portlet.xml</i> can be configured to support multiple view when using - <i>org.apache.portals.bridges.jsf.FacesPortlet</i> as a portlet class. - </p> - -<p> - </p> -<table border="0" class="bodyTable"> - -<tr class="a"> - -<th><init-param></th> - -<th>Description</th> - </tr> - -<tr class="b"> - -<td>ViewPage</td> - -<td>The default page in view mode.</td> - </tr> - -<tr class="a"> - -<td>EditPage</td> - -<td>The default page in edit mode.</td> - </tr> - -<tr class="b"> - -<td>HelpPage</td> - -<td>The default page in help mode.</td> - </tr> - -<tr class="a"> - -<td>CustomPage</td> - -<td>The default page in custom mode.</td> - </tr> - </table> - - </div> - + <!-- 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 class="section"> +<h2>About Apache Portals JSF Bridge<a name="About_Apache_Portals_JSF_Bridge"></a></h2> + +<p> + The JSF Bridge allows <a class="externalLink" href="http://java.sun.com/j2ee/javaserverfaces/">Java Server Faces</a> to be run + as <a class="externalLink" href="http://www.jcp.org/en/jsr/detail?id=168">JSR-168</a> compliant Portlets with very little change + made to the JSF application. + </p> + +<p> + Existing or new JSF Applications can be transparently deployed as Portlet Application or + Web Application.<br /> + </p> + +<p> + The latest release of Portals JSF Bridge is <a class="externalLink" href="http://www.apache.org/dyn/closer.cgi/portals/bridges/sources/portals-bridges-jsf-1.1-source-release.zip">version 1.1</a> + </p> + +<p> + For examples of how to use the JSF bridge, please go to the + <a href="../jsf-demo/index.html">JSF Portlet Demo</a> application which J2's JSF Portlet Bridge. + </p> + +<p> + J2's portlet bridge provides a generic JSF portlet that can be extended by your custom application or configured + in <i>portlet.xml</i> in order to run a JSF application. + </p> + +<p> + The <i><init-param></i> element of the <i>portlet.xml</i> can be configured to support multiple view when using + <i>org.apache.portals.bridges.jsf.FacesPortlet</i> as a portlet class. + </p> + +<p> + </p> +<table border="0" class="bodyTable"> + +<tr class="a"> + +<th><init-param></th> + +<th>Description</th> + </tr> + +<tr class="b"> + +<td>ViewPage</td> + +<td>The default page in view mode.</td> + </tr> + +<tr class="a"> + +<td>EditPage</td> + +<td>The default page in edit mode.</td> + </tr> + +<tr class="b"> + +<td>HelpPage</td> + +<td>The default page in help mode.</td> + </tr> + +<tr class="a"> + +<td>CustomPage</td> + +<td>The default page in custom mode.</td> + </tr> + </table> + + </div> + </div> </div> @@ -235,7 +235,7 @@ limitations under the License. --> </div> <div id="footer"> <div class="xright"> - Copyright © 2004-2015 + Copyright © 2004-2022 <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved. Modified: portals/site-live/bridges/bridges-jsf/myfaces-demo.html URL: http://svn.apache.org/viewvc/portals/site-live/bridges/bridges-jsf/myfaces-demo.html?rev=1901429&r1=1901428&r2=1901429&view=diff ============================================================================== --- portals/site-live/bridges/bridges-jsf/myfaces-demo.html (original) +++ portals/site-live/bridges/bridges-jsf/myfaces-demo.html Tue May 31 02:19:06 2022 @@ -1,304 +1,250 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!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 - + Jetspeed MyFaces Demo Portlet Configuration</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="expanded"> + <a href="../bridges-jsf/index.html" title="JSF Bridge">JSF Bridge</a> + <ul> + <li class="none"> + <a href="../bridges-jsf/guide.html" title="Guide">Guide</a> + </li> + <li class="none"> + <strong>MyFaces Demo</strong> + </li> + </ul> + </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. --> + +<div class="section"> +<h2>Introduction<a name="Introduction"></a></h2> + +<p> +Jetspeed MyFaces Demo Portlet leverages Sun's Guess Number reference implementation sample application to +illustrate how a MyFaces based portlet using Jetspeed 2 JSF bridge should be configured. +</p> + +<p> +Jetspeed 2 provides a JSF bridge implementation to support JSF with the Portlet Specifications. This section describes +the necessary configuration required in order to use Jetspeed 2 JSF bridge. +</p> +</div> + +<div class="section"> +<h2>Configuration MyFaces as a Portlet<a name="Configuration_MyFaces_as_a_Portlet"></a></h2> + +<p> +The modifications required in order to deploy a MyFaces application as a portlet need to be made to the +<i>portlet.xml</i> file. An <i><init-param></i> should be added to the <i>portlet.xml</i> as described below: +</p> +<div class="source"> +<pre> +<init-param> + <name>ViewPage</name> + <value>/greeting.jsp</value> +</init-param> +</pre></div> + + +<p> +The parameter <i>ViewPage</i> indicates to the <i>org.apache.portals.bridges.jsf.FacesPortlet</i> which view +should be used as a default view. +</p> + +<p> +Additionally, the <portlet-class> element should specify the MyFaces generic portlet implementation as described +below: +</p> +<div class="source"> +<pre> +<portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class> +</pre></div> + + +<p> +This final <i>portlet.xml</i> should look like: +</p> +<div class="source"> +<pre> +<portlet id="guessNumber"> + <init-param> + <name>ViewPage</name> + <value>/greeting.jsp</value> + </init-param> + <description>JSF GuessNumber Portlet - Using J2 JSF Bridge</description> + <portlet-name>guessNumber</portlet-name> + <display-name>JSF GuessNumber Portlet - J2 JSF Bridge</display-name> + <portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class> + + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + <portlet-mode>EDIT</portlet-mode> + <portlet-mode>HELP</portlet-mode> + </supports> + + <portlet-info> + <title>GuessNumber Portlet</title> + <short-title>guessNumber</short-title> + </portlet-info> +</portlet> +</pre></div> +</div> - - - - - - - - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Apache Portals Bridges - Jetspeed MyFaces Demo Portlet Configuration</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"> - - - - - - - - - <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> - - - - - - <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> - - - - - - - - <li class="collapsed"> - <a href="../bridges-groovy/index.html">Groovy Bridge</a> - </li> - </ul> - <h5>Archived Portals Bridges</h5> - <ul> - - - - - - - - <li class="expanded"> - <a href="../bridges-jsf/index.html">JSF Bridge</a> - <ul> - - <li class="none"> - <a href="../bridges-jsf/guide.html">Guide</a> - </li> - - <li class="none"> - <strong>MyFaces Demo</strong> - </li> - </ul> - </li> - - - - - - - - - - <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="David Le Strat" email="[email protected]"></authors><div class="section"><h2><a name="Introduction"></a>Introduction</h2> -<p> -Jetspeed MyFaces Demo Portlet leverages Sun's Guess Number reference implementation sample application to -illustrate how a MyFaces based portlet using Jetspeed 2 JSF bridge should be configured. -</p> -<p> -Jetspeed 2 provides a JSF bridge implementation to support JSF with the Portlet Specifications. This section describes -the necessary configuration required in order to use Jetspeed 2 JSF bridge. -</p> -</div> -<div class="section"><h2><a name="Configuration_MyFaces_as_a_Portlet"></a>Configuration MyFaces as a Portlet</h2> -<p> -The modifications required in order to deploy a MyFaces application as a portlet need to be made to the -<i>portlet.xml</i> file. An <i><init-param></i> should be added to the <i>portlet.xml</i> as described below: -<div class="source"><pre> -<init-param> - <name>ViewPage</name> - <value>/greeting.jsp</value> -</init-param> -</pre> -</div> -</p> -<p> -The parameter <i>ViewPage</i> indicates to the <i>org.apache.portals.bridges.jsf.FacesPortlet</i> which view -should be used as a default view. -</p> -<p> -Additionally, the <portlet-class> element should specify the MyFaces generic portlet implementation as described -below: -<div class="source"><pre> -<portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class> -</pre> -</div> -</p> -<p> -This final <i>portlet.xml</i> should look like: -<div class="source"><pre> -<portlet id="guessNumber"> - <init-param> - <name>ViewPage</name> - <value>/greeting.jsp</value> - </init-param> - <description>JSF GuessNumber Portlet - Using J2 JSF Bridge</description> - <portlet-name>guessNumber</portlet-name> - <display-name>JSF GuessNumber Portlet - J2 JSF Bridge</display-name> - <portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>VIEW</portlet-mode> - <portlet-mode>EDIT</portlet-mode> - <portlet-mode>HELP</portlet-mode> - </supports> - - <portlet-info> - <title>GuessNumber Portlet</title> - <short-title>guessNumber</short-title> - </portlet-info> -</portlet> -</pre> -</div> -</p> -</div> - - </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>
