Search in sources :

Example 11 with IControlMsgHandler

use of com.qlangtech.tis.runtime.module.misc.IControlMsgHandler in project tis by qlangtech.

the class BasicModule method createNewApp.

/**
 * 创建 新的应用
 *
 * @param context
 * @param app
 * @param justValidate
 * @param afterAppCreate
 * @param validateParam
 * @return
 * @throws Exception
 */
protected SchemaAction.CreateAppResult createNewApp(Context context, Application app, boolean justValidate, IAfterApplicationCreate afterAppCreate, Object... validateParam) throws Exception {
    IControlMsgHandler handler = new DelegateControl4JavaBeanMsgHandler(this, app);
    // 
    Map<String, Validator.FieldValidators> validateRule = // 
    Validator.fieldsValidator(SchemaAction.FIELD_PROJECT_NAME, new Validator.FieldValidators(Validator.require) {
    }, // 
    new AppNameDuplicateValidator(this.getApplicationDAO()), // 
    SchemaAction.FIELD_Recept, new Validator.FieldValidators(Validator.require) {
    }, // 
    SchemaAction.FIELD_DptId, new Validator.FieldValidators(Validator.require) {
    });
    Validator.addValidateRule(validateRule, validateParam);
    SchemaAction.CreateAppResult result = new SchemaAction.CreateAppResult();
    result.setSuccess(true);
    if (!Validator.validate(handler, context, validateRule)) {
        return result.setSuccess(false);
    }
    app.setDptName(AddAppAction.getDepartment(this, app.getDptId()).getFullName());
    app.setCreateTime(new Date());
    app.setIsAutoDeploy(true);
    if (!justValidate) {
        result = AddAppAction.createApplication(app, context, this, afterAppCreate);
        addActionMessage(context, "已经成功创建实例[" + app.getProjectName() + "]");
    }
    return result;
}
Also used : DelegateControl4JavaBeanMsgHandler(com.qlangtech.tis.runtime.module.misc.impl.DelegateControl4JavaBeanMsgHandler) IControlMsgHandler(com.qlangtech.tis.runtime.module.misc.IControlMsgHandler) Validator(com.qlangtech.tis.plugin.annotation.Validator)

Example 12 with IControlMsgHandler

use of com.qlangtech.tis.runtime.module.misc.IControlMsgHandler in project tis by qlangtech.

the class TestGenerateDAOAndIncrScript method testCompileAndPackageStreamCode.

public void testCompileAndPackageStreamCode() throws Exception {
    IControlMsgHandler msgHandler = new DefaultMessageHandler();
    IndexStreamCodeGenerator indexStreamCodeGenerator = getIndexStreamCodeGenerator();
    GenerateDAOAndIncrScript generateDAOAndIncrScript = new GenerateDAOAndIncrScript(msgHandler, indexStreamCodeGenerator);
    DefaultContext context = new DefaultContext();
    IndexIncrStatus incrStatus = new IndexIncrStatus();
    Map<Integer, Long> /**
     * timestamp ver
     */
    dependencyDbs = Maps.newHashMap();
    // order
    dependencyDbs.put(58, 20200227124059l);
    // member
    dependencyDbs.put(61, 20200227124200l);
    // cardcenter
    dependencyDbs.put(62, 20200227124220l);
    // shop
    dependencyDbs.put(63, 20200227124231l);
    generateDAOAndIncrScript.generate(context, incrStatus, true, dependencyDbs);
}
Also used : IndexIncrStatus(com.qlangtech.tis.coredefine.module.action.IndexIncrStatus) IControlMsgHandler(com.qlangtech.tis.runtime.module.misc.IControlMsgHandler) DefaultContext(com.alibaba.citrus.turbine.impl.DefaultContext)

Aggregations

IControlMsgHandler (com.qlangtech.tis.runtime.module.misc.IControlMsgHandler)12 Context (com.alibaba.citrus.turbine.Context)8 Validator (com.qlangtech.tis.plugin.annotation.Validator)5 DefaultContext (com.alibaba.citrus.turbine.impl.DefaultContext)4 JSONArray (com.alibaba.fastjson.JSONArray)3 IFieldErrorHandler (com.qlangtech.tis.runtime.module.misc.IFieldErrorHandler)3 DelegateControl4JsonPostMsgHandler (com.qlangtech.tis.runtime.module.misc.impl.DelegateControl4JsonPostMsgHandler)3 JSONObject (com.alibaba.fastjson.JSONObject)2 IndexIncrStatus (com.qlangtech.tis.coredefine.module.action.IndexIncrStatus)2 Descriptor (com.qlangtech.tis.extension.Descriptor)2 Func (com.qlangtech.tis.manage.spring.aop.Func)2 Collections (java.util.Collections)2 List (java.util.List)2 Matcher (java.util.regex.Matcher)2 OSS (com.aliyun.oss.OSS)1 OSSClientBuilder (com.aliyun.oss.OSSClientBuilder)1 Bucket (com.aliyun.oss.model.Bucket)1 Lists (com.google.common.collect.Lists)1 KoubeiIbatorRunner (com.koubei.abator.KoubeiIbatorRunner)1 KoubeiProgressCallback (com.koubei.abator.KoubeiProgressCallback)1