Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laurel Lee
O2OA
Commits
fc8ba610
Commit
fc8ba610
authored
3 years ago
by
Ray
Committed by
o2null
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
update resource name
(cherry picked from commit
5776d09c
)
parent
4a2e3aa8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
o2server/configSample/person.json
+1
-1
o2server/configSample/person.json
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
+7
-7
...a/com/x/base/core/project/scripting/ScriptingFactory.java
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
+10
-3
...ganization/assemble/personal/jaxrs/person/ActionEdit.java
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/agent/ActionExecute.java
+1
-1
.../java/com/x/program/center/jaxrs/agent/ActionExecute.java
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/invoke/BaseAction.java
+5
-5
...in/java/com/x/program/center/jaxrs/invoke/BaseAction.java
o2server/x_program_center/src/main/java/com/x/program/center/schedule/TriggerAgent.java
+91
-77
...main/java/com/x/program/center/schedule/TriggerAgent.java
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
+3
-3
...uery/assemble/designer/jaxrs/statement/ActionExecute.java
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecuteV2.java
+3
-3
...ry/assemble/designer/jaxrs/statement/ActionExecuteV2.java
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionExecute.java
+3
-3
...query/assemble/surface/jaxrs/statement/ActionExecute.java
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionExecuteV2.java
+3
-3
...ery/assemble/surface/jaxrs/statement/ActionExecuteV2.java
with
127 additions
and
106 deletions
+127
-106
o2server/configSample/person.json
+
1
-
1
View file @
fc8ba610
...
...
@@ -20,7 +20,7 @@
"###bindLogin"
:
"是否启用扫描二维码登录,默认值:false###"
,
"###faceLogin"
:
"是否启用刷脸登录,默认值:false###"
,
"###password"
:
"注册初始密码,使用()调用脚本生成初始密码,默认为:(var v
\\
u003d person.getMobile();
\\
u000a return v.substring(v.length - 6))###"
,
"###passwordPeriod"
:
"密码过期时间(天),0表示不过期,默认值:0.###"
,
"###passwordPeriod"
:
"密码过期时间(天),0表示不过期
(只对新用户有效),-1表示永不过期(对所有用户有效)
,默认值:0.###"
,
"###passwordRegex"
:
"密码校验正则表达式,默认6位以上,包含数字和字母.###"
,
"###passwordRegexHint"
:
"密码校验不通过的提示信息.###"
,
"###register"
:
"是否允许用户自注册,disable:不允许,captcha通过验证码注册,code:通过短信注册,默认值:disable###"
,
...
...
This diff is collapsed.
Click to expand it.
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
+
7
-
7
View file @
fc8ba610
...
...
@@ -32,7 +32,7 @@ public class ScriptingFactory {
public
static
final
String
BINDING_NAME_WORKCONTEXT
=
"workContext"
;
public
static
final
String
BINDING_NAME_GSON
=
"gson"
;
public
static
final
String
BINDING_NAME_GSON
1
=
"gson"
;
public
static
final
String
BINDING_NAME_DATA
=
"data"
;
public
static
final
String
BINDING_NAME_ORGANIZATION
=
"organization"
;
public
static
final
String
BINDING_NAME_WEBSERVICESCLIENT
=
"webservicesClient"
;
...
...
@@ -58,12 +58,12 @@ public class ScriptingFactory {
public
static
final
String
BINDING_NAME_RESOURCES
=
"java_resources"
;
public
static
final
String
BINDING_NAME_EFFECTIVEPERSON
=
"java_effectivePerson"
;
public
static
final
String
BINDING_NAME_CUSTOMRESPONSE
=
"java_customResponse"
;
public
static
final
String
BINDING_NAME_REQUESTTEXT
=
"java_requestText"
;
public
static
final
String
BINDING_NAME_REQUEST
=
"java_request"
;
public
static
final
String
BINDING_NAME_PARAMETERS
=
"java_parameters"
;
public
static
final
String
BINDING_NAME_
SERVICE_
RESOURCES
=
"java_resources"
;
public
static
final
String
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
=
"java_effectivePerson"
;
public
static
final
String
BINDING_NAME_
SERVICE_
CUSTOMRESPONSE
=
"java_customResponse"
;
public
static
final
String
BINDING_NAME_
SERVICE_
REQUESTTEXT
=
"java_requestText"
;
public
static
final
String
BINDING_NAME_
SERVICE_
REQUEST
=
"java_request"
;
public
static
final
String
BINDING_NAME_
SERVICE_
PARAMETERS
=
"java_parameters"
;
public
static
ScriptEngine
newScriptEngine
()
{
return
(
new
ScriptEngineManager
()).
getEngineByName
(
Config
.
SCRIPTING_ENGINE_NAME
);
...
...
This diff is collapsed.
Click to expand it.
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionEdit.java
+
10
-
3
View file @
fc8ba610
...
...
@@ -61,10 +61,17 @@ class ActionEdit extends BaseAction {
private
static
final
long
serialVersionUID
=
1571810726944802231L
;
// static WrapCopier<Wi, Person> copier = WrapCopierFactory.wi(Wi.class, Person.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, "icon", "iconMdpi", "iconLdpi", "pinyin", "pinyinInitial",
// "password", "passwordExpiredTime", "lastLoginTime", "lastLoginAddress", "lastLoginClient",
// "superior", "controllerList"));
static
WrapCopier
<
Wi
,
Person
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Person
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
"icon"
,
"iconMdpi"
,
"iconLdpi"
,
"pinyin"
,
"pinyinInitial"
,
"password"
,
"passwordExpiredTime"
,
"lastLoginTime"
,
"lastLoginAddress"
,
"lastLoginClient"
,
"superior"
,
"controllerList"
));
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Person
.
icon_FIELDNAME
,
Person
.
iconMdpi_FIELDNAME
,
Person
.
iconLdpi_FIELDNAME
,
Person
.
pinyin_FIELDNAME
,
Person
.
pinyinInitial_FIELDNAME
,
Person
.
password_FIELDNAME
,
Person
.
passwordExpiredTime_FIELDNAME
,
Person
.
lastLoginTime_FIELDNAME
,
Person
.
lastLoginAddress_FIELDNAME
,
Person
.
lastLoginClient_FIELDNAME
,
Person
.
superior_FIELDNAME
,
Person
.
controllerList_FIELDNAME
,
Person
.
ipAddress_FIELDNAME
));
}
public
static
class
Wo
extends
WoId
{
...
...
This diff is collapsed.
Click to expand it.
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/agent/ActionExecute.java
+
1
-
1
View file @
fc8ba610
...
...
@@ -62,7 +62,7 @@ class ActionExecute extends BaseAction {
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
resources
.
setApplications
(
ThisApplication
.
context
().
applications
());
resources
.
setWebservicesClient
(
new
WebservicesClient
());
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
CacheCategory
cacheCategory
=
new
CacheCategory
(
Agent
.
class
);
CacheKey
cacheKey
=
new
CacheKey
(
ActionExecute
.
class
,
agent
.
getId
());
...
...
This diff is collapsed.
Click to expand it.
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/invoke/BaseAction.java
+
5
-
5
View file @
fc8ba610
...
...
@@ -93,11 +93,11 @@ abstract class BaseAction extends StandardJaxrsAction {
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setApplications
(
ThisApplication
.
context
().
applications
());
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_REQUESTTEXT
,
gson
.
toJson
(
jsonElement
));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_REQUEST
,
request
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_CUSTOMRESPONSE
,
customResponse
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
REQUESTTEXT
,
gson
.
toJson
(
jsonElement
));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
REQUEST
,
request
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
CUSTOMRESPONSE
,
customResponse
);
}
protected
CompiledScript
getCompiledScript
(
CacheCategory
cacheCategory
,
Invoke
invoke
)
throws
ScriptException
{
...
...
This diff is collapsed.
Click to expand it.
o2server/x_program_center/src/main/java/com/x/program/center/schedule/TriggerAgent.java
+
91
-
77
View file @
fc8ba610
package
com.x.program.center.schedule
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.stream.Collectors
;
...
...
@@ -17,31 +20,30 @@ import javax.persistence.criteria.Root;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.config.CenterServer
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.connection.ActionResponse
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.exception.RunningException
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.tools.ListTools
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
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.cache.Cache.CacheCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.CenterServer
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.connection.ActionResponse
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.AbstractResources
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.CronTools
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.webservices.WebservicesClient
;
import
com.x.organization.core.express.Organization
;
import
com.x.program.center.Business
;
...
...
@@ -51,6 +53,7 @@ import com.x.program.center.core.entity.Agent_;
/**
* 定时代理任务处理
*
* @author sword
*/
public
class
TriggerAgent
extends
BaseAction
{
...
...
@@ -59,7 +62,8 @@ public class TriggerAgent extends BaseAction {
private
static
final
CopyOnWriteArrayList
<
String
>
LOCK
=
new
CopyOnWriteArrayList
<>();
private
static
final
ExecutorService
executorService
=
new
ScheduledThreadPoolExecutor
(
Runtime
.
getRuntime
().
availableProcessors
(),
private
static
final
ExecutorService
executorService
=
new
ScheduledThreadPoolExecutor
(
Runtime
.
getRuntime
().
availableProcessors
(),
new
BasicThreadFactory
.
Builder
().
namingPattern
(
"triggerAgent-pool-%d"
).
daemon
(
true
).
build
());
@Override
...
...
@@ -71,10 +75,8 @@ public class TriggerAgent extends BaseAction {
Business
business
=
new
Business
(
emc
);
list
=
this
.
list
(
business
);
}
if
(
list
!=
null
)
{
list
.
stream
().
forEach
(
p
->
{
this
.
trigger
(
p
);
});
if
(
list
!=
null
)
{
list
.
stream
().
forEach
(
this
::
trigger
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -122,20 +124,18 @@ public class TriggerAgent extends BaseAction {
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Tuple
>
cq
=
cb
.
createQuery
(
Tuple
.
class
);
Root
<
Agent
>
root
=
cq
.
from
(
Agent
.
class
);
Path
<
String
>
path
_i
d
=
root
.
get
(
Agent_
.
id
);
Path
<
String
>
path
_n
ame
=
root
.
get
(
Agent_
.
name
);
Path
<
String
>
path
_c
ron
=
root
.
get
(
Agent_
.
cron
);
Path
<
Date
>
path
_l
astEndTime
=
root
.
get
(
Agent_
.
lastEndTime
);
Path
<
Date
>
path
_l
astStartTime
=
root
.
get
(
Agent_
.
lastStartTime
);
Path
<
String
>
path
I
d
=
root
.
get
(
Agent_
.
id
);
Path
<
String
>
path
N
ame
=
root
.
get
(
Agent_
.
name
);
Path
<
String
>
path
C
ron
=
root
.
get
(
Agent_
.
cron
);
Path
<
Date
>
path
L
astEndTime
=
root
.
get
(
Agent_
.
lastEndTime
);
Path
<
Date
>
path
L
astStartTime
=
root
.
get
(
Agent_
.
lastStartTime
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Agent_
.
enable
),
true
);
List
<
Tuple
>
list
=
em
.
createQuery
(
cq
.
multiselect
(
path_id
,
path_name
,
path_cron
,
path_lastEndTime
,
path_lastStartTime
).
where
(
p
))
.
createQuery
(
cq
.
multiselect
(
pathId
,
pathName
,
pathCron
,
pathLastEndTime
,
pathLastStartTime
).
where
(
p
))
.
getResultList
();
List
<
Pair
>
pairs
=
list
.
stream
().
map
(
o
->
{
return
new
Pair
(
o
.
get
(
path_id
),
o
.
get
(
path_name
),
o
.
get
(
path_cron
),
o
.
get
(
path_lastStartTime
));
}).
distinct
().
collect
(
Collectors
.
toList
());
return
pairs
;
return
list
.
stream
()
.
map
(
o
->
new
Pair
(
o
.
get
(
pathId
),
o
.
get
(
pathName
),
o
.
get
(
pathCron
),
o
.
get
(
pathLastStartTime
)))
.
distinct
().
collect
(
Collectors
.
toList
());
}
class
Pair
{
...
...
@@ -202,62 +202,76 @@ public class TriggerAgent extends BaseAction {
try
{
LOCK
.
add
(
agent
.
getId
());
Map
.
Entry
<
String
,
CenterServer
>
centerServer
=
getCenterServer
();
if
(
centerServer
==
null
){
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
CacheCategory
cacheCategory
=
new
CacheCategory
(
Agent
.
class
);
CacheKey
cacheKey
=
new
CacheKey
(
TriggerAgent
.
class
,
agent
.
getId
());
CompiledScript
compiledScript
=
null
;
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
())
{
compiledScript
=
(
CompiledScript
)
optional
.
get
();
}
else
{
compiledScript
=
ScriptFactory
.
compile
(
ScriptFactory
.
functionalization
(
agent
.
getText
()));
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
compiledScript
);
}
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Resources
resources
=
new
Resources
();
resources
.
setEntityManagerContainer
(
emc
);
resources
.
setContext
(
ThisApplication
.
context
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
resources
.
setApplications
(
ThisApplication
.
context
().
applications
());
resources
.
setWebservicesClient
(
new
WebservicesClient
());
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_RESOURCES
,
resources
);
try
{
ScriptFactory
.
initialServiceScriptText
().
eval
(
scriptContext
);
compiledScript
.
eval
(
scriptContext
);
}
catch
(
Exception
e
)
{
throw
new
ExceptionAgentEval
(
e
,
e
.
getMessage
(),
agent
.
getId
(),
agent
.
getName
(),
agent
.
getAlias
(),
agent
.
getText
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Agent
o
=
emc
.
find
(
agent
.
getId
(),
Agent
.
class
);
if
(
null
!=
o
)
{
emc
.
beginTransaction
(
Agent
.
class
);
o
.
setLastEndTime
(
new
Date
());
emc
.
commit
();
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
}
else
{
try
{
CipherConnectionAction
.
get
(
false
,
Config
.
url_x_program_center_jaxrs
(
centerServer
,
"agent"
,
agent
.
getId
(),
"execute"
)
+
"?tt="
+
System
.
currentTimeMillis
());
}
catch
(
Exception
e
)
{
logger
.
warn
(
"trigger agent {} on center {} error:{}"
,
agent
.
getName
(),
centerServer
.
getKey
(),
e
.
getMessage
());
}
if
(
centerServer
==
null
)
{
evalLocal
();
}
else
{
evalRemote
(
centerServer
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
finally
{
LOCK
.
remove
(
agent
.
getId
());
}
}
}
private
Map
.
Entry
<
String
,
CenterServer
>
getCenterServer
(){
private
void
evalRemote
(
Map
.
Entry
<
String
,
CenterServer
>
centerServer
)
{
try
{
CipherConnectionAction
.
get
(
false
,
Config
.
url_x_program_center_jaxrs
(
centerServer
,
"agent"
,
agent
.
getId
(),
"execute"
)
+
"?tt="
+
System
.
currentTimeMillis
());
}
catch
(
Exception
e
)
{
logger
.
warn
(
"trigger agent {} on center {} error:{}"
,
agent
.
getName
(),
centerServer
.
getKey
(),
e
.
getMessage
());
}
}
private
void
evalLocal
()
throws
Exception
{
CacheCategory
cacheCategory
=
new
CacheCategory
(
Agent
.
class
);
CacheKey
cacheKey
=
new
CacheKey
(
TriggerAgent
.
class
,
agent
.
getId
());
CompiledScript
compiledScript
=
null
;
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
())
{
compiledScript
=
(
CompiledScript
)
optional
.
get
();
}
else
{
compiledScript
=
ScriptingFactory
.
functionalizationCompile
(
agent
.
getText
());
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
compiledScript
);
}
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Resources
resources
=
new
Resources
();
resources
.
setContext
(
ThisApplication
.
context
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setApplications
(
ThisApplication
.
context
().
applications
());
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_RESOURCES
,
resources
);
eval
(
compiledScript
,
scriptContext
);
updateLastEndTime
();
}
private
void
updateLastEndTime
()
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Agent
o
=
emc
.
find
(
agent
.
getId
(),
Agent
.
class
);
if
(
null
!=
o
)
{
emc
.
beginTransaction
(
Agent
.
class
);
o
.
setLastEndTime
(
new
Date
());
emc
.
commit
();
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
}
private
void
eval
(
CompiledScript
compiledScript
,
ScriptContext
scriptContext
)
throws
ExceptionAgentEval
{
try
{
JsonScriptingExecutor
.
jsonElement
(
compiledScript
,
scriptContext
);
}
catch
(
Exception
e
)
{
throw
new
ExceptionAgentEval
(
e
,
e
.
getMessage
(),
agent
.
getId
(),
agent
.
getName
(),
agent
.
getAlias
(),
agent
.
getText
());
}
}
private
Map
.
Entry
<
String
,
CenterServer
>
getCenterServer
()
{
Map
.
Entry
<
String
,
CenterServer
>
centerServer
=
null
;
try
{
Map
.
Entry
<
String
,
CenterServer
>
entry
;
...
...
This diff is collapsed.
Click to expand it.
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
+
3
-
3
View file @
fc8ba610
...
...
@@ -164,9 +164,9 @@ class ActionExecute extends BaseAction {
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
return
scriptContext
;
}
...
...
This diff is collapsed.
Click to expand it.
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecuteV2.java
+
3
-
3
View file @
fc8ba610
...
...
@@ -234,9 +234,9 @@ class ActionExecuteV2 extends BaseAction {
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
return
scriptContext
;
}
...
...
This diff is collapsed.
Click to expand it.
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionExecute.java
+
3
-
3
View file @
fc8ba610
...
...
@@ -203,9 +203,9 @@ class ActionExecute extends BaseAction {
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
return
scriptContext
;
}
...
...
This diff is collapsed.
Click to expand it.
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionExecuteV2.java
+
3
-
3
View file @
fc8ba610
...
...
@@ -251,9 +251,9 @@ class ActionExecuteV2 extends BaseAction {
resources
.
setWebservicesClient
(
new
WebservicesClient
());
resources
.
setOrganization
(
new
Organization
(
ThisApplication
.
context
()));
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
RESOURCES
,
resources
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
EFFECTIVEPERSON
,
effectivePerson
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_
SERVICE_
PARAMETERS
,
gson
.
toJson
(
runtime
.
getParameters
()));
return
scriptContext
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment