Tuesday, April 28, 2015

Setting up Oracle JDeveloper for WebCenter Portal Asset Development




Oracle WebCenter Portal's round-trip development features provide a simple, convenient way to create and modify Oracle WebCenter Portal assets without redeploying the entire application. Round-trip development refers to features and techniques that allow you to download assets from Oracle WebCenter Portal and upload them to Oracle JDeveloper for maintenance or enhancement. Once an asset has been modified, you can upload it back to Oracle WebCenter Portal for immediate use or for testing.
In this article you will learn how to set up your development environment for Oracle WebCenter 11.1.1.8.
Examples in this article use an environment that has Oracle WebLogic Server, Oracle WebCenter Portal, and Oracle WebCenter Content installed and running.
The installation of Oracle JDeveloper occurs on a laptop with Windows 7 OS.

JDeveloper Installation and Configuration

  1. Download and install JDeveloper 11.1.1.7
    1. As of September 26, 2013, this is the most recent version of JDeveloper that supports asset development for Oracle WebCenter Portal 11.1.1.8
    2. JDeveloper 11.1.2.X.X versions do not support WebCenter development
      JDeveloper was installed in this path: C:\Oracle\Middleware\11117

      That path will be referenced throughout this article, but may be different based on your installation.
  2. Open JDeveloper.
  3. Install the Oracle WebCenter 11.1.1.8 Portal Extension for JDeveloper.
    1. Help —> Check For Updates
    2. Search for Oracle WebCenter Portal extension (version 11.1.1.8.0)
    3. Select the extension, then click Finish
    4. Restart JDeveloper
  4. Download the portal asset development workspace from OTN:
    1. http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_11.1.1.8.0.zip
    2. This folder is a JDeveloper application that you will connect to your WebCenter instance for direct download and upload.
      This ZIP file was downloaded to: C:\Users\MPALSKI\Downloads.

      This path will be referenced for the rest of this article.
    3. Unzip DesignWebCenterSpaces_11.1.1.8.0.zip to C:\Users\MPALSKI\Downloads\DesignWebCenterSpaces_11.1.1.8.0
  5. Copy the workspace WLST scripts to your JDeveloper instance.
    1. Navigate to: C:\Users\MPALSKI\Downloads\DesignWebCenterSpaces_11.1.1.8.0\copy_to_common\common
    2. Select the folders script_handlers and wlst and copy them
    3. Navigate to: C:\Oracle\Middleware\11117\oracle_common\common
    4. Paste the folders into common to replace the existing script_handlers and wlst folders (Figure 1).
palski-jdeveloper-webcenter-fig01
Figure 1
  1. Copy the workspace JAR file to your JDeveloper extensions library.
    1. Navigate to: C:\Users\MPALSKI\Downloads\DesignWebCenterSpaces_11.1.1.8.0\copy_to_jdev_ext
    2. Right-click and copy oracle.webcenter.portal.jar
    3. Navigate to: C:\Oracle\Middleware\11117\jdeveloper\jdev\extensions
    4. Rename oracle.webcenter.portal.jar to oracle.webcenter.portal_old.jar.
    5. Paste oracle.webcenter.portal.jar into the folder (Figure 2).
palski-jdeveloper-webcenter-fig02
Figure 2
  1. Copy the workspace into your JDeveloper folder.
    1. Navigate to: C:\Users\MPALSKI\Downloads\DesignWebCenterSpaces_11.1.1.8.0
    2. Copy the DesignWebCenterSpaces folder.
    3. Navigate to: C:\JDeveloper\mywork.
    4. Note that this is NOT the same location as your JDeveloper installation folder.
    5. Paste the workspace into the mywork folder.
  2. Restart JDeveloper.
    1. Close JDeveloper
    2. Re-open JDeveloper

Workspace Configuration

  1. Open the workspace:
    1. Open JDeveloper
    2. Navigate to File —> Open
    3. Navigate to C:\JDeveloper\mywork\DesignWebCenterSpaces
    4. Select DesignWebCenterSpaces.jws
    5. Click the Open button.
  2. Open connection properties file:
    1. Expand WebCenterSpacesExtensionLibrary
    2. Expand Resources
    3. Expand WebCenterSpacesExtensionLibrary
    4. Open config.properties by double-clicking the file (Figure 3).
palski-jdeveloper-webcenter-fig03
Figure 3
  1. Set connection properties:
    1. Follow the instructions in this file that display in green and are prefixed with a # so that they are commented out.
    2. For reference, here are some example values:
      1. jdeveloper.install.home.directory=C:\\Oracle\\Middleware\\11117
      2. wlst.executable=wlst.cmd
      3. extending.spaces.home.dir=C:\\JDeveloper\\mywork\\DesignWebCenterSpaces
      4. oracle.jdeveloper.ojdeploy.path=${jdeveloper.install.home.directory}/jdeveloper/jdev/bin/ojdeploy
      5. wls.port=7001
      6. wls.host=<IP address>
      7. wc.port=8888
      8. wc.host= <IP address>
      9. wc.protocol=http
  2. Create User Key and User Config files:
    1. Navigate to your wlst.cmd file
      1. C:\Oracle\Middleware\11117\oracle_common\common\bin
      2. Double-click wlst.cmd
    2. Connect to the admin server
      1. connect('weblogic','welcome1','<IP address>:7001')
    3. Enter the following command
      1. storeUserConfig('C:/myFiles/myuserconfigfile.secure', 'C:/myFiles/myuserkeyfile.secure')
    4. When prompted, enter Y and then hit Enter (Figure 4).
palski-jdeveloper-webcenter-fig04
Figure 4
  1. Complete connection properties:
    1. wls.userkey=C:\\myFiles\\myuserkeyfile.secure
    2. wls.userconfig=C:\\myFiles\\myuserconfigfile.secure
    3. wls.target=WC_Spaces,AdminServer
    4. wls.webcenter.app.target=WC_Spaces
    5. webcenter.app.name=webcenter
    6. restart.implementation.version.suffix=2
    7. restart.implementation.version.suffix.ear=2
  2. Test the connection:
    1. Navigate to WebCenterSpacesResources\Web Content\oracle\webcenter\siteresources\scopedMD\s8bba98ff_4cbb_40b8_beee_296c916a23ed\navigation\gsra789be69_045e_40dc_9884_c9d30e78a90b\Navigation.xml
    2. Right-click Navigation.xml
    3. Select "Upload Portal Resource to server…" (Figure 5).
      palski-jdeveloper-webcenter-fig05
      Figure 5
    4. Enter your admin username and password. The default values are (Figure 6):
      1. Username: weblogic
      2. Password: welcome1
      palski-jdeveloper-webcenter-fig06
      Figure 6
    5. A confirmation dialogue box will display (Figure 7):
      palski-jdeveloper-webcenter-fig07
      Figure 7

Downloading Assets

  1. In the Navigator, right-click the WebCenterSpacesResources project and then select Download Portal Resource from Server. You may be prompted to enter a username and password.
    palski-jdeveloper-webcenter-fig08
    Figure 8
  2. In the Download Portal Resources dialogue, choose to download either a shared asset (Application-Level Resource) or a portal asset (Portal-Level Resource).
  3. To filter the list of possible asset names, select the type of asset you wish to download from the Resource Type menu (Figure 9).
    palski-jdeveloper-webcenter-fig09
    Figure 9
  4. Finally, select the name of the asset you wish to download from the Resource Name menu.
  5. Click the OK button. A progress bar will appear and then a confirmation will display (Figure 10).
    palski-jdeveloper-webcenter-fig10
    Figure 10
  6. You can check the log file to confirm that the download completed successfully. Your log file should resemble Figure 11.
    palski-jdeveloper-webcenter-fig11
    Figure 11
  7. The asset that you selected will now appear in your JDeveloper project. In the following example screen shots, a Page Template was downloaded (Figure 12).
    palski-jdeveloper-webcenter-fig12
    Figure 12
  8. To ensure you are viewing the same asset that you just downloaded, right-click the asset and select Update Portal Resource (Figure 14). The display name will match the Resource Name that you selected during download (step #3 in this section).
    palski-jdeveloper-webcenter-fig13
    Figure 13
  9. Click Cancel to close the dialogue and return to your project for resource development.

Editing Portal Resources in JDeveloper

To learn more about building assets, read the appropriate chapters in the Oracle WebCenter Documentation:

Backing Up Your Resources

Sometimes, you may want to create a backup copy of a portal asset. For instance, it would be wise to back up a portal asset before uploading a new version of it in case your development causes unintended results.
Portal resources are saved as EAR files. To save a copy of a portal asset, follow these steps:
  1. Navigate to the Administration page.
  2. Select Shared Assets in the top-navigation.
  3. Select an asset category from the left-navigation.
  4. Navigate to the resource you wish to back up, right-click, and select download (Figure 14).
    palski-jdeveloper-webcenter-fig14
    Figure 14
  5. In the Download dialogue box, click Download to save the EAR file to your local machine (Figure 15).
    palski-jdeveloper-webcenter-fig15
    Figure 15
  6. You have now successfully made a backup copy of that portal resource.

Restoring Your Backup

To restore your backup copy of the resource, simply return to the Administration interface and use the Upload button to import the backup EAR file that you downloaded (Figure 16).
palski-jdeveloper-webcenter-fig16
Figure 16
When replacing a copy of the asset that has already been edited in JDeveloper:
  1. Delete the asset that was already imported into JDeveloper by right-clicking it and selecting Delete (Figure 17).
    palski-jdeveloper-webcenter-fig17
    Figure 17
  2. Follow the steps in this article to download the resource to your JDeveloper project from WebCenter.

Conclusion

Out-of-the-box, Oracle WebCenter Portal provides tools knowledge workers and developers with the tools to quickly and easily create portals, intranets, extranets, and self-service applications that offer users a more effective and efficient way to access and interact with information, business applications, and process. Oracle WebCenter Portal can be customized using browser-based tools and JDeveloper.
JDeveloper can be used to develop components that can be deployed and used in Oracle WebCenter Portal. Components can be ADF task flows, data controls,managed beans, and such other assets as skins, page styles, task flow styles, page templates, content-present display templates, navigations, and resource catalogs.
Enabling direct upload/download between JDeveloper and Oracle WebCenter Portal makes iterative asset development quicker and easier for your development team.

By leveraging the indirect process of downloading a portal asset as an EAR file, development teams can back up portal assets before deploying a new version to their environment.


Reference : http://www.oracle.com/technetwork/articles/enterprise2/palski-jdeveloper-webcenter-2062770.html

Wednesday, April 22, 2015

Best Practices while Un deploying and Re Deploying to the same environment


This is very common requirement whenever we are dealing with Custom Webcenter Framework applications to undeploy and redploy. we need to consider below points whenever we perform these activities

 - Make sure you should not lose the already existing Security Policies (For eg : Users can create pages at run time, add/remove/update security access permissions). All these security policies will be stored in 'Policy Store'. You can access to this Policy store using ' Fusion Middleware Control (EM Console)
ReDeploying Webcenter Applications
Select Domain -> Right Click -> Security -> Application Policies

- It is always best practice to redeploy the application, and choose same MDS Partition
- If you didn't make any changes at design time with respect to security, then always chose
'Configure Application Security' 'Edit' option during deployment process
- Choose 'Ignore' option as shown below,


 - Remove the Application Credential Map

  1. Determine the credentials map name used by the application by inspecting the contents of the application's adf-config.xml and locating the value foradfAppUID. For example:
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="Veeva-7209"/>
    </adf:adf-properties-child>
    
    In this case, Veeva-7209 is the credential map name used by the application.
  2. Log in to Fusion Middleware Control.
    For information on logging into Fusion Middleware Control, see Section 6, "Starting Enterprise Manager Fusion Middleware Control."
  3. In the Navigation pane, expand the WebLogic Domain node and click the target domain (for example, wc_domain).
  4. From the WebLogic Domain dropdown menu, select Security > Credentials.
    The Credentials pane displays (see Figure 7-19).
    Figure 7-19 Credentials Pane
    Description of Figure 7-19 follows
    Description of "Figure 7-19 Credentials Pane"
  5. Select the credential map to remove and click Delete.
  6. Click Yes to confirm deleting the credential map.

How to build/Import/Export Shared Assets in Webcenter Portal 11.1.1.8


i.                 Create an asset with Portal Builder or copy an existing one, select it, then click the Download button:
              – it’s not used anywhere else), and then click the Download button:
iii. Save the layout to your computer
How to import Shared Asset to JDeveloper ?


-  In JDeveloper, in the DesignWebCenterSpaces application, right-click the WebCenterSpacesResources project, and then choose “Import Portal Resource…”:
-   Browse to the downloaded EAR file, and then click the OK button:
- The EAR will import, and the asset will be placed in the project hierarchy by type and GUID of the asset:

- You are ready to Edit.

 How to Export Updated Shared Assets from Jdeveloper:
- When you’ve finished editing the asset and you want to send it back to the Portal server, right click the asset, and choose “Export Portal Resource…”:

 
-  Click the browse button to locate the EAR file you brought over (or create a new file) and click the OK button:



Return to the Portal, then click the “Upload” button:
Browse to the EAR file you just created, and then click the Upload button:
Confirm the replacement if the asset exists:
 And you’re newly uploaded asset is ready to use:
- Import Page template and skin in shared asset –
- Go to Administer portal.
- Go to setting and provide template and skin name and save.Click on view portal
Your Shared Assets are successfully applied to your portal builder now