留言板

validation of custom attribute in Document Library

thumbnail
Shantanu Puranik,修改在12 年前。

validation of custom attribute in Document Library

Junior Member 帖子: 34 加入日期: 11-1-21 最近的帖子
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?