use of com.qlangtech.tis.manage.spring.aop.Func in project tis by qlangtech.
the class AddAppAction method doUpdate.
/**
* 更新应用
*/
@Func(PermissionConstant.APP_UPDATE)
public // Navigator nav,
void doUpdate(Context context) {
Application form = new Application();
context.put("app", form);
Integer bizid = this.getInt("bizid");
final Integer appid = this.getInt("appid");
Assert.assertNotNull(bizid);
Assert.assertNotNull(appid);
form.setAppId(appid);
DepartmentCriteria criteria = new DepartmentCriteria();
criteria.createCriteria().andDptIdEqualTo(bizid).andLeafEqualTo(BooleanYorNConvertCallback.YES);
List<Department> depatment = this.getDepartmentDAO().selectByExample(criteria);
Assert.assertTrue("dptid:" + bizid + " depatment can not be null ", depatment.size() == 1);
for (Department d : depatment) {
form.setDptId(d.getDptId());
form.setDptName(d.getFullName());
}
form.setProjectName(this.getString(SchemaAction.FIELD_PROJECT_NAME));
form.setRecept(this.getString("recept"));
if (!isAppNameValid(this, context, SchemaAction.FIELD_PROJECT_NAME, form)) {
return;
}
// 是否使用自动部署新方案
form.setIsAutoDeploy("true".equalsIgnoreCase(this.getString("isautodeploy")));
if (!validateAppForm(context, form)) {
return;
}
IAppsFetcher fetcher = getAppsFetcher();
fetcher.update(form, new CriteriaSetter() {
@Override
public void set(Criteria criteria) {
criteria.andAppIdEqualTo(appid);
}
});
this.addActionMessage(context, "已经成功更新应用[" + form.getProjectName() + "]");
}
use of com.qlangtech.tis.manage.spring.aop.Func in project tis by qlangtech.
the class AddAppAction method doGetCreateAppMasterData.
/**
* 创建业务流程中所需要的系统表信息,在這個方法中全部取得
*
* @param context
* @throws Exception
*/
@Func(PermissionConstant.APP_ADD)
public void doGetCreateAppMasterData(Context context) throws Exception {
Map<String, Object> masterData = Maps.newHashMap();
boolean justbizLine = this.getBoolean("justbizLine");
masterData.put("bizlinelist", this.getBizLineList());
if (!justbizLine) {
final List<Option> verList = new ArrayList<>();
for (LuceneVersion v : LuceneVersion.values()) {
verList.add(new Option(v.getKey(), v.getKey()));
}
masterData.put("tplenum", verList);
masterData.put("usableWorkflow", this.offlineManager.getUsableWorkflow());
}
this.setBizResult(context, masterData);
}
use of com.qlangtech.tis.manage.spring.aop.Func in project tis by qlangtech.
the class AddAppAction method doCreateCollection.
/**
* 创建索引,不在数据库中添加记录<br>
* 当一个索引创建之后又被删除了,又需要重新创建就需要需执行该流程了
*
* @param context
* @throws Exception
*/
@Func(PermissionConstant.APP_ADD)
public void doCreateCollection(Context context) throws Exception {
CreateIndexConfirmModel confiemModel = parseJsonPost(CreateIndexConfirmModel.class);
confiemModel.setTplAppId(getTemplateApp(this).getAppId());
SchemaResult schemaResult = this.parseSchema(context, ISchemaPluginContext.NULL, confiemModel);
this.createCollection(context, confiemModel, schemaResult, (ctx, app, publishSnapshotId, schemaContent) -> {
CreateSnapshotResult result = new CreateSnapshotResult();
result.setSuccess(true);
Application a = getApplicationDAO().selectByName(app.getProjectName());
if (a == null) {
throw new IllegalStateException("appname:" + app.getProjectName() + " relevant app can not be find in DB");
}
result.setNewSnapshotId(getPublishSnapshotId(this.getServerGroupDAO(), a));
return result;
});
}
use of com.qlangtech.tis.manage.spring.aop.Func in project tis by qlangtech.
the class SchemaAction method doToggleEsStupidModel.
/**
* ES:高级视图模式下保存到缓存(点击小白模式)
*/
@Func(value = PermissionConstant.APP_SCHEMA_UPDATE, sideEffect = false)
public void doToggleEsStupidModel(Context context) throws Exception {
// 整段xml文本
com.alibaba.fastjson.JSONObject body = this.parseJsonPost();
ISearchEngineTypeTransfer typeTransfer = ISearchEngineTypeTransfer.load(this, body.getString(DataxUtils.DATAX_NAME));
// final String content = body.getString("content");
// byte[] schemaContent = body.getString("content").getBytes(TisUTF8.get());
// JSONArray fields = JSON.parseArray(content);
writerStructFields(context, body, typeTransfer);
}
use of com.qlangtech.tis.manage.spring.aop.Func in project tis by qlangtech.
the class SchemaAction method doSaveByExpertModel.
/**
* 在傻瓜模式下保存
*
* @param context
* @throws Exception
*/
@Func(value = PermissionConstant.APP_SCHEMA_UPDATE, sideEffect = true)
public void doSaveByExpertModel(Context context) throws Exception {
VisualizingSchemaForm form = this.parseJsonPost(VisualizingSchemaForm.class);
if (!validateStupidContent(context, form.getVisualizingForm())) {
return;
}
Savefilecontent meta = form.getMeta();
String schema = this.createSchema(SchemaAction.createSchemaPlugin(this.getCollectionName()), form.getVisualizingForm(), context);
//
SchemaAction.CreateSnapshotResult createResult = createNewSnapshot(context, createSchemaPlugin(this.getCollectionName()), this.getSnapshotViewDAO().getView(meta.getSnapshotid()), ConfigFileReader.FILE_SCHEMA, schema.getBytes(TisUTF8.get()), this, this, meta.getMemo(), Long.parseLong(this.getUser().getId()), this.getLoginUserName());
if (!createResult.isSuccess()) {
return;
}
this.setBizResult(context, createResult);
this.addActionMessage(context, "保存文件成功,最新snapshot:" + createResult.getNewId());
}
Aggregations