diff --git a/entity/RoleChildren_entity/RoleChildren_entity.aod b/entity/RoleChildren_entity/RoleChildren_entity.aod index e550842296eba583514dbf4bf140d450da75649d..78d1c42ce37696577d1a50d3388f4f22ea0ab274 100644 --- a/entity/RoleChildren_entity/RoleChildren_entity.aod +++ b/entity/RoleChildren_entity/RoleChildren_entity.aod @@ -2,7 +2,7 @@ <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.13" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.13"> <name>RoleChildren_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <title>Child</title> + <title>Child Role</title> <titlePlural>Child Roles</titlePlural> <recordContainer>jDito</recordContainer> <entityFields> diff --git a/entity/RoleParent_entity/RoleParent_entity.aod b/entity/RoleParent_entity/RoleParent_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..6bc86d355c097d65885306a4496fa6771cb66266 --- /dev/null +++ b/entity/RoleParent_entity/RoleParent_entity.aod @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.13" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.13"> + <name>RoleParent_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <title>Parent Role</title> + <titlePlural>Parent Roles</titlePlural> + <recordContainer>jDito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>UID</name> + </entityField> + <entityField> + <name>CHILD_ROLE</name> + </entityField> + <entityField> + <name>PARENT_ROLE</name> + </entityField> + <entityConsumer> + <name>Roles</name> + <dependency> + <name>dependency</name> + <entityName>Role_entity</entityName> + <fieldName>Roles</fieldName> + </dependency> + </entityConsumer> + <entityProvider> + <name>RoleParents</name> + <recordContainer>jDito</recordContainer> + <dependencies> + <entityDependency> + <name>6aa59dd4-1193-47be-8b69-58c82a0d9daa</name> + <entityName>Role_entity</entityName> + <fieldName>RoleParents</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + <entityParameter> + <name>RoleId_param</name> + <expose v="true" /> + </entityParameter> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jDito</name> + <jDitoRecordAlias>_____SYSTEMALIAS</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/RoleParent_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFieldMappings> + <jDitoRecordFieldMapping> + <name>UID.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>CHILD_ROLE.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>PARENT_ROLE.value</name> + </jDitoRecordFieldMapping> + </recordFieldMappings> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/RoleParent_entity/recordcontainers/jdito/contentProcess.js b/entity/RoleParent_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..69fc6b4cdf5bb49a7ab1677ee3b06162e2d1de8b --- /dev/null +++ b/entity/RoleParent_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,31 @@ +import("Sql_lib"); +import("system.db"); +import("system.vars"); +import("system.result"); +import("system.util"); + +var alias = SqlUtils.getSystemAlias(); +var selectedRoleName = vars.exists("$param.RoleId_param") && vars.get("$param.RoleId_param"); +var parents = []; + +var parentRoles = newSelect("ID, PARENT_ROLE", alias) +.from("ASYS_ROLES_CHILDREN") +.where("ASYS_ROLES_CHILDREN.CHILD_ROLE", selectedRoleName) +.table(); + +for each (let parentRole in parentRoles) { + parents.push([parentRole[0], selectedRoleName, parentRole[1]]); +} + +var ids = vars.get("$local.idvalues"); +if (ids != null) { + parents = parents.filter(function(child) { + for (let i = 0; i < ids.length; i++) { + if (child[0] == ids[i]) + return true; + } + return false; + }); +} + +result.object(parents); \ No newline at end of file diff --git a/entity/Role_entity/Role_entity.aod b/entity/Role_entity/Role_entity.aod index 7011adb0597366b42f07eb313d1bd73ec9376fba..023fd014ccb6b8ef5a39cc45578e2db06a052002 100644 --- a/entity/Role_entity/Role_entity.aod +++ b/entity/Role_entity/Role_entity.aod @@ -83,6 +83,12 @@ <fieldName>Roles</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>23ceb9b3-429c-4381-9ae2-bd23d9d08d42</name> + <entityName>RoleParent_entity</entityName> + <fieldName>Roles</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -145,6 +151,20 @@ <onActionProcess>%aditoprj%/entity/Role_entity/entityfields/deleteeverythinglinkedtorole/onActionProcess.js</onActionProcess> <iconId>VAADIN:CLOSE</iconId> </entityActionField> + <entityConsumer> + <name>RoleParents</name> + <dependency> + <name>dependency</name> + <entityName>RoleParent_entity</entityName> + <fieldName>RoleParents</fieldName> + </dependency> + <children> + <entityParameter> + <name>RoleId_param</name> + <valueProcess>%aditoprj%/entity/Role_entity/entityfields/roleparents/children/roleid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Role_entity/entityfields/roleparents/children/roleid_param/valueProcess.js b/entity/Role_entity/entityfields/roleparents/children/roleid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f1e485c836fb79efb9dcae64c34a89a7432a4d7a --- /dev/null +++ b/entity/Role_entity/entityfields/roleparents/children/roleid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$field.ROLENAME")); \ No newline at end of file diff --git a/neonContext/RoleParent/RoleParent.aod b/neonContext/RoleParent/RoleParent.aod new file mode 100644 index 0000000000000000000000000000000000000000..3745dca840e9ed3de8ced23fd200ecd5c00e9ac9 --- /dev/null +++ b/neonContext/RoleParent/RoleParent.aod @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> + <name>RoleParent</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>RoleParent_entity</entity> + <references> + <neonViewReference> + <name>41ee2c63-4408-4aba-bc22-75465fc94c47</name> + <view>RoleParentList_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/RoleParentList_view/RoleParentList_view.aod b/neonView/RoleParentList_view/RoleParentList_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..c7aba2fb60ee79c5d38cdf87b53fbd96b60e8ead --- /dev/null +++ b/neonView/RoleParentList_view/RoleParentList_view.aod @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.4"> + <name>RoleParentList_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <titledListViewTemplate> + <name>TitledList</name> + <entityField>#ENTITY</entityField> + <isDeletable v="false" /> + <isEditable v="false" /> + <isCreatable v="false" /> + <columns> + <neonTitledListTableColumn> + <name>cdc83256-2ea4-4a97-a323-b400a4037915</name> + <entityField>PARENT_ROLE</entityField> + </neonTitledListTableColumn> + </columns> + </titledListViewTemplate> + </children> +</neonView> diff --git a/neonView/RolePreview_view/RolePreview_view.aod b/neonView/RolePreview_view/RolePreview_view.aod index b8c3a44f1fce81c15471d899a844de05e7f63f8b..20d727f478e587ffe3e61082bb4bab0784e78aa6 100644 --- a/neonView/RolePreview_view/RolePreview_view.aod +++ b/neonView/RolePreview_view/RolePreview_view.aod @@ -32,5 +32,10 @@ <entityField>RoleChildrens</entityField> <view>RoleChildrenList_view</view> </neonViewReference> + <neonViewReference> + <name>c13ad88f-679d-4cd5-a7ce-747d43ff7629</name> + <entityField>RoleParents</entityField> + <view>RoleParentList_view</view> + </neonViewReference> </children> </neonView>