Excuse me, you got some AJAX in my UCM.

Now I know that SiteStudio 10gR4 is hardly brand new but for my own work I’m really starting to dig into it.  We’re running a version of Oracle UCM here at ImageSource that, well, not to put too fine a point on it, is getting a bit long in the tooth.  So, in order for me to play around with it, I ended up installing Oracle UCM 10gR3 on a development system.  I got to say that playing with all the new goodies is pushing getting our production system updated much higher up on my personal priority list!

There are so many new features that SiteStudio 10gR4 brings to the table that to go over them all in detail would take more time than I can spare.  With that in mind I’m going to focus on a new feature that really excites me: External Application Integration.

Oracle has provided us two brand spanking new services in this latest release: the WCM_PLACEHOLDER service, and the WCM_BEGIN_EDIT_SESSION service.  Now, with names like that I can forgive you if you are wondering where the sexiness is located. Let me assure you, it’s in there in spades.

WCM_PLACEHOLDER lets any external application you can think of, be it a custom thick-client, a web portal, or a mashup, get at any piece of content stored in UCM.  Wow!  Not only that but you can specify a rendering template (also stored in UCM) to format the data that’s returned. Double Wow!  So let’s say that you are creating a web portal and want to pull out, say, a word document that happens to contain a press release so you can extol the new virtues of Product 2.0 on the portal page.  With WCM_PLACEHOLDER you could load a link like the following using a standard HTTPRequest on the portal page:

http://myecmserver/idc/idcplg?IdcService=WCM_PLACEHOLDER&dataFileDocName=MY_AWESOME_PR_WORD_DOC
&templateDocName=MY_HTML_TEMPLATE

And get a fully rendered HTML fragment returned to you.  Even though it was a Word document, since we’re pulling it from UCM and using a region template that uses the DynamicConverter to convert that document into HTML, we don’t have to worry about it.  Because this is all done over HTTP we can leverage all the powerful AJAX methods that really are what modern website programming is all about.

You might be saying at this point “Okay, getting HTML back is okay I guess, but man, I really wish I could just get it in some easier format to work with it just as data and let my custom application do what I want with it.”  Luckily, WCM_PLACEHOLDER still has us covered. If we add the IS_JSON parameter to our request link and set that to 1 then, boom, we get a JSON response back and can do whatever we want with it without worrying about all the pesky HTML.   How cool is that?

Now the WCM_PLACEHOLDER services also returns something else interesting.  It returns security metadata that specifies what editing actions are allowed.  Wait, what? We can edit content displayed using this service?  Yes, Virginia, we can edit content in our repository from an external application.

And with all the flair of a featured actor making a dramatic entrance at the start of Act 2 we come to WCM_BEGIN_EDIT_SESSION.  Using this service couldn’t be simpler.  We preform an HTTPRequest on a URL like the following:

http://ecm/idc/idcplg?IdcService=WCM_BEGIN_EDIT_SESSION&dDocName=MY_DOCUMENT

And that will return a SiteStudio editor (assuming the user has the correct role of course) with the document ready to be edited from an external application.  Since WCM_PLACEHOLDER gives us metadata on what editing actions can be taken we can use that in our external application to visualize (or not) the actions that can be taken with that returned content.

These two services, while not complex in and of themselves, really make it easy to start creating dynamic, content driven, applications using the data you already have stored and with all the features you have come to expect from UCM literally anywhere.

One application that comes to my mind would be a UCM and SiteStudio powered blog platform where posts can be created and managed using the security roles already in your UCM installation. Well, a guy can dream can’t he?

Les Harris
Support Engineer
ImageSource Inc.