/** * @deprecated As of Judson (7.1.x), with no direct replacement */ @Deprecated @Override public List<JournalArticle> getArticles(Hits hits) throws PortalException { List<Document> documents = hits.toList(); List<JournalArticle> articles = new ArrayList<>(documents.size()); for (Document document : documents) { String articleId = document.get(Field.ARTICLE_ID); long groupId = GetterUtil.getLong( document.get(Field.SCOPE_GROUP_ID)); JournalArticle article = JournalArticleLocalServiceUtil.fetchLatestArticle( groupId, articleId, WorkflowConstants.STATUS_APPROVED); if (article == null) { articles = null; Indexer<JournalArticle> indexer = IndexerRegistryUtil.getIndexer(JournalArticle.class); long companyId = GetterUtil.getLong( document.get(Field.COMPANY_ID)); indexer.delete(companyId, document.getUID()); } else if (articles != null) { articles.add(article); } } return articles; }
protected List<DDMFormInstanceRecord> getFormInstanceRecords(Hits hits) throws PortalException { List<DDMFormInstanceRecord> formInstanceRecords = new ArrayList<>(); for (Document document : hits.toList()) { long recordId = GetterUtil.getLong( document.get(Field.ENTRY_CLASS_PK)); try { DDMFormInstanceRecord formInstanceRecord = getFormInstanceRecord(recordId); formInstanceRecords.add(formInstanceRecord); } catch (NoSuchFormInstanceRecordException nsfire) { if (_log.isWarnEnabled()) { _log.warn( "DDM form instance record index is stale and" + "contains record " + recordId, nsfire); } long companyId = GetterUtil.getLong( document.get(Field.COMPANY_ID)); Indexer<DDMFormInstanceRecord> indexer = getDDMFormInstanceRecordIndexer(); indexer.delete(companyId, document.getUID()); } } return formInstanceRecords; }