Added: portals/site-live/pluto/v312/tck.html URL: http://svn.apache.org/viewvc/portals/site-live/pluto/v312/tck.html?rev=1914835&view=auto ============================================================================== --- portals/site-live/pluto/v312/tck.html (added) +++ portals/site-live/pluto/v312/tck.html Thu Dec 21 23:45:24 2023 @@ -0,0 +1,553 @@ +<!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.8.1 from src/site/xdoc/v312/tck.xml at 2023-12-21 --> +<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>Pluto – Apache Pluto - Using the JSR 362 TCK</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-Language" content="en" /> + + </head> + <body class="composite"> + <div id="banner"> +<a href="http://portals.apache.org/pluto/" id="bannerLeft"><img src="http://portals.apache.org/pluto/images/apache-portals.gif" alt="Pluto"/></a> +<div id="bannerRight"> +<img src="http://portals.apache.org/pluto/images/banner.png" alt=""/></div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + <div class="xleft"> + <span id="publishDate">Last Published: 2023-12-21</span> + | <a href="http://portals.apache.org/pluto" class="externalLink" title="Home">Home</a> > +Apache Pluto - Using the JSR 362 TCK + </div> + <div class="xright"><a href="../portlet-3.0-apidocs/index.html" title="Portlet 3.0 API">Portlet 3.0 API</a> | +<a href="../portlet-2.0-apidocs/index.html" title="Portlet 2.0 API">Portlet 2.0 API</a> | +<a href="../portlet-1.0-apidocs/index.html" title="Portlet 1.0 API">Portlet 1.0 API</a> | +<a href="http://jcp.org/en/jsr/detail?id=362" class="externalLink" title="JSR 362 JCP Page">JSR 362 JCP Page</a> | +<a href="http://jcp.org/en/jsr/detail?id=286" class="externalLink" title="JSR 286 JCP Page">JSR 286 JCP Page</a> | +<a href="http://jcp.org/en/jsr/detail?id=168" class="externalLink" title="JSR 168 JCP Page">JSR 168 JCP Page</a> </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + <h5>The Pluto Project</h5> + <ul> + <li class="none"><a href="../index.html" title="About Pluto">About Pluto</a></li> + <li class="none"><a href="../mission.html" title="Mission">Mission</a></li> + <li class="none"><a href="../download.html" title="Download">Download</a></li> + <li class="none"><a href="../news.html" title="News">News</a></li> + <li class="none"><a href="../security.html" title="Security">Security</a></li> + <li class="none"><a href="../status.html" title="Status">Status</a></li> + <li class="none"><a href="../architecture.html" title="Architecture">Architecture</a></li> + <li class="none"><a href="../resources.html" title="Resources">Resources</a></li> + <li class="none"><a href="../faq.html" title="FAQ">FAQ</a></li> + <li class="none"><a href="http://wiki.apache.org/portals/Pluto" class="externalLink" title="Wiki">Wiki</a></li> + <li class="none"><a href="https://issues.apache.org/jira/browse/PLUTO" class="externalLink" title="Issue Tracker (JIRA)">Issue Tracker (JIRA)</a></li> + <li class="none"><a href="../helping.html" title="Get Involved">Get Involved</a></li> + </ul> + <h5>Pluto 3.1</h5> + <ul> + <li class="none"><a href="../v312/mvcbean-portlets.html" title="MVCBean Portlets">MVCBean Portlets</a></li> + <li class="none"><a href="../v312/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v312/maven-archetypes.html" title="Maven Archetypes">Maven Archetypes</a></li> + <li class="none"><a href="../v312/deploying.html" title="Deploying Portlets">Deploying Portlets</a></li> + <li class="none"><a href="../v312/portlet-api.html" title="Portlet Concepts">Portlet Concepts</a></li> + <li class="none"><a href="../v312/v3Features.html" title="Version 3 Features">Version 3 Features</a></li> + <li class="none"><strong>Using the TCK</strong></li> + <li class="none"><a href="../v312/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Pluto 3.0</h5> + <ul> + <li class="none"><a href="../v301/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v301/deploying.html" title="Deploying Portlets">Deploying Portlets</a></li> + <li class="none"><a href="../v301/portlet-api.html" title="Portlet Concepts">Portlet Concepts</a></li> + <li class="none"><a href="../v301/v3Features.html" title="Version 3 Features">Version 3 Features</a></li> + <li class="none"><a href="../v301/tck.html" title="Using the TCK">Using the TCK</a></li> + <li class="none"><a href="../v301/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Pluto 2.0</h5> + <ul> + <li class="none"><a href="../v20/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v20/deploying.html" title="Deploying">Deploying</a></li> + <li class="none"><a href="../v20/embedding.html" title="Embedding">Embedding</a></li> + <li class="none"><a href="../v20/release-notes.html" title="Release Notes">Release Notes</a></li> + <li class="none"><a href="../v20/app-servers.html" title="App Servers">App Servers</a></li> + <li class="none"><a href="../v20/powered.html" title="Powered By Pluto">Powered By Pluto</a></li> + </ul> + <h5>Pluto 1.1</h5> + <ul> + <li class="none"><a href="../v11/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v11/deploying.html" title="Deploying">Deploying</a></li> + <li class="none"><a href="../v11/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Subprojects</h5> + <ul> + <li class="none"><a href="../subprojects/subprojects.html" title="Overview">Overview</a></li> + </ul> + <h5>Project Info</h5> + <ul> + <li class="none"><a href="../project-summary.html" title="Project Summary">Project Summary</a></li> + <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 Lists">Mailing Lists</a></li> + <li class="none"><a href="../source-repository.html" title="Source Repository">Source Repository</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"> + + + + + <div class="section"> +<h2><a name="Using_the_JSR_362_TCK"></a>Using the JSR 362 TCK</h2> + +<p> + The JSR 362 Technology Compliance Kit (TCK) is intended to be used by portal + vendors wishing to achieve JSR 362 compatibility for their product. + If you do not meet this description, you do not need to read this section. + </p> + + +<div class="section"> +<h3><a name="Overview"></a>Overview</h3> + +<p> + The TCK contains portlets and a test driver that are used to perform the + compatibility test. The portlets contain the code that actually exercises the + portlet API. The driver uses Selenium 2 driven by Junit to access the system + under test through a selenium webdriver browser. + </p> +<p> + You can click through the tests on the portal pages displayed by the system under + test, or you can use the test driver to automatically click through the tests + and collect the results. Since there are many test cases (>6000), you will + generally use the test driver. + </p> +<p> + A test portlet may define multiple test cases. The test case names must be + unique in the system, and must be of a form that can be used as portlet names + and as Java Properties file keys. + </p> +<p> + Each portlet test module defines its own test case list and page file containing + the page definitions expected by the tests contained in the module. + </p> +<p> + The build process generates a consolidated test case list and consolidated page + file containing all test cases and page definitions for all test modules. The + consolidated test case list maps the test case to the name of the page on which + the test case is located. + </p> +<p> + The test driver works by reading the consolidated test case list. For each test + case, the driver accesses the specified page. It logs in if necessary, clicks + any available test case link, and collects the test case results from the + browser window. + </p> +<p> + The test driver accesses a TCK page by looking for and clicking a link whose + link text is equal to the page name. If the test driver cannot find the link on + current page, it will access the test server login URL configured in the + portlet-tck_3.0/POM.xml file. + </p> +<p> + The test driver checks whether a login is necessary by checking for the + existence of an entry field that has the HTML element ID for the user name + field. If the user name field is available, the driver enters the user name and + password into the corresponding entry fields and submits the form. The username + HTML element ID, password element ID, username and password are configurable + in the portlet-tck_3.0/POM.xml file. + </p> +<p> + The driver checks for links to be clicked and results to be collected by + checking for specific HTML element IDs on the page. The HTML element IDs are + based on the test case name. From the point of view of the test driver there can + be several relevant element IDs on the page for each test case: + </p> + +<ul> + +<li> + "<testcasename>-setup" - Test setup link + </li> +<li> + "<testcasename>-clickme" - Test execution link + </li> +<li> + "<testcasename>-results" - Test results field; "Succeeded" or "Failed" + </li> +<li> + "<testcasename>-details" - Test details field; provides failure reason + </li> + </ul> + +<p> + After accessing the page on which the test case is to be found, the test driver + first looks for a setup link. If found, it clicks the link and waits for the + page to load. + </p> +<p> + The driver then looks for a test execution link. If found, + it clicks the link, waits for the new page to load, and then checks for the + result elements. + </p> +<p> + The driver reads the contents of the HTML elements that have the results and + details element IDs and analyzes the results string to determine test case + success or failure. + </p> + </div> + + +<div class="section"> +<h3><a name="Project_Structure"></a>Project Structure</h3> + +<p> + The TCK source code is located in the subdirectory <tt>./pluto/portlet-tck_3.0</tt>. + The project consists of the following modules: + </p> + +<dl> + +<dt> + common + </dt> +<dd> + Common code used by the test portlets and the test driver. This + module also contains the XSL stylesheets used during the test + portlet module build to generate the test case list and page + configuration for the module. + </dd> +<dt> + deploy + </dt> +<dd> + The directory <tt>deploy/target/deploy-files</tt> contains the portlet war + files and the page file to be deployed on the system under test. + </dd> +<dt> + driver + </dt> +<dd> + The maven-based test driver. When this module is built, it + generates a consolidated test case list and page file for the test + cases and pages defined by all test case portlet modules. + </dd> +<dt> + TestModule1 + </dt> +<dd> + Intended to be a sample for writing TCK portlets. + Defines several portlets, each of which is placed on its own page. + </dd> +<dt> + TestModule2 + </dt> +<dd> + Intended to be a sample for writing TCK portlets. + Defines several portlets, all of which are placed on the same + portal page. Some tests produce links that are clicked by the test + driver when the test is run. Some tests set public render + parameters that are used by another test portlet. + </dd> +<dt> + TestModule3 + </dt> +<dd> + Intended to be a sample for writing TCK portlets. + Defines two portlets in separate portlet applications for public + render parameter testing. Both portlets are placed on the same + page. When the test driver clicks a test link in one portlet, the + test results are displayed in the second portlet. + </dd> +<dt> + V2*Tests + </dt> +<dd> + Modules with this naming scheme contain test cases to demostrate + backward compatibilty with the Portlet Specification version 2.0. + Portlets whose class names contain the string "_SIG_" contain + generated code for verifying the method signatures. These portlets + should not be changed by hand. The remaining portlets contain + additional V2 verification code. + </dd> +<dt> + V3*Tests + </dt> +<dd> + Modules with this naming scheme test v3.0 specific funtionality. + </dd> + </dl> + </div> + + +<div class="section"> +<h3><a name="The_Page_File"></a>The Page File</h3> + +<p> + The page file defines the page names for the TCK and the portlets expected to + be on each page. This is an XML file in the form of a Pluto driver configuration + file. The schema for this file is located in the Pluto project at the following + location: + </p> +<p> + <tt>./pluto/pluto-portal-driver/src/main/resources/pluto-portal-driver-config.xsd</tt> + </p> +<p> + After the TCK has been built, complete page file for the TCK pages is contained + in the following file: + </p> +<p> + <tt>./pluto/portlet-tck_3.0/deploy/target/deploy-files/pluto-portal-driver-config.xml</tt> + </p> +<p> + It is expected that vendors will extract the portlet-to-page mapping information + from the page file in order to create the necessary configuration files for + the portal under test. + </p> +<p> + When creating pages for your system, note that the test driver expects links + to all test case pages to be available. + The test driver searches for the page links by link text, so it is important that + the links have the names defined in the page file. + </p> + </div> + + +<div class="section"> +<h3><a name="Accessing_the_version_3.0.3_TCK_Source_Code"></a>Accessing the version 3.0.3 TCK Source Code</h3> + +<p> + The source code is located in the + <a class="externalLink" href="https://github.com/apache/portals-pluto">Apache Pluto repository</a>. + </p> +<p> + First, use git to clone the repository: + <tt>git clone https://github.com/apache/portals-pluto.git pluto</tt> + </p> +<p> + Then switch into the 'pluto' directory and checkout the source for version 3.0.3 of the TCK: + </p> +<p> + <tt>git checkout portlet-tck-3.0.3</tt> + </p> +<p> + The version 3.0.3 TCK source code is now located in the 'portlet-tck_3.0' directory. + </p> + </div> + + +<div class="section"> +<h3><a name="Building_the_TCK"></a>Building the TCK</h3> + +<p> + Building the TCK produces the test portlets, a list of test cases in XML format, + an XML-based page file containing the page configuration expected by the test + cases, and the test driver itself. + </p> +<p> + To build portlet war files that do not contain any special configuration, use + the command: + </p> +<p> + <tt>mvn clean install</tt> + </p> +<p> + To build portlet war files that are configured for deployment on Pluto, use the + command: + </p> +<p> + <tt>mvn clean install -Ppluto</tt> + </p> +<p> + These commands can be executed either from the Pluto project base directory or + from the <tt>./pluto/portlet-tck_3.0</tt> directory. + </p> + </div> + + +<div class="section"> +<h3><a name="Deploying_the_TCK"></a>Deploying the TCK</h3> + +<p> + Use the page file which has the default + name of <tt>deploy/target/deploy-files/pluto-portal-driver-config.xml</tt> to create + pages for your system. + The WAR files in the <tt>deploy/target/deploy-files</tt> + contain the test portlet code. Deploy these files on your system. + </p> +<p> + If you are testing with Apache Pluto, you can simply copy + the page file into the Pluto <tt>webapps/pluto/WEB-INF</tt> directory in order to set up the + pages. To deploy the WAR files on Pluto, copy them into the Pluto webapps directory. + </p> + </div> + + +<div class="section"> +<h3><a name="Running_the_TCK"></a>Running the TCK</h3> + +<p> + Configure the parent POM file <tt>./pluto/portlet-tck_3.0/pom.xml</tt> to + address your system under test. See the properties section in the pom.xml file. + You can set the host name and port for the system under test, and can + also select the browser to be used by the Selenium WebDriver code. Note, + however, that if you use a browser other than "firefox" or "HTMLUnit" you will + have to download and install additional WebDriver software manually, and you may + need to add additional configuration properties (See the test.browser.webDriver + property in the parent POM). + </p> +<p> + At the time of this writing, the HTMLUnit driver does not support JavaScript + adequately for JSR 362 TCK purposes. You may need to try different drivers to + find the appropriate WebDriver driver for your environment. + </p> +<p> + All TCK tests were successfully executed through the test driver against Pluto + using the ChromeDriver web driver. See the portlet-tck_3.0/POM.xml file for + a configuration example. + </p> +<p> + Run the TCK by switching to the driver subdirectory and execute the command: + </p> +<p> + <tt>mvn test -Prun-tck</tt> + </p> +<p> + If you want to run a subset of the tests, use the "-Dtest.module=" option. The + driver will then only execute those tests whose test case name contains the + specified string. For example, if you want to run the signature verification + tests, use the command: + </p> +<p> + <tt>mvn test -Prun-tck -Dtest.module=SIG</tt> + </p> +<p> + You can also exclude specific tests by placing an exclamation point before the + text to be matched. For example, if you want to exclude the signature verification + tests, use the command: + </p> +<p> + <tt>mvn test -Prun-tck -Dtest.module=!SIG</tt> + </p> +<p> + The 'test.dryrun' flag will cause the test cases to be listed without executing them. + For example, the following command will list all of the test cases whose test + case name contains 'ResourceResponse', but will not execute them: + </p> +<p> + <tt>mvn test -Prun-tck -Dtest.module=ResourceResponse -Dtest.dryrun=true</tt> + </p> +<p> + The test driver will wait for a response for a default time of 3 seconds. If this + value proves to be too short, you can change it in the portlet-tck_3.0/POM.xml + file, or you can specify a timeout value using the 'test-timeout' command line + option. The timeout value is specified in seconds, as follows: + </p> +<p> + <tt>mvn test -Prun-tck -Dtest.module=ResourceResponse -Dtest.timeout=5</tt> + </p> +<p> + The test driver has an ignore list containing test case names that are not + required to pass in order for a portal product to be JSR 362 compliant. The + ignore list is an XML file in properties file format located at: + </p> +<p> + <tt>portlet-tck_3.0/driver/src/main/resources/xml-resources/ignoredTestCases.xml</tt> + </p> +<p> + By default, the test driver will ignore and will not execute all test cases + in the ignore list. If you wish to execute all test cases including those in + the ignore list, set the command line flag 'test.ignore' to false: + </p> +<p> + <tt>mvn test -Prun-tck -Dtest.ignore=false</tt> + </p> + </div> + + +<div class="section"> +<h3><a name="Passing_the_TCK"></a>Passing the TCK</h3> + +<p> + TCK execution is self-policing. If you are a portal vendor and wish to claim + JSR 362 compatibility for your product, you should be able to demonstrate that + this TCK can be executed against your product with no errors. + </p> + </div> + + +<div class="section"> +<h3><a name="Contesting_a_Test_Case"></a>Contesting a Test Case</h3> + +<p> + When defining and implementing the TCK test cases, care was taken to assure + proper implementation and to test only required functionality. + </p> +<p> + However, mistakes may have occurred. If you feel that a test case is incorrectly + implemented or is invalid as defined, please proceed as follows. + </p> +<p> + In either case, please open an issue at the Pluto Jira: + </p> +<p> + <tt>https://issues.apache.org/jira/browse/PLUTO/</tt> + </p> +<p> + Prefix the summary with 'TCK:' in order to allow TCK issues to be readily + identified. Please be sure to specify the exact name(s) of the test case(s) in + question. + </p> +<p> + If you feel that the test case was implemented incorrectly, you may correct the + implementation and issue a pull request through github here: + </p> +<p> + <tt>https://github.com/apache/portals-pluto/pulls</tt> + </p> +<p> + If you feel that the test case is invalid as defined, you may update the ignore + list and issue a pull request. + </p> +<p> + If we agree that the test case is invalid or incorrectly implemented, we will + fix it or integrate your fix into the Pluto master and version 3.0 branches. + </p> + </div> + </div> + + + + + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + Copyright © 2004–2023 <a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved. </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html>
Added: portals/site-live/pluto/v312/v3Features.html URL: http://svn.apache.org/viewvc/portals/site-live/pluto/v312/v3Features.html?rev=1914835&view=auto ============================================================================== --- portals/site-live/pluto/v312/v3Features.html (added) +++ portals/site-live/pluto/v312/v3Features.html Thu Dec 21 23:45:24 2023 @@ -0,0 +1,410 @@ +<!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.8.1 from src/site/xdoc/v312/v3Features.xml at 2023-12-21 --> +<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>Pluto – Apache Pluto - Portlet 3.0 API Overview</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-Language" content="en" /> + + </head> + <body class="composite"> + <div id="banner"> +<a href="http://portals.apache.org/pluto/" id="bannerLeft"><img src="http://portals.apache.org/pluto/images/apache-portals.gif" alt="Pluto"/></a> +<div id="bannerRight"> +<img src="http://portals.apache.org/pluto/images/banner.png" alt=""/></div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + <div class="xleft"> + <span id="publishDate">Last Published: 2023-12-21</span> + | <a href="http://portals.apache.org/pluto" class="externalLink" title="Home">Home</a> > +Apache Pluto - Portlet 3.0 API Overview + </div> + <div class="xright"><a href="../portlet-3.0-apidocs/index.html" title="Portlet 3.0 API">Portlet 3.0 API</a> | +<a href="../portlet-2.0-apidocs/index.html" title="Portlet 2.0 API">Portlet 2.0 API</a> | +<a href="../portlet-1.0-apidocs/index.html" title="Portlet 1.0 API">Portlet 1.0 API</a> | +<a href="http://jcp.org/en/jsr/detail?id=362" class="externalLink" title="JSR 362 JCP Page">JSR 362 JCP Page</a> | +<a href="http://jcp.org/en/jsr/detail?id=286" class="externalLink" title="JSR 286 JCP Page">JSR 286 JCP Page</a> | +<a href="http://jcp.org/en/jsr/detail?id=168" class="externalLink" title="JSR 168 JCP Page">JSR 168 JCP Page</a> </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + <h5>The Pluto Project</h5> + <ul> + <li class="none"><a href="../index.html" title="About Pluto">About Pluto</a></li> + <li class="none"><a href="../mission.html" title="Mission">Mission</a></li> + <li class="none"><a href="../download.html" title="Download">Download</a></li> + <li class="none"><a href="../news.html" title="News">News</a></li> + <li class="none"><a href="../security.html" title="Security">Security</a></li> + <li class="none"><a href="../status.html" title="Status">Status</a></li> + <li class="none"><a href="../architecture.html" title="Architecture">Architecture</a></li> + <li class="none"><a href="../resources.html" title="Resources">Resources</a></li> + <li class="none"><a href="../faq.html" title="FAQ">FAQ</a></li> + <li class="none"><a href="http://wiki.apache.org/portals/Pluto" class="externalLink" title="Wiki">Wiki</a></li> + <li class="none"><a href="https://issues.apache.org/jira/browse/PLUTO" class="externalLink" title="Issue Tracker (JIRA)">Issue Tracker (JIRA)</a></li> + <li class="none"><a href="../helping.html" title="Get Involved">Get Involved</a></li> + </ul> + <h5>Pluto 3.1</h5> + <ul> + <li class="none"><a href="../v312/mvcbean-portlets.html" title="MVCBean Portlets">MVCBean Portlets</a></li> + <li class="none"><a href="../v312/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v312/maven-archetypes.html" title="Maven Archetypes">Maven Archetypes</a></li> + <li class="none"><a href="../v312/deploying.html" title="Deploying Portlets">Deploying Portlets</a></li> + <li class="none"><a href="../v312/portlet-api.html" title="Portlet Concepts">Portlet Concepts</a></li> + <li class="none"><strong>Version 3 Features</strong></li> + <li class="none"><a href="../v312/tck.html" title="Using the TCK">Using the TCK</a></li> + <li class="none"><a href="../v312/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Pluto 3.0</h5> + <ul> + <li class="none"><a href="../v301/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v301/deploying.html" title="Deploying Portlets">Deploying Portlets</a></li> + <li class="none"><a href="../v301/portlet-api.html" title="Portlet Concepts">Portlet Concepts</a></li> + <li class="none"><a href="../v301/v3Features.html" title="Version 3 Features">Version 3 Features</a></li> + <li class="none"><a href="../v301/tck.html" title="Using the TCK">Using the TCK</a></li> + <li class="none"><a href="../v301/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Pluto 2.0</h5> + <ul> + <li class="none"><a href="../v20/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v20/deploying.html" title="Deploying">Deploying</a></li> + <li class="none"><a href="../v20/embedding.html" title="Embedding">Embedding</a></li> + <li class="none"><a href="../v20/release-notes.html" title="Release Notes">Release Notes</a></li> + <li class="none"><a href="../v20/app-servers.html" title="App Servers">App Servers</a></li> + <li class="none"><a href="../v20/powered.html" title="Powered By Pluto">Powered By Pluto</a></li> + </ul> + <h5>Pluto 1.1</h5> + <ul> + <li class="none"><a href="../v11/getting-started.html" title="Getting Started">Getting Started</a></li> + <li class="none"><a href="../v11/deploying.html" title="Deploying">Deploying</a></li> + <li class="none"><a href="../v11/release-notes.html" title="Release Notes">Release Notes</a></li> + </ul> + <h5>Subprojects</h5> + <ul> + <li class="none"><a href="../subprojects/subprojects.html" title="Overview">Overview</a></li> + </ul> + <h5>Project Info</h5> + <ul> + <li class="none"><a href="../project-summary.html" title="Project Summary">Project Summary</a></li> + <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 Lists">Mailing Lists</a></li> + <li class="none"><a href="../source-repository.html" title="Source Repository">Source Repository</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"> + + + + + <div class="section"> +<h2><a name="Portlet_3.0_API_Overview"></a>Portlet 3.0 API Overview</h2> + +<p> + This section presents some of the main new features introduced by JSR 362. + JSR 362 Portlet Specification 3.0 introduces many improvements to the + portlet programming model. It adds configuration through annotation, + asynchronous support similar to the servlet asynchronous support, + multipart form support, support for CDI beans, method annotation support + allowing portlet methods to reside in different classes, and a JavaScript + API that allows portal pages to function as single-page applications. The + Pluto 3.0 portlet container implements all JSR 362 features and passes the + TCK. While doing so, Pluto 3.0 remains fully compliant to the 2.0 Portlet + Specification, meaning that version 2.0 portlets can run on the version + 3.0 portlet container. + </p> + +<p> + Additional Resources: + </p> + +<ul> + +<li> + The + <a class="externalLink" href="http://jcp.org/en/jsr/detail?id=362">Java Community Process JSR 362 page</a> + will allow you to access the complete specification for full details. + </li> + +<li> + The JavaOne 2016 presentation + <a class="externalLink" href="https://static.rainfocus.com/oracle/oow16/sess/1462801563632001pOv8/ppt/JSR362-JavaOne-2016a.pdf">"Portlet Specification 3.0 Is Here!"</a> + provides a version 3.0 overview. + </li> + +<li> + The <a href="../portlet-3.0-apidocs/index.html">Portlet API Version 3.0</a> + page documents the portlet programming interface. + </li> + </ul> + + +<div class="section"> +<h3><a name="Configuration_by_Annotation"></a>Configuration by Annotation</h3> + +<p> + The version 3.0 portlet API introduces the <tt>@PortletApplication</tt> + and <tt>@PortletConfiguration</tt> annotations to allow portlets to + be configured without using the deployment descriptor. + Note that the deployment descriptor can still be used. When both + configuration annotations and a portlet deployment descriptor are present, + values from the deployment descriptor override those provided + by annotation. + </p> + +<div> +<pre> +@PortletApplication( + defaultNamespaceURI="https://www.java.net/", + events = { + @EventDefinition(qname=@PortletQName(namespaceURI="http://www.apache.org/", + localPart="event1") , payloadType = String.class), + @EventDefinition(qname=@PortletQName(namespaceURI="", + localPart="event4")) + } +) + + +@PortletConfiguration(portletName="Portlet1", + initParams = { + @InitParameter(name="color", value="#cafeba"), + }, + title={ + @LocaleString(locale = "EN", value="Annotated Portlet"), + } +) + </pre></div> + </div> + + +<div class="section"> +<h3><a name="Extended_Method_Annotations"></a>Extended Method Annotations</h3> + +<p> + Version 3 extends the idea of method annotations introduced with version 2. + Portlet methods may now be located in classes that do not implement portlet + interfaces. + Also, lifecycle methods belonging to a single portlet need not be in the same + class. + </p> + +<p> + The extended method annotations <tt>@HeaderMethod</tt>, <tt>@RenderMethod</tt>, + and <tt>@ServeResourceMethod</tt> have relaxed method signature requirements + as compared to the methods defined by the portlet interfaces. + See the portlet API documentation for details. + </p> +<p> + Use of the extended method annotation <tt>@RenderMethod</tt> implicitly + configures a portlet. No additional configuration is required. + The following example defines a simple portlet render method. + If this method were located in a class with a default constructor within + a web application deployed on a version 3 portal, it would define and automatically + configure a portlet by the name of "BeanPortletDemo". + </p> + +<div> +<pre> +@RenderMethod(portletNames = "BeanPortletDemo") +public String simpleRender() { + return "Hello, World!"; +} + </pre></div> + </div> + + +<div class="section"> +<h3><a name="CDI_Support"></a>CDI Support</h3> + +<p> + Version 3 provides support for CDI in several ways. + Portlet classes are instantiated through the CDI container + to enable dependency injection while respecting + scope annotations on the portlet classes. + Dependency injection supported in portlet filters and listeners as well as + in asynchronous threads started through the <tt>PortletAsyncContext</tt> + object. + Many portlet artifacts have been made injectable - the + request and response objects, parameter objects, the portlet configuration + object, etc. + </p> +<p> + Custom CDI scopes for portlets have also been introduced. + </p> +<ul> + +<li> + The portlet session scope - @PortletSessionScoped + </li> + +<li> + The portlet request scope - @PortletRequestScoped + </li> + +<li> + The render state scope - @RenderStateScoped + </li> + </ul> + + </div> + + +<div class="section"> +<h3><a name="Asynchronous_support"></a>Asynchronous support</h3> + +<p> + The portlet programming model provides asynchronous support similar to + that provided by servlets. + Using asynchronous support, long-running requests can run in separate thread + in order to free up application server resources. + Asynchronous support is provided for resource requests only. + </p> +<p> + Asynchronous processing must be started within original resource request. + The asynchronous thread runs in context of original resource request, + providing that it is started through the <tt>PortletAsyncContext#start(Runnable)</tt> + method. + This means that CDI injection can be used within async thread + in the same manner as for the original request. + The asynchronous listener and any portlet filters also run in context of original request. + </p> +<p> + The asynchronous thread can dispatch directly to JSP or servlet for producing output + and can also dispatch back to the resource method, if desired. + </p> +<p> + The following diagram illustrates a sample asynchronous processing sequence. + Note that this shows only one of many possible scenarios. + When the portal receives a resource request targeted to the asnychronous + portlet, the portlet container invokes the portlet resource method. + The portlet starts asynchronous processing, adds an asynchronous listener, + uses the portlet asynchronous context object to start a thread, and + returns to the container. + The asynchronous thread does its long-running work and dispatches back to the + original resource method. + The resource method then includes a JSP to produce output and completes + asynchronous processing. + </p> + <img src="../images/async.png" alt="" /> + </div> + + +<div class="section"> +<h3><a name="The_Portlet_Hub_JavaScript_API"></a>The Portlet Hub JavaScript API</h3> + +<p> + The portlet specification defines a JavaScript API that can be used by portlet + code running on the browser to read and set render parameters, carry out portlet + actions, and generate resource URLs while remaining in an Ajax paradigm. + Updating parameters and executing actions through the portlet hub does not + cause a page refresh. + Instead, the portlet hub communicates with the portal, causing the portal + to carry out any required portlet processing. + The portlet hub then informs the portlet client code running on the browser about + any new parameters. + The portlet client can then create a resource URL to obtain any data or + markup required to update the page. + The portal implementation is responsible for making the portlet hub + module available on the portal page. + </p> + +<p> + The following diagram illustrates portlet action processing initiated through + the portlet hub. + In this scenario, the portal page contains three portlets that make use of + the portlet hub. + Portlet B initiates an Ajax action through the portlet hub. + The portlet hub transmits the action request along with any form data and action + parameters to the portal server. + On the server, action processing is executed for portlet B. + During action processing, portlet B fires an event that portlet A can process. + The server executes the event phase for the event and transmits the new render + state information to the portlet hub running on the browser. + The portlet hub fires onStateChange events to portlets A and B to inform them + of the updated render state information. + The portlets can now use the portlet hub API to create resource URLs in order + to retrieve information corresponding to the new render state. + </p> + <img src="../images/hubaction.png" alt="" /> + +<p> + The main JavaScript functions provided by the portlet hub are listed below. + </p> + +<dl> + +<dt><tt> + Promise(PortletInit) register(<Portlet ID>) + </tt></dt> +<dd> + Registers a portlet client designated by portlet ID with the Portlet Hub and returns object that provides access to remaining Portlet Hub functions. + </dd> +<dt><tt> + ListenerID addEventListener(<listener type>, <listener method>) + </tt></dt> +<dd> + The Portlet Hub informs Portlet Client of state changes by calling the event listener function and passing the updated portlet state. + </dd> +<dt><tt> + Promise(url) createResourceUrl(<resource parameters>, <cacheability>, <resource ID>) + </tt></dt> +<dd> + Creates a resource URL containing the current page / portlet state. + The URL can be used with the framework of choice to retrieve the resource. + </dd> +<dt><tt> + setPortletState(<new portlet state>) + </tt></dt> +<dd> + Allows portlet client to set private and public parameters, portlet mode, window state + </dd> +<dt><tt> + action(<action parameters>, <form element>) + </tt></dt> +<dd> + Carries out a portlet action in Ajax mode (Ajax action) + </dd></dl> + +<div> +<pre> + </pre></div> + </div> + + + + </div> + + + + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + Copyright © 2004–2023 <a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved. </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html>
