These tutorials, CBTs and tips are designed to help any Java professional who is looking to acquire JSR development skills to become quickly adept at both. In this three-part series, the articles describe new features available in the Java Portlet Specification (JSR ) and extensions supported by OpenPortal. Portlet Tutorial, Java Portlet, Portlet Example, Java Portlet Tutorial, What is Portlet , JSR has introduced the using of annotations for controlling things were.
|Published (Last):||12 June 2017|
|PDF File Size:||1.80 Mb|
|ePub File Size:||15.34 Mb|
|Price:||Free* [*Free Regsitration Required]|
Creating a simple portlet
WebSphere Portal Express includes an administrative portlet for installing, uninstalling, and updating portlets. Runtime extensions RE branches from runtime classpath, and application extensions AEX branch from runtime extensions. Before you package your portlet, the class files and resources must be hsr in the WAR file directory structure described here.
The portlet is provided along with the source in the IBM Portlet Samples package, which is available from the portlet catalog by searching for navcode 1WPZ. When constructing XMLAccess scripts for use in installing standard portlets, use the following values: Compile your Java source files.
Then, compile the portlet using the fully qualified path to the Java jsd source. If you are not using wizards to develop portlets, the following topics describe the mechanics of building a simple portlet. On a portal server running on Windows, installing a WAR file with a name that is more than 25 characters will result in an error. A particular class loader can reference other classes as long as the other classes can be loaded by the same class loader or any of its ancestors, but not its children.
The following shows the minimum elements required for the standard portlet deployment descriptor. The WAR file format contains the Java classes and resources that make up one or more portlets in a portlet application.
Application class loaders AC1application class loaders AC2and application class loaders AC3 are portlet applications that branch from application extensions. Hello World provides the fewest methods required for a portlet.
Before you begin developing portlets, set up an environment that makes the tasks of writing, compiling, and testing tutotial easier. Omit this tag if the portlet does not use this feature.
Creating a simple portlet
Packaging portlet classes, resources, and descriptive information in a single file makes distribution and deployment of portlets easier. Because Windows limits the maximum path length to characters, the name of the WAR file must be less than 25 characters. Refer to the documentation for Rational Application Developer for complete setup instructions.
After installation, the portlet is ready for use and does not require the server to be restarted. It uses the portlet response object to write simple output directly to the portal page. See Sample portlets for more information. You can also build portlets using your own development environment and tools. GenericPortlet which also can throw a PortletException.
If you gutorial a classloading problem, ensure that the required classes are in the appropriate classpath according to the classloading hierarchy.
The graphic illustrates where WebSphere Portal Express and portlet applications fit into the classloading hierarchy. Use this file if you use services from the Public API javadoc package. Therefore, the portal server copies was.
Tuutorial classpath RP branches from runtime classpath patches. To facilitate deployment of portlet applications and complex portlets, you can provide a portlet configuration file that can be invoked by the XML configuration interface XMLAccess. The XML configuration interface allows the portlet developer to specify places, pages, themes, skins, supported markups and clients, and other settings for a portlet application. Rational Application Tutorjal provides wizards to help you build, test, and deploy portlets using all of the APIs and related classes and interfaces available in the portlet run time environment.
Standard portlets Table 2. The portal administrator can download a WAR file from the Internet and then use the portal administration interface to install the portlet to WebSphere Portal Express.
In the following graphic runtime classpath patches RCP is located at the top of the hierarchy. For more information, see The XML configuration interface. For example, a portlet application might use a portlet descriptor as follows: If you are familiar with the web. The application server searches for security policy files in the location of the enterprise application archive rather than the Web application archive.
A portlet application exists as a structured hierarchy of directories. For portlet updates, the WAR file name must be the original name of the WAR file used to install ttuorial portlet application.
To deploy a portlet and run it on the server, it must be packaged in the form of a Web application ARchive or WAR file.
This is especially useful for portlets that use messaging because these portlets have to be placed on the same page. Use this file if you use services from the Public SPI javadoc package. The resources can be images, JSP files, Writing the portlet descriptorsand property files containing translated message text. The portlet information directory js not part of the public document tree of the application.
There are number of differences between the elements in this example and the corresponding Figure 8. If an installed portlet application includes a class loader, the portlet application class loader is an application class loader ACx under WebSphere Portal Express.
To do this, proceed as follows: That is, the WAR file name 28 be changed, but the uid must indicate the original uid used during portlet installation. If this value has not been specified, specify the WAR file ttuorial of the portlet application in its place. Next, the portlet must be packaged in the JAR file format. The Hello World portlet provides an introduction to writing your first portlet. You can also run the build-war-file or build-ear-file tasks to build the.