Saturday, November 6, 2010

Folder Move in Oracle UCM (Stellent)

I would like to share my experience on COLLECTION_MOVE_LOT service of Oracle UCM 10gR3. This is the service which we used for moving folders from one folder to another in our application.

There were few problems when we actually started implementing the move functionality.

First thing is that the folders that were moved and the documents under it did not inherit the metadata values from destination folder. They still retained the same metadata of the source location.

To overcome this issue, a new method was introduced at the end of all methods in COLLECTION_MOVE_LOT service. This new method's purpose is to update the metadata of the moved folders and documents as per the destination collection's metadata. For updation of metadata, we invoked the COLLECTION_UPDATE_META service from this new method.

Let me give an overview of the COLLECTION_UPDATE_META service. The COLLECTION_UPDATE_META service is used to propagate the inheritable metadata of the parent folder to all the child folders and documents under it. The propagation of the metadata to the documents is achieved by invoking the COLLECTION_UPDATE_ALL service from inside the code of the service COLLECTION_UPDATE_META.

So, when the COLLECTION_UPDATE_META service is used along with COLLECTION_MOVE_LOT to propagate the metadata of the destination folder on the folders that got moved, it introduced new problems.

One problem was that although the moved documents' metadata got updated, the web viewable files of all the documents were not physically relocated according to the destination location's account settings. So all the web-viewable files were not accessible after folder move operation. I solved this problem by commenting the code which was invoking the COLLECTION_UPDATE_ALL service and then invoked the UPDATE_DOCINFO service which updates the metadata of the documents plus physically moves the web-viewable files to the correct location.

The other problem was COLLECTION_UPDATE_META service, updates all the folders and documents under a specific folder. But our requirement was to update the metadata of only the folders that got moved and the documents under it. So we had to overwrite the setContentAsCollectionMetadata method which is the method that does the job for the service COLLECTION_UPDATE_META. I just wrote a small logic to propagate the destination folder's metadata only to the folders that got moved and the documents under it.

If you have some inputs, corrections or suggestions on this post, please leave a comment, so that I can improve my application.

Have a good day...

5 comments:

Anonymous said...

Where did you get the documentation for the calls to the collection services? As far as I can see, at least half of the services listed in the documentation have no associated list of parameters required to run them.

Selvam said...

Yes true, documentation don't provide much help to the developers. I just invoke the service and put some binders, decompile the class files of the Folders_g and other components to get some details. Its all trial and error method.

Cheers!

Bob said...

Thanks for that.
Can you provide the details for the service calls (attributes) of the ones you have used in this blog then?

Gagan said...

Hi, we are planning to do something similar. Will it possible for you to share your component. Will be greatful !
Actually want to see how you use the collection_update_meta service. Do you retrieve the collection_info to first get the collection metadata ? Also how do you obtain the list of documents to update in that folder

Anonymous said...

Hi Selvam -- thanks for sharing your experience with COLLECTION_UPDATE_META.

I have noticed that when I invoke this for a folder which has a lot of content items, the propagation has completed the read times out with java.net.SocketTimeoutException

Despite this, the propagation continues in the background, independent of the invoker of the service.

Do you have any insight into dealing with this? I don't see anywhere to set the read timeout time.

Also, I tried wrapping the call to sendRequest in a try-catch block and catching the java.net.SocketTimeoutException exception, but my IDE (JDeveloper) does not recognize that this method throws that, even though I see it does (e.g. by catching Exception and then inspecting it.

Thanks for any thoughts...
-paul