Sample WebCenter Portal with Coherence Based Search Sequestering

Sample WebCenter Portal with Coherence Based Search Sequestering

I recently sat down with one of Fishbowl’s WebCenter Certified Implementation Specialists, Andy Weaver to chat about WebCenter PS3 and Oracle Coherence.

Billy: What is Oracle Coherence and how does it relate to Oracle WebCenter?

Andy: Oracle Coherence is a distributed caching infrastructure that we are using to facilitate communication between multiple weblogic applications.  It relates to webcenter in that we use it to dynamically load and store cross portal data.  We then use this data to ensure that the data created in one application is in sync – in real time – with the data in all the other applications sharing that infrastructure.

Billy: What advantages does this way of development provide you?

Andy: This allows for real-time data sync.  It is terribly easy to use.  We don’t need to worry about databases or file systems or anything like that.  The transfer between the application and the data cache is very simple, clean and transparent process.  This makes for much speedier and elegant coding.  Without Coherence we would have had to set up a new database schema or  at least a new table in a schema that was in common or at least available to all the other applications, then create all the connections to that database, then write or instantiate all the data access layers for each application.  Comparatively, using coherence is faster, better, stronger – just like a daft punk song.

Multi Portal Management in WebCenter

Multi Portal Management in WebCenter

Billy: One of the advantages of Oracle Web Content Management is its ability to provide template driven multi-site management.  You’ve done this for Portal Sites Now Too.  Is that Correct?

Andy: That’s correct.  We extended the concepts of the Site Studio multi-site management into the portal to allow easy management of web content but also to allow other business application integration with that content.

Billy: So the speed and agility with which business users can spin up targeted websites with WCM can now be used for spinning up portal sites?

Andy: Yes.  Portals are inherently business user oriented –  with capabilities like customization and personalization.  But it was always an IT / R&D task to set up the sites, new web applications or portals.  The delay that this would typically take could be 2-6 weeks and that was for a “responsive” IT team.  This new way made it a natural fit for business-driven portal applications that can spin up quickly while still using the sophisticated and controlled assets that IT creates.  IT just creates them once and now multiple business groups can use them.

Billy: Why did we need to add the website section and page tags from coherence to the assets we created?

Andy: It is really all about SEO for internal search results.  It is so we can scope the search down to content only for that site.  This is vital when you have a single large, multi-portal-site infrastructure hosting lots of different, and highly targeted content.  You don’t want content from one site polluting results when the user searched a different site.

Billy: So is this similar to a in-house multi-tenant – aka “cloud” – web infrastructure?

Andy: Yeah, sure.  The tenants in this case are the owners of each separate portal property.  They are chartered with providing information and service for their own areas but they share a common portal infrastructure.  In this case Oracle WebCenter 11g PS3.  It is very much a shared-services model on the infrastructure side that allows extreme flexibility and ease of use on the owner and consumer side.

Billy: Any final tips on how others can set up and use coherence in their own WebCenter projects?

Andy: Sure, check out the code snippets below.  Remember, this will only work with JVM instances that are running on the same physical box/VM.  Here is your basic setup:

1) Start Coherence script file:

run in $MIDDLEWARE_HOME/coherence_3.5:

#!/bin/bash

export JAVA_HOME=/opt/oracle/jrmc-4.0.1-1.6.0

bin/cache-server.sh 2>logs/coherence.out 1>logs/coherence.out &

2) Then, modify the classpath in setDomainEnv.sh so the coherence.jar is available to your applications:

CLASSPATH="/opt/oracle/middleware/coherence_3.5/lib/coherence.jar${CLASSPATHSEP}${CLASSPATH}"

export CLASSPATH

3) You’re basically ready.  Now you want to put a collection of data into the cache server from Application 1: (fishbowl portlets cache from the Fishbowl Portal Integration Suite is used as an example here).  Then you’ll want to retrieve that data in Application 2 a bit later.

NamedCache cache = CacheFactory.getCache("FishbowlPortletsCache");

cache.put("WP_SITE_MAP", siteMap); //where sitemap is a java.util.HashMap of data

4) Of course you’ll eventually need to get stuff out of the cache.  Here’s how to get the collection of data from the cache in Application 2:

NamedCache cache = CacheFactory.getCache("FishbowlPortletsCache");

Object siteMap = cache.get("WP_SITE_MAP");

And that is basically it.