|
|
@@ -1,5 +1,7 @@
|
|
|
package com.x.component.assemble.control.jaxrs.component;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import com.google.gson.JsonElement;
|
|
|
import com.x.base.core.container.EntityManagerContainer;
|
|
|
import com.x.base.core.container.factory.EntityManagerContainerFactory;
|
|
|
@@ -8,6 +10,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
|
|
|
import com.x.base.core.project.bean.WrapCopier;
|
|
|
import com.x.base.core.project.bean.WrapCopierFactory;
|
|
|
import com.x.base.core.project.cache.ApplicationCache;
|
|
|
+import com.x.base.core.project.config.Config;
|
|
|
import com.x.base.core.project.exception.ExceptionAccessDenied;
|
|
|
import com.x.base.core.project.exception.ExceptionEntityNotExist;
|
|
|
import com.x.base.core.project.http.ActionResult;
|
|
|
@@ -32,6 +35,13 @@ class ActionEdit extends ActionBase {
|
|
|
throw new ExceptionEntityNotExist(flag, Component.class);
|
|
|
}
|
|
|
Wi.copier.copy(wi, component);
|
|
|
+ List<String> names = ListTools.extractProperty(Config.components().getSystems(), "name", String.class, true,
|
|
|
+ true);
|
|
|
+ if (ListTools.contains(names, component.getName())) {
|
|
|
+ component.setType(Component.TYPE_SYSTEM);
|
|
|
+ } else {
|
|
|
+ component.setType(Component.TYPE_CUSTOM);
|
|
|
+ }
|
|
|
emc.beginTransaction(Component.class);
|
|
|
emc.persist(component, CheckPersistType.all);
|
|
|
emc.commit();
|