Pages

Tuesday, September 9, 2014

Groovy : Posted Attribute Value using groovy

How to get the posted attributeValue using Groovy .

 To expose old value of entity objects, follow steps below :

1.  Create transient attribute "OLD_SALARY" in Entity Object.
2. Make sure that "Persistent" and "Derived From SQL Expression" properties are turned off.
3. Set the "Value Type" to Expression and enter the following Groovy expression into the Value field:

adf.object.getPostedAttribute(adf.object.getAttributeIndexOf(model.EmployeesImpl.SALARY))

That's it... Now  old salary attribute holds the value of salary retrieved from database. If required same attribute can be used in viewObject ...

Enjoy.

Tuesday, August 5, 2014

Uploading Large Files to UCM - af:inputFile Component

This post covers uploading large files to UCM using inputFile Component.

JDeveloper Version : Studio Edition Version 11.1.1.7.0

Recently I was working with af:inputFile Component trying to upload files to UCM. I hit an issue when trying to upload files larger than 2MB. I am going to share my findings :

1. InputFile component gets stuck if trying to upload large file... and it doesn't even allow to select other small file once it is stuck. I searched google and found this :

Andrejusb Blog - Oracle UCM 11g uploading large files


Set this parameter "org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE" = 20971520 in  web.xml for upload up to 20 MB.{ maximum file upload size to 20971520 bytes, or divided by 1024 and one more time by 1024 - 20 MB }

2. Now again question is - what happens after that 20MB file ... inputFile Component gets stuck. Further digging found that it is component bug and patch is available.

Dowload and apply Patch : 15931140 

Enjoy !!

Wednesday, May 28, 2014

Error Message html formatting

How to apply HTML formatting to error message

In my earlier post, I explained how to show error messages programmatically. This post covers how to apply HTML formatting to error messages. Credits to Ashish Awasthi's blog for this one. 




Enjoy...