Search in sources :

Example 6 with Pager

use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.

the class OfflineDatasourceAction method doGetWorkflows.

// /**
// * Do get commit version diff. 获取两个版本的变更记录
// *
// * @param context the context
// * @throws Exception the exception
// */
// public void doGetCommitVersionDiff(Context context) throws Exception {
// String fromVersion = this.getString("fromVersion");
// String toVersion = this.getString("toVersion");
// if (StringUtils.isBlank(fromVersion) || fromVersion.length() != 40) {
// this.addErrorMessage(context, "fromVersion版本号错误");
// return;
// }
// if (StringUtils.isBlank(toVersion) || toVersion.length() != 40) {
// this.addErrorMessage(context, "toVersion版本号错误");
// return;
// }
// String directory = this.getString("directory");
// int projectId;
// if (StringUtils.equals("datasource_daily", directory)) {
// projectId = GitUtils.DATASOURCE_PROJECT_ID;
// } else if (StringUtils.equals("datasource_online", directory)) {
// projectId = GitUtils.DATASOURCE_PROJECT_ID;
// } else if (StringUtils.equals("workflow", directory)) {
// projectId = GitUtils.WORKFLOW_GIT_PROJECT_ID;
// } else {
// throw new RuntimeException("directory = " + directory + " is wrong!");
// }
// GitCommitVersionDiff diff = GitUtils.$().getGitCommitVersionDiff(fromVersion, toVersion, projectId);
// this.setBizResult(context, diff);
// }
/**
 * Do get workflows. 获取去数据库查找所有工作流
 *
 * @param context the context
 * @throws Exception the exception
 */
public void doGetWorkflows(Context context) throws Exception {
    Pager pager = createPager();
    IWorkFlowDAO wfDAO = this.getWorkflowDAOFacade().getWorkFlowDAO();
    WorkFlowCriteria query = new WorkFlowCriteria();
    query.createCriteria();
    query.setOrderByClause("id desc");
    pager.setTotalCount(wfDAO.countByExample(query));
    this.setBizResult(context, new PaginationResult(pager, wfDAO.selectByExample(query, pager.getCurPage(), pager.getRowsPerPage())));
}
Also used : Pager(com.koubei.web.tag.pager.Pager) IWorkFlowDAO(com.qlangtech.tis.workflow.dao.IWorkFlowDAO) WorkFlowCriteria(com.qlangtech.tis.workflow.pojo.WorkFlowCriteria)

Example 7 with Pager

use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.

the class BasicModule method createPager.

protected Pager createPager() {
    Pager pager = Pager.register("page", new LinkBuilder() {

        @Override
        public StringBuffer getPagerUrl() {
            return BasicModule.this.getPagerUrl();
        }

        @Override
        public final StringBuffer getPageUrl(int page) {
            StringBuffer url = new StringBuffer(this.getPagerUrl());
            if (url.toString().indexOf("?") >= 0) {
                url.append("&");
            } else {
                url.append("?");
            }
            url.append("page=").append(page);
            return url;
        }
    }, this.getRequest());
    pager.setSchema("k1");
    pager.setRowsPerPage(PAGE_SIZE);
    pager.setCurPage(this.getPage());
    return pager;
}
Also used : Pager(com.koubei.web.tag.pager.Pager) LinkBuilder(com.koubei.web.tag.pager.LinkBuilder)

Example 8 with Pager

use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.

the class UserAction method doGetInitData.

/**
 * 取得初始化頁面數據
 *
 * @param context
 */
public void doGetInitData(Context context) {
    UsrDptRelationCriteria criteria = new UsrDptRelationCriteria();
    criteria.setOrderByClause("create_time desc");
    Pager pager = createPager();
    pager.setTotalCount(this.getUsrDptRelationDAO().countByExample(criteria));
    this.setBizResult(context, new PaginationResult(pager, this.getUsrDptRelationDAO().selectByExample(criteria, pager.getCurPage(), pager.getRowsPerPage())));
}
Also used : UsrDptRelationCriteria(com.qlangtech.tis.manage.biz.dal.pojo.UsrDptRelationCriteria) Pager(com.koubei.web.tag.pager.Pager)

Aggregations

Pager (com.koubei.web.tag.pager.Pager)8 LinkBuilder (com.koubei.web.tag.pager.LinkBuilder)1 Application (com.qlangtech.tis.manage.biz.dal.pojo.Application)1 ApplicationCriteria (com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria)1 Criteria (com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria.Criteria)1 OperationLogCriteria (com.qlangtech.tis.manage.biz.dal.pojo.OperationLogCriteria)1 UsrDptRelationCriteria (com.qlangtech.tis.manage.biz.dal.pojo.UsrDptRelationCriteria)1 AppDomainInfo (com.qlangtech.tis.manage.common.AppDomainInfo)1 Nullable (com.qlangtech.tis.pubhook.common.Nullable)1 IWorkFlowBuildHistoryDAO (com.qlangtech.tis.workflow.dao.IWorkFlowBuildHistoryDAO)1 IWorkFlowDAO (com.qlangtech.tis.workflow.dao.IWorkFlowDAO)1 WorkFlowCriteria (com.qlangtech.tis.workflow.pojo.WorkFlowCriteria)1