The sample portlets require the following services:
They also require one of the following portlet containers:
They are able to be consumed by the following portals:
If you do not have the above software available, please visit the Oracle WebCenter Suite Home Page to obtain it.
This sample portlet will be deployed and configured on the selected portlet container. It is assumed that the reader is familiar with these processes on the selected container; if not please consult the product-specific documentation.
Technologies used by this sample include Java Portlets (JSR 168), JSP 2.0, JSTL, Web services, CSS, and JavaScript. For more information on these technologies, please refer to the Additional References.
Discussions forums support the creation and capture of knowledge via threads that are organized into forums and categories. Oracle WebCenter Discussions 10g Release 3 provides a comprehensive discussion forum platform for use in your Enterprise 2.0 applications. This sample portlet demonstrates the use of many of these capabilities within Oracle's portal solutions.
The discussions sample portlet is designed to allow the user to easily connect to a discussions server in order to view and/or edit pages. Once connected the portlet provides the user with options to navigate and create forums, navigate and create threads, and navigate, create, edit, and reply to messages. All of the state is stored as portlet preferences, allowing the user to maintain their navigation and settings.
The sample portlet is packaged as a Java Web Archive (WAR) file that contains all of the files necessary to deploy the application. The following list of files may be used as a reference when deploying, configuring, modifying, and otherwise using the sample.
Directory | File | Description |
---|---|---|
/WEB-INF/src/samples/webcenter/portlets/discussions | DiscussionsPortlet.java | The JSR 168 Portlet source file |
/WEB-INF/src/samples/webcenter/portlets/discussions | DiscussionsPortlet.properties | Properties file for messages and choices |
/WEB-INF/src/samples/webcenter/portlets/discussions | ForumPerms.java | Utility class for forum permissions |
Directory | File | Description |
---|---|---|
/WEB-INF/lib | axis.jar | Apache Axis Web Services |
/WEB-INF/lib | commons-discovery.jar | Apache Commons Discovery |
/WEB-INF/lib | forums-ws-client.jar | Jive Software Web Services Client |
/WEB-INF/lib | wsdl4j-1.5.1.jar | Java APIs for WSDL (JWSDL) |
/WEB-INF/lib | wss4j.jar | Apache WSS4J (WS-Security) |
/WEB-INF/lib | xmlsec-1.4.1.jar | Common classes for XML cryptography |
Directory | File | Description |
---|---|---|
/samples/webcenter/portlets/discussions | edit.jsp | Edit mode JSP |
/samples/webcenter/portlets/discussions | help.jsp | Help mode JSP |
/samples/webcenter/portlets/discussions | view.jsp | View mode JSP |
/samples/webcenter/portlets/discussions/views | forums.jspx | Use for viewing the forums |
/samples/webcenter/portlets/discussions/views | init.jspx | Initializes the JSP and JavaScript variables |
/samples/webcenter/portlets/discussions/views | main.jspx | Renders the main user interface |
/samples/webcenter/portlets/discussions/views | page.jspx | Used for viewing messages within a thread |
/samples/webcenter/portlets/discussions/views | threads.jspx | Used for viewing threads within a forum |
Directory | File | Description |
---|---|---|
/samples/webcenter/portlets/discussions/css | default.css | Default style sheet |
/samples/webcenter/portlets/discussions/css | plain.css | Plain style sheet |
/samples/webcenter/portlets/discussions/images | configure.png | Configure settings icon |
/samples/webcenter/portlets/discussions/images | delete.png | Delete icon |
/samples/webcenter/portlets/discussions/images | edit_message.png | Edit message icon |
/samples/webcenter/portlets/discussions/images | edit.png | Edit icon |
/samples/webcenter/portlets/discussions/images | forum.png | Forum icon |
/samples/webcenter/portlets/discussions/images | help.png | Help icon |
/samples/webcenter/portlets/discussions/images | message.png | Message icon |
/samples/webcenter/portlets/discussions/images | new_forum.png | New forum icon |
/samples/webcenter/portlets/discussions/images | new_message.png | New message icon |
/samples/webcenter/portlets/discussions/images | new_thread.png | New thread icon |
/samples/webcenter/portlets/discussions/images | new.png | New icon |
/samples/webcenter/portlets/discussions/images | reply_message.png | Reply message icon |
/samples/webcenter/portlets/discussions/images | reply_quoted.png | Reply quoted icon |
/samples/webcenter/portlets/discussions/images | reply.png | Reply icon |
/samples/webcenter/portlets/discussions/images | rss.png | RSS feed link icon |
/samples/webcenter/portlets/discussions/images | search.png | Search icon |
/samples/webcenter/portlets/discussions/images/default | banner.png | Banner image for the default template |
/samples/webcenter/portlets/discussions/images/emoticons | <various>.png | Various emoticons |
Directory | File | Description |
---|---|---|
/WEB-INF | portlet.xml | JSR 168 Portlet Definitions |
Deployment of the sample portlet will vary somewhat depending on the portlet container being used. Please consult the relevant documentation for the portlet container for more specific instructions, some of which may be found in the Additional References.
For many portlet containers the Java Web Archive (WAR) file may be deployed directly using various development and administration tools and utilities. If you are planning on exploring and modifying the sample code you should deploy this as an "exploded" archive on the file system. This may be done via an import utility, as in an IDE, or via a standard JAR or Zip utility.
When using the portlet via Web Services for Remote Portlets (WSRP), please consult the product-specific instructions for creating the consumer and/or producers for the portlets. The portlet has been designed and tested with WSRP in mind, but there may be additional configuration and/or modifications to the code necessary depending on the way the server is configured.
The sample portlet does not provide container-specific security hooks and uses a simple user name based system for accessing the remote services. It assumes that the user exists on both the local and remote systems, and that the authentication is handled by the portal container. Additional security via common security realms, SSO, credential vaults, and the like will require configuration and possible code modifications.
Once the portlet has been deployed on the server it must be added to a portal, page, etc. to be used. The portlet has been designed to be usable by an anonymous (non-authenticated) user, although any customizations made will only be available for the life of the session. When the user authenticates the portlet state will be stored in the portlet preferences, with little need for further manual configuration.
The portlet has been designed to be "bootstrapped" when initially accessed by the user. It will display the configuration screen, allowing the user to enter or select from a list of available options. The table below contains the name of the preferences and the expected values.
Name | Value(s) | Description |
---|---|---|
URL | http://<hostname>:<port> | The host where the server is deployed |
Category ID | Unique number (or leave blank) | The ID of the category to display |
ForumID | Unique number (or leave blank) | The ID of the forum to display |
Thread ID | Unique number (or leave blank) | The ID of the thread to display |
Message ID | Unique number (or leave blank) | The ID of the message to display |
Page Size | Number | The number of items to show per page |
View Mode | Forums, Threads, or Messages | The type of forum item to show |
Template | default or plain | The display template to use |