diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index 6831f1ee6393f67cb6fc4a3e028c550241b6f944..0ee552b3adf75e3f046ad59ff539a91cd1b2274a 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -12,7 +12,7 @@ <element>ATTENDEESLENGTH</element> <element>STARTDATE</element> <element>ENDDATE</element> - <element>SUBJECT</element> + <element>SUMMARY</element> <element>ORGANIZER</element> <element>ATTENDEES</element> <element>STATUS</element> @@ -31,7 +31,7 @@ <entityFields> <entityField> <name>SUMMARY</name> - <fieldName>SUBJECT</fieldName> + <fieldName>SUMMARY</fieldName> <caption>Betreff</caption> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/summary/valueProcess.js</valueProcess> </entityField> @@ -91,5 +91,10 @@ <newItemsAllowed v="true" /> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/categories/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>ATTENDEES</name> + <fieldName>ATTENDEES</fieldName> + <possibleItemsProcess>%aditoprj%/entity/Appointment_entity/entityfields/attendees/possibleItemsProcess.js</possibleItemsProcess> + </entityField> </entityFields> </entity> diff --git a/entity/Appointment_entity/entityfields/attendees/possibleItemsProcess.js b/entity/Appointment_entity/entityfields/attendees/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d02b24118fe177e723a67415653077642851646e --- /dev/null +++ b/entity/Appointment_entity/entityfields/attendees/possibleItemsProcess.js @@ -0,0 +1,18 @@ +import("system.vars"); +import("system.logging"); +import("system.result"); +import("system.calendars"); + +logging.log("attendees poss-items") + +var entry = vars.get("$image.entry"); +var allUsers = calendars.getFullCalendarUsers(calendars.RIGHT_WRITE); +var results = []; + +for (var i = 0; i < allUsers.length; i++) +{ + results[i] = [allUsers[i][0], allUsers[i][2].paramvalue]; +} +logging.log(results); + +result.object(results); \ No newline at end of file diff --git a/entity/Appointment_entity/onInsert.js b/entity/Appointment_entity/onInsert.js index a5258b7fecd0910aa788defd22e4ac7efc5b6b37..d727fdfa736db6f0964ee1acc9de4a3968bdab01 100644 --- a/entity/Appointment_entity/onInsert.js +++ b/entity/Appointment_entity/onInsert.js @@ -19,8 +19,9 @@ var event = vars.get("$image.entry"); var ok = false; event[calendars.TYPE] = calendars.VEVENT; +event[calendars.ATTENDEES] = vars.get("$field.ATTENDEES"); event[calendars.STATUS] = vars.getString("$field.STATUS"); -event[calendars.SUMMARY] = vars.getString("$field.SUBJECT"); +event[calendars.SUMMARY] = vars.getString("$field.SUMMARY"); event[calendars.LOCATION] = vars.get("$field.LOCATION"); event[calendars.DESCRIPTION] = vars.get("$field.DESCRIPTION"); event[calendars.DTSTART] = vars.get("$field.STARTDATE"); @@ -51,7 +52,7 @@ if (hasReminder == "true") } event[calendars.CLASSIFICATION] = vars.get("$field.CLASSIFICATION"); // event[calendars.TRANSPARENCY] = vars.get("$field.transparency"); -event[calendars.AFFECTEDUSERS] = getAffectedUsers( event ); +//event[calendars.AFFECTEDUSERS] = getAffectedUsers( event ); // event[calendars.CATEGORIES] = vars.get("$field.categories"); //calcrecurrence(event); //if (event[calendars.RRULE] != undefined) recurrencend(event); diff --git a/entity/Pers_entity/Pers_entity.aod b/entity/Pers_entity/Pers_entity.aod index 9e21b9402877b1b3e87b7055fe6ad50cbd2821f4..bd7b2e0294fcabb6978cc5b3f77eec7b433cdabf 100644 --- a/entity/Pers_entity/Pers_entity.aod +++ b/entity/Pers_entity/Pers_entity.aod @@ -169,6 +169,7 @@ <columnName>ORG_ID</columnName> <caption></caption> <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/org_id/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/Pers_entity/entityfields/org_id/onValueChange.js</onValueChange> </entityField> <entityField> <name>REL_USER_NEW</name> @@ -242,7 +243,13 @@ <linkedContextProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js</linkedContextProcess> <mandatory v="true" /> <outgoingField>PersOrg_dfo</outgoingField> + <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/valueProcess.js</valueProcess> <fieldIdProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js</fieldIdProcess> + <onValueChange>%aditoprj%/entity/Pers_entity/entityfields/orgname/onValueChange.js</onValueChange> + <onValueChangeTypes> + <element>MASK</element> + <element>PROCESS</element> + </onValueChangeTypes> </entityField> <entityField> <name>ORGID</name> diff --git a/entity/Pers_entity/entityfields/org_id/onValueChange.js b/entity/Pers_entity/entityfields/org_id/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Pers_entity/entityfields/org_id/valueProcess.js b/entity/Pers_entity/entityfields/org_id/valueProcess.js index 489cac6bba9429216dd59c901e7ed69e4131de22..2c20db8f32f8bdfebf7e493efb47f02438b5e403 100644 --- a/entity/Pers_entity/entityfields/org_id/valueProcess.js +++ b/entity/Pers_entity/entityfields/org_id/valueProcess.js @@ -5,8 +5,12 @@ import("system.neon"); if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) { - if(vars.exists("$param.OrgId_param") && vars.get("$param.OrgId_param") != null) + if(vars.exists("$image.lookup_orgname") && vars.get("$image.lookup_orgname") == '') + result.string(vars.get("$this.value")); + else if(vars.exists("$param.OrgId_param") && vars.get("$param.OrgId_param") != null) result.string(vars.getString("$param.OrgId_param")); else result.string("0") -} \ No newline at end of file +} +else + result.string(vars.get("$this.value")); diff --git a/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js b/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js index ade38aef1c45226f092ba224bc5c22b5e1acc2f8..7dd987ac84aa202f9d8413756b7c3aa80a32a0da 100644 --- a/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js +++ b/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js @@ -1,11 +1,10 @@ -import("system.logging"); import("system.vars"); import("system.db"); import("system.result"); import("system.neon"); var ret = ""; -var orgid = vars.getString("$field.ORGID").trim(); +var orgid = vars.getString("$field.ORG_ID").trim(); if(orgid == "0") ret = null; diff --git a/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js b/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js index ec9fb8b7c0230514f925409c072072c3b5245b0c..d2f6c19c344fc058cc0085f00f015667ee3acc2d 100644 --- a/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js +++ b/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js @@ -5,7 +5,10 @@ import("system.neon"); var orgid = vars.getString("$field.ORGID"); -if((orgid == null || orgid.trim() == "0") && (vars.get("$sys.operatingstate") != neon.OPERATINGSTATE_NEW)) +if(vars.exists("$image.lookup_orgname") && vars.get("$image.lookup_orgname") != '') + result.string("Org_context"); +else if((orgid == null || orgid.trim() == "0") + && (vars.get("$sys.operatingstate") != neon.OPERATINGSTATE_NEW)) result.string(null); else - result.string("Org_context"); + result.string("Org_context"); diff --git a/entity/Pers_entity/entityfields/orgname/onValueChange.js b/entity/Pers_entity/entityfields/orgname/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..fce9fb549efd4d46f4b6a0626a31665f943ac66c --- /dev/null +++ b/entity/Pers_entity/entityfields/orgname/onValueChange.js @@ -0,0 +1,17 @@ +import("system.logging"); +import("system.db"); +import("system.neon"); +import("system.vars"); + +var org_id = db.cell("select ORG_ID from RELATION where RELATIONID = '" + vars.getString("$field.ORGNAME") + "'"); + +logging.log("value change -> " + org_id); + +if(org_id != '') +{ + neon.setFieldValue("$field.ORG_ID", org_id); + + var org_name = db.cell("select NAME from ORG where ORGID = '" + org_id + "'"); + vars.set("$image.lookup_orgname", org_name); + neon.refresh("", "$field.ORGNAME"); +} diff --git a/entity/Pers_entity/entityfields/orgname/valueProcess.js b/entity/Pers_entity/entityfields/orgname/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..563668cb78ddd14cb5371dff3fe8881c546908d9 --- /dev/null +++ b/entity/Pers_entity/entityfields/orgname/valueProcess.js @@ -0,0 +1,20 @@ +import("system.result"); +import("system.vars"); + +if(!vars.exists("$image.lookup_orgname")) +{ + result.string(vars.get("$this.value")); +} +else +{ + var name = vars.get("$image.lookup_orgname"); + + if(name != null) + { + vars.set("$image.lookup_orgname", null); + result.string(name); + } + else + result.string(vars.get("$this.value")); +} + \ No newline at end of file diff --git a/neonView/AppointmentEdit_view/AppointmentEdit_view.aod b/neonView/AppointmentEdit_view/AppointmentEdit_view.aod index 8b94f211fc1e3006a29edfa009da5fbc4f284556..37f02b486c3da2d87275344f2af571efa9e69a56 100644 --- a/neonView/AppointmentEdit_view/AppointmentEdit_view.aod +++ b/neonView/AppointmentEdit_view/AppointmentEdit_view.aod @@ -15,7 +15,7 @@ <beginField>BEGIN</beginField> <endField>END</endField> <affectedUsersField>SUMMARY</affectedUsersField> - <attendeesField>SUMMARY</attendeesField> + <attendeesField>ATTENDEES</attendeesField> <privateField>CLASSIFICATION</privateField> <statusField>STATUS</statusField> <locationField>LOCATION</locationField> diff --git a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod index 4e5e5e466f0829a24add9b0a217441f205d3fff8..51982720564a30ddecb910995e4f21d394eec096 100644 --- a/neonView/AppointmentPreview_view/AppointmentPreview_view.aod +++ b/neonView/AppointmentPreview_view/AppointmentPreview_view.aod @@ -18,6 +18,7 @@ <privateField>CLASSIFICATION</privateField> <statusField>STATUS</statusField> <locationField>LOCATION</locationField> + <categoriesField>CATEGORIES</categoriesField> <entityField>#ENTITY</entityField> </appointmentPreviewViewTemplate> </children> diff --git a/others/db_changes/readme.adoc b/others/db_changes/readme.adoc index fe12e5629e34bc402b08d778d49d32dfac34c490..4763f6c4043e204b726084c3b60aed0e1ecce837 100644 --- a/others/db_changes/readme.adoc +++ b/others/db_changes/readme.adoc @@ -1,86 +1,87 @@ -liquibase-readme -================ - -== Structure within ADITO -=== in theory - -When using liquibase in an ADITO-System, your project structure _should_ look like this: ----- -PROJECTHOME/others/db_changes/masterChangelog.xml -PROJECTHOME/others/db_changes/struct/ -PROJECTHOME/others/db_changes/data/ -PROJECTHOME/others/db_changes/liquibase.properties ----- - -The file `masterChangelog.xml` contains a list of all changes (well, in fact more like a list of all changelog-files). The structure could look like this: -[source,xml] ----- -<?xml version="1.1" encoding="UTF-8" standalone="no"?> -<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <include file="struct/create_org.xml"/> - <include file="data/example_org.xml"/> -</databaseChangeLog> ----- - -TIP: Keep in mind that the header-information can change, visit therefore the liquibase-website: http://www.liquibase.org Specific: the XML-format definition: http://www.liquibase.org/documentation/xml_format.html - -So, thats where all our changes are located - but what about the changes _itself_? -As you can think of, they're stored in files located in the folders `struct` for DDL-stuff like _create_, _alter_ etc. -and `data` for DML-stuff like _insert_, _update_ etc. - -If you want to know what to do add in these files take a look at the official liquibase documentation for futher information how to fill these XML files: http://www.liquibase.org/documentation/index.html - -IMPORTANT: Always remember that you might have to define some rollback-entries. + -This is e.g. not needed for create-entries but for others like insert. - -So, whats about that `liquibase.properties` file? The file is needed to specify some data here, e.g. the driver-name, classpath (of the driver), jdbc-url, etc. -You want to store these information there because otherwise you'd need to specify them on every call of liquibase. Not cool. - -Now you're ready to run commands like `liquibase update` in the `PROJECTHOME/others/db_changes` folder. - -=== in practice - -.Let's say whe want to add a new table `FOOBAR` with some demo-data. We need to: -* create a new file in the struct-folder; e.g. `create_FOOBAR.xml` -* fill the file with changesets that will create a table -* add `include`-tag in the `masterChangelog.xml` for the created file -* create a new file in the data-foler; e.g. `demoData_FOOBAR.xml` -* fill the file with changesets that will insert data into the table and define *rollback-entries* -* add `include`-tag in the `masterChangelog.xml` for the created file -* to apply the changes simply run `liquibase update` - -For example one featurepackage "add contact management" could contain several files itself: ----- - create_org.xml - create_pers.xml - create_relation.xml ----- -On the other hand, several featurepackages cannot be contained in one changelog-file. - - -== How to use it -Normally everything you need is provided by the project-template and the existing files in the git-repository. -Therefore it's easy to use and you can start immediately. - -.Keep in mind: -* run `liquibase update` to apply possible changes after merging something into your repository -* apply modifications on the database always with liquibase; do not write a create-script in SQL. Write some changesets and execute them -* set correct `author`- and `id`-attributes in your changelog-files - - - -== FAQ -[qanda] -What about unicode-columns like `NVARCHAR` or `NCLOB`?:: - Simply define them in your changesets; This is something which is not completely verified: - Maybe columns like `NCLOB` cause problems in some DBMS like _MS SQL Server_ -What if i swtich between branches and want to switch between different database-states?:: - This is something that needs to be defined. Possible ways: rollback or recreate your database entirely -Is it possible to write an update-changeset where I can use a preparedStatement in the where-clause?:: - This needs to be analysed and (the result) added here. - - - ---- - +liquibase-readme +================ + +== Structure within ADITO +=== in theory + +When using liquibase in an ADITO-System, your project structure _should_ look like this: +---- +PROJECTHOME/others/db_changes/masterChangelog.xml +PROJECTHOME/others/db_changes/struct/ +PROJECTHOME/others/db_changes/data/ +PROJECTHOME/others/db_changes/misc/ +PROJECTHOME/others/db_changes/liquibase.properties +---- + +The file `masterChangelog.xml` contains a list of all changes (well, in fact more like a list of all changelog-files). The structure could look like this: +[source,xml] +---- +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <include file="struct/create_org.xml"/> + <include file="data/example_org.xml"/> +</databaseChangeLog> +---- + +TIP: Keep in mind that the header-information can change, visit therefore the liquibase-website: http://www.liquibase.org Specific: the XML-format definition: http://www.liquibase.org/documentation/xml_format.html + +So, thats where all our changes are located - but what about the changes _itself_? +As you can think of, they're stored in files located in the folders `struct` for DDL-stuff like _create_, _alter_ etc. +and `data` for DML-stuff like _insert_, _update_ etc. + +If you want to know what to do add in these files take a look at the official liquibase documentation for futher information how to fill these XML files: http://www.liquibase.org/documentation/index.html + +IMPORTANT: Always remember that you might have to define some rollback-entries. + +This is e.g. not needed for create-entries but for others like insert. + +So, whats about that `liquibase.properties` file? The file is needed to specify some data here, e.g. the driver-name, classpath (of the driver), jdbc-url, etc. +You want to store these information there because otherwise you'd need to specify them on every call of liquibase. Not cool. + +Now you're ready to run commands like `liquibase update` in the `PROJECTHOME/others/db_changes` folder. + +=== in practice + +.Let's say whe want to add a new table `FOOBAR` with some demo-data. We need to: +* create a new file in the struct-folder; e.g. `create_FOOBAR.xml` +* fill the file with changesets that will create a table +* add `include`-tag in the `masterChangelog.xml` for the created file +* create a new file in the data-foler; e.g. `demoData_FOOBAR.xml` +* fill the file with changesets that will insert data into the table and define *rollback-entries* +* add `include`-tag in the `masterChangelog.xml` for the created file +* to apply the changes simply run `liquibase update` + +For example one featurepackage "add contact management" could contain several files itself: +---- + create_org.xml + create_pers.xml + create_relation.xml +---- +On the other hand, several featurepackages cannot be contained in one changelog-file. + + +== How to use it +Normally everything you need is provided by the project-template and the existing files in the git-repository. +Therefore it's easy to use and you can start immediately. + +.Keep in mind: +* run `liquibase update` to apply possible changes after merging something into your repository +* apply modifications on the database always with liquibase; do not write a create-script in SQL. Write some changesets and execute them +* set correct `author`- and `id`-attributes in your changelog-files + + + +== FAQ +[qanda] +What about unicode-columns like `NVARCHAR` or `NCLOB`?:: + Simply define them in your changesets; This is something which is not completely verified: + Maybe columns like `NCLOB` cause problems in some DBMS like _MS SQL Server_ +What if i swtich between branches and want to switch between different database-states?:: + This is something that needs to be defined. Possible ways: rollback or recreate your database entirely +Is it possible to write an update-changeset where I can use a preparedStatement in the where-clause?:: + This needs to be analysed and (the result) added here. + + + +--- + ~have~ ~a~ ~nice~ ~day~ ~:-)~ \ No newline at end of file diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 8bea740f88d47d8b2041cac675aac0e2ec92d75c..6342decac506717ea22a8355652f8a4fde3f4c99 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -22,6 +22,7 @@ <clientSearchExcludeForIgnorecase v="true" /> <blobHandlingMethod>DATABASE</blobHandlingMethod> <databaseAuditGetOldValueLobs v="false" /> + <indexsearchGlobalEnabled v="true" /> <indexsearchFullIndexerEnabled v="true" /> <indexsearchFullIndexerInterval v="0" /> <indexsearchIncrementingIndexerEnabled v="true" />