Search in sources :

Example 1 with PageMgmtService

use of org.b3log.solo.service.PageMgmtService in project solo by b3log.

the class CommentProcessorTestCase method addPage.

private String addPage() throws ServiceException {
    final PageMgmtService pageMgmtService = getPageMgmtService();
    final JSONObject requestJSONObject = new JSONObject();
    final JSONObject page = new JSONObject();
    requestJSONObject.put(Page.PAGE, page);
    page.put(Page.PAGE_CONTENT, "page1 content");
    page.put(Page.PAGE_PERMALINK, "page1 permalink");
    page.put(Page.PAGE_TITLE, "page1 title");
    page.put(Page.PAGE_COMMENTABLE, true);
    page.put(Page.PAGE_TYPE, "page");
    page.put(Page.PAGE_OPEN_TARGET, "_self");
    return pageMgmtService.addPage(requestJSONObject);
}
Also used : PageMgmtService(org.b3log.solo.service.PageMgmtService) JSONObject(org.json.JSONObject)

Example 2 with PageMgmtService

use of org.b3log.solo.service.PageMgmtService in project solo by b3log.

the class PageProcessorTestCase method addPage.

private JSONObject addPage() throws Exception {
    final PageMgmtService pageMgmtService = getPageMgmtService();
    final JSONObject requestJSONObject = new JSONObject();
    final JSONObject page = new JSONObject();
    requestJSONObject.put(Page.PAGE, page);
    page.put(Page.PAGE_CONTENT, "page1 content");
    page.put(Page.PAGE_PERMALINK, "pagepermalink");
    page.put(Page.PAGE_TITLE, "page1 title");
    page.put(Page.PAGE_COMMENTABLE, true);
    page.put(Page.PAGE_TYPE, "page");
    page.put(Page.PAGE_OPEN_TARGET, "_self");
    final String pageId = pageMgmtService.addPage(requestJSONObject);
    final PageRepository pageRepository = getPageRepository();
    return pageRepository.get(pageId);
}
Also used : PageMgmtService(org.b3log.solo.service.PageMgmtService) JSONObject(org.json.JSONObject) PageRepository(org.b3log.solo.repository.PageRepository)

Aggregations

PageMgmtService (org.b3log.solo.service.PageMgmtService)2 JSONObject (org.json.JSONObject)2 PageRepository (org.b3log.solo.repository.PageRepository)1