use of com.celements.blog.article.ArticleLoadException in project celements-blog by celements.
the class BlogPlugin method getBlogArticles.
/**
* @deprecated since 1.32 instead use
* {@link BlogService#getArticles(DocumentReference, ArticleLoadParameter)}
* @param blogArticleSpace
* Space where the blog's articles are saved.
* @param subscribedBlogsStr
* Comma separated String with all the blog article spaces the blog has subscribed to.
* @param language
* default language
* @param archiveOnly
* Only get articles from the archive (archivedate < now)
* @param futurOnly
* Only get articles that are not yet published (publishdate > now)
* @param subscribableOnly
* Only get articles from subscribed blogs, but not the ones from the blog the user is
* on.
* @param withArchive
* Include archived articles in the answer. Has no effect if archiveOnly = true.
* @param withFutur
* Include not yet published articles. Only possible if the page has been saved with
* programmingrights or the user has edit right on the article. Has no effect if
* futurOnly = true.
* @param withSubscribable
* Include articles from subscribed blogs.
* @param withSubscribed
* Include articles the blog has subscribed to.
* @param withUnsubscribed
* Include articles the blog has unsubscribed from. Only works with edit rights or
* programmingrights.
* @param withUndecided
* Include articles the blog has not yet desided about a subscription. Only works with
* edit rights or programmingrights.
* @param checkAccessRights
* Do pay attention to the rights. Default = true if no programmingrights.
* @param context
* @return
* @throws XWikiException
*/
@Deprecated
public List<Article> getBlogArticles(String blogArticleSpace, String subscribedBlogsStr, String language, boolean archiveOnly, boolean futurOnly, boolean subscribableOnly, boolean withArchive, boolean withFutur, boolean withSubscribable, boolean withSubscribed, boolean withUnsubscribed, boolean withUndecided, boolean checkAccessRights, XWikiContext context) throws ArticleLoadException {
try {
SpaceReference spaceRef = new SpaceReference(blogArticleSpace, new WikiReference(context.getDatabase()));
DocumentReference blogConfDocRef = getBlogService().getBlogConfigDocRef(spaceRef);
ArticleLoadParameter param = new ArticleLoadParameter();
param.setBlogDocRef(blogConfDocRef);
param.setWithBlogArticles(!subscribableOnly);
param.setLanguage(language);
if (withSubscribable) {
param.setSubscriptionModes(getSubsModes(withSubscribed, withUnsubscribed, withUndecided));
}
param.setDateModes(getDateModes(archiveOnly, futurOnly, withArchive, withFutur));
LOGGER.debug("Got " + param + "' for: blogArticleSpace=" + blogArticleSpace + ", subscribedBlogs=" + subscribedBlogsStr + ", language=" + language + ", archiveOnly=" + archiveOnly + ", futurOnly=" + futurOnly + ", withArchive=" + withArchive + ", withFutur=" + withFutur + ", subscribableOnly=" + subscribableOnly + ", withSubscribable=" + withSubscribable + ", withSubscribed=" + withSubscribed + ", withUnsubscribed=" + withUnsubscribed + ", withUndecided=" + withUndecided + ", checkAccessRights=" + checkAccessRights);
return getBlogService().getArticles(blogConfDocRef, param);
} catch (XWikiException xwe) {
throw new ArticleLoadException(xwe);
} catch (QueryException qexc) {
throw new ArticleLoadException(qexc);
}
}
Aggregations