Foren

validation of custom attribute in Document Library

thumbnail
Shantanu Puranik, geändert vor 12 Jahren.

validation of custom attribute in Document Library

Junior Member Beiträge: 34 Beitrittsdatum: 21.01.11 Neueste Beiträge
A custom attribute is defined for Document of Document Library in Liferay 6.0.6 CE .
It's a selection list with three values. When document is added/ edited, value can be changed. Otherwise it's readonly.
What am I struggling to achieve:
The final value (3rd) can be assigned to document only by user having 'xyz' role.
I could think of two ways of accomplish this:
1. Populate selection list depending on user role. So that only user with 'xyz' role can see and assign any of the value.
2. Populate all three values in selection list and on form submission (click of publish button), validate custom attribute value and generate error message.

I'm thinking on option 2 above, using validator class but don't have idea as to where and how to call it in edit_file_entry.jsp
Can anybody help on this?