Explorar el Código

Merge pull request #3 from o2oa/master

从主分支更新
huqi1980 hace 6 años
padre
commit
0697dc01ea
Se han modificado 100 ficheros con 1256 adiciones y 1117 borrados
  1. 1 0
      .gitignore
  2. 49 22
      README.md
  3. 4 6
      o2server/build_common.xml
  4. BIN
      o2server/commons/ext/ant.jar
  5. BIN
      o2server/commons/ext/classgraph-4.8.4.jar
  6. 0 3
      o2server/commons/ext/commons-beanutils-1.9.2.jar
  7. BIN
      o2server/commons/ext/commons-beanutils-1.9.3.jar
  8. 0 3
      o2server/commons/ext/commons-collections4-4.1.jar
  9. BIN
      o2server/commons/ext/commons-collections4-4.3.jar
  10. 0 3
      o2server/commons/ext/fast-classpath-scanner-2.4.5.jar
  11. BIN
      o2server/commons/ext/gbase8s_jdbc.jar
  12. BIN
      o2server/commons/ext/javapoet-1.11.1.jar
  13. 2 2
      o2server/commons/ext/manifest.cfg
  14. 0 3
      o2server/commons/ext/mssql-jdbc-7.0.0.jre8.jar
  15. 0 3
      o2server/commons/ext/mysql-connector-java-5.1.47.jar
  16. BIN
      o2server/commons/ext/mysql-connector-java-8.0.15.jar
  17. 2 2
      o2server/commons/ext/openjpa-3.0.1-SNAPSHOT.jar
  18. BIN
      o2server/commons/ext/xbean-asm7-shaded-4.12.jar
  19. BIN
      o2server/commons/tess4j/tessdata/eng.traineddata
  20. BIN
      o2server/commons/tess4j/tessdata/osd.traineddata
  21. BIN
      o2server/commons/winsw.exe
  22. 16 0
      o2server/service_windows.bat
  23. 0 0
      o2server/start_macos.sh
  24. 2 2
      o2server/x_base_core_project/pom.xml
  25. 20 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/container/EntityManagerContainer.java
  26. 5 7
      o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SliceEntityManagerContainerFactory.java
  27. 20 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java
  28. 2 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageObject.java
  29. 1 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageType.java
  30. 3 2
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntity.java
  31. 12 6
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
  32. 6 13
      o2server/x_base_core_project/src/main/java/com/x/base/core/entity/tools/EnhancePersistenceXmlWriter.java
  33. 7 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/openjpa/jdbc/sql/GBaseDictionary.java
  34. 74 69
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java
  35. 45 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java
  36. 1 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DataMapping.java
  37. 22 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/LogLevel.java
  38. 0 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Person.java
  39. 2 3
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Query.java
  40. 10 10
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/HttpConnection.java
  41. 15 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/logger/Logger.java
  42. 39 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingEngine.java
  43. 31 11
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/ExtractTextTools.java
  44. 16 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java
  45. 2 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_query_assemble_designer.java
  46. 3 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_query_assemble_surface.java
  47. 4 4
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSSubjectInfoFactory.java
  48. 28 3
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGet.java
  49. 24 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGetAll.java
  50. 2 3
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGetAllWithPermission.java
  51. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionSave.java
  52. 8 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionDelete.java
  53. 33 17
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithSubjectForPage.java
  54. 11 9
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionSave.java
  55. 2 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/BaseAction.java
  56. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionDelete.java
  57. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionDeleteForce.java
  58. 27 3
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionGet.java
  59. 2 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionSave.java
  60. 5 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectDelete.java
  61. 157 132
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectGet.java
  62. 3 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectLock.java
  63. 4 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSave.java
  64. 1 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSetCream.java
  65. 1 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSetOriginal.java
  66. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSubmitVoteResult.java
  67. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnAcceptReply.java
  68. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnComplete.java
  69. 2 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnLock.java
  70. 51 8
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectView.java
  71. 21 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java
  72. 17 0
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoServiceAdv.java
  73. 0 1
      o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSForumInfo.java
  74. 1 1
      o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java
  75. 1 1
      o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/schedule/AlarmTrigger.java
  76. 4 4
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java
  77. 1 1
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionListNextWithFilter.java
  78. 151 152
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java
  79. 3 3
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/ActionFileDownloadStream.java
  80. 3 4
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/FileInfoAction.java
  81. 3 4
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/FileInfoAnonymousAction.java
  82. 1 1
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/view/ActionListNextPageViewData.java
  83. 3 3
      o2server/x_collaboration_service_message/src/main/java/x/collaboration/service/message/ThisApplication.java
  84. 20 3
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/Business.java
  85. 4 4
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionBase.java
  86. 6 0
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionCreate.java
  87. 9 3
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionDelete.java
  88. 44 0
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionDeleteAll.java
  89. 9 3
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionEdit.java
  90. 3 3
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionGet.java
  91. 21 14
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionListAll.java
  92. 26 9
      o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ComponentAction.java
  93. 0 4
      o2server/x_console/pom.xml
  94. 9 80
      o2server/x_console/src/main/java/com/x/server/console/CommandFactory.java
  95. 9 20
      o2server/x_console/src/main/java/com/x/server/console/Main.java
  96. 0 58
      o2server/x_console/src/main/java/com/x/server/console/action/ActionEraseContentReport.java
  97. 13 37
      o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdate.java
  98. 0 241
      o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdateFast.java
  99. 85 0
      o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdateFile.java
  100. 0 97
      o2server/x_console/src/test/java/com/x/server/console/test/TestClient.java

+ 1 - 0
.gitignore

@@ -4,6 +4,7 @@
 .project
 /.settings/
 /target/
+/o2custom/
 /.svn/
 /o2web/gulpfile.js
 **/.DS_Store

+ 49 - 22
README.md

@@ -32,6 +32,11 @@ Gitee : https://gitee.com/liyihz2008/O2OA
 
 Github : https://github.com/o2oa/o2oa
 
+脚本API:http://www.o2oa.net/x_desktop/portal.html?id=dcd8e168-2da0-4496-83ee-137dc976c7f6
+
+O2OA开发相关教程天梯:https://my.oschina.net/o2oa/blog/3016363
+
+
 
 # 配置编译环境\:
 
@@ -175,51 +180,73 @@ o2oa软件遵守双重协议,一个是AGPL授权协议,一个是商用授权
 商业授权是按年收费的,当所购买的商业授权过期后,您将无法再使用O2OA进行任何商业活动,但是您已经出售的O2OA软件或者已经使用O2OA完成后商业项目不会受到影响,仍可以继续使用和正常升级。当您需要再次使用O2OA进行商业活动的时候,只需要再次购买O2OA商业授权即可。
 
 
-# 最新版本 v4.1237\:
+# 最新版本 v4.1369\:
+
+2019-02-20 新增功能 :[桌面主题]己亥金猪新春主题。
+
+2019-02-20 新增功能 :[组织管理]增加组织层级调整。
+
+2019-02-20 新增功能 :[数据接口]增加获取直接上级组织接口。
+
+2019-02-20 新增功能 :[数据接口]增加获取递归上级组织接口。
+
+2019-02-20 新增功能 :[数据接口]增加获指定类型递归接上级组织接口。
+
+2019-02-20 新增功能 :[人员管理]增加登录是否需要验证码的设置config/person.json/captchaLogin=true。
+
+2019-02-20 新增功能 :[文本校正]文本语意校验功能。
+
+2019-02-20 新增功能 :[平台能力]自定义神经网络训练模型。
+
+2019-02-20 新增功能 :[平台能力]数据中心数据库表定制功能。
+
+2019-02-20 新增功能 :[平台能力]支持定制WAR包在系统中运行,可以定制应用。
+
+2019-02-20 新增功能 :[平台能力]增加自动启动功能,node。json中配置autoStart:true。
 
-2019-01-08 新增功能:[流程设计]批量上传附件资源功能。
+2019-02-20 功能优化 :[流程管理]增加文件资源的contentType识别
 
-2019-01-08 新增功能:[应用市场]增加导入本地应用文件功能(.xapp)。
+2019-02-20 功能优化 :[人员管理]增加对新增166号码的判断
 
-2019-01-08 新增功能:[表单设计]增加图片组件直接选择应用附件资源的功能。
+2019-02-20 功能优化 :[中心服务器]增加访问线程池20->100
 
-2019-01-08 新增功能:[组织管理]增加人员通过Excel导入的功能。
+2019-02-20 功能优化 :[平台能力]由于换行符的问题,在新版本MACOS中脚本无法启动的问题
 
-2019-01-08 新增功能:[组织管理]新增达梦数据库数据导出/导入。
+2019-02-20 功能优化 :[文件上传]删除POST和PUT数据时的上传数据限制
 
-2019-01-08 新增功能:[会议管理]支持匿名的附件参看功能。
+2019-02-20 功能优化 :[平台能力]更新最新版java依赖包
 
-2019-01-08 更新优化:[表单设计]大大加快了表单查看Json原始数据的速度,也不会再阻塞浏览器。
+2019-02-20 功能优化 :[数据中心]统计中现在可以指定某一列进行排序
 
-2019-01-08 更新优化:[表单设计]优化了表单和页面的HTML方式导入。
+2019-02-20 BUG修复 :[脑图应用]修复脑图无法使用的问题
 
-2019-01-08 更新优化:[WEB服务器]修正WEB服务器目录结构。
+2019-02-20 BUG修复 :[平台问题]修复同时载入多个CSS的问题
 
-2019-01-08 更新优化:[桌面应用]可将云文件|待办|已办等更多内容放置到桌面。
+2019-02-20 BUG修复 :[人脸识别]修正管理员通过人脸识别登录后没有获取管理权限的错误
 
-2019-01-08 更新优化:[应用服务器]升级POI到4.0.1,匹配tika的支持版本。
+2019-02-20 BUG修复 :[人员管理]通过excel导入人员时,员工号与唯一编码相同是的错误中断
 
-2019-01-08 更新优化:[搜索引擎]修改分词器,缩小安装包大小
+2019-02-20 BUG修复 :[服务器]修复扩展应用无法找到启动类的问题
 
-2019-01-08 更新优化:[搜索引擎]增加对特殊字符的过滤。
+2019-02-20 BUG修复 :[数据中心]修复长文本在视图中被截断的问题
 
-2019-01-08 BUG修复:[表单设计]修正一些旧版本表单的预览错误。
+2019-02-20 BUG修复 :[组织管理]修复政务钉钉人员同步时删除组织的运行错误。
 
-2019-01-08 BUG修复:[页面设计]修正页面图片路径错误的问题
+2019-02-20 BUG修复 :[数据中心]修复钉钉人员同步时删除组织的运行错误
 
-2019-01-08 BUG修复:[流程引擎]修正召回|撤回按钮显示条件的判断错误。
+2019-02-20 BUG修复 :[数据中心]修复linux下无法进行类增强的错误。
 
-2019-01-08 BUG修复:[流程引擎]修正调度按钮显示条件的判断错误。
+2019-02-20 BUG修复 :[数据中心]修复分类统计总数变成了累进总计的错误。
 
 
 # 最新版本服务器安装包下载\:
 
-windows 64Bit : http://download.o2oa.net/download/versions/o2server_20190110095409_windows.zip
+windows 64Bit : http://download.o2oa.net/download/versions/o2server_20190221125927_windows.zip
 
-Linux 64Bit : http://download.o2oa.net/download/versions/o2server_20190110095409_linux.zip
+Linux 64Bit : http://download.o2oa.net/download/versions/o2server_20190221125927_linux.zip
 
-MacOS : http://download.o2oa.net/download/versions/o2server_20190110095409_macos.zip
+MacOS : http://download.o2oa.net/download/versions/o2server_20190221125927_macos.zip
 
-AIX : http://download.o2oa.net/download/versions/o2server_20190110095409_aix.zip
+AIX : http://download.o2oa.net/download/versions/o2server_20190221125927_aix.zip
 
 

+ 4 - 6
o2server/build_common.xml

@@ -43,7 +43,7 @@
 		</delete>
 		<echo message="metamodel complete." />
 	</target>
-
+	<!--
 	<target name="createPersistenceXml">
 		<mkdir dir="${basedir}/src/main/resources/META-INF" />
 		<java classname="com.x.base.core.entity.tools.PersistenceXmlWriter" fork="true">
@@ -60,12 +60,12 @@
 			</classpath>
 			<arg value="{
 				project:'${project}',
-				path:'${basedir}/src/main/resources/META-INF/x_persistence.xml'
+				path:'${basedir}/src/main/resources/META-INF'
 			}" />
 		</java>
 		<echo>${project} create persistence xml: ${basedir}/src/main/resources/META-INF/x_persistence.xml</echo>
 	</target>
-
+-->
 	<target name="describe">
 		<echo>describe project:${project}</echo>
 		<mkdir dir="${basedir}/src/main/webapp/describe" />
@@ -101,7 +101,6 @@
 			<classpath>
 				<pathelement path="${basedir}/target/classes" />
 				<pathelement path="${basedir}/src/main/java" />
-				<pathelement path="${basedir}/src/main/resources" />
 				<fileset dir="${o2server.dir}/commons/ext">
 					<include name="*.jar" />
 				</fileset>
@@ -111,10 +110,9 @@
 				</fileset>
 			</classpath>
 			<arg value="{
-					path:'${basedir}/src/main/resources/META-INF/persistence.xml'
+					path:'${basedir}'
 				}" />
 		</java>
-		<sleep seconds="1" />
 	</target>
 
 </project>

BIN
o2server/commons/ext/ant.jar


BIN
o2server/commons/ext/classgraph-4.8.4.jar


+ 0 - 3
o2server/commons/ext/commons-beanutils-1.9.2.jar

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:05197d29e8a3241206ea7977cc9d0f6d507cea1dc84e0993fe64b369a0b24c43
-size 233857

BIN
o2server/commons/ext/commons-beanutils-1.9.3.jar


+ 0 - 3
o2server/commons/ext/commons-collections4-4.1.jar

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b1fe8b5968b57d8465425357ed2d9dc695504518bed2df5b565c4b8e68c1c8a5
-size 751238

BIN
o2server/commons/ext/commons-collections4-4.3.jar


+ 0 - 3
o2server/commons/ext/fast-classpath-scanner-2.4.5.jar

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c567eb480436188fd2742fa626ce1efe9140fc951b3432792551cf606dba50d9
-size 209556

BIN
o2server/commons/ext/gbase8s_jdbc.jar


BIN
o2server/commons/ext/javapoet-1.11.1.jar


+ 2 - 2
o2server/commons/ext/manifest.cfg

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:f37a03d5dd14fcad8edffdecb3114bb8a203b8b6f512d766408779d99c82a6ad
-size 2749
+oid sha256:c68a017fc524ac766eec4dd4bd8f4a07aa9f4b4d7475fe99fc7d8ab783857026
+size 2786

+ 0 - 3
o2server/commons/ext/mssql-jdbc-7.0.0.jre8.jar

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ada9194cc187ca74c84e1b80c99dac77f0dcba7d6878dc5627c76dbb252bae7a
-size 1166239

+ 0 - 3
o2server/commons/ext/mysql-connector-java-5.1.47.jar

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e4f84048f392b2b37baf46a8d508e4b8ddae286d209ef995b9e11885201c1923
-size 1007502

BIN
o2server/commons/ext/mysql-connector-java-8.0.15.jar


+ 2 - 2
o2server/commons/ext/openjpa-3.0.1-SNAPSHOT.jar

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:194a0d6b78356bda24f11da2553fe946f37ffe48d05b25dddc73e7efb66a626a
-size 4566145
+oid sha256:25436c2ed582046406b2dbe030402a13d9c0a08ca5ddb26291696668baecfa9e
+size 4574360

BIN
o2server/commons/ext/xbean-asm7-shaded-4.12.jar


BIN
o2server/commons/tess4j/tessdata/eng.traineddata


BIN
o2server/commons/tess4j/tessdata/osd.traineddata


BIN
o2server/commons/winsw.exe


+ 16 - 0
o2server/service_windows.bat

@@ -0,0 +1,16 @@
+@echo off
+if not "%1" == "install" ( if not "%1" == "uninstall"  ( if not "%1" == "start" ( if not "%1" == "stop" (
+echo     usage: service_windows.bat install ^| uninstall ^| start ^| stop
+echo     depend Microsoft.NET Framework 4
+goto out
+))))
+echo ^<configuration^> > %~dp0local\service.xml
+echo ^<id^>o2server^<^/id^> >> %~dp0local\service.xml
+echo ^<name^>o2server service^<^/name^> >> %~dp0local\service.xml
+echo ^<description^>winsw warpper o2server service.^<^/description^> >> %~dp0local\service.xml
+echo ^<executable^>%~dp0start_windows.bat^</executable^> >> %~dp0local\service.xml
+echo ^<log mode="none"^/^> >> %~dp0local\service.xml
+echo ^</configuration^> >> %~dp0local\service.xml
+copy %~dp0commons\winsw.exe %~dp0local\service.exe
+%~dp0local\service.exe %1
+:out 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
o2server/start_macos.sh


+ 2 - 2
o2server/x_base_core_project/pom.xml

@@ -24,7 +24,7 @@
 					</execution>
 					<execution>
 						<id>createEnhancePersistenceXml</id>
-						<phase>generate-resources</phase>
+						<phase>process-classes</phase>
 					</execution>
 				</executions>
 			</plugin>
@@ -34,7 +34,7 @@
 				<executions>
 					<execution>
 						<id>enhancer</id>
-						<phase>process-classes</phase>
+						<phase>prepare-package</phase>
 					</execution>
 				</executions>
 			</plugin>

+ 20 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/container/EntityManagerContainer.java

@@ -463,14 +463,32 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
 		return em.createQuery(cq).getSingleResult();
 	}
 
+	public <T extends JpaObject> Long countNotEqual(Class<T> cls, String attribute, Object value) throws Exception {
+		EntityManager em = this.get(cls);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<T> root = cq.from(cls);
+		cq.select(cb.count(root)).where(cb.notEqual(root.get(attribute), value));
+		return em.createQuery(cq).getSingleResult();
+	}
+
+	public <T extends JpaObject> Long countIsNull(Class<T> cls, String attribute) throws Exception {
+		EntityManager em = this.get(cls);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+		Root<T> root = cq.from(cls);
+		cq.select(cb.count(root)).where(cb.isNull(root.get(attribute)));
+		return em.createQuery(cq).getSingleResult();
+	}
+
 	public <T extends JpaObject> Long countEqualAndEqual(Class<T> cls, String euqalAttribute, Object equalValue,
-			String notEqualAttribute, Object notEqualValue) throws Exception {
+			String otherEqualAttribute, Object otherEqualValue) throws Exception {
 		EntityManager em = this.get(cls);
 		CriteriaBuilder cb = em.getCriteriaBuilder();
 		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
 		Root<T> root = cq.from(cls);
 		cq.select(cb.count(root)).where(cb.and(cb.equal(root.get(euqalAttribute), equalValue),
-				cb.equal(root.get(notEqualAttribute), notEqualValue)));
+				cb.equal(root.get(otherEqualAttribute), otherEqualValue)));
 		return em.createQuery(cq).getSingleResult();
 	}
 

+ 5 - 7
o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SliceEntityManagerContainerFactory.java

@@ -89,7 +89,7 @@ public abstract class SliceEntityManagerContainerFactory {
 			checkPersistFieldMap.put(clz, this.loadCheckPersistField(clz));
 			checkRemoveFieldMap.put(clz, this.loadCheckRemoveField(clz));
 			entityManagerFactoryMap.put(clz,
-					OpenJPAPersistence.createEntityManagerFactory(clz.getCanonicalName(), PERSISTENCE_XML_PATH));
+					OpenJPAPersistence.createEntityManagerFactory(clz.getName(), PERSISTENCE_XML_PATH));
 			List<Field> flagFields = new ArrayList<>();
 			List<Field> restrictFlagFields = new ArrayList<>();
 			for (Field o : FieldUtils.getFieldsListWithAnnotation(clz, Id.class)) {
@@ -112,9 +112,8 @@ public abstract class SliceEntityManagerContainerFactory {
 		Set<Class<? extends JpaObject>> classes = this.listUitClass(source);
 		for (Class<? extends JpaObject> clz : classes) {
 			checkPersistFieldMap.put(clz, this.loadCheckPersistField(clz));
-			checkRemoveFieldMap.put(clz, loadCheckRemoveField(clz));
-			entityManagerFactoryMap.put(clz,
-					OpenJPAPersistence.createEntityManagerFactory(clz.getCanonicalName(), source));
+			checkRemoveFieldMap.put(clz, this.loadCheckRemoveField(clz));
+			entityManagerFactoryMap.put(clz, OpenJPAPersistence.createEntityManagerFactory(clz.getName(), source));
 		}
 	}
 
@@ -140,10 +139,10 @@ public abstract class SliceEntityManagerContainerFactory {
 				unit.addAttribute("name", className);
 				unit.addAttribute("transaction-type", "RESOURCE_LOCAL");
 				Element provider = unit.addElement("provider");
-				provider.addText(PersistenceProviderImpl.class.getCanonicalName());
+				provider.addText(PersistenceProviderImpl.class.getName());
 				for (Class<?> o : JpaObjectTools.scanMappedSuperclass(clazz)) {
 					Element mapped_element = unit.addElement("class");
-					mapped_element.addText(o.getCanonicalName());
+					mapped_element.addText(o.getName());
 				}
 				Element slice_unit_properties = unit.addElement("properties");
 				for (Entry<String, String> entry : SlicePropertiesBuilder.getPropertiesDBCP(dataMappings.get(className))
@@ -224,7 +223,6 @@ public abstract class SliceEntityManagerContainerFactory {
 			if (null != checkPersist) {
 				map.put(fld, checkPersist);
 			}
-
 		}
 		return map;
 	}

+ 20 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/container/factory/SlicePropertiesBuilder.java

@@ -21,6 +21,7 @@ public class SlicePropertiesBuilder {
 	public static String driver_h2 = "org.h2.Driver";
 	public static String driver_dm = "dm.jdbc.driver.DmDriver";
 	public static String driver_sqlserver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+	public static String driver_gbase = "com.gbasedbt.jdbc.IfxDriver";
 	/** 避免db2在aix版本和lwl版本字段长度不一致的问题 */
 	public static String dictionary_db2 = "db2(createPrimaryKeys=false,characterColumnSize=255,maxColumnNameLength=128,maxIndexNameLength=128,maxConstraintNameLength=128)";
 	public static String dictionary_oracle = "oracle(maxTableNameLength=128,maxColumnNameLength=128,maxIndexNameLength=128,maxConstraintNameLength=128,maxEmbeddedClobSize=104857600)";
@@ -30,6 +31,7 @@ public class SlicePropertiesBuilder {
 	public static String dictionary_h2 = "org.apache.openjpa.jdbc.sql.H2Dictionary";
 	public static String dictionary_dm = "com.x.base.core.openjpa.jdbc.sql.DMDictionary";
 	public static String dictionary_sqlserver = "sqlserver(schemaCase=preserve)";
+	public static String dictionary_gbase = "com.x.base.core.openjpa.jdbc.sql.GBaseDictionary";
 
 	public static String validationQuery_db2 = "select 1 from sysibm.sysdummy1";
 	public static String validationQuery_oracle = "select 1 from dual";
@@ -39,6 +41,7 @@ public class SlicePropertiesBuilder {
 	public static String validationQuery_h2 = "select 1";
 	public static String validationQuery_dm = "select getdate()";
 	public static String validationQuery_sqlserver = "select 1";
+	public static String validationQuery_gbase = "select 1";
 
 	public static Map<String, String> getPropertiesDBCP(List<DataMapping> list) throws Exception {
 		try {
@@ -57,6 +60,9 @@ public class SlicePropertiesBuilder {
 			if (StringUtils.equals(determineDBDictionary(list.get(0)), dictionary_informix)) {
 				properties.put("openjpa.jdbc.Schema", JpaObject.default_schema);
 			}
+			if (StringUtils.equals(determineDBDictionary(list.get(0)), dictionary_gbase)) {
+				properties.put("openjpa.jdbc.Schema", JpaObject.default_schema);
+			}
 			if (StringUtils.equals(determineDBDictionary(list.get(0)), dictionary_dm)) {
 				properties.put("openjpa.jdbc.Schema", JpaObject.default_schema);
 			}
@@ -73,7 +79,8 @@ public class SlicePropertiesBuilder {
 			properties.put("openjpa.IgnoreChanges", "true");
 			properties.put("openjpa.QueryCache", "false");
 			properties.put("openjpa.jdbc.ResultSetType", "scroll-insensitive");
-			// properties.put("openjpa.DynamicEnhancementAgent", "true");
+			/* 如果启用本地初始化会导致classLoad的问题 */
+			properties.put("openjpa.DynamicEnhancementAgent", "false");
 			properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=false)");
 			// properties.put("openjpa.jdbc.SchemaFactory",
 			// "native(ForeignKeys=false)");
@@ -158,6 +165,10 @@ public class SlicePropertiesBuilder {
 				String url = dataMapping.getUrl();
 				str += ",validationQuery=" + validationQuery_informix + ", driverClassName=" + driver_informix
 						+ ", url=" + url;
+			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_gbase)) {
+				String url = dataMapping.getUrl();
+				str += ",validationQuery=" + validationQuery_gbase + ", driverClassName=" + driver_gbase + ", url="
+						+ url;
 			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_h2)) {
 				String url = dataMapping.getUrl();
 				str += ",validationQuery=" + validationQuery_h2 + ", driverClassName=" + driver_h2 + ", url=" + url;
@@ -200,6 +211,10 @@ public class SlicePropertiesBuilder {
 				String url = dataMapping.getUrl();
 				str += ", validationQuery=" + validationQuery_informix + ", driverClassName=" + driver_informix
 						+ ", url=" + url;
+			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_gbase)) {
+				String url = dataMapping.getUrl();
+				str += ", validationQuery=" + validationQuery_gbase + ", driverClassName=" + driver_gbase + ", url="
+						+ url;
 			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_h2)) {
 				String url = dataMapping.getUrl();
 				str += ", validationQuery=" + validationQuery_h2 + ", driverClassName=" + driver_h2 + ", url=" + url;
@@ -230,6 +245,8 @@ public class SlicePropertiesBuilder {
 				return driver_postgresql;
 			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_informix)) {
 				return driver_informix;
+			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_gbase)) {
+				return driver_gbase;
 			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_h2)) {
 				return driver_h2;
 			} else if (StringUtils.equals(determineDBDictionary(dataMapping), dictionary_dm)) {
@@ -267,6 +284,8 @@ public class SlicePropertiesBuilder {
 				return dictionary_postgresql;
 			} else if (StringUtils.containsIgnoreCase(dataMapping.getUrl(), "jdbc:informix-sqli:")) {
 				return dictionary_informix;
+			} else if (StringUtils.containsIgnoreCase(dataMapping.getUrl(), "jdbc:gbasedbt-sqli")) {
+				return dictionary_gbase;
 			} else if (StringUtils.containsIgnoreCase(dataMapping.getUrl(), "jdbc:h2:tcp:")) {
 				return dictionary_h2;
 			} else if (StringUtils.containsIgnoreCase(dataMapping.getUrl(), "jdbc:dm:")) {

+ 2 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageObject.java

@@ -183,6 +183,8 @@ public abstract class StorageObject extends SliceJpaObject {
 				try (InputStream input = fo.getContent().getInputStream()) {
 					length = IOUtils.copyLarge(input, output);
 				}
+			} else {
+				throw new Exception(fo.getPublicURIString() + " not existed, object:" + this.toString() + ".");
 			}
 			manager.closeFileSystem(fo.getFileSystem());
 		}

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageType.java

@@ -1,6 +1,6 @@
 package com.x.base.core.entity;
 
 public enum StorageType {
-	file, processPlatform, meeting, calendar, okr, cms, bbs, report, strategyDeploy;
+	file, processPlatform, mind, meeting, calendar, okr, cms, bbs, report, strategyDeploy;
 	public static final int length = JpaObject.length_32B;
 }

+ 3 - 2
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntity.java

@@ -54,16 +54,17 @@ public class DynamicEntity extends GsonPropertyObject {
 		if (StringUtils.isEmpty(name)) {
 			throw new Exception("name is empty.");
 		}
-		return StringUtils.capitalize(name);
+		return name;
 	}
 
 	public String className() throws Exception {
 		if (StringUtils.isEmpty(name)) {
 			throw new Exception("name is empty.");
 		}
-		return CLASS_PACKAGE + "." + StringUtils.capitalize(name);
+		return CLASS_PACKAGE + "." + name;
 	}
 
+	@SuppressWarnings("unchecked")
 	public Class<? extends JpaObject> getObjectClass() throws Exception {
 		return (Class<? extends JpaObject>) Class.forName(this.className());
 	}

+ 12 - 6
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java

@@ -52,11 +52,11 @@ import com.x.base.core.entity.dynamic.DynamicEntity.StringMapField;
 import com.x.base.core.entity.dynamic.DynamicEntity.TimeField;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.tools.ListTools;
- 
 
 public class DynamicEntityBuilder {
 
 	public static final String FIELDNAME_SUFFIX = "_FIELDNAME";
+	public static final String DOT_CLASS = ".class";
 
 	private DynamicEntity dynamicEntity;
 	private File dir;
@@ -353,15 +353,21 @@ public class DynamicEntityBuilder {
 				.build();
 
 		AnnotationSpec persistentCollection = AnnotationSpec.builder(PersistentCollection.class)
-				.addMember("fetch", "javax.persistence.FetchType.EAGER").build();
+				.addMember("fetch", "javax.persistence.FetchType.EAGER")
+				.addMember("elementType", typeClass.getSimpleName() + DOT_CLASS).build();
 
 		AnnotationSpec orderColumn = AnnotationSpec.builder(OrderColumn.class).addMember("name", "ORDERCOLUMNCOLUMN")
 				.build();
 
-		AnnotationSpec elementColumn = AnnotationSpec.builder(ElementColumn.class).addMember("length", "length_255B")
-				.addMember("name", "ColumnNamePrefix + " + field.fieldName()).build();
-
-		ClassName type = ClassName.get(String.class);
+		AnnotationSpec elementColumn = null;
+		if (CharSequence.class.isAssignableFrom(typeClass)) {
+			elementColumn = AnnotationSpec.builder(ElementColumn.class).addMember("length", "length_255B")
+					.addMember("name", "ColumnNamePrefix + " + field.fieldName()).build();
+		} else {
+			elementColumn = AnnotationSpec.builder(ElementColumn.class)
+					.addMember("name", "ColumnNamePrefix + " + field.fieldName()).build();
+		}
+		ClassName type = ClassName.get(typeClass);
 		ClassName list = ClassName.get(List.class);
 		TypeName list_type = ParameterizedTypeName.get(list, type);
 

+ 6 - 13
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/tools/EnhancePersistenceXmlWriter.java

@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
 import javax.persistence.Entity;
 import javax.persistence.MappedSuperclass;
 
+import org.apache.commons.io.FileUtils;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
 import org.dom4j.Element;
@@ -50,7 +51,11 @@ public class EnhancePersistenceXmlWriter {
 			}
 			OutputFormat format = OutputFormat.createPrettyPrint();
 			format.setEncoding("UTF-8");
-			XMLWriter writer = new XMLWriter(new FileWriter(new File(arg.getPath())), format);
+			File dir = new File(arg.getPath(), "target/classes/META-INF");
+			// File dir = new File(arg.getPath(), "src/main/resources/META-INF");
+			FileUtils.forceMkdir(dir);
+			File file = new File(dir, "persistence.xml");
+			XMLWriter writer = new XMLWriter(new FileWriter(file), format);
 			writer.write(document);
 			writer.close();
 			System.out.println("create enhance persistence.xml at path:" + arg.getPath());
@@ -68,18 +73,6 @@ public class EnhancePersistenceXmlWriter {
 			}
 			return list.stream().sorted(Comparator.comparing(Class::getName)).collect(Collectors.toList());
 		}
-//		FastClasspathScanner scanner = new FastClasspathScanner(Packages.PREFIX);
-//		ScanResult scanResult = scanner.scan();
-//		List<Class<?>> sortedList = new ArrayList<Class<?>>();
-//		for (String str : scanResult.getNamesOfClassesWithAnnotationsAnyOf(MappedSuperclass.class, Entity.class)) {
-//			sortedList.add(Class.forName(str));
-//		}
-//		Collections.sort(sortedList, new Comparator<Class<?>>() {
-//			public int compare(Class<?> c1, Class<?> c2) {
-//				return c1.getCanonicalName().compareTo(c2.getCanonicalName());
-//			}
-//		});
-//		return sortedList;
 	}
 
 	private static Set<Class<?>> scanMappedSuperclass(Class<?> clz) throws Exception {

+ 7 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/openjpa/jdbc/sql/GBaseDictionary.java

@@ -0,0 +1,7 @@
+package com.x.base.core.openjpa.jdbc.sql;
+
+import org.apache.openjpa.jdbc.sql.InformixDictionary;
+
+public class GBaseDictionary extends InformixDictionary {
+	public static final String VENDOR_OTHER = "gbase";
+}

+ 74 - 69
o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java

@@ -52,15 +52,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		return this.get(clz.getName());
 	}
 
-//	public void add(Class<?> applicationClass, Application application) throws Exception {
-//		CopyOnWriteArrayList<Application> list = this.get(applicationClass.getName());
-//		if (null == list) {
-//			list = new CopyOnWriteArrayList<Application>();
-//			this.put(applicationClass.getName(), list);
-//		}
-//		list.add(application);
-//	}
-
 	public void add(String className, Application application) throws Exception {
 		CopyOnWriteArrayList<Application> list = this.get(className);
 		if (null == list) {
@@ -70,120 +61,138 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		list.add(application);
 	}
 
+	public ActionResponse getQuery(Class<?> applicationClass, String uri) throws Exception {
+		return this.getQuery(false, applicationClass.getName(), uri);
+	}
+
 	public ActionResponse getQuery(Boolean xdebugger, Class<?> applicationClass, String uri) throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
+		return this.getQuery(xdebugger, applicationClass.getName(), uri);
 	}
 
-	public ActionResponse getQuery(Class<?> applicationClass, String uri) throws Exception {
-		return this.getQuery(false, applicationClass, uri);
+	public ActionResponse getQuery(Application application, String uri) throws Exception {
+		return this.getQuery(false, application, uri);
 	}
 
 	public ActionResponse getQuery(Boolean xdebugger, Application application, String uri) throws Exception {
-		return CipherConnectionAction.get(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot(), CipherConnectionAction.trim(uri)));
+		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse getQuery(Application application, String uri) throws Exception {
-		return this.getQuery(false, application, uri);
+	public ActionResponse getQuery(String applicationName, String uri) throws Exception {
+		return getQuery(false, applicationName, uri);
 	}
 
 	public ActionResponse getQuery(Boolean xdebugger, String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.getQuery(xdebugger, cls, uri);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("getQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse getQuery(String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.getQuery(false, cls, uri);
+	public ActionResponse deleteQuery(Class<?> applicationClass, String uri) throws Exception {
+		return this.deleteQuery(false, applicationClass.getName(), uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, Class<?> applicationClass, String uri) throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.delete(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
+		return this.deleteQuery(xdebugger, applicationClass.getName(), uri);
 	}
 
-	public ActionResponse deleteQuery(Class<?> applicationClass, String uri) throws Exception {
-		return this.deleteQuery(false, applicationClass, uri);
+	public ActionResponse deleteQuery(Application application, String uri) throws Exception {
+		return this.deleteQuery(false, application, uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, Application application, String uri) throws Exception {
 		return CipherConnectionAction.delete(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse deleteQuery(Application application, String uri) throws Exception {
-		return this.deleteQuery(false, application, uri);
+	public ActionResponse deleteQuery(String applicationName, String uri) throws Exception {
+		return deleteQuery(false, applicationName, uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.deleteQuery(xdebugger, cls, uri);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("deleteQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.delete(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse deleteQuery(String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.deleteQuery(false, cls, uri);
+	public ActionResponse postQuery(Class<?> applicationClass, String uri, Object body) throws Exception {
+		return this.postQuery(false, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object o)
+	public ActionResponse postQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object body)
 			throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.post(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), o);
+		return this.postQuery(xdebugger, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse postQuery(Class<?> applicationClass, String uri, Object o) throws Exception {
-		return this.postQuery(false, applicationClass, uri, o);
+	public ActionResponse postQuery(Application application, String uri, Object body) throws Exception {
+		return this.postQuery(false, application, uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, Application application, String uri, Object o) throws Exception {
-		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), o);
+	public ActionResponse postQuery(Boolean xdebugger, Application application, String uri, Object body)
+			throws Exception {
+		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri),
+				body);
 	}
 
-	public ActionResponse postQuery(Application application, String uri, Object o) throws Exception {
-		return this.postQuery(false, application, uri, o);
+	public ActionResponse postQuery(String applicationName, String uri, String body) throws Exception {
+		return this.postQuery(false, applicationName, uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, String applicationName, String uri, String body)
+	public ActionResponse postQuery(Boolean xdebugger, String applicationName, String uri, Object body)
 			throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.postQuery(xdebugger, cls, uri, body);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("postQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri),
+				body);
 	}
 
-	public ActionResponse postQuery(String applicationName, String uri, String body) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.postQuery(false, cls, uri, body);
+	public ActionResponse putQuery(Class<?> applicationClass, String uri, Object body) throws Exception {
+		return this.putQuery(false, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object o)
+	public ActionResponse putQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object body)
 			throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.put(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), o);
+		return this.putQuery(xdebugger, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse putQuery(Class<?> applicationClass, String uri, Object o) throws Exception {
-		return this.putQuery(false, applicationClass, uri, o);
+	public ActionResponse putQuery(Application application, String uri, Object body) throws Exception {
+		return this.putQuery(false, application, uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, Application application, String uri, Object o) throws Exception {
+	public ActionResponse putQuery(Boolean xdebugger, Application application, String uri, Object body)
+			throws Exception {
 		return CipherConnectionAction.put(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), o);
+				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), body);
 	}
 
-	public ActionResponse putQuery(Application application, String uri, Object o) throws Exception {
-		return this.putQuery(false, application, uri, o);
+	public ActionResponse putQuery(String applicationName, String uri, Object body) throws Exception {
+		return this.putQuery(false, applicationName, uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, String applicationName, String uri, String body)
+	public ActionResponse putQuery(Boolean xdebugger, String applicationName, String uri, Object body)
 			throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.putQuery(xdebugger, cls, uri, body);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("putQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.put(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), body);
 	}
 
-	public ActionResponse putQuery(String applicationName, String uri, String body) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.putQuery(false, cls, uri, body);
+	public String findApplicationName(String name) throws Exception {
+		for (String str : this.keySet()) {
+			if (StringUtils.equalsIgnoreCase(str, name) || StringUtils.endsWithIgnoreCase(str, "." + name)) {
+				return str;
+			}
+		}
+		return null;
 	}
 
 	public Application randomWithWeight(String className) throws Exception {
@@ -213,10 +222,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		throw new Exception("randomWithWeight error.");
 	}
 
-	public Application randomWithWeight(Class<?> clz) throws Exception {
-		return this.randomWithWeight(clz.getName());
-	}
-
 	public static String joinQueryUri(String... parts) {
 		return Stream.of(parts).map(s -> {
 			try {

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

@@ -65,8 +65,10 @@ public class Config {
 	public static final String PATH_COMMONS_MOOTOOLSSCRIPTTEXT = "commons/mooToolsScriptText.js";
 
 	public static final String DIR_COMMONS = "commons";
+	public static final String DIR_COMMONS_TESS4J_TESSDATA = "commons/tess4j/tessdata";
 	public static final String DIR_COMMONS_EXT = "commons/ext";
 	public static final String DIR_CONFIG = "config";
+	public static final String DIR_CONFIGSAMPLE = "configSample";
 	public static final String DIR_CUSTOM = "custom";
 	public static final String DIR_CUSTOM_JARS = "custom/jars";
 	public static final String DIR_DYNAMIC = "dynamic";
@@ -77,11 +79,14 @@ public class Config {
 	public static final String DIR_JVM_MACOS = "jvm/macos";
 	public static final String DIR_JVM_WINDOWS = "jvm/windows";
 	public static final String DIR_LOCAL = "local";
+	public static final String DIR_LOCAL_BACKUP = "local/backup";
+	public static final String DIR_LOCAL_UPDATE = "local/update";
 	public static final String DIR_LOCAL_TEMP = "local/temp";
 	public static final String DIR_LOCAL_TEMP_CLASSES = "local/temp/classes";
 	public static final String DIR_LOCAL_TEMP_DYNAMIC = "local/temp/dynamic";
 	public static final String DIR_LOCAL_TEMP_DYNAMIC_SRC = "local/temp/dynamic/src";
 	public static final String DIR_LOCAL_TEMP_DYNAMIC_TARGET = "local/temp/dynamic/target";
+	public static final String DIR_LOCALSAMPLE = "localSample";
 	public static final String DIR_LOGS = "logs";
 	public static final String DIR_SERVERS = "servers";
 	public static final String DIR_SERVERS_APPLICATIONSERVER = "servers/applicationServer";
@@ -101,6 +106,10 @@ public class Config {
 		return new File(base(), DIR_COMMONS);
 	}
 
+	public static File dir_commons_tess4j_tessdata() throws Exception {
+		return new File(base(), DIR_COMMONS_TESS4J_TESSDATA);
+	}
+
 	public static File dir_commons_ext() throws Exception {
 		return new File(base(), DIR_COMMONS_EXT);
 	}
@@ -109,6 +118,10 @@ public class Config {
 		return new File(base(), DIR_CONFIG);
 	}
 
+	public static File dir_configSample() throws Exception {
+		return new File(base(), DIR_CONFIGSAMPLE);
+	}
+
 	public static File dir_custom() throws Exception {
 		return dir_custom(true);
 	}
@@ -169,6 +182,38 @@ public class Config {
 		return new File(base(), DIR_LOCAL);
 	}
 
+	public static File dir_local_backup() throws Exception {
+		return new File(base(), DIR_LOCAL_BACKUP);
+	}
+
+	public static File dir_local_backup(boolean force) throws Exception {
+		File dir = new File(base(), DIR_LOCAL_BACKUP);
+		if (force) {
+			if ((!dir.exists()) || dir.isFile()) {
+				FileUtils.forceMkdir(dir);
+			}
+		}
+		return dir;
+	}
+
+	public static File dir_local_update() throws Exception {
+		return new File(base(), DIR_LOCAL_UPDATE);
+	}
+
+	public static File dir_local_update(boolean force) throws Exception {
+		File dir = new File(base(), DIR_LOCAL_UPDATE);
+		if (force) {
+			if ((!dir.exists()) || dir.isFile()) {
+				FileUtils.forceMkdir(dir);
+			}
+		}
+		return dir;
+	}
+
+	public static File dir_localSample() throws Exception {
+		return new File(base(), DIR_LOCALSAMPLE);
+	}
+
 	public static File dir_local_temp() throws Exception {
 		return new File(base(), DIR_LOCAL_TEMP);
 	}

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DataMapping.java

@@ -15,7 +15,7 @@ public class DataMapping extends GsonPropertyObject {
 	private LogLevel enhanceLevel = LogLevel.WARN;
 	private LogLevel queryLevel = LogLevel.WARN;
 	private LogLevel sqlLevel = LogLevel.WARN;
-	private LogLevel jdbcLevel = LogLevel.WARN;
+	private LogLevel jdbcLevel = LogLevel.ERROR;
 
 	public String getUrl() {
 		return url;

+ 22 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/LogLevel.java

@@ -13,6 +13,12 @@ public class LogLevel extends ConfigObject {
 	@FieldDescribe("是否启用调试")
 	private String x_processplatform_service_processing = "";
 
+	@FieldDescribe("是否启用调试")
+	private String x_processplatform_assemble_surface = "";
+
+	@FieldDescribe("是否启用调试")
+	private String x_processplatform_assemble_designer = "";
+
 	@FieldDescribe("是否启用调试")
 	private String x_query_assemble_designer = "";
 
@@ -37,10 +43,13 @@ public class LogLevel extends ConfigObject {
 	@FieldDescribe("是否启用调试")
 	private String x_general_assemble_control = "";
 
+	@FieldDescribe("是否启用调试")
+	private String x_file_assemble_control = "";
+
 	public static LogLevel defaultInstance() {
 		return new LogLevel();
 	}
-	
+
 	public String x_program_center() {
 		return this.get(this.x_program_center);
 	}
@@ -49,6 +58,14 @@ public class LogLevel extends ConfigObject {
 		return this.get(this.x_processplatform_service_processing);
 	}
 
+	public String x_processplatform_assemble_surface() {
+		return this.get(this.x_processplatform_assemble_surface);
+	}
+
+	public String x_processplatform_assemble_designer() {
+		return this.get(this.x_processplatform_assemble_designer);
+	}
+
 	public String x_query_assemble_surface() {
 		return this.get(this.x_query_assemble_surface);
 	}
@@ -81,6 +98,10 @@ public class LogLevel extends ConfigObject {
 		return this.get(this.x_general_assemble_control);
 	}
 
+	public String x_file_assemble_control() {
+		return this.get(this.x_general_assemble_control);
+	}
+
 	private String get(String str) {
 		if (StringUtils.equalsIgnoreCase(str, Logger.ERROR)) {
 			return Logger.ERROR;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Person.java


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

@@ -1,12 +1,11 @@
 package com.x.base.core.project.config;
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.tika.utils.SystemUtils;
 import org.quartz.CronExpression;
 
 import com.x.base.core.project.annotation.FieldDescribe;
@@ -82,7 +81,7 @@ public class Query extends ConfigObject {
 	}
 
 	public Boolean getExtractImage() {
-		return BooleanUtils.isTrue(extractImage);
+		return SystemUtils.IS_OS_WINDOWS && BooleanUtils.isTrue(extractImage);
 	}
 
 	public String getTessLanguage() {

+ 10 - 10
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/HttpConnection.java

@@ -23,16 +23,16 @@ import com.x.base.core.project.tools.ListTools;
 
 public class HttpConnection {
 
-	private static String Access_Control_Allow_Credentials = "Access-Control-Allow-Credentials";
-	private static String Access_Control_Allow_Credentials_Value = "true";
-	private static String Access_Control_Allow_Headers = "Access-Control-Allow-Headers";
-	private static String Access_Control_Allow_Headers_Value = "x-requested-with, x-request, x-token,Content-Type, x-cipher";
-	private static String Access_Control_Allow_Methods = "Access-Control-Allow-Methods";
-	private static String Access_Control_Allow_Methods_Value = "GET, POST, OPTIONS, PUT, DELETE, HEAD, TRACE";
-	private static String Cache_Control = "Cache-Control";
-	private static String Cache_Control_Value = "no-cache, no-transform";
-	private static String Content_Type = "Content-Type";
-	private static String Content_Type_Value = "application/json;charset=UTF-8";
+	public static final String Access_Control_Allow_Credentials = "Access-Control-Allow-Credentials";
+	public static final String Access_Control_Allow_Credentials_Value = "true";
+	public static final String Access_Control_Allow_Headers = "Access-Control-Allow-Headers";
+	public static final String Access_Control_Allow_Headers_Value = "x-requested-with, x-request, x-token,Content-Type, x-cipher";
+	public static final String Access_Control_Allow_Methods = "Access-Control-Allow-Methods";
+	public static final String Access_Control_Allow_Methods_Value = "GET, POST, OPTIONS, PUT, DELETE, HEAD, TRACE";
+	public static final String Cache_Control = "Cache-Control";
+	public static final String Cache_Control_Value = "no-cache, no-transform";
+	public static final String Content_Type = "Content-Type";
+	public static final String Content_Type_Value = "application/json;charset=UTF-8";
 
 	public static String getAsString(String address, List<NameValuePair> heads) throws Exception {
 		HttpURLConnection connection = prepare(address, heads);

+ 15 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/logger/Logger.java

@@ -69,6 +69,21 @@ public class Logger {
 
 	private final static String HTTPMESSAGEFORMAT = " > person:{}, method:{}, request:{}, remote host:{} address:{}, head:{}, body:{}.";
 
+	public boolean isDebug(EffectivePerson effectivePerson) {
+		if (null != effectivePerson && BooleanUtils.isTrue(effectivePerson.getDebugger())) {
+			return true;
+		} else {
+			return this.isDebug();
+		}
+	}
+
+	public boolean isDebug() {
+		if (level <= DEBUG_INT) {
+			return true;
+		}
+		return false;
+	}
+
 	public void print(String message, Object... os) {
 		this.log(PRINT, message, os);
 	}

+ 39 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingEngine.java

@@ -23,6 +23,7 @@ public class ScriptingEngine {
 
 	private static final String distinguishedName = "distinguishedName";
 
+	public static final String BINDINGNAME_GSON = "gson";
 	public static final String BINDINGNAME_ORGANIZATION = "organization";
 	public static final String BINDINGNAME_WORKCONTEXT = "workContext";
 	public static final String BINDINGNAME_DATA = "data";
@@ -31,7 +32,14 @@ public class ScriptingEngine {
 	public static final String BINDINGNAME__LOOKUP = "lookup";
 	public static final String BINDINGNAME_APPLICATIONS = "applications";
 	public static final String BINDINGNAME_PARAMETER = "parameter";
+	public static final String BINDINGNAME_PARAMETERS = "parameters";
 	public static final String BINDINGNAME_EFFECTIVEPERSON = "effectivePerson";
+	public static final String BINDINGNAME_JAXRSRESPONSE = "jaxrsResponse";
+	public static final String BINDINGNAME_JAXWSRESPONSE = "jaxwsResponse";
+	public static final String BINDINGNAME_ROUTEDATA = "routeData";
+
+	public static final String BINDINGNAME_ROUTES = "routes";
+	public static final String BINDINGNAME_ROUTE = "route";
 
 	public ScriptingEngine(ScriptEngine scriptEngine) {
 		this.scriptEngine = scriptEngine;
@@ -78,17 +86,47 @@ public class ScriptingEngine {
 		this.scriptEngine.put(BINDINGNAME_APPLICATIONS, o);
 		return this;
 	}
-	
+
 	public ScriptingEngine bindingEffectivePerson(EffectivePerson effectivePerson) {
 		this.scriptEngine.put(BINDINGNAME_EFFECTIVEPERSON, effectivePerson);
 		return this;
 	}
 
+	public ScriptingEngine bindingJaxrsResponse(Object o) {
+		this.scriptEngine.put(BINDINGNAME_JAXRSRESPONSE, o);
+		return this;
+	}
+
+	public ScriptingEngine bindingJaxwsResponse(Object o) {
+		this.scriptEngine.put(BINDINGNAME_JAXWSRESPONSE, o);
+		return this;
+	}
+
 	public ScriptingEngine bindingParameter(Object o) {
 		this.scriptEngine.put(BINDINGNAME_PARAMETER, o);
 		return this;
 	}
 
+	public ScriptingEngine bindingParameters(Object o) {
+		this.scriptEngine.put(BINDINGNAME_PARAMETERS, o);
+		return this;
+	}
+
+	public ScriptingEngine bindingRouteData(String str) {
+		this.scriptEngine.put(BINDINGNAME_ROUTEDATA, str);
+		return this;
+	}
+
+	public ScriptingEngine bindingRoutes(Object o) {
+		this.scriptEngine.put(BINDINGNAME_ROUTES, o);
+		return this;
+	}
+
+	public ScriptingEngine bindingRoute(Object o) {
+		this.scriptEngine.put(BINDINGNAME_ROUTE, o);
+		return this;
+	}
+
 	public Object eval(String scriptText) throws Exception {
 		StringBuffer sb = new StringBuffer();
 		try {

+ 31 - 11
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ExtractTextTools.java → o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/ExtractTextTools.java

@@ -1,4 +1,4 @@
-package com.x.query.service.processing;
+package com.x.base.core.project.tools;
 
 import java.awt.image.BufferedImage;
 import java.io.ByteArrayInputStream;
@@ -34,6 +34,8 @@ public class ExtractTextTools {
 
 	private static Tika tika = null;
 
+	public static final Integer MAXLENGTH = 1024 * 1024 * 32;
+
 	public static boolean support(String name) {
 		String ext = StringUtils.substringAfterLast(name, ".");
 		if (StringUtils.isNotEmpty(ext)) {
@@ -43,8 +45,27 @@ public class ExtractTextTools {
 		return false;
 	}
 
-	public static final List<String> SUPPORT_TYPES = UnmodifiableList.unmodifiableList(
-			ListTools.toList(".doc", ".docx", ".pdf", ".xls", ".xlsx", ".txt", ".jpg", ".png", ".gif"));
+	public static boolean supportImage(String name) {
+		String ext = StringUtils.substringAfterLast(name, ".");
+		if (StringUtils.isNotEmpty(ext)) {
+			ext = "." + StringUtils.lowerCase(ext);
+			return SUPPORT_IMAGE_TYPES.contains(ext);
+		}
+		return false;
+	}
+
+	public static boolean available(byte[] bytes) {
+		if (null == bytes || bytes.length == 0 || bytes.length > MAXLENGTH) {
+			return false;
+		}
+		return true;
+	}
+
+	public static final List<String> SUPPORT_TYPES = UnmodifiableList.unmodifiableList(ListTools.toList(".doc", ".docx",
+			".pdf", ".xls", ".xlsx", ".txt", ".bmp", ".jpg", ".png", ".gif", ".jpeg", "jpe"));
+
+	public static final List<String> SUPPORT_IMAGE_TYPES = UnmodifiableList
+			.unmodifiableList(ListTools.toList(".bmp", ".jpg", ".png", ".gif", ".jpeg", "jpe"));
 
 	public static String extract(byte[] bytes, String name, Boolean office, Boolean pdf, Boolean txt, Boolean image) {
 		if ((null != bytes) && bytes.length > 0 && bytes.length < 1024 * 1024 * 10) {
@@ -68,7 +89,9 @@ public class ExtractTextTools {
 			}
 			if (image) {
 				if (StringUtils.endsWithIgnoreCase(name, ".jpg") || StringUtils.endsWithIgnoreCase(name, ".png")
-						|| StringUtils.endsWithIgnoreCase(name, ".gif")) {
+						|| StringUtils.endsWithIgnoreCase(name, ".gif") || StringUtils.endsWithIgnoreCase(name, ".bmp")
+						|| StringUtils.endsWithIgnoreCase(name, ".jpeg")
+						|| StringUtils.endsWithIgnoreCase(name, ".jpe")) {
 					return image(bytes);
 				}
 			}
@@ -115,12 +138,9 @@ public class ExtractTextTools {
 	}
 
 	public static String image(byte[] bytes) {
-		try {
-
-			try (ByteArrayInputStream in = new ByteArrayInputStream(bytes);) {
-				BufferedImage image = ImageIO.read(in);
-				return tesseractInstance().doOCR(image);
-			}
+		try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
+			BufferedImage image = ImageIO.read(in);
+			return tesseractInstance().doOCR(image);
 		} catch (Exception e) {
 			logger.error(e);
 		}
@@ -132,7 +152,7 @@ public class ExtractTextTools {
 			synchronized (ExtractTextTools.class) {
 				if (null == tesseract) {
 					tesseract = new Tesseract();
-					tesseract.setDatapath(Config.base() + "/commons/tess4j/tessdata");// 设置训练库的位置
+					tesseract.setDatapath(Config.dir_commons_tess4j_tessdata().getAbsolutePath());// 设置训练库的位置
 					tesseract.setLanguage(Config.query().getTessLanguage());// 中文识别
 				}
 			}

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

@@ -0,0 +1,16 @@
+package com.x.base.core.project.tools;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+public class PropertyTools {
+	@SuppressWarnings("unchecked")
+	public static <T> T getOrElse(Object bean, String name, Class<T> cls, T defaultObject) throws Exception {
+		if (null == bean) {
+			return defaultObject;
+		}
+		if (PropertyUtils.isReadable(bean, name)) {
+			return (T) PropertyUtils.getProperty(bean, name);
+		}
+		return defaultObject;
+	}
+}

+ 2 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_query_assemble_designer.java

@@ -21,7 +21,8 @@ public class x_query_assemble_designer extends AssembleA {
 		dependency.containerEntities.add("com.x.query.core.entity.neural.InValue");
 		dependency.containerEntities.add("com.x.query.core.entity.neural.OutValue");
 		dependency.containerEntities.add("com.x.query.core.entity.neural.Model");
-		dependency.containerEntities.add("com.x.query.core.entity.schema.*");
+		dependency.containerEntities.add("com.x.query.core.entity.schema.Table");
+		dependency.containerEntities.add("com.x.query.core.entity.schema.Statement");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.Review");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.Work");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.WorkCompleted");

+ 3 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_query_assemble_surface.java

@@ -23,7 +23,8 @@ public class x_query_assemble_surface extends AssembleA {
 		dependency.containerEntities.add("com.x.query.core.entity.neural.InValue");
 		dependency.containerEntities.add("com.x.query.core.entity.neural.OutValue");
 		dependency.containerEntities.add("com.x.query.core.entity.neural.Model");
-		dependency.containerEntities.add("com.x.query.core.entity.schema.*");
+		dependency.containerEntities.add("com.x.query.core.entity.schema.Table");
+		dependency.containerEntities.add("com.x.query.core.entity.schema.Statement");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.Review");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.Work");
 		dependency.containerEntities.add("com.x.processplatform.core.entity.content.WorkCompleted");
@@ -40,5 +41,6 @@ public class x_query_assemble_surface extends AssembleA {
 		dependency.storeJars.add(x_processplatform_core_entity.class.getSimpleName());
 		dependency.storeJars.add(x_cms_core_entity.class.getSimpleName());
 		dependency.storeJars.add(x_query_core_express.class.getSimpleName());
+		dependency.dynamicJars.add("x_query_dynamic_entity");
 	}
 }

+ 4 - 4
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSSubjectInfoFactory.java

@@ -277,7 +277,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.sectionId ), sectionId));
 		}
 		if( needPicture != null && needPicture ){
-			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ) );
+			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ),  cb.notEqual( root.get( BBSSubjectInfo_.picId ), ""));
 		}
 		if( creatorName != null && !creatorName.isEmpty() ){
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.creatorName ), creatorName ) );
@@ -316,7 +316,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.sectionId ), sectionId));
 		}
 		if( needPicture != null && needPicture ){
-			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ) );
+			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ),  cb.notEqual( root.get( BBSSubjectInfo_.picId ), ""));
 		}
 		if( creatorName != null && !creatorName.isEmpty() ){
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.creatorName ), creatorName ) );
@@ -418,7 +418,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.sectionId ), sectionId));
 		}
 		if( needPicture != null && needPicture ){
-			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ) );
+			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ),  cb.notEqual( root.get( BBSSubjectInfo_.picId ), ""));
 		}
 		cq.select( cb.count( root ) );		
 		return em.createQuery(cq.where(p)).getSingleResult();
@@ -454,7 +454,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 			p = cb.and( p, cb.equal( root.get( BBSSubjectInfo_.sectionId ), sectionId));
 		}
 		if( needPicture != null && needPicture ){
-			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ) );
+			p = cb.and( p, cb.isNotNull( root.get( BBSSubjectInfo_.picId ) ),  cb.notEqual( root.get( BBSSubjectInfo_.picId ), ""));
 		}
 		cq.orderBy( cb.desc( root.get( BBSSubjectInfo_.createTime ) ) );
 		return em.createQuery(cq.where(p)).setMaxResults( maxRecordCount ).getResultList();

+ 28 - 3
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGet.java

@@ -21,15 +21,17 @@ import com.x.bbs.assemble.control.jaxrs.foruminfo.exception.ExceptionForumInfoPr
 import com.x.bbs.entity.BBSForumInfo;
 import com.x.bbs.entity.BBSSectionInfo;
 
+import net.sf.ehcache.Element;
+
 public class ActionGet extends BaseAction {
 	
 	private static  Logger logger = LoggerFactory.getLogger( ActionGet.class );
 	
+	@SuppressWarnings("unchecked")
 	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
-		Wo wrap = null;
-		BBSForumInfo forumInfo = null;
 		Boolean check = true;
+		
 		if( check ){
 			if( id == null || id.isEmpty() ){
 				check = false;
@@ -38,6 +40,28 @@ public class ActionGet extends BaseAction {
 			}
 		}
 		
+		if( check ){
+			String cacheKey = "forum#" + id;
+			Element element = cache.get( cacheKey );
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<Wo> result_cache = (ActionResult<Wo>) element.getObjectValue();
+				result.setData( result_cache.getData() );
+				result.setCount( 1L);
+			} else {
+				//继续进行数据查询
+				result = getForumQueryResult( id, request, effectivePerson );
+				cache.put(new Element(cacheKey, result ));
+			}
+		}
+		return result;
+	}
+	
+	private ActionResult<Wo> getForumQueryResult(String id, HttpServletRequest request, EffectivePerson effectivePerson) {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wrap = null;
+		BBSForumInfo forumInfo = null;
+		Boolean check = true;
+		
 		if( check ){
 			try {
 				forumInfo = forumInfoServiceAdv.get( id );
@@ -57,6 +81,7 @@ public class ActionGet extends BaseAction {
 					//TODO 为了不改变前端的逻辑,此处将List转为String进行输出,逗号分隔
 					wrap.setForumManagerName( wrap.transferStringListToString( wrap.getForumManagerList()) );
 					result.setData( wrap );
+					result.setCount(1L);
 				} catch (Exception e) {
 					check = false;
 					Exception exception = new ExceptionForumInfoProcess( e, "系统将论坛信息对象转换为输出数据时发生异常。" );
@@ -70,7 +95,7 @@ public class ActionGet extends BaseAction {
 		}
 		return result;
 	}
-	
+
 	public static class Wo extends BBSForumInfo{
 		
 		@FieldDescribe("字符串形式输出的管理员信息,逗号(,)分隔.")

+ 24 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGetAll.java

@@ -20,11 +20,34 @@ import com.x.bbs.assemble.control.jaxrs.foruminfo.exception.ExceptionForumInfoPr
 import com.x.bbs.entity.BBSForumInfo;
 import com.x.bbs.entity.BBSSectionInfo;
 
+import net.sf.ehcache.Element;
+
 public class ActionGetAll extends BaseAction {
 	
 	private static  Logger logger = LoggerFactory.getLogger( ActionGetAll.class );
 	
+	@SuppressWarnings("unchecked")
 	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
+		ActionResult<List<Wo>> result = new ActionResult<>();
+		Boolean check = true;
+		
+		if( check ){
+			String cacheKey = "forum#all";
+			Element element = cache.get( cacheKey );
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<List<Wo>> result_cache = (ActionResult<List<Wo>>) element.getObjectValue();
+				result.setData( result_cache.getData() );
+				result.setCount( 1L);
+			} else {
+				//继续进行数据查询
+				result = getForumAllQueryResult( request, effectivePerson );
+				cache.put(new Element(cacheKey, result ));
+			}
+		}
+		return result;
+	}
+
+	private ActionResult<List<Wo>> getForumAllQueryResult(HttpServletRequest request, EffectivePerson effectivePerson) {
 		ActionResult<List<Wo>> result = new ActionResult<>();
 		List<Wo> wraps = new ArrayList<>();
 		List<BBSForumInfo> forumInfoList = null;
@@ -62,6 +85,7 @@ public class ActionGetAll extends BaseAction {
 			}
 		}
 		result.setData( wraps );
+		result.setCount( Long.parseLong( wraps.size() + "") );
 		return result;
 	}
 

+ 2 - 3
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionGetAllWithPermission.java

@@ -33,7 +33,6 @@ public class ActionGetAllWithPermission extends BaseAction {
 		Boolean check = true;
 		Boolean isBBSManager = false;
 		
-		
 		if ( check ) {
 			isBBSManager = ThisApplication.isBBSManager(effectivePerson);
 		}
@@ -48,7 +47,7 @@ public class ActionGetAllWithPermission extends BaseAction {
 				result.setCount( result_cache.getCount() );
 			} else {
 				//继续进行数据查询;
-				result = getForumQueryResult( request, effectivePerson, isBBSManager );
+				result = getForumWithPermissionQueryResult( request, effectivePerson, isBBSManager );
 				cache.put(new Element(cacheKey, result ));
 			}
 		}		
@@ -56,7 +55,7 @@ public class ActionGetAllWithPermission extends BaseAction {
 	}
 
 	@SuppressWarnings("unchecked")
-	private ActionResult<List<Wo>> getForumQueryResult(HttpServletRequest request, EffectivePerson effectivePerson, Boolean isBBSManager) {
+	private ActionResult<List<Wo>> getForumWithPermissionQueryResult(HttpServletRequest request, EffectivePerson effectivePerson, Boolean isBBSManager) {
 		ActionResult<List<Wo>> result = new ActionResult<>();
 		List<Wo> wraps = new ArrayList<>();
 		Boolean check = true;

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/foruminfo/ActionSave.java

@@ -159,9 +159,11 @@ public class ActionSave extends BaseAction {
 				}
 				forumInfo = forumInfoServiceAdv.save( forumInfo );
 				wo.setId(forumInfo.getId());
+				
 				ApplicationCache.notify( BBSForumInfo.class );
 				ApplicationCache.notify( BBSSectionInfo.class );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionForumInfoProcess(e, "系统在保存BBS论坛分区信息时发生异常.");

+ 8 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionDelete.java

@@ -2,6 +2,7 @@ package com.x.bbs.assemble.control.jaxrs.replyinfo;
 
 import javax.servlet.http.HttpServletRequest;
 
+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;
@@ -11,6 +12,8 @@ import com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyIdEmpt
 import com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyInfoProcess;
 import com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyNotExists;
 import com.x.bbs.entity.BBSReplyInfo;
+import com.x.bbs.entity.BBSSectionInfo;
+import com.x.bbs.entity.BBSSubjectInfo;
 
 public class ActionDelete extends BaseAction {
 
@@ -54,8 +57,11 @@ public class ActionDelete extends BaseAction {
 			wo.setId( id );
 			result.setData( wo );
 			
-			operationRecordService.replyOperation(effectivePerson.getDistinguishedName(), replyInfo, "DELETE", hostIp,
-					hostName);
+			ApplicationCache.notify( BBSSubjectInfo.class );
+			ApplicationCache.notify( BBSReplyInfo.class );
+			ApplicationCache.notify( BBSSectionInfo.class );
+			
+			operationRecordService.replyOperation(effectivePerson.getDistinguishedName(), replyInfo, "DELETE", hostIp, hostName);
 		} catch (Exception e) {
 			check = false;
 			Exception exception = new ExceptionReplyInfoProcess(e, "根据指定ID删除回复信息时发生异常.ID:" + id);

+ 33 - 17
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithSubjectForPage.java

@@ -19,16 +19,15 @@ import com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionPageEmpty;
 import com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyInfoProcess;
 import com.x.bbs.entity.BBSReplyInfo;
 
+import net.sf.ehcache.Element;
+
 public class ActionListWithSubjectForPage extends BaseAction {
 	
 	private static  Logger logger = LoggerFactory.getLogger( ActionListWithSubjectForPage.class );
 	
+	@SuppressWarnings("unchecked")
 	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, Integer page, Integer count, JsonElement jsonElement ) throws Exception {
 		ActionResult<List<Wo>> result = new ActionResult<>();
-		List<Wo> wraps = new ArrayList<>();
-		List<BBSReplyInfo> replyInfoList = null;
-		List<BBSReplyInfo> replyInfoList_out = new ArrayList<BBSReplyInfo>();
-		Long total = 0L;
 		Wi wrapIn = null;
 		Boolean check = true;
 		
@@ -41,6 +40,30 @@ public class ActionListWithSubjectForPage extends BaseAction {
 			logger.error( e, effectivePerson, request, null);
 		}
 		
+		if( check ) {
+			String cacheKey = wrapIn.getSubjectId() + "#" + page + "#" + count;
+			Element element = cache.get( cacheKey );
+			
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<List<Wo>> result_cache = (ActionResult<List<Wo>>) element.getObjectValue();
+				result.setData( result_cache.getData() );
+				result.setCount( result_cache.getCount() );
+			} else {
+				result = getReplyQueryResult(wrapIn, request, effectivePerson, page, count);
+				cache.put(new Element(cacheKey, result ));
+			}
+		}
+		return result;
+	}
+
+	public ActionResult<List<Wo>> getReplyQueryResult( Wi wrapIn, HttpServletRequest request, EffectivePerson effectivePerson, Integer page, Integer count ) {
+		ActionResult<List<Wo>> result = new ActionResult<>();
+		List<Wo> wraps = new ArrayList<>();
+		List<BBSReplyInfo> replyInfoList = null;
+		List<BBSReplyInfo> replyInfoList_out = new ArrayList<BBSReplyInfo>();
+		Long total = 0L;
+		Boolean check = true;
+		
 		if( check ){
 			if( page == null ){
 				check = false;
@@ -118,29 +141,22 @@ public class ActionListWithSubjectForPage extends BaseAction {
 		result.setCount( total );
 		return result;
 	}
-
+	
 	public static class Wi{
-
-		private String subjectId = null;
-		
+		private String subjectId = null;		
 		public static List<String> Excludes = new ArrayList<String>( JpaObject.FieldsUnmodify );
-
 		public String getSubjectId() {
 			return subjectId;
 		}
-
 		public void setSubjectId(String subjectId) {
 			this.subjectId = subjectId;
 		}
 	}
 	
-	public static class Wo extends BBSReplyInfo{
-		
-		private static final long serialVersionUID = -5076990764713538973L;
-		
-		public static List<String> Excludes = new ArrayList<String>();
-		
-		public static WrapCopier< BBSReplyInfo, Wo > copier = WrapCopierFactory.wo( BBSReplyInfo.class, Wo.class, null, JpaObject.FieldsInvisible);
+	public static class Wo extends BBSReplyInfo{		
+		private static final long serialVersionUID = -5076990764713538973L;		
+		public static List<String> Excludes = new ArrayList<String>();		
+		public static WrapCopier< BBSReplyInfo, Wo > copier = WrapCopierFactory.wo( BBSReplyInfo.class, Wo.class, null, JpaObject.FieldsInvisible);		
 		
 		@FieldDescribe( "创建人姓名" )
 		private String creatorNameShort = "";

+ 11 - 9
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionSave.java

@@ -9,6 +9,7 @@ import com.google.gson.JsonElement;
 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.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;
@@ -164,15 +165,13 @@ public class ActionSave extends BaseAction {
 								"SECTION_REPLY_PUBLISH_" + subjectInfo.getMainSectionId());
 						if (!hasPermission) {
 							check = false;
-							Exception exception = new ExceptionSectionInsufficientPermissions(
-									sectionInfo.getSectionName(), "SECTION_REPLY_PUBLISH");
+							Exception exception = new ExceptionSectionInsufficientPermissions( sectionInfo.getSectionName(), "SECTION_REPLY_PUBLISH");
 							result.error(exception);
 						}
 					} catch (Exception e) {
 						check = false;
 						Exception exception = new ExceptionSectionPermissionsCheck(e,
-								effectivePerson.getDistinguishedName(), sectionInfo.getSectionName(),
-								"SECTION_REPLY_PUBLISH");
+								effectivePerson.getDistinguishedName(), sectionInfo.getSectionName(), "SECTION_REPLY_PUBLISH");
 						result.error(exception);
 						logger.error(e, effectivePerson, request, null);
 					}
@@ -210,8 +209,7 @@ public class ActionSave extends BaseAction {
 					}
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ExceptionForumPermissionsCheck(e, effectivePerson.getDistinguishedName(),
-							subjectInfo.getForumName(), "FORUM_REPLY_PUBLISH");
+					Exception exception = new ExceptionForumPermissionsCheck(e, effectivePerson.getDistinguishedName(), subjectInfo.getForumName(), "FORUM_REPLY_PUBLISH");
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
@@ -260,9 +258,13 @@ public class ActionSave extends BaseAction {
 				Wo wo = new Wo();
 				wo.setId(replyInfo.getId());
 				result.setData(wo);
-
-				operationRecordService.replyOperation(effectivePerson.getDistinguishedName(), replyInfo, "CREATE",
-						hostIp, hostName);
+				
+				ApplicationCache.notify( BBSReplyInfo.class );
+				ApplicationCache.notify( BBSForumInfo.class );
+				ApplicationCache.notify( BBSSectionInfo.class );
+				ApplicationCache.notify( BBSSubjectInfo.class );
+				
+				operationRecordService.replyOperation(effectivePerson.getDistinguishedName(), replyInfo, "CREATE", hostIp, hostName);
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionReplyInfoProcess(e, "系统在保存回复信息时发生异常。");

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/BaseAction.java

@@ -11,13 +11,13 @@ import com.x.bbs.assemble.control.service.BBSSectionInfoServiceAdv;
 import com.x.bbs.assemble.control.service.BBSSubjectInfoService;
 import com.x.bbs.assemble.control.service.UserManagerService;
 import com.x.bbs.assemble.control.service.UserPermissionService;
+import com.x.bbs.entity.BBSSubjectInfo;
 
 import net.sf.ehcache.Ehcache;
 
 public class BaseAction extends StandardJaxrsAction{
-	
+	protected Ehcache cache = ApplicationCache.instance().getCache( BBSSubjectInfo.class);
 	protected UserPermissionService UserPermissionService = new UserPermissionService();
-	protected Ehcache cache = ApplicationCache.instance().getCache( BaseAction.class);
 	protected BBSReplyInfoService replyInfoService = new BBSReplyInfoService();
 	protected BBSSubjectInfoService subjectInfoService = new BBSSubjectInfoService();
 	protected BBSSectionInfoServiceAdv sectionInfoServiceAdv = new BBSSectionInfoServiceAdv();

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionDelete.java

@@ -123,9 +123,11 @@ public class ActionDelete extends BaseAction {
 				// 已经没有子版块和任何贴子信息了,所以只需要删除相应的权限信息即可
 				sectionInfoServiceAdv.delete( id );
 				wo.setId( id );
+				
 				ApplicationCache.notify( BBSForumInfo.class );
 				ApplicationCache.notify( BBSSectionInfo.class );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 				operationRecordService.sectionOperation(effectivePerson.getDistinguishedName(), sectionInfo, "DELETE", hostIp, hostName);
 			} catch (Exception e) {
 				check = false;

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionDeleteForce.java

@@ -83,9 +83,11 @@ public class ActionDeleteForce extends BaseAction {
 			try {
 				sectionInfoServiceAdv.deleteForce(id);
 				wo.setId( id );
+				
 				ApplicationCache.notify( BBSForumInfo.class );
 				ApplicationCache.notify( BBSSectionInfo.class );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 				operationRecordService.sectionOperation(effectivePerson.getDistinguishedName(), sectionInfo, "DELETE", hostIp, hostName);
 			} catch (Exception e) {
 				check = false;

+ 27 - 3
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionGet.java

@@ -17,14 +17,15 @@ import com.x.bbs.assemble.control.jaxrs.sectioninfo.exception.ExceptionSectionIn
 import com.x.bbs.assemble.control.jaxrs.sectioninfo.exception.ExceptionSectionNotExists;
 import com.x.bbs.entity.BBSSectionInfo;
 
+import net.sf.ehcache.Element;
+
 public class ActionGet extends BaseAction {
 	
 	private static  Logger logger = LoggerFactory.getLogger( ActionGet.class );
 	
+	@SuppressWarnings("unchecked")
 	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
-		Wo wrap = null;
-		BBSSectionInfo sectionInfo = null;
 		Boolean check = true;
 		
 		if( check ){
@@ -34,6 +35,29 @@ public class ActionGet extends BaseAction {
 				result.error( exception );
 			}
 		}
+		
+		if( check ){
+			String cacheKey = "section#" + id;
+			Element element = cache.get( cacheKey );
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<Wo> result_cache = (ActionResult<Wo>) element.getObjectValue();
+				result.setData( result_cache.getData() );
+				result.setCount( 1L);
+			} else {
+				//继续进行数据查询
+				result = getSectionQueryResult( id, request, effectivePerson );
+				cache.put(new Element(cacheKey, result ));
+			}
+		}
+		return result;
+	}
+
+	private ActionResult<Wo> getSectionQueryResult(String id, HttpServletRequest request, EffectivePerson effectivePerson) {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wrap = null;
+		BBSSectionInfo sectionInfo = null;
+		Boolean check = true;
+		
 		if( check ){
 			try {
 				sectionInfo = sectionInfoServiceAdv.get( id );
@@ -62,7 +86,7 @@ public class ActionGet extends BaseAction {
 		}
 		return result;
 	}
-
+	
 	public static class Wo extends BBSSectionInfo{
 		
 		private static final long serialVersionUID = -5076990764713538973L;

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/sectioninfo/ActionSave.java

@@ -227,13 +227,13 @@ public class ActionSave extends BaseAction {
 				if( sectionInfo.getUpdateTime() == null ) {
 					sectionInfo.setUpdateTime( sectionInfo.getCreateTime() );
 				}
-				sectionInfo = sectionInfoServiceAdv.save( sectionInfo );
-				
+				sectionInfo = sectionInfoServiceAdv.save( sectionInfo );				
 				wo.setId( sectionInfo.getId() );
 				
 				ApplicationCache.notify( BBSForumInfo.class );
 				ApplicationCache.notify( BBSSectionInfo.class );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 				if ( sectionInfo.getCreateTime().compareTo( sectionInfo.getUpdateTime() ) == 0 ) {
 					operationRecordService.sectionOperation(effectivePerson.getDistinguishedName(), sectionInfo, "CREATE", hostIp, hostName);
 				} else {

+ 5 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectDelete.java

@@ -12,6 +12,8 @@ import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectId
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectInfoProcess;
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectNotExists;
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectQueryById;
+import com.x.bbs.entity.BBSForumInfo;
+import com.x.bbs.entity.BBSSectionInfo;
 import com.x.bbs.entity.BBSSubjectInfo;
 
 public class ActionSubjectDelete extends BaseAction {
@@ -55,10 +57,11 @@ public class ActionSubjectDelete extends BaseAction {
 			wo.setId( id );
 			
 			ApplicationCache.notify( BBSSubjectInfo.class );
+			ApplicationCache.notify( BBSSectionInfo.class );
+			ApplicationCache.notify( BBSForumInfo.class );
 			
 			// 记录操作日志
-			operationRecordService.subjectOperation(effectivePerson.getDistinguishedName(), subjectInfo, "DELETE",
-					hostIp, hostName);
+			operationRecordService.subjectOperation(effectivePerson.getDistinguishedName(), subjectInfo, "DELETE", hostIp, hostName);
 		} catch (Exception e) {
 			check = false;
 			Exception exception = new ExceptionSubjectInfoProcess(e, "根据指定ID删除主题信息时发生异常.ID:" + id);

+ 157 - 132
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectGet.java

@@ -24,11 +24,45 @@ import com.x.bbs.entity.BBSSubjectInfo;
 import com.x.bbs.entity.BBSVoteOption;
 import com.x.bbs.entity.BBSVoteOptionGroup;
 
+import net.sf.ehcache.Element;
+
 public class ActionSubjectGet extends BaseAction {
-	
-	private static  Logger logger = LoggerFactory.getLogger( ActionSubjectGet.class );
-	
-	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionSubjectGet.class);
+
+	@SuppressWarnings("unchecked")
+	protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id)
+			throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Boolean check = true;
+
+		if (check) {
+			if (id == null || id.isEmpty()) {
+				check = false;
+				Exception exception = new ExceptionSubjectIdEmpty();
+				result.error(exception);
+			}
+		}
+
+		if (check) {
+			String cacheKey = "subject#get#" + id;
+			Element element = cache.get(cacheKey);
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<Wo> result_cache = (ActionResult<Wo>) element.getObjectValue();
+				result.setData(result_cache.getData());
+				result.setCount(1L);
+			} else {
+				// 继续进行数据查询
+				result = getSubjectGetQueryResult(id, request, effectivePerson);
+				cache.put(new Element(cacheKey, result));
+			}
+		}
+
+		return result;
+	}
+
+	private ActionResult<Wo> getSubjectGetQueryResult(String id, HttpServletRequest request,
+			EffectivePerson effectivePerson) {
 		ActionResult<Wo> result = new ActionResult<>();
 		List<WoSubjectAttachment> wrapSubjectAttachmentList = null;
 		List<BBSSubjectAttachment> subjectAttachmentList = null;
@@ -41,184 +75,175 @@ public class ActionSubjectGet extends BaseAction {
 		String subjectContent = null;
 		Boolean check = true;
 		
-		if( check ){
-			if( id == null || id.isEmpty() ){
-				check = false;
-				Exception exception = new ExceptionSubjectIdEmpty();
-				result.error( exception );
-			}
-		}
-		
-		//查询版块信息是否存在
+		// 查询版块信息是否存在
 		if (check) {
 			try {
-				subjectInfo = subjectInfoServiceAdv.get( id );
+				subjectInfo = subjectInfoServiceAdv.get(id);
 			} catch (Exception e) {
 				check = false;
-				Exception exception = new ExceptionSubjectQueryById( e, id );
-				result.error( exception );
-				logger.error( e, effectivePerson, request, null);
+				Exception exception = new ExceptionSubjectQueryById(e, id);
+				result.error(exception);
+				logger.error(e, effectivePerson, request, null);
 			}
 		}
 
 		if (check) {
-			if ( subjectInfo == null ) {
+			if (subjectInfo == null) {
 				check = false;
-				Exception exception = new ExceptionSubjectNotExists( id );
-				result.error( exception );
-				//logger.error( e, effectivePerson, request, null);
-			}else{//查到了主题信息
+				Exception exception = new ExceptionSubjectNotExists(id);
+				result.error(exception);
+				// logger.error( e, effectivePerson, request, null);
+			} else {// 查到了主题信息
 				try {
-					wrap = Wo.copier.copy( subjectInfo );
-					//根据附件ID列表查询附件信息
-					if( subjectInfo.getAttachmentList() != null && subjectInfo.getAttachmentList().size() > 0 ){
-						subjectAttachmentList = subjectInfoServiceAdv.listAttachmentByIds( subjectInfo.getAttachmentList() );
-						if( subjectAttachmentList != null && subjectAttachmentList.size() > 0 ){
-							wrapSubjectAttachmentList = WoSubjectAttachment.copier.copy( subjectAttachmentList );
-							wrap.setSubjectAttachmentList( wrapSubjectAttachmentList );
+					wrap = Wo.copier.copy(subjectInfo);
+					// 根据附件ID列表查询附件信息
+					if (subjectInfo.getAttachmentList() != null && subjectInfo.getAttachmentList().size() > 0) {
+						subjectAttachmentList = subjectInfoServiceAdv
+								.listAttachmentByIds(subjectInfo.getAttachmentList());
+						if (subjectAttachmentList != null && subjectAttachmentList.size() > 0) {
+							wrapSubjectAttachmentList = WoSubjectAttachment.copier.copy(subjectAttachmentList);
+							wrap.setSubjectAttachmentList(wrapSubjectAttachmentList);
 						}
 					}
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ExceptionSubjectWrapOut( e );
-					result.error( exception );
-					logger.error( e, effectivePerson, request, null);
+					Exception exception = new ExceptionSubjectWrapOut(e);
+					result.error(exception);
+					logger.error(e, effectivePerson, request, null);
 				}
-			}			
+			}
 		}
 		if (check) {
-			if( wrap != null ){
-				//填充主题的内容信息
+			if (wrap != null) {
+				// 填充主题的内容信息
 				try {
-					subjectContent = subjectInfoServiceAdv.getSubjectContent( id );
-					if( subjectContent != null ){
-						wrap.setContent( subjectContent );
+					subjectContent = subjectInfoServiceAdv.getSubjectContent(id);
+					if (subjectContent != null) {
+						wrap.setContent(subjectContent);
 					}
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ExceptionSubjectContentQueryById( e, id );
-					result.error( exception );
-					logger.error( e, effectivePerson, request, null);
+					Exception exception = new ExceptionSubjectContentQueryById(e, id);
+					result.error(exception);
+					logger.error(e, effectivePerson, request, null);
 				}
 			}
 		}
-		
+
 		if (check) {
-			if( wrap != null ){//获取该主题的投票选项组
+			if (wrap != null) {// 获取该主题的投票选项组
 				try {
-					voteOptionGroupList = subjectVoteService.listVoteOptionGroup( id );
-					if( voteOptionGroupList != null && !voteOptionGroupList.isEmpty() ){
-						wrapOutSubjectVoteOptionGroupList = WoBBSVoteOptionGroup.copier.copy( voteOptionGroupList );
-						for( WoBBSVoteOptionGroup group : wrapOutSubjectVoteOptionGroupList ){
-							voteOptionList = subjectVoteService.listVoteOptionByGroupId( group.getId() );
-							if( voteOptionList != null  && !voteOptionList.isEmpty() ){
+					voteOptionGroupList = subjectVoteService.listVoteOptionGroup(id);
+					if (voteOptionGroupList != null && !voteOptionGroupList.isEmpty()) {
+						wrapOutSubjectVoteOptionGroupList = WoBBSVoteOptionGroup.copier.copy(voteOptionGroupList);
+						for (WoBBSVoteOptionGroup group : wrapOutSubjectVoteOptionGroupList) {
+							voteOptionList = subjectVoteService.listVoteOptionByGroupId(group.getId());
+							if (voteOptionList != null && !voteOptionList.isEmpty()) {
 								try {
-									wrapOutSubjectVoteOptionList = WoBBSVoteOption.copier.copy( voteOptionList );
-									group.setVoteOptions( wrapOutSubjectVoteOptionList );
+									wrapOutSubjectVoteOptionList = WoBBSVoteOption.copier.copy(voteOptionList);
+									group.setVoteOptions(wrapOutSubjectVoteOptionList);
 								} catch (Exception e) {
 									check = false;
-									Exception exception = new ExceptionSubjectWrapOut( e );
-									result.error( exception );
-									logger.error( e, effectivePerson, request, null);
+									Exception exception = new ExceptionSubjectWrapOut(e);
+									result.error(exception);
+									logger.error(e, effectivePerson, request, null);
 								}
 							}
 						}
-						wrap.setVoteOptionGroupList( wrapOutSubjectVoteOptionGroupList );
+						wrap.setVoteOptionGroupList(wrapOutSubjectVoteOptionGroupList);
 					}
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ExceptionVoteOptionListById( e, id );
-					result.error( exception );
-					logger.error( e, effectivePerson, request, null);
+					Exception exception = new ExceptionVoteOptionListById(e, id);
+					result.error(exception);
+					logger.error(e, effectivePerson, request, null);
 				}
 			}
 		}
-		
+
 		if (check) {
-			//将带@形式的人员标识修改为人员的姓名并且赋值到xxShort属性里
-			if( wrap != null ){
-				cutPersonNames( wrap );
+			// 将带@形式的人员标识修改为人员的姓名并且赋值到xxShort属性里
+			if (wrap != null) {
+				cutPersonNames(wrap);
 			}
 		}
-		result.setData( wrap );
+		result.setData(wrap);
 		return result;
 	}
 
 	/**
-	 *  将带@形式的人员标识修改为人员的姓名并且赋值到xxShort属性里
-	 *  
-	 *  latestReplyUserShort = "";
-		bBSIndexSetterNameShort = "";
-		screamSetterNameShort = "";
-		originalSetterNameShort = "";
-		creatorNameShort = "";
-		auditorNameShort = "";
-		
+	 * 将带@形式的人员标识修改为人员的姓名并且赋值到xxShort属性里
+	 * 
+	 * latestReplyUserShort = ""; bBSIndexSetterNameShort = "";
+	 * screamSetterNameShort = ""; originalSetterNameShort = ""; creatorNameShort =
+	 * ""; auditorNameShort = "";
+	 * 
 	 * @param subject
 	 */
-	private void cutPersonNames( Wo subject ) {
-		if( subject != null ) {
-			if( subject.getLatestReplyUser() != null && !subject.getLatestReplyUser().isEmpty() ) {
-				subject.setLatestReplyUserShort( subject.getLatestReplyUser().split( "@" )[0]);
+	private void cutPersonNames(Wo subject) {
+		if (subject != null) {
+			if (subject.getLatestReplyUser() != null && !subject.getLatestReplyUser().isEmpty()) {
+				subject.setLatestReplyUserShort(subject.getLatestReplyUser().split("@")[0]);
 			}
-			if( subject.getbBSIndexSetterName() != null && !subject.getbBSIndexSetterName().isEmpty() ) {
-				subject.setbBSIndexSetterNameShort( subject.getbBSIndexSetterName().split( "@" )[0]);
+			if (subject.getbBSIndexSetterName() != null && !subject.getbBSIndexSetterName().isEmpty()) {
+				subject.setbBSIndexSetterNameShort(subject.getbBSIndexSetterName().split("@")[0]);
 			}
-			if( subject.getScreamSetterName() != null && !subject.getScreamSetterName().isEmpty() ) {
-				subject.setScreamSetterNameShort( subject.getScreamSetterName().split( "@" )[0]);
+			if (subject.getScreamSetterName() != null && !subject.getScreamSetterName().isEmpty()) {
+				subject.setScreamSetterNameShort(subject.getScreamSetterName().split("@")[0]);
 			}
-			if( subject.getOriginalSetterName() != null && !subject.getOriginalSetterName().isEmpty() ) {
-				subject.setOriginalSetterNameShort( subject.getOriginalSetterName().split( "@" )[0]);
+			if (subject.getOriginalSetterName() != null && !subject.getOriginalSetterName().isEmpty()) {
+				subject.setOriginalSetterNameShort(subject.getOriginalSetterName().split("@")[0]);
 			}
-			if( subject.getCreatorName() != null && !subject.getCreatorName().isEmpty() ) {
-				subject.setCreatorNameShort( subject.getCreatorName().split( "@" )[0]);
+			if (subject.getCreatorName() != null && !subject.getCreatorName().isEmpty()) {
+				subject.setCreatorNameShort(subject.getCreatorName().split("@")[0]);
 			}
-			if( subject.getAuditorName() != null && !subject.getAuditorName().isEmpty() ) {
-				subject.setAuditorNameShort( subject.getAuditorName().split( "@" )[0]);
+			if (subject.getAuditorName() != null && !subject.getAuditorName().isEmpty()) {
+				subject.setAuditorNameShort(subject.getAuditorName().split("@")[0]);
 			}
 		}
 	}
-	
-	public static class Wo extends BBSSubjectInfo{
-		
+
+	public static class Wo extends BBSSubjectInfo {
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
+
 		public static List<String> Excludes = new ArrayList<String>();
-		
-		public static WrapCopier< BBSSubjectInfo, Wo > copier = WrapCopierFactory.wo( BBSSubjectInfo.class, Wo.class, null, JpaObject.FieldsInvisible);
-		
+
+		public static WrapCopier<BBSSubjectInfo, Wo> copier = WrapCopierFactory.wo(BBSSubjectInfo.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
+
 		private List<WoSubjectAttachment> subjectAttachmentList;
-		
-		@FieldDescribe( "投票主题的所有投票选项列表." )
+
+		@FieldDescribe("投票主题的所有投票选项列表.")
 		private List<WoBBSVoteOptionGroup> voteOptionGroupList;
-		
+
 		private String content = null;
-		
+
 		private Long voteCount = 0L;
-		
+
 		private String pictureBase64 = null;
-		
-		@FieldDescribe( "最新回复用户" )
+
+		@FieldDescribe("最新回复用户")
 		private String latestReplyUserShort = "";
-		
-		@FieldDescribe( "首页推荐人姓名" )
+
+		@FieldDescribe("首页推荐人姓名")
 		private String bBSIndexSetterNameShort = "";
-		
-		@FieldDescribe( "精华设置人姓名" )
+
+		@FieldDescribe("精华设置人姓名")
 		private String screamSetterNameShort = "";
-		
-		@FieldDescribe( "原创设置人姓名" )
+
+		@FieldDescribe("原创设置人姓名")
 		private String originalSetterNameShort = "";
-		
-		@FieldDescribe( "创建人姓名" )
+
+		@FieldDescribe("创建人姓名")
 		private String creatorNameShort = "";
-		
-		@FieldDescribe( "审核人姓名" )
+
+		@FieldDescribe("审核人姓名")
 		private String auditorNameShort = "";
-		
-		@FieldDescribe( "当前用户是否已经投票过." )
+
+		@FieldDescribe("当前用户是否已经投票过.")
 		private Boolean voted = false;
-		
+
 		public String getLatestReplyUserShort() {
 			return latestReplyUserShort;
 		}
@@ -315,22 +340,22 @@ public class ActionSubjectGet extends BaseAction {
 			this.voteCount = voteCount;
 		}
 	}
-	
-	public static class WoSubjectAttachment extends BBSSubjectAttachment{
-		
+
+	public static class WoSubjectAttachment extends BBSSubjectAttachment {
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
-		
-		public static WrapCopier< BBSSubjectAttachment, WoSubjectAttachment > copier = WrapCopierFactory.wo( BBSSubjectAttachment.class, WoSubjectAttachment.class, null, JpaObject.FieldsInvisible);
+
+		public static WrapCopier<BBSSubjectAttachment, WoSubjectAttachment> copier = WrapCopierFactory
+				.wo(BBSSubjectAttachment.class, WoSubjectAttachment.class, null, JpaObject.FieldsInvisible);
 	}
-	
-	public static class WoBBSVoteOptionGroup extends BBSVoteOptionGroup{
-		
+
+	public static class WoBBSVoteOptionGroup extends BBSVoteOptionGroup {
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
-		
-		public static WrapCopier< BBSVoteOptionGroup, WoBBSVoteOptionGroup > copier = WrapCopierFactory.wo( BBSVoteOptionGroup.class, WoBBSVoteOptionGroup.class, null, JpaObject.FieldsInvisible);
-		
+
+		public static WrapCopier<BBSVoteOptionGroup, WoBBSVoteOptionGroup> copier = WrapCopierFactory
+				.wo(BBSVoteOptionGroup.class, WoBBSVoteOptionGroup.class, null, JpaObject.FieldsInvisible);
+
 		private List<WoBBSVoteOption> voteOptions = null;
 
 		public List<WoBBSVoteOption> getVoteOptions() {
@@ -342,13 +367,13 @@ public class ActionSubjectGet extends BaseAction {
 		}
 	}
 
-	public static class WoBBSVoteOption extends BBSVoteOption{
-		
+	public static class WoBBSVoteOption extends BBSVoteOption {
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
-		
-		public static WrapCopier< BBSVoteOption, WoBBSVoteOption > copier = WrapCopierFactory.wo( BBSVoteOption.class, WoBBSVoteOption.class, null,JpaObject.FieldsInvisible);
-		
+
+		public static WrapCopier<BBSVoteOption, WoBBSVoteOption> copier = WrapCopierFactory.wo(BBSVoteOption.class,
+				WoBBSVoteOption.class, null, JpaObject.FieldsInvisible);
+
 		private Boolean voted = false;
 
 		public Boolean getVoted() {

+ 3 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectLock.java

@@ -2,6 +2,7 @@ package com.x.bbs.assemble.control.jaxrs.subjectinfo;
 
 import javax.servlet.http.HttpServletRequest;
 
+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;
@@ -54,6 +55,8 @@ public class ActionSubjectLock extends BaseAction {
 				wo.setId( id );
 				result.setData( wo );
 				
+				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation(e, "用户在锁定主题信息时发生异常!");

+ 4 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSave.java

@@ -21,6 +21,7 @@ import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectSa
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectWrapIn;
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionVoteOptionEmpty;
 import com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionWrapInConvert;
+import com.x.bbs.entity.BBSForumInfo;
 import com.x.bbs.entity.BBSSectionInfo;
 import com.x.bbs.entity.BBSSubjectInfo;
 
@@ -143,6 +144,9 @@ public class ActionSubjectSave extends BaseAction {
 				wo.setId(subjectInfo.getId());
 				
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				ApplicationCache.notify( BBSSectionInfo.class );
+				ApplicationCache.notify( BBSForumInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectSave(e);

+ 1 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSetCream.java

@@ -61,6 +61,7 @@ public class ActionSubjectSetCream extends BaseAction {
 				wo.setId( id );
 				result.setData( wo );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation(e, "用户在设置精华主题信息时发生异常!");

+ 1 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSetOriginal.java

@@ -60,6 +60,7 @@ public class ActionSubjectSetOriginal extends BaseAction {
 				wo.setId( id );
 				result.setData( wo );
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation(e, "用户在设置原创主题信息时发生异常!");

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSubmitVoteResult.java

@@ -86,7 +86,9 @@ public class ActionSubjectSubmitVoteResult extends BaseAction {
 			if ("投票".equals(subjectInfo.getTypeCategory())) {
 				try {
 					subjectVoteService.submitVoteResult(effectivePerson, subjectInfo, wrapIn.getOptionGroups());
+					
 					ApplicationCache.notify( BBSSubjectInfo.class );
+					
 				} catch (Exception e) {
 					check = false;
 					Exception exception = new ExceptionSubjectOperation(e, "系统在保存投票选项信息时发生异常");

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnAcceptReply.java

@@ -53,7 +53,9 @@ public class ActionSubjectUnAcceptReply extends BaseAction {
 				Wo wo = new Wo();
 				wo.setId( id );
 				result.setData( wo );
+				
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation( e, "用户在取消确认主题回帖信息时发生异常!" );

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnComplete.java

@@ -53,7 +53,9 @@ public class ActionSubjectUnComplete extends BaseAction {
 				Wo wo = new Wo();
 				wo.setId( id );
 				result.setData( wo );
+				
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation( e, "用户在取消主题完成时发生异常!" );

+ 2 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectUnLock.java

@@ -53,7 +53,9 @@ public class ActionSubjectUnLock extends BaseAction {
 				Wo wo = new Wo();
 				wo.setId( id );
 				result.setData( wo );
+				
 				ApplicationCache.notify( BBSSubjectInfo.class );
+				
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectOperation( e, "用户在取消锁定主题信息时发生异常!" );

+ 51 - 8
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectView.java

@@ -26,11 +26,53 @@ import com.x.bbs.entity.BBSSubjectInfo;
 import com.x.bbs.entity.BBSVoteOption;
 import com.x.bbs.entity.BBSVoteOptionGroup;
 
+import net.sf.ehcache.Element;
+
 public class ActionSubjectView extends BaseAction {
 	
 	private static Logger logger = LoggerFactory.getLogger( ActionSubjectView.class );
 	
+	@SuppressWarnings("unchecked")
 	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Boolean check = true;
+		if( check ){
+			if( id == null || id.isEmpty() ){
+				check = false;
+				Exception exception = new ExceptionSubjectIdEmpty();
+				result.error( exception );
+			}
+		}
+		
+		if( check ){
+			String cacheKey = "subject#view#" + id;
+			Element element = cache.get( cacheKey );
+			if ((null != element) && (null != element.getObjectValue())) {
+				ActionResult<Wo> result_cache = (ActionResult<Wo>) element.getObjectValue();
+				result.setData( result_cache.getData() );
+				result.setCount( 1L);
+			} else {
+				//继续进行数据查询
+				result = getSubjectViewQueryResult( id, request, effectivePerson );
+				cache.put(new Element(cacheKey, result ));
+			}
+		}
+		
+		if( check ){
+			try {
+				// 查看次数+1
+				subjectInfoServiceAdv.addViewCount( id );
+			}catch(Exception e) {
+				check = false;
+				Exception exception = new ExceptionSubjectView( e, id );
+				result.error( exception );
+				logger.error( e, effectivePerson, request, null);
+			}
+		}
+		return result;
+	}
+
+	private ActionResult<Wo> getSubjectViewQueryResult(String id, HttpServletRequest request, EffectivePerson effectivePerson) {
 		ActionResult<Wo> result = new ActionResult<>();
 		List<WoSubjectAttachment> wrapSubjectAttachmentList = null;
 		List<BBSSubjectAttachment> subjectAttachmentList = null;
@@ -45,16 +87,10 @@ public class ActionSubjectView extends BaseAction {
 		List<WoBBSVoteOption> wrapOutSubjectVoteOptionList = null;
 		String subjectContent = null;
 		Boolean check = true;
-		if( check ){
-			if( id == null || id.isEmpty() ){
-				check = false;
-				Exception exception = new ExceptionSubjectIdEmpty();
-				result.error( exception );
-			}
-		}
+		
 		if (check) {//查询版块信息是否存在
 			try {
-				subjectInfo = subjectInfoServiceAdv.view( id );
+				subjectInfo = subjectInfoServiceAdv.get( id );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionSubjectView( e, id );
@@ -71,6 +107,7 @@ public class ActionSubjectView extends BaseAction {
 			}else{//查到了主题信息
 				try {
 					currentSubject = WoBBSSubjectInfo.copier.copy( subjectInfo );
+					
 					//根据附件ID列表查询附件信息
 					if( currentSubject.getAttachmentList() != null && currentSubject.getAttachmentList().size() > 0 ){
 						subjectAttachmentList = subjectInfoServiceAdv.listAttachmentByIds( currentSubject.getAttachmentList() );
@@ -88,6 +125,7 @@ public class ActionSubjectView extends BaseAction {
 				}
 			}			
 		}
+		
 		if (check) {
 			if( wrapOutNearSubjectInfo.getCurrentSubject() != null ){
 				currentSubject = wrapOutNearSubjectInfo.getCurrentSubject();
@@ -105,6 +143,7 @@ public class ActionSubjectView extends BaseAction {
 				}
 			}
 		}
+		
 		//开始查询上一个主题的信息
 		if (check) {
 			try {
@@ -124,6 +163,7 @@ public class ActionSubjectView extends BaseAction {
 				wrapOutNearSubjectInfo.setLastSubject( lastSubject );
 			}
 		}
+		
 		//开始查询下一个主题的信息
 		if (check) {
 			try {
@@ -143,6 +183,7 @@ public class ActionSubjectView extends BaseAction {
 				wrapOutNearSubjectInfo.setNextSubject( nextSubject );
 			}
 		}
+		
 		if (check) {
 			if( currentSubject != null ){//获取该主题的投票选项
 				try {
@@ -155,6 +196,7 @@ public class ActionSubjectView extends BaseAction {
 				}
 			}
 		}
+		
 		if (check) {
 			if( currentSubject != null ){//获取该主题的投票选项组
 				try {
@@ -208,6 +250,7 @@ public class ActionSubjectView extends BaseAction {
 				}
 			}
 		}
+		
 		//将带@形式的人员标识修改为人员的姓名并且赋值到xxShort属性里
 		cutPersonNames( wrapOutNearSubjectInfo.getCurrentSubject() );
 		

+ 21 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java

@@ -95,6 +95,27 @@ public class BBSSubjectInfoService {
 		return subjectInfo;
 	}
 	
+	/**
+	 * 根据传入的ID从数据库查询BBSSubjectInfo对象
+	 * @param id
+	 * @return
+	 * @throws Exception
+	 */
+	public void addViewCount( EntityManagerContainer emc, String id ) throws Exception {
+		if( id  == null || id.isEmpty() ){
+			throw new Exception( "id is null, return null!" );
+		}
+		BBSSubjectInfo subjectInfo = null;
+		subjectInfo = emc.find( id, BBSSubjectInfo.class );
+		if( subjectInfo != null ){
+			emc.beginTransaction( BBSSubjectInfo.class );
+			subjectInfo.setViewTotal( subjectInfo.getViewTotal() + 1 );
+			subjectInfo.setHot( subjectInfo.getHot() + 1 );
+			emc.check( subjectInfo, CheckPersistType.all );
+			emc.commit();
+		}
+	}
+	
 	
 	/**
 	 * 向数据库保存BBSSubjectInfo对象

+ 17 - 0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoServiceAdv.java

@@ -71,6 +71,23 @@ public class BBSSubjectInfoServiceAdv {
 		}
 	}
 	
+	/**
+	 * 根据传入的ID从数据库查询BBSSubjectInfo对象
+	 * @param id
+	 * @return
+	 * @throws Exception
+	 */
+	public void addViewCount( String id ) throws Exception {
+		if( id  == null || id.isEmpty() ){
+			throw new Exception( "id is null, return null!" );
+		}
+		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
+			subjectInfoService.addViewCount( emc, id );
+		}catch( Exception e ){
+			throw e;
+		}
+	}
+	
 	/**
 	 * 向数据库保存BBSSubjectInfo对象
 	 * @param wrapIn

+ 0 - 1
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSForumInfo.java

@@ -21,7 +21,6 @@ import org.apache.openjpa.persistence.jdbc.ElementColumn;
 import org.apache.openjpa.persistence.jdbc.ElementIndex;
 import org.apache.openjpa.persistence.jdbc.Index;
 
-import com.x.base.core.entity.AbstractPersistenceProperties;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.entity.SliceJpaObject;
 import com.x.base.core.entity.annotation.CheckPersist;

+ 1 - 1
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java

@@ -23,7 +23,7 @@ public class ThisApplication {
 	public static void init() throws Exception {
 		try {
 			MessageConnector.start(context());
-			context.schedule(AlarmTrigger.class, "0 * * * * ?");
+			context.schedule(AlarmTrigger.class, "0/30 * * * * ?");
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

+ 1 - 1
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/schedule/AlarmTrigger.java

@@ -62,7 +62,7 @@ public class AlarmTrigger implements Job {
 					calendar_Event = calendar_EventServiceAdv.get(id);
 					if (calendar_Event != null) {
 						MessageFactory.send_alarm(emc, calendar_Event);
-						logger.info("send message:{}.", calendar_Event);
+						logger.info("send message:{}.", calendar_Event.getTitle());
 					}
 				}
 			} catch (Exception e) {

+ 4 - 4
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java

@@ -630,13 +630,13 @@ public class DocumentFactory<T> extends AbstractFactory {
 		p = CriteriaBuilderTools.predicate_and(cb, p, permissionWhere );	
 		
 		if( maxResultCount == null || maxResultCount == 0 ){
-			maxResultCount = 10000;
+			maxResultCount = 500;
 		}
 		
 		if( publishDateList != null && !publishDateList.isEmpty() ){
-			cq.orderBy( cb.asc( root.get( Document_.publishTime )) );
+			cq.orderBy( cb.desc( root.get( Document_.publishTime )) );
 		}else {
-			cq.orderBy( cb.asc( root.get( Document_.createTime )) );
+			cq.orderBy( cb.desc( root.get( Document_.createTime )) );
 		}
 
 		//LogUtil.INFO( ">>>>SQL:", em.createQuery( cq.where( p ) ).setMaxResults( maxResultCount ).toString() );
@@ -685,7 +685,7 @@ public class DocumentFactory<T> extends AbstractFactory {
 
 	public List<String> listInReviewIds(Integer maxCount) throws Exception {
 		if( maxCount == null ){
-			maxCount = 1000;
+			maxCount = 500;
 		}
 		EntityManager em = this.entityManagerContainer().get( Document.class );
 		CriteriaBuilder cb = em.getCriteriaBuilder();

+ 1 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionListNextWithFilter.java

@@ -77,7 +77,7 @@ public class ActionListNextWithFilter extends BaseAction {
 			try {
 				queryCategoryIds = listAllViewAbleCategoryIds( 
 						wi.getAppIdList(),  wi.getAppAliasList(), wi.getCategoryIdList(), wi.getCategoryAliasList(), wi.getDocumentType(), 
-						personName, isAnonymous, manager, 1000
+						personName, isAnonymous, manager, 500
 				);
 				if ( queryCategoryIds == null) {
 					queryCategoryIds = new ArrayList<>();

+ 151 - 152
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java

@@ -30,19 +30,11 @@ public class ActionView extends BaseAction {
 
 	private static  Logger logger = LoggerFactory.getLogger(ActionView.class);
 
+	@SuppressWarnings("unchecked")
 	protected ActionResult<Wo> execute(HttpServletRequest request, String id, EffectivePerson effectivePerson) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		Wo wo = new Wo();
-		WoDocument woOutDocument = null;
-		AppInfo appInfo = null;
-		CategoryInfo categoryInfo = null;
-		Document document = null;
-		List<FileInfo> attachmentList = null;
-		Boolean isAppAdmin = false;
-		Boolean isCategoryAdmin = false;
 		Boolean isManager = false;
-		Boolean isEditor = false;
-		Boolean isCreator = false;
 		Boolean check = true;
 		Boolean isAnonymous = effectivePerson.isAnonymous();
 		String personName = effectivePerson.getDistinguishedName();
@@ -70,176 +62,194 @@ public class ActionView extends BaseAction {
 		Element element = cache.get(cacheKey);
 
 		if ((null != element) && (null != element.getObjectValue())) {
-			wo = (Wo) element.getObjectValue();
-			document = woOutDocument = wo.getDocument();
-			result.setData(wo);
+			result = (ActionResult<Wo>) element.getObjectValue();
 		} else {
-			if (check) {
+			//继续进行数据查询
+			result = getDocumentQueryResult( id, request, effectivePerson, isManager );
+			cache.put(new Element(cacheKey, result ));
+		}
+		
+		if (check ) {
+			//只要不是管理员访问,则记录该文档的访问记录
+			if ( !"xadmin".equalsIgnoreCase( personName) ) {
 				try {
-					document = documentInfoServiceAdv.view( id, effectivePerson );
-					if ( document == null ) {
-						check = false;
-						Exception exception = new ExceptionDocumentNotExists(id);
-						result.error(exception);
-					} else {
-						try {
-							woOutDocument = WoDocument.copier.copy( document );
-						} catch (Exception e) {
-							check = false;
-							Exception exception = new ExceptionDocumentInfoProcess(e, "将查询出来的文档信息对象转换为可输出的数据信息时发生异常。");
-							result.error(exception);
-							logger.error(e, effectivePerson, request, null);
-						}
-					}
+					documentViewRecordServiceAdv.addViewRecord( id, personName );
 				} catch (Exception e) {
-					check = false;
-					Exception exception = new ExceptionDocumentInfoProcess(e, "文档信息访问操作时发生异常。Id:" + id + ", Name:" + personName);
-					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
-			if (check) {
-				if( isAnonymous ) {
-					//检查这个文档所在的栏目和分类是否都是全员可见
-					if( ( ListTools.isNotEmpty( document.getReadPersonList() ) && !document.getReadPersonList().contains( "所有人" ) )
-							|| ListTools.isNotEmpty( document.getReadUnitList() )
-							|| ListTools.isNotEmpty( document.getReadGroupList() )
-							) {
+		}
+		return result;			
+	}
+
+	private ActionResult<Wo> getDocumentQueryResult( String id, HttpServletRequest request, EffectivePerson effectivePerson, Boolean isManager ) {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wo = new Wo();
+		WoDocument woOutDocument = null;
+		AppInfo appInfo = null;
+		CategoryInfo categoryInfo = null;
+		Document document = null;
+		List<FileInfo> attachmentList = null;
+		Boolean isAppAdmin = false;
+		Boolean isCategoryAdmin = false;
+		Boolean isEditor = false;
+		Boolean isCreator = false;
+		Boolean check = true;
+		Boolean isAnonymous = effectivePerson.isAnonymous();
+		String personName = effectivePerson.getDistinguishedName();
+		
+		if (check) {
+			try {
+				document = documentInfoServiceAdv.view( id, effectivePerson );
+				if ( document == null ) {
+					check = false;
+					Exception exception = new ExceptionDocumentNotExists(id);
+					result.error(exception);
+				} else {
+					try {
+						woOutDocument = WoDocument.copier.copy( document );
+					} catch (Exception e) {
 						check = false;
-						Exception exception = new ExceptionDocumentInfoProcess(
-								"该文档不允许匿名访问。ID:" + id );
+						Exception exception = new ExceptionDocumentInfoProcess(e, "将查询出来的文档信息对象转换为可输出的数据信息时发生异常。");
 						result.error(exception);
+						logger.error(e, effectivePerson, request, null);
 					}
 				}
+			} catch (Exception e) {
+				check = false;
+				Exception exception = new ExceptionDocumentInfoProcess(e, "文档信息访问操作时发生异常。Id:" + id + ", Name:" + personName);
+				result.error(exception);
+				logger.error(e, effectivePerson, request, null);
 			}
-			
-			if (check) {
-				try {
-					appInfo = appInfoServiceAdv.get( document.getAppId() );
-					if( appInfo == null ) {
-						check = false;
-						Exception exception = new ExceptionAppInfoNotExists( document.getAppId()  );
-						result.error(exception);
-					}					
-					if( isAnonymous ) {
-						//检查这个文档所在的栏目和分类是否都是全员可见
-						if( !appInfo.getAllPeopleView() ) {
-							//栏目不可见
-							check = false;
-							Exception exception = new ExceptionDocumentInfoProcess(
-									"栏目["+appInfo.getAppName()+"]不允许匿名访问。ID:" + document.getAppId());
-							result.error(exception);
-						}
-					}
-				} catch (Exception e) {
+		}
+		
+		if (check) {
+			if( isAnonymous ) {
+				//检查这个文档所在的栏目和分类是否都是全员可见
+				if( ( ListTools.isNotEmpty( document.getReadPersonList() ) && !document.getReadPersonList().contains( "所有人" ) )
+						|| ListTools.isNotEmpty( document.getReadUnitList() )
+						|| ListTools.isNotEmpty( document.getReadGroupList() )
+						) {
 					check = false;
-					Exception exception = new ExceptionDocumentInfoProcess(e,
-							"根据ID查询栏目信息对象时发生异常。ID:" + document.getAppId());
+					Exception exception = new ExceptionDocumentInfoProcess( "该文档不允许匿名访问。ID:" + id );
 					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			if (check) {
-				try {
-					categoryInfo = categoryInfoServiceAdv.get(document.getCategoryId());
-					if( categoryInfo == null ) {
-						check = false;
-						Exception exception = new ExceptionCategoryInfoNotExists( document.getCategoryId() );
-						result.error(exception);
-					}					
-					if( isAnonymous ) {
-						//检查这个文档所在的栏目和分类是否都是全员可见
-						if( !categoryInfo.getAllPeopleView() ) {
-							//分类不可见
-							check = false;
-							Exception exception = new ExceptionDocumentInfoProcess(
-									"分类["+categoryInfo.getCategoryName()+"]不允许匿名访问。ID:" + document.getCategoryId());
-							result.error(exception);
-						}
-					}
-				} catch (Exception e) {
+		}
+		
+		if (check) {
+			try {
+				appInfo = appInfoServiceAdv.get( document.getAppId() );
+				if( appInfo == null ) {
 					check = false;
-					Exception exception = new ExceptionDocumentInfoProcess(e,
-							"根据ID查询分类信息对象时发生异常。ID:" + document.getCategoryId());
+					Exception exception = new ExceptionAppInfoNotExists( document.getAppId()  );
 					result.error(exception);
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-			if (check) {
-				if ( woOutDocument != null && categoryInfo != null ) {
-					try {
-						woOutDocument.setForm(categoryInfo.getFormId());
-						woOutDocument.setFormName(categoryInfo.getFormName());
-						woOutDocument.setReadFormId(categoryInfo.getReadFormId());
-						woOutDocument.setReadFormName(categoryInfo.getReadFormName());
-						woOutDocument.setCategoryName(categoryInfo.getCategoryName());
-						woOutDocument.setCategoryAlias(categoryInfo.getCategoryAlias());
-						
-						if( woOutDocument.getCreatorPerson() != null && !woOutDocument.getCreatorPerson().isEmpty() ) {
-							woOutDocument.setCreatorPersonShort( woOutDocument.getCreatorPerson().split( "@" )[0]);
-						}
-						if( woOutDocument.getCreatorUnitName() != null && !woOutDocument.getCreatorUnitName().isEmpty() ) {
-							woOutDocument.setCreatorUnitNameShort( woOutDocument.getCreatorUnitName().split( "@" )[0]);
-						}
-						if( woOutDocument.getCreatorTopUnitName() != null && !woOutDocument.getCreatorTopUnitName().isEmpty() ) {
-							woOutDocument.setCreatorTopUnitNameShort( woOutDocument.getCreatorTopUnitName().split( "@" )[0]);
-						}
-						
-						wo.setDocument(woOutDocument);
-					} catch (Exception e) {
+				}					
+				if( isAnonymous ) {
+					//检查这个文档所在的栏目和分类是否都是全员可见
+					if( !appInfo.getAllPeopleView() ) {
+						//栏目不可见
 						check = false;
-						Exception exception = new ExceptionDocumentInfoProcess(e,
-								"根据ID查询分类信息对象时发生异常。ID:" + document.getCategoryId());
+						Exception exception = new ExceptionDocumentInfoProcess( "栏目["+appInfo.getAppName()+"]不允许匿名访问。ID:" + document.getAppId());
 						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
 					}
 				}
+			} catch (Exception e) {
+				check = false;
+				Exception exception = new ExceptionDocumentInfoProcess(e, "根据ID查询栏目信息对象时发生异常。ID:" + document.getAppId());
+				result.error(exception);
+				logger.error(e, effectivePerson, request, null);
 			}
-
-			if (check) {
-				if (woOutDocument != null) {
-					try {						
-						wo.setData( documentInfoServiceAdv.getDocumentData( document ) );
-					} catch (Exception e) {
+		}
+		if (check) {
+			try {
+				categoryInfo = categoryInfoServiceAdv.get(document.getCategoryId());
+				if( categoryInfo == null ) {
+					check = false;
+					Exception exception = new ExceptionCategoryInfoNotExists( document.getCategoryId() );
+					result.error(exception);
+				}					
+				if( isAnonymous ) {
+					//检查这个文档所在的栏目和分类是否都是全员可见
+					if( !categoryInfo.getAllPeopleView() ) {
+						//分类不可见
 						check = false;
-						Exception exception = new ExceptionDocumentInfoProcess(e,
-								"系统获取文档数据内容信息时发生异常。Id:" + document.getCategoryId());
+						Exception exception = new ExceptionDocumentInfoProcess( "分类["+categoryInfo.getCategoryName()+"]不允许匿名访问。ID:" + document.getCategoryId());
 						result.error(exception);
-						logger.error(e, effectivePerson, request, null);
 					}
 				}
+			} catch (Exception e) {
+				check = false;
+				Exception exception = new ExceptionDocumentInfoProcess(e, "根据ID查询分类信息对象时发生异常。ID:" + document.getCategoryId());
+				result.error(exception);
+				logger.error(e, effectivePerson, request, null);
 			}
-
-			if (check) {
+		}
+		if (check) {
+			if ( woOutDocument != null && categoryInfo != null ) {
 				try {
-					attachmentList = fileInfoServiceAdv.getAttachmentList(document.getId());
-					if (attachmentList != null && !attachmentList.isEmpty()) {
-						wo.setAttachmentList( WoFileInfo.copier.copy(attachmentList));
+					woOutDocument.setForm(categoryInfo.getFormId());
+					woOutDocument.setFormName(categoryInfo.getFormName());
+					woOutDocument.setReadFormId(categoryInfo.getReadFormId());
+					woOutDocument.setReadFormName(categoryInfo.getReadFormName());
+					woOutDocument.setCategoryName(categoryInfo.getCategoryName());
+					woOutDocument.setCategoryAlias(categoryInfo.getCategoryAlias());
+					
+					if( woOutDocument.getCreatorPerson() != null && !woOutDocument.getCreatorPerson().isEmpty() ) {
+						woOutDocument.setCreatorPersonShort( woOutDocument.getCreatorPerson().split( "@" )[0]);
 					}
+					if( woOutDocument.getCreatorUnitName() != null && !woOutDocument.getCreatorUnitName().isEmpty() ) {
+						woOutDocument.setCreatorUnitNameShort( woOutDocument.getCreatorUnitName().split( "@" )[0]);
+					}
+					if( woOutDocument.getCreatorTopUnitName() != null && !woOutDocument.getCreatorTopUnitName().isEmpty() ) {
+						woOutDocument.setCreatorTopUnitNameShort( woOutDocument.getCreatorTopUnitName().split( "@" )[0]);
+					}
+					wo.setDocument(woOutDocument);
 				} catch (Exception e) {
 					check = false;
-					Exception exception = new ExceptionDocumentInfoProcess(e,
-							"系统获取文档附件内容列表时发生异常。Id:" + document.getCategoryId());
+					Exception exception = new ExceptionDocumentInfoProcess(e, "根据ID查询分类信息对象时发生异常。ID:" + document.getCategoryId());
 					result.error(exception);
 					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
-			if (check) {
-				if( wo.getDocument() != null &&
-						wo.getDocument().getCreatorPerson() != null &&
-						wo.getDocument().getCreatorPerson().equals( personName )) {
-						isCreator = true;
-						wo.setIsCreator( isCreator );
+		}
+
+		if (check) {
+			if (woOutDocument != null) {
+				try {						
+					wo.setData( documentInfoServiceAdv.getDocumentData( document ) );
+				} catch (Exception e) {
+					check = false;
+					Exception exception = new ExceptionDocumentInfoProcess(e, "系统获取文档数据内容信息时发生异常。Id:" + document.getCategoryId());
+					result.error(exception);
+					logger.error(e, effectivePerson, request, null);
 				}
 			}
-			
-			if (check) {
-				cache.put( new Element(cacheKey, wo) );
+		}
+
+		if (check) {
+			try {
+				attachmentList = fileInfoServiceAdv.getAttachmentList(document.getId());
+				if (attachmentList != null && !attachmentList.isEmpty()) {
+					wo.setAttachmentList( WoFileInfo.copier.copy(attachmentList));
+				}
+			} catch (Exception e) {
+				check = false;
+				Exception exception = new ExceptionDocumentInfoProcess(e, "系统获取文档附件内容列表时发生异常。Id:" + document.getCategoryId());
+				result.error(exception);
+				logger.error(e, effectivePerson, request, null);
 			}
 		}
 		
+		if (check) {
+			if( wo.getDocument() != null &&
+					wo.getDocument().getCreatorPerson() != null &&
+					wo.getDocument().getCreatorPerson().equals( personName )) {
+					isCreator = true;
+					wo.setIsCreator( isCreator );
+			}
+		}
+	
 		if (check) {
 			try {
 				if ( categoryInfoServiceAdv.isCategoryInfoManager(woOutDocument.getCategoryId(), personName)) {
@@ -252,6 +262,7 @@ public class ActionView extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
+		
 		if (check) {
 			try {
 				if (appInfoServiceAdv.isAppInfoManager(woOutDocument.getAppId(), personName)) {
@@ -271,7 +282,6 @@ public class ActionView extends BaseAction {
 			} else {
 				// 判断当前登录者是不是该文档的可编辑者
 				try {
-					
 					List<String> unitNames = null;
 					List<String> groupNames = null;
 					if( !isAnonymous ) {
@@ -301,23 +311,12 @@ public class ActionView extends BaseAction {
 				}
 			}
 		}
-		
+	
 		wo.setIsManager( isManager );
 		wo.setIsAppAdmin( isAppAdmin );
 		wo.setIsCategoryAdmin( isCategoryAdmin );
 		wo.setIsEditor( isEditor );
 		
-		if (check) {
-			// 记录该文档的访问记录
-			if ( !"xadmin".equalsIgnoreCase( personName) ) {
-				try {
-					documentViewRecordServiceAdv.addViewRecord(id, personName);
-				} catch (Exception e) {
-					logger.error(e, effectivePerson, request, null);
-				}
-			}
-		}
-		
 		result.setData(wo);
 		return result;
 	}

+ 3 - 3
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/ActionFileDownloadStream.java

@@ -11,7 +11,7 @@ import com.x.cms.core.entity.FileInfo;
 
 public class ActionFileDownloadStream extends BaseAction {
 	
-	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id, Boolean stream ) throws Exception {
+	protected ActionResult<Wo> execute( HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 		FileInfo attachment = fileInfoServiceAdv.get(id);
 		
@@ -20,8 +20,8 @@ public class ActionFileDownloadStream extends BaseAction {
 		}else {
 			StorageMapping mapping = ThisApplication.context().storageMappings().get(FileInfo.class, attachment.getStorage());
 			Wo wo = new Wo(attachment.readContent(mapping), 
-					this.contentType(stream, attachment.getName()), 
-					this.contentDisposition(stream, attachment.getName()));
+					this.contentType( true, attachment.getName()), 
+					this.contentDisposition( true, attachment.getName()));
 			result.setData(wo);
 		}
 		return result;

+ 3 - 4
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/FileInfoAction.java

@@ -153,16 +153,15 @@ public class FileInfoAction extends StandardJaxrsAction{
 
 	@JaxrsMethodDescribe(value = "根据附件ID下载附件,设定是否使用stream输出", action = ActionFileDownloadStream.class)
 	@GET
-	@Path("download/document/{id}/stream/{stream}")
+	@Path("download/document/{id}/stream")
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void attachmentDownloadStream(@Suspended final AsyncResponse asyncResponse, 
 			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id, 
-			@JaxrsParameterDescribe("用.APPLICATION_OCTET_STREAM头输出") @PathParam("stream") Boolean stream) {
+			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id) {
 		ActionResult<ActionFileDownloadStream.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionFileDownloadStream().execute(request, effectivePerson, id, stream);
+			result = new ActionFileDownloadStream().execute(request, effectivePerson, id );
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);

+ 3 - 4
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/fileinfo/FileInfoAnonymousAction.java

@@ -90,16 +90,15 @@ public class FileInfoAnonymousAction extends StandardJaxrsAction{
 
 	@JaxrsMethodDescribe(value = "根据附件ID下载附件,设定是否使用stream输出", action = ActionFileDownloadStream.class)
 	@GET
-	@Path("download/document/{id}/stream/{stream}")
+	@Path("download/document/{id}/stream")
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void attachmentDownloadStream(@Suspended final AsyncResponse asyncResponse, 
 			@Context HttpServletRequest request, 
-			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id, 
-			@JaxrsParameterDescribe("用.APPLICATION_OCTET_STREAM头输出") @PathParam("stream") Boolean stream) {
+			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id ) {
 		ActionResult<ActionFileDownloadStream.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionFileDownloadStream().execute(request, effectivePerson, id, stream);
+			result = new ActionFileDownloadStream().execute(request, effectivePerson, id );
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);

+ 1 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/view/ActionListNextPageViewData.java

@@ -200,7 +200,7 @@ public class ActionListNextPageViewData extends BaseAction {
 						unitNames,
 						groupNames,
 						isManager,
-						viewableCatagories, wi.getDocumentType(), 5000);
+						viewableCatagories, wi.getDocumentType(), 500);
 				if( viewAbleDocIds == null ){
 					viewAbleDocIds = new ArrayList<>();
 				}

+ 3 - 3
o2server/x_collaboration_service_message/src/main/java/x/collaboration/service/message/ThisApplication.java

@@ -12,7 +12,7 @@ public class ThisApplication {
 		return context;
 	}
 
-    public static SmsQueue smsQueue;
+	public static SmsQueue smsQueue;
 
 	public static WsQueue wsQueue;
 
@@ -21,10 +21,10 @@ public class ThisApplication {
 	public static void init() {
 		try {
 			LoggerFactory.setLevel(Config.logLevel().x_collaboration_service_message());
-            smsQueue = new SmsQueue(context());
+			smsQueue = new SmsQueue(context());
 			wsQueue = new WsQueue(context());
 			pushMessageQueue = new PushMessageQueue(context());
-            context().startQueue(smsQueue);
+			context().startQueue(smsQueue);
 			context().startQueue(wsQueue);
 			context().startQueue(pushMessageQueue);
 		} catch (Exception e) {

+ 20 - 3
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/Business.java

@@ -2,7 +2,9 @@ package com.x.component.assemble.control;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.organization.OrganizationDefinition;
 import com.x.component.assemble.control.factory.ComponentFactory;
+import com.x.organization.core.express.Organization;
 
 public class Business {
 
@@ -25,10 +27,25 @@ public class Business {
 		return component;
 	}
 
-	public boolean componentEditAvailable(EffectivePerson effectivePerson) throws Exception {
+	private Organization organization;
+
+	public Organization organization() throws Exception {
+		if (null == this.organization) {
+			this.organization = new Organization(ThisApplication.context());
+		}
+		return organization;
+	}
+
+	public boolean editable(EffectivePerson effectivePerson) throws Exception {
+		boolean result = false;
 		if (effectivePerson.isManager()) {
-			return true;
+			result = true;
+		}
+		if (!result) {
+			if (this.organization().person().hasRole(effectivePerson, OrganizationDefinition.Manager)) {
+				result = true;
+			}
 		}
-		return false;
+		return result;
 	}
 }

+ 4 - 4
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionBase.java

@@ -22,14 +22,15 @@ class ActionBase extends StandardJaxrsAction {
 	static final String COMPONENT_HOTARTICLE = "HotArticle";
 	static final String COMPONENT_EXEMANAGER = "ExeManager";
 	static final String COMPONENT_ONLINEMEETING = "OnlineMeeting";
-	static final String COMPONENT_STRATEGY = "Strategy";
-	static final String COMPONENT_REPORT = "Report";
+	static final String COMPONENT_ANN = "ANN";
+//	static final String COMPONENT_STRATEGY = "Strategy";
+//	static final String COMPONENT_REPORT = "Report";
 	static final String COMPONENT_MINDER = "Minder";
 	static final String COMPONENT_CALENDAR = "Calendar";
 
 	List<String> DEFAULT_COMPONENT_LIST = ListTools.toList(COMPONENT_FILE, COMPONENT_NOTE, COMPONENT_MEETING,
 			COMPONENT_EXECUTION, COMPONENT_ATTENDANCE, COMPONENT_FORUM, COMPONENT_HOTARTICLE, COMPONENT_EXEMANAGER,
-			COMPONENT_ONLINEMEETING, COMPONENT_STRATEGY, COMPONENT_REPORT, COMPONENT_MINDER, COMPONENT_CALENDAR);
+			COMPONENT_ONLINEMEETING, COMPONENT_MINDER, COMPONENT_CALENDAR, COMPONENT_ANN);
 
 	// {
 	// "name": "File",
@@ -124,5 +125,4 @@ class ActionBase extends StandardJaxrsAction {
 	// "visible": true
 	// }
 
- 
 }

+ 6 - 0
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionCreate.java

@@ -8,15 +8,21 @@ import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
 import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WrapBoolean;
+import com.x.component.assemble.control.Business;
 import com.x.component.core.entity.Component;
 
 class ActionCreate extends ActionBase {
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			if (!business.editable(effectivePerson)) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
 			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 			Component component = Wi.copier.copy(wi);
 			emc.beginTransaction(Component.class);

+ 9 - 3
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionDelete.java

@@ -4,19 +4,25 @@ import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.annotation.CheckRemoveType;
 import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
 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.WrapBoolean;
+import com.x.component.assemble.control.Business;
 import com.x.component.core.entity.Component;
 
 class ActionDelete extends ActionBase {
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
-			Component component = emc.find(id, Component.class);
+			Business business = new Business(emc);
+			if (!business.editable(effectivePerson)) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
+			Component component = emc.flag(flag, Component.class);
 			if (null == component) {
-				throw new ExceptionEntityNotExist(id, Component.class);
+				throw new ExceptionEntityNotExist(flag, Component.class);
 			}
 			emc.beginTransaction(Component.class);
 			emc.remove(component, CheckRemoveType.all);

+ 44 - 0
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionDeleteAll.java

@@ -0,0 +1,44 @@
+package com.x.component.assemble.control.jaxrs.component;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.annotation.CheckRemoveType;
+import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WrapBoolean;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.component.assemble.control.Business;
+import com.x.component.core.entity.Component;
+
+class ActionDeleteAll extends ActionBase {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionDeleteAll.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			if (!business.editable(effectivePerson)) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
+			emc.beginTransaction(Component.class);
+			for (Component o : emc.listAll(Component.class)) {
+				emc.remove(o, CheckRemoveType.all);
+			}
+			emc.commit();
+			Wo wo = new Wo();
+			wo.setValue(true);
+			result.setData(wo);
+			ApplicationCache.notify(Component.class);
+			return result;
+		}
+	}
+
+	public static class Wo extends WrapBoolean {
+
+	}
+
+}

+ 9 - 3
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionEdit.java

@@ -8,21 +8,27 @@ import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
 import com.x.base.core.project.cache.ApplicationCache;
+import com.x.base.core.project.exception.ExceptionAccessDenied;
 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.WrapBoolean;
+import com.x.component.assemble.control.Business;
 import com.x.component.core.entity.Component;
 
 class ActionEdit extends ActionBase {
 
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, JsonElement jsonElement) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			if (!business.editable(effectivePerson)) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
 			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
-			Component component = emc.find(id, Component.class);
+			Component component = emc.flag(flag, Component.class);
 			if (null == component) {
-				throw new ExceptionEntityNotExist(id, Component.class);
+				throw new ExceptionEntityNotExist(flag, Component.class);
 			}
 			Wi.copier.copy(wi, component);
 			emc.beginTransaction(Component.class);

+ 3 - 3
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionGet.java

@@ -12,12 +12,12 @@ import com.x.component.core.entity.Component;
 
 class ActionGet extends ActionBase {
 
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
-			Component component = emc.find(id, Component.class);
+			Component component = emc.flag(flag, Component.class);
 			if (null == component) {
-				throw new ExceptionEntityNotExist(id, Component.class);
+				throw new ExceptionEntityNotExist(flag, Component.class);
 			}
 			Wo wo = Wo.copier.copy(component);
 			result.setData(wo);

+ 21 - 14
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ActionListAll.java

@@ -130,20 +130,20 @@ class ActionListAll extends ActionBase {
 			o.setIconPath("appicon.png");
 			o.setVisible(true);
 			break;
-		case COMPONENT_STRATEGY:
-			o.setName(COMPONENT_STRATEGY);
-			o.setPath(COMPONENT_STRATEGY);
-			o.setTitle("战略管理");
-			o.setIconPath("appicon.png");
-			o.setVisible(true);
-			break;
-		case COMPONENT_REPORT:
-			o.setName(COMPONENT_REPORT);
-			o.setPath(COMPONENT_REPORT);
-			o.setTitle("工作报告");
-			o.setIconPath("appicon.png");
-			o.setVisible(true);
-			break;
+//		case COMPONENT_STRATEGY:
+//			o.setName(COMPONENT_STRATEGY);
+//			o.setPath(COMPONENT_STRATEGY);
+//			o.setTitle("战略管理");
+//			o.setIconPath("appicon.png");
+//			o.setVisible(true);
+//			break;
+//		case COMPONENT_REPORT:
+//			o.setName(COMPONENT_REPORT);
+//			o.setPath(COMPONENT_REPORT);
+//			o.setTitle("工作报告");
+//			o.setIconPath("appicon.png");
+//			o.setVisible(true);
+//			break;
 		case COMPONENT_MINDER:
 			o.setName(COMPONENT_MINDER);
 			o.setPath(COMPONENT_MINDER);
@@ -158,6 +158,13 @@ class ActionListAll extends ActionBase {
 			o.setIconPath("appicon.png");
 			o.setVisible(true);
 			break;
+		case COMPONENT_ANN:
+			o.setName(COMPONENT_ANN);
+			o.setPath(COMPONENT_ANN);
+			o.setTitle("神经网络");
+			o.setIconPath("appicon.png");
+			o.setVisible(true);
+			break;
 		default:
 			break;
 		}

+ 26 - 9
o2server/x_component_assemble_control/src/main/java/com/x/component/assemble/control/jaxrs/component/ComponentAction.java

@@ -52,15 +52,15 @@ public class ComponentAction extends StandardJaxrsAction {
 
 	@JaxrsMethodDescribe(value = "获取Component对象.", action = ActionGet.class)
 	@GET
-	@Path("{id}")
+	@Path("{flag}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@PathParam("id") String id) {
+			@PathParam("flag") String flag) {
 		ActionResult<ActionGet.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionGet().execute(effectivePerson, id);
+			result = new ActionGet().execute(effectivePerson, flag);
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
@@ -87,15 +87,15 @@ public class ComponentAction extends StandardJaxrsAction {
 
 	@JaxrsMethodDescribe(value = "更新Component对象.", action = ActionEdit.class)
 	@PUT
-	@Path("{id}")
+	@Path("{flag}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void edit(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@PathParam("id") String id, JsonElement jsonElement) {
+			@PathParam("flag") String flag, JsonElement jsonElement) {
 		ActionResult<ActionEdit.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionEdit().execute(effectivePerson, id, jsonElement);
+			result = new ActionEdit().execute(effectivePerson, flag, jsonElement);
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, jsonElement);
 			result.error(e);
@@ -105,15 +105,32 @@ public class ComponentAction extends StandardJaxrsAction {
 
 	@JaxrsMethodDescribe(value = "删除Component对象.", action = ActionDelete.class)
 	@DELETE
-	@Path("{id}")
+	@Path("{flag}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@PathParam("id") String id) {
+			@PathParam("flag") String flag) {
 		ActionResult<ActionDelete.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionDelete().execute(effectivePerson, id);
+			result = new ActionDelete().execute(effectivePerson, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
+	@JaxrsMethodDescribe(value = "删除所有Component,还原默认布局.", action = ActionDeleteAll.class)
+	@DELETE
+	@Path("delete/all")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void deleteAll(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
+		ActionResult<ActionDeleteAll.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionDeleteAll().execute(effectivePerson);
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);

+ 0 - 4
o2server/x_console/pom.xml

@@ -20,10 +20,6 @@
 			<groupId>o2oa</groupId>
 			<artifactId>x_bbs_core_entity</artifactId>
 		</dependency>
-		<dependency>
-			<groupId>o2oa</groupId>
-			<artifactId>x_report_core_entity</artifactId>
-		</dependency>
 		<dependency>
 			<groupId>o2oa</groupId>
 			<artifactId>x_program_center_core_entity</artifactId>

+ 9 - 80
o2server/x_console/src/main/java/com/x/server/console/CommandFactory.java

@@ -37,9 +37,10 @@ public class CommandFactory {
 
 	public static final Pattern exit_pattern = Pattern.compile("^ {0,}exit {0,}$", Pattern.CASE_INSENSITIVE);
 
-	public static final Pattern update_pattern = Pattern.compile("^ {0,}update (.+)$", Pattern.CASE_INSENSITIVE);
+	public static final Pattern update_pattern = Pattern.compile("^ {0,}update (true|false) (true|false) (.+)$",
+			Pattern.CASE_INSENSITIVE);
 
-	public static final Pattern fastUpdate_pattern = Pattern.compile("^ {0,}fast update (.+)$",
+	public static final Pattern updateFile_pattern = Pattern.compile("^ {0,}update file (.+) (true|false) (.+)$",
 			Pattern.CASE_INSENSITIVE);
 
 	public static final Pattern version_pattern = Pattern.compile("^ {0,}version {0,}$", Pattern.CASE_INSENSITIVE);
@@ -48,7 +49,7 @@ public class CommandFactory {
 			Pattern.CASE_INSENSITIVE);
 
 	public static final Pattern erase_content_pattern = Pattern
-			.compile("^ {0,}erase content (pp|cms|log|report|bbs) (.+)$", Pattern.CASE_INSENSITIVE);
+			.compile("^ {0,}erase content (cms|pp|bbs|log) (.+)$", Pattern.CASE_INSENSITIVE);
 
 	public static final Pattern compact_data_pattern = Pattern.compile("^ {0,}compact data (.+)$",
 			Pattern.CASE_INSENSITIVE);
@@ -114,18 +115,20 @@ public class CommandFactory {
 			help += StringUtils.LF;
 			help += " setPassword (oldpasswd) (newpasswd)" + "\t\t\t" + "change initial manager password.";
 			help += StringUtils.LF;
-			help += " version " + "\t\t\t\t\t\t" + "show available update version.";
+			help += " update (backup) (latest) (passwd)" + "\t\t\t" + "upgrade to new version.";
 			help += StringUtils.LF;
-			help += " update (passwd)" + "\t\t\t\t\t" + "upgrade to next version.";
+			help += " update file (path) (backup) (passwd)" + "\t\t\t" + "upgrade to new version from local zip file.";
 			help += StringUtils.LF;
 			help += " compact data (passwd)" + "\t\t\t\t\t" + "compact local h2 repository database.";
 			help += StringUtils.LF;
-			help += " erase content (cms|pp|bbs|log|report) (passwd)" + "\t\t" + "remove all data except design.";
+			help += " erase content (cms|pp|bbs|log) (passwd)" + "\t\t" + "remove all data except design.";
 			help += StringUtils.LF;
 			help += " create encrypt key" + "\t\t\t\t\t" + "create random RSA key.";
 			help += StringUtils.LF;
 			help += " show (os|cpu|memory|thread) interval repeat" + "\t\t" + "show operating system infomation.";
 			help += StringUtils.LF;
+			help += " version " + "\t\t\t\t\t\t" + "show available update version.";
+			help += StringUtils.LF;
 			help += " exit" + "\t\t\t\t\t\t\t" + "exit after stop.";
 			help += StringUtils.LF;
 			System.out.println(help);
@@ -134,81 +137,7 @@ public class CommandFactory {
 		}
 	}
 
-//	public static void printHelpTable() {
-//		try {
-//			AsciiTable at = new AsciiTable();
-//			at.addRule();
-//			AT_Row row = at.addRow("command", "description");
-//			row.setTextAlignment(TextAlignment.CENTER);
-//			at.addRule();
-//			row = at.addRow("help", " show useage message");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop [all]", "start stop all enable server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop data", "start stop data server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop storage", "start stop storage server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop center", "start stop center server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop application", "start stop application server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("start|stop web", "start stop web server");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("dump data (passwd)", "dump data from database");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("dump storage (passwd)", "dump storage from database,file");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("restore data yyyyMMddHHmmss (passwd)", "restore data to database");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("restore storage yyyyMMddHHmmss (passwd)", "restore storage to database,file");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("setPassword (oldpasswd) (newpasswd)", "change initial manager password");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("version", "show available update version");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("update (passwd)", "upgrade to next version");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("compact data (passwod)", "compact local h2 repository database");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("erase content (cms|pp|bss|log|report) (passwd)", "remove all data except design");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("create encrypt key", "create random RSA key");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			row = at.addRow("exit", "exit after stop");
-//			row.setPaddingLeft(1);
-//			at.addRule();
-//			at.getRenderer().setCWC(new CWC_FixedWidth().add(48).add(38));
-//			System.out.println(at.render());
-//		} catch (Exception e) {
-//			e.printStackTrace();
-//		}
-//	}
-
 	private static void printStartImage() {
-//		try {
-//			String ascii = FigletFont.convertOneLine(Config.currentNode().getBanner());
-//			System.out.println(ascii);
-//		} catch (Exception e) {
-//			e.printStackTrace();
-//		}
 		try {
 			File file = Config.startImage();
 			BufferedImage image = null;

+ 9 - 20
o2server/x_console/src/main/java/com/x/server/console/Main.java

@@ -43,7 +43,6 @@ import com.x.server.console.action.ActionEraseContentBbs;
 import com.x.server.console.action.ActionEraseContentCms;
 import com.x.server.console.action.ActionEraseContentLog;
 import com.x.server.console.action.ActionEraseContentProcessPlatform;
-import com.x.server.console.action.ActionEraseContentReport;
 import com.x.server.console.action.ActionRestoreData;
 import com.x.server.console.action.ActionRestoreStorage;
 import com.x.server.console.action.ActionSetPassword;
@@ -52,6 +51,7 @@ import com.x.server.console.action.ActionShowMemory;
 import com.x.server.console.action.ActionShowOs;
 import com.x.server.console.action.ActionShowThread;
 import com.x.server.console.action.ActionUpdate;
+import com.x.server.console.action.ActionUpdateFile;
 import com.x.server.console.action.ActionVersion;
 import com.x.server.console.log.LogTools;
 import com.x.server.console.server.Servers;
@@ -275,7 +275,7 @@ public class Main {
 
 					matcher = CommandFactory.update_pattern.matcher(cmd);
 					if (matcher.find()) {
-						if (update(matcher.group(1))) {
+						if (update(matcher.group(1), matcher.group(2), matcher.group(3))) {
 							stopAll();
 							System.exit(0);
 						} else {
@@ -283,9 +283,9 @@ public class Main {
 						}
 					}
 
-					matcher = CommandFactory.fastUpdate_pattern.matcher(cmd);
+					matcher = CommandFactory.updateFile_pattern.matcher(cmd);
 					if (matcher.find()) {
-						if (fastUpdate(matcher.group(1))) {
+						if (updateFile(matcher.group(1), matcher.group(2), matcher.group(3))) {
 							stopAll();
 							System.exit(0);
 						} else {
@@ -315,9 +315,6 @@ public class Main {
 						case "log":
 							eraseContentLog(matcher.group(2));
 							break;
-						case "report":
-							eraseContentReport(matcher.group(2));
-							break;
 						case "bbs":
 							eraseContentBbs(matcher.group(2));
 							break;
@@ -421,18 +418,19 @@ public class Main {
 		return true;
 	}
 
-	private static boolean fastUpdate(String password) {
+	private static boolean update(String password, String backup, String latest) {
 		try {
-			return new ActionUpdate().execute(password, false, true);
+			return new ActionUpdate().execute(password, BooleanUtils.toBoolean(backup),
+					BooleanUtils.toBoolean(latest));
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
 		return true;
 	}
 
-	private static boolean update(String password) {
+	private static boolean updateFile(String path, String backup, String password) {
 		try {
-			return new ActionUpdate().execute(password, true, false);
+			return new ActionUpdateFile().execute(path, BooleanUtils.toBoolean(backup), password);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
@@ -885,13 +883,4 @@ public class Main {
 		return false;
 	}
 
-	private static boolean eraseContentReport(String password) throws Exception {
-		try {
-			return new ActionEraseContentReport().execute(password);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return false;
-	}
-
 }

+ 0 - 58
o2server/x_console/src/main/java/com/x/server/console/action/ActionEraseContentReport.java

@@ -1,58 +0,0 @@
-package com.x.server.console.action;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.x.base.core.project.config.Config;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.report.core.entity.Report_C_WorkPlan;
-import com.x.report.core.entity.Report_C_WorkPlanDetail;
-import com.x.report.core.entity.Report_C_WorkPlanNext;
-import com.x.report.core.entity.Report_C_WorkPlanNextDetail;
-import com.x.report.core.entity.Report_C_WorkProg;
-import com.x.report.core.entity.Report_C_WorkProgDetail;
-import com.x.report.core.entity.Report_I_Base;
-import com.x.report.core.entity.Report_I_Detail;
-import com.x.report.core.entity.Report_I_WorkInfo;
-import com.x.report.core.entity.Report_I_WorkInfoDetail;
-import com.x.report.core.entity.Report_I_WorkTag;
-import com.x.report.core.entity.Report_I_WorkTagUnit;
-import com.x.report.core.entity.Report_P_MeasureInfo;
-import com.x.report.core.entity.Report_P_Permission;
-import com.x.report.core.entity.Report_P_Profile;
-import com.x.report.core.entity.Report_P_ProfileDetail;
-import com.x.report.core.entity.Report_R_CreateTime;
-import com.x.report.core.entity.Report_R_View;
-
-public class ActionEraseContentReport extends ActionEraseContentProcessPlatform {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionEraseContentReport.class);
-
-	public boolean execute(String password) throws Exception {
-		if (!StringUtils.equals(Config.token().getPassword(), password)) {
-			logger.print("password not match.");
-			return false;
-		}
-		this.init("report", null);
-		addClass(Report_C_WorkPlan.class);
-		addClass(Report_C_WorkPlanDetail.class);
-		addClass(Report_C_WorkPlanNext.class);
-		addClass(Report_C_WorkPlanNextDetail.class);
-		addClass(Report_C_WorkProg.class);
-		addClass(Report_C_WorkProgDetail.class);
-		addClass(Report_I_Base.class);
-		addClass(Report_I_Detail.class);
-		addClass(Report_I_WorkInfo.class);
-		addClass(Report_I_WorkInfoDetail.class);
-		addClass(Report_I_WorkTag.class);
-		addClass(Report_I_WorkTagUnit.class);
-		addClass(Report_P_MeasureInfo.class);
-		addClass(Report_P_Permission.class);
-		addClass(Report_P_Profile.class);
-		addClass(Report_P_ProfileDetail.class);
-		addClass(Report_R_CreateTime.class);
-		addClass(Report_R_View.class);
-		this.run();
-		return true;
-	}
-}

+ 13 - 37
o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdate.java

@@ -38,14 +38,14 @@ public class ActionUpdate extends ActionBase {
 
 	private static final String LATEST = "latest";
 
-	public boolean execute(String password, boolean backup, boolean toLatest) {
+	public boolean execute(String password, boolean backup, boolean latest) {
 		try {
 			this.init();
 			if (!StringUtils.equals(Config.token().getPassword(), password)) {
 				logger.print("password not mactch.");
 				return false;
 			}
-			WrapUpdateVersion wrapUpdateVersion = this.get(toLatest);
+			WrapUpdateVersion wrapUpdateVersion = this.get(latest);
 			if (StringUtils.equals(LATEST, wrapUpdateVersion.getVersion())) {
 				logger.print("already the latest version.");
 				return false;
@@ -67,21 +67,24 @@ public class ActionUpdate extends ActionBase {
 	}
 
 	private void backup() throws Exception {
-		File dir = new File(Config.base(), "local/backup");
-		FileUtils.forceMkdir(dir);
+		File dir = Config.dir_local_backup(true);
 		String tag = DateTools.compact(new Date());
 		File dest = new File(dir, tag + ".zip");
 		logger.print("backup current version to {}.", dest.getAbsolutePath());
 		List<File> files = new ArrayList<>();
-		files.add(new File(Config.base(), "commons"));
-		files.add(new File(Config.base(), "config"));
-		files.add(new File(Config.base(), "jvm"));
-		files.add(new File(Config.base(), "servers"));
-		files.add(new File(Config.base(), "store"));
+		files.add(Config.dir_commons());
+		files.add(Config.dir_config());
+		files.add(Config.dir_configSample());
+		files.add(Config.dir_localSample());
+		files.add(Config.dir_jvm());
+		files.add(Config.dir_servers());
+		files.add(Config.dir_store());
+		files.add(Config.dir_dynamic());
+		files.add(Config.dir_custom());
 		files.add(new File(Config.base(), "console.jar"));
 		files.add(new File(Config.base(), "index.html"));
 		files.add(new File(Config.base(), "version.o2"));
-		FileFilter fileFilter = new RegexFileFilter("^(start_|stop_)(aix|windows|linux|macos).(sh|bat)$");
+		FileFilter fileFilter = new RegexFileFilter("^(start_|stop_|console_)(aix|windows|linux|macos).(sh|bat)$");
 		for (File _f : new File(Config.base()).listFiles(fileFilter)) {
 			files.add(_f);
 		}
@@ -172,31 +175,4 @@ public class ActionUpdate extends ActionBase {
 		JarTools.unjar(file, "", dir, true);
 	}
 
-	// private byte[] getPack(String address) throws Exception {
-	// logger.print("download update pack form url: {}.", address);
-	// URL url = new URL(address);
-	//
-	// HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-	// connection.setUseCaches(false);
-	// connection.setRequestProperty("Content-Type",
-	// HttpMediaType.APPLICATION_JSON_UTF_8);
-	// connection.setRequestMethod("GET");
-	// connection.setDoOutput(false);
-	// connection.setDoInput(true);
-	// connection.connect();
-	// byte[] bytes;
-	// try (InputStream input = connection.getInputStream()) {
-	// bytes = IOUtils.toByteArray(input);
-	// }
-	// logger.print("download update pack completed.");
-	// return bytes;
-	// }
-
-	// private void unzip(byte[] bytes) throws Exception {
-	// File dir = new File(Config.base(), "local/update");
-	// FileUtils.forceMkdir(dir);
-	// FileUtils.cleanDirectory(dir);
-	// JarTools.unjar(bytes, "", dir, true);
-	// }
-
 }

+ 0 - 241
o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdateFast.java

@@ -1,241 +0,0 @@
-package com.x.server.console.action;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.filefilter.RegexFileFilter;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.reflect.MethodUtils;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.x.base.core.project.config.Config;
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.http.HttpMediaType;
-import com.x.base.core.project.logger.Logger;
-import com.x.base.core.project.logger.LoggerFactory;
-import com.x.base.core.project.tools.DateTools;
-import com.x.base.core.project.tools.JarTools;
-import com.x.server.console.NodeAgent;
-
-public class ActionUpdateFast extends ActionBase {
-
-	private static Logger logger = LoggerFactory.getLogger(ActionUpdateFast.class);
-
-	private Date start;
-
-	private void init() throws Exception {
-		this.start = new Date();
-	}
-
-	private static final String LATEST = "latest";
-
-	public boolean execute(String password) throws Exception {
-		this.init();
-		if (!StringUtils.equals(Config.token().getPassword(), password)) {
-			System.out.println("password not match.");
-			return false;
-		}
-		WrapUpdateVersion wrapUpdateVersion = this.get();
-		if (StringUtils.equals(LATEST, wrapUpdateVersion.getVersion())) {
-			System.out.println("already the latest version!");
-			return false;
-		} else {
-			this.backup();
-			File file = this.getPack(wrapUpdateVersion.getUrl());
-			this.unzip(file);
-			FileUtils.forceDelete(file);
-			System.out.println("update completed in " + (((new Date()).getTime() - start.getTime()) / 1000)
-					+ " seconds, restart server to continue update!");
-			return true;
-		}
-	}
-
-	private void backup() throws Exception {
-		File dir = new File(Config.base(), "local/backup");
-		FileUtils.forceMkdir(dir);
-		String tag = DateTools.compact(new Date());
-		File dest = new File(dir, tag + ".zip");
-		logger.print("backup current version to {}.", dest.getAbsolutePath());
-		List<File> files = new ArrayList<>();
-		files.add(new File(Config.base(), "commons"));
-		files.add(new File(Config.base(), "config"));
-		files.add(new File(Config.base(), "jvm"));
-		files.add(new File(Config.base(), "servers"));
-		files.add(new File(Config.base(), "store"));
-		files.add(new File(Config.base(), "console.jar"));
-		files.add(new File(Config.base(), "index.html"));
-		files.add(new File(Config.base(), "version.o2"));
-		FileFilter fileFilter = new RegexFileFilter("^(start_|stop_)(aix|windows|linux|macos).(sh|bat)$");
-		for (File _f : new File(Config.base()).listFiles(fileFilter)) {
-			files.add(_f);
-		}
-		JarTools.jar(files, dest);
-		logger.print("backup current version completed.");
-	}
-
-	private WrapUpdateVersion get() throws Exception {
-		String address = Config.collect().url("/o2_collect_assemble/jaxrs/update/next/" + Config.version());
-		URL url = new URL(address);
-		HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-		connection.setUseCaches(false);
-		connection.setRequestProperty("Content-Type", HttpMediaType.APPLICATION_JSON_UTF_8);
-		connection.setRequestMethod("GET");
-		connection.setDoOutput(false);
-		connection.setDoInput(true);
-		connection.connect();
-		String json = "";
-		try (InputStream input = connection.getInputStream()) {
-			json = IOUtils.toString(input, StandardCharsets.UTF_8);
-		}
-		connection.disconnect();
-		Gson gson = XGsonBuilder.instance();
-		JsonElement jsonElement = gson.fromJson(json, JsonElement.class);
-		if (jsonElement.isJsonObject()) {
-			JsonObject jsonObject = jsonElement.getAsJsonObject();
-			if (jsonObject.has("data")) {
-				return XGsonBuilder.instance().fromJson(jsonObject.get("data"), WrapUpdateVersion.class);
-			}
-		}
-		return null;
-	}
-
-	public static class WrapUpdateVersion {
-
-		private String version;
-
-		private Long size;
-
-		private String url;
-
-		public String getVersion() {
-			return version;
-		}
-
-		public void setVersion(String version) {
-			this.version = version;
-		}
-
-		public String getUrl() {
-			return url;
-		}
-
-		public void setUrl(String url) {
-			this.url = url;
-		}
-
-		public Long getSize() {
-			return size;
-		}
-
-		public void setSize(Long size) {
-			this.size = size;
-		}
-	}
-
-	// private byte[] getPack(String address) throws Exception {
-	// logger.print("download upate pack form url: {}.", address);
-	// URL url = new URL(address);
-	//
-	// HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-	// connection.setUseCaches(false);
-	// connection.setRequestProperty("Content-Type",
-	// HttpMediaType.APPLICATION_JSON_UTF_8);
-	// connection.setRequestMethod("GET");
-	// connection.setDoOutput(false);
-	// connection.setDoInput(true);
-	// connection.connect();
-	// byte[] bytes;
-	// try (InputStream input = connection.getInputStream()) {
-	// bytes = IOUtils.toByteArray(input);
-	// }
-	// System.out.println("download upate pack completed.");
-	// return bytes;
-	// }
-	//
-	// private void unzip(byte[] bytes) throws Exception {
-	// File dir = new File(Config.base(), "local/update");
-	// FileUtils.forceMkdir(dir);
-	// FileUtils.cleanDirectory(dir);
-	// JarTools.unjar(bytes, "", dir, true);
-	// }
-
-	private File getPack(String address) throws Exception {
-		logger.print("download update pack form url: {}.", address);
-		URL url = new URL(address);
-		File file = new File(Config.base(), "local/update.zip");
-		if (file.exists() && file.isFile()) {
-			FileUtils.forceDelete(file);
-		}
-		FileUtils.copyURLToFile(url, file);
-		logger.print("download update pack completed.");
-		return file;
-	}
-
-	private void unzip(File file) throws Exception {
-		File dir = new File(Config.base(), "local/update");
-		FileUtils.forceMkdir(dir);
-		FileUtils.cleanDirectory(dir);
-		JarTools.unjar(file, "", dir, true);
-	}
-
-	private void updateFiles(String base, String updateVersion) throws Exception {
-		File file = new File(base, "local/updates/" + updateVersion + "/commons");
-		if (file.exists() && file.isDirectory()) {
-			FileUtils.copyDirectory(file, new File(base, "commons"));
-		}
-		file = new File(base, "local/updates/" + updateVersion + "/servers");
-		if (file.exists() && file.isDirectory()) {
-			FileUtils.copyDirectory(file, new File(base, "servers"));
-		}
-		file = new File(base, "local/updates/" + updateVersion + "/store");
-		if (file.exists() && file.isDirectory()) {
-			FileUtils.copyDirectory(file, new File(base, "store"));
-		}
-		file = new File(base, "local/updates/" + updateVersion + "/console.jar");
-		if (file.exists() && file.isFile()) {
-			FileUtils.copyFile(file, new File(base, "console.jar"));
-		}
-	}
-
-	private void executeBeforeScript(String base, String updateVersion) throws Exception {
-		File file = new File(base, "local/updates/" + updateVersion + "/script/update" + updateVersion + "before.jar");
-		if (file.exists() && file.isFile()) {
-			System.out.println("executing before update script.");
-			File tempFile = new File(base, "local/temp/" + file.getName());
-			FileUtils.copyFile(file, tempFile);
-			addJar(tempFile);
-			Class<?> clz = Class.forName("update" + updateVersion + "before.Main");
-			MethodUtils.invokeStaticMethod(clz, "main", new Object[] { new String[] {} });
-		}
-	}
-
-	private void changeVersion(String base, String updateVersion) throws Exception {
-		File file = new File(base, "version.o2");
-		FileUtils.writeStringToFile(file, updateVersion, "UTF-8");
-	}
-
-	private void addJar(File file) throws Exception {
-		URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
-		Class<?> urlClass = URLClassLoader.class;
-		Method method = urlClass.getDeclaredMethod("addURL", new Class[] { URL.class });
-		method.setAccessible(true);
-		method.invoke(urlClassLoader, new Object[] { file.toURI().toURL() });
-	}
-
-}

+ 85 - 0
o2server/x_console/src/main/java/com/x/server/console/action/ActionUpdateFile.java

@@ -0,0 +1,85 @@
+package com.x.server.console.action;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.commons.lang3.StringUtils;
+
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.DateTools;
+import com.x.base.core.project.tools.JarTools;
+
+public class ActionUpdateFile extends ActionUpdate {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionUpdateFile.class);
+
+	private Date start;
+
+	private void init() throws Exception {
+		this.start = new Date();
+	}
+
+	public boolean execute(String path, boolean backup, String password) {
+		try {
+			this.init();
+			if (!StringUtils.equals(Config.token().getPassword(), password)) {
+				logger.print("password not mactch.");
+				return false;
+			}
+			File file = new File(path);
+			if (!file.exists() || file.isDirectory()) {
+				logger.print("zip file not exist path:{}.", path);
+				return false;
+			}
+			if (backup) {
+				this.backup();
+			}
+			this.unzip(file);
+			logger.print("update completed in {} seconds, restart server to continue update.",
+					((new Date()).getTime() - start.getTime()) / 1000);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	private void backup() throws Exception {
+		File dir = Config.dir_local_backup(true);
+		String tag = DateTools.compact(new Date());
+		File dest = new File(dir, tag + ".zip");
+		logger.print("backup current version to {}.", dest.getAbsolutePath());
+		List<File> files = new ArrayList<>();
+		files.add(Config.dir_commons());
+		files.add(Config.dir_config());
+		files.add(Config.dir_configSample());
+		files.add(Config.dir_localSample());
+		files.add(Config.dir_jvm());
+		files.add(Config.dir_servers());
+		files.add(Config.dir_store());
+		files.add(Config.dir_dynamic());
+		files.add(Config.dir_custom());
+		files.add(new File(Config.base(), "console.jar"));
+		files.add(new File(Config.base(), "index.html"));
+		files.add(new File(Config.base(), "version.o2"));
+		FileFilter fileFilter = new RegexFileFilter("^(start_|stop_|console_)(aix|windows|linux|macos).(sh|bat)$");
+		for (File _f : new File(Config.base()).listFiles(fileFilter)) {
+			files.add(_f);
+		}
+		JarTools.jar(files, dest);
+		logger.print("backup current version completed.");
+	}
+
+	private void unzip(File file) throws Exception {
+		File dir = Config.dir_local_update(true);
+		FileUtils.cleanDirectory(dir);
+		JarTools.unjar(file, "", dir, true);
+	}
+}

+ 0 - 97
o2server/x_console/src/test/java/com/x/server/console/test/TestClient.java

@@ -1,97 +0,0 @@
-package com.x.server.console.test;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.tools.StringTools;
-
-public class TestClient {
-
-	@Test
-	public void test1() throws Exception {
-		int width = 100;
-		int height = 30;
-
-		// BufferedImage image = ImageIO.read(new
-		// File("/Users/mkyong/Desktop/logo.jpg"));
-		BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-		Graphics g = image.getGraphics();
-		// g.setFont(new Font("SansSerif", Font.BOLD, 24));
-
-		Graphics2D graphics = (Graphics2D) g;
-		graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-		graphics.drawString("JAVA", 10, 20);
-
-		// save this image
-		// ImageIO.write(image, "png", new File("/users/mkyong/ascii-art.png"));
-
-		for (int y = 0; y < height; y++) {
-			StringBuilder sb = new StringBuilder();
-			for (int x = 0; x < width; x++) {
-
-				sb.append(image.getRGB(x, y) == -16777216 ? " " : "$");
-
-			}
-
-			if (sb.toString().trim().isEmpty()) {
-				continue;
-			}
-
-			System.out.println(sb);
-		}
-
-	}
-
-	@Test
-	public void test() {
-		List<String> list = new ArrayList<>();
-		list.add("com.x.base.core.project.x_attendance_assemble_control");
-		list.add("com.x.base.core.project.x_bbs_assemble_control");
-		list.add("com.x.base.core.project.x_calendar_assemble_control");
-		list.add("com.x.base.core.project.x_cms_assemble_control");
-		list.add("com.x.base.core.project.x_collaboration_assemble_websocket");
-		list.add("com.x.base.core.project.x_collaboration_service_message");
-		list.add("com.x.base.core.project.x_component_assemble_control");
-		list.add("com.x.base.core.project.x_file_assemble_control");
-		list.add("com.x.base.core.project.x_general_assemble_control");
-		list.add("com.x.base.core.project.x_hotpic_assemble_control");
-		list.add("com.x.base.core.project.x_meeting_assemble_control");
-		list.add("com.x.base.core.project.x_message_assemble_communicate");
-		list.add("com.x.base.core.project.x_mind_assemble_control");
-		list.add("com.x.base.core.project.x_okr_assemble_control");
-		list.add("com.x.base.core.project.x_organization_assemble_authentication");
-		list.add("com.x.base.core.project.x_organization_assemble_control");
-		list.add("com.x.base.core.project.x_organization_assemble_custom");
-		list.add("com.x.base.core.project.x_organization_assemble_express");
-		list.add("com.x.base.core.project.x_organization_assemble_personal");
-		list.add("com.x.base.core.project.x_portal_assemble_designer");
-		list.add("com.x.base.core.project.x_portal_assemble_surface");
-		list.add("com.x.base.core.project.x_processplatform_assemble_bam");
-		list.add("com.x.base.core.project.x_processplatform_assemble_designer");
-		list.add("com.x.base.core.project.x_processplatform_assemble_surface");
-		list.add("com.x.base.core.project.x_processplatform_service_processing");
-		list.add("com.x.base.core.project.x_query_assemble_designer");
-		list.add("com.x.base.core.project.x_query_assemble_surface");
-		list.add("com.x.base.core.project.x_query_service_processing");
-		List<String> in = new ArrayList<>();
-		List<String> ex = new ArrayList<>();
-		ex.add("com.x.base.core.project.x_mind_assemble_*");
-		ex.add("com.x.base.core.project.x_okr_assemble_*");
-		ex.add("com.x.base.core.project.x_hotpic_assemble_*");
-		ex.add("com.x.base.core.project.x_calendar_*");
-		ex.add("com.x.base.core.project.x_attendance_*");
-		ex.add("com.x.base.core.project.x_meeting_*");
-		ex.add("com.x.base.core.project.x_file_*");
-		list = StringTools.includesExcludesWithWildcard(list, in, ex);
-		System.out.println(XGsonBuilder.toJson(list));
-		System.out.println(StringTools.matchWildcard("com.x.base.core.project.x_hotpic_assemble_control", "com.x.base.core.project.x_hotpic_assemble_*"));
-	}
-
-}

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio