@Override public DDMFormValues getDDMFormValues( DDMStructure ddmStructure, Fields fields) throws PortalException { return _fieldsToDDMFormValuesConverter.convert(ddmStructure, fields); }
@Override public DDMFormValues getDDMFormValues( long ddmStructureId, String fieldNamespace, ServiceContext serviceContext) throws PortalException { DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure( ddmStructureId); Fields fields = getFields( ddmStructure.getStructureId(), fieldNamespace, serviceContext); return _fieldsToDDMFormValuesConverter.convert(ddmStructure, fields); }
protected String extractDDMContent( JournalArticle article, String languageId) throws Exception { DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (ddmStructure == null) { return StringPool.BLANK; } DDMFormValues ddmFormValues = null; try { Fields fields = _journalConverter.getDDMFields( ddmStructure, article.getDocument()); ddmFormValues = _fieldsToDDMFormValuesConverter.convert( ddmStructure, fields); } catch (Exception e) { return StringPool.BLANK; } if (ddmFormValues == null) { return StringPool.BLANK; } return _ddmIndexer.extractIndexableAttributes( ddmStructure, ddmFormValues, LocaleUtil.fromLanguageId(languageId)); }
protected void addDDMStructureAttributes( Document document, JournalArticle article) throws Exception { DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (ddmStructure == null) { return; } document.addKeyword(Field.CLASS_TYPE_ID, ddmStructure.getStructureId()); DDMFormValues ddmFormValues = null; try { Fields fields = _journalConverter.getDDMFields( ddmStructure, article.getDocument()); ddmFormValues = _fieldsToDDMFormValuesConverter.convert( ddmStructure, fields); } catch (Exception e) { return; } if (ddmFormValues != null) { _ddmIndexer.addAttributes(document, ddmStructure, ddmFormValues); } }