Просмотр исходного кода

流程平台的表单和脚本、内容管理的表单和脚本、门户的页面和脚本等设计搜索

o2sword 5 лет назад
Родитель
Сommit
4a1cabcf24
26 измененных файлов с 786 добавлено и 198 удалено
  1. 4 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/enums/DesignerType.java
  2. 17 6
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WiDesigner.java
  3. 30 3
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java
  4. 4 18
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/FieldTools.java
  5. 21 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java
  6. 26 13
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/FormFactory.java
  7. 5 4
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/ActionApplication.java
  8. 5 4
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/CmsJaxrsCipherFilter.java
  9. 167 0
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java
  10. 7 0
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/BaseAction.java
  11. 48 0
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/DesignerAction.java
  12. 11 0
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ExceptionFieldEmpty.java
  13. 15 1
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/factory/PageFactory.java
  14. 15 1
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/factory/WidgetFactory.java
  15. 3 1
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/ActionApplication.java
  16. 10 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/DesignerJaxrsFilter.java
  17. 213 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java
  18. 7 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/BaseAction.java
  19. 48 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/DesignerAction.java
  20. 11 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ExceptionFieldEmpty.java
  21. 2 2
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/DesignerJaxrsFilter.java
  22. 28 7
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
  23. 1 1
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/DesignerAction.java
  24. 11 0
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ExceptionFieldEmpty.java
  25. 75 133
      o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
  26. 2 1
      o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ModuleType.java

+ 4 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/enums/DesignerType.java

@@ -5,11 +5,13 @@ import com.x.base.core.entity.JpaObject;
 /**
 /**
  * 平台设计搜索业务类型枚举类
  * 平台设计搜索业务类型枚举类
  * script(脚本:流程平台脚本、内容管理脚本、门户脚本、服务管理的代理、服务管理的接口)
  * script(脚本:流程平台脚本、内容管理脚本、门户脚本、服务管理的代理、服务管理的接口)
- * form(流程平台的表单、内容管理的表单、门户的页面)
+ * form(流程平台的表单、内容管理的表单)
+ * page(门户的页面)
+ * widget(门户的widget)
  * process(流程平台的流程模板)
  * process(流程平台的流程模板)
  */
  */
 public enum DesignerType {
 public enum DesignerType {
 
 
-	script, form, process;
+	script, form, page, widget, process;
 	public static final int length = JpaObject.length_64B;
 	public static final int length = JpaObject.length_64B;
 }
 }

+ 17 - 6
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WiDesigner.java

@@ -3,6 +3,7 @@ package com.x.base.core.project.jaxrs;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.gson.GsonPropertyObject;
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -17,8 +18,10 @@ public class WiDesigner extends GsonPropertyObject {
     private Boolean matchWholeWord;
     private Boolean matchWholeWord;
     @FieldDescribe("是否正则表达式匹配.")
     @FieldDescribe("是否正则表达式匹配.")
     private Boolean matchRegExp;
     private Boolean matchRegExp;
-    @FieldDescribe("模块的应用ID信息.")
-    private Map<String, List<String>> moduleApps = new HashMap<>();
+    @FieldDescribe("设计类型:script|form|page|widget|process")
+    private List<String> designerTypes = new ArrayList<>();
+    @FieldDescribe("应用ID列表.")
+    private List<String> appIdList = new ArrayList<>();
 
 
     public String getKeyword() {
     public String getKeyword() {
         return keyword;
         return keyword;
@@ -52,11 +55,19 @@ public class WiDesigner extends GsonPropertyObject {
         this.matchRegExp = matchRegExp;
         this.matchRegExp = matchRegExp;
     }
     }
 
 
-    public Map<String, List<String>> getModuleApps() {
-        return moduleApps;
+    public List<String> getDesignerTypes() {
+        return designerTypes == null ? new ArrayList<>() : designerTypes;
     }
     }
 
 
-    public void setModuleApps(Map<String, List<String>> moduleApps) {
-        this.moduleApps = moduleApps;
+    public void setDesignerTypes(List<String> designerTypes) {
+        this.designerTypes = designerTypes;
+    }
+
+    public List<String> getAppIdList() {
+        return appIdList == null ? new ArrayList<>() : appIdList;
+    }
+
+    public void setAppIdList(List<String> appIdList) {
+        this.appIdList = appIdList;
     }
     }
 }
 }

+ 30 - 3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java

@@ -1,9 +1,11 @@
 package com.x.base.core.project.jaxrs;
 package com.x.base.core.project.jaxrs;
 
 
+import com.x.base.core.entity.enums.DesignerType;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.gson.GsonPropertyObject;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -24,6 +26,8 @@ public class WrapDesigner extends GsonPropertyObject {
 	@FieldDescribe("设计类型.")
 	@FieldDescribe("设计类型.")
 	private String designerType;
 	private String designerType;
 
 
+	private Date updateTime;
+
 	@FieldDescribe("匹配信息.")
 	@FieldDescribe("匹配信息.")
 	private List<DesignerPattern> patternList = new ArrayList<>();
 	private List<DesignerPattern> patternList = new ArrayList<>();
 
 
@@ -67,6 +71,14 @@ public class WrapDesigner extends GsonPropertyObject {
 		this.designerType = designerType;
 		this.designerType = designerType;
 	}
 	}
 
 
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
 	public List<DesignerPattern> getPatternList() {
 	public List<DesignerPattern> getPatternList() {
 		return patternList;
 		return patternList;
 	}
 	}
@@ -86,7 +98,6 @@ public class WrapDesigner extends GsonPropertyObject {
 			}
 			}
 			this.patternList = patternList;
 			this.patternList = patternList;
 		}
 		}
-		this.patternList = patternList;
 	}
 	}
 
 
 	public DesignerPattern getPatternInstant(){
 	public DesignerPattern getPatternInstant(){
@@ -96,11 +107,27 @@ public class WrapDesigner extends GsonPropertyObject {
 
 
 	public void clearPatternValue(){
 	public void clearPatternValue(){
 		for (DesignerPattern pattern : this.patternList){
 		for (DesignerPattern pattern : this.patternList){
-			pattern.propertyValue = null;
+			pattern.setPropertyValue(null);
+		}
+	}
+
+	public DesignerPattern getScriptDesigner(){
+		DesignerPattern designerPattern = null;
+		if(DesignerType.script.toString().equals(this.getDesignerType())){
+			for (DesignerPattern pattern : this.patternList){
+				if ("text".equals(pattern.getProperty())){
+					designerPattern = pattern;
+				}else{
+					pattern.setPropertyValue(null);
+				}
+			}
+		}else{
+			this.clearPatternValue();
 		}
 		}
+		return designerPattern;
 	}
 	}
 
 
-	class DesignerPattern extends GsonPropertyObject {
+	public class DesignerPattern extends GsonPropertyObject {
 
 
 		@FieldDescribe("元素类型(activity | process).")
 		@FieldDescribe("元素类型(activity | process).")
 		private String elementType;
 		private String elementType;

+ 4 - 18
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/FieldTools.java

@@ -2,10 +2,11 @@ package com.x.base.core.project.tools;
 
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Field;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 
-import com.x.base.core.project.jaxrs.WiDesigner;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 
 
 public class FieldTools {
 public class FieldTools {
@@ -17,19 +18,4 @@ public class FieldTools {
 		}
 		}
 		return new ArrayList<Field>(set);
 		return new ArrayList<Field>(set);
 	}
 	}
-
-	public static <T> Map<String, String> fieldMatchKeyword(final Class<T> origClass, T t, String keyword, Boolean caseSensitive, Boolean matchWholeWord, Boolean matchRegExp) throws Exception{
-		Map<String, String> map = new HashMap<>();
-		if(origClass!=null && StringUtils.isNotBlank(keyword)) {
-			for (Field field : FieldUtils.getAllFields(origClass)) {
-				if (field.getType() == String.class) {
-					String content = (String) field.get(t);
-					if (StringTools.matchKeyword(keyword, content, caseSensitive, matchWholeWord, matchRegExp)) {
-						map.put(field.getName(), content);
-					}
-				}
-			}
-		}
-		return map;
-	}
 }
 }

+ 21 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java

@@ -1,8 +1,12 @@
 package com.x.base.core.project.tools;
 package com.x.base.core.project.tools;
 
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 
 
 public class PropertyTools {
 public class PropertyTools {
@@ -32,4 +36,20 @@ public class PropertyTools {
 		return defaultObject;
 		return defaultObject;
 	}
 	}
 
 
-}
+	public static <T> Map<String, String> fieldMatchKeyword(final List<String> properties, T t, String keyword, Boolean caseSensitive, Boolean matchWholeWord, Boolean matchRegExp) throws Exception {
+		Map<String, String> map = new HashMap<>();
+		if(ListTools.isNotEmpty(properties) && StringUtils.isNotBlank(keyword)) {
+			for (String name : properties) {
+				Object o = PropertyUtils.getProperty(t, name);
+				if (o!=null) {
+					String content = String.valueOf(o);
+					if (StringTools.matchKeyword(keyword, content, caseSensitive, matchWholeWord, matchRegExp)) {
+						map.put(name, content);
+					}
+				}
+			}
+		}
+		return map;
+	}
+
+}

+ 26 - 13
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/FormFactory.java

@@ -19,7 +19,7 @@ import java.util.List;
 
 
 /**
 /**
  * 分类表单模板信息管理表基础功能服务类
  * 分类表单模板信息管理表基础功能服务类
- * 
+ *
  * @author O2LEE
  * @author O2LEE
  */
  */
 public class FormFactory extends AbstractFactory {
 public class FormFactory extends AbstractFactory {
@@ -37,7 +37,7 @@ public class FormFactory extends AbstractFactory {
 	public Form get( String id ) throws Exception {
 	public Form get( String id ) throws Exception {
 		return this.entityManagerContainer().find( id, Form.class, ExceptionWhen.none );
 		return this.entityManagerContainer().find( id, Form.class, ExceptionWhen.none );
 	}
 	}
-	
+
 	/**
 	/**
 	 * @return List:String
 	 * @return List:String
 	 * @throws Exception
 	 * @throws Exception
@@ -51,9 +51,9 @@ public class FormFactory extends AbstractFactory {
 		cq.select(root.get(Form_.id));
 		cq.select(root.get(Form_.id));
 		return em.createQuery(cq).getResultList();
 		return em.createQuery(cq).getResultList();
 	}
 	}
-	
+
 	/**
 	/**
-	 * 
+	 *
 	 * @param ids 需要查询的ID列表
 	 * @param ids 需要查询的ID列表
 	 * @return List:Form
 	 * @return List:Form
 	 * @throws Exception
 	 * @throws Exception
@@ -70,15 +70,15 @@ public class FormFactory extends AbstractFactory {
 //		Predicate p = root.get(Form_.id).in(ids);
 //		Predicate p = root.get(Form_.id).in(ids);
 //		return em.createQuery(cq.where(p)).getResultList();
 //		return em.createQuery(cq.where(p)).getResultList();
 //	}
 //	}
-	
+
 	/**
 	/**
 	 * 列示指定应用的所有表单模板信息ID列表
 	 * 列示指定应用的所有表单模板信息ID列表
-	 * @param doucmentId 指定的文档ID
+	 * @param appId 指定的文档ID
 	 * @return
 	 * @return
-	 * @throws Exception 
+	 * @throws Exception
 	 */
 	 */
 	//@MethodDescribe("列示指定分类的所有表单模板信息ID列表")
 	//@MethodDescribe("列示指定分类的所有表单模板信息ID列表")
-	public List<String> listByAppId( String appId ) throws Exception {		
+	public List<String> listByAppId( String appId ) throws Exception {
 		if( StringUtils.isEmpty(appId) ){
 		if( StringUtils.isEmpty(appId) ){
 			throw new Exception("内容管理listByAppId方法不接受appId为空的查询操作!");
 			throw new Exception("内容管理listByAppId方法不接受appId为空的查询操作!");
 		}
 		}
@@ -90,8 +90,21 @@ public class FormFactory extends AbstractFactory {
 		Predicate p = cb.equal(root.get( Form_.appId ), appId);
 		Predicate p = cb.equal(root.get( Form_.appId ), appId);
 		return em.createQuery(cq.where(p)).getResultList();
 		return em.createQuery(cq.where(p)).getResultList();
 	}
 	}
-	
-	public List<Form> listFormByAppId( String appId ) throws Exception {		
+
+	public List<String> listByAppIds(List<String> appIds) throws Exception {
+		EntityManager em = this.entityManagerContainer().get(Form.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<String> cq = cb.createQuery(String.class);
+		Root<Form> root = cq.from(Form.class);
+		Predicate p = cb.conjunction();
+		if(ListTools.isNotEmpty(appIds)) {
+			p = cb.isMember(root.get(Form_.appId), cb.literal(appIds));
+		}
+		cq.select(root.get(Form_.id)).where(p);
+		return em.createQuery(cq).getResultList();
+	}
+
+	public List<Form> listFormByAppId( String appId ) throws Exception {
 		if( StringUtils.isEmpty(appId) ){
 		if( StringUtils.isEmpty(appId) ){
 			throw new Exception("内容管理listByAppId方法不接受appId为空的查询操作!");
 			throw new Exception("内容管理listByAppId方法不接受appId为空的查询操作!");
 		}
 		}
@@ -123,9 +136,9 @@ public class FormFactory extends AbstractFactory {
 		Root<Form> root = cq.from( Form.class );
 		Root<Form> root = cq.from( Form.class );
 		Predicate appPre = cb.equal( root.get( Form_.appId ), appId );
 		Predicate appPre = cb.equal( root.get( Form_.appId ), appId );
 		Predicate p = CriteriaBuilderTools.predicate_or( cb, cb.equal( root.get( Form_.id ), formFlag ), cb.equal( root.get( Form_.name ), formFlag ) );
 		Predicate p = CriteriaBuilderTools.predicate_or( cb, cb.equal( root.get( Form_.id ), formFlag ), cb.equal( root.get( Form_.name ), formFlag ) );
-//		p = CriteriaBuilderTools.predicate_or( cb, cb.equal( root.get( Form_.alias ), formFlag ), p );				
+//		p = CriteriaBuilderTools.predicate_or( cb, cb.equal( root.get( Form_.alias ), formFlag ), p );
 		p = CriteriaBuilderTools.predicate_and( cb, appPre, p );
 		p = CriteriaBuilderTools.predicate_and( cb, appPre, p );
-		List<Form> list = em.createQuery(cq.where(p)).getResultList();		
+		List<Form> list = em.createQuery(cq.where(p)).getResultList();
 		return ListTools.isEmpty( list ) ? null : list.get( 0 );
 		return ListTools.isEmpty( list ) ? null : list.get( 0 );
 	}
 	}
-}
+}

+ 5 - 4
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/ActionApplication.java

@@ -12,6 +12,7 @@ import com.x.cms.assemble.control.jaxrs.categoryinfo.CategoryInfoAnonymousAction
 import com.x.cms.assemble.control.jaxrs.commend.DocumentCommendAction;
 import com.x.cms.assemble.control.jaxrs.commend.DocumentCommendAction;
 import com.x.cms.assemble.control.jaxrs.comment.DocumentCommentInfoAction;
 import com.x.cms.assemble.control.jaxrs.comment.DocumentCommentInfoAction;
 import com.x.cms.assemble.control.jaxrs.data.DataAction;
 import com.x.cms.assemble.control.jaxrs.data.DataAction;
+import com.x.cms.assemble.control.jaxrs.designer.DesignerAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentAnonymousAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentAnonymousAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentCipherAction;
 import com.x.cms.assemble.control.jaxrs.document.DocumentCipherAction;
@@ -46,7 +47,7 @@ import java.util.Set;
 public class ActionApplication extends AbstractActionApplication {
 public class ActionApplication extends AbstractActionApplication {
 
 
 	public Set<Class<?>> getClasses() {
 	public Set<Class<?>> getClasses() {
-		
+
 		this.classes.add(TemplateFormAction.class);
 		this.classes.add(TemplateFormAction.class);
 		this.classes.add(AppInfoAction.class);
 		this.classes.add(AppInfoAction.class);
 		this.classes.add(AppInfoConfigAction.class);
 		this.classes.add(AppInfoConfigAction.class);
@@ -77,7 +78,7 @@ public class ActionApplication extends AbstractActionApplication {
 		this.classes.add(SearchFilterAction.class);
 		this.classes.add(SearchFilterAction.class);
 		this.classes.add(InputAction.class);
 		this.classes.add(InputAction.class);
 		this.classes.add(OutputAction.class);
 		this.classes.add(OutputAction.class);
-		
+
 		this.classes.add(AppInfoAnonymousAction.class);
 		this.classes.add(AppInfoAnonymousAction.class);
 		this.classes.add(AppDictAnonymousAction.class);
 		this.classes.add(AppDictAnonymousAction.class);
 		this.classes.add(CategoryInfoAnonymousAction.class);
 		this.classes.add(CategoryInfoAnonymousAction.class);
@@ -87,8 +88,8 @@ public class ActionApplication extends AbstractActionApplication {
 		this.classes.add(ScriptAnonymousAction.class);
 		this.classes.add(ScriptAnonymousAction.class);
 		this.classes.add(DocumentCommentInfoAction.class);
 		this.classes.add(DocumentCommentInfoAction.class);
 		this.classes.add(DocumentCommendAction.class);
 		this.classes.add(DocumentCommendAction.class);
-
+		this.classes.add(DesignerAction.class);
 		return this.classes;
 		return this.classes;
 	}
 	}
 
 
-}
+}

+ 5 - 4
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/CmsJaxrsCipherFilter.java

@@ -7,13 +7,14 @@ import javax.servlet.annotation.WebFilter;
 ;
 ;
 /**
 /**
  * web服务过滤器,将指定的URL定义为需要用户认证的服务,如果用户未登录,则无法访问该服务
  * web服务过滤器,将指定的URL定义为需要用户认证的服务,如果用户未登录,则无法访问该服务
- * 
+ *
  * @author O2LEE *
  * @author O2LEE *
  */
  */
-@WebFilter(urlPatterns = { 
+@WebFilter(urlPatterns = {
 		"/jaxrs/document/cipher/*",
 		"/jaxrs/document/cipher/*",
-		"/jaxrs/permission/management/*"
+		"/jaxrs/permission/management/*",
+		"/jaxrs/designer/*"
 }, asyncSupported = true )
 }, asyncSupported = true )
 public class CmsJaxrsCipherFilter extends CipherManagerJaxrsFilter {
 public class CmsJaxrsCipherFilter extends CipherManagerJaxrsFilter {
 
 
-}
+}

+ 167 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java

@@ -0,0 +1,167 @@
+package com.x.cms.assemble.control.jaxrs.designer;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.JpaObject;
+import com.x.base.core.entity.enums.DesignerType;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WiDesigner;
+import com.x.base.core.project.jaxrs.WrapDesigner;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ListTools;
+import com.x.base.core.project.tools.PropertyTools;
+import com.x.cms.assemble.control.Business;
+import com.x.cms.core.entity.AppInfo;
+import com.x.cms.core.entity.element.Form;
+import com.x.cms.core.entity.element.Script;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+class ActionSearch extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionSearch.class);
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
+		if(!effectivePerson.isManager()){
+			throw new ExceptionAccessDenied(effectivePerson);
+		}
+		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+		logger.info("{}开始内容管理设计搜索,条件:{}", effectivePerson.getDistinguishedName(), wi);
+		if(StringUtils.isBlank(wi.getKeyword())){
+			throw new ExceptionFieldEmpty("keyword");
+		}
+
+		ActionResult<List<Wo>> result = new ActionResult<>();
+
+		List<Wo> resWos = new ArrayList<>();
+		List<CompletableFuture<List<Wo>>> list = new ArrayList<>();
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.form.toString())){
+			list.add(searchForm(wi, wi.getAppIdList()));
+		}
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.script.toString())){
+			list.add(searchScript(wi, wi.getAppIdList()));
+		}
+		for (CompletableFuture<List<Wo>> cf : list){
+			if(resWos.size()<50) {
+				resWos.addAll(cf.get(60, TimeUnit.SECONDS));
+			}
+		}
+		if (resWos.size()>50){
+			resWos = resWos.subList(0, 50);
+		}
+		result.setData(resWos);
+		result.setCount((long)resWos.size());
+		return result;
+	}
+
+	private CompletableFuture<List<Wo>> searchScript(final Wi wi, final List<String> appIdList) {
+		CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+			List<Wo> resWos = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<WoScript> woScripts;
+				if (ListTools.isEmpty(appIdList)) {
+					woScripts = emc.fetchAll(Script.class, WoScript.copier);
+				} else {
+					woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.appId_FIELDNAME, appIdList);
+				}
+
+				for (WoScript woScript : woScripts) {
+					Map<String, String> map = PropertyTools.fieldMatchKeyword(WoScript.copier.getCopyFields(), woScript, wi.getKeyword(),
+							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+					if (!map.isEmpty()) {
+						Wo wo = new Wo();
+						AppInfo appInfo = emc.find( wo.getAppId(), AppInfo.class );
+						if(appInfo != null){
+							wo.setAppId(appInfo.getId());
+							wo.setAppName(appInfo.getAppName());
+						}
+						wo.setDesignerId(woScript.getId());
+						wo.setDesignerName(woScript.getName());
+						wo.setDesignerType(DesignerType.script.toString());
+						wo.setUpdateTime(woScript.getUpdateTime());
+						wo.setPatternList(map);
+						resWos.add(wo);
+					}
+				}
+				woScripts.clear();
+			}catch (Exception e){
+				logger.error(e);
+			}
+			return resWos;
+		});
+		return cf;
+	}
+
+	private CompletableFuture<List<Wo>> searchForm(final Wi wi, final List<String> appIdList) {
+		CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+			List<Wo> resWos = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				List<String> formIds = business.getFormFactory().listByAppIds(appIdList);
+				for (List<String> partFormIds : ListTools.batch(formIds, 100)) {
+					List<WoForm> woForms = emc.fetchIn(Form.class, WoForm.copier, Form.id_FIELDNAME, partFormIds);
+					for (WoForm woForm : woForms) {
+						Map<String, String> map = PropertyTools.fieldMatchKeyword(WoForm.copier.getCopyFields(), woForm, wi.getKeyword(),
+								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+						if (!map.isEmpty()) {
+							Wo wo = new Wo();
+							AppInfo appInfo = emc.find( wo.getAppId(), AppInfo.class );
+							if(appInfo != null){
+								wo.setAppId(appInfo.getId());
+								wo.setAppName(appInfo.getAppName());
+							}
+							wo.setDesignerId(woForm.getId());
+							wo.setDesignerName(woForm.getName());
+							wo.setDesignerType(DesignerType.form.toString());
+							wo.setUpdateTime(woForm.getUpdateTime());
+							wo.setPatternList(map);
+							resWos.add(wo);
+						}
+					}
+					woForms.clear();
+				}
+
+			}catch (Exception e){
+				logger.error(e);
+			}
+			return resWos;
+		});
+		return cf;
+	}
+
+
+
+	public static class Wi extends WiDesigner {
+
+	}
+
+	public static class Wo extends WrapDesigner{
+
+	}
+
+	public static class WoScript extends Script {
+
+		static WrapCopier<Script, WoScript> copier = WrapCopierFactory.wo(Script.class, WoScript.class,
+				JpaObject.singularAttributeField(Script.class, true, false),null);
+
+	}
+
+	public static class WoForm extends Form {
+
+		static WrapCopier<Form, WoForm> copier = WrapCopierFactory.wo(Form.class, WoForm.class,
+				JpaObject.singularAttributeField(Form.class, true, false),null);
+
+	}
+
+}

+ 7 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/BaseAction.java

@@ -0,0 +1,7 @@
+package com.x.cms.assemble.control.jaxrs.designer;
+
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+}

+ 48 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/DesignerAction.java

@@ -0,0 +1,48 @@
+package com.x.cms.assemble.control.jaxrs.designer;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.project.annotation.JaxrsDescribe;
+import com.x.base.core.project.annotation.JaxrsMethodDescribe;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.http.HttpMediaType;
+import com.x.base.core.project.jaxrs.ResponseFactory;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import java.util.List;
+
+@Path("designer")
+@JaxrsDescribe("设计")
+public class DesignerAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(DesignerAction.class);
+
+	@JaxrsMethodDescribe(value = "根据关键字搜索设计对象.", action = ActionSearch.class)
+	@POST
+	@Path("search")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void search(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+							JsonElement jsonElement) {
+		ActionResult<List<ActionSearch.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionSearch().execute(effectivePerson, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+}

+ 11 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ExceptionFieldEmpty.java

@@ -0,0 +1,11 @@
+package com.x.cms.assemble.control.jaxrs.designer;
+
+import com.x.base.core.project.exception.PromptException;
+
+public class ExceptionFieldEmpty extends PromptException {
+
+	public ExceptionFieldEmpty(String field) {
+		super("参数: {} 值无效.", field);
+	}
+
+}

+ 15 - 1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/factory/PageFactory.java

@@ -10,6 +10,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Root;
 
 
+import com.x.base.core.project.tools.ListTools;
 import com.x.portal.assemble.designer.AbstractFactory;
 import com.x.portal.assemble.designer.AbstractFactory;
 import com.x.portal.assemble.designer.Business;
 import com.x.portal.assemble.designer.Business;
 import com.x.portal.core.entity.Page;
 import com.x.portal.core.entity.Page;
@@ -74,6 +75,19 @@ public class PageFactory extends AbstractFactory {
 		return list;
 		return list;
 	}
 	}
 
 
+	public List<String> listWithPortals(List<String> portalIds) throws Exception {
+		EntityManager em = this.entityManagerContainer().get(Page.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<String> cq = cb.createQuery(String.class);
+		Root<Page> root = cq.from(Page.class);
+		Predicate p = cb.conjunction();
+		if(ListTools.isNotEmpty(portalIds)) {
+			p = cb.isMember(root.get(Page_.portal), cb.literal(portalIds));
+		}
+		cq.select(root.get(Page_.id)).where(p);
+		return em.createQuery(cq).getResultList();
+	}
+
 	public boolean isFirstPage(Page page) {
 	public boolean isFirstPage(Page page) {
 		return FIRSTPAGE_NAMES.contains(page.getName());
 		return FIRSTPAGE_NAMES.contains(page.getName());
 	}
 	}
@@ -88,4 +102,4 @@ public class PageFactory extends AbstractFactory {
 		return null;
 		return null;
 	}
 	}
 
 
-}
+}

+ 15 - 1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/factory/WidgetFactory.java

@@ -8,6 +8,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Root;
 
 
+import com.x.base.core.project.tools.ListTools;
 import com.x.portal.assemble.designer.AbstractFactory;
 import com.x.portal.assemble.designer.AbstractFactory;
 import com.x.portal.assemble.designer.Business;
 import com.x.portal.assemble.designer.Business;
 import com.x.portal.core.entity.Widget;
 import com.x.portal.core.entity.Widget;
@@ -69,4 +70,17 @@ public class WidgetFactory extends AbstractFactory {
 		return list;
 		return list;
 	}
 	}
 
 
-}
+	public List<String> listWithPortals(List<String> portalIds) throws Exception {
+		EntityManager em = this.entityManagerContainer().get(Widget.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<String> cq = cb.createQuery(String.class);
+		Root<Widget> root = cq.from(Widget.class);
+		Predicate p = cb.conjunction();
+		if(ListTools.isNotEmpty(portalIds)) {
+			p = cb.isMember(root.get(Widget_.portal), cb.literal(portalIds));
+		}
+		cq.select(root.get(Widget_.id)).where(p);
+		return em.createQuery(cq).getResultList();
+	}
+
+}

+ 3 - 1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/ActionApplication.java

@@ -5,6 +5,7 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;
 import javax.ws.rs.ApplicationPath;
 
 
 import com.x.base.core.project.jaxrs.AbstractActionApplication;
 import com.x.base.core.project.jaxrs.AbstractActionApplication;
+import com.x.portal.assemble.designer.jaxrs.designer.DesignerAction;
 import com.x.portal.assemble.designer.jaxrs.file.FileAction;
 import com.x.portal.assemble.designer.jaxrs.file.FileAction;
 import com.x.portal.assemble.designer.jaxrs.id.IdAction;
 import com.x.portal.assemble.designer.jaxrs.id.IdAction;
 import com.x.portal.assemble.designer.jaxrs.input.InputAction;
 import com.x.portal.assemble.designer.jaxrs.input.InputAction;
@@ -30,7 +31,8 @@ public class ActionApplication extends AbstractActionApplication {
 		classes.add(IdAction.class);
 		classes.add(IdAction.class);
 		classes.add(OutputAction.class);
 		classes.add(OutputAction.class);
 		classes.add(InputAction.class);
 		classes.add(InputAction.class);
+		classes.add(DesignerAction.class);
 		return classes;
 		return classes;
 	}
 	}
 
 
-}
+}

+ 10 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/DesignerJaxrsFilter.java

@@ -0,0 +1,10 @@
+package com.x.portal.assemble.designer.jaxrs;
+
+import com.x.base.core.project.jaxrs.CipherManagerJaxrsFilter;
+
+import javax.servlet.annotation.WebFilter;
+
+@WebFilter(urlPatterns = "/jaxrs/designer/*", asyncSupported = true)
+public class DesignerJaxrsFilter extends CipherManagerJaxrsFilter {
+
+}

+ 213 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -0,0 +1,213 @@
+package com.x.portal.assemble.designer.jaxrs.designer;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.JpaObject;
+import com.x.base.core.entity.enums.DesignerType;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WiDesigner;
+import com.x.base.core.project.jaxrs.WrapDesigner;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ListTools;
+import com.x.base.core.project.tools.PropertyTools;
+import com.x.portal.assemble.designer.Business;
+import com.x.portal.core.entity.Page;
+import com.x.portal.core.entity.Portal;
+import com.x.portal.core.entity.Script;
+import com.x.portal.core.entity.Widget;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+class ActionSearch extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionSearch.class);
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
+		if(!effectivePerson.isManager()){
+			throw new ExceptionAccessDenied(effectivePerson);
+		}
+		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+		logger.info("{}开始内容管理设计搜索,条件:{}", effectivePerson.getDistinguishedName(), wi);
+		if(StringUtils.isBlank(wi.getKeyword())){
+			throw new ExceptionFieldEmpty("keyword");
+		}
+		ActionResult<List<Wo>> result = new ActionResult<>();
+
+		List<Wo> resWos = new ArrayList<>();
+		List<CompletableFuture<List<Wo>>> list = new ArrayList<>();
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.form.toString())){
+			list.add(searchPage(wi, wi.getAppIdList()));
+		}
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.script.toString())){
+			list.add(searchScript(wi, wi.getAppIdList()));
+		}
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.widget.toString())){
+			list.add(searchWidget(wi, wi.getAppIdList()));
+		}
+		for (CompletableFuture<List<Wo>> cf : list){
+			if(resWos.size()<50) {
+				resWos.addAll(cf.get(60, TimeUnit.SECONDS));
+			}
+		}
+		if (resWos.size()>50){
+			resWos = resWos.subList(0, 50);
+		}
+		result.setData(resWos);
+		result.setCount((long)resWos.size());
+		return result;
+	}
+
+	private CompletableFuture<List<Wo>> searchScript(final Wi wi, final List<String> appIdList) {
+		CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+			List<Wo> resWos = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<WoScript> woScripts;
+				if (ListTools.isEmpty(appIdList)) {
+					woScripts = emc.fetchAll(Script.class, WoScript.copier);
+				} else {
+					woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.portal_FIELDNAME, appIdList);
+				}
+
+				for (WoScript woScript : woScripts) {
+					Map<String, String> map = PropertyTools.fieldMatchKeyword(WoScript.copier.getCopyFields(), woScript, wi.getKeyword(),
+							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+					if (!map.isEmpty()) {
+						Wo wo = new Wo();
+						Portal portal = emc.find(woScript.getPortal(), Portal.class);
+						if(portal != null){
+							wo.setAppId(portal.getId());
+							wo.setAppName(portal.getName());
+						}
+						wo.setDesignerId(woScript.getId());
+						wo.setDesignerName(woScript.getName());
+						wo.setDesignerType(DesignerType.script.toString());
+						wo.setUpdateTime(woScript.getUpdateTime());
+						wo.setPatternList(map);
+						resWos.add(wo);
+					}
+				}
+				woScripts.clear();
+			}catch (Exception e){
+				logger.error(e);
+			}
+			return resWos;
+		});
+		return cf;
+	}
+
+	private CompletableFuture<List<Wo>> searchPage(final Wi wi, final List<String> appIdList) {
+		CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+			List<Wo> resWos = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				List<String> ids = business.page().listWithPortals(appIdList);
+				for (List<String> partIds : ListTools.batch(ids, 100)) {
+					List<WoPage> wos = emc.fetchIn(Page.class, WoPage.copier, Page.id_FIELDNAME, partIds);
+					for (WoPage wopage : wos) {
+						Map<String, String> map = PropertyTools.fieldMatchKeyword(WoPage.copier.getCopyFields(), wopage, wi.getKeyword(),
+								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+						if (!map.isEmpty()) {
+							Wo wo = new Wo();
+							Portal portal = emc.find(wopage.getPortal(), Portal.class);
+							if(portal != null){
+								wo.setAppId(portal.getId());
+								wo.setAppName(portal.getName());
+							}
+							wo.setDesignerId(wopage.getId());
+							wo.setDesignerName(wopage.getName());
+							wo.setDesignerType(DesignerType.page.toString());
+							wo.setUpdateTime(wopage.getUpdateTime());
+							wo.setPatternList(map);
+							resWos.add(wo);
+						}
+					}
+					wos.clear();
+				}
+
+			}catch (Exception e){
+				logger.error(e);
+			}
+			return resWos;
+		});
+		return cf;
+	}
+
+	private CompletableFuture<List<Wo>> searchWidget(final Wi wi, final List<String> appIdList) {
+		CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+			List<Wo> resWos = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				List<String> ids = business.widget().listWithPortals(appIdList);
+				for (List<String> partIds : ListTools.batch(ids, 100)) {
+					List<WoWidget> wos = emc.fetchIn(Widget.class, WoWidget.copier, WoWidget.id_FIELDNAME, partIds);
+					for (WoWidget woWidget : wos) {
+						Map<String, String> map = PropertyTools.fieldMatchKeyword(WoWidget.copier.getCopyFields(), woWidget, wi.getKeyword(),
+								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+						if (!map.isEmpty()) {
+							Wo wo = new Wo();
+							Portal portal = emc.find(woWidget.getPortal(), Portal.class);
+							if(portal != null){
+								wo.setAppId(portal.getId());
+								wo.setAppName(portal.getName());
+							}
+							wo.setDesignerId(woWidget.getId());
+							wo.setDesignerName(woWidget.getName());
+							wo.setDesignerType(DesignerType.widget.toString());
+							wo.setUpdateTime(woWidget.getUpdateTime());
+							wo.setPatternList(map);
+							resWos.add(wo);
+						}
+					}
+					wos.clear();
+				}
+
+			}catch (Exception e){
+				logger.error(e);
+			}
+			return resWos;
+		});
+		return cf;
+	}
+
+	public static class Wi extends WiDesigner {
+
+	}
+
+	public static class Wo extends WrapDesigner{
+
+	}
+
+	public static class WoScript extends Script {
+
+		static WrapCopier<Script, WoScript> copier = WrapCopierFactory.wo(Script.class, WoScript.class,
+				JpaObject.singularAttributeField(Script.class, true, false),null);
+
+	}
+
+	public static class WoPage extends Page {
+
+		static WrapCopier<Page, WoPage> copier = WrapCopierFactory.wo(Page.class, WoPage.class,
+				JpaObject.singularAttributeField(WoPage.class, true, false),null);
+
+	}
+
+	public static class WoWidget extends Widget {
+
+		static WrapCopier<Widget, WoWidget> copier = WrapCopierFactory.wo(Widget.class, WoWidget.class,
+				JpaObject.singularAttributeField(WoWidget.class, true, false),null);
+
+	}
+
+
+}

+ 7 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/BaseAction.java

@@ -0,0 +1,7 @@
+package com.x.portal.assemble.designer.jaxrs.designer;
+
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+}

+ 48 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/DesignerAction.java

@@ -0,0 +1,48 @@
+package com.x.portal.assemble.designer.jaxrs.designer;
+
+import com.google.gson.JsonElement;
+import com.x.base.core.project.annotation.JaxrsDescribe;
+import com.x.base.core.project.annotation.JaxrsMethodDescribe;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.http.HttpMediaType;
+import com.x.base.core.project.jaxrs.ResponseFactory;
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import java.util.List;
+
+@Path("designer")
+@JaxrsDescribe("设计")
+public class DesignerAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(DesignerAction.class);
+
+	@JaxrsMethodDescribe(value = "根据关键字搜索设计对象.", action = ActionSearch.class)
+	@POST
+	@Path("search")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void search(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+							JsonElement jsonElement) {
+		ActionResult<List<ActionSearch.Wo>> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionSearch().execute(effectivePerson, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+}

+ 11 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ExceptionFieldEmpty.java

@@ -0,0 +1,11 @@
+package com.x.portal.assemble.designer.jaxrs.designer;
+
+import com.x.base.core.project.exception.PromptException;
+
+public class ExceptionFieldEmpty extends PromptException {
+
+	public ExceptionFieldEmpty(String field) {
+		super("参数: {} 值无效.", field);
+	}
+
+}

+ 2 - 2
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/DesignerJaxrsFilter.java

@@ -1,10 +1,10 @@
 package com.x.processplatform.assemble.designer.jaxrs;
 package com.x.processplatform.assemble.designer.jaxrs;
 
 
-import com.x.base.core.project.jaxrs.ManagerUserJaxrsFilter;
+import com.x.base.core.project.jaxrs.CipherManagerJaxrsFilter;
 
 
 import javax.servlet.annotation.WebFilter;
 import javax.servlet.annotation.WebFilter;
 
 
 @WebFilter(urlPatterns = "/jaxrs/designer/*", asyncSupported = true)
 @WebFilter(urlPatterns = "/jaxrs/designer/*", asyncSupported = true)
-public class DesignerJaxrsFilter extends ManagerUserJaxrsFilter {
+public class DesignerJaxrsFilter extends CipherManagerJaxrsFilter {
 
 
 }
 }

+ 28 - 7
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -14,18 +14,20 @@ import com.x.base.core.project.jaxrs.WiDesigner;
 import com.x.base.core.project.jaxrs.WrapDesigner;
 import com.x.base.core.project.jaxrs.WrapDesigner;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.logger.LoggerFactory;
-import com.x.base.core.project.tools.FieldTools;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.ListTools;
+import com.x.base.core.project.tools.PropertyTools;
 import com.x.processplatform.assemble.designer.Business;
 import com.x.processplatform.assemble.designer.Business;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Script;
 import com.x.processplatform.core.entity.element.Script;
 import com.x.processplatform.core.entity.element.wrap.WrapProcess;
 import com.x.processplatform.core.entity.element.wrap.WrapProcess;
+import org.apache.commons.lang3.StringUtils;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 
 
 class ActionSearch extends BaseAction {
 class ActionSearch extends BaseAction {
 
 
@@ -36,10 +38,28 @@ class ActionSearch extends BaseAction {
 			throw new ExceptionAccessDenied(effectivePerson);
 			throw new ExceptionAccessDenied(effectivePerson);
 		}
 		}
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+		logger.info("{}开始流程平台设计搜索,条件:{}", effectivePerson.getDistinguishedName(), wi);
+		if(StringUtils.isBlank(wi.getKeyword())){
+			throw new ExceptionFieldEmpty("keyword");
+		}
 		ActionResult<List<Wo>> result = new ActionResult<>();
 		ActionResult<List<Wo>> result = new ActionResult<>();
 
 
-		final List<Wo> resWos = new ArrayList<>();
-
+		List<Wo> resWos = new ArrayList<>();
+		List<CompletableFuture<List<Wo>>> list = new ArrayList<>();
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.form.toString())){
+			list.add(searchForm(wi, wi.getAppIdList()));
+		}
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.script.toString())){
+			list.add(searchScript(wi, wi.getAppIdList()));
+		}
+		for (CompletableFuture<List<Wo>> cf : list){
+			if(resWos.size()<50) {
+				resWos.addAll(cf.get(60, TimeUnit.SECONDS));
+			}
+		}
+		if (resWos.size()>50){
+			resWos = resWos.subList(0, 50);
+		}
 		result.setData(resWos);
 		result.setData(resWos);
 		result.setCount((long)resWos.size());
 		result.setCount((long)resWos.size());
 		return result;
 		return result;
@@ -55,9 +75,8 @@ class ActionSearch extends BaseAction {
 				} else {
 				} else {
 					woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.application_FIELDNAME, appIdList);
 					woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.application_FIELDNAME, appIdList);
 				}
 				}
-
 				for (WoScript woScript : woScripts) {
 				for (WoScript woScript : woScripts) {
-					Map<String, String> map = FieldTools.fieldMatchKeyword(WoScript.class, woScript, wi.getKeyword(),
+					Map<String, String> map = PropertyTools.fieldMatchKeyword(WoScript.copier.getCopyFields(), woScript, wi.getKeyword(),
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 							wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 					if (!map.isEmpty()) {
 					if (!map.isEmpty()) {
 						Wo wo = new Wo();
 						Wo wo = new Wo();
@@ -69,6 +88,7 @@ class ActionSearch extends BaseAction {
 						wo.setDesignerId(woScript.getId());
 						wo.setDesignerId(woScript.getId());
 						wo.setDesignerName(woScript.getName());
 						wo.setDesignerName(woScript.getName());
 						wo.setDesignerType(DesignerType.script.toString());
 						wo.setDesignerType(DesignerType.script.toString());
+						wo.setUpdateTime(woScript.getUpdateTime());
 						wo.setPatternList(map);
 						wo.setPatternList(map);
 						resWos.add(wo);
 						resWos.add(wo);
 					}
 					}
@@ -91,7 +111,7 @@ class ActionSearch extends BaseAction {
 				for (List<String> partFormIds : ListTools.batch(formIds, 100)) {
 				for (List<String> partFormIds : ListTools.batch(formIds, 100)) {
 					List<WoForm> woForms = emc.fetchIn(Form.class, WoForm.copier, Form.id_FIELDNAME, partFormIds);
 					List<WoForm> woForms = emc.fetchIn(Form.class, WoForm.copier, Form.id_FIELDNAME, partFormIds);
 					for (WoForm woForm : woForms) {
 					for (WoForm woForm : woForms) {
-						Map<String, String> map = FieldTools.fieldMatchKeyword(WoForm.class, woForm, wi.getKeyword(),
+						Map<String, String> map = PropertyTools.fieldMatchKeyword(WoForm.copier.getCopyFields(), woForm, wi.getKeyword(),
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 								wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
 						if (!map.isEmpty()) {
 						if (!map.isEmpty()) {
 							Wo wo = new Wo();
 							Wo wo = new Wo();
@@ -102,7 +122,8 @@ class ActionSearch extends BaseAction {
 							}
 							}
 							wo.setDesignerId(woForm.getId());
 							wo.setDesignerId(woForm.getId());
 							wo.setDesignerName(woForm.getName());
 							wo.setDesignerName(woForm.getName());
-							wo.setDesignerType(DesignerType.script.toString());
+							wo.setDesignerType(DesignerType.form.toString());
+							wo.setUpdateTime(woForm.getUpdateTime());
 							wo.setPatternList(map);
 							wo.setPatternList(map);
 							resWos.add(wo);
 							resWos.add(wo);
 						}
 						}

+ 1 - 1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/DesignerAction.java

@@ -30,7 +30,7 @@ public class DesignerAction extends StandardJaxrsAction {
 	@Path("search")
 	@Path("search")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	@Consumes(MediaType.APPLICATION_JSON)
-	public void managerList(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+	public void search(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 							JsonElement jsonElement) {
 							JsonElement jsonElement) {
 		ActionResult<List<ActionSearch.Wo>> result = new ActionResult<>();
 		ActionResult<List<ActionSearch.Wo>> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		EffectivePerson effectivePerson = this.effectivePerson(request);

+ 11 - 0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ExceptionFieldEmpty.java

@@ -0,0 +1,11 @@
+package com.x.processplatform.assemble.designer.jaxrs.designer;
+
+import com.x.base.core.project.exception.PromptException;
+
+public class ExceptionFieldEmpty extends PromptException {
+
+	public ExceptionFieldEmpty(String field) {
+		super("参数: {} 值无效.", field);
+	}
+
+}

+ 75 - 133
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java

@@ -5,8 +5,11 @@ import com.x.base.core.project.Applications;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.annotation.FieldTypeDescribe;
 import com.x.base.core.project.annotation.FieldTypeDescribe;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WiDesigner;
+import com.x.base.core.project.jaxrs.WrapDesigner;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.ListTools;
@@ -16,10 +19,11 @@ import com.x.base.core.project.x_cms_assemble_control;
 import com.x.base.core.project.x_portal_assemble_designer;
 import com.x.base.core.project.x_portal_assemble_designer;
 import com.x.base.core.project.x_processplatform_assemble_designer;
 import com.x.base.core.project.x_processplatform_assemble_designer;
 import com.x.query.service.processing.ThisApplication;
 import com.x.query.service.processing.ThisApplication;
+import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 
 
 import java.util.*;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.*;
 
 
 class ActionSearch extends BaseAction {
 class ActionSearch extends BaseAction {
 
 
@@ -29,27 +33,15 @@ class ActionSearch extends BaseAction {
 			throws Exception {
 			throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		ActionResult<Wo> result = new ActionResult<>();
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
-		Wo wo = new Wo();
-		wo.setType(wi.getType());
 		if(StringUtils.isBlank(wi.getKeyword())){
 		if(StringUtils.isBlank(wi.getKeyword())){
 			throw new ExceptionFieldEmpty("keyword");
 			throw new ExceptionFieldEmpty("keyword");
 		}
 		}
-		if(StringUtils.isBlank(wi.getType())){
-			throw new ExceptionFieldEmpty("type");
-		}
-		logger.print("{}搜索全局设计:{},关键字:{}", effectivePerson.getDistinguishedName(), wi.getType(), wi.getKeyword());
-		switch (wi.getType()) {
-			case "script":
-				wo.setScriptWrapList(searchScript(wi));
-				break;
-			default:
-				throw new ExceptionFieldEmpty("type");
-		}
-		result.setData(wo);
+		logger.print("{}搜索全局设计:{},关键字:{}", effectivePerson.getDistinguishedName(), wi.getModuleList(), wi.getKeyword());
+		result.setData(search(wi));
 		return result;
 		return result;
 	}
 	}
 
 
-	private List<ScriptWo> searchScript(final Wi wi) throws Exception{
+	private Wo search(final Wi wi) {
 		final Map<String, List<String>> moduleMap = new HashMap<>();
 		final Map<String, List<String>> moduleMap = new HashMap<>();
 		if(!ListTools.isEmpty(wi.getModuleList())){
 		if(!ListTools.isEmpty(wi.getModuleList())){
 			for (Module module: wi.getModuleList()){
 			for (Module module: wi.getModuleList()){
@@ -69,65 +61,66 @@ class ActionSearch extends BaseAction {
 			moduleMap.put(ModuleType.portal.toString(), list);
 			moduleMap.put(ModuleType.portal.toString(), list);
 			moduleMap.put(ModuleType.processPlatform.toString(), list);
 			moduleMap.put(ModuleType.processPlatform.toString(), list);
 		}
 		}
-
-		CompletableFuture<List<ScriptWo>> processPlatformCf = scriptSearchAsync(wi, moduleMap, ModuleType.processPlatform.toString(), x_processplatform_assemble_designer.class);
-		CompletableFuture<List<ScriptWo>> portalCf = scriptSearchAsync(wi, moduleMap, ModuleType.portal.toString(), x_portal_assemble_designer.class);
-		CompletableFuture<List<ScriptWo>> cmsCf = scriptSearchAsync(wi, moduleMap, ModuleType.cms.toString(), x_cms_assemble_control.class);
-
-		List<ScriptWo> scriptWoList = new ArrayList<>();
-		scriptWoList.addAll(processPlatformCf.get());
-		scriptWoList.addAll(portalCf.get());
-		scriptWoList.addAll(cmsCf.get());
-
-		return scriptWoList;
+		Executor executor = Executors.newFixedThreadPool(5);
+		CompletableFuture<List<WrapDesigner>> processPlatformCf = searchAsync(wi, moduleMap, ModuleType.processPlatform.toString(), x_processplatform_assemble_designer.class, executor);
+		CompletableFuture<List<WrapDesigner>> portalCf = searchAsync(wi, moduleMap, ModuleType.portal.toString(), x_portal_assemble_designer.class, executor);
+		CompletableFuture<List<WrapDesigner>> cmsCf = searchAsync(wi, moduleMap, ModuleType.cms.toString(), x_cms_assemble_control.class, executor);
+		Wo wo = new Wo();
+		try {
+			wo.setProcessPlatformDesigners(processPlatformCf.get(200, TimeUnit.SECONDS));
+		} catch (Exception e) {
+			logger.warn("搜索流程平台设计异常:{}",e.getMessage());
+		}
+		try {
+			wo.setPortalDesigners(portalCf.get(200, TimeUnit.SECONDS));
+		} catch (Exception e) {
+			logger.warn("搜索门户平台设计异常:{}",e.getMessage());
+		}
+		try {
+			wo.setCmsDesigners(cmsCf.get(200, TimeUnit.SECONDS));
+		} catch (Exception e) {
+			logger.warn("搜索内容管理平台设计异常:{}",e.getMessage());
+		}
+		return wo;
 	}
 	}
 
 
-	private CompletableFuture<List<ScriptWo>> scriptSearchAsync(final Wi wi, final Map<String, List<String>> moduleMap, final String moduleType, final Class<?> applicationClass){
-		CompletableFuture<List<ScriptWo>> cf = CompletableFuture.supplyAsync(() -> {
-			List<ScriptWo> swList = new ArrayList<>();
+	private CompletableFuture<List<WrapDesigner>> searchAsync(final Wi wi, final Map<String, List<String>> moduleMap, final String moduleType, final Class<?> applicationClass, Executor executor){
+		CompletableFuture<List<WrapDesigner>> cf = CompletableFuture.supplyAsync(() -> {
+			List<WrapDesigner> swList = new ArrayList<>();
 			if(moduleMap.containsKey(moduleType)) {
 			if(moduleMap.containsKey(moduleType)) {
 				try {
 				try {
-					Map<String, Object> map = new HashMap<>();
-					map.put("appIdList", moduleMap.get(moduleType));
-					map.put("keyword", wi.getKeyword());
-					map.put("caseSensitive", wi.getCaseSensitive());
-					map.put("matchWholeWord", wi.getMatchWholeWord());
-					map.put("matchRegExp", wi.getMatchRegExp());
-					List<WrapScript> scriptList = ThisApplication.context().applications().postQuery(applicationClass,
-							Applications.joinQueryUri("script", "list", "manager"), map).getDataAsList(WrapScript.class);
-					logger.print("设计搜索关联{}的匹配脚本个数:{}", moduleType, scriptList.size());
-					getScriptSearchRes(wi, moduleType, swList, scriptList);
+					WiDesigner wiDesigner = new WiDesigner();
+					BeanUtils.copyProperties(wiDesigner, wi);
+					wiDesigner.setAppIdList(moduleMap.get(moduleType));
+					List<WrapDesigner> designerList = ThisApplication.context().applications().postQuery(applicationClass,
+							Applications.joinQueryUri("designer", "search"), wiDesigner).getDataAsList(WrapDesigner.class);
+					logger.print("设计搜索关联{}的匹配设计个数:{}", moduleType, designerList.size());
+					getSearchRes(wi, designerList);
+					swList = designerList;
 				} catch (Exception e) {
 				} catch (Exception e) {
 					logger.error(e);
 					logger.error(e);
 				}
 				}
 				if (swList.size() > 2) {
 				if (swList.size() > 2) {
 					try {
 					try {
-						SortTools.desc(swList, "appId");
+						SortTools.desc(swList, "designerType","appId");
 					} catch (Exception e) {
 					} catch (Exception e) {
 					}
 					}
 				}
 				}
 			}
 			}
 			return swList;
 			return swList;
-		});
+		}, executor);
 		return cf;
 		return cf;
 	}
 	}
 
 
-	private void getScriptSearchRes(final Wi wi, String moduleType, List<ScriptWo> swList, List<WrapScript> scriptList){
-		if (!ListTools.isEmpty(scriptList)){
-			for (WrapScript script:scriptList) {
-				if (StringTools.matchKeyword(wi.getKeyword(), script.getText(), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
-					List<Integer> list = patternLines(script.getId()+"-"+script.getUpdateTime().getTime(),
-							wi.getKeyword(), script.getText(), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
-					if (!ListTools.isEmpty(list)){
-						ScriptWo scriptWo = new ScriptWo();
-						scriptWo.setModuleType(moduleType);
-						scriptWo.setAppId(script.getAppId());
-						scriptWo.setAppName(script.getAppName());
-						scriptWo.setScriptId(script.getId());
-						scriptWo.setScriptName(script.getName());
-						scriptWo.setPatternLines(list);
-						swList.add(scriptWo);
-					}
+	private void getSearchRes(final Wi wi, List<WrapDesigner> designerList){
+		if (!ListTools.isEmpty(designerList)){
+			for (WrapDesigner designer : designerList) {
+				WrapDesigner.DesignerPattern pattern = designer.getScriptDesigner();
+				if(pattern!=null) {
+					List<Integer> lines = patternLines(designer.getDesignerId() + "-" + designer.getUpdateTime().getTime(),
+							wi.getKeyword(), pattern.getPropertyValue(), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+					pattern.setLines(lines);
+					pattern.setPropertyValue(null);
 				}
 				}
 			}
 			}
 		}
 		}
@@ -138,15 +131,15 @@ class ActionSearch extends BaseAction {
 
 
 		@FieldDescribe("搜索关键字.")
 		@FieldDescribe("搜索关键字.")
 		private String keyword;
 		private String keyword;
-		@FieldDescribe("搜索类型:script|form|process")
-		private String type;
+		@FieldDescribe("搜索设计类型:script|form|page|widget|process")
+		private List<String> designerTypes;
 		@FieldDescribe("是否区分大小写.")
 		@FieldDescribe("是否区分大小写.")
 		private Boolean caseSensitive;
 		private Boolean caseSensitive;
 		@FieldDescribe("是否全字匹配.")
 		@FieldDescribe("是否全字匹配.")
 		private Boolean matchWholeWord;
 		private Boolean matchWholeWord;
 		@FieldDescribe("是否正则表达式匹配.")
 		@FieldDescribe("是否正则表达式匹配.")
 		private Boolean matchRegExp;
 		private Boolean matchRegExp;
-		@FieldDescribe("限制查询的模块列表(模块:processPlatform|portal|cms|service).")
+		@FieldDescribe("限制查询的模块列表(模块类型:processPlatform|cms|portal|query|service).")
 		@FieldTypeDescribe(fieldType = "class", fieldTypeName = "Module", fieldValue = "{\"moduleType\": \"cms\", \"flagList\": []}")
 		@FieldTypeDescribe(fieldType = "class", fieldTypeName = "Module", fieldValue = "{\"moduleType\": \"cms\", \"flagList\": []}")
 		private List<Module> moduleList;
 		private List<Module> moduleList;
 
 
@@ -158,12 +151,12 @@ class ActionSearch extends BaseAction {
 			this.keyword = keyword;
 			this.keyword = keyword;
 		}
 		}
 
 
-		public String getType() {
-			return type;
+		public List<String> getDesignerTypes() {
+			return designerTypes;
 		}
 		}
 
 
-		public void setType(String type) {
-			this.type = type;
+		public void setDesignerTypes(List<String> designerTypes) {
+			this.designerTypes = designerTypes;
 		}
 		}
 
 
 		public Boolean getCaseSensitive() {
 		public Boolean getCaseSensitive() {
@@ -202,7 +195,7 @@ class ActionSearch extends BaseAction {
 	public static class Module extends GsonPropertyObject {
 	public static class Module extends GsonPropertyObject {
 		@FieldDescribe("模块的应用id列表.")
 		@FieldDescribe("模块的应用id列表.")
 		private List<String> flagList;
 		private List<String> flagList;
-		@FieldDescribe("模块类型:processPlatform|cms|portal|query|service")
+		@FieldDescribe("模块类型.")
 		private String moduleType;
 		private String moduleType;
 
 
 		public List<String> getFlagList() {
 		public List<String> getFlagList() {
@@ -223,88 +216,37 @@ class ActionSearch extends BaseAction {
 	}
 	}
 
 
 	public static class Wo extends GsonPropertyObject {
 	public static class Wo extends GsonPropertyObject {
-		@FieldDescribe("搜索类型:script|form|process")
-		private String type;
-		@FieldDescribe("脚本搜索结果集")
-		private List<ScriptWo> scriptWrapList = new ArrayList<>();
 
 
-		public String getType() {
-			return type;
-		}
-
-		public void setType(String type) {
-			this.type = type;
-		}
-
-		public List<ScriptWo> getScriptWrapList() {
-			return scriptWrapList;
-		}
+		private static final long serialVersionUID = 8169092162410529422L;
 
 
-		public void setScriptWrapList(List<ScriptWo> scriptWrapList) {
-			this.scriptWrapList = scriptWrapList;
-		}
-	}
+		private List<WrapDesigner> processPlatformDesigners;
 
 
-	public static class ScriptWo extends GsonPropertyObject {
-		@FieldDescribe("模块类型:processPlatform|cms|portal|query|service")
-		private String moduleType;
-		@FieldDescribe("应用ID")
-		private String appId;
-		@FieldDescribe("应用名称")
-		private String appName;
-		@FieldDescribe("脚本Id")
-		private String scriptId;
-		@FieldDescribe("脚本名称")
-		private String scriptName;
-		@FieldDescribe("匹配行")
-		private List<Integer> patternLines;
+		private List<WrapDesigner> cmsDesigners;
 
 
-		public String getModuleType() {
-			return moduleType;
-		}
-
-		public void setModuleType(String moduleType) {
-			this.moduleType = moduleType;
-		}
-
-		public String getAppId() {
-			return appId;
-		}
-
-		public void setAppId(String appId) {
-			this.appId = appId;
-		}
-
-		public String getAppName() {
-			return appName;
-		}
-
-		public void setAppName(String appName) {
-			this.appName = appName;
-		}
+		private List<WrapDesigner> portalDesigners;
 
 
-		public String getScriptId() {
-			return scriptId;
+		public List<WrapDesigner> getProcessPlatformDesigners() {
+			return processPlatformDesigners;
 		}
 		}
 
 
-		public void setScriptId(String scriptId) {
-			this.scriptId = scriptId;
+		public void setProcessPlatformDesigners(List<WrapDesigner> processPlatformDesigners) {
+			this.processPlatformDesigners = processPlatformDesigners;
 		}
 		}
 
 
-		public String getScriptName() {
-			return scriptName;
+		public List<WrapDesigner> getCmsDesigners() {
+			return cmsDesigners;
 		}
 		}
 
 
-		public void setScriptName(String scriptName) {
-			this.scriptName = scriptName;
+		public void setCmsDesigners(List<WrapDesigner> cmsDesigners) {
+			this.cmsDesigners = cmsDesigners;
 		}
 		}
 
 
-		public List<Integer> getPatternLines() {
-			return patternLines;
+		public List<WrapDesigner> getPortalDesigners() {
+			return portalDesigners;
 		}
 		}
 
 
-		public void setPatternLines(List<Integer> patternLines) {
-			this.patternLines = patternLines;
+		public void setPortalDesigners(List<WrapDesigner> portalDesigners) {
+			this.portalDesigners = portalDesigners;
 		}
 		}
 	}
 	}
 
 

+ 2 - 1
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ModuleType.java

@@ -6,10 +6,11 @@ import com.x.base.core.entity.JpaObject;
  * processPlatform(流程管理平台)
  * processPlatform(流程管理平台)
  * portal(门户管理平台)
  * portal(门户管理平台)
  * cms(内容管理平台)
  * cms(内容管理平台)
+ * query (数据中心平台)
  * service(服务管理平台)
  * service(服务管理平台)
  */
  */
 public enum ModuleType {
 public enum ModuleType {
 
 
-	processPlatform, portal, cms, service;
+	processPlatform, portal, cms, query, service;
 	public static final int length = JpaObject.length_64B;
 	public static final int length = JpaObject.length_64B;
 }
 }