Friday, July 13, 2012

Deploy Custom ADF Application to WebCenter Spaces



Introduction:

You can extend or alter the look and feel and functionality of Oracle WebCenter Spaces task flows using the Oracle JDeveloper Customization Developer role. But what if you want to deploy a 100% custom ADF application to WebCenter Spaces? Initially I had difficulties deploying a new ADF taskflow within WebCenter Spaces . I read a lot of Oracle blogs/whitepapers but was unsuccessful.  Finally when I got it to work, I wrote this article, which lists all the steps that are required to complete the task successfully

Steps:
Create ADF application with custom task flow
1. Create a new deployment profile ("ADF Library JAR file") for  the View Controller project
2. Delete the existing WAR deployment profile from View Controller -> Project Properties
3. Deploy the View Controller to ADF Library JAR (Right Click on ViewController -> Deploy)
4. Note the location of the JAR file

Create a wrapper project which will be deployed as WAR file and will include the taskflow JAR file
1. Create a new Generic Project
2. Create a WAR deployment Profile
3. Add task flow JAR file to WAR deployment.
. Right click on the new project -> Project Properties
. Select library and classpath
. Click ‘Add JAR/directory’
. Add the JAR created in step (4)
4. Edit web.xml for the wrapper project and remove all entries
. Note:  FAILURE to do this will result in errors
5. Deploy the Wrapper project to Webcenter spaces (Right Click wrapper project -> Deploy)
. Create connection to Server
. Select WC_Spaces Managed Server
. Ensure to select radio button "Deploy as shared library"
. After Deployment, Ensure Library is displayed by logging into the WLS Console (Admin server)
Extend Spaces and reference the library that contains the custom task flow
1. Download and install Oracle JDeveloper WebCenter Framework and Services Design Time Extensions:
. In JDeveloper, select Help > Check for Updates.
. Click Next, and then Next again to display all available updates.
. Use the search field to filter the list, for example, enter 'webcenter framework'.
. Select WebCenter Framework and Services Design Time.
. Click Finish.
2. Download the WebCenter Spaces development ZIP file (DesignWebCenterSpaces_ps4.zip) from Oracle Technology Network:
http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_ps4.zip
3. Copy WebCenter's WLST (WebLogic Scripting Tool) commands to the Oracle home directory where JDeveloper is installed:
. Navigate to <DesignWebCenterSpaces_Unzip_Location>\copy_to_common
. Make a copy of the common directory.
. The common directory is located under <DesignWebCenterSpaces_Unzip_Location>\copy_to_common.
. Navigate to: <JDeveloper_install_directory>\oracle_common
. Copy the content of the common directory here.
. Copy new version of oracle.webcenter.portal.jar to the Oracle JDeveloper extensions directory:
     a. Navigate to <DesignWebCenterSpaces_Unzip_Location>\copy_to_jdev_ext
     b. Make a copy of oracle.webcenter.portal.jar.
     c. The oracle.webcenter.portal.jar file is located under  
         <DesignWebCenterSpaces_Unzip_Location>\copy_to_jdev_ext.
     d. Navigate to: <JDeveloper_install_directory>\jdeveloper\jdev\extensions\
     e. Copy the oracle.webcenter.portal.jar file here.
4. Restart JDeveloper if it is open.
5. Edit weblogic.xml and add your library
6. Modify the config.properties files
            
      Before you can build the shared library list and deploy extend.spaces.webapp.war   to the WebCenter Spaces managed server, you must provide some information about your environment and your WebCenter Spaces installation in the configuration file  config.properties

. To set build and deployment properties for the extend.spaces.webapp shared library
. Open DesignWebCenterSpaces.jws.
. Expand the WebCenterSpacesExtensionLibrary project.
. Open config.properties.
. Enter information about your JDeveloper environment and WebCenter Spaces installation, as shown in 
. The config.properties file describes each property and offers examples. The defaults provided are only samples and must be replaced with your own, installation-specific values.
7. Save your updates to config.properties
8. Select WebCenterSpacesExtensionLibrary project and deploy to  WC_Spaces using ANT
. Clean stage
. Deploy-shared-lib
. After Deployment, Ensure Library is displayed in WLS Console

Register the taskflow in Resource Catalog
1. Login to Webcenter spaces
2. Click on ‘Administration’
3. Create a new catalog and copy it from the default catalog
4. Select the newly created catalog and click on ‘Edit’ -> ‘Edit’
5. In the ‘Edit’ popup, select Add -> Add from library
6. In the search box, enter the name of your taskflow
7. Select your taskflow and give it a ‘Name’ and click ‘Add’. This adds the taskflow to the   resource catalog
8. Select the newly created catalog and click Edit -> show
9. Click on ‘Configuratiions’ tab
10. Change the ‘Resource Catalog for Home spaces’ to the newly created catalog and click ‘Apply’
11. Now go back to webcenter spaces and to test the newly created taskflow:
. Create a new page
. Click on ‘Add Content’
. Select the taskflow from the catalog and click ‘Add’. The taskflow should   
   appear on the page
. Click ‘Save’ and ‘Close’

5 comments:

  1. Nice article. Looking forward for more "tips" in the future.

    ReplyDelete
  2. Nice and a precise Article Deepak .

    Thanks
    Harish Joshi

    ReplyDelete
  3. Hi Deepak!
    I followed the steps above but the Actives change encountered error on wls console:
    An error occurred during activation of changes, please see the log for details.
    - Error Cannot undeploy library Extension-Name: extend.spaces.webapp, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.3 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, webcenter-rss.war, sharepoint-servlet.war.
    Help me!
    thanks

    ReplyDelete
  4. Hi Manh,

    You need to ensure your library contains a Manifest file which contains a version number, the version number must be higher than the current version deployed on the Weblogic server.

    It tries to undeploy the current deployment but will fail as it is in use.

    Onkar

    ReplyDelete