Browse Source

Merge remote-tracking branch 'origin/develop' into develop

o2lee 5 years ago
parent
commit
b47a60a9a8
100 changed files with 1511 additions and 5422 deletions
  1. 3 3
      gulpfile.js
  2. 3 1
      o2server/configSample/node_127.0.0.1.json
  3. 9 0
      o2server/pom.xml
  4. 364 0
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/StatisticPersonForMonthFactory.java
  5. 78 10
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticService.java
  6. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
  7. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Dingding.java
  8. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Person.java
  9. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Portal.java
  10. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Qiyeweixin.java
  11. 3 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Token.java
  12. 24 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java
  13. 106 7
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/BaseTools.java
  14. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_designer.java
  15. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_assemble_surface.java
  16. 3 3
      o2server/x_console/src/main/java/com/x/server/console/ResourceFactory.java
  17. 11 3
      o2server/x_console/src/main/java/com/x/server/console/action/DumpData.java
  18. 4 3
      o2server/x_console/src/main/java/com/x/server/console/action/EraseContent.java
  19. 2 0
      o2server/x_console/src/main/java/com/x/server/console/action/EraseContentCms.java
  20. 6 2
      o2server/x_console/src/main/java/com/x/server/console/action/RestoreData.java
  21. 3 3
      o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java
  22. 37 23
      o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java
  23. 52 0
      o2server/x_console/src/main/java/com/x/server/console/server/web/Proxy.java
  24. 45 7
      o2server/x_console/src/main/java/com/x/server/console/server/web/WebServerTools.java
  25. 0 1994
      o2server/x_portal_assemble_surface/src/main/webapp/describe/describe.json
  26. 0 28
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/AbstractFactory.java
  27. 0 33
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ApplicationServletContextListener.java
  28. 0 77
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/Business.java
  29. 0 97
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/Control.java
  30. 0 37
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ThisApplication.java
  31. 0 74
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/FileFactory.java
  32. 0 70
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PageFactory.java
  33. 0 95
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PortalFactory.java
  34. 0 162
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/ScriptFactory.java
  35. 0 53
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/WidgetFactory.java
  36. 0 25
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/ActionApplication.java
  37. 0 10
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/FileJaxrsFilter.java
  38. 0 10
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/PageJaxrsFilter.java
  39. 0 10
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/PortalJaxrsFilter.java
  40. 0 10
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/ScriptJaxrsFilter.java
  41. 0 10
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/WidgetJaxrsFilter.java
  42. 0 88
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java
  43. 0 87
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java
  44. 0 43
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionListWithPortal.java
  45. 0 7
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/BaseAction.java
  46. 0 87
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/FileAction.java
  47. 0 48
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGet.java
  48. 0 48
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetMobile.java
  49. 0 63
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
  50. 0 60
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
  51. 0 53
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionList.java
  52. 0 19
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
  53. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPageNotExist.java
  54. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPortalAccessDenied.java
  55. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPortalNotExist.java
  56. 0 124
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/PageAction.java
  57. 0 45
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionGet.java
  58. 0 45
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionIcon.java
  59. 0 34
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionIconBase64.java
  60. 0 84
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionList.java
  61. 0 6
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/BaseAction.java
  62. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ExceptionPortalAccessDenied.java
  63. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ExceptionPortalNotExist.java
  64. 0 119
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/PortalAction.java
  65. 0 112
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionFlag.java
  66. 0 47
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGet.java
  67. 0 87
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java
  68. 0 53
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionList.java
  69. 0 11
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java
  70. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionPortalAccessDenied.java
  71. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionPortalNotExist.java
  72. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionScriptNotExist.java
  73. 0 108
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ScriptAction.java
  74. 0 48
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGet.java
  75. 0 47
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetMobile.java
  76. 0 63
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
  77. 0 63
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
  78. 0 55
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionList.java
  79. 0 11
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
  80. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionPortalAccessDenied.java
  81. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionPortalNotExist.java
  82. 0 13
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionWidgetNotExist.java
  83. 0 124
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/WidgetAction.java
  84. 52 2
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/form/ActionCreate.java
  85. 57 6
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/form/ActionEdit.java
  86. 8 0
      o2server/x_processplatform_assemble_surface/pom.xml
  87. 64 62
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java
  88. 21 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/CmsFactory.java
  89. 17 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/cms/ScriptFactory.java
  90. 21 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/PortalFactory.java
  91. 17 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/portal/ScriptFactory.java
  92. 53 174
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompleted.java
  93. 53 174
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithWorkOrWorkCompletedMobile.java
  94. 215 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
  95. 18 18
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java
  96. 58 1
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java
  97. 26 84
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Form.java
  98. 57 0
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/FormProperties.java
  99. 3 3
      o2web/gulpfile.js
  100. 2 1
      o2web/source/o2_core/o2.js

+ 3 - 3
gulpfile.js

@@ -461,6 +461,7 @@ function build_concat_xform(){
         'o2web/source/' + path + '/Textfield.js',
         'o2web/source/' + path + '/Personfield.js',
         'o2web/source/' + path + '/*.js',
+        'o2web/source/x_component_process_Work/Processor.js',
         '!o2web/source/' + path + '/Office.js'
     ];
     var dest = 'target/o2server/servers/webServer/'+path+'/';
@@ -493,7 +494,6 @@ function build_bundle(){
 function build_concat_basework() {
     var src = [
         'o2web/source/x_desktop/js/base_work_begin.js',
-        'o2web/source/x_desktop/js/base.js',
         'o2web/source/o2_core/o2/widget/Common.js',
         'o2web/source/o2_core/o2/widget/Dialog.js',
         'o2web/source/o2_core/o2/widget/UUID.js',
@@ -520,12 +520,12 @@ function build_concat_basework() {
         'o2web/source/o2_core/o2/xScript/Actions/ScriptActions.js',
         'o2web/source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
         'o2web/source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
-        'o2web/source/x_component_process_Work/Processor.js',
         'o2web/source/x_component_Template/MTooltips.js',
         'o2web/source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
         'o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js',
         'o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
-        'o2web/source/x_desktop/js/base_work_end.js'
+        'o2web/source/x_desktop/js/base_work_end.js',
+        'o2web/source/x_desktop/js/base.js'
     ];
     var dest = 'target/o2server/servers/webServer/x_desktop/js/';
     return gulp.src(src)

+ 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,

+ 9 - 0
o2server/pom.xml

@@ -144,6 +144,10 @@
 			<groupId>org.eclipse.jetty</groupId>
 			<artifactId>jetty-quickstart</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jetty</groupId>
+			<artifactId>jetty-proxy</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>com.google.zxing</groupId>
 			<artifactId>core</artifactId>
@@ -545,6 +549,11 @@
 				<artifactId>jetty-quickstart</artifactId>
 				<version>9.4.20.v20190813</version>
 			</dependency>
+			<dependency>
+				<groupId>org.eclipse.jetty</groupId>
+				<artifactId>jetty-proxy</artifactId>
+				<version>9.4.31.v20200723</version>
+			</dependency>
 			<dependency>
 				<groupId>com.google.zxing</groupId>
 				<artifactId>core</artifactId>

+ 364 - 0
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/factory/StatisticPersonForMonthFactory.java

@@ -16,6 +16,9 @@ import org.apache.commons.lang3.StringUtils;
 import com.x.attendance.assemble.control.AbstractFactory;
 import com.x.attendance.assemble.control.Business;
 import com.x.attendance.assemble.control.jaxrs.attendancestatistic.WrapInFilterStatisticPersonForMonth;
+import com.x.attendance.assemble.control.service.AttendanceEmployeeConfigServiceAdv;
+import com.x.attendance.assemble.control.service.UserManagerService;
+import com.x.attendance.entity.AttendanceEmployeeConfig;
 import com.x.attendance.entity.StatisticPersonForMonth;
 import com.x.attendance.entity.StatisticPersonForMonth_;
 import com.x.base.core.project.exception.ExceptionWhen;
@@ -416,6 +419,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织,统计年月,计算组织内所有员工迟到数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumLateCountByUnitYearAndMonthUn(List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.lateTimes ) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工出勤天数总和
@@ -450,6 +493,45 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工出勤天数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Double sumAttendanceDayCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Double> cq = cb.createQuery(Double.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.onDutyDayCount) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工异常打卡数总和
 	 * @param unitName
@@ -483,6 +565,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工异常打卡数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumAbNormalDutyCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.abNormalDutyCount) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工工时不足次数总和
 	 * @param unitName
@@ -516,6 +638,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工工时不足次数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumLackOfTimeCountByUnitYearAndMonthUn(List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.lackOfTimeCount) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工早退次数总和
 	 * @param unitName
@@ -549,6 +711,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工早退次数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumLeaveEarlyCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.leaveEarlyTimes ) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工签退次数总和
 	 * @param unitName
@@ -582,6 +784,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工签退次数总和
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumOffDutyCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.offDutyTimes ) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工签到退次数总和
 	 * @param unitName
@@ -615,6 +857,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工签到退次数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Long sumOnDutyCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.onDutyTimes ) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工请假天数总和
 	 * @param unitName
@@ -648,6 +930,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工请假天数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Double sumOnSelfHolidayCountByUnitYearAndMonthUn( List<String> unitName, List<String> unUnitNameList,List<String> personNameList,String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}		
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Double> cq = cb.createQuery(Double.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.onSelfHolidayCount) ) );		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
+	
 	/**
 	 * 根据组织列表,统计年月,计算组织内所有员工缺勤天数总和
 	 * @param unitName
@@ -683,4 +1005,46 @@ public class StatisticPersonForMonthFactory extends AbstractFactory {
 		}
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
+	
+	/**
+	 * 根据组织列表,统计年月,计算组织内所有员工缺勤天数总和(排除不参加考勤的员工)
+	 * @param unitName
+	 * @param sYear
+	 * @param sMonth
+	 * @return
+	 * @throws Exception
+	 */
+	public Double sumAbsenceDayCountByUnitYearAndMonthUn( List<String> unitName,List<String> unUnitNameList,List<String> personNameList, String sYear, String sMonth) throws Exception{
+		if( unitName == null || unitName.size() == 0 ){
+			logger.error( new UnitNamesEmptyException() );
+			return null;
+		}
+		EntityManager em = this.entityManagerContainer().get( StatisticPersonForMonth.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Double> cq = cb.createQuery(Double.class);
+		Root<StatisticPersonForMonth> root = cq.from( StatisticPersonForMonth.class);		
+		//查询总数
+		cq.select( cb.sum( root.get(StatisticPersonForMonth_.absenceDayCount) ) );	
+		
+		Predicate p = root.get(StatisticPersonForMonth_.unitName).in( unitName );
+		
+		if(ListTools.isNotEmpty(unUnitNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.unitName ), cb.literal(unUnitNameList)));
+		}
+		if(ListTools.isNotEmpty(personNameList)){
+			p = cb.and( p, cb.isNotMember(root.get( StatisticPersonForMonth_.employeeName ), cb.literal(personNameList)));
+		}
+		if( sYear == null || sYear.isEmpty() ){
+			logger.error( new StatisticYearEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticYear), sYear));
+		}
+		
+		if( sMonth == null || sMonth.isEmpty() ){
+			logger.error( new StatisticMonthEmptyException() );
+		}else{
+			p = cb.and( p, cb.equal( root.get(StatisticPersonForMonth_.statisticMonth), sMonth));
+		}
+		return em.createQuery(cq.where(p)).getSingleResult();
+	}
 }

+ 78 - 10
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/service/AttendanceStatisticService.java

@@ -5,9 +5,12 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
+
 import com.x.attendance.assemble.control.Business;
 import com.x.attendance.assemble.control.factory.AttendanceDetailStatisticFactory;
 import com.x.attendance.assemble.control.factory.StatisticUnitForMonthFactory;
+import com.x.attendance.entity.AttendanceEmployeeConfig;
 import com.x.attendance.entity.AttendanceStatisticRequireLog;
 import com.x.attendance.entity.AttendanceStatisticalCycle;
 import com.x.attendance.entity.AttendanceWorkDayConfig;
@@ -27,6 +30,7 @@ public class AttendanceStatisticService {
 	
 	private static  Logger logger = LoggerFactory.getLogger( AttendanceStatisticService.class );
 	private UserManagerService userManagerService = new UserManagerService();
+	protected AttendanceEmployeeConfigServiceAdv attendanceEmployeeConfigServiceAdv = new AttendanceEmployeeConfigServiceAdv();
 	
 	/**
 	 * 根据数据统计需求,进行员工每月考勤分析结果统计
@@ -229,7 +233,8 @@ public class AttendanceStatisticService {
 		Object workDayCountForMonth = 0.0, absenceDayCount=0.0, onSelfHolidayCount=0.0;
 		String cycleYear = null, cycleMonth = null;
 		Business business = null;
-		
+		List<String> unUnitNameList = new ArrayList<String>();
+		List<String> personNameList = new ArrayList<String>();
 
 		cycleYear = attendanceStatisticRequireLog.getStatisticYear();
 		cycleMonth = attendanceStatisticRequireLog.getStatisticMonth();
@@ -237,6 +242,8 @@ public class AttendanceStatisticService {
 		query_unitNames.add( unitName );
 		
 		try {
+			unUnitNameList = getUnUnitNameList();
+			personNameList = getUnPersonNameList();
 			business = new Business(emc);
 			statisticUnitForMonth = new StatisticUnitForMonth();
 			statisticUnitForMonth.setUnitName( unitName );
@@ -250,42 +257,51 @@ public class AttendanceStatisticService {
 				logger.warn( "根据组织名称["+unitName+"]未查询到组织信息。" );
 			}
 			//    1.2.1 应出勤天数
-			workDayCountForMonth = business.getStatisticPersonForMonthFactory().sumAttendanceDayCountByUnitYearAndMonth(query_unitNames, cycleYear, cycleMonth);
+			//workDayCountForMonth = business.getStatisticPersonForMonthFactory().sumAttendanceDayCountByUnitYearAndMonth(query_unitNames, cycleYear, cycleMonth);
+			workDayCountForMonth = business.getStatisticPersonForMonthFactory().sumAttendanceDayCountByUnitYearAndMonthUn(query_unitNames,unUnitNameList,personNameList, cycleYear, cycleMonth);
 			double count = 0.0;
 			if( workDayCountForMonth != null ){
 				count = (double)workDayCountForMonth;
 			}
 			statisticUnitForMonth.setOnDutyEmployeeCount( count );
 			//    1.2.3 异常打卡次数
-			abNormalDutyCount = business.getStatisticPersonForMonthFactory().sumAbNormalDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth );
+			//abNormalDutyCount = business.getStatisticPersonForMonthFactory().sumAbNormalDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth );
+			abNormalDutyCount = business.getStatisticPersonForMonthFactory().sumAbNormalDutyCountByUnitYearAndMonthUn( query_unitNames,unUnitNameList,personNameList, cycleYear, cycleMonth );
 			if( abNormalDutyCount == null ){ abNormalDutyCount = 0L;}
 			statisticUnitForMonth.setAbNormalDutyCount((long)abNormalDutyCount);
 			//    1.2.4 工时不足次数
-			lackOfTimeCount = business.getStatisticPersonForMonthFactory().sumLackOfTimeCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//lackOfTimeCount = business.getStatisticPersonForMonthFactory().sumLackOfTimeCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			lackOfTimeCount = business.getStatisticPersonForMonthFactory().sumLackOfTimeCountByUnitYearAndMonthUn( query_unitNames,unUnitNameList,personNameList, cycleYear, cycleMonth);
 			if( lackOfTimeCount == null ){ lackOfTimeCount = 0L;}
 			statisticUnitForMonth.setLackOfTimeCount((long)lackOfTimeCount);
 			//    1.2.5 签到次数
-			onDutyTimes = business.getStatisticPersonForMonthFactory().sumOnDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//onDutyTimes = business.getStatisticPersonForMonthFactory().sumOnDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			onDutyTimes = business.getStatisticPersonForMonthFactory().sumOnDutyCountByUnitYearAndMonthUn( query_unitNames,unUnitNameList,personNameList, cycleYear, cycleMonth);
 			if( onDutyTimes == null ){ onDutyTimes = 0L;}
 			statisticUnitForMonth.setOnDutyCount( (long)onDutyTimes);
 			//    1.2.6 签退次数
-			offDutyTimes = business.getStatisticPersonForMonthFactory().sumOffDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//offDutyTimes = business.getStatisticPersonForMonthFactory().sumOffDutyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			offDutyTimes = business.getStatisticPersonForMonthFactory().sumOffDutyCountByUnitYearAndMonthUn( query_unitNames, unUnitNameList,personNameList,cycleYear, cycleMonth);
 			if( offDutyTimes == null ){ offDutyTimes = 0L;}
 			statisticUnitForMonth.setOffDutyCount((long)offDutyTimes);
 			//    1.2.7 迟到次数
-			lateTimes = business.getStatisticPersonForMonthFactory().sumLateCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//lateTimes = business.getStatisticPersonForMonthFactory().sumLateCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			lateTimes = business.getStatisticPersonForMonthFactory().sumLateCountByUnitYearAndMonthUn( query_unitNames, unUnitNameList,personNameList,cycleYear, cycleMonth);
 			if( lateTimes == null ){ lateTimes = 0L;}
 			statisticUnitForMonth.setLateCount((long)lateTimes);
 			//    1.2.8 缺勤天数
-			absenceDayCount = business.getStatisticPersonForMonthFactory().sumAbsenceDayCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//absenceDayCount = business.getStatisticPersonForMonthFactory().sumAbsenceDayCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			absenceDayCount = business.getStatisticPersonForMonthFactory().sumAbsenceDayCountByUnitYearAndMonthUn( query_unitNames, unUnitNameList,personNameList,cycleYear, cycleMonth);
 			if( absenceDayCount == null ){ absenceDayCount = 0.0;}
 			statisticUnitForMonth.setAbsenceDayCount((double)absenceDayCount);
 			//    1.2.9 早退次数
-			leaveEarlyTimes = business.getStatisticPersonForMonthFactory().sumLeaveEarlyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//leaveEarlyTimes = business.getStatisticPersonForMonthFactory().sumLeaveEarlyCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			leaveEarlyTimes = business.getStatisticPersonForMonthFactory().sumLeaveEarlyCountByUnitYearAndMonthUn( query_unitNames, unUnitNameList,personNameList,cycleYear, cycleMonth);
 			if( leaveEarlyTimes == null ){ leaveEarlyTimes = 0L;}
 			statisticUnitForMonth.setLeaveEarlyCount((long)leaveEarlyTimes);
 			//    1.2.10 休假天数
-			onSelfHolidayCount = business.getStatisticPersonForMonthFactory().sumOnSelfHolidayCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			//onSelfHolidayCount = business.getStatisticPersonForMonthFactory().sumOnSelfHolidayCountByUnitYearAndMonth( query_unitNames, cycleYear, cycleMonth);
+			onSelfHolidayCount = business.getStatisticPersonForMonthFactory().sumOnSelfHolidayCountByUnitYearAndMonthUn( query_unitNames,unUnitNameList,personNameList, cycleYear, cycleMonth);
 			if( onSelfHolidayCount == null ){ onSelfHolidayCount = 0.0;}
 			statisticUnitForMonth.setOnSelfHolidayCount((double)onSelfHolidayCount);
 			
@@ -861,4 +877,56 @@ public class AttendanceStatisticService {
 		Business business =  new Business( emc );
 		return business.getStatisticTopUnitForDayFactory().list( ids );
 	}
+	
+	/**
+	 * 获取不需要考勤的组织
+	 * @return
+	 * @throws Exception 
+	 */
+	protected  List<String> getUnUnitNameList() throws Exception {
+		List<String> unUnitNameList = new ArrayList<String>();
+
+		List<AttendanceEmployeeConfig> attendanceEmployeeConfigs = attendanceEmployeeConfigServiceAdv.listByConfigType("NOTREQUIRED");
+
+		if(ListTools.isNotEmpty(attendanceEmployeeConfigs)){
+			for (AttendanceEmployeeConfig attendanceEmployeeConfig : attendanceEmployeeConfigs) {
+				String unitName = attendanceEmployeeConfig.getUnitName();
+				String employeeName = attendanceEmployeeConfig.getEmployeeName();
+
+				if(StringUtils.isEmpty(employeeName) && StringUtils.isNotEmpty(unitName)){
+					unUnitNameList.add(unitName);
+					List<String> tempUnitNameList = userManagerService.listSubUnitNameWithParent(unitName);
+					if(ListTools.isNotEmpty(tempUnitNameList)){
+						for(String tempUnit:tempUnitNameList){
+							if(!ListTools.contains(unUnitNameList, tempUnit)){
+								unUnitNameList.add(tempUnit);
+							}
+						}
+					}
+				}
+			} 
+		}
+		return unUnitNameList;
+	}
+	
+	/**
+	 * 获取不需要考勤的人员
+	 * @return
+	 * @throws Exception 
+	 */
+	protected  List<String> getUnPersonNameList() throws Exception {
+		List<String> personNameList = new ArrayList<String>();
+		List<AttendanceEmployeeConfig> attendanceEmployeeConfigs = attendanceEmployeeConfigServiceAdv.listByConfigType("NOTREQUIRED");
+
+		if(ListTools.isNotEmpty(attendanceEmployeeConfigs)){
+			for (AttendanceEmployeeConfig attendanceEmployeeConfig : attendanceEmployeeConfigs) {
+				String employeeName = attendanceEmployeeConfig.getEmployeeName();
+
+				if(StringUtils.isNotEmpty(employeeName) && !ListTools.contains(personNameList, employeeName)){
+					personNameList.add(employeeName);
+				}
+			}
+		}
+		return personNameList;
+	}
 }

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

@@ -10,6 +10,7 @@ import java.util.Objects;
 
 import com.x.base.core.project.connection.ActionResponse;
 import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.tools.BaseTools;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.BooleanUtils;
@@ -245,6 +246,7 @@ public class Collect extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_COLLECT);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+		BaseTools.executeSyncFile(Config.PATH_CONFIG_COLLECT);
 	}
 
 	public void setSecret(String secret) {

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

@@ -4,6 +4,7 @@ import java.io.File;
 import java.util.Calendar;
 import java.util.Date;
 
+import com.x.base.core.project.tools.BaseTools;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -223,6 +224,7 @@ public class Dingding extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_DINGDING);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+		BaseTools.executeSyncFile(Config.PATH_CONFIG_DINGDING);
 	}
 
 	public void setEnable(Boolean enable) {

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

@@ -4,6 +4,7 @@ import java.io.File;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import com.x.base.core.project.tools.BaseTools;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -247,6 +248,7 @@ public class Person extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_PERSON);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+		BaseTools.executeSyncFile(Config.PATH_CONFIG_PERSON);
 	}
 
 	public void setCodeLogin(Boolean codeLogin) {

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

@@ -5,6 +5,7 @@ import java.util.LinkedHashMap;
 
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.gson.XGsonBuilder;
+import com.x.base.core.project.tools.BaseTools;
 import com.x.base.core.project.tools.DefaultCharset;
 
 import org.apache.commons.io.FileUtils;
@@ -141,6 +142,7 @@ public class Portal extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_PORTAL);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+		BaseTools.executeSyncFile(Config.PATH_CONFIG_PORTAL);
 	}
 
 	public LinkedHashMap<String, String> getUrlMapping() {

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

@@ -4,6 +4,7 @@ import java.io.File;
 import java.util.Calendar;
 import java.util.Date;
 
+import com.x.base.core.project.tools.BaseTools;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -447,6 +448,7 @@ public class Qiyeweixin extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_QIYEWEIXIN);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+		BaseTools.executeSyncFile(Config.PATH_CONFIG_QIYEWEIXIN);
 	}
 
 

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

@@ -1,12 +1,14 @@
 package com.x.base.core.project.config;
 
 import java.io.File;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import com.x.base.core.project.tools.BaseTools;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -176,6 +178,7 @@ public class Token extends ConfigObject {
 	public void save() throws Exception {
 		File file = new File(Config.base(), Config.PATH_CONFIG_TOKEN);
 		FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
+        BaseTools.executeSyncFile(Config.PATH_CONFIG_TOKEN);
 	}
 
 	public boolean isInitialManager(String name) {

+ 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;
+	}
+
 }

+ 106 - 7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/BaseTools.java

@@ -1,13 +1,19 @@
 package com.x.base.core.project.tools;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.io.*;
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.Socket;
+import java.util.*;
 import java.util.Map.Entry;
-import java.util.Objects;
 
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.config.ConfigObject;
+import com.x.base.core.project.config.Nodes;
+import com.x.base.core.project.gson.XGsonBuilder;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -15,7 +21,7 @@ import com.google.gson.Gson;
 import com.google.gson.JsonElement;
 
 public class BaseTools {
-
+	private static Logger logger = LoggerFactory.getLogger(BaseTools.class);
 	public static String getBasePath() throws Exception {
 		return getBaseDirectory().getAbsolutePath();
 	}
@@ -135,4 +141,97 @@ public class BaseTools {
 		}
 		return FileUtils.readFileToString(file, DefaultCharset.charset);
 	}
+
+	public  static boolean executeSyncFile(String syncFilePath) throws Exception {
+
+		boolean Syncflag = false;
+		String localip = getIpAddress();
+		Nodes nodes = Config.nodes();
+		//同步config文件
+		for (String node : nodes.keySet()) {
+			//其他服务器
+			if (!node.equalsIgnoreCase(localip)) {
+				if (nodes.get(node).getApplication().getEnable() || nodes.get(node).getCenter().getEnable()) {
+					Syncflag = executeSyncFile(syncFilePath, node, nodes.get(node).nodeAgentPort());
+				}
+			}
+		}
+		return  Syncflag;
+	}
+
+	private  static boolean executeSyncFile(String syncFilePath , String nodeName ,int nodePort){
+		boolean syncFileFlag = false;
+		File syncFile;
+		InputStream fileInputStream = null;
+
+		try (Socket socket = new Socket(nodeName, nodePort)) {
+
+			syncFile = new File(Config.base(), syncFilePath);
+			fileInputStream= new FileInputStream(syncFile);
+
+			socket.setKeepAlive(true);
+			socket.setSoTimeout(5000);
+			DataOutputStream dos = null;
+			DataInputStream dis  = null;
+			try {
+				dos = new DataOutputStream(socket.getOutputStream());
+				dis = new DataInputStream(socket.getInputStream());
+
+				Map<String, Object> commandObject = new HashMap<>();
+				commandObject.put("command", "syncFile:"+ syncFilePath);
+				commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey()));
+				dos.writeUTF(XGsonBuilder.toJson(commandObject));
+				dos.flush();
+
+				dos.writeUTF(syncFilePath);
+				dos.flush();
+
+
+				logger.info("同步文件:"+syncFilePath+" starting...");
+				byte[] bytes = new byte[1024];
+				int length =0;
+				while((length = fileInputStream.read(bytes, 0, bytes.length)) != -1) {
+					dos.write(bytes, 0, length);
+					dos.flush();
+				}
+				logger.info("同步文件:" + syncFilePath +"end.");
+
+			}finally {
+				dos.close();
+				dis.close();
+				socket.close();
+				fileInputStream.close();
+			}
+
+			syncFileFlag = true;
+		} catch (Exception ex) {
+			logger.error(ex);
+			syncFileFlag = false;
+		}
+		return syncFileFlag;
+	}
+
+	public static String getIpAddress() {
+		try {
+			Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
+			InetAddress ip = null;
+			while (allNetInterfaces.hasMoreElements()) {
+				NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement();
+				if (netInterface.isLoopback() || netInterface.isVirtual() || !netInterface.isUp()) {
+					continue;
+				} else {
+					Enumeration<InetAddress> addresses = netInterface.getInetAddresses();
+					while (addresses.hasMoreElements()) {
+						ip = addresses.nextElement();
+						if (ip != null && ip instanceof Inet4Address) {
+							return ip.getHostAddress();
+						}
+					}
+				}
+			}
+		} catch (Exception e) {
+			System.err.println("IP地址获取失败" + e.toString());
+		}
+		return "";
+	}
 }

+ 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 {
 }

+ 3 - 3
o2server/x_console/src/main/java/com/x/server/console/ResourceFactory.java

@@ -140,7 +140,7 @@ public class ResourceFactory {
 		for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) {
 			DruidDataSourceC3P0Adapter dataSource = new DruidDataSourceC3P0Adapter();
 			String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
-					+ "/X;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
+					+ "/X;LOCK_MODE=0;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
 					+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE="
 					+ (entry.getValue().getCacheSize() * 1024);
 			dataSource.setJdbcUrl(url);
@@ -170,7 +170,7 @@ public class ResourceFactory {
 			BasicDataSource dataSource = new BasicDataSource();
 
 			String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
-					+ "/X;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
+					+ "/X;LOCK_MODE=0;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
 					+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE="
 					+ (entry.getValue().getCacheSize() * 1024);
 			dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2);
@@ -195,7 +195,7 @@ public class ResourceFactory {
 		for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) {
 			DruidDataSource dataSource = new DruidDataSource();
 			String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
-					+ "/X;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
+					+ "/X;LOCK_MODE=0;DEFAULT_LOCK_TIMEOUT=" + entry.getValue().getLockTimeout() + ";JMX="
 					+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE="
 					+ (entry.getValue().getCacheSize() * 1024);
 			dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2);

+ 11 - 3
o2server/x_console/src/main/java/com/x/server/console/action/DumpData.java

@@ -39,6 +39,7 @@ import com.x.base.core.project.config.StorageMappings;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ClassLoaderTools;
 import com.x.base.core.project.tools.DateTools;
 import com.x.base.core.project.tools.ListTools;
 
@@ -78,7 +79,7 @@ public class DumpData {
 			this.pureGsonDateFormated = XGsonBuilder.instance();
 		}
 
-		public void run() {
+		private Thread dumpDataThread = new Thread(() -> {
 			try {
 				List<String> classNames = entities();
 				logger.print("find {} data to dump, start at {}.", classNames.size(), DateTools.format(start));
@@ -95,9 +96,12 @@ public class DumpData {
 					EntityManagerFactory emf = null;
 					EntityManager em = null;
 					try {
+						Thread.currentThread().setContextClassLoader(ClassLoaderTools.urlClassLoader(false,false,false,
+								false, false, Config.dir_local_temp_classes().toPath()));
 						Thread.currentThread().setName(DumpData.class.getName() + ":" + className);
 						@SuppressWarnings("unchecked")
-						Class<JpaObject> cls = (Class<JpaObject>) Class.forName(className);
+						Class<JpaObject> cls = (Class<JpaObject>) Thread.currentThread().getContextClassLoader()
+								.loadClass(className);
 						emf = OpenJPAPersistence.createEntityManagerFactory(cls.getName(), xml.getFileName().toString(),
 								PersistenceXmlHelper.properties(cls.getName(), Config.slice().getEnable()));
 						em = emf.createEntityManager();
@@ -120,6 +124,10 @@ public class DumpData {
 			} catch (Exception e) {
 				e.printStackTrace();
 			}
+		}, "dumpDataThread");
+
+		public void run() {
+			dumpDataThread.start();
 		}
 
 		@SuppressWarnings("unchecked")
@@ -130,7 +138,7 @@ public class DumpData {
 				return list;
 			}
 			for (String str : (List<String>) Config.resource(Config.RESOURCE_CONTAINERENTITYNAMES)) {
-				Class<?> cls = Class.forName(str);
+				Class<?> cls = Thread.currentThread().getContextClassLoader().loadClass(str);
 				ContainerEntity containerEntity = cls.getAnnotation(ContainerEntity.class);
 				if (Objects.equals(containerEntity.reference(), Reference.strong)) {
 					list.add(str);

+ 4 - 3
o2server/x_console/src/main/java/com/x/server/console/action/EraseContent.java

@@ -61,8 +61,8 @@ public abstract class EraseContent {
 	protected void run() throws Exception {
 		new Thread(() -> {
 			try {
-				Thread.currentThread().setContextClassLoader(ClassLoaderTools.urlClassLoader(false, true, true, true,
-						true, Config.dir_local_temp_classes().toPath()));
+				Thread.currentThread().setContextClassLoader(ClassLoaderTools.urlClassLoader(false, false, false, false,
+						false, Config.dir_local_temp_classes().toPath()));
 				logger.print("erase {} content data: start at {}.", name, DateTools.format(start));
 				this.classNames = ListUtils.intersection(this.classNames,
 						(List<String>) Config.resource(Config.RESOURCE_CONTAINERENTITYNAMES));
@@ -77,7 +77,6 @@ public abstract class EraseContent {
 							persistence.getName(),
 							PersistenceXmlHelper.properties(cls.getName(), Config.slice().getEnable()));
 					EntityManager em = emf.createEntityManager();
-
 					if (DataItem.class.isAssignableFrom(cls)) {
 						Long total = this.estimateItemCount(em, cls);
 						logger.print("erase {} content data:{}, total {}.", name, cls.getName(), total);
@@ -87,6 +86,8 @@ public abstract class EraseContent {
 						logger.print("erase {} content data:{}, total {}.", name, cls.getName(), total);
 						this.erase(cls, em, storageMappings, total);
 					}
+					em.close();
+					emf.close();
 				}
 				Date end = new Date();
 				logger.print("erase {} content data: completed at {}, elapsed {} ms.", name, DateTools.format(end),

+ 2 - 0
o2server/x_console/src/main/java/com/x/server/console/action/EraseContentCms.java

@@ -12,6 +12,7 @@ import com.x.cms.core.entity.FileInfo;
 import com.x.cms.core.entity.Log;
 import com.x.cms.core.entity.ReadRemind;
 import com.x.cms.core.entity.Review;
+import com.x.query.core.entity.Item;
 
 public class EraseContentCms extends EraseContent {
 
@@ -29,6 +30,7 @@ public class EraseContentCms extends EraseContent {
 		addClass(DocumentCommentCommend.class);
 		addClass(DocumentCommend.class);
 		addClass(CmsBatchOperation.class);
+		addClass(Item.class);
 		this.run();
 		return true;
 	}

+ 6 - 2
o2server/x_console/src/main/java/com/x/server/console/action/RestoreData.java

@@ -38,6 +38,7 @@ import com.x.base.core.project.config.StorageMappings;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ClassLoaderTools;
 import com.x.base.core.project.tools.DateTools;
 import com.x.base.core.project.tools.ListTools;
 
@@ -100,10 +101,13 @@ public class RestoreData {
 				AtomicLong total = new AtomicLong(0);
 				stream.forEach(className -> {
 					String nameOfThread = Thread.currentThread().getName();
-					Thread.currentThread().setName(RestoreData.class.getName() + ":" + className);
 					try {
+						Thread.currentThread().setContextClassLoader(ClassLoaderTools.urlClassLoader(false, false,
+								false, false, false, Config.dir_local_temp_classes().toPath()));
+						Thread.currentThread().setName(RestoreData.class.getName() + ":" + className);
 						@SuppressWarnings("unchecked")
-						Class<JpaObject> cls = (Class<JpaObject>) Class.forName(className);
+						Class<JpaObject> cls = (Class<JpaObject>) Thread.currentThread().getContextClassLoader()
+								.loadClass(className);
 						logger.print("restore data({}/{}): {}.", idx.getAndAdd(1), classNames.size(), cls.getName());
 						long size = restore(cls, xml);
 						total.getAndAdd(size);

+ 3 - 3
o2server/x_console/src/main/java/com/x/server/console/server/application/ApplicationServerTools.java

@@ -305,7 +305,7 @@ public class ApplicationServerTools extends JettySeverTools {
 			throws Exception {
 		List<String> names = new ArrayList<>();
 		officialClassInfos.stream().map(ClassInfo::getSimpleName).forEach(names::add);
-		// names.addAll(customNames);
+		names.addAll(customNames);
 		for (String str : Config.dir_servers_applicationServer_work(true).list()) {
 			if (!names.contains(str)) {
 				FileUtils.forceDelete(new File(Config.dir_servers_applicationServer_work(), str));
@@ -316,7 +316,7 @@ public class ApplicationServerTools extends JettySeverTools {
 	private static void modified(Path war, Path dir) throws IOException {
 		Path lastModified = Paths.get(dir.toString(), PathTools.WEB_INF_LASTMODIFIED);
 		if ((!Files.exists(lastModified)) || Files.isDirectory(lastModified)
-				|| (Files.getLastModifiedTime(lastModified).toMillis() != NumberUtils
+				|| (Files.getLastModifiedTime(war).toMillis() != NumberUtils
 						.toLong(FileUtils.readFileToString(lastModified.toFile(), DefaultCharset.charset_utf_8), 0))) {
 			logger.print("deploy war:{}.", war.getFileName().toAbsolutePath());
 			if (Files.exists(dir)) {
@@ -327,7 +327,7 @@ public class ApplicationServerTools extends JettySeverTools {
 				Files.createDirectories(lastModified.getParent());
 				Files.createFile(lastModified);
 			}
-			FileUtils.writeStringToFile(lastModified.toFile(), Files.getLastModifiedTime(lastModified).toMillis() + "",
+			FileUtils.writeStringToFile(lastModified.toFile(), Files.getLastModifiedTime(war).toMillis() + "",
 					DefaultCharset.charset_utf_8, false);
 		}
 	}

+ 37 - 23
o2server/x_console/src/main/java/com/x/server/console/server/center/CenterServerTools.java

@@ -1,11 +1,17 @@
 package com.x.server.console.server.center;
 
 import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.EnumSet;
 
 import javax.servlet.DispatcherType;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.file.PathUtils;
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.eclipse.jetty.quickstart.QuickStartWebApp;
@@ -25,14 +31,15 @@ import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.DefaultCharset;
 import com.x.base.core.project.tools.JarTools;
+import com.x.base.core.project.tools.PathTools;
 import com.x.server.console.server.JettySeverTools;
 
 public class CenterServerTools extends JettySeverTools {
 
 	private static Logger logger = LoggerFactory.getLogger(CenterServerTools.class);
 
-	private static int CENTERSERVER_THREAD_POOL_SIZE_MIN = 50;
-	private static int CENTERSERVER_THREAD_POOL_SIZE_MAX = 500;
+	private static final int CENTERSERVER_THREAD_POOL_SIZE_MIN = 50;
+	private static final int CENTERSERVER_THREAD_POOL_SIZE_MAX = 500;
 
 	public static Server start(CenterServer centerServer) throws Exception {
 
@@ -40,22 +47,24 @@ public class CenterServerTools extends JettySeverTools {
 
 		HandlerList handlers = new HandlerList();
 
-		File war = new File(Config.dir_store(), x_program_center.class.getSimpleName() + ".war");
-		File dir = new File(Config.dir_servers_centerServer_work(true), x_program_center.class.getSimpleName());
-		if (war.exists()) {
+		Path war = Paths.get(Config.dir_store().toString(), x_program_center.class.getSimpleName() + PathTools.DOT_WAR);
+		Path dir = Paths.get(Config.dir_servers_centerServer_work(true).toString(),
+				x_program_center.class.getSimpleName());
+		if (Files.exists(war)) {
 			modified(war, dir);
 			QuickStartWebApp webApp = new QuickStartWebApp();
 			webApp.setAutoPreconfigure(false);
 			webApp.setDisplayName(x_program_center.class.getSimpleName());
 			webApp.setContextPath("/" + x_program_center.class.getSimpleName());
-			webApp.setResourceBase(dir.getAbsolutePath());
-			webApp.setDescriptor(new File(dir, "WEB-INF/web.xml").getAbsolutePath());
+			webApp.setResourceBase(dir.toAbsolutePath().toString());
+			webApp.setDescriptor(dir.resolve(Paths.get(PathTools.WEB_INF_WEB_XML)).toString());
 			webApp.setExtraClasspath(calculateExtraClassPath(x_program_center.class));
-			webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
-			webApp.getInitParams().put("org.eclipse.jetty.jsp.precompiled", "true");
-			webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
-			/* stat */
-			if (centerServer.getStatEnable()) {
+			webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer",
+					BooleanUtils.toStringTrueFalse(false));
+			webApp.getInitParams().put("org.eclipse.jetty.jsp.precompiled", BooleanUtils.toStringTrueFalse(true));
+			webApp.getInitParams().put("org.eclipse.jetty.servlet.Default.dirAllowed",
+					BooleanUtils.toStringTrueFalse(false));
+			if (BooleanUtils.isTrue(centerServer.getStatEnable())) {
 				FilterHolder statFilterHolder = new FilterHolder(new WebStatFilter());
 				statFilterHolder.setInitParameter("exclusions", centerServer.getStatExclusions());
 				webApp.addFilter(statFilterHolder, "/*", EnumSet.of(DispatcherType.REQUEST));
@@ -63,10 +72,9 @@ public class CenterServerTools extends JettySeverTools {
 				statServletHolder.setInitParameter("sessionStatEnable", "false");
 				webApp.addServlet(statServletHolder, "/druid/*");
 			}
-			/* stat end */
 			handlers.addHandler(webApp);
 		} else {
-			throw new Exception("centerServer war not exist.");
+			throw new IOException("centerServer war not exist.");
 		}
 
 		QueuedThreadPool threadPool = new QueuedThreadPool();
@@ -75,7 +83,7 @@ public class CenterServerTools extends JettySeverTools {
 		Server server = new Server(threadPool);
 		server.setAttribute("maxFormContentSize", centerServer.getMaxFormContent() * 1024 * 1024);
 
-		if (centerServer.getSslEnable()) {
+		if (BooleanUtils.isTrue(centerServer.getSslEnable())) {
 			addHttpsConnector(server, centerServer.getPort());
 		} else {
 			addHttpConnector(server, centerServer.getPort());
@@ -106,16 +114,22 @@ public class CenterServerTools extends JettySeverTools {
 		}
 	}
 
-	private static void modified(File war, File dir) throws Exception {
-		File lastModified = new File(dir, "WEB-INF/lastModified");
-		if ((!lastModified.exists()) || lastModified.isDirectory() || (war.lastModified() != NumberUtils
-				.toLong(FileUtils.readFileToString(lastModified, DefaultCharset.charset_utf_8), 0))) {
-			if (dir.exists()) {
-				FileUtils.forceDelete(dir);
+	private static void modified(Path war, Path dir) throws IOException {
+		Path lastModified = Paths.get(dir.toString(), PathTools.WEB_INF_LASTMODIFIED);
+		if ((!Files.exists(lastModified)) || Files.isDirectory(lastModified)
+				|| (Files.getLastModifiedTime(war).toMillis() != NumberUtils
+						.toLong(FileUtils.readFileToString(lastModified.toFile(), DefaultCharset.charset_utf_8), 0))) {
+			logger.print("deploy war:{}.", war.getFileName().toAbsolutePath());
+			if (Files.exists(dir)) {
+				PathUtils.cleanDirectory(dir);
 			}
 			JarTools.unjar(war, "", dir, true);
-			FileUtils.writeStringToFile(lastModified, war.lastModified() + "", DefaultCharset.charset_utf_8, false);
+			if (!Files.exists(lastModified)) {
+				Files.createDirectories(lastModified.getParent());
+				Files.createFile(lastModified);
+			}
+			FileUtils.writeStringToFile(lastModified.toFile(), Files.getLastModifiedTime(war).toMillis() + "",
+					DefaultCharset.charset_utf_8, false);
 		}
 	}
-
 }

+ 52 - 0
o2server/x_console/src/main/java/com/x/server/console/server/web/Proxy.java

@@ -0,0 +1,52 @@
+package com.x.server.console.server.web;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.eclipse.jetty.proxy.ProxyServlet;
+
+public class Proxy extends ProxyServlet {
+
+	private static final long serialVersionUID = 2737360000716631564L;
+
+	@Override
+	protected String rewriteTarget(HttpServletRequest request) {
+		String url = request.getRequestURL().toString();
+		return target(url, this.getServletConfig().getInitParameter("port"));
+	}
+
+	private String target(String url, String port) {
+		int x = StringUtils.indexOf(url, ":", 8);
+		int y = StringUtils.indexOf(url, "/", 8);
+		if ((x > 0) && (y > 0)) {
+			return url.substring(0, x) + port(url, port) + url.substring(y);
+		} else if (y > 0) {
+			return url.substring(0, y) + port(url, port) + url.substring(y);
+		} else {
+			return null;
+		}
+	}
+
+	private String port(String url, String port) {
+		if (StringUtils.startsWithIgnoreCase(url, "https://")) {
+			if (StringUtils.equals(port, "443")) {
+				return "";
+			}
+		} else if (StringUtils.startsWithIgnoreCase(url, "http://")) {
+			if (StringUtils.equals(port, "80")) {
+				return "";
+			}
+		}
+		return ":" + port;
+	}
+
+//	@Test
+//	public void test1() {
+//		System.out.println(target("http://www.o2oa.net:20030/111/22?1=1", "80"));
+//		System.out.println(target("http://www.o2oa.net:20030/111/22?1=1", "81"));
+//		System.out.println(target("https://www.o2oa.net:20030/111/22?1=1", "80"));
+//		System.out.println(target("https://www.o2oa.net:20030/111/22?1=1", "443"));
+//		System.out.println(target("https://www.o2oa.net:20030/111/22?1=1", "4430"));
+//	}
+
+}

+ 45 - 7
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;
@@ -104,6 +109,16 @@ public class WebServerTools extends JettySeverTools {
 		}
 		/* stat end */
 		server.setHandler(context);
+
+		if (BooleanUtils.isTrue(webServer.getProxyCenterEnable())) {
+			proxyCenter(context);
+		}
+
+		if (BooleanUtils.isTrue(webServer.getProxyApplicationEnable())) {
+			proxyApplication(context, Config.dir_store().toPath());
+			proxyApplication(context, Config.dir_custom().toPath());
+		}
+
 		server.setDumpAfterStart(false);
 		server.setDumpBeforeStop(false);
 		server.setStopAtShutdown(true);
@@ -117,6 +132,29 @@ public class WebServerTools extends JettySeverTools {
 		return server;
 	}
 
+	private static void proxyCenter(WebAppContext context) throws Exception {
+		ServletHolder proxyHolder = new ServletHolder(Proxy.class);
+		proxyHolder.setInitParameter("port", Config.currentNode().getCenter().getPort() + "");
+		context.addServlet(proxyHolder, "/" + x_program_center.class.getSimpleName() + "/*");
+	}
+
+	private static void proxyApplication(WebAppContext context, Path path) throws Exception {
+		try (Stream<Path> stream = Files.list(path)) {
+			stream.filter(o -> StringUtils.endsWithIgnoreCase(o.getFileName().toString(), ".war"))
+					.map(Path::getFileName).map(Path::toString).map(FilenameUtils::getBaseName)
+					.filter(o -> !StringUtils.equals(o, x_program_center.class.getSimpleName())).forEach(o -> {
+						try {
+							ServletHolder proxyHolder = new ServletHolder(Proxy.class);
+							proxyHolder.setInitParameter("port", Config.currentNode().getApplication().getPort() + "");
+							context.addServlet(proxyHolder, "/" + o + "/*");
+						} catch (Exception e) {
+							logger.error(e);
+						}
+					});
+		}
+	}
+
+
 	private static void copyDefaultHtml() throws Exception {
 		File file = new File(Config.dir_config(), "default.html");
 		if (file.exists() && file.isFile()) {
@@ -205,16 +243,16 @@ public class WebServerTools extends JettySeverTools {
 			/* 密码规则 */
 			map.put("passwordRegex", Config.person().getPasswordRegex());
 			map.put("passwordRegexHint", Config.person().getPasswordRegexHint());
-			
-		    /*RSA*/
+
+			/* RSA */
 			File publicKeyFile = new File(Config.base(), "config/public.key");
 			if (publicKeyFile.exists() && publicKeyFile.isFile()) {
-					 String publicKey = FileUtils.readFileToString(publicKeyFile, "utf-8");
-					 byte[] publicKeyB = Base64.decodeBase64(publicKey);
-					 publicKey = new String(Base64.encodeBase64(publicKeyB));
-					 map.put("publicKey", publicKey);
+				String publicKey = FileUtils.readFileToString(publicKeyFile, "utf-8");
+				byte[] publicKeyB = Base64.decodeBase64(publicKey);
+				publicKey = new String(Base64.encodeBase64(publicKeyB));
+				map.put("publicKey", publicKey);
 			}
-			
+
 			FileUtils.writeStringToFile(file, gson.toJson(map), DefaultCharset.charset);
 		}
 	}

+ 0 - 1994
o2server/x_portal_assemble_surface/src/main/webapp/describe/describe.json

@@ -1,1994 +0,0 @@
-{
-  "jaxrs": [
-    {
-      "name": "CacheAction",
-      "className": "com.x.base.core.project.jaxrs.cache.CacheAction",
-      "description": "缓存操作",
-      "methods": [
-        {
-          "name": "configFlush",
-          "className": "com.x.base.core.project.jaxrs.cache.ActionConfigFlush",
-          "description": "接收config flush 信号.",
-          "type": "GET",
-          "path": "jaxrs/cache/config/flush",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        },
-        {
-          "name": "receive",
-          "className": "com.x.base.core.project.jaxrs.cache.ActionReceive",
-          "description": "接收Cache刷新信息.",
-          "type": "PUT",
-          "path": "jaxrs/cache",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [
-            {
-              "name": "nodeName",
-              "type": "String",
-              "isCollection": false,
-              "description": "节点名",
-              "isBaseType": true
-            },
-            {
-              "name": "className",
-              "type": "String",
-              "isCollection": false,
-              "description": "类名",
-              "isBaseType": true
-            },
-            {
-              "name": "keys",
-              "type": "List\u003cObject\u003e",
-              "isCollection": true,
-              "description": "关键字",
-              "isBaseType": false
-            }
-          ],
-          "outs": [
-            {
-              "name": "value",
-              "type": "String",
-              "isCollection": false,
-              "description": "字符串值"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "EchoAction",
-      "className": "com.x.base.core.project.jaxrs.echo.EchoAction",
-      "description": "响应",
-      "methods": [
-        {
-          "name": "get",
-          "className": "com.x.base.core.project.jaxrs.echo.ActionGet",
-          "description": "获取应答.",
-          "type": "GET",
-          "path": "jaxrs/echo",
-          "contentType": "application/json",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "servletContextName",
-              "type": "String",
-              "isCollection": false,
-              "description": "上下文根"
-            },
-            {
-              "name": "serverTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "服务器时间"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "FileAction",
-      "className": "com.x.portal.assemble.surface.jaxrs.file.FileAction",
-      "description": "文件操作",
-      "methods": [
-        {
-          "name": "content",
-          "className": "com.x.portal.assemble.surface.jaxrs.file.ActionContent",
-          "description": "访问文件内容.",
-          "type": "GET",
-          "path": "jaxrs/file/{flag}/portal/{portalFlag}/content",
-          "contentType": "application/json",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "应用标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "contentDisposition",
-              "type": "String",
-              "isCollection": false,
-              "description": "说明"
-            },
-            {
-              "name": "contentType",
-              "type": "String",
-              "isCollection": false,
-              "description": "类型"
-            },
-            {
-              "name": "bytes",
-              "type": "byte[]",
-              "isCollection": false,
-              "description": "字节内容."
-            }
-          ]
-        },
-        {
-          "name": "download",
-          "className": "com.x.portal.assemble.surface.jaxrs.file.ActionDownload",
-          "description": "访问文件内容.义stream格式下载",
-          "type": "GET",
-          "path": "jaxrs/file/{flag}/portal/{portalFlag}/download",
-          "contentType": "application/json",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "应用标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "contentDisposition",
-              "type": "String",
-              "isCollection": false,
-              "description": "说明"
-            },
-            {
-              "name": "contentType",
-              "type": "String",
-              "isCollection": false,
-              "description": "类型"
-            },
-            {
-              "name": "bytes",
-              "type": "byte[]",
-              "isCollection": false,
-              "description": "字节内容."
-            }
-          ]
-        },
-        {
-          "name": "listWithPortal",
-          "className": "com.x.portal.assemble.surface.jaxrs.file.ActionListWithPortal",
-          "description": "列示指定站点的下所有可见的文件.",
-          "type": "GET",
-          "path": "jaxrs/file/list/portal/{portalFlag}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "文件名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "文件别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "文件所属门户."
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "最后的编辑者."
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "最后的编辑时间."
-            },
-            {
-              "name": "fileName",
-              "type": "String",
-              "isCollection": false,
-              "description": "文件名称."
-            },
-            {
-              "name": "length",
-              "type": "Long",
-              "isCollection": false,
-              "description": "文件大小."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "FireScheduleAction",
-      "className": "com.x.base.core.project.jaxrs.fireschedule.FireScheduleAction",
-      "description": "触发任务",
-      "methods": [
-        {
-          "name": "execute",
-          "className": "com.x.base.core.project.jaxrs.fireschedule.ActionExecute",
-          "description": "接受x_program_center发送过来的运行schedule.",
-          "type": "GET",
-          "path": "jaxrs/fireschedule/classname/{className}",
-          "contentType": "application/json",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "className",
-              "type": "String",
-              "description": "运行类"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "LoggerAction",
-      "className": "com.x.base.core.project.jaxrs.logger.LoggerAction",
-      "description": "日志操作",
-      "methods": [
-        {
-          "name": "debug",
-          "className": "com.x.base.core.project.jaxrs.logger.ActionDebug",
-          "description": "设置日志级别为DEBUG.",
-          "type": "GET",
-          "path": "jaxrs/logger/debug",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        },
-        {
-          "name": "get",
-          "className": "com.x.base.core.project.jaxrs.logger.ActionGet",
-          "description": "获取当前日志级别.",
-          "type": "GET",
-          "path": "jaxrs/logger",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "String",
-              "isCollection": false,
-              "description": "字符串值"
-            }
-          ]
-        },
-        {
-          "name": "info",
-          "className": "com.x.base.core.project.jaxrs.logger.ActionInfo",
-          "description": "设置日志级别为INFO",
-          "type": "GET",
-          "path": "jaxrs/logger/info",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        },
-        {
-          "name": "trace",
-          "className": "com.x.base.core.project.jaxrs.logger.ActionTrace",
-          "description": "设置日志级别为TRACE.",
-          "type": "GET",
-          "path": "jaxrs/logger/trace",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        },
-        {
-          "name": "warn",
-          "className": "com.x.base.core.project.jaxrs.logger.ActionWarn",
-          "description": "设置日志级别为WARN",
-          "type": "GET",
-          "path": "jaxrs/logger/warn",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "PageAction",
-      "className": "com.x.portal.assemble.surface.jaxrs.page.PageAction",
-      "description": "页面",
-      "methods": [
-        {
-          "name": "get",
-          "className": "com.x.portal.assemble.surface.jaxrs.page.ActionGet",
-          "description": "获取Page内容.",
-          "type": "GET",
-          "path": "jaxrs/page/{id}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getMobile",
-          "className": "com.x.portal.assemble.surface.jaxrs.page.ActionGetMobile",
-          "description": "获取Page内容Mobile.",
-          "type": "GET",
-          "path": "jaxrs/page/{id}/mobile",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getWithPortal",
-          "className": "com.x.portal.assemble.surface.jaxrs.page.ActionGetWithPortal",
-          "description": "列示属于指定Portal的Page,其中Portal可以用name,alias和id标识,Page为在此Portal下的页面.",
-          "type": "GET",
-          "path": "jaxrs/page/{flag}/portal/{portalFlag}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getWithPortalMobile",
-          "className": "com.x.portal.assemble.surface.jaxrs.page.ActionGetWithPortalMobile",
-          "description": "列示属于指定Portal的Page,其中Portal可以用name,alias和id标识,Page为在此Portal下的页面Mobile.",
-          "type": "GET",
-          "path": "jaxrs/page/{flag}/portal/{portalFlag}/mobile",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "list",
-          "className": "com.x.portal.assemble.surface.jaxrs.page.ActionList",
-          "description": "列示属于指定Portal的Page.",
-          "type": "GET",
-          "path": "jaxrs/page/list/portal/{portal}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "portal",
-              "type": "String",
-              "description": "门户"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "PortalAction",
-      "className": "com.x.portal.assemble.surface.jaxrs.portal.PortalAction",
-      "description": "门户",
-      "methods": [
-        {
-          "name": "get",
-          "className": "com.x.portal.assemble.surface.jaxrs.portal.ActionGet",
-          "description": "获取单个的Portal.",
-          "type": "GET",
-          "path": "jaxrs/portal/{flag}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "availableIdentityList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "在指定启动时候,允许新建的用户."
-            },
-            {
-              "name": "availableUnitList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "在指定启动时候,允许新建的组织."
-            },
-            {
-              "name": "portalCategory",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用分类."
-            },
-            {
-              "name": "icon",
-              "type": "String",
-              "isCollection": false,
-              "description": "icon Base64编码后的文本."
-            },
-            {
-              "name": "firstPage",
-              "type": "String",
-              "isCollection": false,
-              "description": "默认首页."
-            },
-            {
-              "name": "controllerList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "应用管理者。"
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用的创建者。"
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "应用的最后修改时间。"
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用的最后修改者"
-            },
-            {
-              "name": "pcClient",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否在pc终端显示."
-            },
-            {
-              "name": "mobileClient",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否在移动设备显示."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "icon",
-          "className": "com.x.portal.assemble.surface.jaxrs.portal.ActionIcon",
-          "description": "获取Portal的图标.",
-          "type": "GET",
-          "path": "jaxrs/portal/{id}/icon",
-          "contentType": "application/json",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "contentDisposition",
-              "type": "String",
-              "isCollection": false,
-              "description": "说明"
-            },
-            {
-              "name": "contentType",
-              "type": "String",
-              "isCollection": false,
-              "description": "类型"
-            },
-            {
-              "name": "bytes",
-              "type": "byte[]",
-              "isCollection": false,
-              "description": "字节内容."
-            }
-          ]
-        },
-        {
-          "name": "iconBase64",
-          "className": "com.x.portal.assemble.surface.jaxrs.portal.ActionIconBase64",
-          "description": "获取Portal的图标Base64编码.",
-          "type": "GET",
-          "path": "jaxrs/portal/{id}/icon/base64",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "String",
-              "isCollection": false,
-              "description": "字符串值"
-            }
-          ]
-        },
-        {
-          "name": "list",
-          "className": "com.x.portal.assemble.surface.jaxrs.portal.ActionList",
-          "description": "列示当前用户所有可见的Portal.",
-          "type": "GET",
-          "path": "jaxrs/portal/list",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portalCategory",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用分类."
-            },
-            {
-              "name": "icon",
-              "type": "String",
-              "isCollection": false,
-              "description": "icon Base64编码后的文本."
-            },
-            {
-              "name": "firstPage",
-              "type": "String",
-              "isCollection": false,
-              "description": "默认首页."
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用的创建者。"
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "应用的最后修改时间。"
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "应用的最后修改者"
-            },
-            {
-              "name": "pcClient",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否在pc终端显示."
-            },
-            {
-              "name": "mobileClient",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否在移动设备显示."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "ScriptAction",
-      "className": "com.x.portal.assemble.surface.jaxrs.script.ScriptAction",
-      "description": "脚本",
-      "methods": [
-        {
-          "name": "flag",
-          "className": "com.x.portal.assemble.surface.jaxrs.script.ActionFlag",
-          "description": "在指定的Portal下根据flag获取Script.",
-          "type": "POST",
-          "path": "jaxrs/script/portal/{portal}/name/{name}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "name",
-              "type": "String",
-              "description": "名称"
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [
-            {
-              "name": "importedList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "已经导入的脚本",
-              "isBaseType": true
-            }
-          ],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "validated",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "代码格式是否正确."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本所属应用."
-            },
-            {
-              "name": "text",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本内容."
-            },
-            {
-              "name": "dependScriptList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "依赖的函数列表."
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "流程创建者."
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "最后的编辑者."
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "最后的编辑时间."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "get",
-          "className": "com.x.portal.assemble.surface.jaxrs.script.ActionGet",
-          "description": "获取Script内容.",
-          "type": "GET",
-          "path": "jaxrs/script/{id}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "validated",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "代码格式是否正确."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本所属应用."
-            },
-            {
-              "name": "text",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本内容."
-            },
-            {
-              "name": "dependScriptList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "依赖的函数列表."
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "流程创建者."
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "最后的编辑者."
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "最后的编辑时间."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getImported",
-          "className": "com.x.portal.assemble.surface.jaxrs.script.ActionGetImported",
-          "description": "获取Script内容,并递归附带应用脚本.",
-          "type": "GET",
-          "path": "jaxrs/script/portal/{portal}/name/{name}/imported",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "name",
-              "type": "String",
-              "description": "名称"
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "validated",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "代码格式是否正确."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本所属应用."
-            },
-            {
-              "name": "text",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本内容."
-            },
-            {
-              "name": "dependScriptList",
-              "type": "List\u003cString\u003e",
-              "isCollection": true,
-              "description": "依赖的函数列表."
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "流程创建者."
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "最后的编辑者."
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "最后的编辑时间."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "list",
-          "className": "com.x.portal.assemble.surface.jaxrs.script.ActionList",
-          "description": "列示属于指定Portal的Script.",
-          "type": "GET",
-          "path": "jaxrs/script/list/portal/{portal}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "portal",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "validated",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "代码格式是否正确."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "脚本所属应用."
-            },
-            {
-              "name": "creatorPerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "流程创建者."
-            },
-            {
-              "name": "lastUpdatePerson",
-              "type": "String",
-              "isCollection": false,
-              "description": "最后的编辑者."
-            },
-            {
-              "name": "lastUpdateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "最后的编辑时间."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "SysResourceAction",
-      "className": "com.x.base.core.project.jaxrs.sysresource.SysResourceAction",
-      "description": "系统资源",
-      "methods": [
-        {
-          "name": "listResource",
-          "className": "com.x.base.core.project.jaxrs.sysresource.ActionListResource",
-          "description": "获取静态资源信息.",
-          "type": "GET",
-          "path": "jaxrs/sysresource/filePath/{filePath}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "filePath",
-              "type": "String",
-              "description": "查找路径(根路径:(0))"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": []
-        },
-        {
-          "name": "uploadResource",
-          "className": "com.x.base.core.project.jaxrs.sysresource.ActionUploadResource",
-          "description": "上传静态资源(仅上传到当前服务器)",
-          "type": "POST",
-          "path": "jaxrs/sysresource/upload/resource/as/new/{asNew}",
-          "contentType": "multipart/form-data",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": true,
-          "pathParameters": [
-            {
-              "name": "asNew",
-              "type": "Boolean",
-              "description": "覆盖类型:true删除原文件然后上传,false覆盖原文件"
-            }
-          ],
-          "formParameters": [
-            {
-              "name": "file",
-              "type": "File",
-              "description": "上传文件"
-            },
-            {
-              "name": "fileName",
-              "type": "String",
-              "description": "附件名称"
-            },
-            {
-              "name": "filePath",
-              "type": "String",
-              "description": "附件存放目录(可以为空)"
-            }
-          ],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "value",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "布尔值."
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "WidgetAction",
-      "className": "com.x.portal.assemble.surface.jaxrs.widget.WidgetAction",
-      "description": "部件",
-      "methods": [
-        {
-          "name": "get",
-          "className": "com.x.portal.assemble.surface.jaxrs.widget.ActionGet",
-          "description": "获取部件内容.",
-          "type": "GET",
-          "path": "jaxrs/widget/{id}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getMobile",
-          "className": "com.x.portal.assemble.surface.jaxrs.widget.ActionGetMobile",
-          "description": "获取部件内容Mobile.",
-          "type": "GET",
-          "path": "jaxrs/widget/{id}/mobile",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "id",
-              "type": "String",
-              "description": "标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getWithPortal",
-          "className": "com.x.portal.assemble.surface.jaxrs.widget.ActionGetWithPortal",
-          "description": "列示属于指定Portal的部件,其中Portal可以用name,alias和id标识,部件为在此Portal下的页面.",
-          "type": "GET",
-          "path": "jaxrs/widget/{flag}/portal/{portalFlag}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "getWithPortalMobile",
-          "className": "com.x.portal.assemble.surface.jaxrs.widget.ActionGetWithPortalMobile",
-          "description": "列示属于指定Portal的部件,其中Portal可以用name,alias和id标识,部件为在此Portal下的页面Mobile.",
-          "type": "GET",
-          "path": "jaxrs/widget/{flag}/portal/{portalFlag}/mobile",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "flag",
-              "type": "String",
-              "description": "标识"
-            },
-            {
-              "name": "portalFlag",
-              "type": "String",
-              "description": "门户标识"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        },
-        {
-          "name": "list",
-          "className": "com.x.portal.assemble.surface.jaxrs.widget.ActionList",
-          "description": "列示属于指定Portal的部件.",
-          "type": "GET",
-          "path": "jaxrs/widget/list/portal/{portal}",
-          "contentType": "application/json",
-          "resultContentType": "application/json; charset\u003dUTF-8",
-          "useJsonElementParameter": false,
-          "useStringParameter": false,
-          "pathParameters": [
-            {
-              "name": "portal",
-              "type": "String",
-              "description": "门户"
-            }
-          ],
-          "formParameters": [],
-          "queryParameters": [],
-          "ins": [],
-          "outs": [
-            {
-              "name": "id",
-              "type": "String",
-              "isCollection": false,
-              "description": "数据库主键,自动生成."
-            },
-            {
-              "name": "name",
-              "type": "String",
-              "isCollection": false,
-              "description": "名称."
-            },
-            {
-              "name": "alias",
-              "type": "String",
-              "isCollection": false,
-              "description": "别名."
-            },
-            {
-              "name": "description",
-              "type": "String",
-              "isCollection": false,
-              "description": "描述."
-            },
-            {
-              "name": "portal",
-              "type": "String",
-              "isCollection": false,
-              "description": "所属的Portal."
-            },
-            {
-              "name": "hasMobile",
-              "type": "Boolean",
-              "isCollection": false,
-              "description": "是否有移动端内容."
-            },
-            {
-              "name": "createTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "创建时间,自动生成,索引创建在约束中."
-            },
-            {
-              "name": "updateTime",
-              "type": "Date",
-              "isCollection": false,
-              "description": "修改时间,自动生成,索引创建在约束中."
-            }
-          ]
-        }
-      ]
-    }
-  ]
-}

+ 0 - 28
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/AbstractFactory.java

@@ -1,28 +0,0 @@
-package com.x.portal.assemble.surface;
-
-import com.x.base.core.container.EntityManagerContainer;
-
-public abstract class AbstractFactory {
-
-	private Business business;
-
-	public AbstractFactory(Business business) throws Exception {
-		try {
-			if (null == business) {
-				throw new Exception("business can not be null.");
-			}
-			this.business = business;
-		} catch (Exception e) {
-			throw new Exception("can not instantiating factory.");
-		}
-	}
-
-	public EntityManagerContainer entityManagerContainer() throws Exception {
-		return this.business.entityManagerContainer();
-	}
-
-	public Business business() throws Exception {
-		return this.business;
-	}
-
-}

+ 0 - 33
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ApplicationServletContextListener.java

@@ -1,33 +0,0 @@
-package com.x.portal.assemble.surface;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-import com.x.base.core.project.Context;
-
-@WebListener
-public class ApplicationServletContextListener implements ServletContextListener {
-
-	@Override
-	public void contextInitialized(ServletContextEvent servletContextEvent) {
-		try {
-			ThisApplication.context = Context.concrete(servletContextEvent);
-			ThisApplication.init();
-			ThisApplication.context().regist();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	@Override
-	public void contextDestroyed(ServletContextEvent servletContextEvent) {
-		try {
-			ThisApplication.destroy();
-			ThisApplication.context.destrory(servletContextEvent);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 77
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/Business.java

@@ -1,77 +0,0 @@
-package com.x.portal.assemble.surface;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.organization.core.express.Organization;
-import com.x.portal.assemble.surface.factory.FileFactory;
-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;
-
-public class Business {
-
-	private EntityManagerContainer emc;
-
-	public Business(EntityManagerContainer emc) throws Exception {
-		this.emc = emc;
-	}
-
-	public EntityManagerContainer entityManagerContainer() {
-		return this.emc;
-	}
-
-	private Organization organization;
-
-	public Organization organization() throws Exception {
-		if (null == this.organization) {
-			this.organization = new Organization(ThisApplication.context());
-		}
-		return organization;
-	}
-
-	private PortalFactory portal;
-
-	public PortalFactory portal() throws Exception {
-		if (null == this.portal) {
-			this.portal = new PortalFactory(this);
-		}
-		return portal;
-	}
-
-	private WidgetFactory widget;
-
-	public WidgetFactory widget() throws Exception {
-		if (null == this.widget) {
-			this.widget = new WidgetFactory(this);
-		}
-		return widget;
-	}
-
-	private PageFactory page;
-
-	public PageFactory page() throws Exception {
-		if (null == this.page) {
-			this.page = new PageFactory(this);
-		}
-		return page;
-	}
-
-	private ScriptFactory script;
-
-	public ScriptFactory script() throws Exception {
-		if (null == this.script) {
-			this.script = new ScriptFactory(this);
-		}
-		return script;
-	}
-
-	private FileFactory file;
-
-	public FileFactory file() throws Exception {
-		if (null == this.file) {
-			this.file = new FileFactory(this);
-		}
-		return file;
-	}
-
-}

+ 0 - 97
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/Control.java

@@ -1,97 +0,0 @@
-package com.x.portal.assemble.surface;
-
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class Control extends GsonPropertyObject {
-	/* 是否可以看到 */
-	private Boolean allowVisit;
-	/* 是否可以直接流转 */
-	private Boolean allowProcessing;
-	/* 是否可以处理待阅 */
-	private Boolean allowReadProcessing;
-	/* 是否可以保存数据 */
-	private Boolean allowSave;
-	/* 是否可以重置处理人 */
-	private Boolean allowReset;
-	/* 是否可以待阅处理人 */
-	private Boolean allowReadReset;
-	/* 是否可以召回 */
-	private Boolean allowRetract;
-	/* 是否可以调度 */
-	private Boolean allowReroute;
-	/* 是否可以删除 */
-	private Boolean allowDelete;
-
-	public Boolean getAllowSave() {
-		return allowSave;
-	}
-
-	public void setAllowSave(Boolean allowSave) {
-		this.allowSave = allowSave;
-	}
-
-	public Boolean getAllowReset() {
-		return allowReset;
-	}
-
-	public void setAllowReset(Boolean allowReset) {
-		this.allowReset = allowReset;
-	}
-
-	public Boolean getAllowRetract() {
-		return allowRetract;
-	}
-
-	public void setAllowRetract(Boolean allowRetract) {
-		this.allowRetract = allowRetract;
-	}
-
-	public Boolean getAllowReroute() {
-		return allowReroute;
-	}
-
-	public void setAllowReroute(Boolean allowReroute) {
-		this.allowReroute = allowReroute;
-	}
-
-	public Boolean getAllowProcessing() {
-		return allowProcessing;
-	}
-
-	public void setAllowProcessing(Boolean allowProcessing) {
-		this.allowProcessing = allowProcessing;
-	}
-
-	public Boolean getAllowDelete() {
-		return allowDelete;
-	}
-
-	public void setAllowDelete(Boolean allowDelete) {
-		this.allowDelete = allowDelete;
-	}
-
-	public Boolean getAllowVisit() {
-		return allowVisit;
-	}
-
-	public void setAllowVisit(Boolean allowVisit) {
-		this.allowVisit = allowVisit;
-	}
-
-	public Boolean getAllowReadProcessing() {
-		return allowReadProcessing;
-	}
-
-	public void setAllowReadProcessing(Boolean allowReadProcessing) {
-		this.allowReadProcessing = allowReadProcessing;
-	}
-
-	public Boolean getAllowReadReset() {
-		return allowReadReset;
-	}
-
-	public void setAllowReadReset(Boolean allowReadReset) {
-		this.allowReadReset = allowReadReset;
-	}
-
-}

+ 0 - 37
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ThisApplication.java

@@ -1,37 +0,0 @@
-package com.x.portal.assemble.surface;
-
-import com.x.base.core.project.Context;
-import com.x.base.core.project.cache.CacheManager;
-import com.x.base.core.project.config.Config;
-import com.x.base.core.project.logger.LoggerFactory;
-
-public class ThisApplication {
-
-	private ThisApplication() {
-		// nothing
-	}
-
-	protected static Context context;
-
-	public static Context context() {
-		return context;
-	}
-
-	public static void init() {
-		try {
-			CacheManager.init(context.clazz().getSimpleName());
-			LoggerFactory.setLevel(Config.logLevel().x_portal_assemble_surface());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-	public static void destroy() {
-		try {
-			CacheManager.shutdown();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 74
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/FileFactory.java

@@ -1,74 +0,0 @@
-package com.x.portal.assemble.surface.factory;
-
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import com.x.portal.assemble.surface.AbstractFactory;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.File;
-import com.x.portal.core.entity.File_;
-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 java.util.Optional;
-
-public class FileFactory extends AbstractFactory {
-
-	static CacheCategory cache = new CacheCategory(File.class);
-
-	public FileFactory(Business abstractBusiness) throws Exception {
-		super(abstractBusiness);
-	}
-
-	public File pick(String id) throws Exception {
-		CacheKey cacheKey = new CacheKey(id);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (File) optional.get();
-		} else {
-			File o = this.business().entityManagerContainer().find(id, File.class);
-			if (null != o) {
-				this.business().entityManagerContainer().get(File.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-
-	public List<File> listWithPortalObject(String portalId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(File.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<File> cq = cb.createQuery(File.class);
-		Root<File> root = cq.from(File.class);
-		Predicate p = cb.equal(root.get(File_.portal), portalId);
-		List<File> list = em.createQuery(cq.select(root).where(p)).getResultList();
-		return list;
-	}
-
-	public List<String> listWithPortal(String portalId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(File.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<File> root = cq.from(File.class);
-		Predicate p = cb.equal(root.get(File_.portal), portalId);
-		List<String> list = em.createQuery(cq.select(root.get(File_.id)).where(p)).getResultList();
-		return list;
-	}
-	
-	public <T extends File> List<T> sort(List<T> list) {
-		list = list.stream()
-				.sorted(Comparator.comparing(File::getAlias, Comparator.nullsLast(String::compareTo))
-						.thenComparing(File::getName, Comparator.nullsLast(String::compareTo)))
-				.collect(Collectors.toList());
-		return list;
-	}
-
-}

+ 0 - 70
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PageFactory.java

@@ -1,70 +0,0 @@
-package com.x.portal.assemble.surface.factory;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-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.Page_;
-import com.x.portal.core.entity.Portal;
-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 java.util.Optional;
-
-public class PageFactory extends AbstractFactory {
-
-	static CacheCategory cache = new CacheCategory(Page.class);
-
-	public PageFactory(Business abstractBusiness) throws Exception {
-		super(abstractBusiness);
-	}
-
-	public List<String> listWithPortal(String portalId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Page.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Page> root = cq.from(Page.class);
-		Predicate p = cb.equal(root.get(Page_.portal), portalId);
-		List<String> list = em.createQuery(cq.select(root.get(Page_.id)).where(p)).getResultList();
-		return list;
-	}
-
-	public Page pick(String id) throws Exception {
-		CacheKey cacheKey = new CacheKey(id);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Page) optional.get();
-		} else {
-			Page o = this.business().entityManagerContainer().find(id, Page.class);
-			if (null != o) {
-				this.business().entityManagerContainer().get(Page.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-
-	public Page pick(Portal portal, String flag) throws Exception {
-		CacheKey cacheKey = new CacheKey(portal.getId(), flag);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Page) optional.get();
-		} else {
-			Page o = entityManagerContainer().restrictFlag(flag, Page.class, Page.portal_FIELDNAME, portal.getId());
-			if (null != o) {
-				this.business().entityManagerContainer().get(Page.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-}

+ 0 - 95
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PortalFactory.java

@@ -1,95 +0,0 @@
-package com.x.portal.assemble.surface.factory;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-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.portal.assemble.surface.AbstractFactory;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Portal_;
-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 java.util.Optional;
-
-public class PortalFactory extends AbstractFactory {
-
-	static CacheCategory cache = new CacheCategory(Portal.class);
-
-	public PortalFactory(Business abstractBusiness) throws Exception {
-		super(abstractBusiness);
-	}
-
-	public List<String> list(EffectivePerson effectivePerson) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Portal.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Portal> root = cq.from(Portal.class);
-		Predicate p = cb.conjunction();
-		if (effectivePerson.isNotManager() && (!this.business().organization().person().hasRole(effectivePerson,
-				OrganizationDefinition.PortalManager))) {
-			List<String> identities = this.business().organization().identity()
-					.listWithPerson(effectivePerson.getDistinguishedName());
-			List<String> units = this.business().organization().unit()
-					.listWithPersonSupNested(effectivePerson.getDistinguishedName());
-			p = cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName());
-			p = cb.or(p, cb.isMember(effectivePerson.getDistinguishedName(), root.get(Portal_.controllerList)));
-			p = cb.or(cb.and(cb.isEmpty(root.get(Portal_.availableIdentityList)),
-					cb.isEmpty(root.get(Portal_.availableUnitList))));
-			p = cb.or(p, root.get(Portal_.availableIdentityList).in(identities));
-			p = cb.or(p, root.get(Portal_.availableUnitList).in(units));
-		}
-		cq.select(root.get(Portal_.id)).where(p).distinct(true);
-		return em.createQuery(cq).getResultList();
-	}
-
-	public boolean visible(EffectivePerson effectivePerson, Portal portal) throws Exception {
-		if (effectivePerson.isManager() || this.business().organization().person().hasRole(effectivePerson,
-				OrganizationDefinition.PortalManager)) {
-			return true;
-		}
-		if (effectivePerson.isPerson(portal.getCreatorPerson())) {
-			return true;
-		}
-		if (effectivePerson.isPerson(portal.getControllerList())) {
-			return true;
-		}
-		if (ListTools.isEmpty(portal.getAvailableIdentityList(), portal.getAvailableUnitList())) {
-			return true;
-		}
-		List<String> identities = this.business().organization().identity()
-				.listWithPerson(effectivePerson.getDistinguishedName());
-		if (ListTools.containsAny(identities, portal.getAvailableIdentityList())) {
-			return true;
-		}
-		List<String> units = this.business().organization().unit().listWithPersonSupNested(effectivePerson);
-		if (ListTools.containsAny(units, portal.getAvailableUnitList())) {
-			return true;
-		}
-		return false;
-	}
-
-	public Portal pick(String flag) throws Exception {
-		CacheKey cacheKey = new CacheKey(flag);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Portal) optional.get();
-		} else {
-			Portal o = this.business().entityManagerContainer().flag(flag, Portal.class);
-			if (null != o) {
-				this.business().entityManagerContainer().get(Portal.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-}

+ 0 - 162
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/ScriptFactory.java

@@ -1,162 +0,0 @@
-package com.x.portal.assemble.surface.factory;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import com.x.portal.assemble.surface.AbstractFactory;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Script;
-import com.x.portal.core.entity.Script_;
-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 java.util.Optional;
-
-public class ScriptFactory extends AbstractFactory {
-
-	static CacheCategory cache = new CacheCategory(Script.class);
-
-	public ScriptFactory(Business abstractBusiness) throws Exception {
-		super(abstractBusiness);
-	}
-
-	public Script flagWithPortalObject(String flag, String portalId) throws Exception {
-		CacheKey cacheKey = new CacheKey("flagObject", flag);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Script) optional.get();
-		} else {
-			EntityManager em = this.entityManagerContainer().get(Script.class);
-			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Script> cq = cb.createQuery(Script.class);
-			Root<Script> root = cq.from(Script.class);
-			Predicate p = cb.equal(root.get(Script_.portal), portalId);
-			p = cb.and(p, cb.or(cb.equal(root.get(Script_.name), flag), cb.equal(root.get(Script_.alias), flag)));
-			List<Script> list = em.createQuery(cq.select(root).where(p)).setMaxResults(1).getResultList();
-			if (list.isEmpty()) {
-				return null;
-			} else {
-				Script o = list.get(0);
-				em.detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-		}
-	}
-
-	public Script pick(String id) throws Exception {
-		CacheKey cacheKey = new CacheKey(id);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Script) optional.get();
-		} else {
-			Script o = this.business().entityManagerContainer().find(id, Script.class);
-			if (null != o) {
-				this.business().entityManagerContainer().get(Script.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-
-	public List<String> listWithPortal(String portalId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Script.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Script> root = cq.from(Script.class);
-		Predicate p = cb.equal(root.get(Script_.portal), portalId);
-		List<String> list = em.createQuery(cq.select(root.get(Script_.id)).where(p)).getResultList();
-		return list;
-	}
-
-	@SuppressWarnings("unchecked")
-	public List<Script> listScriptNestedWithPortalWithFlag(Portal portal, String flag) throws Exception {
-		List<Script> list = new ArrayList<>();
-		CacheKey cacheKey = new CacheKey(flag, portal.getId(), "listScriptNestedWithPortalWithFlag");
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			list = (List<Script>) optional.get();
-		} else {
-			List<String> names = new ArrayList<>();
-			names.add(flag);
-			while (!names.isEmpty()) {
-				List<String> loops = new ArrayList<>();
-				for (String name : names) {
-					Script o = this.getScriptWithPortalWithFlag(portal, name);
-					if ((null != o) && (!list.contains(o))) {
-						list.add(o);
-						loops.addAll(o.getDependScriptList());
-					}
-				}
-				names = loops;
-			}
-			if (!list.isEmpty()) {
-				Collections.reverse(list);
-				CacheManager.put(cache, cacheKey, list);
-			}
-		}
-		return list;
-	}
-
-	private Script getScriptWithPortalWithFlag(Portal portal, String flag) throws Exception {
-		Script script = this.getWithPortalWithId(portal, flag);
-		if (null == script) {
-			script = this.getWithPortalWithAlias(portal, flag);
-		}
-		if (null == script) {
-			script = this.getWithPortalWithName(portal, flag);
-		}
-		return script;
-	}
-
-	private Script getWithPortalWithId(Portal portal, String flag) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Script.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Script> cq = cb.createQuery(Script.class);
-		Root<Script> root = cq.from(Script.class);
-		Predicate p = cb.equal(root.get(Script_.id), flag);
-		p = cb.and(p, cb.equal(root.get(Script_.portal), portal.getId()));
-		List<Script> list = em.createQuery(cq.where(p)).setMaxResults(1).getResultList();
-		if (!list.isEmpty()) {
-			return list.get(0);
-		}
-		return null;
-	}
-
-	private Script getWithPortalWithAlias(Portal portal, String flag) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Script.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Script> cq = cb.createQuery(Script.class);
-		Root<Script> root = cq.from(Script.class);
-		Predicate p = cb.equal(root.get(Script_.alias), flag);
-		p = cb.and(p, cb.equal(root.get(Script_.portal), portal.getId()));
-		List<Script> list = em.createQuery(cq.where(p)).setMaxResults(1).getResultList();
-		if (!list.isEmpty()) {
-			return list.get(0);
-		}
-		return null;
-	}
-
-	private Script getWithPortalWithName(Portal portal, String flag) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Script.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<Script> cq = cb.createQuery(Script.class);
-		Root<Script> root = cq.from(Script.class);
-		Predicate p = cb.equal(root.get(Script_.name), flag);
-		p = cb.and(p, cb.equal(root.get(Script_.portal), portal.getId()));
-		List<Script> list = em.createQuery(cq.where(p)).setMaxResults(1).getResultList();
-		if (!list.isEmpty()) {
-			return list.get(0);
-		}
-		return null;
-	}
-}

+ 0 - 53
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/WidgetFactory.java

@@ -1,53 +0,0 @@
-package com.x.portal.assemble.surface.factory;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import com.x.portal.assemble.surface.AbstractFactory;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Widget;
-import com.x.portal.core.entity.Widget_;
-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 java.util.Optional;
-
-public class WidgetFactory extends AbstractFactory {
-
-	static CacheCategory cache = new CacheCategory(Widget.class);
-
-	public WidgetFactory(Business abstractBusiness) throws Exception {
-		super(abstractBusiness);
-	}
-
-	public Widget pick(String id) throws Exception {
-		CacheKey cacheKey = new CacheKey(id);
-		Optional<?> optional = CacheManager.get(cache, cacheKey);
-		if (optional.isPresent()) {
-			return (Widget) optional.get();
-		} else {
-			Widget o = this.business().entityManagerContainer().find(id, Widget.class);
-			if (null != o) {
-				this.business().entityManagerContainer().get(Widget.class).detach(o);
-				CacheManager.put(cache, cacheKey, o);
-				return o;
-			}
-			return null;
-		}
-	}
-
-	public List<String> listWithPortal(String portalId) throws Exception {
-		EntityManager em = this.entityManagerContainer().get(Widget.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Widget> root = cq.from(Widget.class);
-		Predicate p = cb.equal(root.get(Widget_.portal), portalId);
-		List<String> list = em.createQuery(cq.select(root.get(Widget_.id)).where(p)).getResultList();
-		return list;
-	}
-}

+ 0 - 25
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/ActionApplication.java

@@ -1,25 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs;
-
-import java.util.Set;
-
-import javax.ws.rs.ApplicationPath;
-
-import com.x.base.core.project.jaxrs.AbstractActionApplication;
-import com.x.portal.assemble.surface.jaxrs.file.FileAction;
-import com.x.portal.assemble.surface.jaxrs.page.PageAction;
-import com.x.portal.assemble.surface.jaxrs.portal.PortalAction;
-import com.x.portal.assemble.surface.jaxrs.script.ScriptAction;
-import com.x.portal.assemble.surface.jaxrs.widget.WidgetAction;
-
-@ApplicationPath("jaxrs")
-public class ActionApplication extends AbstractActionApplication {
-
-	public Set<Class<?>> getClasses() {
-		classes.add(PortalAction.class);
-		classes.add(WidgetAction.class);
-		classes.add(PageAction.class);
-		classes.add(ScriptAction.class);
-		classes.add(FileAction.class);
-		return classes;
-	}
-}

+ 0 - 10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/FileJaxrsFilter.java

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

+ 0 - 10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/PageJaxrsFilter.java

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

+ 0 - 10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/PortalJaxrsFilter.java

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

+ 0 - 10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/ScriptJaxrsFilter.java

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

+ 0 - 10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/WidgetJaxrsFilter.java

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

+ 0 - 88
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java

@@ -1,88 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.file;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.project.cache.ApplicationCache;
-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.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.jaxrs.WoFile;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.File;
-import com.x.portal.core.entity.File_;
-import com.x.portal.core.entity.Portal;
-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 java.util.Optional;
-
-class ActionContent extends StandardJaxrsAction {
-
-	private CacheCategory cache = new CacheCategory(File.class);
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<Wo> result = new ActionResult<>();
-			Wo wo = null;
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(cache, cacheKey);
-			if (optional.isPresent()) {
-				wo = ((Wo) optional.get());
-			} else {
-				Business business = new Business(emc);
-				Portal portal = business.portal().pick(portalFlag);
-				if (null == portal) {
-					throw new ExceptionEntityNotExist(portalFlag, Portal.class);
-				}
-				String id = this.get(business, portal, flag);
-				if (StringUtils.isEmpty(id)) {
-					throw new ExceptionEntityNotExist(flag, File.class);
-				}
-				File file = business.file().pick(id);
-				byte[] bs = new byte[] {};
-				if (StringUtils.isNotEmpty(file.getData())) {
-					bs = Base64.decodeBase64(file.getData());
-				}
-				wo = new Wo(bs, this.contentType(false, file.getFileName()),
-						this.contentDisposition(false, file.getFileName()));
-				CacheManager.put(cache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends WoFile {
-
-		public Wo(byte[] bytes, String contentType, String contentDisposition) {
-			super(bytes, contentType, contentDisposition);
-		}
-
-	}
-
-	private String get(Business business, Portal portal, String flag) throws Exception {
-		EntityManager em = business.entityManagerContainer().get(File.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<File> root = cq.from(File.class);
-		Predicate p = cb.equal(root.get(File_.name), flag);
-		p = cb.or(p, cb.equal(root.get(File_.alias), flag));
-		p = cb.or(p, cb.equal(root.get(File_.id), flag));
-		p = cb.and(p, cb.equal(root.get(File_.portal), portal.getId()));
-		List<String> list = em.createQuery(cq.select(root.get(File_.id)).where(p)).setMaxResults(1).getResultList();
-		return list.isEmpty() ? null : list.get(0);
-	}
-
-}

+ 0 - 87
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java

@@ -1,87 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.file;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-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.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.jaxrs.WoFile;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.File;
-import com.x.portal.core.entity.File_;
-import com.x.portal.core.entity.Portal;
-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 java.util.Optional;
-
-class ActionDownload extends StandardJaxrsAction {
-
-	private CacheCategory cache = new CacheCategory(File.class);
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<Wo> result = new ActionResult<>();
-			Wo wo = null;
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(cache, cacheKey);
-			if (optional.isPresent()) {
-				wo = ((Wo) optional.get());
-			} else {
-				Business business = new Business(emc);
-				Portal portal = business.portal().pick(portalFlag);
-				if (null == portal) {
-					throw new ExceptionEntityNotExist(portalFlag, Portal.class);
-				}
-				String id = this.get(business, portal, flag);
-				if (StringUtils.isEmpty(id)) {
-					throw new ExceptionEntityNotExist(flag, File.class);
-				}
-				File file = business.file().pick(id);
-				byte[] bs = new byte[] {};
-				if (StringUtils.isNotEmpty(file.getData())) {
-					bs = Base64.decodeBase64(file.getData());
-				}
-				wo = new Wo(bs, this.contentType(true, file.getFileName()),
-						this.contentDisposition(true, file.getFileName()));
-				CacheManager.put(cache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends WoFile {
-
-		public Wo(byte[] bytes, String contentType, String contentDisposition) {
-			super(bytes, contentType, contentDisposition);
-		}
-
-	}
-
-	private String get(Business business, Portal portal, String flag) throws Exception {
-		EntityManager em = business.entityManagerContainer().get(File.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<File> root = cq.from(File.class);
-		Predicate p = cb.equal(root.get(File_.name), flag);
-		p = cb.or(p, cb.equal(root.get(File_.alias), flag));
-		p = cb.or(p, cb.equal(root.get(File_.id), flag));
-		p = cb.and(p, cb.equal(root.get(File_.portal), portal.getId()));
-		List<String> list = em.createQuery(cq.select(root.get(File_.id)).where(p)).setMaxResults(1).getResultList();
-		return list.isEmpty() ? null : list.get(0);
-	}
-
-}

+ 0 - 43
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionListWithPortal.java

@@ -1,43 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.file;
-
-import java.util.List;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-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.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.File;
-import com.x.portal.core.entity.Portal;
-
-class ActionListWithPortal extends BaseAction {
-
-	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String portalFlag) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<List<Wo>> result = new ActionResult<>();
-			Portal portal = business.portal().pick(portalFlag);
-			if (null == portal) {
-				throw new ExceptionEntityNotExist(portalFlag, Portal.class);
-			}
-			List<Wo> wos = emc.fetchEqual(File.class, Wo.copier, File.portal_FIELDNAME, portal.getId());
-			wos = business.file().sort(wos);
-			result.setData(wos);
-			return result;
-		}
-	}
-
-	public static class Wo extends File {
-
-		private static final long serialVersionUID = 3121411589636528551L;
-		static WrapCopier<File, Wo> copier = WrapCopierFactory.wo(File.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, File.data_FIELDNAME));
-
-	}
-
-}

+ 0 - 7
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/BaseAction.java

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

+ 0 - 87
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/FileAction.java

@@ -1,87 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.file;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("file")
-@JaxrsDescribe("文件操作")
-public class FileAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(FileAction.class);
-
-	@JaxrsMethodDescribe(value = "列示指定站点的下所有可见的文件.", action = ActionListWithPortal.class)
-	@GET
-	@Path("list/portal/{portalFlag}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void listWithPortal(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("portalFlag") String applicationFlag) {
-		ActionResult<List<ActionListWithPortal.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionListWithPortal().execute(effectivePerson, applicationFlag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "访问文件内容.义stream格式下载", action = ActionDownload.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}/download")
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void download(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("应用标识") @PathParam("portalFlag") String applicationFlag) {
-		ActionResult<ActionDownload.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionDownload().execute(effectivePerson, flag, applicationFlag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "访问文件内容.", action = ActionContent.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}/content")
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void content(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("应用标识") @PathParam("portalFlag") String applicationFlag) {
-		ActionResult<ActionContent.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionContent().execute(effectivePerson, flag, applicationFlag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-}

+ 0 - 48
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGet.java

@@ -1,48 +0,0 @@
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Portal;
-
-class ActionGet extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Page page = business.page().pick(id);
-			if (null == page) {
-				throw new ExceptionPageNotExist(id);
-			}
-			Portal portal = business.portal().pick(page.getPortal());
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(page.getPortal());
-			}
-			if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			Wo wo = Wo.copier.copy(page);
-			wo.setData(page.getDataOrMobileData());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Page, Wo> copier = WrapCopierFactory.wo(Page.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, Page.data_FIELDNAME, Page.mobileData_FIELDNAME));
-	}
-}

+ 0 - 48
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetMobile.java

@@ -1,48 +0,0 @@
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Portal;
-
-class ActionGetMobile extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Page page = business.page().pick(id);
-			if (null == page) {
-				throw new ExceptionPageNotExist(id);
-			}
-			Portal portal = business.portal().pick(page.getPortal());
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(page.getPortal());
-			}
-			if (isNotLoginPage(id) && (!business.portal().visible(effectivePerson, portal))) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			Wo wo = Wo.copier.copy(page);
-			wo.setData(page.getMobileDataOrData());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Page, Wo> copier = WrapCopierFactory.wo(Page.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, Page.data_FIELDNAME, Page.mobileData_FIELDNAME));
-	}
-}

+ 0 - 63
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java

@@ -1,63 +0,0 @@
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Portal;
-import com.x.base.core.project.cache.Cache.CacheKey;
-import com.x.base.core.project.cache.CacheManager;
-import java.util.Optional;
-
-class ActionGetWithPortal extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(pageCache, cacheKey);
-			if (optional.isPresent()) {
-				wo = (Wo) optional.get();
-				Portal portal = business.portal().pick(wo.getPortal());
-				if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-			} else {
-				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 page = business.page().pick(portal, flag);
-				if (null == page) {
-					throw new ExceptionPageNotExist(flag);
-				}
-				wo = Wo.copier.copy(page);
-				wo.setData(page.getDataOrMobileData());
-				CacheManager.put(pageCache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		static WrapCopier<Page, Wo> copier = WrapCopierFactory.wo(Page.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, Page.data_FIELDNAME, Page.mobileData_FIELDNAME));
-
-	}
-}

+ 0 - 60
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java

@@ -1,60 +0,0 @@
-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.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-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.Portal;
-import com.x.base.core.project.cache.Cache.CacheKey;
-import com.x.base.core.project.cache.CacheManager;
-import java.util.Optional;
-
-class ActionGetWithPortalMobile extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(pageCache, cacheKey);
-			if (optional.isPresent()) {
-				wo = (Wo) optional.get();
-				Portal portal = business.portal().pick(wo.getPortal());
-				if (isNotLoginPage(flag) && (!business.portal().visible(effectivePerson, portal))) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-			} else {
-				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 page = business.page().pick(portal, flag);
-				wo = Wo.copier.copy(page);
-				wo.setData(page.getMobileDataOrData());
-				CacheManager.put(pageCache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		static WrapCopier<Page, Wo> copier = WrapCopierFactory.wo(Page.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, Page.data_FIELDNAME, Page.mobileData_FIELDNAME));
-
-	}
-}

+ 0 - 53
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionList.java

@@ -1,53 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Page;
-import com.x.portal.core.entity.Portal;
-
-class ActionList extends BaseAction {
-
-	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String portalId) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<List<Wo>> result = new ActionResult<>();
-			List<Wo> wos = new ArrayList<>();
-			Portal portal = business.portal().pick(portalId);
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(portalId);
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			List<String> ids = business.page().listWithPortal(portal.getId());
-			for (String id : ids) {
-				Page o = business.page().pick(id);
-				if (null == o) {
-					throw new ExceptionPageNotExist(id);
-				} else {
-					wos.add(Wo.copier.copy(o));
-				}
-			}
-			result.setData(wos);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		static WrapCopier<Page, Wo> copier = WrapCopierFactory.wo(Page.class, Wo.class,
-				JpaObject.singularAttributeField(Page.class, true, true), JpaObject.FieldsInvisible);
-
-	}
-}

+ 0 - 19
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java

@@ -1,19 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.config.Config;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.portal.core.entity.Page;
-import com.x.base.core.project.cache.Cache.CacheCategory;
-
-abstract class BaseAction extends StandardJaxrsAction {
-
-	CacheCategory pageCache = new CacheCategory(Page.class);
-
-	protected boolean isNotLoginPage(String id) throws Exception {
-		return !(Config.portal().getIndexPage().getEnable()
-				&& StringUtils.equals(id, Config.portal().getIndexPage().getPage()));
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPageNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPageNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPageNotExist(String id) {
-		super("指定的页面不存在:{}.", id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPortalAccessDenied.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalAccessDenied extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalAccessDenied(String person, String name, String id) {
-		super("用户: {}, 访问站点: {}, id: {}, 失败,权限不足.", person, name, id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ExceptionPortalNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalNotExist(String id) {
-		super("指定的站点不存在:{}.", id);
-	}
-
-}

+ 0 - 124
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/PageAction.java

@@ -1,124 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.page;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("page")
-@JaxrsDescribe("页面")
-public class PageAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(PageAction.class);
-
-	@JaxrsMethodDescribe(value = "获取Page内容.", action = ActionGet.class)
-	@GET
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取Page内容Mobile.", action = ActionGetMobile.class)
-	@GET
-	@Path("{id}/mobile")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionGetMobile.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetMobile().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.", action = ActionList.class)
-	@GET
-	@Path("list/portal/{portal}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void list(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("门户") @PathParam("portal") String portal) {
-		ActionResult<List<ActionList.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionList().execute(effectivePerson, portal);
-		} 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 = ActionGetWithPortal.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getWithPortal(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
-		ActionResult<ActionGetWithPortal.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetWithPortal().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 = ActionGetWithPortalMobile.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}/mobile")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getWithPortalMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
-		ActionResult<ActionGetWithPortalMobile.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetWithPortalMobile().execute(effectivePerson, flag, portalFlag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 45
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionGet.java

@@ -1,45 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-
-class ActionGet extends BaseAction {
-
-	/**
-	 * 1.身份在可使用列表中 2.部门在可使用部门中 3.公司在可使用公司中 4.没有限定身份,部门或者公司 5.个人在应用管理员中
-	 * 6.是此Portal的创建人员 7.个人有Manage权限 8.个人拥有PortalManager
-	 */
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Portal o = business.portal().pick(flag);
-			if (null == o) {
-				throw new ExceptionPortalNotExist(flag);
-			}
-			if (!business.portal().visible(effectivePerson, o)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), o.getName(), o.getId());
-			}
-			Wo wo = Wo.copier.copy(o);
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Portal {
-
-		private static final long serialVersionUID = 727247858785981924L;
-
-		static WrapCopier<Portal, Wo> copier = WrapCopierFactory.wo(Portal.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

+ 0 - 45
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionIcon.java

@@ -1,45 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WoFile;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-
-class ActionIcon extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Portal o = business.portal().pick(id);
-			if (null == o) {
-				throw new ExceptionPortalNotExist(id);
-			}
-			// if (!business.portal().visible(effectivePerson, o)) {
-			// throw new
-			// ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(),
-			// o.getName(), o.getId());
-			// }
-			byte[] bs = Base64
-					.decodeBase64(StringUtils.isEmpty(o.getIcon()) ? DEFAULT_PORTAL_ICON_BASE64 : o.getIcon());
-			Wo wo = new Wo(bs, this.contentType(false, "icon.png"), this.contentDisposition(false, "icon.png"));
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends WoFile {
-
-		public Wo(byte[] bytes, String contentType, String contentDisposition) {
-			super(bytes, contentType, contentDisposition);
-		}
-
-	}
-
-}

+ 0 - 34
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionIconBase64.java

@@ -1,34 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapString;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-
-class ActionIconBase64 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Portal o = business.portal().pick(id);
-			if (null == o) {
-				throw new ExceptionPortalNotExist(id);
-			}
-			Wo wo = new Wo();
-			wo.setValue(StringUtils.isEmpty(o.getIcon()) ? DEFAULT_PORTAL_ICON_BASE64 : o.getIcon());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends WrapString {
-
-	}
-
-}

+ 0 - 84
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ActionList.java

@@ -1,84 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.EntityManager;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.organization.OrganizationDefinition;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Portal_;
-
-class ActionList extends BaseAction {
-
-	/**
-	 * 1.身份在可使用列表中 2.部门在可使用部门中 3.公司在可使用公司中 4.没有限定身份,部门或者公司 5.个人在应用管理员中
-	 * 6.是此Portal的创建人员 7.个人有Manage权限 8.个人拥有PortalManager
-	 */
-	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<List<Wo>> result = new ActionResult<>();
-			List<Wo> wos = new ArrayList<>();
-			Business business = new Business(emc);
-			List<String> ids = this.list(business, effectivePerson);
-			for (String id : ids) {
-				Portal o = business.portal().pick(id);
-				if (null == o) {
-					throw new ExceptionPortalNotExist(id);
-				} else {
-					wos.add(Wo.copier.copy(o));
-				}
-			}
-			wos = wos.stream().sorted(Comparator.comparing(Portal::getName, Comparator.nullsLast(String::compareTo)))
-					.collect(Collectors.toList());
-			result.setData(wos);
-			return result;
-		}
-	}
-
-	private List<String> list(Business business, EffectivePerson effectivePerson) throws Exception {
-		EntityManager em = business.entityManagerContainer().get(Portal.class);
-		CriteriaBuilder cb = em.getCriteriaBuilder();
-		CriteriaQuery<String> cq = cb.createQuery(String.class);
-		Root<Portal> root = cq.from(Portal.class);
-		Predicate p = cb.or(cb.isNull(root.get(Portal_.pcClient)), cb.isTrue(root.get(Portal_.pcClient)));
-		if (effectivePerson.isNotManager()
-				&& (!business.organization().person().hasRole(effectivePerson, OrganizationDefinition.PortalManager))) {
-			List<String> identities = business.organization().identity()
-					.listWithPerson(effectivePerson.getDistinguishedName());
-			List<String> units = business.organization().unit()
-					.listWithPersonSupNested(effectivePerson.getDistinguishedName());
-			Predicate who = cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName());
-			who = cb.or(who, cb.isMember(effectivePerson.getDistinguishedName(), root.get(Portal_.controllerList)));
-			who = cb.or(who, cb.and(cb.isEmpty(root.get(Portal_.availableIdentityList)),
-					cb.isEmpty(root.get(Portal_.availableUnitList))));
-			who = cb.or(who, root.get(Portal_.availableIdentityList).in(identities));
-			who = cb.or(who, root.get(Portal_.availableUnitList).in(units));
-			p = cb.and(p, who);
-		}
-		cq.select(root.get(Portal_.id)).where(p).distinct(true);
-		return em.createQuery(cq).getResultList();
-	}
-
-	public static class Wo extends Portal {
-
-		private static final long serialVersionUID = -5240059905993945729L;
-		static WrapCopier<Portal, Wo> copier = WrapCopierFactory.wo(Portal.class, Wo.class,
-				JpaObject.singularAttributeField(Portal.class, true, false), JpaObject.FieldsInvisible);
-
-	}
-}

File diff suppressed because it is too large
+ 0 - 6
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/BaseAction.java


+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ExceptionPortalAccessDenied.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalAccessDenied extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalAccessDenied(String person, String name, String id) {
-		super("用户: {}, 访问站点: {}, id: {}, 失败,权限不足.", person, name, id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/ExceptionPortalNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalNotExist(String id) {
-		super("指定的站点不存在:{}.", id);
-	}
-
-}

+ 0 - 119
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/portal/PortalAction.java

@@ -1,119 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.portal;
-
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.List;
-
-import javax.imageio.ImageIO;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.commons.codec.binary.Base64;
-
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("portal")
-@JaxrsDescribe("门户")
-public class PortalAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(PortalAction.class);
-
-	@JaxrsMethodDescribe(value = "获取单个的Portal.", action = ActionGet.class)
-	@GET
-	@Path("{flag}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute(effectivePerson, flag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取Portal的图标.", action = ActionIcon.class)
-	@GET
-	@Path("{id}/icon")
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void icon(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionIcon.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionIcon().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取Portal的图标Base64编码.", action = ActionIconBase64.class)
-	@GET
-	@Path("{id}/icon/base64")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void iconBase64(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionIconBase64.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionIconBase64().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "列示当前用户所有可见的Portal.", action = ActionList.class)
-	@GET
-	@Path("list")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void list(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<List<ActionList.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionList().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	public void test() throws Exception {
-		try (FileInputStream in = new FileInputStream(new File("d:/a.png"));
-				ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
-			BufferedImage image = ImageIO.read(in);
-			ImageIO.write(image, "png", baos);
-			String icon = Base64.encodeBase64String(baos.toByteArray());
-		}
-	}
-
-}

+ 0 - 112
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionFlag.java

@@ -1,112 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.SystemUtils;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.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.gson.GsonPropertyObject;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Script;
-
-class ActionFlag extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalId, JsonElement jsonElement)
-			throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
-			ActionResult<Wo> result = new ActionResult<>();
-			Portal portal = business.portal().pick(portalId);
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(portalId);
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			List<Script> list = new ArrayList<>();
-			for (Script o : business.script().listScriptNestedWithPortalWithFlag(portal, flag)) {
-
-				if ((!this.contains(wi.getImportedList(), o.getAlias()))
-						&& (!this.contains(wi.getImportedList(), o.getName()))
-						&& (!this.contains(wi.getImportedList(), o.getId()))) {
-					list.add(o);
-				}
-			}
-			StringBuffer buffer = new StringBuffer();
-			List<String> imported = new ArrayList<>();
-			for (Script o : list) {
-				buffer.append(o.getText());
-				buffer.append(SystemUtils.LINE_SEPARATOR);
-				imported.add(o.getId());
-				if (StringUtils.isNotEmpty(o.getName())) {
-					imported.add(o.getName());
-				}
-				if (StringUtils.isNotEmpty(o.getAlias())) {
-					imported.add(o.getAlias());
-				}
-			}
-			Wo wo = new Wo();
-			wo.setImportedList(imported);
-			wo.setText(buffer.toString());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	private boolean contains(List<String> list, String value) {
-		if (StringUtils.isEmpty(value)) {
-			return false;
-		} else {
-			return ListTools.contains(list, value);
-		}
-	}
-
-	public static class Wi extends GsonPropertyObject {
-
-		@FieldDescribe("已经导入的脚本")
-		private List<String> importedList;
-
-		public List<String> getImportedList() {
-			return importedList;
-		}
-
-		public void setImportedList(List<String> importedList) {
-			this.importedList = importedList;
-		}
-
-	}
-
-	public static class Wo extends Script {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		static WrapCopier<Script, Wo> copier = WrapCopierFactory.wo(Script.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible));
-
-		private List<String> importedList;
-
-		public List<String> getImportedList() {
-			return importedList;
-		}
-
-		public void setImportedList(List<String> importedList) {
-			this.importedList = importedList;
-		}
-
-	}
-
-}

+ 0 - 47
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGet.java

@@ -1,47 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Script;
-
-class ActionGet extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Script script = business.script().pick(id);
-			if (null == script) {
-				throw new ExceptionScriptNotExist(id);
-			}
-			Portal portal = business.portal().pick(script.getPortal());
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(script.getPortal());
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			Wo wo = Wo.copier.copy(script);
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Script {
-
-		private static final long serialVersionUID = 727247858785981924L;
-
-		static WrapCopier<Script, Wo> copier = WrapCopierFactory.wo(Script.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible));
-
-	}
-}

+ 0 - 87
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java

@@ -1,87 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Script;
-import com.x.base.core.project.cache.Cache.CacheKey;
-import com.x.base.core.project.cache.CacheManager;
-import java.util.Optional;
-
-class ActionGetImported extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalId) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<Wo> result = new ActionResult<>();
-			Wo wo = new Wo();
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalId);
-			Optional<?> optional = CacheManager.get(cache, cacheKey);
-			if (optional.isPresent()) {
-				wo = (Wo) optional.get();
-			} else {
-				Business business = new Business(emc);
-				Portal portal = business.portal().pick(portalId);
-				if (null == portal) {
-					throw new ExceptionPortalNotExist(portalId);
-				}
-				if (!business.portal().visible(effectivePerson, portal)) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-				List<Script> list = new ArrayList<>();
-				for (Script o : business.script().listScriptNestedWithPortalWithFlag(portal, flag)) {
-					list.add(o);
-				}
-				StringBuffer buffer = new StringBuffer();
-				List<String> imported = new ArrayList<>();
-				for (Script o : list) {
-					buffer.append(o.getText());
-					buffer.append(System.lineSeparator());
-					imported.add(o.getId());
-					if (StringUtils.isNotEmpty(o.getName())) {
-						imported.add(o.getName());
-					}
-					if (StringUtils.isNotEmpty(o.getAlias())) {
-						imported.add(o.getAlias());
-					}
-				}
-				wo.setImportedList(imported);
-				wo.setText(buffer.toString());
-				CacheManager.put(cache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Script {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		static WrapCopier<Script, Wo> copier = WrapCopierFactory.wo(Script.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible));
-
-		private List<String> importedList;
-
-		public List<String> getImportedList() {
-			return importedList;
-		}
-
-		public void setImportedList(List<String> importedList) {
-			this.importedList = importedList;
-		}
-	}
-
-}

+ 0 - 53
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionList.java

@@ -1,53 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Script;
-
-class ActionList extends BaseAction {
-
-	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String portalId) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<List<Wo>> result = new ActionResult<>();
-			List<Wo> wos = new ArrayList<>();
-			Portal portal = business.portal().pick(portalId);
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(portalId);
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			List<String> ids = business.script().listWithPortal(portal.getId());
-			for (String id : ids) {
-				Script o = business.script().pick(id);
-				if (null == o) {
-					throw new ExceptionScriptNotExist(id);
-				} else {
-					wos.add(Wo.copier.copy(o));
-				}
-			}
-			result.setData(wos);
-			return result;
-		}
-	}
-
-	public static class Wo extends Script {
-
-		private static final long serialVersionUID = -5240059905993945729L;
-		static WrapCopier<Script, Wo> copier = WrapCopierFactory.wo(Script.class, Wo.class,
-				JpaObject.singularAttributeField(Script.class, true, true), JpaObject.FieldsInvisible);
-
-	}
-}

+ 0 - 11
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java

@@ -1,11 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.portal.core.entity.Script;
-import com.x.base.core.project.cache.Cache.CacheCategory;
-
-abstract class BaseAction extends StandardJaxrsAction {
-
-	protected CacheCategory cache = new CacheCategory(Script.class);
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionPortalAccessDenied.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalAccessDenied extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalAccessDenied(String person, String name, String id) {
-		super("用户: {}, 访问站点: {}, id: {}, 失败,权限不足.", person, name, id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionPortalNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalNotExist(String id) {
-		super("指定的站点不存在:{}.", id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ExceptionScriptNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionScriptNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionScriptNotExist(String id) {
-		super("指定的脚本不存在:{}.", id);
-	}
-
-}

+ 0 - 108
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ScriptAction.java

@@ -1,108 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.script;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("script")
-@JaxrsDescribe("脚本")
-public class ScriptAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(ScriptAction.class);
-
-	@JaxrsMethodDescribe(value = "获取Script内容.", action = ActionGet.class)
-	@GET
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取Script内容,并递归附带应用脚本.", action = ActionGetImported.class)
-	@GET
-	@Path("portal/{portal}/name/{name}/imported")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getImported(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("名称") @PathParam("name") String name,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portal") String portal) {
-		ActionResult<ActionGetImported.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetImported().execute(effectivePerson, name, portal);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "在指定的Portal下根据flag获取Script.", action = ActionFlag.class)
-	@POST
-	@Path("portal/{portal}/name/{name}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void flag(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("名称") @PathParam("name") String name,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portal") String portal, JsonElement jsonElement) {
-		ActionResult<ActionFlag.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionFlag().execute(effectivePerson, name, portal, jsonElement);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, jsonElement);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "列示属于指定Portal的Script.", action = ActionList.class)
-	@GET
-	@Path("list/portal/{portal}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void list(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portal") String portal) {
-		ActionResult<List<ActionList.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionList().execute(effectivePerson, portal);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 0 - 48
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGet.java

@@ -1,48 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.tools.ListTools;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Widget;
-
-class ActionGet extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Widget widget = business.widget().pick(id);
-			if (null == widget) {
-				throw new ExceptionWidgetNotExist(id);
-			}
-			Portal portal = business.portal().pick(widget.getPortal());
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(widget.getPortal());
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			Wo wo = Wo.copier.copy(widget);
-			wo.setData(widget.getDataOrMobileData());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Widget {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Widget, Wo> copier = WrapCopierFactory.wo(Widget.class, Wo.class, null,
-				ListTools.toList(JpaObject.FieldsInvisible, Widget.data_FIELDNAME, Widget.mobileData_FIELDNAME));
-	}
-}

+ 0 - 47
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetMobile.java

@@ -1,47 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Widget;
-
-class ActionGetMobile extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<Wo> result = new ActionResult<>();
-			Widget widget = business.widget().pick(id);
-			if (null == widget) {
-				throw new ExceptionWidgetNotExist(id);
-			}
-			Portal portal = business.portal().pick(widget.getPortal());
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(widget.getPortal());
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			Wo wo = Wo.copier.copy(widget);
-			wo.setData(widget.getMobileDataOrData());
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Widget {
-
-		private static final long serialVersionUID = -8067704098385000667L;
-
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Widget, Wo> copier = WrapCopierFactory.wo(Widget.class, Wo.class,
-				JpaObject.singularAttributeField(Widget.class, true, true), JpaObject.FieldsInvisible);
-	}
-}

+ 0 - 63
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java

@@ -1,63 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Widget;
-import com.x.base.core.project.cache.Cache.CacheKey;
-import com.x.base.core.project.cache.CacheManager;
-import java.util.Optional;
-
-class ActionGetWithPortal extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(cache, cacheKey);
-			if (optional.isPresent()) {
-				wo = (Wo) optional.get();
-				Portal portal = business.portal().pick(wo.getPortal());
-				if (!business.portal().visible(effectivePerson, portal)) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-			} else {
-				Portal portal = emc.flag(portalFlag, Portal.class);
-				if (null == portal) {
-					throw new ExceptionPortalNotExist(portalFlag);
-				}
-				if (!business.portal().visible(effectivePerson, portal)) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-				Widget widget = emc.restrictFlag(flag, Widget.class, Widget.portal_FIELDNAME, portal.getId());
-				if (null == widget) {
-					throw new ExceptionWidgetNotExist(flag);
-				}
-				wo = Wo.copier.copy(widget);
-				wo.setData(widget.getDataOrMobileData());
-				CacheManager.put(cache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Widget {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Widget, Wo> copier = WrapCopierFactory.wo(Widget.class, Wo.class,
-				JpaObject.singularAttributeField(Widget.class, true, true), JpaObject.FieldsInvisible);
-
-	}
-}

+ 0 - 63
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java

@@ -1,63 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Widget;
-import com.x.base.core.project.cache.Cache.CacheKey;
-import com.x.base.core.project.cache.CacheManager;
-import java.util.Optional;
-
-class ActionGetWithPortalMobile extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);
-			Optional<?> optional = CacheManager.get(cache, cacheKey);
-			if (optional.isPresent()) {
-				wo = (Wo) optional.get();
-				Portal portal = business.portal().pick(wo.getPortal());
-				if (!business.portal().visible(effectivePerson, portal)) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-			} else {
-				Portal portal = emc.flag(portalFlag, Portal.class);
-				if (null == portal) {
-					throw new ExceptionPortalNotExist(portalFlag);
-				}
-				if (!business.portal().visible(effectivePerson, portal)) {
-					throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-							portal.getId());
-				}
-				Widget widget = emc.restrictFlag(flag, Widget.class, Widget.portal_FIELDNAME, portal.getId());
-				if (null == widget) {
-					throw new ExceptionWidgetNotExist(flag);
-				}
-				wo = Wo.copier.copy(widget);
-				wo.setData(widget.getMobileDataOrData());
-				CacheManager.put(cache, cacheKey, wo);
-			}
-			result.setData(wo);
-			return result;
-		}
-	}
-
-	public static class Wo extends Widget {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Widget, Wo> copier = WrapCopierFactory.wo(Widget.class, Wo.class,
-				JpaObject.singularAttributeField(Widget.class, true, true), JpaObject.FieldsInvisible);
-
-	}
-}

+ 0 - 55
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionList.java

@@ -1,55 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.entity.JpaObject;
-import com.x.base.core.project.bean.WrapCopier;
-import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.portal.assemble.surface.Business;
-import com.x.portal.core.entity.Page;
-import com.x.portal.core.entity.Portal;
-import com.x.portal.core.entity.Widget;
-
-class ActionList extends BaseAction {
-
-	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String portalId) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			ActionResult<List<Wo>> result = new ActionResult<>();
-			List<Wo> wos = new ArrayList<>();
-			Portal portal = business.portal().pick(portalId);
-			if (null == portal) {
-				throw new ExceptionPortalNotExist(portalId);
-			}
-			if (!business.portal().visible(effectivePerson, portal)) {
-				throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(),
-						portal.getId());
-			}
-			List<String> ids = business.widget().listWithPortal(portal.getId());
-			for (String id : ids) {
-				Widget o = business.widget().pick(id);
-				if (null == o) {
-					throw new ExceptionWidgetNotExist(id);
-				} else {
-					wos.add(Wo.copier.copy(o));
-				}
-			}
-			result.setData(wos);
-			return result;
-		}
-	}
-
-	public static class Wo extends Page {
-
-		private static final long serialVersionUID = 3454132769791427909L;
-		/** 不输出data数据,单独处理 */
-		static WrapCopier<Widget, Wo> copier = WrapCopierFactory.wo(Widget.class, Wo.class,
-				JpaObject.singularAttributeField(Widget.class, true, true), JpaObject.FieldsInvisible);
-
-	}
-}

+ 0 - 11
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java

@@ -1,11 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.portal.core.entity.Widget;
-import com.x.base.core.project.cache.Cache.CacheCategory;
-
-abstract class BaseAction extends StandardJaxrsAction {
-
-	CacheCategory cache = new CacheCategory(Widget.class);
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionPortalAccessDenied.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalAccessDenied extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalAccessDenied(String person, String name, String id) {
-		super("用户: {}, 访问站点: {}, id: {}, 失败,权限不足.", person, name, id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionPortalNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionPortalNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionPortalNotExist(String id) {
-		super("指定的站点不存在:{}.", id);
-	}
-
-}

+ 0 - 13
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ExceptionWidgetNotExist.java

@@ -1,13 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import com.x.base.core.project.exception.PromptException;
-
-class ExceptionWidgetNotExist extends PromptException {
-
-	private static final long serialVersionUID = -4908883340253465376L;
-
-	ExceptionWidgetNotExist(String id) {
-		super("指定的部件不存在:{}.", id);
-	}
-
-}

+ 0 - 124
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/WidgetAction.java

@@ -1,124 +0,0 @@
-package com.x.portal.assemble.surface.jaxrs.widget;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.container.AsyncResponse;
-import javax.ws.rs.container.Suspended;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import com.x.base.core.project.annotation.JaxrsDescribe;
-import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.jaxrs.ResponseFactory;
-import com.x.base.core.project.jaxrs.StandardJaxrsAction;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-
-@Path("widget")
-@JaxrsDescribe("部件")
-public class WidgetAction extends StandardJaxrsAction {
-
-	private static Logger logger = LoggerFactory.getLogger(WidgetAction.class);
-
-	@JaxrsMethodDescribe(value = "获取部件内容.", action = ActionGet.class)
-	@GET
-	@Path("{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionGet.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGet().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "获取部件内容Mobile.", action = ActionGetMobile.class)
-	@GET
-	@Path("{id}/mobile")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionGetMobile.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetMobile().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "列示属于指定Portal的部件.", action = ActionList.class)
-	@GET
-	@Path("list/portal/{portal}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void list(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("门户") @PathParam("portal") String portal) {
-		ActionResult<List<ActionList.Wo>> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionList().execute(effectivePerson, portal);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "列示属于指定Portal的部件,其中Portal可以用name,alias和id标识,部件为在此Portal下的页面.", action = ActionGetWithPortal.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getWithPortal(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
-		ActionResult<ActionGetWithPortal.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetWithPortal().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的部件,其中Portal可以用name,alias和id标识,部件为在此Portal下的页面Mobile.", action = ActionGetWithPortalMobile.class)
-	@GET
-	@Path("{flag}/portal/{portalFlag}/mobile")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void getWithPortalMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("门户标识") @PathParam("portalFlag") String portalFlag) {
-		ActionResult<ActionGetWithPortalMobile.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionGetWithPortalMobile().execute(effectivePerson, flag, portalFlag);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-}

+ 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;
+		}
+
+	}
 
 }

+ 18 - 18
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java

@@ -141,23 +141,23 @@ public class FormAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
-	@JaxrsMethodDescribe(value = "V2根据工作或完成工作标识获取表单,合并关联表单和关联脚本输出.", action = V2GetWithWorkOrWorkCompleted.class)
-	@GET
-	@Path("v2/workorworkcompleted/{workOrWorkCompleted}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void V2GetWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request,
-			@JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) {
-		ActionResult<V2GetWithWorkOrWorkCompleted.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new V2GetWithWorkOrWorkCompleted().execute(effectivePerson, workOrWorkCompleted);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
+//	@JaxrsMethodDescribe(value = "V2根据工作或完成工作标识获取表单,合并关联表单和关联脚本输出.", action = V2GetWithWorkOrWorkCompleted.class)
+//	@GET
+//	@Path("v2/workorworkcompleted/{workOrWorkCompleted}")
+//	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+//	@Consumes(MediaType.APPLICATION_JSON)
+//	public void V2GetWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
+//			@Context HttpServletRequest request,
+//			@JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) {
+//		ActionResult<V2GetWithWorkOrWorkCompleted.Wo> result = new ActionResult<>();
+//		EffectivePerson effectivePerson = this.effectivePerson(request);
+//		try {
+//			result = new V2GetWithWorkOrWorkCompleted().execute(effectivePerson, workOrWorkCompleted);
+//		} catch (Exception e) {
+//			logger.error(e, effectivePerson, request, null);
+//			result.error(e);
+//		}
+//		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+//	}
 
 }

+ 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;
+	}
+
+}

+ 3 - 3
o2web/gulpfile.js

@@ -155,6 +155,7 @@ function createXFormConcatTask(path, isMin, thisOptions) {
             'source/' + path + '/Textfield.js',
             'source/' + path + '/Personfield.js',
             'source/' + path + '/*.js',
+            'source/x_component_process_Work/Processor.js',
             '!source/' + path + '/Office.js'
         ];
         var dest = option.dest+'/' + path + '/';
@@ -356,7 +357,6 @@ function createBaseWorkConcatTask(path, isMin, thisOptions) {
         var option = thisOptions || options;
         var src = [
             'source/' + path + '/js/base_work_begin.js',
-            'source/' + path + '/js/base.js',
             'source/o2_core/o2/widget/Common.js',
             'source/o2_core/o2/widget/Dialog.js',
             'source/o2_core/o2/widget/UUID.js',
@@ -383,12 +383,12 @@ function createBaseWorkConcatTask(path, isMin, thisOptions) {
             'source/o2_core/o2/xScript/Actions/ScriptActions.js',
             'source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
             'source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
-            'source/x_component_process_Work/Processor.js',
             'source/x_component_Template/MTooltips.js',
             'source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
             'source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js',
             'source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
-            'source/' + path + '/js/base_work_end.js'
+            'source/' + path + '/js/base_work_end.js',
+            'source/' + path + '/js/base.js'
         ];
         var dest = option.dest+'/' + path + '/';
         return gulp.src(src)

+ 2 - 1
o2web/source/o2_core/o2.js

@@ -1247,7 +1247,8 @@
         /jaxrs\/page\/.+\/portal\/.+/ig,
         /jaxrs\/document\/.+/ig,
         /jaxrs\/applicationdict\/.+/ig,
-        /jaxrs\/custom\/.+/ig
+        /jaxrs\/custom\/.+/ig,
+        /jaxrs\/definition\/idea.+/ig
 
         ///jaxrs\/form\/workorworkcompleted\/.+/ig,
         //    /jaxrs\/script/ig,

Some files were not shown because too many files changed in this diff