protected JournalArticle getLatestArticle(long groupId, String articleId, int status) { List<JournalArticle> articles = null; if (status == WorkflowConstants.STATUS_ANY) { articles = JournalArticleUtil.findByG_A(groupId, articleId, 0, 1); } else { articles = JournalArticleUtil.findByG_A_ST(groupId, articleId, status, 0, 1); } if (articles.isEmpty()) { return null; } return articles.get(0); }
protected JournalArticle updateArticle(JournalArticle journalArticle, String content) throws Exception { Locale locale = LocaleUtil.getDefault(); String localeId = locale.toString(); String xmlContent = getArticleContent(content, localeId); _layoutSetPrototypeJournalArticle.setContent(xmlContent); return JournalArticleUtil.update(journalArticle, true); }