Foros de discusión

Document Library Custom Field Search

narendar b, modificado hace 10 años.

Document Library Custom Field Search

New Member Mensajes: 2 Fecha de incorporación: 23/02/12 Mensajes recientes
Hi,

Please find the issue description below.

We have created a custom field as "hindi-description" under "Documents and Media Document".

While uploading the basic document we are providing some data to custom field "hindi-description" which is storing in the "ExpandoValue" table "data_" column.

Please find the attached screenshot.

Suppose I have 2 or 3 versions of the same document then I need to retrieve the latest version.

I am using the below code

ExpandoColumn column = ExpandoColumnLocalServiceUtil.getDefaultTableColumn(10153, DLFileEntry.class.getName(),"hindi-description"); //here 10153 is companyId


if (column != null) {
DynamicQuery query = DynamicQueryFactoryUtil.forClass(ExpandoValue.class,PortalClassLoaderUtil.getClassLoader());


query.add(RestrictionsFactoryUtil.eq("tableId", column.getTableId()));
query.add(RestrictionsFactoryUtil.eq("columnId", column.getColumnId()));
query.add(RestrictionsFactoryUtil.ilike("data", keyword));

List<ExpandoValue> results = ExpandoColumnLocalServiceUtil.dynamicQuery(query);

for (ExpandoValue expandoValue : results) {

System.out.println(" data_ -----> " + expandoValue.getData());

}
}



Please let me know how to get the latest version and its description.

Also please let me know the relation between DlFileEntry and ExpandoValue tables.

Thanks in advance.
Narendar