Package com.jeecms.common.page

Examples of com.jeecms.common.page.Pagination


  @SuppressWarnings("unchecked")
  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    CmsSite site = FrontUtils.getSite(env);
    Pagination page = cmsTopicMng.getPageForTag(getChannelId(params),
        getRecommend(params), FrontUtils.getPageNo(env), FrontUtils
            .getCount(params));

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here


  @SuppressWarnings("unchecked")
  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    CmsSite site = FrontUtils.getSite(env);
    Pagination page = contentTagMng.getPageForTag(
        FrontUtils.getPageNo(env), FrontUtils.getCount(params));

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here

  @SuppressWarnings("unchecked")
  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    CmsSite site = FrontUtils.getSite(env);
    Pagination page = cmsCommentMng.getPageForTag(null,
        getContentId(params), getGreaterThen(params),
        getChecked(params), getRecommend(params), getDesc(params),
        FrontUtils.getPageNo(env), FrontUtils.getCount(params));

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here

    CmsSite site = FrontUtils.getSite(env);
    Integer parentId = DirectiveUtils.getInt(PARAM_PARENT_ID, params);
    Integer siteId = DirectiveUtils.getInt(PARAM_SITE_ID, params);
    boolean hasContentOnly = getHasContentOnly(params);

    Pagination page;
    if (parentId != null) {
      page = channelMng.getChildPageForTag(parentId, hasContentOnly,
          FrontUtils.getPageNo(env), FrontUtils.getCount(params));
    } else {
      if (siteId == null) {
View Full Code Here

   * @return
   */
  @SuppressWarnings("unchecked")
  protected Pagination find(Finder finder, int pageNo, int pageSize) {
    int totalCount = countQueryResult(finder);
    Pagination p = new Pagination(pageNo, pageSize, totalCount);
    if (totalCount < 1) {
      p.setList(new ArrayList());
      return p;
    }
    Query query = getSession().createQuery(finder.getOrigHql());
    finder.setParamsToQuery(query);
    query.setFirstResult(p.getFirstResult());
    query.setMaxResults(p.getPageSize());
    if (finder.isCacheable()) {
      query.setCacheable(true);
    }
    List list = query.list();
    p.setList(list);
    return p;
  }
View Full Code Here

          "cannot read/write 'orderEntries' from CriteriaImpl", e);
    }

    int totalCount = ((Number) crit.setProjection(Projections.rowCount())
        .uniqueResult()).intValue();
    Pagination p = new Pagination(pageNo, pageSize, totalCount);
    if (totalCount < 1) {
      p.setList(new ArrayList());
      return p;
    }

    // 将之前的Projection,ResultTransformer和OrderBy条件重新设回去
    crit.setProjection(projection);
    if (projection == null) {
      crit.setResultTransformer(CriteriaSpecification.ROOT_ENTITY);
    }
    if (transformer != null) {
      crit.setResultTransformer(transformer);
    }
    try {
      MyBeanUtils.setFieldValue(impl, ORDER_ENTRIES, orderEntries);
    } catch (Exception e) {
      throw new RuntimeException(
          "set 'orderEntries' to CriteriaImpl faild", e);
    }
    crit.setFirstResult(p.getFirstResult());
    crit.setMaxResults(p.getPageSize());
    p.setList(crit.list());
    return p;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    CmsSite site = FrontUtils.getSite(env);
    Pagination page = (Pagination) super.getData(params, env);

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here

  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    CmsSite site = FrontUtils.getSite(env);
    int pageNo = FrontUtils.getPageNo(env);
    int count = FrontUtils.getCount(params);
    Pagination page = cmsGuestbookMng.getPage(getSiteId(params),
        getCtgId(params),null, getRecommend(params), getChecked(params),
        getDesc(params), true, pageNo, count);

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here

    return (Authentication) findUnique(hql, userId);
  }

  public Pagination getPage(int pageNo, int pageSize) {
    Criteria crit = createCriteria();
    Pagination page = findByCriteria(crit, pageNo, pageSize);
    return page;
  }
View Full Code Here

    return ((Number) query.iterate().next()).intValue();
  }

  public Pagination getPage(int pageNo, int pageSize) {
    Criteria crit = createCriteria();
    Pagination page = findByCriteria(crit, pageNo, pageSize);
    return page;
  }
View Full Code Here

TOP

Related Classes of com.jeecms.common.page.Pagination

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.