use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.
the class SnapshotRevsionAction method doGetSnapshotList.
/**
* @param context
*/
public void doGetSnapshotList(Context context) {
AppDomainInfo domain = this.getAppDomain();
if (domain instanceof Nullable) {
this.addErrorMessage(context, "has not select app");
// 是否已经选择了域
return;
}
context.put("hasselectdomain", true);
Pager pager = this.createPager();
SnapshotCriteria query = new SnapshotCriteria();
// 一览先不考虑有 版本设置
query.createCriteria().andAppidEqualTo(domain.getAppid());
query.setOrderByClause("snapshot.sn_id desc");
query.setPageSize(PAGE_SIZE);
pager.setTotalCount(this.getSnapshotDAO().countByExample(query));
ServerGroup group = getAppServerGroup();
SnapshotList snapshotList = new SnapshotList();
snapshotList.publishSnapshotid = group.getPublishSnapshotId();
snapshotList.snapshotList = this.getSnapshotDAO().selectByExample(query, pager.getCurPage(), PAGE_SIZE);
this.setBizResult(context, new PaginationResult(pager, snapshotList.snapshotList, snapshotList.publishSnapshotid));
Assert.assertNotNull("group can not be null,app:" + domain.getAppName() + ", runtime:" + domain.getRunEnvironment().getKeyName(), group);
// context.put("selectgroup", group);
}
use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.
the class OperationLogAction method doGetInitData.
/**
* log 显示页面显示日志信息
*
* @param context
*/
public void doGetInitData(Context context) {
OperationLogCriteria query = createOperationLogCriteria();
Pager pager = this.createPager();
query.setOrderByClause("op_id desc");
pager.setTotalCount(this.operationLogDAO.countByExample(query));
this.setBizResult(context, new PaginationResult(pager, this.operationLogDAO.selectByExampleWithoutBLOBs(query, pager.getCurPage(), pager.getRowsPerPage())));
}
use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.
the class AppViewAction method doGetApps.
/**
* 取得索引实例列表
*
* @param context
* @throws Exception
*/
public void doGetApps(Context context) throws Exception {
Integer dptid = this.getInt("dptid", null);
String appName = this.getString("name");
Integer dptId = (Integer) context.get("dptId");
String recept = (String) context.get("recept");
// 应用集合
ApplicationCriteria query = new ApplicationCriteria();
Criteria criteria = query.createCriteria();
criteria.andAppIdNotEqualTo(SysInitializeAction.TEMPLATE_APPLICATION_DEFAULT_ID);
if (dptid != null) {
context.put("bizdomain", this.getDepartmentDAO().loadFromWriteDB(dptid));
// criteria.andDptIdEqualTo(dptid);
}
if (appName != null && !appName.equals("search4")) {
criteria.andProjectNameLike("%" + appName + "%");
}
if (dptId != null) {
criteria.andDptIdEqualTo(dptId);
}
if (recept != null && !StringUtils.isEmpty(recept)) {
criteria.andReceptEqualTo(recept);
}
query.setOrderByClause("last_process_time desc,app_id desc");
int allRows = this.getApplicationDAO().countByExample(query);
Pager pager = getPager();
List<Application> apps = Collections.emptyList();
pager.setTotalCount(allRows);
if (allRows < 1) {
// this.addErrorMessage(context, "很抱歉,未能找到结果");
this.setBizResult(context, new PaginationResult(pager, apps));
return;
}
context.put("recept", recept);
context.put("dptId", dptId);
apps = this.getApplicationDAO().selectByExample(query, pager.getCurPage(), pager.getRowsPerPage());
apps.forEach((app) -> {
// WorkFlow df = null;
// if (app.getWorkFlowId() != null && (df = getWorkflowDAOFacade().getWorkFlowDAO().selectByPrimaryKey(app.getWorkFlowId())) != null) {
// app.setDataflowName(df.getName());
// }
});
this.setBizResult(context, new PaginationResult(pager, apps));
}
use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.
the class CoreAction method doGetFullBuildHistory.
/**
* 构建全量索引歷史記錄
*
* @param context
* @throws Exception
*/
public void doGetFullBuildHistory(Context context) throws Exception {
Integer wfid = this.getInt("wfid", -1);
boolean getwf = this.getBoolean("getwf");
WorkFlow workFlow = new WorkFlow();
WorkFlowBuildHistoryCriteria query = new WorkFlowBuildHistoryCriteria();
WorkFlowBuildHistoryCriteria.Criteria criteria = query.createCriteria();
if (isCollectionAware()) {
criteria.andAppIdEqualTo(this.getAppDomain().getAppid());
} else {
if (wfid < 0) {
throw new IllegalArgumentException("param wfid can not small than 0");
}
criteria.andWorkFlowIdEqualTo(wfid);
workFlow = new WorkFlow();
if (getwf) {
workFlow = this.getWorkflowDAOFacade().getWorkFlowDAO().selectByPrimaryKey(wfid);
if (workFlow == null) {
throw new IllegalStateException("can not find workflow in db ,wfid:" + wfid);
}
}
}
query.setOrderByClause("id desc");
IWorkFlowBuildHistoryDAO historyDAO = this.getWorkflowDAOFacade().getWorkFlowBuildHistoryDAO();
Pager pager = this.createPager();
pager.setTotalCount(historyDAO.countByExample(query));
this.setBizResult(context, new PaginationResult(pager, adapterBuildHistory(historyDAO.selectByExample(query, pager.getCurPage(), pager.getRowsPerPage())), workFlow.getName()));
}
use of com.koubei.web.tag.pager.Pager in project tis by qlangtech.
the class PluginAction method doGetAvailablePlugins.
/**
* 取得当前可以被安装的插件
*
* @param context
*/
public void doGetAvailablePlugins(Context context) {
List<String> extendpoint = getExtendpointParam();
Pager pager = this.createPager();
pager.setTotalCount(Integer.MAX_VALUE);
List<UpdateSite.Plugin> availables = TIS.get().getUpdateCenter().getAvailables();
if (CollectionUtils.isNotEmpty(extendpoint)) {
availables = availables.stream().filter((plugin) -> {
return CollectionUtils.containsAny(plugin.extendPoints.keySet(), extendpoint);
// return plugin.extendPoints.containsKey(extendpoint.get());
}).collect(Collectors.toList());
}
if (CollectionUtils.isNotEmpty(this.getQueryPluginParam())) {
availables = availables.stream().filter((plugin) -> {
return !filterPlugin(plugin.title, plugin.excerpt);
}).collect(Collectors.toList());
}
this.setBizResult(context, new PaginationResult(pager, availables));
}
Aggregations