Search in sources :

Example 41 with PageHandler

use of com.publiccms.common.handler.PageHandler in project PublicCMS-preview by sanluan.

the class HomeBroadcastListDirective method execute.

@Override
public void execute(RenderHandler handler) throws IOException, Exception {
    PageHandler page = service.getPage(getSite(handler).getId(), handler.getLong("userId"), handler.getBoolean("reposted"), handler.getLong("repostId"), handler.getBoolean("disabled"), handler.getString("orderField"), handler.getString("orderType"), handler.getInteger("pageIndex", 1), handler.getInteger("count", 30));
    handler.put("page", page).render();
}
Also used : PageHandler(com.publiccms.common.handler.PageHandler)

Example 42 with PageHandler

use of com.publiccms.common.handler.PageHandler in project PublicCMS-preview by sanluan.

the class CmsFacetSearchDirective method execute.

@Override
public void execute(RenderHandler handler) throws IOException, Exception {
    String word = handler.getString("word");
    Long[] tagIds = handler.getLongArray("tagId");
    if (CommonUtils.notEmpty(word) || CommonUtils.notEmpty(tagIds)) {
        SysSite site = getSite(handler);
        if (CommonUtils.notEmpty(word)) {
            statisticsComponent.search(site.getId(), word);
        }
        if (CommonUtils.notEmpty(tagIds)) {
            for (Long tagId : tagIds) {
                statisticsComponent.searchTag(tagId);
            }
        }
        PageHandler page;
        Integer pageIndex = handler.getInteger("pageIndex", 1);
        Integer count = handler.getInteger("count", 30);
        try {
            page = service.facetQuery(site.getId(), handler.getStringArray("categoryId"), handler.getStringArray("modelId"), word, tagIds, handler.getDate("startPublishDate"), handler.getDate("endPublishDate", CommonUtils.getDate()), pageIndex, count);
        } catch (Exception e) {
            page = new FacetPageHandler(pageIndex, count, 0, null);
        }
        handler.put("page", page).render();
    }
}
Also used : FacetPageHandler(com.publiccms.common.handler.FacetPageHandler) PageHandler(com.publiccms.common.handler.PageHandler) IOException(java.io.IOException) FacetPageHandler(com.publiccms.common.handler.FacetPageHandler) SysSite(com.publiccms.entities.sys.SysSite)

Example 43 with PageHandler

use of com.publiccms.common.handler.PageHandler in project PublicCMS-preview by sanluan.

the class CmsLotteryUserListDirective method execute.

@Override
public void execute(RenderHandler handler) throws IOException, Exception {
    PageHandler page = service.getPage(handler.getLong("lotteryId"), handler.getLong("userId"), handler.getBoolean("winning"), handler.getDate("startCreateDate"), handler.getDate("endCreateDate"), handler.getString("orderType"), handler.getInteger("pageIndex", 1), handler.getInteger("count", 30));
    handler.put("page", page).render();
}
Also used : PageHandler(com.publiccms.common.handler.PageHandler)

Example 44 with PageHandler

use of com.publiccms.common.handler.PageHandler in project PublicCMS-preview by sanluan.

the class CmsModelListDirective method execute.

@Override
public void execute(RenderHandler handler) throws IOException, Exception {
    PageHandler page = new PageHandler(null, null, 0, null);
    page.setList(modelComponent.getList(getSite(handler), handler.getString("parentId"), handler.getBoolean("hasChild"), handler.getBoolean("onlyUrl"), handler.getBoolean("hasImages"), handler.getBoolean("hasFiles")));
    handler.put("page", page).render();
}
Also used : PageHandler(com.publiccms.common.handler.PageHandler)

Example 45 with PageHandler

use of com.publiccms.common.handler.PageHandler in project PublicCMS-preview by sanluan.

the class CmsPlaceListDirective method execute.

@Override
public void execute(RenderHandler handler) throws IOException, Exception {
    Date endPublishDate = handler.getDate("endPublishDate");
    String path = handler.getString("path");
    Boolean disabled = false;
    Integer status = CmsPlaceService.STATUS_NORMAL;
    if (handler.getBoolean("advanced", false)) {
        status = handler.getInteger("status");
        disabled = handler.getBoolean("disabled", false);
    } else {
        Date now = CommonUtils.getMinuteDate();
        if (null == endPublishDate || endPublishDate.after(now)) {
            endPublishDate = now;
        }
    }
    if (CommonUtils.notEmpty(path)) {
        path = path.replace("//", SEPARATOR);
    }
    PageHandler page = service.getPage(getSite(handler).getId(), handler.getLong("userId"), path, handler.getString("itemType"), handler.getLong("itemId"), handler.getDate("startPublishDate"), handler.getDate("endPublishDate"), status, disabled, handler.getString("orderField"), handler.getString("orderType"), handler.getInteger("pageIndex", 1), handler.getInteger("count", 30));
    handler.put("page", page).render();
}
Also used : PageHandler(com.publiccms.common.handler.PageHandler) Date(java.util.Date)

Aggregations

PageHandler (com.publiccms.common.handler.PageHandler)65 FacetPageHandler (com.publiccms.common.handler.FacetPageHandler)3 SysSite (com.publiccms.entities.sys.SysSite)3 IOException (java.io.IOException)3 Date (java.util.Date)3 HashMap (java.util.HashMap)3 CmsContentQuery (com.publiccms.views.pojo.query.CmsContentQuery)2 CmsContentAttribute (com.publiccms.entities.cms.CmsContentAttribute)1 CmsLottery (com.publiccms.entities.cms.CmsLottery)1 LogUpload (com.publiccms.entities.log.LogUpload)1 SysCluster (com.publiccms.entities.sys.SysCluster)1 CmsCategoryQuery (com.publiccms.views.pojo.query.CmsCategoryQuery)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Scheduled (org.springframework.scheduling.annotation.Scheduled)1 ModelMap (org.springframework.ui.ModelMap)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1