WebCenter Portal .8: Extending portal functionality with ADF Taskflows
By Bangaly Traore-Oracle on May 21, 2014
This blog entry will describe how to extend your portal functionality using a taskflow deployed as a web app shared library (extend.spaces.webapp) . The pros and cons of this approach will be discussed in a subsequent post however some of the implications of deploying your functionality as a shared library are:
- your taskflow will run in the same scope as the portal
- the portal and taskflow are tightly coupled
The Development Process
The .8 WebCenter Portal application (formerly referred to as Spaces) provides a mature and robust starting point for your portal application development. While Custom Framework is still available, the Portal application has many features that aren't available in a Custom Framework application. While the steps for extending portal functionality are documented, this post will describe my experience and some of the design decisions.
At a high level, you must do the following:
- Create an application in JDeveloper based on the WebCenter Portal Server Extension template.
- Develop your taskflow, managed bean or data control source in the Portal Extension Project OR register your Custom Web App Shared Libraries in the weblogic.xml of the Portal Shared Library Project
- Test your ADF source in JDeveloper
- Build, Package and Deploy the Portal Shared Library to the spaces server
Note: You MUST increment the PortalSharedLibrary Implementation Version defined in the MANIFEST.MF file. Failure to do so will generate an error when the spaces server is started preventing the application from running.
Creating the WebCenter Portal Server Extension Workspace
The steps for creating the workspace are straight forward. The workspace will contain 2 projects:
- PortalExtension View Project: This is where your development work will occur
- PortalSharedLibrary Application Project: This is where the SharedLibrary content is packaged
As illustrated in the project browser picture, a model project can be added as a dependency to the PortalExtension project. In other words, your Portal Extension conforms to ADF Development best practices. When you build and deploy the Portal Shared Library, you MUST increment the implementation version number located in the MANIFEST.MF file.
Implementing the functionality in PortalExtension project
Note: Your application source will be developed in the PortalExtension project; no source goes in the PortalSharedLibrary project.
It's important to note that the PortalExtension project follows the same rules as any other ADF View project. There are no constraints therefore you can reference a model project and follow ADF Development best practices.
In the event that you wish to override items in the Portal Application deployment descriptors, you can add the entries to the PortalSharedLibrary project. For example, We added a web.xml file to the PortalSharedLibrary project where we disabled JS content compression to facilitate debugging by adding the org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION property.
Note: You must delete the public_html folder in the PortalSharedLibrary project to successfully deploy and test the PortalExtension project in the WebLogic Server embedded in JDeveloper. This folder will be present if you added a web.xml to override various properties in the webcenter application deployment descriptor.
Testing your Portal Extension
During development, you will frequently unit test your Portal Extension. This is achieved by running the project on the WebLogic Server integrated with JDeveloper. Again, you must delete the public_html folder in the Portal Shared Library Project if you added web.xml deployment descriptor. Failure to do so will result in the following error:
<May 20, 2014 7:39:25 AM EDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Failed to load webapp: 'RedstackPortalExtension-PortalSharedLibrary-context-root'
Caused By: java.lang.ClassNotFoundException: javax.faces.webapp.ConverterELTag
Deploying the Portal Shared Library
The WebCenter Portal installation ships with an empty shared library called extend.spaces.webapp. The webcenter application has a library reference to extend.spaces.webapp defined in it's weblogic.xml. This library reference is the mechanism by which the shared library is merged with the webcenter application during deployment.
If you're organization is composed of multiple development teams, it's likely that each team will be working on different functionality. This functionality can be packaged as a conforming webapp shared library which must be referenced by the weblogic.xml deployment descriptor in the your custom PortalExtension project. In other words, develop your taskflows in standard ADF Web projects then package them as shared libraries. Create a single Portal Extension Workspace where you will reference the custom shared libraries you developed in the PortalExtension project weblogic.xml.
By default, the weblogic.xml is not added to the PortalExtension project therefore you must add it using the JDeveloper New File Wizard.
Note: The most important task to remember is to increment the implementation version in the Shared Library project MANIFEST.MF file. Failure to do so will prevent the WebCenter Application from deploying because of application assembly errors.
The steps for deploying a shared library to WebCenter Portal Domain are discussed here.
Extending WebCenter Portal .8 functionality is well documented and straight forward. The key things to keep in mind are:
- Your source is developed in the PortalExtension project
- You can deploy additional shared libraries by referencing them in the PortalExtension project weblogic.xml deployment descriptor
- The Portal Extension Workspace is similar to other ADF Web Projects in that you can add a model project and follow common ADF Development best practices (no special requirements)