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