Search in sources :

Example 1 with Pager

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);
}
Also used : AppDomainInfo(com.qlangtech.tis.manage.common.AppDomainInfo) Pager(com.koubei.web.tag.pager.Pager) Nullable(com.qlangtech.tis.pubhook.common.Nullable)

Example 2 with Pager

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())));
}
Also used : Pager(com.koubei.web.tag.pager.Pager) OperationLogCriteria(com.qlangtech.tis.manage.biz.dal.pojo.OperationLogCriteria)

Example 3 with Pager

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));
}
Also used : ApplicationCriteria(com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria) Pager(com.koubei.web.tag.pager.Pager) Criteria(com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria.Criteria) ApplicationCriteria(com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria) Application(com.qlangtech.tis.manage.biz.dal.pojo.Application)

Example 4 with Pager

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()));
}
Also used : IWorkFlowBuildHistoryDAO(com.qlangtech.tis.workflow.dao.IWorkFlowBuildHistoryDAO) Pager(com.koubei.web.tag.pager.Pager)

Example 5 with Pager

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));
}
Also used : 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