Sunday, October 19, 2014

OUCSS 2.1 customization and extension

1.  Introduction

OUCSS (Oracle Utilities Customer Self Service) usage by the energy and utilities industries is picking up fast these days. In this post I am sharing my experience of how we architected the solution using OUCSS to extend and customize this product to a large extent to meet one of our customer’s requirements. I tried to cover complete end to end steps that can be followed to make changes to the out-of-box OUCSS task flows, screens and add additional functionalities and deployment approach


Pre-requisites:
·         OUCSS portal should have been installed as per Oracle documentation along with necessary database schemas before proceeding further.
·         Following are the applications required

Application
Type
Remark
ExtendOUCSSPortal
Fusion ADF (will be deployed as shared library)
The application is available as part of ExtendOUCSSPortal.zip.

New task flows, pages, managed beans will be part of this application.
CustomizeOUCSSPortal
WebCenter Portal framework  (only MAR will be deployed, application will not be deployed)
New framework application to be created. All the OOB OUCSS task flow customizations are done as part of this.

Most important part of this application is “ADF library customization Sources” folder as shown in the screen shot below.
DPSkinsApp
WebCenter Portal framework
(only ear with skin.css will be deployed)
New application to be developed that will have all the application specific skins
DPModelApp
Fusion ADF (will be buil as ADF library and included inside ExtendOUCSSPortal)
All the business components and data services will be developed as part of this application.
DPLoginApp
WebCenter Portal framework (will be deployed as separate ear file)
All the public pages – login, registration, forgotpassword etc will be developed as part of this application and deployed as separate ear file into the same managed server as OUCSSPortal.
NOTE: Except ExtendOUCSSPortal, name the other applications as per your need


2.     Setup ExtendOUCSSPortal project

Follow the steps below to setup the project.

1          1. Unzip ExtendOUCSSPortal.zip into a folder.
            2. Right click on the folder and uncheck “read only” option.

3. Open .jws from Jdeveloper.
4. Add a new jspx page under public folder as shown below

5. Make sure to generate page definition for the new JSPX (I will be using this jspx page later to add OUCSS OOB task flows and customize it)

3.     How to test ExtendOUCSSPortal locally using Jdeveloper

           1. In order to run and test the application from Jdeveloper locally, edit weblogic-application.xml and uncomment the highlighted entries below.

         2.       Make sure to add OUCSS data source as shown below in the integrated server.

          3.  Add the below two libraries of OUCSS extension into the OUCSSPortalADFLibrary project.
     
       
      4. Now right click on the jspx page (Test.jspx in this example) and run on Integrated server. You should be able to see the output.
      
      5. You can create new task flows and page templates also as part of the same ExtendOUCSSPortal application.
      
      6. You can add OUCSS task flows (from OUCSS extension) into the project.

4.     How to deploy ExtendOUCSSPortal as shared library to the managed server

Follow the steps below.
        1. Comment out the library references from weblogic-application.xml as shown below.

         2.       Edit MANIFEST.MF file and provide appropriate version numbers as shown below.


        
      3. Double click on OUCSSPortalSharedLibrary project and make sure to uncheck all jars named “oracle.ugbu.ss.*.jar” except “oracle.ugbu.ss.custom.adflib.jar” as shown below.   
                   
           
          4. Now right click on OUCSSPortalSharedLibrary project and deploy it to the  WebCenter custom portal as shared library as shown below.
  
          5. Login to WebLogic admin server console and make sure the shared library is deployed as per the MANIFEST.MF file details as shown below.

          
          6. Restart the managed server where OUCSS portal is installed.
          7.  Login to OUCSS Portal, click administrationà Navigations, make copy of existing navigation and then click edit on the copied navigation. Click “Add”, “link” and manually enter the path of the newly created jspx page as shown below.
Click OK, and click “Back to portal” on top.
You can see the new link added as shown below. Click on that link to launch the Test1.jspx page.

5. How to use OUCSS OOB task flows inside ExtendOUCSSPortal

           1. Add OUCSS model and view libraries to the project as shown below. Click on each library and click “Add to project”. In this post I have picked up “admin” task flow to customize
            2. Enable to view the ADF libraries from project menu as shown below.

  
3. Drag & drop LabelTaskFlow (that is available under ADF Library) to the jspx page as shown below.


        4. Increase the version numbers in MANIFEST.MF and deploy ExtendOUCSSPOrtal as shared library. Restart the managed server and check the jspx in OUCSS portal to see if the task flow appears. You should see something like this in the OUCSS portal when you click on the “Test1” menu.

6.     How to customize OOB OUCSS task flows

Let us say for example, you want to customize OUCSS LabelTasklfow and add a new button at the bottom of the task flow and add this task flow as part of Test1.jspx. In order to do that, you need to first add the task flow into Test1.jspx page and deploy it into the OUCSS portal as explained in the above steps. Then through a different portal framework project the same task flow need to be customized. Follow the steps below.

      1. Create new WebCenter portal framework application (CustomizeOUCSSPortal) and add OUCSS libraries that contain the task flows that need to be customized. In this example LabelTaskFlow is part of admin libraries; hence add that library into the project as shown below.  Choose option “Neither” for the data source.


         2. Enable seeded customization for this application as shown below.

         3. Restart Jdev in customization mode and save the changes.

    
     4. Select the jsff that you want to customize and make the necessary view level changes as shown below (in this example I’ve added one new buttons at the bottom in LabelView.jsff file). 
   5. Save all the changes.
   6. Create new MAR deployment profile from application properties à Deployment.

    
    7.Now deploy the application by selecting the MAR deployment profile and deploy it on to OUCSSPortal application as shown below
    8. Choose “Export” option as shown below.
     
 9. Choose OUCSSPortal as the application to be deployed.
    
   10. Choose default options in the rest of the wizard screens.
   11. The MAR deployment should be successful as shown in Jdev below.

   
   12. Now if you access the page, you should see the newly added command button at the bottom of the page.


   NOTE: If MAR deployment from jdeveloper is not working or changes are not reflected, use EM console and select the MAR file to deploy as shown below instead of deploying from Jdeveloper.

7.  How to implement custom events

      Suppose if you add a new button as part of existing OUCSS task flow and if you want to call your own java method that is in your own custom class then you have to add the new class as part of ExtendOUCSSPortal and refer the new method as part of CustomizeOUCSSPortal as shown below through button action property.

As part of ExtendOUCSSPortal project, create TestClass.java and add a method called testMethod(). Then deploy this ExtendOUCSSPortal as shared library as explained in section 3.
Now in CustomizeOUCSSPortal project in customization mode,
      1.  Register TestClass as managed bean for the task flow.
    
2. Select the button for which this method needs to be called. In the “Action” property add #{pageFlowScope.TestManagedBean.testMethod}.
   3.Deploy the MAR file as explained in the previous section.
   4. Now launch the application and click “commandButton1”, you should see the System.out.println in the managed server log file.

8.     How to develop skins

Follow the steps below.
1.       Login into OUCSSPortal using admin user id.
2.       Click “Administration” link from the portal home page.
3.       In the resources tab, click “Skins” link.
4.       Make a copy of the “Default Portal skin”.
5.       Then select the copy, click edit and show.
6.       Now click “Download” on top to download the default skin as ear file into local computer.
7. Through DP-SkinApp application, import the downloaded ear as 

8.       The imported skin should appear under siteresources/scopeMD folder as shown below. DO NOT CHANGE THE AUTO GENERATE ID. 
9.       Now, double click skin.css and make necessary changes, test it.
10.       Add additional images/htc files under shared folder as shown below.
11.       Then right click on the css and choose “Export portal resources” option as shown below.

12.       Check “include Content directory” to include newly added images and other files under shared folder.
                  For more details about import/export, pls look into this site     http://docs.oracle.com/cd/E25178_01/webcenter.1111/e10148/jpsdg_srm.htm#CFHGIEEJ section 17.4.2 & 17.4.3.

13.   Now login back to OUCSSPortal administration, navigate to skins and click “upload” option to upload the exported ear in the last step.


14.       Remember to change the default skin option under “Configuration” tab as shown below.

15.       Now, click “Back to portal” link.
16.       Now select the newly added style sheet class name to the ADF components as shown below (in this example I have shown how to add style class to the OUCSS task flow).
17.       Deploy this change as per step-6.
18.       You should see the changes in OUCSS portal as shown below.

9.     How to develop page templates

Develop page templates as part of ExtendOUCSSPortal. The jspx pages that are using the page template will be shown inside the page template.

10.    Conclusion

We had to extend not only the view of the task flow but also added additional logic by having our own custom managed beans and methods inside the OUCSS task flows. Oracle documentation provides steps that you can follow to protect your custom changes when you have to upgrade your OUCSS to the next version. We couldn’t use some of the default OCUSS provided task flows and instead we went ahead and recreated them afresh as the time and effort required to extend took very long.
Our customer’s complicated business requirement forced us to go with this level of customization. But my advice is to follow (if you can) the best practice by not creating too task flows and managed beans of your own as part of OUCSS. Limit yourself to what OUCSS provides and educate the customer about the existing features it provides as more the customization higher the maintenance cost. 



No comments:

Post a Comment