zhourui 5 жил өмнө
parent
commit
a5f4e9dd10
19 өөрчлөгдсөн 757 нэмэгдсэн , 509 устгасан
  1. 3 1
      o2server/configSample/node_127.0.0.1.json
  2. 24 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java
  3. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_designer.java
  4. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_surface.java
  5. 5 0
      o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java
  6. 52 2
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/form/ActionCreate.java
  7. 57 6
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/form/ActionEdit.java
  8. 8 0
      o2server/x_processplatform_assemble_surface/pom.xml
  9. 64 62
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java
  10. 21 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/CmsFactory.java
  11. 17 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/ScriptFactory.java
  12. 21 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/PortalFactory.java
  13. 17 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/ScriptFactory.java
  14. 53 174
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompleted.java
  15. 53 174
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompletedMobile.java
  16. 215 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
  17. 58 1
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java
  18. 26 84
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Form.java
  19. 57 0
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/FormProperties.java

+ 3 - 1
o2server/configSample/node_127.0.0.1.json

@@ -78,7 +78,9 @@
     "###dirAllowed": "允许浏览目录,###",
     "###statEnable": "启用统计,默认启用统计.###",
     "###statExclusions": "统计忽略路径,默认忽略*.gif,*.jpg,*.png,*.ico###",
-    "###cacheControlMaxAge": "服务器max-age缓存时间(秒)###"
+    "###cacheControlMaxAge": "服务器max-age缓存时间(秒)###",
+    "###proxyCenterEnable": "是否启用center服务器代理.###",
+    "###proxyApplicationEnable": "是否启用application服务器代理###"
   },
   "data": {
     "enable": true,

+ 24 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java

@@ -31,6 +31,8 @@ public class WebServer extends ConfigObject {
 	private static final Boolean DEFAULT_STATENABLE = false;
 	private static final String DEFAULT_STATEXCLUSIONS = "*.gif,*.jpg,*.png,*.ico";
 	private static final Integer DEFAULT_CACHECONTROLMAXAGE = 0;
+	private static final Boolean DEFAULT_PROXYCENTERENABLE = true;
+	private static final Boolean DEFAULT_PROXYAPPLICATIONENABLE = true;
 
 	@FieldDescribe("是否启用")
 	private Boolean enable;
@@ -53,6 +55,20 @@ public class WebServer extends ConfigObject {
 	@FieldDescribe("服务器max-age缓存时间(秒)")
 	private Integer cacheControlMaxAge;
 
+	@FieldDescribe("是否启用center服务器代理.")
+	private Boolean proxyCenterEnable;
+
+	@FieldDescribe("是否启用application服务器代理")
+	private Boolean proxyApplicationEnable;
+
+	public Boolean getProxyCenterEnable() {
+		return proxyCenterEnable == null ? DEFAULT_PROXYCENTERENABLE : this.proxyCenterEnable;
+	}
+
+	public Boolean getProxyApplicationEnable() {
+		return proxyApplicationEnable == null ? DEFAULT_PROXYAPPLICATIONENABLE : this.proxyApplicationEnable;
+	}
+
 	public Integer getCacheControlMaxAge() {
 		if (cacheControlMaxAge == null || cacheControlMaxAge < 0) {
 			return DEFAULT_CACHECONTROLMAXAGE;
@@ -136,4 +152,12 @@ public class WebServer extends ConfigObject {
 		this.weight = weight;
 	}
 
+	public void setProxyApplicationEnable(Boolean proxyApplicationEnable) {
+		this.proxyApplicationEnable = proxyApplicationEnable;
+	}
+
+	public void setProxyCenterEnable(Boolean proxyCenterEnable) {
+		this.proxyCenterEnable = proxyCenterEnable;
+	}
+
 }

+ 3 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_designer.java

@@ -29,9 +29,10 @@ import com.x.base.core.project.annotation.ModuleType;
 		"com.x.processplatform.core.entity.element.ApplicationDictItem",
 		"com.x.processplatform.core.entity.element.QueryView", "com.x.processplatform.core.entity.element.QueryStat",
 		"com.x.processplatform.core.entity.element.Mapping", "com.x.query.core.entity.Item",
+		"com.x.cms.core.entity.element.Script", "com.x.portal.core.entity.Script",
 		"com.x.query.dynamic.entity.*" }, storeJars = { "x_organization_core_entity", "x_organization_core_express",
-				"x_processplatform_core_entity", "x_processplatform_core_express",
-				"x_query_core_entity" }, dynamicJars = {
+				"x_processplatform_core_entity", "x_processplatform_core_express", "x_query_core_entity",
+				"x_cms_core_entity", "x_portal_core_entity" }, dynamicJars = {
 						"x_query_dynamic_entity", }, storageTypes = { StorageType.processPlatform })
 public class x_processplatform_assemble_designer extends Deployable {
 

+ 3 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_surface.java

@@ -28,8 +28,9 @@ import com.x.base.core.project.annotation.ModuleType;
 		"com.x.processplatform.core.entity.element.Script", "com.x.processplatform.core.entity.element.Service",
 		"com.x.processplatform.core.entity.element.Split", "com.x.processplatform.core.entity.element.QueryView",
 		"com.x.processplatform.core.entity.element.QueryStat", "com.x.processplatform.core.entity.element.Mapping",
-		"com.x.query.core.entity.Item" }, storageTypes = { StorageType.processPlatform }, storeJars = {
+		"com.x.query.core.entity.Item", "com.x.cms.core.entity.element.Script",
+		"com.x.portal.core.entity.Script" }, storageTypes = { StorageType.processPlatform }, storeJars = {
 				"x_organization_core_entity", "x_organization_core_express", "x_processplatform_core_entity",
-				"x_processplatform_core_express", "x_query_core_entity" })
+				"x_processplatform_core_express", "x_query_core_entity", "x_cms_core_entity", "x_portal_core_entity" })
 public class x_processplatform_assemble_surface extends Deployable {
 }

+ 5 - 0
o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java

@@ -1,6 +1,8 @@
 package com.x.server.console.server.web;
 
 import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashMap;
@@ -9,11 +11,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Objects;
+import java.util.stream.Stream;
 
 import javax.servlet.DispatcherType;
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jetty.server.Server;
@@ -27,6 +31,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
 import com.alibaba.druid.support.http.StatViewServlet;
 import com.alibaba.druid.support.http.WebStatFilter;
 import com.google.gson.Gson;
+import com.x.base.core.project.x_program_center;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.config.WebServer;
 import com.x.base.core.project.gson.XGsonBuilder;

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

@@ -2,7 +2,9 @@ package com.x.processplatform.assemble.designer.jaxrs.form;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
@@ -12,7 +14,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WoId;
@@ -44,6 +46,10 @@ class ActionCreate extends BaseAction {
 			form.setApplication(application.getId());
 			form.setLastUpdatePerson(effectivePerson.getDistinguishedName());
 			form.setLastUpdateTime(new Date());
+			form.getProperties().setRelatedFormList(wi.getRelatedFormList());
+			form.getProperties().setMobileRelatedFormList(wi.getMobileRelatedFormList());
+			form.getProperties().setRelatedScriptMap(wi.getRelatedScriptMap());
+			form.getProperties().setMobileRelatedScriptMap(wi.getMobileRelatedScriptMap());
 			emc.persist(form, CheckPersistType.all);
 			emc.commit();
 			List<FormField> formFields = WiFormField.copier.copy(wi.getFormFieldList());
@@ -54,7 +60,7 @@ class ActionCreate extends BaseAction {
 				emc.persist(o, CheckPersistType.all);
 			}
 			emc.commit();
-			CacheManager.notify(Form.class);
+			ApplicationCache.notify(Form.class);
 			Wo wo = new Wo();
 			wo.setId(form.getId());
 			result.setData(wo);
@@ -75,6 +81,18 @@ class ActionCreate extends BaseAction {
 		@FieldDescribe("字段")
 		private List<WiFormField> formFieldList = new ArrayList<>();
 
+		@FieldDescribe("关联表单")
+		private List<String> relatedFormList = new ArrayList<>();
+
+		@FieldDescribe("移动端关联表单")
+		private List<String> mobileRelatedFormList = new ArrayList<>();
+
+		@FieldDescribe("关联脚本.")
+		private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+		@FieldDescribe("移动端关联脚本.")
+		private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
 		public List<WiFormField> getFormFieldList() {
 			return formFieldList;
 		}
@@ -83,6 +101,38 @@ class ActionCreate extends BaseAction {
 			this.formFieldList = formFieldList;
 		}
 
+		public List<String> getRelatedFormList() {
+			return relatedFormList;
+		}
+
+		public void setRelatedFormList(List<String> relatedFormList) {
+			this.relatedFormList = relatedFormList;
+		}
+
+		public List<String> getMobileRelatedFormList() {
+			return mobileRelatedFormList;
+		}
+
+		public void setMobileRelatedFormList(List<String> mobileRelatedFormList) {
+			this.mobileRelatedFormList = mobileRelatedFormList;
+		}
+
+		public Map<String, String> getRelatedScriptMap() {
+			return relatedScriptMap;
+		}
+
+		public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+		public Map<String, String> getMobileRelatedScriptMap() {
+			return mobileRelatedScriptMap;
+		}
+
+		public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+			this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+		}
+
 	}
 
 	public static class WiFormField extends FormField {

+ 57 - 6
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/form/ActionEdit.java

@@ -2,7 +2,9 @@ package com.x.processplatform.assemble.designer.jaxrs.form;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
@@ -12,7 +14,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WoId;
@@ -22,6 +24,7 @@ import com.x.processplatform.assemble.designer.ThisApplication;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.FormField;
+import com.x.processplatform.core.entity.element.FormProperties;
 import com.x.processplatform.core.entity.element.FormVersion;
 
 class ActionEdit extends BaseAction {
@@ -60,11 +63,15 @@ class ActionEdit extends BaseAction {
 			Wi.copier.copy(wi, form);
 			form.setId(id);
 			form.setApplication(application.getId());
-			form.setLastUpdatePerson(effectivePerson.getDistinguishedName());
-			form.setLastUpdateTime(new Date());
+			FormProperties properties = new FormProperties();
+			properties.setRelatedFormList(wi.getRelatedFormList());
+			properties.setMobileRelatedFormList(wi.getMobileRelatedFormList());
+			properties.setRelatedScriptMap(wi.getRelatedScriptMap());
+			properties.setMobileRelatedScriptMap(wi.getMobileRelatedScriptMap());
+			form.setProperties(properties);
 			emc.check(form, CheckPersistType.all);
 			emc.commit();
-			CacheManager.notify(Form.class);
+			ApplicationCache.notify(Form.class);
 			/* 保存历史版本 */
 			ThisApplication.formVersionQueue.send(new FormVersion(form.getId(), jsonElement));
 			Wo wo = new Wo();
@@ -81,12 +88,24 @@ class ActionEdit extends BaseAction {
 
 		private static final long serialVersionUID = 4289841165185269299L;
 
-		static WrapCopier<Wi, Form> copier = WrapCopierFactory.wi(Wi.class, Form.class, null, ListTools.toList(
-				JpaObject.FieldsUnmodifyExcludeId, Form.lastUpdatePerson_FIELDNAME, Form.lastUpdateTime_FIELDNAME));
+		static WrapCopier<Wi, Form> copier = WrapCopierFactory.wi(Wi.class, Form.class, null, ListTools
+				.toList(JpaObject.FieldsUnmodify, Form.lastUpdatePerson_FIELDNAME, Form.lastUpdateTime_FIELDNAME));
 
 		@FieldDescribe("字段")
 		private List<WiFormField> formFieldList = new ArrayList<>();
 
+		@FieldDescribe("关联表单")
+		private List<String> relatedFormList = new ArrayList<>();
+
+		@FieldDescribe("移动端关联表单")
+		private List<String> mobileRelatedFormList = new ArrayList<>();
+
+		@FieldDescribe("关联脚本.")
+		private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+		@FieldDescribe("移动端关联脚本.")
+		private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
 		public List<WiFormField> getFormFieldList() {
 			return formFieldList;
 		}
@@ -95,6 +114,38 @@ class ActionEdit extends BaseAction {
 			this.formFieldList = formFieldList;
 		}
 
+		public List<String> getRelatedFormList() {
+			return relatedFormList;
+		}
+
+		public void setRelatedFormList(List<String> relatedFormList) {
+			this.relatedFormList = relatedFormList;
+		}
+
+		public List<String> getMobileRelatedFormList() {
+			return mobileRelatedFormList;
+		}
+
+		public void setMobileRelatedFormList(List<String> mobileRelatedFormList) {
+			this.mobileRelatedFormList = mobileRelatedFormList;
+		}
+
+		public Map<String, String> getRelatedScriptMap() {
+			return relatedScriptMap;
+		}
+
+		public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+		public Map<String, String> getMobileRelatedScriptMap() {
+			return mobileRelatedScriptMap;
+		}
+
+		public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+			this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+		}
+
 	}
 
 	public static class WiFormField extends FormField {

+ 8 - 0
o2server/x_processplatform_assemble_surface/pom.xml

@@ -36,6 +36,14 @@
 			<groupId>o2oa</groupId>
 			<artifactId>x_processplatform_core_express</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_cms_core_entity</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_portal_core_entity</artifactId>
+		</dependency>
 	</dependencies>
 	<build>
 		<plugins>

+ 64 - 62
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java

@@ -20,6 +20,7 @@ import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.organization.OrganizationDefinition;
 import com.x.base.core.project.tools.ListTools;
 import com.x.organization.core.express.Organization;
+import com.x.processplatform.assemble.surface.factory.cms.CmsFactory;
 import com.x.processplatform.assemble.surface.factory.content.AttachmentFactory;
 import com.x.processplatform.assemble.surface.factory.content.ItemFactory;
 import com.x.processplatform.assemble.surface.factory.content.JobFactory;
@@ -54,6 +55,7 @@ import com.x.processplatform.assemble.surface.factory.element.RouteFactory;
 import com.x.processplatform.assemble.surface.factory.element.ScriptFactory;
 import com.x.processplatform.assemble.surface.factory.element.ServiceFactory;
 import com.x.processplatform.assemble.surface.factory.element.SplitFactory;
+import com.x.processplatform.assemble.surface.factory.portal.PortalFactory;
 import com.x.processplatform.core.entity.content.Attachment;
 import com.x.processplatform.core.entity.content.Read;
 import com.x.processplatform.core.entity.content.ReadCompleted;
@@ -387,24 +389,6 @@ public class Business {
 		return script;
 	}
 
-//	private QueryViewFactory queryView;
-//
-//	public QueryViewFactory queryView() throws Exception {
-//		if (null == this.queryView) {
-//			this.queryView = new QueryViewFactory(this);
-//		}
-//		return queryView;
-//	}
-//
-//	private QueryStatFactory queryStat;
-//
-//	public QueryStatFactory queryStat() throws Exception {
-//		if (null == this.queryStat) {
-//			this.queryStat = new QueryStatFactory(this);
-//		}
-//		return queryStat;
-//	}
-
 	private FileFactory file;
 
 	public FileFactory file() throws Exception {
@@ -414,6 +398,24 @@ public class Business {
 		return file;
 	}
 
+	private CmsFactory cms;
+
+	public CmsFactory cms() throws Exception {
+		if (null == this.cms) {
+			this.cms = new CmsFactory(this);
+		}
+		return cms;
+	}
+
+	private PortalFactory portal;
+
+	public PortalFactory portal() throws Exception {
+		if (null == this.portal) {
+			this.portal = new PortalFactory(this);
+		}
+		return portal;
+	}
+
 	public Activity getActivity(Work work) throws Exception {
 		return this.getActivity(work.getActivity(), work.getActivityType());
 	}
@@ -422,50 +424,50 @@ public class Business {
 		Activity o = null;
 		if (null != activityType) {
 			switch (activityType) {
-				case agent:
-					o = agent().pick(id);
-					break;
-				case begin:
-					o = begin().pick(id);
-					break;
-				case cancel:
-					o = cancel().pick(id);
-					break;
-				case choice:
-					o = choice().pick(id);
-					break;
-				case delay:
-					o = delay().pick(id);
-					break;
-				case embed:
-					o = embed().pick(id);
-					break;
-				case end:
-					o = end().pick(id);
-					break;
-				case invoke:
-					o = invoke().pick(id);
-					break;
-				case manual:
-					o = manual().pick(id);
-					break;
-				case merge:
-					o = merge().pick(id);
-					break;
-				case message:
-					o = message().pick(id);
-					break;
-				case parallel:
-					o = parallel().pick(id);
-					break;
-				case service:
-					o = service().pick(id);
-					break;
-				case split:
-					o = service().pick(id);
-					break;
-				default:
-					break;
+			case agent:
+				o = agent().pick(id);
+				break;
+			case begin:
+				o = begin().pick(id);
+				break;
+			case cancel:
+				o = cancel().pick(id);
+				break;
+			case choice:
+				o = choice().pick(id);
+				break;
+			case delay:
+				o = delay().pick(id);
+				break;
+			case embed:
+				o = embed().pick(id);
+				break;
+			case end:
+				o = end().pick(id);
+				break;
+			case invoke:
+				o = invoke().pick(id);
+				break;
+			case manual:
+				o = manual().pick(id);
+				break;
+			case merge:
+				o = merge().pick(id);
+				break;
+			case message:
+				o = message().pick(id);
+				break;
+			case parallel:
+				o = parallel().pick(id);
+				break;
+			case service:
+				o = service().pick(id);
+				break;
+			case split:
+				o = service().pick(id);
+				break;
+			default:
+				break;
 			}
 		}
 		return o;

+ 21 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/CmsFactory.java

@@ -0,0 +1,21 @@
+package com.x.processplatform.assemble.surface.factory.cms;
+
+import com.x.processplatform.assemble.surface.AbstractFactory;
+import com.x.processplatform.assemble.surface.Business;
+
+public class CmsFactory extends AbstractFactory {
+
+	public CmsFactory(Business abstractBusiness) throws Exception {
+		super(abstractBusiness);
+	}
+
+	private ScriptFactory script;
+
+	public ScriptFactory script() throws Exception {
+		if (null == this.script) {
+			this.script = new ScriptFactory(this.business());
+		}
+		return script;
+	}
+
+}

+ 17 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/ScriptFactory.java

@@ -0,0 +1,17 @@
+package com.x.processplatform.assemble.surface.factory.cms;
+
+import com.x.cms.core.entity.element.Script;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.assemble.surface.factory.element.ElementFactory;
+
+public class ScriptFactory extends ElementFactory {
+
+	public ScriptFactory(Business abstractBusiness) throws Exception {
+		super(abstractBusiness);
+	}
+
+	public Script pick(String flag) throws Exception {
+		return this.pick(flag, Script.class);
+	}
+
+}

+ 21 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/PortalFactory.java

@@ -0,0 +1,21 @@
+package com.x.processplatform.assemble.surface.factory.portal;
+
+import com.x.processplatform.assemble.surface.AbstractFactory;
+import com.x.processplatform.assemble.surface.Business;
+
+public class PortalFactory extends AbstractFactory {
+
+	public PortalFactory(Business abstractBusiness) throws Exception {
+		super(abstractBusiness);
+	}
+
+	private ScriptFactory script;
+
+	public ScriptFactory script() throws Exception {
+		if (null == this.script) {
+			this.script = new ScriptFactory(this.business());
+		}
+		return script;
+	}
+
+}

+ 17 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/ScriptFactory.java

@@ -0,0 +1,17 @@
+package com.x.processplatform.assemble.surface.factory.portal;
+
+import com.x.portal.core.entity.Script;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.assemble.surface.factory.element.ElementFactory;
+
+public class ScriptFactory extends ElementFactory {
+
+	public ScriptFactory(Business abstractBusiness) throws Exception {
+		super(abstractBusiness);
+	}
+
+	public Script pick(String flag) throws Exception {
+		return this.pick(flag, Script.class);
+	}
+
+}

+ 53 - 174
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompleted.java

@@ -1,7 +1,6 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.commons.lang3.StringUtils;
 
@@ -10,7 +9,6 @@ import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
 import com.x.base.core.project.exception.ExceptionEntityNotExist;
-import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Audit;
@@ -20,6 +18,7 @@ import com.x.base.core.project.tools.PropertyTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.element.Activity;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Script;
@@ -65,204 +64,84 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 		if (StringUtils.isNotEmpty(id)) {
 			Form form = business.form().pick(id);
 			if (null != form) {
-				wo.setForm(toWoForm(form));
+				wo.setForm(toWoFormDataOrMobileData(form));
 				related(business, wo, form);
 			}
 		}
 		return wo;
 	}
 
-	private void related(Business business, Wo wo, Form form) throws Exception {
-		if (StringUtils.isNotBlank(form.getData())) {
-			for (String relatedFormId : form.getRelatedFormList()) {
-				Form relatedForm = business.form().pick(relatedFormId);
-				if (null != relatedForm) {
-					wo.getRelatedFormMap().put(relatedFormId, toWoForm(relatedForm));
-				}
-			}
-		} else {
-			for (String relatedFormId : form.getMobileRelatedFormList()) {
-				Form relatedForm = business.form().pick(relatedFormId);
-				if (null != relatedForm) {
-					wo.getRelatedFormMap().put(relatedFormId, toWoMobileForm(relatedForm));
-				}
-			}
-		}
-		for (String relatedScriptId : form.getRelatedScriptList()) {
-			Script relatedScript = business.script().pick(relatedScriptId);
-			if (null != relatedScript) {
-				wo.getRelatedScriptMap().put(relatedScriptId, toWoScript(relatedScript));
-			}
-		}
-	}
-
 	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
 		Wo wo = new Wo();
 		// 先使用当前库的表单,如果不存在使用储存的表单.
 		if (StringUtils.isNotEmpty(workCompleted.getForm())) {
 			Form form = business.form().pick(workCompleted.getForm());
 			if (null != form) {
-				wo.setForm(toWoForm(form));
+				wo.setForm(toWoFormDataOrMobileData(form));
 				related(business, wo, form);
 			}
-		} else {
-			if (null != workCompleted.getProperties().getForm()) {
-				wo.form = toWoForm(workCompleted.getProperties().getForm());
-			}
+		} else if (null != workCompleted.getProperties().getForm()) {
+			wo.setForm(toWoFormDataOrMobileData(workCompleted.getProperties().getForm()));
 			if (StringUtils.isNotBlank(workCompleted.getProperties().getForm().getData())) {
-				for (Form f : workCompleted.getProperties().getRelatedFormList()) {
-					wo.getRelatedFormMap().put(f.getId(), toWoForm(f));
-				}
+				workCompleted.getProperties().getRelatedFormList()
+						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormDataOrMobileData(o)));
 			} else {
-				for (Form f : workCompleted.getProperties().getRelatedFormList()) {
-					wo.getRelatedFormMap().put(f.getId(), toWoMobileForm(f));
-				}
-			}
-			for (Script s : workCompleted.getProperties().getRelatedScriptList()) {
-				wo.getRelatedScriptMap().put(s.getId(), toWoScript(s));
+				workCompleted.getProperties().getMobileRelatedFormList()
+						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormMobileDataOrData(o)));
 			}
 		}
+		workCompleted.getProperties().getRelatedScriptList().stream()
+				.forEach(o -> wo.getRelatedScriptMap().put(o.getId(), toWoScript(o)));
 		return wo;
 	}
 
-	private WoForm toWoForm(Form form) {
-		WoForm wo = new WoForm();
-		wo.setId(form.getId());
-		wo.setName(form.getName());
-		wo.setAlias(form.getAlias());
-		wo.setData(form.getDataOrMobileData());
-		return wo;
-	}
-
-	private WoForm toWoMobileForm(Form form) {
-		WoForm wo = new WoForm();
-		wo.setId(form.getId());
-		wo.setName(form.getName());
-		wo.setAlias(form.getAlias());
-		wo.setData(form.getMobileDataOrData());
-		return wo;
-	}
-
-	private WoScript toWoScript(Script script) {
-		WoScript wo = new WoScript();
-		wo.setId(script.getId());
-		wo.setName(script.getName());
-		wo.setAlias(script.getAlias());
-		wo.setText(script.getText());
-		return wo;
-	}
-
-	public static class WoForm extends GsonPropertyObject {
-		private String id;
-		private String alias;
-		private String name;
-		private String data;
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getData() {
-			return data;
-		}
-
-		public void setData(String data) {
-			this.data = data;
+	private void related(Business business, Wo wo, Form form) throws Exception {
+		if (StringUtils.isNotBlank(form.getData())) {
+			for (String relatedFormId : form.getProperties().getRelatedFormList()) {
+				Form relatedForm = business.form().pick(relatedFormId);
+				if (null != relatedForm) {
+					wo.getRelatedFormMap().put(relatedFormId, toWoFormDataOrMobileData(relatedForm));
+				}
+			}
+		} else {
+			for (String mobileRelatedFormId : form.getProperties().getMobileRelatedFormList()) {
+				Form mobileRelatedForm = business.form().pick(mobileRelatedFormId);
+				if (null != mobileRelatedForm) {
+					wo.getRelatedFormMap().put(mobileRelatedFormId, toWoFormMobileDataOrData(mobileRelatedForm));
+				}
+			}
 		}
+		relatedScript(business, wo, form);
 	}
 
-	public static class WoScript extends GsonPropertyObject {
-
-		private String id;
-		private String alias;
-		private String name;
-		private String text;
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getText() {
-			return text;
-		}
-
-		public void setText(String text) {
-			this.text = text;
-		}
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
+	protected void relatedScript(Business business, AbstractWo wo, Form form) throws Exception {
+		for (Entry<String, String> entry : form.getProperties().getRelatedScriptMap().entrySet()) {
+			switch (entry.getValue()) {
+			case WorkCompletedProperties.Script.TYPE_PROCESSPLATFORM:
+				Script relatedScript = business.script().pick(entry.getKey());
+				if (null != relatedScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedScript));
+				}
+				break;
+			case WorkCompletedProperties.Script.TYPE_CMS:
+				com.x.cms.core.entity.element.Script relatedCmsScript = business.cms().script().pick(entry.getKey());
+				if (null != relatedCmsScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedCmsScript));
+				}
+				break;
+			case WorkCompletedProperties.Script.TYPE_PORTAL:
+				com.x.portal.core.entity.Script relatedPortalScript = business.portal().script().pick(entry.getKey());
+				if (null != relatedPortalScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedPortalScript));
+				}
+				break;
+			default:
+				break;
+			}
 		}
-
 	}
 
-	public static class Wo extends GsonPropertyObject {
-
-		private WoForm form;
-
-		private Map<String, WoForm> relatedFormMap = new HashMap<>();
-
-		private Map<String, WoScript> relatedScriptMap = new HashMap<>();
-
-		public WoForm getForm() {
-			return form;
-		}
-
-		public void setForm(WoForm form) {
-			this.form = form;
-		}
-
-		public Map<String, WoForm> getRelatedFormMap() {
-			return relatedFormMap;
-		}
-
-		public void setRelatedFormMap(Map<String, WoForm> relatedFormMap) {
-			this.relatedFormMap = relatedFormMap;
-		}
-
-		public Map<String, WoScript> getRelatedScriptMap() {
-			return relatedScriptMap;
-		}
-
-		public void setRelatedScriptMap(Map<String, WoScript> relatedScriptMap) {
-			this.relatedScriptMap = relatedScriptMap;
-		}
+	public static class Wo extends AbstractWo {
 
 	}
 

+ 53 - 174
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompletedMobile.java

@@ -1,7 +1,6 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.commons.lang3.StringUtils;
 
@@ -10,7 +9,6 @@ import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
 import com.x.base.core.project.exception.ExceptionEntityNotExist;
-import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Audit;
@@ -20,6 +18,7 @@ import com.x.base.core.project.tools.PropertyTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.element.Activity;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Script;
@@ -65,204 +64,84 @@ class ActionGetWithWorkOrWorkCompletedMobile extends BaseAction {
 		if (StringUtils.isNotEmpty(id)) {
 			Form form = business.form().pick(id);
 			if (null != form) {
-				wo.setForm(toWoMobileForm(form));
+				wo.setForm(toWoFormMobileDataOrData(form));
 				related(business, wo, form);
 			}
 		}
 		return wo;
 	}
 
-	private void related(Business business, Wo wo, Form form) throws Exception {
-		if (StringUtils.isNotBlank(form.getMobileData())) {
-			for (String relatedFormId : form.getMobileRelatedFormList()) {
-				Form relatedForm = business.form().pick(relatedFormId);
-				if (null != relatedForm) {
-					wo.getRelatedFormMap().put(relatedFormId, toWoMobileForm(relatedForm));
-				}
-			}
-		} else {
-			for (String relatedFormId : form.getRelatedFormList()) {
-				Form relatedForm = business.form().pick(relatedFormId);
-				if (null != relatedForm) {
-					wo.getRelatedFormMap().put(relatedFormId, toWoForm(relatedForm));
-				}
-			}
-		}
-		for (String relatedScriptId : form.getRelatedScriptList()) {
-			Script relatedScript = business.script().pick(relatedScriptId);
-			if (null != relatedScript) {
-				wo.getRelatedScriptMap().put(relatedScriptId, toWoScript(relatedScript));
-			}
-		}
-	}
-
 	private Wo workCompleted(Business business, WorkCompleted workCompleted) throws Exception {
 		Wo wo = new Wo();
 		// 先使用当前库的表单,如果不存在使用储存的表单.
 		if (StringUtils.isNotEmpty(workCompleted.getForm())) {
 			Form form = business.form().pick(workCompleted.getForm());
 			if (null != form) {
-				wo.setForm(toWoMobileForm(form));
+				wo.setForm(toWoFormMobileDataOrData(form));
 				related(business, wo, form);
 			}
-		} else {
-			if (null != workCompleted.getProperties().getForm()) {
-				wo.form = toWoMobileForm(workCompleted.getProperties().getForm());
-			}
+		} else if (null != workCompleted.getProperties().getForm()) {
+			wo.setForm(toWoFormMobileDataOrData(workCompleted.getProperties().getForm()));
 			if (StringUtils.isNotBlank(workCompleted.getProperties().getForm().getMobileData())) {
-				for (Form f : workCompleted.getProperties().getMobileRelatedFormList()) {
-					wo.getRelatedFormMap().put(f.getId(), toWoMobileForm(f));
-				}
+				workCompleted.getProperties().getMobileRelatedFormList()
+						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormMobileDataOrData(o)));
 			} else {
-				for (Form f : workCompleted.getProperties().getRelatedFormList()) {
-					wo.getRelatedFormMap().put(f.getId(), toWoForm(f));
-				}
-			}
-			for (Script s : workCompleted.getProperties().getRelatedScriptList()) {
-				wo.getRelatedScriptMap().put(s.getId(), toWoScript(s));
+				workCompleted.getProperties().getRelatedFormList()
+						.forEach(o -> wo.getRelatedFormMap().put(o.getId(), toWoFormDataOrMobileData(o)));
 			}
 		}
+		workCompleted.getProperties().getRelatedScriptList().stream()
+				.forEach(o -> wo.getRelatedScriptMap().put(o.getId(), toWoScript(o)));
 		return wo;
 	}
 
-	private WoForm toWoForm(Form form) {
-		WoForm wo = new WoForm();
-		wo.setId(form.getId());
-		wo.setName(form.getName());
-		wo.setAlias(form.getAlias());
-		wo.setData(form.getDataOrMobileData());
-		return wo;
-	}
-
-	private WoForm toWoMobileForm(Form form) {
-		WoForm wo = new WoForm();
-		wo.setId(form.getId());
-		wo.setName(form.getName());
-		wo.setAlias(form.getAlias());
-		wo.setData(form.getMobileDataOrData());
-		return wo;
-	}
-
-	private WoScript toWoScript(Script script) {
-		WoScript wo = new WoScript();
-		wo.setId(script.getId());
-		wo.setName(script.getName());
-		wo.setAlias(script.getAlias());
-		wo.setText(script.getText());
-		return wo;
-	}
-
-	public static class WoForm extends GsonPropertyObject {
-		private String id;
-		private String alias;
-		private String name;
-		private String data;
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getData() {
-			return data;
-		}
-
-		public void setData(String data) {
-			this.data = data;
+	private void related(Business business, Wo wo, Form form) throws Exception {
+		if (StringUtils.isNotBlank(form.getMobileData())) {
+			for (String mobileRelatedFormId : form.getProperties().getMobileRelatedFormList()) {
+				Form relatedForm = business.form().pick(mobileRelatedFormId);
+				if (null != relatedForm) {
+					wo.getRelatedFormMap().put(mobileRelatedFormId, toWoFormMobileDataOrData(relatedForm));
+				}
+			}
+		} else {
+			for (String relatedFormId : form.getProperties().getRelatedFormList()) {
+				Form relatedForm = business.form().pick(relatedFormId);
+				if (null != relatedForm) {
+					wo.getRelatedFormMap().put(relatedFormId, toWoFormDataOrMobileData(relatedForm));
+				}
+			}
 		}
+		relatedScript(business, wo, form);
 	}
 
-	public static class WoScript extends GsonPropertyObject {
-
-		private String id;
-		private String alias;
-		private String name;
-		private String text;
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getText() {
-			return text;
-		}
-
-		public void setText(String text) {
-			this.text = text;
-		}
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
+	protected void relatedScript(Business business, AbstractWo wo, Form form) throws Exception {
+		for (Entry<String, String> entry : form.getProperties().getMobileRelatedScriptMap().entrySet()) {
+			switch (entry.getValue()) {
+			case WorkCompletedProperties.Script.TYPE_PROCESSPLATFORM:
+				Script relatedScript = business.script().pick(entry.getKey());
+				if (null != relatedScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedScript));
+				}
+				break;
+			case WorkCompletedProperties.Script.TYPE_CMS:
+				com.x.cms.core.entity.element.Script relatedCmsScript = business.cms().script().pick(entry.getKey());
+				if (null != relatedCmsScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedCmsScript));
+				}
+				break;
+			case WorkCompletedProperties.Script.TYPE_PORTAL:
+				com.x.portal.core.entity.Script relatedPortalScript = business.portal().script().pick(entry.getKey());
+				if (null != relatedPortalScript) {
+					wo.getRelatedScriptMap().put(entry.getKey(), toWoScript(relatedPortalScript));
+				}
+				break;
+			default:
+				break;
+			}
 		}
-
 	}
 
-	public static class Wo extends GsonPropertyObject {
-
-		private WoForm form;
-
-		private Map<String, WoForm> relatedFormMap = new HashMap<>();
-
-		private Map<String, WoScript> relatedScriptMap = new HashMap<>();
-
-		public WoForm getForm() {
-			return form;
-		}
-
-		public void setForm(WoForm form) {
-			this.form = form;
-		}
-
-		public Map<String, WoForm> getRelatedFormMap() {
-			return relatedFormMap;
-		}
-
-		public void setRelatedFormMap(Map<String, WoForm> relatedFormMap) {
-			this.relatedFormMap = relatedFormMap;
-		}
-
-		public Map<String, WoScript> getRelatedScriptMap() {
-			return relatedScriptMap;
-		}
-
-		public void setRelatedScriptMap(Map<String, WoScript> relatedScriptMap) {
-			this.relatedScriptMap = relatedScriptMap;
-		}
+	public static class Wo extends AbstractWo {
 
 	}
 

+ 215 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java

@@ -1,9 +1,223 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
+import com.x.processplatform.core.entity.element.Form;
+import com.x.processplatform.core.entity.element.Script;
+
+import net.sf.ehcache.Ehcache;
 
 abstract class BaseAction extends StandardJaxrsAction {
 
-	 
+	protected static Ehcache CACHE = ApplicationCache.instance().getCache(Form.class, Script.class,
+			com.x.portal.core.entity.Script.class, com.x.cms.core.entity.element.Script.class);
+
+	protected WoForm toWoFormDataOrMobileData(Form form) {
+		WoForm wo = new WoForm();
+		wo.setId(form.getId());
+		wo.setName(form.getName());
+		wo.setAlias(form.getAlias());
+		wo.setCategory(form.getCategory());
+		wo.setApplication(form.getApplication());
+		wo.setHasMobile(form.getHasMobile());
+		wo.setData(form.getDataOrMobileData());
+		return wo;
+	}
+
+	protected WoForm toWoFormMobileDataOrData(Form form) {
+		WoForm wo = new WoForm();
+		wo.setId(form.getId());
+		wo.setName(form.getName());
+		wo.setAlias(form.getAlias());
+		wo.setCategory(form.getCategory());
+		wo.setApplication(form.getApplication());
+		wo.setHasMobile(form.getHasMobile());
+		wo.setData(form.getMobileDataOrData());
+		return wo;
+	}
+
+	protected WoScript toWoScript(Script script) {
+		WoScript wo = new WoScript();
+		wo.setId(script.getId());
+		wo.setName(script.getName());
+		wo.setAlias(script.getAlias());
+		wo.setText(script.getText());
+		return wo;
+	}
+
+	protected WoScript toWoScript(com.x.cms.core.entity.element.Script script) {
+		WoScript wo = new WoScript();
+		wo.setId(script.getId());
+		wo.setName(script.getName());
+		wo.setAlias(script.getAlias());
+		wo.setText(script.getText());
+		return wo;
+	}
+
+	protected WoScript toWoScript(com.x.portal.core.entity.Script script) {
+		WoScript wo = new WoScript();
+		wo.setId(script.getId());
+		wo.setName(script.getName());
+		wo.setAlias(script.getAlias());
+		wo.setText(script.getText());
+		return wo;
+	}
+
+	protected WoScript toWoScript(WorkCompletedProperties.Script script) {
+		WoScript wo = new WoScript();
+		wo.setId(script.getId());
+		wo.setName(script.getName());
+		wo.setAlias(script.getAlias());
+		wo.setText(script.getText());
+		return wo;
+	}
+
+	public static class WoForm extends GsonPropertyObject {
+		private String id;
+		private String alias;
+		private String name;
+		private String data;
+		private String category;
+		private String application;
+		private Boolean hasMobile;
+
+		public String getCategory() {
+			return category;
+		}
+
+		public void setCategory(String category) {
+			this.category = category;
+		}
+
+		public String getApplication() {
+			return application;
+		}
+
+		public void setApplication(String application) {
+			this.application = application;
+		}
+
+		public Boolean getHasMobile() {
+			return hasMobile;
+		}
+
+		public void setHasMobile(Boolean hasMobile) {
+			this.hasMobile = hasMobile;
+		}
+
+		public String getAlias() {
+			return alias;
+		}
+
+		public void setAlias(String alias) {
+			this.alias = alias;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+		public String getId() {
+			return id;
+		}
+
+		public void setId(String id) {
+			this.id = id;
+		}
+
+		public String getData() {
+			return data;
+		}
+
+		public void setData(String data) {
+			this.data = data;
+		}
+	}
+
+	public static class WoScript extends GsonPropertyObject {
+
+		private String id;
+		private String alias;
+		private String name;
+		private String text;
+
+		public String getId() {
+			return id;
+		}
+
+		public void setId(String id) {
+			this.id = id;
+		}
+
+		public String getText() {
+			return text;
+		}
+
+		public void setText(String text) {
+			this.text = text;
+		}
+
+		public String getAlias() {
+			return alias;
+		}
+
+		public void setAlias(String alias) {
+			this.alias = alias;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+	}
+
+	public static class AbstractWo extends GsonPropertyObject {
+
+		private WoForm form;
+
+		private Map<String, WoForm> relatedFormMap = new HashMap<>();
+
+		private Map<String, WoScript> relatedScriptMap = new HashMap<>();
+
+		public WoForm getForm() {
+			return form;
+		}
+
+		public void setForm(WoForm form) {
+			this.form = form;
+		}
+
+		public Map<String, WoForm> getRelatedFormMap() {
+			return relatedFormMap;
+		}
+
+		public void setRelatedFormMap(Map<String, WoForm> relatedFormMap) {
+			this.relatedFormMap = relatedFormMap;
+		}
+
+		public Map<String, WoScript> getRelatedScriptMap() {
+			return relatedScriptMap;
+		}
+
+		public void setRelatedScriptMap(Map<String, WoScript> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+	}
 
 }

+ 58 - 1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java

@@ -6,7 +6,6 @@ import java.util.List;
 import com.x.base.core.entity.JsonProperties;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.processplatform.core.entity.element.Form;
-import com.x.processplatform.core.entity.element.Script;
 
 public class WorkCompletedProperties extends JsonProperties {
 
@@ -109,4 +108,62 @@ public class WorkCompletedProperties extends JsonProperties {
 		this.mobileRelatedScriptList = mobileRelatedScriptList;
 	}
 
+	public static class Script {
+
+		public static final String TYPE_PROCESSPLATFORM = "processPlatform";
+		public static final String TYPE_CMS = "cms";
+		public static final String TYPE_PORTAL = "portal";
+
+		private String id;
+
+		private String alias;
+
+		private String name;
+
+		private String type;
+
+		private String text;
+
+		public String getId() {
+			return id;
+		}
+
+		public void setId(String id) {
+			this.id = id;
+		}
+
+		public String getAlias() {
+			return alias;
+		}
+
+		public void setAlias(String alias) {
+			this.alias = alias;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+		public String getType() {
+			return type;
+		}
+
+		public void setType(String type) {
+			this.type = type;
+		}
+
+		public String getText() {
+			return text;
+		}
+
+		public void setText(String text) {
+			this.text = text;
+		}
+
+	}
+
 }

+ 26 - 84
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Form.java

@@ -1,7 +1,6 @@
 package com.x.processplatform.core.entity.element;
 
 import java.util.Date;
-import java.util.List;
 import java.util.Objects;
 
 import javax.persistence.Basic;
@@ -12,16 +11,13 @@ import javax.persistence.Id;
 import javax.persistence.Inheritance;
 import javax.persistence.InheritanceType;
 import javax.persistence.Lob;
-import javax.persistence.OrderColumn;
 import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.openjpa.persistence.PersistentCollection;
-import org.apache.openjpa.persistence.jdbc.ContainerTable;
-import org.apache.openjpa.persistence.jdbc.ElementColumn;
-import org.apache.openjpa.persistence.jdbc.ElementIndex;
+import org.apache.openjpa.persistence.Persistent;
 import org.apache.openjpa.persistence.jdbc.Index;
+import org.apache.openjpa.persistence.jdbc.Strategy;
 
 import com.x.base.core.entity.AbstractPersistenceProperties;
 import com.x.base.core.entity.JpaObject;
@@ -98,6 +94,17 @@ public class Form extends SliceJpaObject {
 		// nothing
 	}
 
+	public Form() {
+		this.properties = new FormProperties();
+	}
+
+	public FormProperties getProperties() {
+		if (null == this.properties) {
+			this.properties = new FormProperties();
+		}
+		return this.properties;
+	}
+
 	public String getDataOrMobileData() {
 		if (StringUtils.isNotEmpty(this.getData())) {
 			return this.getData();
@@ -187,8 +194,8 @@ public class Form extends SliceJpaObject {
 	public static final String data_FIELDNAME = "data";
 	@FieldDescribe("文本内容.")
 	@Lob
-	@Basic(fetch = FetchType.EAGER)
-	// @Persistent(fetch = FetchType.EAGER)
+@Basic(fetch = FetchType.EAGER)
+//	@Persistent(fetch = FetchType.EAGER)
 	@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + data_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String data;
@@ -196,7 +203,8 @@ public class Form extends SliceJpaObject {
 	public static final String mobileData_FIELDNAME = "mobileData";
 	@FieldDescribe("移动端文本内容.")
 	@Lob
-	@Basic(fetch = FetchType.EAGER)
+	 @Basic(fetch = FetchType.EAGER)
+	//@Persistent(fetch = FetchType.EAGER)
 	@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + mobileData_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
 	private String mobileData;
@@ -206,68 +214,14 @@ public class Form extends SliceJpaObject {
 	@Column(name = ColumnNamePrefix + hasMobile_FIELDNAME)
 	private Boolean hasMobile;
 
-	public static final String relatedFormList_FIELDNAME = "relatedFormList";
-	@FieldDescribe("related form.")
-	@PersistentCollection(fetch = FetchType.EAGER)
-	@ContainerTable(name = TABLE + ContainerTableNameMiddle + relatedFormList_FIELDNAME, joinIndex = @Index(name = TABLE
-			+ IndexNameMiddle + relatedFormList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name = ORDERCOLUMNCOLUMN)
-	@ElementColumn(length = length_255B, name = ColumnNamePrefix + relatedFormList_FIELDNAME)
-	@ElementIndex(name = TABLE + IndexNameMiddle + relatedFormList_FIELDNAME + ElementIndexNameSuffix)
-	@CheckPersist(allowEmpty = true)
-	private List<String> relatedFormList;
-
-	public static final String relatedScriptList_FIELDNAME = "relatedScriptList";
-	@FieldDescribe("related form.")
-	@PersistentCollection(fetch = FetchType.EAGER)
-	@ContainerTable(name = TABLE + ContainerTableNameMiddle
-			+ relatedScriptList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
-					+ relatedScriptList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name = ORDERCOLUMNCOLUMN)
-	@ElementColumn(length = length_255B, name = ColumnNamePrefix + relatedScriptList_FIELDNAME)
-	@ElementIndex(name = TABLE + IndexNameMiddle + relatedScriptList_FIELDNAME + ElementIndexNameSuffix)
-	@CheckPersist(allowEmpty = true)
-	private List<String> relatedScriptList;
-
-	public static final String mobileRelatedFormList_FIELDNAME = "mobileRelatedFormList";
-	@FieldDescribe("关联移动表单.")
-	@PersistentCollection(fetch = FetchType.EAGER)
-	@ContainerTable(name = TABLE + ContainerTableNameMiddle
-			+ mobileRelatedFormList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
-					+ mobileRelatedFormList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name = ORDERCOLUMNCOLUMN)
-	@ElementColumn(length = length_255B, name = ColumnNamePrefix + mobileRelatedFormList_FIELDNAME)
-	@ElementIndex(name = TABLE + IndexNameMiddle + mobileRelatedFormList_FIELDNAME + ElementIndexNameSuffix)
+	public static final String properties_FIELDNAME = "properties";
+	// @Basic(fetch = FetchType.EAGER)
+	@FieldDescribe("属性对象存储字段.")
+	@Persistent(fetch = FetchType.EAGER)
+	@Strategy(JsonPropertiesValueHandler)
+	@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + properties_FIELDNAME)
 	@CheckPersist(allowEmpty = true)
-	private List<String> mobileRelatedFormList;
-
-	public static final String mobileRelatedScriptList_FIELDNAME = "mobileRelatedScriptList";
-	@FieldDescribe("关联移动脚本.")
-	@PersistentCollection(fetch = FetchType.EAGER)
-	@ContainerTable(name = TABLE + ContainerTableNameMiddle
-			+ mobileRelatedScriptList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
-					+ mobileRelatedScriptList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name = ORDERCOLUMNCOLUMN)
-	@ElementColumn(length = length_255B, name = ColumnNamePrefix + mobileRelatedScriptList_FIELDNAME)
-	@ElementIndex(name = TABLE + IndexNameMiddle + mobileRelatedScriptList_FIELDNAME + ElementIndexNameSuffix)
-	@CheckPersist(allowEmpty = true)
-	private List<String> mobileRelatedScriptList;
-
-	public List<String> getMobileRelatedFormList() {
-		return mobileRelatedFormList;
-	}
-
-	public void setMobileRelatedFormList(List<String> mobileRelatedFormList) {
-		this.mobileRelatedFormList = mobileRelatedFormList;
-	}
-
-	public List<String> getMobileRelatedScriptList() {
-		return mobileRelatedScriptList;
-	}
-
-	public void setMobileRelatedScriptList(List<String> mobileRelatedScriptList) {
-		this.mobileRelatedScriptList = mobileRelatedScriptList;
-	}
+	private FormProperties properties;
 
 	public void setCategory(String category) {
 		this.category = category;
@@ -353,20 +307,8 @@ public class Form extends SliceJpaObject {
 		this.hasMobile = hasMobile;
 	}
 
-	public List<String> getRelatedFormList() {
-		return relatedFormList;
-	}
-
-	public void setRelatedFormList(List<String> relatedFormList) {
-		this.relatedFormList = relatedFormList;
-	}
-
-	public List<String> getRelatedScriptList() {
-		return relatedScriptList;
-	}
-
-	public void setRelatedScriptList(List<String> relatedScriptList) {
-		this.relatedScriptList = relatedScriptList;
+	public void setProperties(FormProperties properties) {
+		this.properties = properties;
 	}
 
 }

+ 57 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/FormProperties.java

@@ -0,0 +1,57 @@
+package com.x.processplatform.core.entity.element;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.x.base.core.entity.JsonProperties;
+import com.x.base.core.project.annotation.FieldDescribe;
+
+public class FormProperties extends JsonProperties {
+
+	@FieldDescribe("关联表单.")
+	private List<String> relatedFormList = new ArrayList<>();
+
+	@FieldDescribe("移动端关联表单.")
+	private List<String> mobileRelatedFormList = new ArrayList<>();
+
+	@FieldDescribe("关联脚本.")
+	private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+	@FieldDescribe("移动端关联脚本.")
+	private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
+	public List<String> getRelatedFormList() {
+		return this.relatedFormList == null ? new ArrayList<>() : this.relatedFormList;
+	}
+
+	public List<String> getMobileRelatedFormList() {
+		return this.mobileRelatedFormList == null ? new ArrayList<>() : this.mobileRelatedFormList;
+	}
+
+	public Map<String, String> getRelatedScriptMap() {
+		return this.relatedScriptMap == null ? new LinkedHashMap<>() : this.relatedScriptMap;
+	}
+
+	public Map<String, String> getMobileRelatedScriptMap() {
+		return this.mobileRelatedScriptMap == null ? new LinkedHashMap<>() : this.mobileRelatedScriptMap;
+	}
+
+	public void setRelatedFormList(List<String> relatedFormList) {
+		this.relatedFormList = relatedFormList;
+	}
+
+	public void setMobileRelatedFormList(List<String> mobileRelatedFormList) {
+		this.mobileRelatedFormList = mobileRelatedFormList;
+	}
+
+	public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+		this.relatedScriptMap = relatedScriptMap;
+	}
+
+	public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+		this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+	}
+
+}