Archive

Archive for June, 2009

Get Groovy With UCM (Stellent)

June 11, 2009 Jason Stortz Comments off

Yet another way to work with UCM? You bet! But this one is super Groovy (sorry, I had to do that). Check out how to setup Groovy and the Remote Intradoc Client to integrate with the Oracle Fusion Enterprise Content Management platform. You know you want to!

I really like the Remote Intradoc Client (RIDC). RIDC allows me to control UCM (Stellent) from a Java based application (Console, JSP, Servlet, etc.). What was that? Sounds similar to Content Integration Suite (CIS) you say? Yes, so far it does. RIDC is a thinner, light weight framework for those already familiar with UCM services. RIDC has very few of those "helper methods" that would guide you through the intelli-sense embedded in your IDE. However, for those familiar with services or willing to research them RIDC will offer tremendous capacity with little effort.

You can get RIDC as part of the CIS download from here. Within the CIS download is a folder containing the jar files and documentation needed to get up to speed on RIDC. This is not a deep dive on RIDC itself, but more of a sampling of how I use it to integrate/control UCM. Bex Huff has a similar article using Jython with RIDC. There is always more than one way to skin a cat.

I make use of RIDC via Groovy. Side Note: Groovy is built in with ADF 11g and Oracle uptake on Groovy will go even deeper in the future.

Important Groovy Links

  • Download – As of this writing the latest version of Groovy was 1.6.3.
  • Documentation – (Tons of examples!)
  • Getting Started – Discusses configuration of the JDK and variables like JAVA_HOME

Pure Groovy Examples

Sample #1 – Hello World

println "Hello, World!"

Sample #2 – JSON Like Syntax Possibilities

scores = [ "Brett":100, "Pete":"Did not finish" ]
println scores["Pete"]
println scores.Pete

Groovy UCM Sample

How about we start with a very simple example? We will use Groovy to Ping the Content Server. Start by opening the Groovy Console application. From there I need to use the "Script" menu to add a reference to the RIDC JAR file. At this point the environment is pretty well ready to go and we can start writing code in the console to be executed. To execute the code you can use CTRL-R, and to clear the output window you can use CTRL-W.

Using RIDC is easiest when we are familiar with the services calls, the parameters to send the calls, and what to expect in the response from the calls. If you set your profile to Top Menus so you can see the URL you will be able to look at the variables passed around to service calls as you surf through content server. You could also use a tool like Fiddler or another HTTP proxy/sniffer to spy on the parameters being swapped with content server by your browser.

Use the "Script" menu to add JARs.

Use script menu to add jars

Add the RIDC JAR specifically.

Add the RIDC JAR

As an example, when I execute this url:

http://localhost/idc/idcplg?IdcService=PING_SERVER&IsJava=1

I get back a response like this one below, which I can then use RIDC/Groovy to access the response data.

<?hda version="10.1.3.4.1 (090528)" jcharset=UTF8 encoding=utf-8?>
@Properties LocalData
dUser=sysadmin
blFieldTypes=StatusMessage message
refreshSubMonikers=
StatusMessage=You are logged in as 'sysadmin'.
blDateFormat=M/d/yy {h:mm[:ss] {aa}[zzz]}!mAM,PM!tAmerica/Chicago
XmlEncodingMode=Full
changedSubjects=
refreshSubjects=
refreshMonikers=
changedMonikers=
IdcService=PING_SERVER
IsJava=1
@end

Armed with this request/response knowledge, we can create a Groovy script using RIDC like this:

// Import needed classes from Remote Intradoc Client Jar
import oracle.stellent.ridc.IdcClientManager
import oracle.stellent.ridc.IdcContext

// Create the client for request/response
client = (new IdcClientManager()).createClient("idc://localhost:4444")

// Create a user/security context, don't need a as we're connecting
// directly to ucm and we're a trusted ip
userContext = new IdcContext("sysadmin")

// Setup the request
req = client.createBinder()
req.putLocal("IdcService", "PING_SERVER")

// Get the response
resp = client.sendRequest(userContext, req).getResponseAsBinder()

// Use the response, should say "Response: you are logged in as 'sysadmin'"
println "Response: ${resp.getLocal("StatusMessage")}"

// Wrap it up!
println "Done"

Here's what this looks like run in Groovy Console:

PING_SERVER run in Groovy

You may need to add your ip address to the IP Address Filter of content server for this script to run (as it is written). You can also use a user name and password with RIDC. This is covered in the documentation.

Download the Sample PingServer.groovy Script.

Categories: OracleUCM Tags:

Hide Primary File In Site Studio Contributor

June 10, 2009 Jason Stortz Comments off

When users create new datafiles through Site Studio Contributor the Primary File (primaryFile) field can be the source of some questions or confusion. This field is usually pre-populated with ?default.xml?. Sometimes users will ask what this field is and/or why they see it. One of the easiest ways to deal with this issue or answer this problem is to hide that field! Add the following field to the server's config.cfg and restart. It looks like this setting may have been added in the may releases, so this may or may not work for you depending on your version and when this new feature was added.

SSHidePrimaryFileInContributor=true

Categories: OracleWCM

Link To a Specific PDF Page

June 9, 2009 Jason Stortz Comments off

Sometimes I need to send someone to the documentation. Now and then it will be easier to tell them, "Hey, check out page 10 of the iDocScript guide!" This can easily accomplished by tagging #page= onto the end of the PDF URL.

As an example, check out page 30 of the "Using Components" PDF:

http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/developer/using_components_10en.pdf#page=30

Send users directly to a certain page makes the process much easier for them.

Categories: OracleUCM

Saying I Don't Know

June 2, 2009 Jason Stortz Comments off

How do you say "I don't know"? More often than I would like I am presented with an opportunity to tell a client or potential client how little I know about topic XYZ. In consulting, each opportunity presents itself as new twists to an old problem or some completely new animal that catches you totally off guard.

If you have had success in your past endeavors you usually have an answer or a process that quickly derives an answer in your back pocket. For those days when you get blind-sided, just how do you say you are clueless without coming off as inept?

  1. Discuss something you have done that is similar
  2. Demonstrate some degree of familiarity with the problem space (though perhaps not a solution)
  3. Admit you simply do not know

I have found that trying to know everything is generally a recipe for disaster. It comes back to bite you in the end. I will usually opt for total transparency whenever possible and point out where I may be lacking in hopes of fostering a trust relationship with the client. This in turn sometimes leads them to grant a little latitude or even an allotment of time to learn something new.

Since I am always looking for new ways to not look totally moronic, how do you say "I don't know" gracefully?

Categories: Mindlessness

Manually Disable Component

June 1, 2009 Jason Stortz Comments off

It is very easy to disable a Stellent component manually. Sometimes when you install a new component you may find something is wrong and the server does not restart. Other times you might be developing the component yourself and the server again fails to restart. On a variety of occasions you will not even be able to fire up Component Wizard. This process also comes in handy when content server is installed on a remote machine and you do not have access to be able to pull up component wizard.

That is where this trick comes in. Find this file: /config/components.hda

Remove the name and location entries for the component causing the issue. I suggest storing those strings somewhere else, perhaps another text file?

Now attempt to restart your content server and all should be right with the world once again.

Categories: OracleUCM