CMS Controller
Implement a new CMSController
with base APIv1_BASE + /cms
in server.api.v1 that exposes select methods (from ContentService
):
List<ActivityPost> lastNews();
Page<ActivityPost> allNews(int page);
Article getArticle(Class<?> clazz, Long id, String slug, Locale locale, boolean useDefault);
Article getArticleBySlugAndLang(String slug, String lang);
Article getGlobalArticle(String slug, Locale locale, boolean useDefault);
Page<Article> listArticles(Pageable pageable);
Page<Article> listArticlesByLang(String lang, Pageable pageable);
ActivityPost createActivityPost(String title, String body);
Article updateArticle(Class<?> clazz, Long id, String slug, String title, String body, String summary, Locale locale) throws CRMException;
Article updateArticle(long id, String slug, String title, String body, String summary);
Article createGlobalArticle(String slug, Locale locale, String title, String body, String summary, boolean isTemplate) throws CRMException;
Article updateGlobalArticle(String slug, Locale locale, String title, String body, String summary) throws CRMException;
ActivityPost getActivityPost(long id);
ActivityPost updateActivityPost(long id, String title, String body);
void deleteActivityPost(long id);
Locale getDefaultLocale();
String processTemplate(String body, Map<String, Object> root);
// Menus
Menu getMenu(String key);
Menu updateMenu(String key, List<MenuItem> menuItems);
MenuItem ensureMenuItem(String menuKey, String url, String text);
- Please use sensible
@RequestMapping(value=
names.
Extras
Add ArticleFilter
and use the filter for listArticles(ArticleFilter filter, Pageable page)
.