Permalink
Browse files

LPS-26920 journal.article.expire.all.versions=true has no effect when…

… auto expire triggered
  • Loading branch information...
1 parent 85650fc commit 30f22cd84e15be47acc2e7154f1e504981ed9c32 @vilmospapp vilmospapp committed with brianchandotcom Jun 26, 2012
@@ -418,15 +418,28 @@ public void checkArticles() throws PortalException, SystemException {
Set<Long> companyIds = new HashSet<Long>();
for (JournalArticle article : articles) {
- article.setStatus(WorkflowConstants.STATUS_EXPIRED);
- journalArticlePersistence.update(article, false);
+ if (PropsValues.JOURNAL_ARTICLE_EXPIRE_ALL_VERSIONS) {
+ List<JournalArticle> versionedArticles =
+ journalArticlePersistence.findByG_A(
+ article.getGroupId(), article.getArticleId(),
+ QueryUtil.ALL_POS, QueryUtil.ALL_POS,
+ new ArticleVersionComparator(true));
- if (article.isIndexable()) {
- Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(
- JournalArticle.class);
+ for (JournalArticle versionedArticle : versionedArticles) {
+ versionedArticle.setStatus(
+ WorkflowConstants.STATUS_EXPIRED);
- indexer.delete(article);
+ versionedArticle.setExpirationDate(
+ article.getExpirationDate());
+
+ journalArticlePersistence.update(versionedArticle, false);
+ }
+ }
+ else {
+ article.setStatus(WorkflowConstants.STATUS_EXPIRED);
+
+ journalArticlePersistence.update(article, false);
}
updatePreviousApprovedArticle(article);

0 comments on commit 30f22cd

Please sign in to comment.