Saturday, December 18, 2010

Oracle UCM 11g Access From ADF 11g Table Row

There is quite obvious requirement, to show how many documents are uploaded and assigned for every employee. While we can open employee details and check available document, its more user friendly to show number of attached documents directly inside table row.

We are uploading new document for employee #200:


When document is uploaded, user can refresh employees table and see updated number of attachments for employee #200:


Sample application highlights record in green, if there are more than 0 documents attached.

We can upload more documents for employee #206, attachment status will be updated accordingly:


This allows to get information in advance and user can select only those records, he needs to select. For example, when Attachments indicated 0 documents, WebCenter 11g Document Management task flow is empty - without documents:


ADF 11g table contains column to indicate number of documents stored in Oracle UCM 11g per each employee #id:


If needed, employees table refresh is done manually, by calling Execute operation:


Employees VO contains one transient attribute - this attribute (UcmDocStatus) is referenced from ADF 11g table to show number of attached documents:


I have overridden prepareSession() method for AM, Oracle UCM 11g connection is established here and stored into session scope, to share it across requests:


Transient attribute getter method is overridden - getUcmDocStatus(), to retrieve number of documents per each employee #id:


On the side note, I recommend to use ADF logger, instead of external log4j library. You will avoid external library dependency by using built-in ADF logger class:


Download sample application - UCMNewFolderStatus.zip.

6 comments:

tkandhati said...

Dear Andrejus,

A heartfelt THANK-YOU for the excellent work you have done on your site and
for freely sharing such valuable information and insight with your fellow human beings.

Best Regards,
Thulasi kumar kandhati.

Andrejus Baranovskis said...

Thanks for great feedback !

Andrejus

Andreas Koop said...

In the checkFolderContent() method you explicitly check for idcClient == null or idcContext == null and if needed instantiate a new one.

Looks like there are indeed cases occurred otherwise you wouldn't implement it;-)

So from architectural point of view I am not really satisfied with the solution because there are two places where the idcClient is created: in prepareSession() and checkFolderContent().

Is this a bug?

Regards,
Andreas.

PS: Thanks a lot for sharing all the valuable posts in 2010!

Andrejus Baranovskis said...

Hi,

No, I didnt saw any bug regarding this. It's just proactively checking if UCM connection wasn't lost, to make sure connection is always maintained during requests. You can remove this check, it still will work.

Thanks !

Andrejus

wilcor said...

Dear Andrejus,
The post is really great !! thank for share your knowledge ! :).... I have a question about UCM... Do you know if there is a way to add Attachments to docments programatically ? ... I'm lokking up for a solution but didn't find any :'(... Hope you can help me :)

Andrejus Baranovskis said...

Hi Wilcor,

Thanks for your request. However I need a bit more info about your problem, to answer properly.

Would it be possible for you to log it on our public Wiki - http://redsamoracle.wikispaces.com/ ?

Thanks,
Andrejus