Browse Source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2155
胡起 5 years ago
parent
commit
709239f2dd
28 changed files with 1397 additions and 26 deletions
  1. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_portal_assemble_designer.java
  2. 4 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_portal_assemble_surface.java
  3. 54 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionCreate.java
  4. 54 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionEdit.java
  5. 8 0
      o2server/x_portal_assemble_surface/pom.xml
  6. 20 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/Business.java
  7. 73 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/ElementFactory.java
  8. 21 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/cms/CmsFactory.java
  9. 17 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/cms/ScriptFactory.java
  10. 21 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/process/ProcessFactory.java
  11. 17 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/process/ScriptFactory.java
  12. 264 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
  13. 74 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/PageAction.java
  14. 133 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2Get.java
  15. 133 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetMobile.java
  16. 149 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetWithPortal.java
  17. 149 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetWithPortalMobile.java
  18. 26 0
      o2server/x_portal_core_entity/src/main/java/com/x/portal/core/entity/Page.java
  19. 57 0
      o2server/x_portal_core_entity/src/main/java/com/x/portal/core/entity/PageProperties.java
  20. 44 3
      o2web/source/o2_core/o2/xAction/services/x_portal_assemble_designer.js
  21. 8 1
      o2web/source/o2_core/o2/xAction/services/x_portal_assemble_surface.json
  22. 11 4
      o2web/source/o2_core/o2/xDesktop/Default.js
  23. 1 1
      o2web/source/o2_core/o2/xDesktop/shortcut.js
  24. 15 0
      o2web/source/x_component_portal_PageDesigner/Main.js
  25. 12 1
      o2web/source/x_component_portal_PageDesigner/Module/Page/page.html
  26. 15 3
      o2web/source/x_component_portal_Portal/Main.js
  27. 0 4
      o2web/source/x_component_process_Work/Main.js
  28. 14 5
      o2web/source/x_component_process_Xform/Widget.js

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

@@ -7,7 +7,8 @@ import com.x.base.core.project.annotation.ModuleType;
 @Module(type = ModuleType.ASSEMBLE, category = ModuleCategory.OFFICIAL, name = "门户设计", packageName = "com.x.portal.assemble.designer", containerEntities = {
 		"com.x.portal.core.entity.Portal", "com.x.portal.core.entity.Widget", "com.x.portal.core.entity.Page",
 		"com.x.portal.core.entity.Script", "com.x.portal.core.entity.File",
-		"com.x.portal.core.entity.TemplatePage" }, storeJars = { "x_organization_core_entity",
-				"x_organization_core_express", "x_portal_core_entity" })
+		"com.x.portal.core.entity.TemplatePage", "com.x.cms.core.entity.element.Script",
+		"com.x.processplatform.core.entity.element.Script" }, storeJars = { "x_organization_core_entity",
+				"x_organization_core_express", "x_portal_core_entity", "x_cms_core_entity", "x_processplatform_core_entity" })
 public class x_portal_assemble_designer extends Deployable {
 }

+ 4 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_portal_assemble_surface.java

@@ -6,7 +6,9 @@ import com.x.base.core.project.annotation.ModuleType;
 
 @Module(type = ModuleType.ASSEMBLE, category = ModuleCategory.OFFICIAL, name = "门户", packageName = "com.x.portal.assemble.surface", containerEntities = {
 		"com.x.portal.core.entity.Portal", "com.x.portal.core.entity.Widget", "com.x.portal.core.entity.Page",
-		"com.x.portal.core.entity.Script", "com.x.portal.core.entity.File" }, storeJars = {
-				"x_organization_core_entity", "x_organization_core_express", "x_portal_core_entity" })
+		"com.x.portal.core.entity.Script", "com.x.portal.core.entity.File", "com.x.cms.core.entity.element.Script",
+		"com.x.processplatform.core.entity.element.Script" }, storeJars = {
+		"x_organization_core_entity", "x_organization_core_express", "x_portal_core_entity", "x_cms_core_entity",
+		"x_processplatform_core_entity" })
 public class x_portal_assemble_surface extends Deployable {
 }

+ 54 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionCreate.java

@@ -1,5 +1,6 @@
 package com.x.portal.assemble.designer.jaxrs.page;
 
+import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.cache.CacheManager;
 import org.apache.commons.lang3.StringUtils;
 
@@ -17,6 +18,11 @@ import com.x.portal.assemble.designer.Business;
 import com.x.portal.core.entity.Page;
 import com.x.portal.core.entity.Portal;
 
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
 class ActionCreate extends BaseAction {
 
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
@@ -32,6 +38,10 @@ class ActionCreate extends BaseAction {
 			Page page = Wi.copier.copy(wi);
 			this.checkName(business, page);
 			this.checkAlias(business, page);
+			page.getProperties().setRelatedWidgetList(wi.getRelatedWidgetList());
+			page.getProperties().setMobileRelatedWidgetList(wi.getMobileRelatedWidgetList());
+			page.getProperties().setRelatedScriptMap(wi.getRelatedScriptMap());
+			page.getProperties().setMobileRelatedScriptMap(wi.getMobileRelatedScriptMap());
 			emc.persist(page, CheckPersistType.all);
 			/** 更新首页 */
 			if (this.isBecomeFirstPage(business, portal, page)) {
@@ -59,6 +69,50 @@ class ActionCreate extends BaseAction {
 
 		static WrapCopier<Wi, Page> copier = WrapCopierFactory.wi(Wi.class, Page.class, null,
 				JpaObject.FieldsUnmodifyExcludeId);
+
+		@FieldDescribe("关联Widget.")
+		private List<String> relatedWidgetList = new ArrayList<>();
+
+		@FieldDescribe("移动端关联Widget.")
+		private List<String> mobileRelatedWidgetList = new ArrayList<>();
+
+		@FieldDescribe("关联脚本.")
+		private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+		@FieldDescribe("移动端关联脚本.")
+		private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
+		public List<String> getRelatedWidgetList() {
+			return this.relatedWidgetList == null ? new ArrayList<>() : this.relatedWidgetList;
+		}
+
+		public List<String> getMobileRelatedWidgetList() {
+			return this.mobileRelatedWidgetList == null ? new ArrayList<>() : this.mobileRelatedWidgetList;
+		}
+
+		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 setRelatedWidgetList(List<String> relatedWidgetList) {
+			this.relatedWidgetList = relatedWidgetList;
+		}
+
+		public void setMobileRelatedWidgetList(List<String> mobileRelatedWidgetList) {
+			this.mobileRelatedWidgetList = mobileRelatedWidgetList;
+		}
+
+		public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+		public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+			this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+		}
 	}
 
 	public static class Wo extends WoId {

+ 54 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionEdit.java

@@ -1,5 +1,6 @@
 package com.x.portal.assemble.designer.jaxrs.page;
 
+import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.cache.CacheManager;
 import org.apache.commons.lang3.StringUtils;
 
@@ -17,6 +18,11 @@ import com.x.portal.assemble.designer.Business;
 import com.x.portal.core.entity.Page;
 import com.x.portal.core.entity.Portal;
 
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
 class ActionEdit extends BaseAction {
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
@@ -38,6 +44,10 @@ class ActionEdit extends BaseAction {
 			Wi.copier.copy(wi, page);
 			this.checkName(business, page);
 			this.checkAlias(business, page);
+			page.getProperties().setRelatedWidgetList(wi.getRelatedWidgetList());
+			page.getProperties().setMobileRelatedWidgetList(wi.getMobileRelatedWidgetList());
+			page.getProperties().setRelatedScriptMap(wi.getRelatedScriptMap());
+			page.getProperties().setMobileRelatedScriptMap(wi.getMobileRelatedScriptMap());
 			emc.check(page, CheckPersistType.all);
 			/** 更新首页 */
 			if (this.isBecomeFirstPage(business, portal, page)) {
@@ -64,6 +74,50 @@ class ActionEdit extends BaseAction {
 		private static final long serialVersionUID = 6624639107781167248L;
 
 		static WrapCopier<Wi, Page> copier = WrapCopierFactory.wi(Wi.class, Page.class, null, JpaObject.FieldsUnmodify);
+
+		@FieldDescribe("关联Widget.")
+		private List<String> relatedWidgetList = new ArrayList<>();
+
+		@FieldDescribe("移动端关联Widget.")
+		private List<String> mobileRelatedWidgetList = new ArrayList<>();
+
+		@FieldDescribe("关联脚本.")
+		private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+		@FieldDescribe("移动端关联脚本.")
+		private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
+		public List<String> getRelatedWidgetList() {
+			return this.relatedWidgetList == null ? new ArrayList<>() : this.relatedWidgetList;
+		}
+
+		public List<String> getMobileRelatedWidgetList() {
+			return this.mobileRelatedWidgetList == null ? new ArrayList<>() : this.mobileRelatedWidgetList;
+		}
+
+		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 setRelatedWidgetList(List<String> relatedWidgetList) {
+			this.relatedWidgetList = relatedWidgetList;
+		}
+
+		public void setMobileRelatedWidgetList(List<String> mobileRelatedWidgetList) {
+			this.mobileRelatedWidgetList = mobileRelatedWidgetList;
+		}
+
+		public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+		public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+			this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+		}
 	}
 
 	public static class Wo extends WoId {

+ 8 - 0
o2server/x_portal_assemble_surface/pom.xml

@@ -24,6 +24,14 @@
 			<groupId>o2oa</groupId>
 			<artifactId>x_organization_core_express</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_processplatform_core_entity</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>o2oa</groupId>
+			<artifactId>x_cms_core_entity</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>o2oa</groupId>
 			<artifactId>x_general_core_entity</artifactId>

+ 20 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/Business.java

@@ -7,6 +7,8 @@ import com.x.portal.assemble.surface.factory.PageFactory;
 import com.x.portal.assemble.surface.factory.PortalFactory;
 import com.x.portal.assemble.surface.factory.ScriptFactory;
 import com.x.portal.assemble.surface.factory.WidgetFactory;
+import com.x.portal.assemble.surface.factory.cms.CmsFactory;
+import com.x.portal.assemble.surface.factory.process.ProcessFactory;
 
 public class Business {
 
@@ -74,4 +76,22 @@ 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 ProcessFactory process;
+
+	public ProcessFactory process() throws Exception {
+		if (null == this.process) {
+			this.process = new ProcessFactory(this);
+		}
+		return process;
+	}
+
 }

+ 73 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/ElementFactory.java

@@ -0,0 +1,73 @@
+package com.x.portal.assemble.surface.factory;
+
+import com.x.base.core.entity.JpaObject;
+import com.x.base.core.project.cache.Cache.CacheCategory;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
+import com.x.portal.assemble.surface.AbstractFactory;
+import com.x.portal.assemble.surface.Business;
+import com.x.portal.core.entity.Page;
+import com.x.portal.core.entity.Portal;
+import net.sf.ehcache.Ehcache;
+import java.util.*;
+
+public abstract class ElementFactory extends AbstractFactory {
+
+	protected Ehcache cache;
+
+	public ElementFactory(Business abstractBusiness) throws Exception {
+		super(abstractBusiness);
+	}
+
+	@SuppressWarnings("unchecked")
+	protected <T extends JpaObject> T pick(String flag, Class<T> clz) throws Exception {
+		CacheCategory cacheCategory = new CacheCategory(clz);
+		CacheKey cacheKey = new CacheKey(flag);
+		T t = null;
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			t = (T) optional.get();
+		} else {
+			t = this.entityManagerContainer().flag(flag, clz);
+			if (t != null) {
+				this.entityManagerContainer().get(clz).detach(t);
+				CacheManager.put(cacheCategory, cacheKey, t);
+			}
+		}
+		return t;
+	}
+
+	protected <T extends JpaObject> List<T> pick(Collection<String> flags, Class<T> clz) throws Exception {
+		List<T> list = new ArrayList<>();
+		for (String str : flags) {
+			T t = pick(str, clz);
+			if (null != t) {
+				list.add(t);
+			}
+		}
+		return list;
+	}
+
+	@SuppressWarnings("unchecked")
+	protected <T extends JpaObject> T pick(Portal portal, String flag, Class<T> clz) throws Exception {
+		if (null == portal) {
+			return null;
+		}
+		CacheCategory cacheCategory = new CacheCategory(clz);
+		CacheKey cacheKey = new CacheKey(portal.getId(), flag);
+		T t = null;
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			t = (T) optional.get();
+		} else {
+			t = this.entityManagerContainer().restrictFlag(flag, clz, Page.portal_FIELDNAME,
+					portal.getId());
+			if (t != null) {
+				this.entityManagerContainer().get(clz).detach(t);
+				CacheManager.put(cacheCategory, cacheKey, t);
+			}
+		}
+		return t;
+	}
+
+}

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

@@ -0,0 +1,21 @@
+package com.x.portal.assemble.surface.factory.cms;
+
+import com.x.portal.assemble.surface.AbstractFactory;
+import com.x.portal.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_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/cms/ScriptFactory.java

@@ -0,0 +1,17 @@
+package com.x.portal.assemble.surface.factory.cms;
+
+import com.x.cms.core.entity.element.Script;
+import com.x.portal.assemble.surface.Business;
+import com.x.portal.assemble.surface.factory.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_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/process/ProcessFactory.java

@@ -0,0 +1,21 @@
+package com.x.portal.assemble.surface.factory.process;
+
+import com.x.portal.assemble.surface.AbstractFactory;
+import com.x.portal.assemble.surface.Business;
+
+public class ProcessFactory extends AbstractFactory {
+
+	public ProcessFactory(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_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/process/ScriptFactory.java

@@ -0,0 +1,17 @@
+package com.x.portal.assemble.surface.factory.process;
+
+import com.x.processplatform.core.entity.element.Script;
+import com.x.portal.assemble.surface.Business;
+import com.x.portal.assemble.surface.factory.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);
+	}
+
+}

+ 264 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java

@@ -1,5 +1,9 @@
 package com.x.portal.assemble.surface.jaxrs.page;
 
+import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
+import com.x.portal.core.entity.Script;
+import com.x.portal.core.entity.Widget;
 import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.project.config.Config;
@@ -7,6 +11,9 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
 import com.x.portal.core.entity.Page;
 import com.x.base.core.project.cache.Cache.CacheCategory;
 
+import java.util.HashMap;
+import java.util.Map;
+
 abstract class BaseAction extends StandardJaxrsAction {
 
 	CacheCategory pageCache = new CacheCategory(Page.class);
@@ -16,4 +23,261 @@ abstract class BaseAction extends StandardJaxrsAction {
 				&& StringUtils.equals(id, Config.portal().getIndexPage().getPage()));
 	}
 
+	CacheCategory cacheCategory = new CacheCategory(Page.class, Widget.class, Script.class, com.x.processplatform.core.entity.element.Script.class,
+			com.x.cms.core.entity.element.Script.class);
+
+	public static class AbstractWo extends WoMaxAgeFastETag {
+
+		private static final long serialVersionUID = -246989645483328034L;
+
+		private RelatedPage page;
+
+		private Map<String, RelatedWidget> relatedWidgetMap = new HashMap<>();
+
+		private Map<String, RelatedScript> relatedScriptMap = new HashMap<>();
+
+		public RelatedPage getPage() {
+			return page;
+		}
+
+		public void setPage(RelatedPage page) {
+			this.page = page;
+		}
+
+		public Map<String, RelatedWidget> getRelatedWidgetMap() {
+			return relatedWidgetMap;
+		}
+
+		public void setRelatedWidgetMap(Map<String, RelatedWidget> relatedWidgetMap) {
+			this.relatedWidgetMap = relatedWidgetMap;
+		}
+
+		public Map<String, RelatedScript> getRelatedScriptMap() {
+			return relatedScriptMap;
+		}
+
+		public void setRelatedScriptMap(Map<String, RelatedScript> relatedScriptMap) {
+			this.relatedScriptMap = relatedScriptMap;
+		}
+
+	}
+
+	public static class RelatedPage extends GsonPropertyObject {
+
+		private static final long serialVersionUID = 7525243539062813646L;
+
+		public RelatedPage() {
+
+		}
+
+		public RelatedPage(Page page, String data) {
+			this.id = page.getId();
+			this.alias = page.getAlias();
+			this.name = page.getName();
+			this.portal = page.getPortal();
+			this.hasMobile = page.getHasMobile();
+			this.data = data;
+		}
+
+		private String id;
+		private String alias;
+		private String name;
+		private String portal;
+		private Boolean hasMobile;
+		private String data;
+
+		public String getPortal() {
+			return portal;
+		}
+
+		public void setPortal(String portal) {
+			this.portal = portal;
+		}
+
+		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 RelatedWidget extends GsonPropertyObject {
+
+		private static final long serialVersionUID = -6649777538891528958L;
+
+		public RelatedWidget() {
+
+		}
+
+		public RelatedWidget(Widget widget, String data) {
+			this.id = widget.getId();
+			this.alias = widget.getAlias();
+			this.name = widget.getName();
+			this.portal = widget.getPortal();
+			this.hasMobile = widget.getHasMobile();
+			this.data = data;
+		}
+
+		private String id;
+		private String alias;
+		private String name;
+		private String portal;
+		private Boolean hasMobile;
+		private String data;
+
+		public String getPortal() {
+			return portal;
+		}
+
+		public void setPortal(String portal) {
+			this.portal = portal;
+		}
+
+		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 RelatedScript extends GsonPropertyObject {
+
+		private static final long serialVersionUID = -4465416667636529080L;
+
+		public static final String TYPE_PROCESSPLATFORM = "processPlatform";
+		public static final String TYPE_CMS = "cms";
+		public static final String TYPE_PORTAL = "portal";
+
+		public RelatedScript() {
+
+		}
+
+		public RelatedScript(String id, String name, String alias, String text, String type) {
+			this.id = id;
+			this.alias = alias;
+			this.name = name;
+			this.text = text;
+			this.type = type;
+		}
+
+		private String type;
+
+		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 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;
+		}
+
+	}
+
 }

+ 74 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/PageAction.java

@@ -121,4 +121,78 @@ public class PageAction extends StandardJaxrsAction {
 		}
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
+
+	@JaxrsMethodDescribe(value = "获取Page.", action = V2Get.class)
+	@GET
+	@Path("v2/{id}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void V2Get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+					  @JaxrsParameterDescribe("标识") @PathParam("id") String id) {
+		ActionResult<V2Get.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new V2Get().execute(effectivePerson, id);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "获取PageMobile.", action = V2GetMobile.class)
+	@GET
+	@Path("v2/{id}/mobile")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void V2GetMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+							@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
+		ActionResult<V2GetMobile.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new V2GetMobile().execute(effectivePerson, id);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "列示属于指定Portal的Page,其中Portal可以用name,alias和id标识,Page为在此Portal下的页面.", action = V2GetWithPortal.class)
+	@GET
+	@Path("v2/{flag}/portal/{portalFlag}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void V2GetWithPortal(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+							  @JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
+							  @JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
+		ActionResult<V2GetWithPortal.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new V2GetWithPortal().execute(effectivePerson, flag, portalFlag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+	@JaxrsMethodDescribe(value = "列示属于指定Portal的Page,其中Portal可以用name,alias和id标识,Page为在此Portal下的页面Mobile.", action = V2GetWithPortalMobile.class)
+	@GET
+	@Path("v2/{flag}/portal/{portalFlag}/mobile")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void V2GetWithPortalMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+									@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
+									@JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
+		ActionResult<V2GetWithPortalMobile.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new V2GetWithPortalMobile().execute(effectivePerson, flag, portalFlag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
 }

+ 133 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2Get.java

@@ -0,0 +1,133 @@
+package com.x.portal.assemble.surface.jaxrs.page;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+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.portal.assemble.surface.Business;
+import com.x.portal.core.entity.Page;
+import com.x.portal.core.entity.PageProperties;
+import com.x.portal.core.entity.Script;
+import com.x.portal.core.entity.Widget;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+
+class V2Get extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(V2Get.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		CacheKey cacheKey = new CacheKey(this.getClass(), id);
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			result.setData((Wo) optional.get());
+		} else {
+			Wo wo = this.get(id);
+			CacheManager.put(cacheCategory, cacheKey, wo);
+			result.setData(wo);
+		}
+		return result;
+	}
+
+	private Wo get(String id) throws Exception {
+		Page page;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			page = business.page().pick(id);
+		}
+		if (null == page) {
+			throw new ExceptionEntityNotExist(id, Page.class);
+		}
+		Wo wo = new Wo();
+		final PageProperties properties = page.getProperties();
+		wo.setPage(new RelatedPage(page, page.getDataOrMobileData()));
+		final List<String> list = new CopyOnWriteArrayList<>();
+		CompletableFuture<Map<String, RelatedWidget>> _relatedWidget = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedWidget> map = new TreeMap<>();
+			if (ListTools.isNotEmpty(properties.getRelatedWidgetList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					Widget _f;
+					for (String _id : properties.getRelatedWidgetList()) {
+						_f = bus.widget().pick(_id);
+						if (null != _f) {
+							map.put(_id, new RelatedWidget(_f, _f.getDataOrMobileData()));
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedScript> map = new TreeMap<>();
+			if ((null != properties.getRelatedScriptMap())
+					&& (properties.getRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					for (Entry<String, String> entry : properties.getRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+							case RelatedScript.TYPE_PROCESSPLATFORM:
+								com.x.processplatform.core.entity.element.Script _pp = bus.process().script().pick(entry.getKey());
+								if (null != _pp) {
+									map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
+											_pp.getText(), entry.getValue()));
+									list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+								}
+								break;
+							case RelatedScript.TYPE_CMS:
+								com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
+								if (null != _cms) {
+									map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
+											_cms.getText(), entry.getValue()));
+									list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+								}
+								break;
+							case RelatedScript.TYPE_PORTAL:
+								Script _p = bus.script().pick(entry.getKey());
+								if (null != _p) {
+									map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
+											_p.getText(), entry.getValue()));
+									list.add(_p.getId() + _p.getUpdateTime().getTime());
+								}
+								break;
+							default:
+								break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		list.add(page.getId() + page.getUpdateTime().getTime());
+		List<String> sortList = list.stream().sorted().collect(Collectors.toList());
+		wo.setFastETag(StringUtils.join(sortList, "#"));
+		wo.setRelatedWidgetMap(_relatedWidget.get());
+		wo.setRelatedScriptMap(_relatedScript.get());
+		return wo;
+	}
+
+	public static class Wo extends AbstractWo {
+
+	}
+
+}

+ 133 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetMobile.java

@@ -0,0 +1,133 @@
+package com.x.portal.assemble.surface.jaxrs.page;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+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.portal.assemble.surface.Business;
+import com.x.portal.core.entity.Page;
+import com.x.portal.core.entity.PageProperties;
+import com.x.portal.core.entity.Script;
+import com.x.portal.core.entity.Widget;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+
+class V2GetMobile extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(V2GetMobile.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		CacheKey cacheKey = new CacheKey(this.getClass(), id);
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			result.setData((Wo) optional.get());
+		} else {
+			Wo wo = this.get(id);
+			CacheManager.put(cacheCategory, cacheKey, wo);
+			result.setData(wo);
+		}
+		return result;
+	}
+
+	private Wo get(String id) throws Exception {
+		Page page;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			page = business.page().pick(id);
+		}
+		if (null == page) {
+			throw new ExceptionEntityNotExist(id, Page.class);
+		}
+		Wo wo = new Wo();
+		final PageProperties properties = page.getProperties();
+		wo.setPage(new RelatedPage(page, page.getMobileDataOrData()));
+		final List<String> list = new CopyOnWriteArrayList<>();
+		CompletableFuture<Map<String, RelatedWidget>> _relatedWidget = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedWidget> map = new TreeMap<>();
+			if (ListTools.isNotEmpty(properties.getMobileRelatedWidgetList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					Widget _f;
+					for (String _id : properties.getMobileRelatedWidgetList()) {
+						_f = bus.widget().pick(_id);
+						if (null != _f) {
+							map.put(_id, new RelatedWidget(_f, _f.getMobileDataOrData()));
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedScript> map = new TreeMap<>();
+			if ((null != properties.getMobileRelatedScriptMap())
+					&& (properties.getMobileRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					for (Entry<String, String> entry : properties.getMobileRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+						case RelatedScript.TYPE_PROCESSPLATFORM:
+							com.x.processplatform.core.entity.element.Script _pp = bus.process().script().pick(entry.getKey());
+							if (null != _pp) {
+								map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
+										_pp.getText(), entry.getValue()));
+								list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+							}
+							break;
+						case RelatedScript.TYPE_CMS:
+							com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
+							if (null != _cms) {
+								map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
+										_cms.getText(), entry.getValue()));
+								list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+							}
+							break;
+						case RelatedScript.TYPE_PORTAL:
+							Script _p = bus.script().pick(entry.getKey());
+							if (null != _p) {
+								map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
+										_p.getText(), entry.getValue()));
+								list.add(_p.getId() + _p.getUpdateTime().getTime());
+							}
+							break;
+						default:
+							break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		list.add(page.getId() + page.getUpdateTime().getTime());
+		List<String> sortList = list.stream().sorted().collect(Collectors.toList());
+		wo.setFastETag(StringUtils.join(sortList, "#"));
+		wo.setRelatedWidgetMap(_relatedWidget.get());
+		wo.setRelatedScriptMap(_relatedScript.get());
+		return wo;
+	}
+
+	public static class Wo extends AbstractWo {
+
+	}
+
+}

+ 149 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetWithPortal.java

@@ -0,0 +1,149 @@
+package com.x.portal.assemble.surface.jaxrs.page;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+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.portal.assemble.surface.Business;
+import com.x.portal.core.entity.*;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+
+class V2GetWithPortal extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(V2GetWithPortal.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wo = null;
+		CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			wo = (Wo) optional.get();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				Portal portal = business.portal().pick(portalFlag);
+				if (null == portal) {
+					throw new ExceptionPortalNotExist(portalFlag);
+				}
+				if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
+					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
+							portal.getId());
+				}
+			}
+		} else {
+			wo = this.get(flag, portalFlag, effectivePerson);
+			CacheManager.put(cacheCategory, cacheKey, wo);
+		}
+		result.setData(wo);
+		return result;
+	}
+
+	private Wo get(String flag, String portalFlag, EffectivePerson effectivePerson) throws Exception {
+		Page page = null;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			Portal portal = business.portal().pick(portalFlag);
+			if (null == portal) {
+				throw new ExceptionPortalNotExist(portalFlag);
+			}
+			if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
+				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
+						portal.getId());
+			}
+			page = business.page().pick(portal, flag);
+			if (null == page) {
+				throw new ExceptionPageNotExist(flag);
+			}
+		}
+		Wo wo = new Wo();
+		final PageProperties properties = page.getProperties();
+		wo.setPage(new RelatedPage(page, page.getDataOrMobileData()));
+		final List<String> list = new CopyOnWriteArrayList<>();
+		CompletableFuture<Map<String, RelatedWidget>> _relatedWidget = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedWidget> map = new TreeMap<>();
+			if (ListTools.isNotEmpty(properties.getRelatedWidgetList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					Widget _f;
+					for (String _id : properties.getRelatedWidgetList()) {
+						_f = bus.widget().pick(_id);
+						if (null != _f) {
+							map.put(_id, new RelatedWidget(_f, _f.getDataOrMobileData()));
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedScript> map = new TreeMap<>();
+			if ((null != properties.getRelatedScriptMap())
+					&& (properties.getRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					for (Entry<String, String> entry : properties.getRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+							case RelatedScript.TYPE_PROCESSPLATFORM:
+								com.x.processplatform.core.entity.element.Script _pp = bus.process().script().pick(entry.getKey());
+								if (null != _pp) {
+									map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
+											_pp.getText(), entry.getValue()));
+									list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+								}
+								break;
+							case RelatedScript.TYPE_CMS:
+								com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
+								if (null != _cms) {
+									map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
+											_cms.getText(), entry.getValue()));
+									list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+								}
+								break;
+							case RelatedScript.TYPE_PORTAL:
+								Script _p = bus.script().pick(entry.getKey());
+								if (null != _p) {
+									map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
+											_p.getText(), entry.getValue()));
+									list.add(_p.getId() + _p.getUpdateTime().getTime());
+								}
+								break;
+							default:
+								break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		list.add(page.getId() + page.getUpdateTime().getTime());
+		List<String> sortList = list.stream().sorted().collect(Collectors.toList());
+		wo.setFastETag(StringUtils.join(sortList, "#"));
+		wo.setRelatedWidgetMap(_relatedWidget.get());
+		wo.setRelatedScriptMap(_relatedScript.get());
+		return wo;
+	}
+
+	public static class Wo extends AbstractWo {
+
+	}
+
+}

+ 149 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/V2GetWithPortalMobile.java

@@ -0,0 +1,149 @@
+package com.x.portal.assemble.surface.jaxrs.page;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.cache.Cache.CacheKey;
+import com.x.base.core.project.cache.CacheManager;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+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.portal.assemble.surface.Business;
+import com.x.portal.core.entity.*;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+
+class V2GetWithPortalMobile extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(V2GetWithPortalMobile.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wo = null;
+		CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
+		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+		if (optional.isPresent()) {
+			wo = (Wo) optional.get();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				Portal portal = business.portal().pick(portalFlag);
+				if (null == portal) {
+					throw new ExceptionPortalNotExist(portalFlag);
+				}
+				if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
+					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
+							portal.getId());
+				}
+			}
+		} else {
+			wo = this.get(flag, portalFlag, effectivePerson);
+			CacheManager.put(cacheCategory, cacheKey, wo);
+		}
+		result.setData(wo);
+		return result;
+	}
+
+	private Wo get(String flag, String portalFlag, EffectivePerson effectivePerson) throws Exception {
+		Page page;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			Portal portal = business.portal().pick(portalFlag);
+			if (null == portal) {
+				throw new ExceptionPortalNotExist(portalFlag);
+			}
+			if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
+				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
+						portal.getId());
+			}
+			page = business.page().pick(portal, flag);
+			if (null == page) {
+				throw new ExceptionPageNotExist(flag);
+			}
+		}
+		Wo wo = new Wo();
+		final PageProperties properties = page.getProperties();
+		wo.setPage(new RelatedPage(page, page.getMobileDataOrData()));
+		final List<String> list = new CopyOnWriteArrayList<>();
+		CompletableFuture<Map<String, RelatedWidget>> _relatedWidget = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedWidget> map = new TreeMap<>();
+			if (ListTools.isNotEmpty(properties.getMobileRelatedWidgetList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					Widget _f;
+					for (String _id : properties.getMobileRelatedWidgetList()) {
+						_f = bus.widget().pick(_id);
+						if (null != _f) {
+							map.put(_id, new RelatedWidget(_f, _f.getMobileDataOrData()));
+							list.add(_f.getId() + _f.getUpdateTime().getTime());
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+			Map<String, RelatedScript> map = new TreeMap<>();
+			if ((null != properties.getMobileRelatedScriptMap())
+					&& (properties.getMobileRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business bus = new Business(emc);
+					for (Entry<String, String> entry : properties.getMobileRelatedScriptMap().entrySet()) {
+						switch (entry.getValue()) {
+						case RelatedScript.TYPE_PROCESSPLATFORM:
+							com.x.processplatform.core.entity.element.Script _pp = bus.process().script().pick(entry.getKey());
+							if (null != _pp) {
+								map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
+										_pp.getText(), entry.getValue()));
+								list.add(_pp.getId() + _pp.getUpdateTime().getTime());
+							}
+							break;
+						case RelatedScript.TYPE_CMS:
+							com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
+							if (null != _cms) {
+								map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
+										_cms.getText(), entry.getValue()));
+								list.add(_cms.getId() + _cms.getUpdateTime().getTime());
+							}
+							break;
+						case RelatedScript.TYPE_PORTAL:
+							Script _p = bus.script().pick(entry.getKey());
+							if (null != _p) {
+								map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
+										_p.getText(), entry.getValue()));
+								list.add(_p.getId() + _p.getUpdateTime().getTime());
+							}
+							break;
+						default:
+							break;
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return map;
+		});
+		list.add(page.getId() + page.getUpdateTime().getTime());
+		List<String> sortList = list.stream().sorted().collect(Collectors.toList());
+		wo.setFastETag(StringUtils.join(sortList, "#"));
+		wo.setRelatedWidgetMap(_relatedWidget.get());
+		wo.setRelatedScriptMap(_relatedScript.get());
+		return wo;
+	}
+
+	public static class Wo extends AbstractWo {
+
+	}
+
+}

+ 26 - 0
o2server/x_portal_core_entity/src/main/java/com/x/portal/core/entity/Page.java

@@ -14,6 +14,7 @@ import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.persistence.Persistent;
 import org.apache.openjpa.persistence.jdbc.Index;
 
 import com.x.base.core.entity.JpaObject;
@@ -26,6 +27,7 @@ import com.x.base.core.entity.annotation.Equal;
 import com.x.base.core.entity.annotation.IdReference;
 import com.x.base.core.entity.annotation.RestrictFlag;
 import com.x.base.core.project.annotation.FieldDescribe;
+import org.apache.openjpa.persistence.jdbc.Strategy;
 
 @Entity
 @ContainerEntity(dumpSize = 1000, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong)
@@ -58,6 +60,21 @@ public class Page extends SliceJpaObject {
 	public void onPersist() throws Exception {
 	}
 
+	public Page() {
+		this.properties = new PageProperties();
+	}
+
+	public PageProperties getProperties() {
+		if (null == this.properties) {
+			this.properties = new PageProperties();
+		}
+		return this.properties;
+	}
+
+	public void setProperties(PageProperties properties) {
+		this.properties = properties;
+	}
+
 	/* flag标志位 */
 	/* Entity 默认字段结束 */
 
@@ -136,6 +153,15 @@ public class Page extends SliceJpaObject {
 	@Column(name = ColumnNamePrefix + hasMobile_FIELDNAME)
 	private Boolean hasMobile;
 
+	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 PageProperties properties;
+
 	// public static String[] FLA GS = new String[] { JpaObject.id_FIELDNAME };
 	//
 	// public static String[] RESTRICTFLA GS = new String[] { name_FIELDNAME,

+ 57 - 0
o2server/x_portal_core_entity/src/main/java/com/x/portal/core/entity/PageProperties.java

@@ -0,0 +1,57 @@
+package com.x.portal.core.entity;
+
+import com.x.base.core.entity.JsonProperties;
+import com.x.base.core.project.annotation.FieldDescribe;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PageProperties extends JsonProperties {
+
+	@FieldDescribe("关联Widget.")
+	private List<String> relatedWidgetList = new ArrayList<>();
+
+	@FieldDescribe("移动端关联Widget.")
+	private List<String> mobileRelatedWidgetList = new ArrayList<>();
+
+	@FieldDescribe("关联脚本.")
+	private Map<String, String> relatedScriptMap = new LinkedHashMap<>();
+
+	@FieldDescribe("移动端关联脚本.")
+	private Map<String, String> mobileRelatedScriptMap = new LinkedHashMap<>();
+
+	public List<String> getRelatedWidgetList() {
+		return this.relatedWidgetList == null ? new ArrayList<>() : this.relatedWidgetList;
+	}
+
+	public List<String> getMobileRelatedWidgetList() {
+		return this.mobileRelatedWidgetList == null ? new ArrayList<>() : this.mobileRelatedWidgetList;
+	}
+
+	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 setRelatedWidgetList(List<String> relatedWidgetList) {
+		this.relatedWidgetList = relatedWidgetList;
+	}
+
+	public void setMobileRelatedWidgetList(List<String> mobileRelatedWidgetList) {
+		this.mobileRelatedWidgetList = mobileRelatedWidgetList;
+	}
+
+	public void setRelatedScriptMap(Map<String, String> relatedScriptMap) {
+		this.relatedScriptMap = relatedScriptMap;
+	}
+
+	public void setMobileRelatedScriptMap(Map<String, String> mobileRelatedScriptMap) {
+		this.mobileRelatedScriptMap = mobileRelatedScriptMap;
+	}
+
+}

+ 44 - 3
o2web/source/o2_core/o2/xAction/services/x_portal_assemble_designer.js

@@ -35,6 +35,23 @@ MWF.xAction.RestActions.Action["x_portal_assemble_designer"] = new Class({
         var data, mobileDataStr;
         if (pageData) data = MWF.encodeJsonString(JSON.encode(pageData));
         if (mobileData) mobileDataStr = MWF.encodeJsonString(JSON.encode(mobileData));
+
+        var relatedScriptMap = null;
+        if (pageData && pageData.json.includeScripts && pageData.json.includeScripts.length){
+            relatedScriptMap = {};
+            pageData.json.includeScripts.each(function(s){
+                relatedScriptMap[s.id] = ((s.appType==="process") ? "processPlatform" : s.appType);
+            });
+        };
+
+        var mobileRelatedScriptMap = null;
+        if (mobileData && mobileData.json.includeScripts && mobileData.json.includeScripts.length){
+            mobileRelatedScriptMap = {};
+            mobileData.json.includeScripts.each(function(s){
+                mobileRelatedScriptMap[s.id] = ((s.appType==="process") ? "processPlatform" : s.appType);
+            });
+        }
+
         var json = {
             "id": pageData.json.id,
             "name": pageData.json.name,
@@ -43,7 +60,11 @@ MWF.xAction.RestActions.Action["x_portal_assemble_designer"] = new Class({
             "description": pageData.json.description,
             "portal": pageData.json.application,
             "icon": pageData.json.formIcon,
-            "formFieldList": fieldList
+            "formFieldList": fieldList,
+            "relatedScriptMap": relatedScriptMap,
+            "relatedWidgetList": (pageData && pageData.json.widgetList) ? pageData.json.widgetList : [],
+            "mobileRelatedScriptMap": mobileRelatedScriptMap,
+            "mobileRelatedWidgetList": (mobileData && mobileData.json.widgetList) ? mobileData.json.widgetList : []
         };
         if (mobileData && mobileData.json.moduleList){
             if (Object.keys(mobileData.json.moduleList).length){
@@ -78,6 +99,22 @@ MWF.xAction.RestActions.Action["x_portal_assemble_designer"] = new Class({
                 if (pageData) data = MWF.encodeJsonString(JSON.encode(pageData));
                 if (mobileData) mobileDataStr = MWF.encodeJsonString(JSON.encode(mobileData));
 
+                var relatedScriptMap = null;
+                if (pageData && pageData.json.includeScripts && pageData.json.includeScripts.length){
+                    relatedScriptMap = {};
+                    pageData.json.includeScripts.each(function(s){
+                        relatedScriptMap[s.id] = ((s.appType==="process") ? "processPlatform" : s.appType);
+                    });
+                };
+
+                var mobileRelatedScriptMap = null;
+                if (mobileData && mobileData.json.includeScripts && mobileData.json.includeScripts.length){
+                    mobileRelatedScriptMap = {};
+                    mobileData.json.includeScripts.each(function(s){
+                        mobileRelatedScriptMap[s.id] = ((s.appType==="process") ? "processPlatform" : s.appType);
+                    });
+                }
+
                 var json = {
                     "id": pageData.json.id,
                     "name": pageData.json.name,
@@ -86,7 +123,11 @@ MWF.xAction.RestActions.Action["x_portal_assemble_designer"] = new Class({
                     "description": pageData.json.description,
                     "portal": pageData.json.application,
                     "icon": pageData.json.formIcon,
-                    "formFieldList": fieldList
+                    "formFieldList": fieldList,
+                    "relatedScriptMap": relatedScriptMap,
+                    "relatedWidgetList": (pageData && pageData.json.widgetList) ? pageData.json.widgetList : [],
+                    "mobileRelatedScriptMap": mobileRelatedScriptMap,
+                    "mobileRelatedWidgetList": (mobileData && mobileData.json.widgetList) ? mobileData.json.widgetList : []
                 };
                 if (mobileData && mobileData.json.moduleList){
                     if (Object.keys(mobileData.json.moduleList).length){
@@ -315,4 +356,4 @@ MWF.xAction.RestActions.Action["x_portal_assemble_designer"] = new Class({
     changeApplicationIcon: function(applicationId, success, failure, formData, file){
         this.action.invoke({"name": "updateApplicationIcon", "parameter": {"id": applicationId},"data": formData,"file": file,"success": success,"failure": failure});
     }
-});
+});

+ 8 - 1
o2web/source/o2_core/o2/xAction/services/x_portal_assemble_surface.json

@@ -11,8 +11,15 @@
 
   "getPage": {"uri": "/jaxrs/page/{id}"},
   "getPageMobile": {"uri": "/jaxrs/page/{id}/mobile"},
+  "getPageV2": {"uri": "/jaxrs/page/v2/{id}"},
+  "getPageMobileV2": {"uri": "/jaxrs/page/v2/{id}/mobile"},
+
   "getPageByName": {"uri": "/jaxrs/page/{name}/portal/{id}"},
   "getPageByNameMobile": {"uri": "/jaxrs/page/{name}/portal/{id}/mobile"},
+
+  "getPageByNameV2": {"uri": "/jaxrs/page/v2/{name}/portal/{id}"},
+  "getPageByNameMobileV2": {"uri": "/jaxrs/page/v2/{name}/portal/{id}/mobile"},
+
   "getSource": {"uri": "/jaxrs/source/{id}"},
   "getScript": {"uri": "/jaxrs/script/{id}"},
   //"getScriptByName": {"uri": "/jaxrs/script/portal/{applicationId}/name/{name}"},
@@ -26,4 +33,4 @@
 
   "readFile": {"uri": "/jaxrs/file/{flag}/portal/{applicationFlag}/content"},
   "listFile": {"uri": "/jaxrs/file/list/portal/{applicationFlag}"}
-}
+}

+ 11 - 4
o2web/source/o2_core/o2/xDesktop/Default.js

@@ -44,6 +44,7 @@ o2.xDesktop.Default = new Class({
             this.status.apps[appNames] = options || {};
             this.status.apps[appNames].name = appNames;
             this.status.apps[appNames].appId = appNames;
+            this.status.apps[appNames].isIndex = true;
             this.status.currentApp = appNames;
         }else{
             this.status = layout.userLayout;
@@ -228,7 +229,7 @@ o2.xDesktop.Default = new Class({
                     this.taskitem.destroy();
                 },
                 "setCurrent": function(){
-                    this.taskitem.textNode.click();
+                    if (this.taskitem.textNode) this.taskitem.textNode.click();
                 }
             };
             //layout.openApplication(null, "portal.Portal", options);
@@ -239,7 +240,7 @@ o2.xDesktop.Default = new Class({
                     this.taskitem.destroy();
                 },
                 "setCurrent": function(){
-                    this.taskitem.textNode.click();
+                    if (this.taskitem.textNode) this.taskitem.textNode.click();
                 }
             };
             //layout.openApplication(null, "Homepage");
@@ -247,7 +248,7 @@ o2.xDesktop.Default = new Class({
 
         taskitem = layout.desktop.createTaskItem(app);
         app.taskitem = taskitem;
-        app.isIndex = true;
+        app.options.isIndex = true;
         this.apps[app.options.appId] = app;
         taskitem.textNode.click();
     },
@@ -264,6 +265,7 @@ o2.xDesktop.Default = new Class({
     },
 
     loadStatus: function(){
+        debugger;
         if (this.status){
             var keys = Object.keys(this.status.apps);
             if (this.status.apps && keys.length){
@@ -281,7 +283,7 @@ o2.xDesktop.Default = new Class({
                             this.taskitem.destroy();
                         },
                         "setCurrent": function(){
-                            this.taskitem.textNode.click();
+                            if (this.taskitem.textNode) this.taskitem.textNode.click();
                         }
                     };
                     taskitem = layout.desktop.createTaskItem(app);
@@ -509,6 +511,11 @@ o2.xDesktop.Default = new Class({
                 var appStatus = this.getAppStatusData(app, id);
                 if (appStatus) status.apps[id] = appStatus;
             }
+            debugger;
+            if (app.isIndex){
+                if (!status.apps[id]) status.apps[id] = {};
+                status.apps[id].isIndex = true;
+            }
         }.bind(this));
         this.lnks.each(function(lnk){
             status.flatLnks.push(lnk.data);

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/shortcut.js

@@ -27,7 +27,7 @@ MWF.shortcut = {
     clearDesktop: function(){
         var keys = Array.clone(Object.keys(layout.desktop.apps));
         keys.each(function(key){
-            if (!layout.desktop.apps[key].isIndex) layout.desktop.apps[key].close();
+            if (!layout.desktop.apps[key].isIndex && !layout.desktop.apps[key].options.isIndex) layout.desktop.apps[key].close();
         });
         keys = null;
     },

+ 15 - 0
o2web/source/x_component_portal_PageDesigner/Main.js

@@ -1387,6 +1387,18 @@ MWF.xApplication.portal.PageDesigner.Main = new Class({
         }.bind(this));
         return fieldList;
     },
+    getWidgetList: function(data){
+        widgetList = [];
+
+        Object.each(data.moduleList, function(moudle){
+            if (moudle.moduleName.toLowerCase()=="widget"){
+                if (moudle.widgetType == "select"){
+                    widgetList.push(moudle.widgetSelected);
+                }
+            }
+        }.bind(this));
+        return widgetList;
+    },
     saveForm: function(){
         this.savePage()
     },
@@ -1402,10 +1414,12 @@ MWF.xApplication.portal.PageDesigner.Main = new Class({
             var pcData, mobileData;
             if (this.pcPage){
                 this.pcPage._getPageData();
+                this.pcPage.json.widgetList = this.getWidgetList(this.pcPage.json);
                 pcData = this.pcPage.data;
             }
             if (this.mobilePage){
                 this.mobilePage._getPageData();
+                this.mobilePage.json.widgetList = this.getWidgetList(this.mobilePage.json);
                 mobileData = this.mobilePage.data;
             }else{
                 if (this.pageMobileData) mobileData = this.pageMobileData;
@@ -1413,6 +1427,7 @@ MWF.xApplication.portal.PageDesigner.Main = new Class({
 
             this.isSave = true;
             var fieldList = this.getFieldList();
+
             this._savePage(pcData, mobileData, fieldList, function(responseJSON){
                 this.notice(MWF.APPPD.LP.notice["save_success"], "ok", null, {x: "left", y:"bottom"});
                 if (!this.pcPage.json.name) this.pcPage.treeNode.setText("<"+this.json.type+"> "+this.json.id);

+ 12 - 1
o2web/source/x_component_portal_PageDesigner/Module/Page/page.html

@@ -30,6 +30,17 @@
                 <td class="editTableValue"><div class="MWFIcon" name="formIcon"></div></td>
             </tr>
         </table>
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999;font-weight:bold;">预加载脚本</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">脚本:</td>
+                <td class="editTableValue">
+                    <div class="MWFScriptSelect" data-count=0 name="includeScripts"></div>
+                    <div class="MWFScriptSelectAction"><div style="color: #0b58a2; cursor: pointer; float: left">复制</div><div style="color: #0b58a2; cursor: pointer; float: left; margin-left:10px">粘贴</div></div>
+                </td>
+            </tr>
+        </table>
 		
 		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
 		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
@@ -49,4 +60,4 @@
 	<div title="JSON"  class="MWFTab">
 		<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
 	</div>
-</div>
+</div>

+ 15 - 3
o2web/source/x_component_portal_Portal/Main.js

@@ -158,8 +158,17 @@ MWF.xApplication.portal.Portal.Main = new Class({
             if (!!pageJson && loadModuleFlag){
                 layout.sessionPromise.then(function(){
                     this.setTitle(pageJson.data.name);
-                    this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null;
-                    this.pageInfor = pageJson.data;
+                    if (pageJson.data.page){
+                        this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null;
+                        this.relatedFormMap = pageJson.data.relatedWidgetMap;
+                        this.relatedScriptMap = pageJson.data.relatedScriptMap;
+                        delete pageJson.data.page.data;
+                        this.pageInfor = pageJson.data.page;
+                    }else{
+                        this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null;
+                        delete pageJson.data.data;
+                        this.pageInfor = pageJson.data;
+                    }
                     this.openPortal(par, callback);
                 }.bind(this));
             }
@@ -169,7 +178,7 @@ MWF.xApplication.portal.Portal.Main = new Class({
         if( this.options.widgetId ){
             m = (layout.mobile) ? "getWidgetByNameMobile" : "getWidgetByName";
         }else{
-            m = (layout.mobile) ? "getPageByNameMobile" : "getPageByName";
+            m = (layout.mobile) ? "getPageByNameMobileV2" : "getPageByNameV2";
         }
         this.action[m]( this.options.widgetId || this.options.pageId, this.options.portalId, function(json){
             pageJson = json;
@@ -202,6 +211,7 @@ MWF.xApplication.portal.Portal.Main = new Class({
     },
 
     openPortal: function(par, callback){
+        debugger;
         if (this.page){
             //MWF.xDesktop.requireApp("process.Xform", "Form", function(){
                 this.appForm = new MWF.APPForm(this.formNode, this.page, {
@@ -216,8 +226,10 @@ MWF.xApplication.portal.Portal.Main = new Class({
                     "data": {}
                 };
 
+
                 this.appForm.workAction = this.action;
                 this.appForm.app = this;
+
                 this.appForm.load();
 
                 if (callback) callback();

+ 0 - 4
o2web/source/x_component_process_Work/Main.js

@@ -716,15 +716,11 @@ MWF.xApplication.process.Work.Main = new Class({
                         layout.appForm = this.appForm;
                         window.webkit.messageHandlers.appFormLoaded.postMessage(JSON.stringify(this.appForm.mobileTools));
                     }
-debugger;
-
                     if (this.options.action=="processTask"){
                         this.appForm.processWork();
                         this.options.action = "";
                     }
-
                     this.fireEvent("postLoadForm");
-
                 }.bind(this));
             //}.bind(this));
         }

+ 14 - 5
o2web/source/x_component_process_Xform/Widget.js

@@ -3,6 +3,7 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
     Extends: MWF.APP$Module,
 
     _loadUserInterface: function(){
+        debugger;
         this.node.empty();
         this.getWidget(function(){
             this.loadWidget();
@@ -139,11 +140,19 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
             }
         }else{
             if (this.json.widgetSelected && this.json.widgetSelected!=="none"){
-                var app = this.form.businessData.pageInfor.portal;
-                o2.Actions.get("x_portal_assemble_surface")[method](this.json.widgetSelected, app, function(json){
-                    this.getWidgetData(json.data);
+
+                var widgetData = (this.form.app.relatedFormMap) ? this.form.app.relatedFormMap[this.json.widgetSelected] : null;
+                if (widgetData){
+                    this.getWidgetData({"data": widgetData.data});
                     if (callback) callback();
-                }.bind(this));
+
+                }else{
+                    var app = this.form.businessData.pageInfor.portal;
+                    o2.Actions.get("x_portal_assemble_surface")[method](this.json.widgetSelected, app, function(json){
+                        this.getWidgetData(json.data);
+                        if (callback) callback();
+                    }.bind(this));
+                }
             }else{
                 if (callback) callback();
             }
@@ -175,4 +184,4 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
         }
         return params;
     }
-});
+});