Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
bbdcff0b
Commit
bbdcff0b
authored
4 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
360Degree_entity supports no the $local.idvalues variable
parent
210bed44
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
+35
-4
35 additions, 4 deletions
...360Degree_entity/recordcontainers/jdito/contentProcess.js
process/Context_lib/process.js
+3
-2
3 additions, 2 deletions
process/Context_lib/process.js
with
38 additions
and
6 deletions
entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
+
35
−
4
View file @
bbdcff0b
...
...
@@ -25,7 +25,12 @@ if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"
var
contextList
=
JSON
.
parse
(
vars
.
getString
(
"
$param.ObjectType_param
"
));
var
contactId
=
vars
.
get
(
"
$param.ObjectRowId_param
"
);
result
.
object
(
_get360Data
(
selectMap
,
contactId
,
contextList
,
active
));
var
idValues
;
if
(
vars
.
exists
(
"
$local.idvalues
"
))
idValues
=
vars
.
get
(
"
$local.idvalues
"
);
var
res
=
_get360Data
(
selectMap
,
contactId
,
contextList
,
active
,
idValues
);
result
.
object
(
res
);
}
else
{
...
...
@@ -38,15 +43,40 @@ else
* @param {String[]} pContactId the Contactid the 360 Degree tree should be loaded for
* @param {String[]} pContextList list of contexts to load. Note that subcontexts use their own list, defined in ContextUtils
* @param {Boolean} [pActive=undefined] if not undefined: it select only for active / inactive state
* @param {Array} [pUids=undefined] uids of the 360° entity that are used for filtering, each rowId needs the format:
* {id: "«rowid»", type: "«context id»"}
*
* @return {String[][]} the resulting data
*/
function
_get360Data
(
pSelectMap
,
pContactId
,
pContextList
,
pActive
)
function
_get360Data
(
pSelectMap
,
pContactId
,
pContextList
,
pActive
,
pUids
)
{
//if there are uids for filtering, group them per context:
var
uidContextMap
=
new
Map
();
//Map where key is the type (contextname) and value is an array of the rowIds for that type
if
(
pUids
)
{
pUids
.
forEach
(
function
(
uid
){
uid
=
JSON
.
parse
(
uid
);
if
(
uidContextMap
.
has
(
uid
.
type
))
uidContextMap
.
get
(
uid
.
type
).
push
(
uid
.
id
);
else
uidContextMap
.
set
(
uid
.
type
,
[
uid
.
id
]);
});
}
var
resultList
=
[];
pContextList
.
forEach
(
function
(
context
)
{
var
data
=
db
.
table
(
ContextUtils
.
getContextDataSql
(
context
,
JSON
.
parse
(
pContactId
),
true
,
pActive
,
true
,
true
));
var
rowIds
;
if
(
pUids
)
{
//when a Uid-filter exists, but there is no context for filtering we can skip that context,
//otherwise we need to filter for the found row ids of that context
if
(
!
uidContextMap
.
has
(
context
))
return
;
else
rowIds
=
uidContextMap
.
get
(
context
);
}
var
data
=
db
.
table
(
ContextUtils
.
getContextDataSql
(
context
,
JSON
.
parse
(
pContactId
),
true
,
pActive
,
true
,
true
,
rowIds
));
data
.
forEach
(
function
(
row
)
{
var
active
;
...
...
@@ -64,8 +94,9 @@ function _get360Data(pSelectMap, pContactId, pContextList, pActive)
if
(
groupBy
==
""
)
groupBy
=
ContextUtils
.
getEntityTitle
(
context
,
true
);
var
uid
=
JSON
.
stringify
({
id
:
row
[
0
],
type
:
context
});
resultList
.
push
([
u
til
.
getNewUUID
()
,
// UID
u
id
,
// UID
row
[
0
],
// TARGET_ID
context
,
// TARGET_CONTEXT
row
[
1
],
// TITLE
...
...
This diff is collapsed.
Click to expand it.
process/Context_lib/process.js
+
3
−
2
View file @
bbdcff0b
...
...
@@ -662,7 +662,7 @@ ContextUtils.getContactId = function(pContextId, pRowId)
* nur 360
*
*/
ContextUtils
.
getContextDataSql
=
function
(
pContextId
,
pContactId
,
pWithDate
,
pActive
,
pWithState
,
pWithGroupBy
)
ContextUtils
.
getContextDataSql
=
function
(
pContextId
,
pContactId
,
pWithDate
,
pActive
,
pWithState
,
pWithGroupBy
,
pUidsForFiltering
)
{
var
selectMap
=
ContextUtils
.
getSelectMap
();
var
ownContextSelector
=
selectMap
[
pContextId
];
...
...
@@ -689,7 +689,8 @@ ContextUtils.getContextDataSql = function(pContextId, pContactId, pWithDate, pAc
var
contextDataSelect
=
newSelect
(
columns
.
join
(
"
,
"
)
)
.
from
(
ownContextSelector
.
getFullFromClause
())
.
where
(
ownContextSelector
.
getFullField
(
ownContextSelector
.
contactIdField
),
pContactId
,
SqlBuilder
.
IN
());
.
where
(
ownContextSelector
.
getFullField
(
ownContextSelector
.
contactIdField
),
pContactId
,
SqlBuilder
.
IN
())
.
andIfSet
(
ownContextSelector
.
getFullIdField
(),
pUidsForFiltering
,
SqlBuilder
.
IN
());
if
(
pActive
!=
undefined
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment