Executing a service from a ServiceHandler

Executing a service from a custom ServiceHandler is very easy.

ServiceHandlers always extend the ServiceHandler class. So within a custom ServiceHandler Java class, you have access to the Service object using the variable m_service. From this Service object, you can get a ServiceRequestImplementor object: m_service.getRequestImplementor(). With the ServiceRequestImplementor object, you can execute services with a few different methods (executeSubServiceCode, executeSafeServiceInNewContext, executeServiceEx, executeServiceDirect, executeServiceTopLevelSimple). I typically tend to use the executeServiceTopLevelSimple method.

The executeServiceTopLevelSimple method signature looks like the following: public void executeServiceTopLevelSimple(DataBinder binder, String serviceName, UserData userData) {}.

Below is a sample method I use to wrap the executeServiceTopLevelSimple method:

/**
* This method executes a service.
* @throws ServiceException
*/
private void executeService(final String DataBinder serviceBinder, final String serviceName) throws ServiceException {
     traceVerbose("Start executeService");
     try {
          trace("Calling service " + serviceName + ": " + serviceBinder.getLocalData().toString());           // Execute service
          m_service.getRequestImplementor().executeServiceTopLevelSimple(serviceBinder, serviceName, m_service.getUserData());
          trace("Finished calling service");
     } catch (final DataException e) {
          trace("Something went wrong executing service " + serviceName);
          e.printStackTrace(System.out);
          throw new ServiceException("Something went wrong executing service " + serviceName, e);
     } finally {
          traceVerbose("End executeService");
     }
}

Categories: OracleUCM

UCM Service Handlers and Java Filters

April 25, 2012 4 comments

Quite often we need to customize our Content Servers using some specific Java code. Usually we accomplish this by creating a custom component and utilizing Service Handlers or Java Filters (or both). Unfortunately, sometimes it might be hard to decide when you should use one over the other. So, let’s dig deeper into both and understand how they work.

Service Handlers

Service Handlers are a mechanism that allows us to add new services or modify existing services by using  Java.

Multiple Service Handlers could contain the same Java method, but the Content Server would only execute the one that is contained within the Service Handler that has the lowest Search Order. The Search Order is defined during the creation of the configuration table. The configuration table is a table that exposes your custom code to the Content Server.

Service Handlers could be chained/put-in-place to be executed:

  • Instead of new service actions:
    • Create a Service Handler with a lower Search Order.
  • Before existing service actions:
    • Create a Service Handler with a lower Search Order,
    • Make a call to the same method after your custom java code:

… custom java code …
m_service.doCodeEx(“<sameMethodName>”, this);

  • After existing service actions:
    • Create a Service Handler with a lower Search Order,
    • Make a call to the same method before your custom java code:

m_service.doCodeEx(“<sameMethodName>”, this);
… custom java code …

Java Filters

Java Filters is an event subscription mechanism through which developers can subscribe to the various events that occur within the Content Server and execute custom Java code.

During the operation of Content Server, there are various events that constantly being fired up. The developer can subscribe to these events and alter the behavior of Content Server. When the desired event would occur the control would be passed to the subscribers of the event and the custom java code could be executed. The Content Server then expects a result of the custom code execution.  The results are pretty straight forward:

  • CONTINUE – informs Content Server that everything went accordingly;
  • FINISHED – informs Content Server to stop running any other filters with the similar name;
  • ABORT – informs Content Server to halt execution of the current process.

When to Use Service Handlers versus Java Filters

Java Filters is the least-intrusive and easiest way to customize the behavior of Content Server with Java, whereas Service Handlers require more thorough understanding of the actions that need to be customized.

Java Filters is the preferred and most commonly used way of customization, but it is limited to the existing set of filters within the Content Server. So, if there is no defined filter to which you can subscribe, then you can create your own custom component that uses Service Handlers to customize the behavior.

Install Google-Chrome on Oracle Enterprise Linux 6.2

April 20, 2012 Comments off

These steps show how to install Google Chrome on Oracle Enterprise Linux 6.x.  I suspect these steps would also work with Fedora, CentOS and Red Hat (RHEL).  This approach uses Google’s YUM repository.

  1. Login or switch to the root user
  2. Create a file named google.repo in the /etc/yum.repos.d dirctory
  3. Add the appropriate segment to your new google.repo file
    • 32 bit
      [google-chrome]
      name=google-chrome – 32-bit
      baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
      enabled=1
      gpgcheck=1
      gpgkey=https://dl-ssl.google.com/linux
      linux_signing_key.pub
      
    • 64 bit
      [google-chrome]
      name=google-chrome – 64-bit
      baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
      enabled=1
      gpgcheck=1
      gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
      
  4. yum install google-chrome-stable
Categories: OracleLinux

Site Studio project file changes

April 19, 2012 Comments off

How often does the Site Studio project file change? The first determination that needs to be made is what all affects the project file. Some examples are as follows:

Out of the box, these changes are committed to the WebCenter Content repository (as a new revision of the project file content item) every 10 minutes. This 10 minute interval is set by the WebCenter Content configuration flag SSProjectAutoCheckinInterval (integer value in seconds which defaults to 600).
While waiting for the the time interval set with SSProjectAutoCheckinInterval, the project file changes are stored in a temp file located here: vault/~ssprojects/

The service SS_COMMIT_SITE_CHANGES can, “Be run at any time to commit changes on demand”. The only required parameter is siteId. “The user executing this service must have write access to the project file to execute the service.”

There is another configuration flag SSAutoCheckinBusyTimeout (integer value in seconds which defaults to 30) that is, “Used to set the minimum time duration (in seconds) before the auto check-in mechanism attempts a check-in of a project file. This configuration flag prevents two nodes from trying to check the project file in at the same time”. The auto check-in behavior appears to use service CHECKIN_ARCHIVE and with the default time of 10 minutes, this should handle any issues that might come up with the release date debacle.

The undocumented configuration flag SSOverwriteProjectsUponCheckin (boolean value which defaults to false) controls whether the latest project file revision is overwritten. So, out of the box, project file auto check-ins stack revisions one on top of the other, instead of simply overwriting the latest revision. This is, is in my opinion, a good thing.

Categories: OracleWCM

WebCenter Patch Set 5 (11.1.1.6)

February 24, 2012 2 comments

Patch Set 5 Released!

Oracle recently released Patch Set 5 for Fusion Middleware.  This includes my primary area of interest WebCenter Content.  This technically started rolling out to Oracle eDelivery and then OTN sometime on February 22nd, 2012.  I was a little late to the blogging game so instead of “announcing” the release let’s do a quick link roundup about this release from some of my favorite community members!  While this list isn’t comprehensive, it does come from a lot of people that have taught me a lot down the years so add them to your blog roll if you haven’t already.

Link Round-Up

  1. One of my friends, John Sim might have been the first to point out the release availability.  He also has a great rundown of the products included in the release
  2. Ryan has some handy links and also points out that the documentation has been updated
  3. Bex runs down the patch sets you may need to navigate if you plan to upgrade your now out-of-date UCM instance using his recently setup shortcuts for Oracle Patches
  4. The Official WebCenter Content Blog lists a host of new features around User Engagement, Content Enabling Applications and Infrastructure
  5. Webmonkey really elaborates on the new Folders Component (This one is sometimes referred to as Framework Folders while the older one was called Folders_g)
  6. And finally, on a separate note, but still related to PS5 note, Shay has a really nifty video showing some of the iPad related ADF stuff that’s new in JDeveloper/ADF for PS5
  7. Yannick Ongena has a good review with information on the new RIDC connection in JDeveloper
  8. The folks at AMIS also have a good link roundup

Ok, so these guys are a hard act to follow.  What can I say/do that they didn’t cover?  Only thing I can think about are some screenshots!  Once we got all the final bits downloaded (caution: that part takes a while if you want it all) we got a VM put together pronto and here’s some of the things we thought were interesting.

JDeveloper

First up, JDeveloper PS5 with Site Studio for External Applications (SSXA).  Notice in the shot below there is a dedicated RIDC connection you can now add to projects.  This could be handy for all kinds of things!

Also in JDevleoper PS5 (and I think it acts this way in the 11gR2 releases as well) you can now set the default built-in WebLogic Domain password to something you know and will remember when you first start the integrated server.  It used to be that the default password for the integrated server was weblogic1 and this was a major issue for those first setting out to use the product.  New users would be very frustrated trying to find out why they couldn’t login as weblogic user to test that first site they tried to build.  Love this!

Branding

Having booted up the integrated WebLogic server we see our contribution mode banner is now updated with the new product branding (WebCenter Content).  This is also updated in the content server user interface as well.

Out-of-the-box Assets

During the setup of our sandbox we obviously enabled Site Studio and SSXA.  It appears as though those components now ship with all the sample Custom Element Forms right from the start.  No more loading up the Site Studio Samples site from OTN just to grab these Custom Element Forms!  This made my day.

Folders and Desktop Integration

Of all the updates the Framework Folders and Desktop Integration Suite (DIS) changes are my favorite so far.  As mentioned before, Webmonkey runs down a lot of the features for us, but let’s see what it looks like.  One thing I want to point out though is that DIS works with Framework Folders and that Framework Folders overcomes a lot of the performance problems people used to experience with “Folders” in the past (previously called Contribution Folders).  This bears repeating because it opens a lot of doors and numerous customers have been waiting on these two features to converge.

Once you have DIS installed you’ll see an icon on the desktop (similar to how DIS has always worked) and you’ll double click that to open Windows Explorer which now has a “WebCenter Content Servers” node.  Clicking that node will show you the list of servers you have configured for your desktop (initially it will be blank, right click the blank white area and select Add Server).

If you have Rules and Profiles (custom check-in screens, etc.) enabled you’ll be able to use them in a drag and drop fashion right from your desktop by opening the “New Check-In” node.

Categories: OracleUCM, OracleWCM, WebLogic

Delete WebLogic Domain

February 1, 2012 1 comment

Deleting a WebLogic domain can be accomplished through a series of manual tasks.  There is no script or application to run that will accomplish deleting a domain or removing a domain.  The good news is the steps are fairly short and easy.  In the sample steps below it is assumed that your domain is named base_domain.

  1. Delete the domain folder (meaning base_domain) under %WL_HOME%/user_projects/domains
  2. Delete the domain folder (meaning base_domain) under %WL_HOME%/user_projects/apps
  3. Remove any references to the domain in the %WL_HOME%/domain-registry.xml file
  4. Remove any references to the domain in the file WL_HOME/common/nodemanager/nodemanager.domains
  5. Remove any schema/database associated with the domain
Categories: WebLogic
Follow

Get every new post delivered to your Inbox.