diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index b9e852b3b2ae077b24a41200d051dad37e408a9a..c9855622f5a88df06c57b8c307adf3df0b6b88e7 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -4,7 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/AnyContact_entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/AnyContact_entity/onInit.js</onInit> + <initFilterProcess>%aditoprj%/entity/AnyContact_entity/initFilterProcess.js</initFilterProcess> <imageProcess>%aditoprj%/entity/AnyContact_entity/imageProcess.js</imageProcess> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/AnyContact_entity/initFilterProcess.js b/entity/AnyContact_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..695577262bdb7ee4519993bcaf130262075e81ca --- /dev/null +++ b/entity/AnyContact_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/AnyContact_entity/onInit.js b/entity/AnyContact_entity/onInit.js deleted file mode 100644 index a75a8d405e273b1b3e026251a305676c2ccbd9ad..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/onInit.js +++ /dev/null @@ -1,23 +0,0 @@ -import("system.neon"); -import("Keyword_lib"); -import("system.vars"); -import("KeywordRegistry_basic"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": "TEXT" -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index 82c35b3c618ecc933e74b694daa96ad9f97cbfa4..ad05310a9dd5d918ce46a6b17a4ec7564dad10ba 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -8,8 +8,8 @@ <grantUpdateProcess>%aditoprj%/entity/Contact_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDeleteProcess>%aditoprj%/entity/Contact_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Contact_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/Contact_entity/onInit.js</onInit> <onValidation>%aditoprj%/entity/Contact_entity/onValidation.js</onValidation> + <initFilterProcess>%aditoprj%/entity/Contact_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:USERS</iconId> <titlePlural>Contacts</titlePlural> <recordContainer>db</recordContainer> diff --git a/entity/Contact_entity/initFilterProcess.js b/entity/Contact_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..695577262bdb7ee4519993bcaf130262075e81ca --- /dev/null +++ b/entity/Contact_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Contact_entity/onInit.js b/entity/Contact_entity/onInit.js deleted file mode 100644 index ad4324c7682881b8e9ca470e334269ae822ec522..0000000000000000000000000000000000000000 --- a/entity/Contact_entity/onInit.js +++ /dev/null @@ -1,23 +0,0 @@ -import("system.neon"); -import("Keyword_lib"); -import("system.vars"); -import("KeywordRegistry_basic"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": vars.get("$property.STATUS.contentType") -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 26fe1fdb3d81b895c3116377537320ae54a77d70..cbd7cb44ef5d77d0e3656bfe5867f3c3f68ce8f8 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -7,8 +7,9 @@ <title>Company</title> <grantDeleteProcess>%aditoprj%/entity/Organisation_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Organisation_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/Organisation_entity/onInit.js</onInit> + <afterUiInit>%aditoprj%/entity/Organisation_entity/afterUiInit.js</afterUiInit> <afterOperatingState>%aditoprj%/entity/Organisation_entity/afterOperatingState.js</afterOperatingState> + <initFilterProcess>%aditoprj%/entity/Organisation_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:BUILDING</iconId> <imageProcess>%aditoprj%/entity/Organisation_entity/imageProcess.js</imageProcess> <titlePlural>Companies</titlePlural> diff --git a/entity/Organisation_entity/afterUiInit.js b/entity/Organisation_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..d529418d07b0567a96364d831a8a27194c2eca23 --- /dev/null +++ b/entity/Organisation_entity/afterUiInit.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("Context_lib"); +import("Attribute_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); \ No newline at end of file diff --git a/entity/Organisation_entity/initFilterProcess.js b/entity/Organisation_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..26ce7fa02bbaeaa2d25db318aa011b67278354cc --- /dev/null +++ b/entity/Organisation_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); +import("system.result"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Organisation_entity/onInit.js b/entity/Organisation_entity/onInit.js deleted file mode 100644 index b9717583554415c62b48c4ad8304aceb87245938..0000000000000000000000000000000000000000 --- a/entity/Organisation_entity/onInit.js +++ /dev/null @@ -1,30 +0,0 @@ -import("Keyword_lib"); -import("KeywordRegistry_basic"); -import("system.neon"); -import("system.vars"); -import("Context_lib"); -import("Attribute_lib"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": "TEXT" -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); -} diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index cbabea32766c97f2a7d1faa4fcc2ede5fd2a3048..907d1408a4c2c5606ddcc61e47249d015939e3e3 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -10,9 +10,10 @@ </siblings> <grantDeleteProcess>%aditoprj%/entity/Person_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Person_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/Person_entity/onInit.js</onInit> + <afterUiInit>%aditoprj%/entity/Person_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Person_entity/onValidation.js</onValidation> <afterOperatingState>%aditoprj%/entity/Person_entity/afterOperatingState.js</afterOperatingState> + <initFilterProcess>%aditoprj%/entity/Person_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:USERS</iconId> <imageProcess>%aditoprj%/entity/Person_entity/imageProcess.js</imageProcess> <usePermissions v="false" /> diff --git a/entity/Person_entity/afterUiInit.js b/entity/Person_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..d529418d07b0567a96364d831a8a27194c2eca23 --- /dev/null +++ b/entity/Person_entity/afterUiInit.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("Context_lib"); +import("Attribute_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); \ No newline at end of file diff --git a/entity/Person_entity/initFilterProcess.js b/entity/Person_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..26ce7fa02bbaeaa2d25db318aa011b67278354cc --- /dev/null +++ b/entity/Person_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); +import("system.result"); + +var statusInactive = $KeywordRegistry.contactStatus$inactive(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusInactive, + value: KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusInactive) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Person_entity/onInit.js b/entity/Person_entity/onInit.js deleted file mode 100644 index 1958e327f289481afe51088aa62d5d57af3a782f..0000000000000000000000000000000000000000 --- a/entity/Person_entity/onInit.js +++ /dev/null @@ -1,30 +0,0 @@ -import("Keyword_lib"); -import("KeywordRegistry_basic"); -import("system.neon"); -import("system.vars"); -import("Context_lib"); -import("Attribute_lib"); - -var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.contactStatus$inactive(), - "contenttype": "TEXT" -}; - -statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); - -var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] -}; - -filter = JSON.stringify(filter); -neon.setFilter("#ENTITY", filter); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); -} diff --git a/entity/Task_entity/Task_entity.aod b/entity/Task_entity/Task_entity.aod index 14cdb18785867088dbb7220fa1bb33afc7b479a3..64f381e93f98b991c2c8502acfc95780050d98c6 100644 --- a/entity/Task_entity/Task_entity.aod +++ b/entity/Task_entity/Task_entity.aod @@ -6,8 +6,9 @@ <title>Task</title> <grantDeleteProcess>%aditoprj%/entity/Task_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Task_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/Task_entity/onInit.js</onInit> + <afterUiInit>%aditoprj%/entity/Task_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Task_entity/onValidation.js</onValidation> + <initFilterProcess>%aditoprj%/entity/Task_entity/initFilterProcess.js</initFilterProcess> <iconId>VAADIN:TASKS</iconId> <iconIdProcess>%aditoprj%/entity/Task_entity/iconIdProcess.js</iconIdProcess> <titlePlural>Tasks</titlePlural> diff --git a/entity/Task_entity/afterUiInit.js b/entity/Task_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..2f108ba446930b67156ba07b5e880b1ff371117a --- /dev/null +++ b/entity/Task_entity/afterUiInit.js @@ -0,0 +1,6 @@ +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.PARENT_CONTEXT", "$field.PARENT_ID"); \ No newline at end of file diff --git a/entity/Task_entity/initFilterProcess.js b/entity/Task_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..39b6e0b2e29be0e89c1cf8279ab9c9ae93a74ab9 --- /dev/null +++ b/entity/Task_entity/initFilterProcess.js @@ -0,0 +1,19 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var statusEnded = $KeywordRegistry.taskStatus$ended(); +var filter = { + type: "group", + operator: "AND", + childs: [{ + type: "row", + name: "STATUS", + operator: "NOT_EQUAL", + contenttype: "TEXT", + key: statusEnded, + value: KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), statusEnded) + }] +}; + +result.string(JSON.stringify(filter)); \ No newline at end of file diff --git a/entity/Task_entity/onInit.js b/entity/Task_entity/onInit.js deleted file mode 100644 index 0a610862cbb9ecae7e44e15eabbc31b0b20eceda..0000000000000000000000000000000000000000 --- a/entity/Task_entity/onInit.js +++ /dev/null @@ -1,31 +0,0 @@ -import("system.neon"); -import("system.vars"); -import("system.neon"); -import("ActivityTask_lib"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -var recordState = vars.get("$sys.recordstate"); -if(recordState == neon.OPERATINGSTATE_NEW) -{ - TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.PARENT_CONTEXT", "$field.PARENT_ID"); -} -else if (recordState != neon.OPERATINGSTATE_SEARCH) -{ - var statusFilterElement = { - "type":"row", - "name":"STATUS", - "operator":"NOT_EQUAL", - "key":$KeywordRegistry.taskStatus$ended(), - "contenttype": "TEXT" - }; - statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), statusFilterElement.key); - - var filter = { - "type":"group", - "operator":"AND", - "childs": [statusFilterElement] - }; - filter = JSON.stringify(filter); - neon.setFilter("#ENTITY", filter); -} \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod index 1cd52f7035f12fffa8d282df67384589bd7c0eb5..db719f1fd0c9f75968b75227ffc77044223ce190 100644 --- a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod +++ b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod @@ -7,7 +7,6 @@ <grantCreateProcess>%aditoprj%/entity/WorkflowDefinition_entity/grantCreateProcess.js</grantCreateProcess> <grantDelete v="false" /> <contentTitleProcess>%aditoprj%/entity/WorkflowDefinition_entity/contentTitleProcess.js</contentTitleProcess> - <onInit>%aditoprj%/entity/WorkflowDefinition_entity/onInit.js</onInit> <iconId>VAADIN:DROP</iconId> <titlePlural>Workflow definitions</titlePlural> <recordContainer>jdito</recordContainer> diff --git a/entity/WorkflowDefinition_entity/onInit.js b/entity/WorkflowDefinition_entity/onInit.js deleted file mode 100644 index 7199fd35b05e991cb7f35e577f1a7e593a28c60e..0000000000000000000000000000000000000000 --- a/entity/WorkflowDefinition_entity/onInit.js +++ /dev/null @@ -1,20 +0,0 @@ -import("system.neon"); -import("system.vars"); -import("system.translate"); - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW && vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET) -{ - var filterOnlyUnfinished = { - type : "group", - operator : "AND", - childs : [{ - type : "row", - name : "ISFINISHED", - operator : "EQUAL", - value : translate.text("No"), - key : "false", - contenttype : "BOOLEAN" - }] - }; - neon.setFilter("Instances", JSON.stringify(filterOnlyUnfinished)); -} \ No newline at end of file diff --git a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod index 37c5a337ba3fef1c5b2d8e9c3574bbea5404ef21..765793b9f379e0c813bca3b508491cf0dcba0421 100644 --- a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod +++ b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod @@ -5,6 +5,7 @@ <documentation>%aditoprj%/entity/WorkflowInstance_entity/documentation.adoc</documentation> <title>Workflow instance</title> <contentTitleProcess>%aditoprj%/entity/WorkflowInstance_entity/contentTitleProcess.js</contentTitleProcess> + <initFilterProcess>%aditoprj%/entity/WorkflowInstance_entity/initFilterProcess.js</initFilterProcess> <titlePlural>Workflow instances</titlePlural> <recordContainer>jdito</recordContainer> <entityFields> diff --git a/entity/WorkflowInstance_entity/initFilterProcess.js b/entity/WorkflowInstance_entity/initFilterProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..80a38560e27c2236fec97c140cbce55462a7c809 --- /dev/null +++ b/entity/WorkflowInstance_entity/initFilterProcess.js @@ -0,0 +1,17 @@ +import("system.result"); +import("system.translate"); + +var filterOnlyUnfinished = { + type : "group", + operator : "AND", + childs : [{ + type : "row", + name : "ISFINISHED", + operator : "EQUAL", + value : translate.text("No"), + key : "false", + contenttype : "BOOLEAN" + }] +}; + +result.string(JSON.stringify(filterOnlyUnfinished)); \ No newline at end of file