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())));
}
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;
}
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())));
}
Aggregations