Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
8aa9f3cb
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8aa9f3cb
编写于
8月 26, 2020
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/门户缓存优化' into 'develop'
【平台】门户缓存优化 See merge request o2oa/o2oa!1453
上级
32f2fd1c
8b427f66
变更
99
隐藏空白更改
内联
并排
Showing
99 changed file
with
571 addition
and
596 deletion
+571
-596
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/identity/ActionGet.java
...ganization/assemble/control/jaxrs/identity/ActionGet.java
+0
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/Business.java
...n/java/com/x/organization/assemble/personal/Business.java
+8
-15
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/GroupFactory.java
.../organization/assemble/personal/factory/GroupFactory.java
+13
-14
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/IdentityFactory.java
...ganization/assemble/personal/factory/IdentityFactory.java
+13
-15
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/PersonAttributeFactory.java
...ion/assemble/personal/factory/PersonAttributeFactory.java
+13
-15
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/PersonFactory.java
...organization/assemble/personal/factory/PersonFactory.java
+13
-14
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/RoleFactory.java
...x/organization/assemble/personal/factory/RoleFactory.java
+13
-14
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitAttributeFactory.java
...ation/assemble/personal/factory/UnitAttributeFactory.java
+13
-15
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitDutyFactory.java
...ganization/assemble/personal/factory/UnitDutyFactory.java
+13
-15
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitFactory.java
...x/organization/assemble/personal/factory/UnitFactory.java
+13
-14
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/custom/ActionDelete.java
...nization/assemble/personal/jaxrs/custom/ActionDelete.java
+2
-2
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionDelete.java
...tion/assemble/personal/jaxrs/definition/ActionDelete.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionEdit.java
...zation/assemble/personal/jaxrs/definition/ActionEdit.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionGet.java
...ization/assemble/personal/jaxrs/definition/ActionGet.java
+10
-7
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionCreate.java
...ization/assemble/personal/jaxrs/empower/ActionCreate.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionDelete.java
...ization/assemble/personal/jaxrs/empower/ActionDelete.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionDisable.java
...zation/assemble/personal/jaxrs/empower/ActionDisable.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionEdit.java
...anization/assemble/personal/jaxrs/empower/ActionEdit.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionEnable.java
...ization/assemble/personal/jaxrs/empower/ActionEnable.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListTo.java
...ization/assemble/personal/jaxrs/empower/ActionListTo.java
+0
-2
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListToEnable.java
...n/assemble/personal/jaxrs/empower/ActionListToEnable.java
+0
-2
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPerson.java
...e/personal/jaxrs/empower/ActionListWithCurrentPerson.java
+0
-3
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithPerson.java
...assemble/personal/jaxrs/empower/ActionListWithPerson.java
+8
-8
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerCreate.java
.../assemble/personal/jaxrs/empower/ActionManagerCreate.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerDelete.java
.../assemble/personal/jaxrs/empower/ActionManagerDelete.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerEdit.java
...on/assemble/personal/jaxrs/empower/ActionManagerEdit.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/BaseAction.java
...anization/assemble/personal/jaxrs/empower/BaseAction.java
+0
-4
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empowerlog/ActionDelete.java
...tion/assemble/personal/jaxrs/empowerlog/ActionDelete.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/icon/ActionGetWithPerson.java
...ion/assemble/personal/jaxrs/icon/ActionGetWithPerson.java
+8
-8
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
...ganization/assemble/personal/jaxrs/person/ActionEdit.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGet.java
...rganization/assemble/personal/jaxrs/person/ActionGet.java
+8
-8
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGetIcon.java
...ization/assemble/personal/jaxrs/person/ActionGetIcon.java
+8
-9
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetIcon.java
...ization/assemble/personal/jaxrs/person/ActionSetIcon.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetIconOctetStream.java
...emble/personal/jaxrs/person/ActionSetIconOctetStream.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetPassword.java
...ion/assemble/personal/jaxrs/person/ActionSetPassword.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/reset/ActionSetPasswordAnonymous.java
...mble/personal/jaxrs/reset/ActionSetPasswordAnonymous.java
+2
-1
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/schedule/DisableExpiredEmpower.java
...ion/assemble/personal/schedule/DisableExpiredEmpower.java
+2
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionCreate.java
...m/x/portal/assemble/designer/jaxrs/file/ActionCreate.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionDelete.java
...m/x/portal/assemble/designer/jaxrs/file/ActionDelete.java
+2
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionDownload.java
...x/portal/assemble/designer/jaxrs/file/ActionDownload.java
+10
-10
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionEdit.java
...com/x/portal/assemble/designer/jaxrs/file/ActionEdit.java
+2
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionUpload.java
...m/x/portal/assemble/designer/jaxrs/file/ActionUpload.java
+2
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/input/ActionCover.java
...m/x/portal/assemble/designer/jaxrs/input/ActionCover.java
+5
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/ActionSelect.java
...x/portal/assemble/designer/jaxrs/output/ActionSelect.java
+4
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/ActionSelectFile.java
...rtal/assemble/designer/jaxrs/output/ActionSelectFile.java
+7
-5
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/BaseAction.java
...m/x/portal/assemble/designer/jaxrs/output/BaseAction.java
+2
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionCreate.java
...m/x/portal/assemble/designer/jaxrs/page/ActionCreate.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionDelete.java
...m/x/portal/assemble/designer/jaxrs/page/ActionDelete.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionEdit.java
...com/x/portal/assemble/designer/jaxrs/page/ActionEdit.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionGet.java
.../com/x/portal/assemble/designer/jaxrs/page/ActionGet.java
+8
-8
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/BaseAction.java
...com/x/portal/assemble/designer/jaxrs/page/BaseAction.java
+2
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionCreate.java
...x/portal/assemble/designer/jaxrs/portal/ActionCreate.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionDelete.java
...x/portal/assemble/designer/jaxrs/portal/ActionDelete.java
+6
-6
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionEdit.java
...m/x/portal/assemble/designer/jaxrs/portal/ActionEdit.java
+5
-5
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionGet.java
...om/x/portal/assemble/designer/jaxrs/portal/ActionGet.java
+8
-8
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionSetIcon.java
.../portal/assemble/designer/jaxrs/portal/ActionSetIcon.java
+2
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/BaseAction.java
...m/x/portal/assemble/designer/jaxrs/portal/BaseAction.java
+2
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionCreate.java
...x/portal/assemble/designer/jaxrs/script/ActionCreate.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionDelete.java
...x/portal/assemble/designer/jaxrs/script/ActionDelete.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionEdit.java
...m/x/portal/assemble/designer/jaxrs/script/ActionEdit.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionGet.java
...om/x/portal/assemble/designer/jaxrs/script/ActionGet.java
+8
-8
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/BaseAction.java
...m/x/portal/assemble/designer/jaxrs/script/BaseAction.java
+2
-4
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/templatepage/ActionCreate.java
...al/assemble/designer/jaxrs/templatepage/ActionCreate.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/templatepage/ActionDelete.java
...al/assemble/designer/jaxrs/templatepage/ActionDelete.java
+2
-2
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionCreate.java
...x/portal/assemble/designer/jaxrs/widget/ActionCreate.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionDelete.java
...x/portal/assemble/designer/jaxrs/widget/ActionDelete.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionEdit.java
...m/x/portal/assemble/designer/jaxrs/widget/ActionEdit.java
+3
-3
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionGet.java
...om/x/portal/assemble/designer/jaxrs/widget/ActionGet.java
+8
-8
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/BaseAction.java
...m/x/portal/assemble/designer/jaxrs/widget/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/FileFactory.java
...va/com/x/portal/assemble/surface/factory/FileFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/PageFactory.java
...va/com/x/portal/assemble/surface/factory/PageFactory.java
+15
-15
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/PortalFactory.java
.../com/x/portal/assemble/surface/factory/PortalFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/ScriptFactory.java
.../com/x/portal/assemble/surface/factory/ScriptFactory.java
+20
-20
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/WidgetFactory.java
.../com/x/portal/assemble/surface/factory/WidgetFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java
...m/x/portal/assemble/surface/jaxrs/file/ActionContent.java
+10
-9
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java
.../x/portal/assemble/surface/jaxrs/file/ActionDownload.java
+10
-10
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
...rtal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
+8
-8
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
...ssemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
+8
-8
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
.../com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java
...rtal/assemble/surface/jaxrs/script/ActionGetImported.java
+8
-8
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java
...om/x/portal/assemble/surface/jaxrs/script/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
...al/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
+8
-8
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
...emble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
+8
-8
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
...om/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/FileFactory.java
...es/com/x/portal/assemble/surface/factory/FileFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PageFactory.java
...es/com/x/portal/assemble/surface/factory/PageFactory.java
+15
-15
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PortalFactory.java
.../com/x/portal/assemble/surface/factory/PortalFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/ScriptFactory.java
.../com/x/portal/assemble/surface/factory/ScriptFactory.java
+20
-20
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/WidgetFactory.java
.../com/x/portal/assemble/surface/factory/WidgetFactory.java
+10
-10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java
...m/x/portal/assemble/surface/jaxrs/file/ActionContent.java
+10
-9
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java
.../x/portal/assemble/surface/jaxrs/file/ActionDownload.java
+10
-10
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
...rtal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
+8
-8
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
...ssemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
+8
-8
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
.../com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java
...rtal/assemble/surface/jaxrs/script/ActionGetImported.java
+8
-8
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java
...om/x/portal/assemble/surface/jaxrs/script/BaseAction.java
+2
-4
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
...al/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
+8
-8
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
...emble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
+8
-8
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
...om/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
+2
-4
未找到文件。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/identity/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -25,7 +25,6 @@ import com.x.organization.core.entity.Unit;
import
com.x.organization.core.entity.Unit_
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/Business.java
浏览文件 @
8aa9f3cb
package
com.x.organization.assemble.personal
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.instrument.Instrument
;
import
com.x.organization.assemble.personal.factory.GroupFactory
;
import
com.x.organization.assemble.personal.factory.IdentityFactory
;
...
...
@@ -11,27 +10,21 @@ import com.x.organization.assemble.personal.factory.RoleFactory;
import
com.x.organization.assemble.personal.factory.UnitAttributeFactory
;
import
com.x.organization.assemble.personal.factory.UnitDutyFactory
;
import
com.x.organization.assemble.personal.factory.UnitFactory
;
import
com.x.organization.core.entity.Group
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.PersonAttribute
;
import
com.x.organization.core.entity.Role
;
import
com.x.organization.core.entity.Unit
;
import
com.x.organization.core.entity.UnitAttribute
;
import
com.x.organization.core.entity.UnitDuty
;
import
net.sf.ehcache.Ehcache
;
import
com.x.organization.core.entity.*
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.organization.core.entity.accredit.Empower
;
public
class
Business
{
private
EntityManagerContainer
emc
;
private
Ehcache
cache
;
private
CacheCategory
cache
;
public
Business
(
EntityManagerContainer
emc
)
throws
Exception
{
this
.
emc
=
emc
;
this
.
cache
=
ApplicationCache
.
instance
().
getCache
(
Group
.
class
,
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Unit
.
class
,
UnitDuty
.
class
,
UnitAttribute
.
class
,
Identity
.
class
);
this
.
cache
=
new
CacheCategory
(
Group
.
class
,
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Unit
.
class
,
UnitDuty
.
class
,
UnitAttribute
.
class
,
Identity
.
class
,
Definition
.
class
,
Empower
.
class
,
Custom
.
class
);
}
public
EntityManagerContainer
entityManagerContainer
()
{
...
...
@@ -119,7 +112,7 @@ public class Business {
return
instrument
;
}
public
Ehcache
cache
()
{
public
CacheCategory
cache
()
{
return
cache
;
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/GroupFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -22,8 +22,9 @@ import com.x.organization.core.entity.Group;
import
com.x.organization.core.entity.Group_
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.Person
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
GroupFactory
extends
AbstractFactory
{
...
...
@@ -36,14 +37,13 @@ public class GroupFactory extends AbstractFactory {
return
null
;
}
Group
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
Group
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
Group
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -51,14 +51,13 @@ public class GroupFactory extends AbstractFactory {
public
List
<
Group
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
Group
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
Group
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
Group
)
optional
.
get
());
}
else
{
Group
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/IdentityFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -14,14 +14,14 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity_
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
IdentityFactory
extends
AbstractFactory
{
...
...
@@ -34,14 +34,13 @@ public class IdentityFactory extends AbstractFactory {
return
null
;
}
Identity
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
Identity
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
Identity
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -80,14 +79,13 @@ public class IdentityFactory extends AbstractFactory {
public
List
<
Identity
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
Identity
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
Identity
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
Identity
)
optional
.
get
());
}
else
{
Identity
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/PersonAttributeFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -14,14 +14,14 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.PersonAttribute
;
import
com.x.organization.core.entity.PersonAttribute_
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
PersonAttributeFactory
extends
AbstractFactory
{
...
...
@@ -34,14 +34,13 @@ public class PersonAttributeFactory extends AbstractFactory {
return
null
;
}
PersonAttribute
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
PersonAttribute
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
PersonAttribute
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -80,14 +79,13 @@ public class PersonAttributeFactory extends AbstractFactory {
public
List
<
PersonAttribute
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
PersonAttribute
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
PersonAttribute
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
PersonAttribute
)
optional
.
get
());
}
else
{
PersonAttribute
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/PersonFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -17,15 +17,16 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.entity.tools.JpaObjectTools
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.tools.Crypto
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.Person_
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
import
net.sf.ehcache.Element
;
public
class
PersonFactory
extends
AbstractFactory
{
...
...
@@ -38,14 +39,13 @@ public class PersonFactory extends AbstractFactory {
return
null
;
}
Person
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
Person
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
Person
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -84,14 +84,13 @@ public class PersonFactory extends AbstractFactory {
public
List
<
Person
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
Person
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
Person
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
Person
)
optional
.
get
());
}
else
{
Person
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/RoleFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -14,14 +14,15 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.Role
;
import
com.x.organization.core.entity.Role_
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
import
net.sf.ehcache.Element
;
public
class
RoleFactory
extends
AbstractFactory
{
...
...
@@ -34,14 +35,13 @@ public class RoleFactory extends AbstractFactory {
return
null
;
}
Role
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
Role
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
Role
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -80,14 +80,13 @@ public class RoleFactory extends AbstractFactory {
public
List
<
Role
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
Role
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
Role
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
Role
)
optional
.
get
());
}
else
{
Role
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitAttributeFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -14,14 +14,14 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.UnitAttribute
;
import
com.x.organization.core.entity.UnitAttribute_
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
UnitAttributeFactory
extends
AbstractFactory
{
...
...
@@ -34,14 +34,13 @@ public class UnitAttributeFactory extends AbstractFactory {
return
null
;
}
UnitAttribute
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
UnitAttribute
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
UnitAttribute
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -80,14 +79,13 @@ public class UnitAttributeFactory extends AbstractFactory {
public
List
<
UnitAttribute
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
UnitAttribute
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
UnitAttribute
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
UnitAttribute
)
optional
.
get
());
}
else
{
UnitAttribute
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitDutyFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -14,14 +14,14 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.organization.assemble.personal.AbstractFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.UnitDuty
;
import
com.x.organization.core.entity.UnitDuty_
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
UnitDutyFactory
extends
AbstractFactory
{
...
...
@@ -34,14 +34,13 @@ public class UnitDutyFactory extends AbstractFactory {
return
null
;
}
UnitDuty
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
UnitDuty
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
UnitDuty
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -80,14 +79,13 @@ public class UnitDutyFactory extends AbstractFactory {
public
List
<
UnitDuty
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
UnitDuty
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
UnitDuty
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
UnitDuty
)
optional
.
get
());
}
else
{
UnitDuty
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -21,8 +21,9 @@ import com.x.organization.assemble.personal.Business;
import
com.x.organization.core.entity.PersistenceProperties
;
import
com.x.organization.core.entity.Unit
;
import
com.x.organization.core.entity.Unit_
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
UnitFactory
extends
AbstractFactory
{
...
...
@@ -35,14 +36,13 @@ public class UnitFactory extends AbstractFactory {
return
null
;
}
Unit
o
=
null
;
Element
element
=
this
.
business
.
cache
().
get
(
flag
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
o
=
(
Unit
)
element
.
getObjectValue
();
}
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
o
=
(
Unit
)
optional
.
get
();
}
else
{
o
=
this
.
pickObject
(
flag
);
this
.
business
.
cache
().
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
}
return
o
;
}
...
...
@@ -97,14 +97,13 @@ public class UnitFactory extends AbstractFactory {
public
List
<
Unit
>
pick
(
List
<
String
>
flags
)
throws
Exception
{
List
<
Unit
>
list
=
new
ArrayList
<>();
for
(
String
str
:
flags
)
{
Element
element
=
this
.
business
.
cache
().
get
(
str
);
if
(
null
!=
element
)
{
if
(
null
!=
element
.
getObjectValue
())
{
list
.
add
((
Unit
)
element
.
getObjectValue
());
}
CacheKey
cacheKey
=
new
CacheKey
(
str
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
list
.
add
((
Unit
)
optional
.
get
());
}
else
{
Unit
o
=
this
.
pickObject
(
str
);
this
.
business
.
cache
().
put
(
new
Element
(
str
,
o
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
o
);
if
(
null
!=
o
)
{
list
.
add
(
o
);
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/custom/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,7 +2,7 @@ package com.x.organization.assemble.personal.jaxrs.custom;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.
ApplicationCache
;
import
com.x.base.core.project.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -24,7 +24,7 @@ class ActionDelete extends BaseAction {
emc
.
remove
(
o
);
emc
.
commit
();
wo
.
setId
(
o
.
getId
());
ApplicationCache
.
notify
(
Custom
.
class
,
effectivePerson
.
getDistinguishedName
());
CacheManager
.
notify
(
Custom
.
class
,
effectivePerson
.
getDistinguishedName
());
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -3,6 +3,7 @@ package com.x.organization.assemble.personal.jaxrs.definition;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -24,7 +25,7 @@ class ActionDelete extends BaseAction {
emc
.
remove
(
o
);
emc
.
commit
();
wo
.
setId
(
o
.
getId
());
ApplicationCache
.
notify
(
Definition
.
class
);
CacheManager
.
notify
(
Definition
.
class
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -30,7 +31,7 @@ class ActionEdit extends BaseAction {
emc
.
persist
(
definition
,
CheckPersistType
.
all
);
}
emc
.
commit
();
ApplicationCache
.
notify
(
Definition
.
class
);
CacheManager
.
notify
(
Definition
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
definition
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/definition/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -6,9 +6,11 @@ import com.x.base.core.project.http.ActionResult;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Definition
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
...
...
@@ -16,17 +18,18 @@ class ActionGet extends BaseAction {
ActionResult
<
String
>
execute
(
EffectivePerson
effectivePerson
,
String
name
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
String
>
result
=
new
ActionResult
<>();
String
cacheKey
=
name
;
Element
element
=
cache
.
get
(
cacheKey
);
CacheKey
cacheKey
=
new
CacheKey
(
name
)
;
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
String
wo
=
""
;
if
(
null
!=
element
)
{
wo
=
(
String
)
element
.
getObjectValue
();
if
(
optional
.
isPresent
()
)
{
wo
=
(
String
)
optional
.
get
();
}
else
{
Definition
o
=
emc
.
flag
(
name
,
Definition
.
class
);
if
(
null
!=
o
)
{
wo
=
o
.
getData
();
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
wo
);
}
}
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionCreate.java
浏览文件 @
8aa9f3cb
package
com.x.organization.assemble.personal.jaxrs.empower
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -44,7 +45,7 @@ class ActionCreate extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
persist
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -26,7 +27,7 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
remove
(
empower
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionDisable.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -27,7 +28,7 @@ class ActionDisable extends BaseAction {
empower
.
setEnable
(
false
);
emc
.
check
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionEdit.java
浏览文件 @
8aa9f3cb
package
com.x.organization.assemble.personal.jaxrs.empower
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -49,7 +50,7 @@ class ActionEdit extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
check
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionEnable.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -27,7 +28,7 @@ class ActionEnable extends BaseAction {
empower
.
setEnable
(
true
);
emc
.
check
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListTo.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,13 +7,11 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Empower
;
import
net.sf.ehcache.Element
;
class
ActionListTo
extends
BaseAction
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListToEnable.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,13 +7,11 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Empower
;
import
net.sf.ehcache.Element
;
class
ActionListToEnable
extends
BaseAction
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPerson.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,14 +7,11 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Empower
;
import
net.sf.ehcache.Element
;
class
ActionListWithCurrentPerson
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithPerson.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,15 +7,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.accredit.Empower
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionListWithPerson
extends
BaseAction
{
...
...
@@ -27,13 +27,13 @@ class ActionListWithPerson extends BaseAction {
if
(
null
==
person
)
{
throw
new
ExceptionEntityNotExist
(
flag
);
}
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
person
.
getDistinguishedName
());
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
person
.
getDistinguishedName
());
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
(
))
{
result
.
setData
((
List
<
Wo
>)
optional
.
get
());
}
else
{
List
<
Wo
>
wos
=
this
.
list
(
business
,
person
.
getDistinguishedName
());
cache
.
put
(
new
Element
(
cacheKey
,
wos
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
wos
);
result
.
setData
(
wos
);
}
return
result
;
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerCreate.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,6 +8,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -48,7 +49,7 @@ class ActionManagerCreate extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
persist
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -24,7 +25,7 @@ class ActionManagerDelete extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
remove
(
empower
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,6 +8,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -50,7 +51,7 @@ class ActionManagerEdit extends BaseAction {
emc
.
beginTransaction
(
Empower
.
class
);
emc
.
check
(
empower
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
empower
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,7 +10,6 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityFieldEmpty
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.organization.assemble.personal.Business
;
...
...
@@ -19,12 +18,9 @@ import com.x.organization.core.entity.Person;
import
com.x.organization.core.entity.accredit.Empower
;
import
com.x.organization.core.entity.accredit.Empower_
;
import
net.sf.ehcache.Ehcache
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
static
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
Empower
.
class
);
protected
void
check
(
Business
business
,
Empower
empower
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
empower
.
getFromIdentity
()))
{
throw
new
ExceptionEmptyFromIdentity
();
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empowerlog/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -26,7 +27,7 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
EmpowerLog
.
class
);
emc
.
remove
(
empowerLog
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
EmpowerLog
.
class
);
CacheManager
.
notify
(
EmpowerLog
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/icon/ActionGetWithPerson.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,15 +8,15 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Person
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPerson
extends
BaseAction
{
...
...
@@ -24,13 +24,13 @@ class ActionGetWithPerson extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
);
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
result
.
setData
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
(
))
{
result
.
setData
((
Wo
)
optional
.
get
());
}
else
{
Wo
wo
=
this
.
get
(
business
,
flag
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
wo
);
result
.
setData
(
wo
);
}
return
result
;
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,6 +8,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -46,7 +47,7 @@ class ActionEdit extends BaseAction {
emc
.
check
(
person
,
CheckPersistType
.
all
);
emc
.
commit
();
/** 刷新缓存 */
ApplicationCache
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Person
.
class
);
/** 通知x_collect_service_transmit同步数据到collect */
business
.
instrument
().
collect
().
person
();
Wo
wo
=
new
Wo
();
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -17,7 +17,6 @@ import com.x.base.core.entity.JpaObject;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -35,8 +34,9 @@ import com.x.organization.core.entity.Role_;
import
com.x.organization.core.entity.Unit
;
import
com.x.organization.core.entity.UnitDuty
;
import
com.x.organization.core.entity.UnitDuty_
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
...
...
@@ -44,11 +44,11 @@ class ActionGet extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
result
.
setData
((
Wo
)
element
.
getObjectValue
());
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
(
))
{
result
.
setData
((
Wo
)
optional
.
get
());
}
else
{
if
(
Config
.
token
().
isInitialManager
(
effectivePerson
.
getDistinguishedName
()))
{
/** 如果是xadmin单独处理 */
...
...
@@ -65,7 +65,7 @@ class ActionGet extends BaseAction {
this
.
referenceIdentity
(
business
,
wo
);
this
.
referenceRole
(
business
,
wo
);
this
.
referenceGroup
(
business
,
wo
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
wo
);
result
.
setData
(
wo
);
}
}
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGetIcon.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,15 +8,15 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Person
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetIcon
extends
BaseAction
{
...
...
@@ -24,14 +24,13 @@ class ActionGetIcon extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Optional
<?>
optional
=
CacheManager
.
get
(
business
.
cache
(),
cacheKey
);
if
(
optional
.
isPresent
())
{
result
.
setData
((
Wo
)
optional
.
get
());
}
else
{
Wo
wo
=
this
.
get
(
business
,
effectivePerson
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
business
.
cache
(),
cacheKey
,
wo
);
result
.
setData
(
wo
);
}
return
result
;
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetIcon.java
浏览文件 @
8aa9f3cb
...
...
@@ -6,6 +6,7 @@ import java.io.ByteArrayOutputStream;
import
javax.imageio.ImageIO
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.glassfish.jersey.media.multipart.FormDataContentDisposition
;
import
org.imgscalr.Scalr
;
...
...
@@ -60,7 +61,7 @@ class ActionSetIcon extends BaseAction {
person
.
setIconLdpi
(
icon_l
);
emc
.
commit
();
ApplicationCache
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Person
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetIconOctetStream.java
浏览文件 @
8aa9f3cb
...
...
@@ -6,6 +6,7 @@ import java.io.ByteArrayOutputStream;
import
javax.imageio.ImageIO
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.imgscalr.Scalr
;
...
...
@@ -58,7 +59,7 @@ class ActionSetIconOctetStream extends BaseAction {
person
.
setIconLdpi
(
icon_l
);
emc
.
commit
();
ApplicationCache
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Person
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
person
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetPassword.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,6 +2,7 @@ package com.x.organization.assemble.personal.jaxrs.person;
import
java.util.Date
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -94,7 +95,7 @@ class ActionSetPassword extends BaseAction {
emc
.
beginTransaction
(
Person
.
class
);
business
.
person
().
setPassword
(
person
,
wi
.
getNewPassword
());
emc
.
commit
();
ApplicationCache
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Person
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/reset/ActionSetPasswordAnonymous.java
浏览文件 @
8aa9f3cb
package
com.x.organization.assemble.personal.jaxrs.reset
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -98,7 +99,7 @@ public class ActionSetPasswordAnonymous extends BaseAction {
emc
.
beginTransaction
(
Person
.
class
);
business
.
person
().
setPassword
(
person
,
wi
.
getNewPassword
());
emc
.
commit
();
ApplicationCache
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Person
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/schedule/DisableExpiredEmpower.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,6 +9,7 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
...
...
@@ -49,7 +50,7 @@ public class DisableExpiredEmpower extends AbstractJob {
o
.
setEnable
(
false
);
}
emc
.
commit
();
ApplicationCache
.
notify
(
Empower
.
class
);
CacheManager
.
notify
(
Empower
.
class
);
}
}
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionCreate.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.file
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -9,7 +10,6 @@ import com.x.base.core.entity.JpaObject;
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.ExceptionDuplicateFlag
;
import
com.x.base.core.project.exception.ExceptionDuplicateRestrictFlag
;
...
...
@@ -56,7 +56,7 @@ class ActionCreate extends BaseAction {
}
emc
.
persist
(
file
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
File
.
class
);
CacheManager
.
notify
(
File
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
file
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,6 +4,7 @@ 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.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -32,7 +33,7 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
File
.
class
);
emc
.
remove
(
file
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
File
.
class
);
CacheManager
.
notify
(
File
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
file
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionDownload.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,7 +5,6 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -13,22 +12,23 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionDownload
extends
StandardJaxrsAction
{
private
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
private
CacheCategory
cacheCategory
=
new
CacheCategory
(
File
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
File
file
=
emc
.
flag
(
flag
,
File
.
class
);
if
(
null
==
file
)
{
...
...
@@ -48,7 +48,7 @@ class ActionDownload extends StandardJaxrsAction {
* 对10M以下的文件进行缓存
*/
if
(
bs
.
length
<
(
1024
*
1024
*
10
))
{
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
wo
);
}
}
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionEdit.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.file
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -57,7 +58,7 @@ class ActionEdit extends BaseAction {
}
emc
.
check
(
file
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
File
.
class
);
CacheManager
.
notify
(
File
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
file
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/file/ActionUpload.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.file
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.StringUtils
;
import
org.glassfish.jersey.media.multipart.FormDataContentDisposition
;
...
...
@@ -43,7 +44,7 @@ class ActionUpload extends BaseAction {
file
.
setFileName
(
fileName
);
}
emc
.
commit
();
ApplicationCache
.
notify
(
File
.
class
);
CacheManager
.
notify
(
File
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/input/ActionCover.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,6 +10,7 @@ import javax.persistence.criteria.Predicate;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -146,10 +147,10 @@ class ActionCover extends BaseAction {
business
.
entityManagerContainer
().
persist
(
o
);
}
business
.
entityManagerContainer
().
commit
();
ApplicationCache
.
notify
(
Script
.
class
);
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
return
portal
;
}
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/ActionSelect.java
浏览文件 @
8aa9f3cb
...
...
@@ -4,7 +4,6 @@ import com.google.gson.JsonElement;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -20,8 +19,8 @@ import com.x.portal.core.entity.wrap.WrapPage;
import
com.x.portal.core.entity.wrap.WrapPortal
;
import
com.x.portal.core.entity.wrap.WrapScript
;
import
com.x.portal.core.entity.wrap.WrapWidget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
class
ActionSelect
extends
BaseAction
{
...
...
@@ -44,7 +43,8 @@ class ActionSelect extends BaseAction {
cacheObject
.
setName
(
portal
.
getName
());
cacheObject
.
setPortal
(
wrapPortal
);
String
flag
=
StringTools
.
uniqueToken
();
this
.
cache
.
put
(
new
Element
(
flag
,
cacheObject
));
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
);
CacheManager
.
put
(
this
.
cache
,
cacheKey
,
cacheObject
);
Wo
wo
=
XGsonBuilder
.
convert
(
wrapPortal
,
Wo
.
class
);
wo
.
setFlag
(
flag
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/ActionSelectFile.java
浏览文件 @
8aa9f3cb
...
...
@@ -6,8 +6,9 @@ import com.x.base.core.project.http.ActionResult;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoFile
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionSelectFile
extends
BaseAction
{
...
...
@@ -16,11 +17,12 @@ class ActionSelectFile extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Element
element
=
cache
.
get
(
flag
);
if
(
null
==
element
||
null
==
element
.
getObjectValue
())
{
CacheKey
cacheKey
=
new
CacheKey
(
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
this
.
cache
,
cacheKey
);
if
(!
optional
.
isPresent
())
{
throw
new
ExceptionFlagNotExist
(
flag
);
}
CacheObject
cacheObject
=
(
CacheObject
)
element
.
getObjectValue
();
CacheObject
cacheObject
=
(
CacheObject
)
optional
.
get
();
Wo
wo
=
new
Wo
(
gson
.
toJson
(
cacheObject
.
getPortal
()).
getBytes
(
DefaultCharset
.
name
),
this
.
contentType
(
true
,
cacheObject
.
getName
()
+
extension
),
this
.
contentDisposition
(
true
,
cacheObject
.
getName
()
+
extension
));
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/output/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,17 +9,15 @@ import javax.persistence.criteria.Predicate;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.wrap.WrapPortal
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
CacheObject
.
class
);
protected
CacheCategory
cache
=
new
CacheCategory
(
CacheObject
.
class
);
protected
<
T
extends
JpaObject
>
List
<
String
>
listWithPortal
(
Business
business
,
Portal
portal
,
Class
<
T
>
cls
)
throws
Exception
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionCreate.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.page
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -9,7 +10,6 @@ import com.x.base.core.entity.JpaObject;
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.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -44,8 +44,8 @@ class ActionCreate extends BaseAction {
portal
.
setFirstPage
(
page
.
getId
());
}
emc
.
commit
();
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
page
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionDelete.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.page
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
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.WrapBoolean
;
...
...
@@ -44,8 +44,8 @@ class ActionDelete extends BaseAction {
}
}
emc
.
commit
();
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionEdit.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.designer.jaxrs.page
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -9,7 +10,6 @@ import com.x.base.core.entity.JpaObject;
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.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -50,8 +50,8 @@ class ActionEdit extends BaseAction {
portal
.
setFirstPage
(
page
.
getId
());
}
emc
.
commit
();
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
page
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
...
...
@@ -20,17 +20,17 @@ class ActionGet extends BaseAction {
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Page
page
=
emc
.
find
(
id
,
Page
.
class
);
if
(
null
==
page
)
{
throw
new
PageNotExistedException
(
id
);
}
wo
=
Wo
.
copier
.
copy
(
page
);
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
Portal
portal
=
emc
.
find
(
wo
.
getPortal
(),
Portal
.
class
);
if
(
null
==
portal
)
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/page/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,17 +2,15 @@ package com.x.portal.assemble.designer.jaxrs.page;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
static
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
Page
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Page
.
class
);
void
checkName
(
Business
business
,
Page
page
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
page
.
getName
()))
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionCreate.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,7 +9,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -35,7 +35,7 @@ class ActionCreate extends BaseAction {
this
.
checkAlias
(
business
,
portal
);
emc
.
persist
(
portal
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
portal
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,7 +5,7 @@ import java.util.List;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.cache.
ApplicationCache
;
import
com.x.base.core.project.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
...
...
@@ -41,11 +41,11 @@ class ActionDelete extends BaseAction {
this
.
removeFile
(
business
,
portal
.
getId
());
emc
.
remove
(
portal
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Portal
.
class
);
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Script
.
class
);
ApplicationCache
.
notify
(
File
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
File
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,7 +9,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -41,10 +41,10 @@ class ActionEdit extends BaseAction {
this
.
checkAlias
(
business
,
o
);
emc
.
check
(
o
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Portal
.
class
);
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Page
.
class
);
ApplicationCache
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Page
.
class
);
CacheManager
.
notify
(
Script
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
o
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,13 +5,13 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
...
...
@@ -19,10 +19,10 @@ class ActionGet extends BaseAction {
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
null
!=
element
.
getObjectValue
())
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
())
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Portal
o
=
emc
.
find
(
id
,
Portal
.
class
);
if
(
null
==
o
)
{
...
...
@@ -32,7 +32,7 @@ class ActionGet extends BaseAction {
throw
new
InvisibleException
(
effectivePerson
.
getDistinguishedName
(),
o
.
getName
(),
o
.
getId
());
}
wo
=
Wo
.
copier
.
copy
(
o
);
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/ActionSetIcon.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,6 +7,7 @@ import java.io.InputStream;
import
javax.imageio.ImageIO
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.binary.Base64
;
import
org.glassfish.jersey.media.multipart.FormDataContentDisposition
;
import
org.imgscalr.Scalr
;
...
...
@@ -45,7 +46,7 @@ class ActionSetIcon extends BaseAction {
portal
.
setIcon
(
icon
);
emc
.
commit
();
Wo
wo
=
new
Wo
();
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
wo
.
setId
(
portal
.
getId
());
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/portal/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -11,18 +11,16 @@ import javax.persistence.criteria.Root;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Portal_
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
static
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
Portal
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Portal
.
class
);
void
checkName
(
Business
business
,
Portal
portal
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
portal
.
getName
()))
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionCreate.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,7 +9,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -38,7 +38,7 @@ class ActionCreate extends BaseAction {
this
.
checkDepend
(
business
,
script
);
emc
.
persist
(
script
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
Script
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
script
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,12 +8,12 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
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.WrapBoolean
;
...
...
@@ -44,7 +44,7 @@ class ActionDelete extends BaseAction {
this
.
checkDepended
(
business
,
script
);
emc
.
remove
(
script
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
Script
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,7 +9,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -44,7 +44,7 @@ class ActionEdit extends BaseAction {
this
.
checkDepend
(
business
,
script
);
emc
.
check
(
script
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Script
.
class
);
CacheManager
.
notify
(
Script
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
script
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
...
...
@@ -20,17 +20,17 @@ class ActionGet extends BaseAction {
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Script
script
=
emc
.
find
(
id
,
Script
.
class
);
if
(
null
==
script
)
{
throw
new
ScriptNotExistedException
(
id
);
}
wo
=
Wo
.
copier
.
copy
(
script
);
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
Portal
portal
=
emc
.
find
(
wo
.
getPortal
(),
Portal
.
class
);
if
(
null
==
portal
)
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/script/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,17 +2,15 @@ package com.x.portal.assemble.designer.jaxrs.script;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
static
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
Script
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Script
.
class
);
void
checkName
(
Business
business
,
Script
script
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
script
.
getName
()))
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/templatepage/ActionCreate.java
浏览文件 @
8aa9f3cb
...
...
@@ -9,7 +9,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
...
...
@@ -35,7 +35,7 @@ class ActionCreate extends BaseAction {
emc
.
beginTransaction
(
TemplatePage
.
class
);
emc
.
persist
(
o
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
TemplatePage
.
class
);
CacheManager
.
notify
(
TemplatePage
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
o
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/templatepage/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -3,7 +3,7 @@ package com.x.portal.assemble.designer.jaxrs.templatepage;
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.cache.
CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
...
...
@@ -26,7 +26,7 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
TemplatePage
.
class
);
emc
.
remove
(
o
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
TemplatePage
.
class
);
CacheManager
.
notify
(
TemplatePage
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionCreate.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,7 +7,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -33,8 +33,8 @@ class ActionCreate extends BaseAction {
this
.
checkAlias
(
business
,
widget
);
emc
.
persist
(
widget
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
widget
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionDelete.java
浏览文件 @
8aa9f3cb
...
...
@@ -3,7 +3,7 @@ package com.x.portal.assemble.designer.jaxrs.widget;
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.cache.
CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -33,8 +33,8 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
Widget
.
class
);
emc
.
remove
(
widget
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionEdit.java
浏览文件 @
8aa9f3cb
...
...
@@ -7,7 +7,7 @@ import com.x.base.core.entity.JpaObject;
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.cache.
CacheManager
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
...
...
@@ -40,8 +40,8 @@ class ActionEdit extends BaseAction {
this
.
checkAlias
(
business
,
widget
);
emc
.
check
(
widget
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Widget
.
class
);
ApplicationCache
.
notify
(
Portal
.
class
);
CacheManager
.
notify
(
Widget
.
class
);
CacheManager
.
notify
(
Portal
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
widget
.
getId
());
result
.
setData
(
wo
);
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/ActionGet.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,7 +5,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.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
;
...
...
@@ -13,8 +12,9 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGet
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
...
...
@@ -22,17 +22,17 @@ class ActionGet extends BaseAction {
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Widget
widget
=
emc
.
find
(
id
,
Widget
.
class
);
if
(
null
==
widget
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Widget
.
class
);
}
wo
=
Wo
.
copier
.
copy
(
widget
);
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
Portal
portal
=
emc
.
find
(
wo
.
getPortal
(),
Portal
.
class
);
if
(
null
==
portal
)
{
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/widget/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,16 +2,14 @@ package com.x.portal.assemble.designer.jaxrs.widget;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.assemble.designer.Business
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
static
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
Widget
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Widget
.
class
);
void
checkName
(
Business
business
,
Widget
widget
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
widget
.
getName
()))
{
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/FileFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,33 +10,33 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
FileFactory
extends
AbstractFactory
{
static
Ehcache
fileCache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
public
FileFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
File
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
fileCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
File
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
File
)
optional
.
get
();
}
else
{
File
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
File
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
File
.
class
).
detach
(
o
);
fileCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/PageFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,19 +8,19 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Page_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
PageFactory
extends
AbstractFactory
{
static
Ehcache
pageCache
=
ApplicationCache
.
instance
().
getCache
(
Page
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Page
.
class
);
public
PageFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
...
...
@@ -37,15 +37,15 @@ public class PageFactory extends AbstractFactory {
}
public
Page
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Page
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Page
)
optional
.
get
();
}
else
{
Page
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Page
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Page
.
class
).
detach
(
o
);
pageCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
@@ -53,15 +53,15 @@ public class PageFactory extends AbstractFactory {
}
public
Page
pick
(
Portal
portal
,
String
flag
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
portal
.
getId
(),
flag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Page
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
portal
.
getId
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Page
)
optional
.
get
();
}
else
{
Page
o
=
entityManagerContainer
().
restrictFlag
(
flag
,
Page
.
class
,
Page
.
portal_FIELDNAME
,
portal
.
getId
());
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Page
.
class
).
detach
(
o
);
pageCache
.
put
(
new
Element
(
cacheKey
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/PortalFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,7 +8,6 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.tools.ListTools
;
...
...
@@ -16,13 +15,14 @@ import com.x.portal.assemble.surface.AbstractFactory;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Portal_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
PortalFactory
extends
AbstractFactory
{
static
Ehcache
portalCache
=
ApplicationCache
.
instance
().
getCache
(
Portal
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Portal
.
class
);
public
PortalFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
...
...
@@ -78,15 +78,15 @@ public class PortalFactory extends AbstractFactory {
}
public
Portal
pick
(
String
flag
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
flag
);
Element
element
=
portalCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Portal
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Portal
)
optional
.
get
();
}
else
{
Portal
o
=
this
.
business
().
entityManagerContainer
().
flag
(
flag
,
Portal
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Portal
.
class
).
detach
(
o
);
portalCache
.
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/ScriptFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,29 +10,29 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Script
;
import
com.x.portal.core.entity.Script_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
ScriptFactory
extends
AbstractFactory
{
static
Ehcache
scriptCache
=
ApplicationCache
.
instance
().
getCache
(
Script
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Script
.
class
);
public
ScriptFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
Script
flagWithPortalObject
(
String
flag
,
String
portalId
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
"flagObject"
,
flag
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Script
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
"flagObject"
,
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Script
)
optional
.
get
();
}
else
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Script
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -46,22 +46,22 @@ public class ScriptFactory extends AbstractFactory {
}
else
{
Script
o
=
list
.
get
(
0
);
em
.
detach
(
o
);
scriptCache
.
put
(
new
Element
(
cacheKey
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
}
}
public
Script
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Script
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Script
)
optional
.
get
();
}
else
{
Script
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Script
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Script
.
class
).
detach
(
o
);
scriptCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
@@ -81,10 +81,10 @@ public class ScriptFactory extends AbstractFactory {
@SuppressWarnings
(
"unchecked"
)
public
List
<
Script
>
listScriptNestedWithPortalWithFlag
(
Portal
portal
,
String
flag
)
throws
Exception
{
List
<
Script
>
list
=
new
ArrayList
<>();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
flag
,
portal
.
getId
(),
"listScriptNestedWithPortalWithFlag"
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
list
=
(
List
<
Script
>)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
flag
,
portal
.
getId
(),
"listScriptNestedWithPortalWithFlag"
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
list
=
(
List
<
Script
>)
optional
.
get
();
}
else
{
List
<
String
>
names
=
new
ArrayList
<>();
names
.
add
(
flag
);
...
...
@@ -101,7 +101,7 @@ public class ScriptFactory extends AbstractFactory {
}
if
(!
list
.
isEmpty
())
{
Collections
.
reverse
(
list
);
scriptCache
.
put
(
new
Element
(
cacheKey
,
list
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
list
);
}
}
return
list
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/factory/WidgetFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,33 +8,33 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Widget
;
import
com.x.portal.core.entity.Widget_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
WidgetFactory
extends
AbstractFactory
{
static
Ehcache
menuCache
=
ApplicationCache
.
instance
().
getCache
(
Widget
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Widget
.
class
);
public
WidgetFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
Widget
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
menuCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Widget
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Widget
)
optional
.
get
();
}
else
{
Widget
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Widget
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Widget
.
class
).
detach
(
o
);
menuCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java
浏览文件 @
8aa9f3cb
...
...
@@ -23,22 +23,23 @@ import com.x.portal.assemble.surface.Business;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionContent
extends
StandardJaxrsAction
{
private
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
private
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
portalFlag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
((
Wo
)
optional
.
get
());
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalFlag
);
...
...
@@ -56,7 +57,7 @@ class ActionContent extends StandardJaxrsAction {
}
wo
=
new
Wo
(
bs
,
this
.
contentType
(
false
,
file
.
getFileName
()),
this
.
contentDisposition
(
false
,
file
.
getFileName
()));
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java
浏览文件 @
8aa9f3cb
...
...
@@ -13,7 +13,6 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -23,22 +22,23 @@ import com.x.portal.assemble.surface.Business;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionDownload
extends
StandardJaxrsAction
{
private
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
private
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
portalFlag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
((
Wo
)
optional
.
get
());
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalFlag
);
...
...
@@ -56,7 +56,7 @@ class ActionDownload extends StandardJaxrsAction {
}
wo
=
new
Wo
(
bs
,
this
.
contentType
(
true
,
file
.
getFileName
()),
this
.
contentDisposition
(
true
,
file
.
getFileName
()));
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,15 +5,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortal
extends
BaseAction
{
...
...
@@ -22,10 +22,10 @@ class ActionGetWithPortal extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
pageCache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(
isNotLoginPage
(
flag
)
&&
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
)))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -46,7 +46,7 @@ class ActionGetWithPortal extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
page
);
wo
.
setData
(
page
.
getDataOrMobileData
());
pageCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
pageCache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,15 +5,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortalMobile
extends
BaseAction
{
...
...
@@ -22,10 +22,10 @@ class ActionGetWithPortalMobile extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
pageCache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(
isNotLoginPage
(
flag
)
&&
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
)))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -43,7 +43,7 @@ class ActionGetWithPortalMobile extends BaseAction {
Page
page
=
business
.
page
().
pick
(
portal
,
flag
);
wo
=
Wo
.
copier
.
copy
(
page
);
wo
.
setData
(
page
.
getMobileDataOrData
());
pageCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
pageCache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,16 +2,14 @@ package com.x.portal.assemble.surface.jaxrs.page;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Page
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
pageCache
=
ApplicationCache
.
instance
().
getCache
(
Page
.
class
);
CacheCategory
pageCache
=
new
CacheCategory
(
Page
.
class
);
protected
boolean
isNotLoginPage
(
String
id
)
throws
Exception
{
return
!(
Config
.
portal
().
getIndexPage
().
getEnable
()
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,15 +10,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetImported
extends
BaseAction
{
...
...
@@ -26,10 +26,10 @@ class ActionGetImported extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalId
);
Element
element
=
CACHE
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalId
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalId
);
...
...
@@ -59,7 +59,7 @@ class ActionGetImported extends BaseAction {
}
wo
.
setImportedList
(
imported
);
wo
.
setText
(
buffer
.
toString
());
C
ACHE
.
put
(
new
Element
(
cacheKey
,
wo
)
);
C
acheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.surface.jaxrs.script
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
Ehcache
CACHE
=
ApplicationCache
.
instance
().
getCache
(
Script
.
class
);
protected
CacheCategory
cache
=
new
CacheCategory
(
Script
.
class
);
}
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortal
extends
BaseAction
{
...
...
@@ -21,10 +21,10 @@ class ActionGetWithPortal extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
widgetCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -45,7 +45,7 @@ class ActionGetWithPortal extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
widget
);
wo
.
setData
(
widget
.
getDataOrMobileData
());
widgetCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortalMobile
extends
BaseAction
{
...
...
@@ -21,10 +21,10 @@ class ActionGetWithPortalMobile extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
widgetCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -45,7 +45,7 @@ class ActionGetWithPortalMobile extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
widget
);
wo
.
setData
(
widget
.
getMobileDataOrData
());
widgetCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.surface.jaxrs.widget
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
widgetCache
=
ApplicationCache
.
instance
().
getCache
(
Widget
.
class
);
CacheCategory
cache
=
new
CacheCategory
(
Widget
.
class
);
}
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/FileFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,33 +10,33 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
FileFactory
extends
AbstractFactory
{
static
Ehcache
fileCache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
public
FileFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
File
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
fileCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
File
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
File
)
optional
.
get
();
}
else
{
File
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
File
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
File
.
class
).
detach
(
o
);
fileCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PageFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,19 +8,19 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Page_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
PageFactory
extends
AbstractFactory
{
static
Ehcache
pageCache
=
ApplicationCache
.
instance
().
getCache
(
Page
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Page
.
class
);
public
PageFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
...
...
@@ -37,15 +37,15 @@ public class PageFactory extends AbstractFactory {
}
public
Page
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Page
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Page
)
optional
.
get
();
}
else
{
Page
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Page
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Page
.
class
).
detach
(
o
);
pageCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
@@ -53,15 +53,15 @@ public class PageFactory extends AbstractFactory {
}
public
Page
pick
(
Portal
portal
,
String
flag
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
portal
.
getId
(),
flag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Page
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
portal
.
getId
(),
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Page
)
optional
.
get
();
}
else
{
Page
o
=
entityManagerContainer
().
restrictFlag
(
flag
,
Page
.
class
,
Page
.
portal_FIELDNAME
,
portal
.
getId
());
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Page
.
class
).
detach
(
o
);
pageCache
.
put
(
new
Element
(
cacheKey
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/PortalFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,7 +8,6 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.tools.ListTools
;
...
...
@@ -16,13 +15,14 @@ import com.x.portal.assemble.surface.AbstractFactory;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Portal_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
PortalFactory
extends
AbstractFactory
{
static
Ehcache
portalCache
=
ApplicationCache
.
instance
().
getCache
(
Portal
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Portal
.
class
);
public
PortalFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
...
...
@@ -78,15 +78,15 @@ public class PortalFactory extends AbstractFactory {
}
public
Portal
pick
(
String
flag
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
flag
);
Element
element
=
portalCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Portal
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Portal
)
optional
.
get
();
}
else
{
Portal
o
=
this
.
business
().
entityManagerContainer
().
flag
(
flag
,
Portal
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Portal
.
class
).
detach
(
o
);
portalCache
.
put
(
new
Element
(
flag
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/ScriptFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,29 +10,29 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Script
;
import
com.x.portal.core.entity.Script_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
ScriptFactory
extends
AbstractFactory
{
static
Ehcache
scriptCache
=
ApplicationCache
.
instance
().
getCache
(
Script
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Script
.
class
);
public
ScriptFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
Script
flagWithPortalObject
(
String
flag
,
String
portalId
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
"flagObject"
,
flag
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Script
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
"flagObject"
,
flag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Script
)
optional
.
get
();
}
else
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Script
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -46,22 +46,22 @@ public class ScriptFactory extends AbstractFactory {
}
else
{
Script
o
=
list
.
get
(
0
);
em
.
detach
(
o
);
scriptCache
.
put
(
new
Element
(
cacheKey
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
}
}
public
Script
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Script
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Script
)
optional
.
get
();
}
else
{
Script
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Script
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Script
.
class
).
detach
(
o
);
scriptCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
@@ -81,10 +81,10 @@ public class ScriptFactory extends AbstractFactory {
@SuppressWarnings
(
"unchecked"
)
public
List
<
Script
>
listScriptNestedWithPortalWithFlag
(
Portal
portal
,
String
flag
)
throws
Exception
{
List
<
Script
>
list
=
new
ArrayList
<>();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
flag
,
portal
.
getId
(),
"listScriptNestedWithPortalWithFlag"
);
Element
element
=
scriptCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
list
=
(
List
<
Script
>)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
flag
,
portal
.
getId
(),
"listScriptNestedWithPortalWithFlag"
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
list
=
(
List
<
Script
>)
optional
.
get
();
}
else
{
List
<
String
>
names
=
new
ArrayList
<>();
names
.
add
(
flag
);
...
...
@@ -101,7 +101,7 @@ public class ScriptFactory extends AbstractFactory {
}
if
(!
list
.
isEmpty
())
{
Collections
.
reverse
(
list
);
scriptCache
.
put
(
new
Element
(
cacheKey
,
list
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
list
);
}
}
return
list
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/factory/WidgetFactory.java
浏览文件 @
8aa9f3cb
...
...
@@ -8,33 +8,33 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.portal.assemble.surface.AbstractFactory
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Widget
;
import
com.x.portal.core.entity.Widget_
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
public
class
WidgetFactory
extends
AbstractFactory
{
static
Ehcache
menuCache
=
ApplicationCache
.
instance
().
getCache
(
Widget
.
class
);
static
CacheCategory
cache
=
new
CacheCategory
(
Widget
.
class
);
public
WidgetFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
Widget
pick
(
String
id
)
throws
Exception
{
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
id
);
Element
element
=
menuCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
return
(
Widget
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
id
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
return
(
Widget
)
optional
.
get
();
}
else
{
Widget
o
=
this
.
business
().
entityManagerContainer
().
find
(
id
,
Widget
.
class
);
if
(
null
!=
o
)
{
this
.
business
().
entityManagerContainer
().
get
(
Widget
.
class
).
detach
(
o
);
menuCache
.
put
(
new
Element
(
id
,
o
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
o
);
return
o
;
}
return
null
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionContent.java
浏览文件 @
8aa9f3cb
...
...
@@ -23,22 +23,23 @@ import com.x.portal.assemble.surface.Business;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionContent
extends
StandardJaxrsAction
{
private
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
private
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
portalFlag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
((
Wo
)
optional
.
get
());
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalFlag
);
...
...
@@ -56,7 +57,7 @@ class ActionContent extends StandardJaxrsAction {
}
wo
=
new
Wo
(
bs
,
this
.
contentType
(
false
,
file
.
getFileName
()),
this
.
contentDisposition
(
false
,
file
.
getFileName
()));
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/file/ActionDownload.java
浏览文件 @
8aa9f3cb
...
...
@@ -13,7 +13,6 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -23,22 +22,23 @@ import com.x.portal.assemble.surface.Business;
import
com.x.portal.core.entity.File
;
import
com.x.portal.core.entity.File_
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionDownload
extends
StandardJaxrsAction
{
private
Ehcache
cache
=
ApplicationCache
.
instance
().
getCache
(
File
.
class
);
private
CacheCategory
cache
=
new
CacheCategory
(
File
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
portalFlag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
null
;
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
((
Wo
)
element
.
getObjectValue
());
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
((
Wo
)
optional
.
get
());
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalFlag
);
...
...
@@ -56,7 +56,7 @@ class ActionDownload extends StandardJaxrsAction {
}
wo
=
new
Wo
(
bs
,
this
.
contentType
(
true
,
file
.
getFileName
()),
this
.
contentDisposition
(
true
,
file
.
getFileName
()));
cache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortal.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,15 +5,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortal
extends
BaseAction
{
...
...
@@ -22,10 +22,10 @@ class ActionGetWithPortal extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
pageCache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(
isNotLoginPage
(
flag
)
&&
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
)))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -46,7 +46,7 @@ class ActionGetWithPortal extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
page
);
wo
.
setData
(
page
.
getDataOrMobileData
());
pageCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
pageCache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/ActionGetWithPortalMobile.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,15 +5,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Page
;
import
com.x.portal.core.entity.Portal
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortalMobile
extends
BaseAction
{
...
...
@@ -22,10 +22,10 @@ class ActionGetWithPortalMobile extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
pageCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
pageCache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(
isNotLoginPage
(
flag
)
&&
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
)))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -43,7 +43,7 @@ class ActionGetWithPortalMobile extends BaseAction {
Page
page
=
business
.
page
().
pick
(
portal
,
flag
);
wo
=
Wo
.
copier
.
copy
(
page
);
wo
.
setData
(
page
.
getMobileDataOrData
());
pageCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
pageCache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/page/BaseAction.java
浏览文件 @
8aa9f3cb
...
...
@@ -2,16 +2,14 @@ package com.x.portal.assemble.surface.jaxrs.page;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Page
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
pageCache
=
ApplicationCache
.
instance
().
getCache
(
Page
.
class
);
CacheCategory
pageCache
=
new
CacheCategory
(
Page
.
class
);
protected
boolean
isNotLoginPage
(
String
id
)
throws
Exception
{
return
!(
Config
.
portal
().
getIndexPage
().
getEnable
()
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/ActionGetImported.java
浏览文件 @
8aa9f3cb
...
...
@@ -10,15 +10,15 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetImported
extends
BaseAction
{
...
...
@@ -26,10 +26,10 @@ class ActionGetImported extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalId
);
Element
element
=
CACHE
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalId
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
}
else
{
Business
business
=
new
Business
(
emc
);
Portal
portal
=
business
.
portal
().
pick
(
portalId
);
...
...
@@ -59,7 +59,7 @@ class ActionGetImported extends BaseAction {
}
wo
.
setImportedList
(
imported
);
wo
.
setText
(
buffer
.
toString
());
C
ACHE
.
put
(
new
Element
(
cacheKey
,
wo
)
);
C
acheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/script/BaseAction.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.surface.jaxrs.script
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Script
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
Ehcache
CACHE
=
ApplicationCache
.
instance
().
getCache
(
Script
.
class
);
protected
CacheCategory
cache
=
new
CacheCategory
(
Script
.
class
);
}
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortal.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortal
extends
BaseAction
{
...
...
@@ -21,10 +21,10 @@ class ActionGetWithPortal extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
widgetCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -45,7 +45,7 @@ class ActionGetWithPortal extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
widget
);
wo
.
setData
(
widget
.
getDataOrMobileData
());
widgetCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/ActionGetWithPortalMobile.java
浏览文件 @
8aa9f3cb
...
...
@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.portal.assemble.surface.Business
;
import
com.x.portal.core.entity.Portal
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Element
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionGetWithPortalMobile
extends
BaseAction
{
...
...
@@ -21,10 +21,10 @@ class ActionGetWithPortalMobile extends BaseAction {
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concrete
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Element
element
=
widgetCache
.
get
(
cacheKey
);
if
(
(
null
!=
element
)
&&
(
null
!=
element
.
getObjectValue
()
))
{
wo
=
(
Wo
)
element
.
getObjectValue
();
CacheKey
cacheKey
=
new
CacheKey
(
this
.
getClass
(),
flag
,
portalFlag
);
Optional
<?>
optional
=
CacheManager
.
get
(
cache
,
cacheKey
);
if
(
optional
.
isPresent
(
))
{
wo
=
(
Wo
)
optional
.
get
();
Portal
portal
=
business
.
portal
().
pick
(
wo
.
getPortal
());
if
(!
business
.
portal
().
visible
(
effectivePerson
,
portal
))
{
throw
new
ExceptionPortalAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
portal
.
getName
(),
...
...
@@ -45,7 +45,7 @@ class ActionGetWithPortalMobile extends BaseAction {
}
wo
=
Wo
.
copier
.
copy
(
widget
);
wo
.
setData
(
widget
.
getMobileDataOrData
());
widgetCache
.
put
(
new
Element
(
cacheKey
,
wo
)
);
CacheManager
.
put
(
cache
,
cacheKey
,
wo
);
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/jaxrs/widget/BaseAction.java
浏览文件 @
8aa9f3cb
package
com.x.portal.assemble.surface.jaxrs.widget
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.portal.core.entity.Widget
;
import
net.sf.ehcache.Ehcache
;
import
com.x.base.core.project.cache.Cache.CacheCategory
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
widgetCache
=
ApplicationCache
.
instance
().
getCache
(
Widget
.
class
);
CacheCategory
cache
=
new
CacheCategory
(
Widget
.
class
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录