protected String extractDDMContent(DLFileVersion dlFileVersion, Locale locale) throws Exception { List<DLFileEntryMetadata> dlFileEntryMetadatas = DLFileEntryMetadataLocalServiceUtil.getFileVersionFileEntryMetadatas( dlFileVersion.getFileVersionId()); StringBundler sb = new StringBundler(dlFileEntryMetadatas.size()); for (DLFileEntryMetadata dlFileEntryMetadata : dlFileEntryMetadatas) { Fields fields = null; try { fields = StorageEngineUtil.getFields(dlFileEntryMetadata.getDDMStorageId()); } catch (Exception e) { } if (fields != null) { DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(dlFileEntryMetadata.getDDMStructureId()); sb.append(DDMIndexerUtil.extractAttributes(ddmStructure, fields, locale)); } } return sb.toString(); }
protected void addFileEntryTypeAttributes(Document document, DLFileVersion dlFileVersion) throws PortalException { List<DLFileEntryMetadata> dlFileEntryMetadatas = DLFileEntryMetadataLocalServiceUtil.getFileVersionFileEntryMetadatas( dlFileVersion.getFileVersionId()); for (DLFileEntryMetadata dlFileEntryMetadata : dlFileEntryMetadatas) { Fields fields = null; try { fields = StorageEngineUtil.getFields(dlFileEntryMetadata.getDDMStorageId()); } catch (Exception e) { } if (fields != null) { DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(dlFileEntryMetadata.getDDMStructureId()); DDMIndexerUtil.addAttributes(document, ddmStructure, fields); } } }