*/
public List<JSONObject> getRandomArticles() throws ActionException {
try {
final JSONObject preference = preferenceUtils.getPreference();
if (null == preference) {
throw new ActionException("Not found preference");
}
final int displayCnt =
preference.getInt(Preference.RANDOM_ARTICLES_DISPLAY_CNT);
final List<JSONObject> ret =
articleRepository.getRandomly(displayCnt);
// Remove unused properties
for (final JSONObject article : ret) {
article.remove(Keys.OBJECT_ID);
article.remove(ARTICLE_AUTHOR_EMAIL);
article.remove(ARTICLE_ABSTRACT);
article.remove(ARTICLE_COMMENT_COUNT);
article.remove(ARTICLE_CONTENT);
article.remove(ARTICLE_CREATE_DATE);
article.remove(ARTICLE_TAGS_REF);
article.remove(ARTICLE_UPDATE_DATE);
article.remove(ARTICLE_VIEW_COUNT);
article.remove(ARTICLE_RANDOM_DOUBLE);
}
return ret;
} catch (final Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
throw new ActionException(e);
}
}