diff --git a/.gitignore b/.gitignore index 963a0a033594a51f813c1ebe298925d666503ac5..cca8b3b58f6373099e0d2e39a981d0a18d73a15a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /data /others/db_changes/jdbc/ /others/db_changes/liquibase/ -/others/db_changes/liqui_update.bat \ No newline at end of file +/others/db_changes/liqui_update.bat +/others/db_changes/liqui_reset.ps1 \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index c58080846f036f9611512c7779e345b7e2ae7cb8..96bc635802679fc3a083dfd0d8bb22df301af0cf 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -1189,6 +1189,7 @@ <titleColumn>TITLECOLUMN</titleColumn> <descriptionColumn>DESCCOLUMN</descriptionColumn> <query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/org/query.js</query> + <subQueries>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/org/subQueries.js</subQueries> <resultContextNeon>Org_context</resultContextNeon> <affectedTables> <element>ADDRESS</element> @@ -1206,6 +1207,7 @@ <titleColumn>TITLECOLUMN</titleColumn> <descriptionColumn>DESCCOLUMN</descriptionColumn> <query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js</query> + <subQueries>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/pers/subQueries.js</subQueries> <resultContextNeon>Pers_context</resultContextNeon> <affectedTables> <element>ADDRESS</element> diff --git a/aliasDefinition/Data_alias/indexsearchgroups/org/query.js b/aliasDefinition/Data_alias/indexsearchgroups/org/query.js index b49ee30966107787b47007bcf2fd2dd0c0c9f27e..8bbe4d9089995e3e5e9058f1032c487a9ad440e9 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/org/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/org/query.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.result"); import("system.vars"); import("system.calendars"); @@ -10,11 +11,14 @@ if (vars.exists("$local.idvalue")) { queryCondition = "where RELATION.RELATIONID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')"; //TODO: refactor this for incremental indexer (injections?) } -sqlHelper = new SqlUtils(); +sqlHelper = new LegacySqlUtils(); sqlQuery = "select RELATION.RELATIONID " - + "," + sqlHelper.concat(["ORG.NAME", "ORG.CUSTOMERCODE", "defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) + + "," + sqlHelper.concat(["ORG.NAME", "ORG.CUSTOMERCODE"]) + " as TITLECOLUMN " - + "," + sqlHelper.concat(["ADDRESS", "BUILDINGNO", "', '", "COUNTRY", "'-'", "ZIP", "CITY"], ' ') + " as DESCCOLUMN " + + "," + sqlHelper.concat([ + sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) + ,sqlHelper.concat(["defaultAddress.ZIP", "defaultAddress.CITY"]) + ,"defaultAddress.COUNTRY"], ", ") + " as DESCCOLUMN " //additional indexed fields + ",ORG.NAME, COMM.ADDR " + " from ORG " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/org/subQueries.js b/aliasDefinition/Data_alias/indexsearchgroups/org/subQueries.js new file mode 100644 index 0000000000000000000000000000000000000000..6e5a9c19f3c5b4a5b5a492baf5710f3fde309757 --- /dev/null +++ b/aliasDefinition/Data_alias/indexsearchgroups/org/subQueries.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("select ADDRESS.ZIP, ADDRESS.CITY, ADDRESS.COUNTRY, ADDRESS.ADDRESS from ADDRESS where ADDRESS.RELATION_ID = '@@@'"); \ No newline at end of file diff --git a/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js b/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js index 39d30b5b8b9606410fc06eb5fcabe34e1d5b018c..5a04df238226750feec62189ff427cdfded43419 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js @@ -10,11 +10,14 @@ if (vars.exists("$local.idvalue")) { queryCondition = "where RELATION.RELATIONID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')"; //TODO: refactor this for incremental indexer (injections?) } -sqlHelper = new SqlUtils(); +sqlHelper = new LegacySqlUtils(); sqlQuery = "select RELATION.RELATIONID " + "," + sqlHelper.concat(["PERS.SALUTATION", "PERS.FIRSTNAME", "PERS.LASTNAME", "ORG.NAME"]) + " as TITLECOLUMN " - + "," + sqlHelper.concat(["ADDRESS", "BUILDINGNO", "', '", "COUNTRY", "'-'", "ZIP", "CITY"], ' ') + " as DESCCOLUMN " + + "," + sqlHelper.concat([ + sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) + ,sqlHelper.concat(["defaultAddress.ZIP", "defaultAddress.CITY"]) + ,"defaultAddress.COUNTRY"], ", ") + " as DESCCOLUMN " //additional indexed fields + ",ORG.NAME, COMM.ADDR " + " from PERS " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/pers/subQueries.js b/aliasDefinition/Data_alias/indexsearchgroups/pers/subQueries.js new file mode 100644 index 0000000000000000000000000000000000000000..6e5a9c19f3c5b4a5b5a492baf5710f3fde309757 --- /dev/null +++ b/aliasDefinition/Data_alias/indexsearchgroups/pers/subQueries.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("select ADDRESS.ZIP, ADDRESS.CITY, ADDRESS.COUNTRY, ADDRESS.ADDRESS from ADDRESS where ADDRESS.RELATION_ID = '@@@'"); \ No newline at end of file diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 5a9a2413668173d1e103ccd0e186373763121f70..5dde13f0008983a4d1dcb8543aa11a74fe80b816 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -6,6 +6,7 @@ <node name="CONTACTS" kind="123" title="Contactmanagement"> <icon>VAADIN:STAR</icon> <node name="Group1" kind="123" title=""> + <node name="_test_clientProcess" kind="103" /> <node name="Vertriebsdashboard" kind="10090" /> <node name="Calendar_context" kind="10077" /> <node name="Org_context" kind="10077" /> diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index c80ff8c1405b3548262889e8fd6b238118a0dd08..b1c0672de79fc6f46566fc49864cbfd67ee2b088 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -120,6 +120,12 @@ <fieldName>OrgAddress_dfo</fieldName> <isOutgoing v="false" /> </entityDependency> + <entityDependency> + <name>aa44f6ec-2b9b-43f8-902d-92490480413f</name> + <entityName>Pers_entity</entityName> + <fieldName>OrgAddress_dfo</fieldName> + <isOutgoing v="false" /> + </entityDependency> </dependencies> </entityIncomingField> <entityParameter> @@ -139,6 +145,21 @@ </entityDependency> </dependencies> </entityIncomingField> + <entityParameter> + <name>StandardAddressId_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityField> + <name>IS_STANDARD</name> + <contentType>BOOLEAN</contentType> + <possibleItemsProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard/possibleItemsProcess.js</possibleItemsProcess> + <valueProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/Address_entity/entityfields/is_standard/onValueChange.js</onValueChange> + <onValueChangeTypes> + <element>MASK</element> + </onValueChangeTypes> + </entityField> </entityFields> <linkInformation> <linkInformation> diff --git a/entity/Address_entity/entityfields/is_standard/onValueChange.js b/entity/Address_entity/entityfields/is_standard/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..c4170ac0088bf8f2be38ca4e2370afe23318e9f9 --- /dev/null +++ b/entity/Address_entity/entityfields/is_standard/onValueChange.js @@ -0,0 +1,8 @@ +import("system.neon"); +import("system.logging"); +import("system.vars"); + +vars.set("$image.EditedStandardAddressId", vars.get("$field.ADDRESSID")); +neon.refresh("$sys.currentimage", "$field.OrgAddress_dfo");//TODO: refresh the correct DFO + +//TODO: store in database via onUpdate \ No newline at end of file diff --git a/entity/Address_entity/entityfields/is_standard/possibleItemsProcess.js b/entity/Address_entity/entityfields/is_standard/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b429686afd550f89c5ea0f0c908cc3e17a5a9001 --- /dev/null +++ b/entity/Address_entity/entityfields/is_standard/possibleItemsProcess.js @@ -0,0 +1,7 @@ +import("system.translate"); +import("system.result"); + +result.object([ + ["true", translate.text("Standardadresse")] + ,["false", ""] +]); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/is_standard/valueProcess.js b/entity/Address_entity/entityfields/is_standard/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..793e8ffb4806ecdafc6b81fbd37826483c175a65 --- /dev/null +++ b/entity/Address_entity/entityfields/is_standard/valueProcess.js @@ -0,0 +1,10 @@ +import("system.logging"); +import("system.vars"); +import("system.result"); + +var currentAddressId, changedAddressId; +currentAddressId = vars.get("$field.ADDRESSID"); +if (vars.exists("$image.EditedStandardAddressId")){ + changedAddressId = vars.get("$image.EditedStandardAddressId"); +} +result.string((changedAddressId ? changedAddressId : vars.get("$param.StandardAddressId_param")) == currentAddressId); \ No newline at end of file diff --git a/entity/Comm_entity/Comm_entity.aod b/entity/Comm_entity/Comm_entity.aod index a2176f75f4d8ffd0bc2c2c51d2ee6822deed370c..6cee642503117b8bc0d4fc9991198fc27d51c2d5 100644 --- a/entity/Comm_entity/Comm_entity.aod +++ b/entity/Comm_entity/Comm_entity.aod @@ -5,6 +5,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Comm_entity/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Comm_entity/orderClauseProcess.js</orderClauseProcess> <recordContainerType>DB</recordContainerType> <caption>Communication</caption> <entityFields> @@ -91,6 +92,11 @@ </entityDependency> </dependencies> </entityIncomingField> + <entityField> + <name>IS_STANDARD</name> + <contentType>BOOLEAN</contentType> + <valueProcess>%aditoprj%/entity/Comm_entity/entityfields/is_standard/valueProcess.js</valueProcess> + </entityField> </entityFields> <linkInformation> <linkInformation> diff --git a/entity/Comm_entity/entityfields/is_standard/valueProcess.js b/entity/Comm_entity/entityfields/is_standard/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..64cb76b496be2ca9ccc9741f81452cafc1fc15ef --- /dev/null +++ b/entity/Comm_entity/entityfields/is_standard/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.STANDARD") == "1"); \ No newline at end of file diff --git a/entity/Comm_entity/orderClauseProcess.js b/entity/Comm_entity/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..abc10fd9cec7a9df27af21ffdb9f89845e390471 --- /dev/null +++ b/entity/Comm_entity/orderClauseProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.db"); + +result.object({"COMM.MEDIUM_ID": db.ASCENDING}); \ No newline at end of file diff --git a/entity/History_entity/conditionProcess.js b/entity/History_entity/conditionProcess.js index 9a59cbc1a072c592958774232280bf3e1e8b5a63..495433af6a8a50ac19b381fb3034f96b9e1502b2 100644 --- a/entity/History_entity/conditionProcess.js +++ b/entity/History_entity/conditionProcess.js @@ -8,7 +8,7 @@ var rowId, conditionStr, preparedValues ,sqlHelper; conditionStr = ""; preparedValues = []; -sqlHelper = new SqlUtils(); +sqlHelper = new LegacySqlUtils(); if ((rowId = vars.getString("$param.RowId_param"))){ conditionStr += " and HISTORYLINK.ROW_ID = ? "; diff --git a/entity/Org_entity/Org_entity.aod b/entity/Org_entity/Org_entity.aod index b2ad0af5ac69ed0d7a9b41391bfcc688caee3d25..4339184f8a52a7999d43b4f7504b742b2fd30615 100644 --- a/entity/Org_entity/Org_entity.aod +++ b/entity/Org_entity/Org_entity.aod @@ -183,6 +183,14 @@ <entityIncomingField> <name>Org_dfi</name> <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>11f8e13a-d801-4bd6-829c-d334c49e9a4c</name> + <entityName>Pers_entity</entityName> + <fieldName>PersOrg_dfo</fieldName> + <isOutgoing v="false" /> + </entityDependency> + </dependencies> </entityIncomingField> <entityOutgoingField> <name>OrgAddress_dfo</name> @@ -200,6 +208,11 @@ <code>%aditoprj%/entity/Org_entity/entityfields/orgaddress_dfo/children/relid_param/code.js</code> <triggerRecalculation v="true" /> </entityParameter> + <entityParameter> + <name>StandardAddressId_param</name> + <code>%aditoprj%/entity/Org_entity/entityfields/orgaddress_dfo/children/standardaddressid_param/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> </children> </entityOutgoingField> <entityField> diff --git a/entity/Org_entity/entityfields/orgaddress_dfo/children/standardaddressid_param/code.js b/entity/Org_entity/entityfields/orgaddress_dfo/children/standardaddressid_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..d42e61e0686428e56877e4c33892f3953de8cb6f --- /dev/null +++ b/entity/Org_entity/entityfields/orgaddress_dfo/children/standardaddressid_param/code.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); + +var addressId = vars.get("$field.ADDRESS_ID"); +result.string(addressId); \ No newline at end of file diff --git a/entity/Pers_entity/Pers_entity.aod b/entity/Pers_entity/Pers_entity.aod index 91347c5f0e94416f5fe7fe12bfc336c7117b0234..6f54575abbf2da0727b7d0a799feba65740a295c 100644 --- a/entity/Pers_entity/Pers_entity.aod +++ b/entity/Pers_entity/Pers_entity.aod @@ -198,12 +198,6 @@ <contentType>DATE</contentType> <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/rel_date_edit/valueProcess.js</valueProcess> </entityField> - <entityField> - <name>ORGNAME</name> - <caption>Company</caption> - <mandatory v="true" /> - <valueProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/valueProcess.js</valueProcess> - </entityField> <entityOutgoingField> <name>PersAddress_dfo</name> <title>Addresses</title> @@ -240,25 +234,66 @@ </entityParameter> </children> </entityOutgoingField> + <entityField> + <name>ORGNAME</name> + <tableName>ORG</tableName> + <columnName>NAME</columnName> + <caption>Company</caption> + <linkedContextProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js</linkedContextProcess> + <mandatory v="true" /> + <outgoingField>PersOrg_dfo</outgoingField> + <fieldIdProcess>%aditoprj%/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js</fieldIdProcess> + </entityField> + <entityField> + <name>ORGID</name> + <tableName>ORG</tableName> + <columnName>ORGID</columnName> + </entityField> <entityOutgoingField> - <name>PersAppointment_dfo</name> + <name>OrgAddress_dfo</name> <fieldType>DEPENDENCY_OUT</fieldType> + <caption>Company Addresses</caption> <dependency> <name>dependency</name> + <entityName>Address_entity</entityName> + <fieldName>OrgAddress_dfi</fieldName> + </dependency> + <children> + <entityParameter> + <name>RelId_param</name> + <code>%aditoprj%/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityOutgoingField> + <entityOutgoingField> + <name>PersOrg_dfo</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <selectionMode>SINGLE</selectionMode> + <dependency> + <name>dependency</name> + <entityName>Org_entity</entityName> + <fieldName>Org_dfi</fieldName> </dependency> </entityOutgoingField> </entityFields> <linkInformation> <linkInformation> - <name>449dc321-de5a-40da-a96e-23784d830745</name> + <name>ffff1758-e84e-47d8-a957-5989d0be7092</name> <tableName>PERS</tableName> <primaryKey>PERSID</primaryKey> </linkInformation> <linkInformation> - <name>724cb303-ea72-4207-9fc4-52aec17e0c31</name> + <name>5547b8d7-5145-4eb7-8698-c92674b4691f</name> <tableName>RELATION</tableName> <primaryKey>RELATIONID</primaryKey> <isUIDTable v="true" /> </linkInformation> + <linkInformation> + <name>dae8e70a-ec76-4c53-9799-ee04bfbe3bd2</name> + <tableName>ORG</tableName> + <primaryKey>ORGID</primaryKey> + <readonly v="true" /> + </linkInformation> </linkInformation> </entity> diff --git a/entity/Pers_entity/conditionProcess.js b/entity/Pers_entity/conditionProcess.js index 0459862542c09b13eb4436731ba245e057c52692..f2d2356e392ceb64a7411674838ddc827ff730a6 100644 --- a/entity/Pers_entity/conditionProcess.js +++ b/entity/Pers_entity/conditionProcess.js @@ -7,7 +7,7 @@ var orgId, conditionStr, preparedValues ,sqlHelper; conditionStr = ""; preparedValues = []; -sqlHelper = new SqlUtils(); +sqlHelper = new LegacySqlUtils(); if (vars.exists("$param.OrgId_param") && (orgId = vars.getString("$param.OrgId_param"))){ conditionStr += " and RELATION.ORG_ID = ? "; diff --git a/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js b/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..22ba1eb2fb3d6f23e64bb602a05f62bcc94f61be --- /dev/null +++ b/entity/Pers_entity/entityfields/orgaddress_dfo/children/relid_param/code.js @@ -0,0 +1,16 @@ +import("system.result"); +import("system.db"); +import("system.vars"); +import("Sql_lib"); + +var orgId, orgRelId, sqlHelper; + +sqlHelper = new LegacySqlUtils(); +orgId = vars.get("$field.ORGID"); +if (orgId){ + orgRelId = db.cell(["select RELATION.RELATIONID from RELATION where RELATION.PERS_ID is null and RELATION.ORG_ID = ?", + [ + [orgId, sqlHelper.getSingleColumnType("RELATION", "ORG_ID")] + ]]); + result.string(orgRelId); +} \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js b/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ade38aef1c45226f092ba224bc5c22b5e1acc2f8 --- /dev/null +++ b/entity/Pers_entity/entityfields/orgname/fieldIdProcess.js @@ -0,0 +1,15 @@ +import("system.logging"); +import("system.vars"); +import("system.db"); +import("system.result"); +import("system.neon"); + +var ret = ""; +var orgid = vars.getString("$field.ORGID").trim(); + +if(orgid == "0") + ret = null; +else if(orgid != "") + ret = db.cell("select RELATIONID from RELATION where ORG_ID = '" + orgid + "' and PERS_ID is NULL"); + +result.string (ret); \ No newline at end of file diff --git a/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js b/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ec9fb8b7c0230514f925409c072072c3b5245b0c --- /dev/null +++ b/entity/Pers_entity/entityfields/orgname/linkedContextProcess.js @@ -0,0 +1,11 @@ +import("system.logging"); +import("system.vars"); +import("system.result"); +import("system.neon"); + +var orgid = vars.getString("$field.ORGID"); + +if((orgid == null || orgid.trim() == "0") && (vars.get("$sys.operatingstate") != neon.OPERATINGSTATE_NEW)) + result.string(null); +else + result.string("Org_context"); diff --git a/entity/Pers_entity/entityfields/orgname/valueProcess.js b/entity/Pers_entity/entityfields/orgname/valueProcess.js deleted file mode 100644 index 46324b9873509404cf70d45a788bc67d84ea5e34..0000000000000000000000000000000000000000 --- a/entity/Pers_entity/entityfields/orgname/valueProcess.js +++ /dev/null @@ -1,17 +0,0 @@ -import("system.logging"); -import("system.vars"); -import("system.db"); -import("system.result"); -import("system.neon"); - -var ret = ""; -var orgid = vars.getString("$field.ORG_ID"); -if( orgid == "0") -{ - ret = "privat"; -} -else if(orgid != "") -{ - ret = db.cell("select NAME from ORG where ORGID = '" + orgid + "'"); -} -result.string (ret); \ No newline at end of file diff --git a/entity/Pers_entity/fromClauseProcess.js b/entity/Pers_entity/fromClauseProcess.js index ea75988bad57d0e046471637898df98b4d4377d1..146d38ec562f315e872c6e3967bbb00c23ef275a 100644 --- a/entity/Pers_entity/fromClauseProcess.js +++ b/entity/Pers_entity/fromClauseProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -result.string("PERS join RELATION on (RELATION.PERS_ID = PERS.PERSID)"); \ No newline at end of file +result.string("PERS join RELATION on (RELATION.PERS_ID = PERS.PERSID) join ORG on ORGID = ORG_ID "); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index cf22caac9e05f7c81ca94378b1616cb429e664af..92d2227e33e0d15f578c4183f7990bd9b105264d 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -237,6 +237,60 @@ <entry> <key>Inactive</key> </entry> + <entry> + <key>Nein</key> + </entry> + <entry> + <key>Bestätigt</key> + </entry> + <entry> + <key>Benutzer</key> + </entry> + <entry> + <key>frei</key> + </entry> + <entry> + <key>Vorläufig</key> + </entry> + <entry> + <key>Ja</key> + </entry> + <entry> + <key>Monatliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Betreff</key> + </entry> + <entry> + <key>Internal (2)</key> + </entry> + <entry> + <key>Company Addresses</key> + </entry> + <entry> + <key>Jährliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Termin</key> + </entry> + <entry> + <key>Außer Haus</key> + </entry> + <entry> + <key>Abgesagt</key> + </entry> + <entry> + <key>Tägliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>yyyyMMdd</key> + </entry> + <entry> + <key>Gebucht</key> + </entry> + <entry> + <key>Ein Gruppentermin kann nur durch den Organisator bearbeitet werden.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index b1986dac1ace09dd16dff01b5a91fb6477ac1975..39203791eb0670717911c5a5981acebd06801b97 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -317,6 +317,61 @@ <key>Inactive</key> <value>Inaktiv</value> </entry> + <entry> + <key>Nein</key> + </entry> + <entry> + <key>Bestätigt</key> + </entry> + <entry> + <key>Benutzer</key> + </entry> + <entry> + <key>frei</key> + </entry> + <entry> + <key>Vorläufig</key> + </entry> + <entry> + <key>Ja</key> + </entry> + <entry> + <key>Monatliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Betreff</key> + </entry> + <entry> + <key>Internal (2)</key> + </entry> + <entry> + <key>Company Addresses</key> + <value>Firmenadressen</value> + </entry> + <entry> + <key>Jährliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Termin</key> + </entry> + <entry> + <key>Außer Haus</key> + </entry> + <entry> + <key>Abgesagt</key> + </entry> + <entry> + <key>Tägliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>yyyyMMdd</key> + </entry> + <entry> + <key>Gebucht</key> + </entry> + <entry> + <key>Ein Gruppentermin kann nur durch den Organisator bearbeitet werden.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 1f06748faec98a4283939d278c357197c21e6918..6364678c5979c104fc10cfd2ce0b5e0ac2e855b9 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -242,6 +242,60 @@ <entry> <key>Inactive</key> </entry> + <entry> + <key>Nein</key> + </entry> + <entry> + <key>Bestätigt</key> + </entry> + <entry> + <key>Benutzer</key> + </entry> + <entry> + <key>frei</key> + </entry> + <entry> + <key>Vorläufig</key> + </entry> + <entry> + <key>Ja</key> + </entry> + <entry> + <key>Monatliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Betreff</key> + </entry> + <entry> + <key>Internal (2)</key> + </entry> + <entry> + <key>Company Addresses</key> + </entry> + <entry> + <key>Jährliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>Termin</key> + </entry> + <entry> + <key>Außer Haus</key> + </entry> + <entry> + <key>Abgesagt</key> + </entry> + <entry> + <key>Tägliche Serie nicht genauer spezifiziert. Ignoriere Serie.</key> + </entry> + <entry> + <key>yyyyMMdd</key> + </entry> + <entry> + <key>Gebucht</key> + </entry> + <entry> + <key>Ein Gruppentermin kann nur durch den Organisator bearbeitet werden.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/Org_context/Org_context.aod b/neonContext/Org_context/Org_context.aod index c9a5b204f3b4e4a97f86b3e8ae7509fd265c4ca3..388b6446c3b02f5ddfd7f0726af591ea0854193c 100644 --- a/neonContext/Org_context/Org_context.aod +++ b/neonContext/Org_context/Org_context.aod @@ -9,6 +9,7 @@ <filterview>OrgFilter_view</filterview> <editview>OrgEdit_view</editview> <preview>OrgPreview_view</preview> + <lookupview>OrgFilter_view</lookupview> <entity>Org_entity</entity> <references> <neonViewReference> diff --git a/neonView/AddressList_view/AddressList_view.aod b/neonView/AddressList_view/AddressList_view.aod index 828cc952541dad39c39f094f02794fd271aa0ff7..5d906899398153562889548938edb7c13f51fd6c 100644 --- a/neonView/AddressList_view/AddressList_view.aod +++ b/neonView/AddressList_view/AddressList_view.aod @@ -36,6 +36,10 @@ <name>12727b21-0359-4430-a9c2-54eb48e2e864</name> <entityField>CITY</entityField> </neonTableColumn> + <neonTableColumn> + <name>df4263f3-13db-40e4-8d6c-65b8f6b37512</name> + <entityField>IS_STANDARD</entityField> + </neonTableColumn> </columns> </titledListViewTemplate> </children> diff --git a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod index 8d4fbe5c22d9324a7e90b79c42d565bf17a3d49c..7cb5c87e5e89d996f8948a2b9e4974139d321f4b 100644 --- a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod +++ b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod @@ -36,6 +36,10 @@ <name>d8a7a26b-9d7f-44d7-bbb1-b0404d5b8b2f</name> <entityField>COUNTRY</entityField> </neonTableColumn> + <neonTableColumn> + <name>33bcfdad-8466-4191-b9e3-7e5d73e384a6</name> + <entityField>IS_STANDARD</entityField> + </neonTableColumn> </children> </genericMultipleViewTemplate> </children> diff --git a/neonView/CommList_view/CommList_view.aod b/neonView/CommList_view/CommList_view.aod index 3235321ba69cb9dec50c532046c5299aae76550d..69efad9092439f6af13d91ae75b6dc4aec0ed5a2 100644 --- a/neonView/CommList_view/CommList_view.aod +++ b/neonView/CommList_view/CommList_view.aod @@ -10,6 +10,7 @@ <children> <titledListViewTemplate> <name>TitledList_template</name> + <highlightingField>IS_STANDARD</highlightingField> <entityField>#ENTITY</entityField> <columns> <neonTableColumn> diff --git a/neonView/PersFilter_view/PersFilter_view.aod b/neonView/PersFilter_view/PersFilter_view.aod index 3dca796089029c3a388fd100826cd44938f92027..b8f86322d84be98eeb9378ec3f60e9846e428644 100644 --- a/neonView/PersFilter_view/PersFilter_view.aod +++ b/neonView/PersFilter_view/PersFilter_view.aod @@ -43,10 +43,12 @@ <neonTableColumn> <name>2cdfaf73-d3ee-4ad8-83ea-f50acba0335a</name> <entityField>TITLE</entityField> + <collapse v="true" /> </neonTableColumn> <neonTableColumn> <name>210cc6ab-5023-4d8a-8f2e-a6cd91d994ef</name> <entityField>FIRSTNAME</entityField> + <collapse v="true" /> </neonTableColumn> <neonTableColumn> <name>187bcb25-db19-4e35-8723-34764166b7bd</name> diff --git a/neonView/PersPreview_view/PersPreview_view.aod b/neonView/PersPreview_view/PersPreview_view.aod index d2e167f33ec60505bc7fbcbf361134afa87768d3..44c36c38d2d5d241b9567cbd68a8241829f8c646 100644 --- a/neonView/PersPreview_view/PersPreview_view.aod +++ b/neonView/PersPreview_view/PersPreview_view.aod @@ -20,6 +20,11 @@ <entityField>PersAddress_dfo</entityField> <view>AddressList_view</view> </neonViewReference> + <neonViewReference> + <name>f4f9ba7d-b969-416b-a4c2-0be82ad1c744</name> + <entityField>OrgAddress_dfo</entityField> + <view>AddressList_view</view> + </neonViewReference> <neonViewReference> <name>41e3d75c-0456-4140-b651-eb45ffb53a35</name> <entityField>PersComm_dfo</entityField> diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index b058fa28a99b05b0a27a661cddafd164f5b48794..9c02150e765abf5b0171d4efb4fa4a45282bdce3 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -2,9 +2,9 @@ <preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.0.1"> <name>_____PREFERENCES_PROJECT</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <projectName>xRM-Basic 5</projectName> + <projectName>xRM-Basic-5</projectName> <jditoMaxContentSize v="57671680" /> - <calendarCategories> + <calendarCategoriesEvent> <entry> <key>Meeting</key> <value></value> @@ -14,21 +14,7 @@ <value></value> </entry> <entry> - <key>Organisatorisch</key> - <value></value> - </entry> - </calendarCategories> - <calendarCategoriesEvent> - <entry> - <key>MeetingEvent</key> - <value></value> - </entry> - <entry> - <key>PrivatEvent</key> - <value></value> - </entry> - <entry> - <key>OrganisatorischEvent</key> + <key>Organisation</key> <value></value> </entry> </calendarCategoriesEvent> diff --git a/process/IndexSearch_lib/process.js b/process/IndexSearch_lib/process.js index afef388c81f632b9704dc7fcc8c4444f2c5542f9..355f73d542a6f979ef23dcc47be2b0f101f271da 100644 --- a/process/IndexSearch_lib/process.js +++ b/process/IndexSearch_lib/process.js @@ -1,61 +1,61 @@ -function IndexsearchUtils(){ - this.getAffectedIdValues = function(fieldname, affectedInfoContainer, updateFn){ - var affectedIds; - switch (affectedInfoContainer.action){ - case "I": - affectedIds = [affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]]; - break; - case "U": - affectedIds = updateFn.call(null, changedIdValue); - break; - case "D": - affectedIds = [affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]]; - break; - } - return affectedIds || []; - } - - this.createAffectedInfoContainer = function(changedIdValue, changedTable, action, columnsFn, oldValueFn, newValueFn){ - var res, internalStorage; - internalStorage = {}; - res = { - id: changedIdValue - ,table: changedTable - ,action: action - ,columns: null //null for autocomplete in the ADITO-designer - ,oldValues: null - ,newValues: null - }; - Object.defineProperty(res, "columns", { - get: function(){ - if (internalStorage["columns"] == undefined) - internalStorage["columns"] = columnsFn.call(null); - return internalStorage["columns"]; - } - ,set: function (v){ - internalStorage["columns"] = v; - } - }); - Object.defineProperty(res, "oldValues", { - get: function(){ - if (internalStorage["oldValues"] == undefined) - internalStorage["oldValues"] = oldValueFn.call(null); - return internalStorage["oldValues"]; - } - ,set: function (v){ - internalStorage["oldValues"] = v; - } - }); - Object.defineProperty(res, "newValues", { - get: function(){ - if (internalStorage["newValues"] == undefined) - internalStorage["newValues"] = newValueFn.call(null); - return internalStorage["newValues"]; - } - ,set: function (v){ - internalStorage["newValues"] = v; - } - }); - return res; - } +function IndexsearchUtils(){ + this.getAffectedIdValues = function(fieldname, affectedInfoContainer, updateFn){ + var affectedIds; + switch (affectedInfoContainer.action){ + case "I": + affectedIds = [affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]]; + break; + case "U": + affectedIds = updateFn.call(null, affectedInfoContainer.id); + break; + case "D": + affectedIds = [affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]]; + break; + } + return affectedIds || []; + } + + this.createAffectedInfoContainer = function(changedIdValue, changedTable, action, columnsFn, oldValueFn, newValueFn){ + var res, internalStorage; + internalStorage = {}; + res = { + id: changedIdValue + ,table: changedTable + ,action: action + ,columns: null //null for autocomplete in the ADITO-designer + ,oldValues: null + ,newValues: null + }; + Object.defineProperty(res, "columns", { + get: function(){ + if (internalStorage["columns"] == undefined) + internalStorage["columns"] = columnsFn.call(null); + return internalStorage["columns"]; + } + ,set: function (v){ + internalStorage["columns"] = v; + } + }); + Object.defineProperty(res, "oldValues", { + get: function(){ + if (internalStorage["oldValues"] == undefined) + internalStorage["oldValues"] = oldValueFn.call(null); + return internalStorage["oldValues"]; + } + ,set: function (v){ + internalStorage["oldValues"] = v; + } + }); + Object.defineProperty(res, "newValues", { + get: function(){ + if (internalStorage["newValues"] == undefined) + internalStorage["newValues"] = newValueFn.call(null); + return internalStorage["newValues"]; + } + ,set: function (v){ + internalStorage["newValues"] = v; + } + }); + return res; + } } \ No newline at end of file diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index a29b85a638e5f669c5e6f459e2849b09a36f5bbc..24a50f2516a95166d47eb787b3d8b3ad64c10027 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -5,214 +5,167 @@ import("system.datetime"); import("system.tools"); import("system.SQLTYPES"); import("Util_lib") -/** - *Class containing utilities for SQL - * - *@class - */ -function SqlUtils() -{ - var that = this; + +function SqlMaskingUtils(){ + //TODO: use callbacks for different handling? /** - * masks the function cast. + * masks the function cast of standard sql * - * @param {String} pField req - * @param {String} pDatatype req the datatypes, which should be casted to - * (varchar, integer, char, decimal or the SQLTYPES-Constants - * sowie SQLTYPES.DATE) - * @param {Integer|Interger[]} pLength req the length of the data - * decimal: [length, decimals] - * @param {String} pAlias req the database alias + * @param {String} field name of the database field that shall be castet + * @param {String} [targetDatatype] a SQLTYPES-value of the following: SQLTYPES.CHAR, SQLTYPES.VARCHAR, SQLTYPES.INTEGER, + * SQLTYPES.DECIMAL, SQLTYPES.DATE + * @param {int|int[]} targetLength specifies the length of the target data type; + * <br/>- char/varchar: length + * <br/>- decimal: [length, decimals] + * @param {String} [alias=the current alias] the alias where the statement shall be executed (this is needed to determine the database-type) * - * @return {String} + * @return {String} sql part to be included in sql-statements */ - this.cast = function(pField, pDatatype, pLength, pAlias) - { - if (pAlias == undefined) - pAlias = vars.getString("$sys.dbalias"); - var dbtype = db.getDatabaseType(pAlias); - var func = ""; - var datatype = ""; - - switch(Number(dbtype)) - { - case db.DBTYPE_ORACLE10_CLUSTER: - case db.DBTYPE_ORACLE10_THIN: - case db.DBTYPE_ORACLE10_OCI: - func = "cast"; - switch(pDatatype) - { - case "char": - case SQLTYPES.CHAR: - datatype = "char"; - break; - case "varchar": + this.cast = function (field, targetDatatype, targetLength, alias){ + /* Some informations if you want to add supported databaseTypes or dataTypes: + * You should consider using the _mapDefaults function-expression (details in the functions doc) + * However you shouldn't use the function in a "default"-Block of a switch-case because of the following behaviour: + * If a datatype is not supported you just have to NOT specify "sqlDataType" (leave it "undefined") -> an error is then raised + * Therefore you should explicitly define which Data-type is supported and which is not + */ + var dbType, functionName, sqlPart, sqlDataType, _mapDefaults; + if (alias == undefined) + alias = vars.getString("$sys.dbalias"); + dbType = db.getDatabaseType(alias); + functionName = "cast";//overwrite this in the "switch (dbType)" if needed with your DBMS + + /** + * handles default-scenarios for mapping input-targetDatatype to a string for a sql-statement + * e.g. SQLTYPES.INTEGER --> int + * @param {Number} dataType input as a value of "SQLTYPES." that will be mapped to a string + * @return {String} the mapped dataType for using in a sql-statement + */ + _mapDefaults = function (dataType){ + var res; + switch(dataType) + { + case SQLTYPES.CHAR: + res = "char"; + break; + case SQLTYPES.VARCHAR: + res = "char"; + break; + case SQLTYPES.INTEGER: + res = "int"; + break; + case SQLTYPES.DECIMAL: + res = "decimal"; + break; + case SQLTYPES.DATE: + res = "date"; + break; + } + return res; + } + switch (dbType) { + case db.DBTYPE_DERBY10: + switch(targetDatatype) { case SQLTYPES.VARCHAR: - datatype = "varchar2"; - break; - case "integer": - case SQLTYPES.INTEGER: - datatype = "number(22,0)"; - break; - case "decimal": - case SQLTYPES.DECIMAL: - datatype = "decimal"; - break; - case SQLTYPES.DATE: - datatype = "date"; + // Because of a Derby bug, you can't cast INTEGER into VARCHAR + // Therefor first cast to char then to varchar + // https://issues.apache.org/jira/browse/DERBY-2072 + field = "rtrim(" + cast(field, SQLTYPES.CHAR, targetLength, alias) + ")"; + sqlDataType = "varchar"; break; - } - break; - case db.DBTYPE_POSTGRESQL8: - func = "cast"; - switch(pDatatype) - { - case "char": case SQLTYPES.CHAR: - datatype = "char"; - break; - case "varchar": - case SQLTYPES.VARCHAR: - datatype = "varchar"; + //TODO: throw error if(targetLength > 254)? https://db.apache.org/derby/docs/10.14/ref/rrefsqlj13733.html + sqlDataType = "char"; break; - case "integer": - case SQLTYPES.INTEGER: - datatype = "numeric(22,0)"; - break; - case "decimal": case SQLTYPES.DECIMAL: - datatype = "numeric"; - break; - case SQLTYPES.DATE: - return pField + "::date"; - } - break; - case db.DBTYPE_SQLSERVER2000: - func = "cast"; - switch(pDatatype) - { - case "char": - case SQLTYPES.CHAR: - datatype = "char"; - break; - case "varchar": - case SQLTYPES.VARCHAR: - datatype = "varchar"; - break; - case "integer": case SQLTYPES.INTEGER: - datatype = "int"; - break; - case "decimal": - case SQLTYPES.DECIMAL: - datatype = "decimal"; - break; case SQLTYPES.DATE: - datatype = "date"; + sqlDataType = _mapDefaults(dataType); break; } break; - case db.DBTYPE_MYSQL4: case db.DBTYPE_MARIADB10: - func = "cast"; - switch(pDatatype) - { - case "char": - case SQLTYPES.CHAR: - datatype = "char"; - break; - case "varchar": + case db.DBTYPE_MYSQL4: + switch(targetDatatype) { case SQLTYPES.VARCHAR: - datatype = "char"; - break; - case "integer": + case SQLTYPES.CHAR: case SQLTYPES.INTEGER: - datatype = "integer"; - break; - case "decimal": case SQLTYPES.DECIMAL: - datatype = "decimal"; - break; case SQLTYPES.DATE: - datatype = "date"; + sqlDataType = _mapDefaults(targetDatatype); break; } break; - case db.DBTYPE_DERBY10: - func = "cast"; - if(pLength > 254) - pLength = 254; + case db.DBTYPE_ORACLE10_CLUSTER: + case db.DBTYPE_ORACLE10_THIN: + case db.DBTYPE_ORACLE10_OCI: switch(pDatatype) { - - case "varchar": case SQLTYPES.VARCHAR: - // Because of a Derby bug, you can't cast INTEGER into VARCHAR - // Therefor first cast to char then to varchar - // https://issues.apache.org/jira/browse/DERBY-2072 - func = "rtrim(" + func; - pField = " cast( " + pField + " as char("+pLength+")) "; - datatype = "varchar"; - pLength += ")"; - break; - - case "char": - case SQLTYPES.CHAR: - datatype = "char"; + datatype = "varchar2"; break; - case "integer": case SQLTYPES.INTEGER: - datatype = "int"; + datatype = "number"; + targetLength = "10" break; - case "decimal": + case SQLTYPES.CHAR: case SQLTYPES.DECIMAL: - datatype = "numeric"; - break; case SQLTYPES.DATE: - datatype = "date"; + sqlDataType = _mapDefaults(targetDatatype); break; } break; - case db.DBTYPE_FIREBIRD250: - func = "cast"; + case db.DBTYPE_POSTGRESQL8: switch(pDatatype) { - case "char": + case SQLTYPES.DATE: + case SQLTYPES.DECIMAL: + case SQLTYPES.INTEGER: case SQLTYPES.CHAR: - datatype = "char"; - break; - case "varchar": case SQLTYPES.VARCHAR: - datatype = "varchar"; - break; - case "integer": - case SQLTYPES.INTEGER: - datatype = "numeric(22,0)"; - break; - case "decimal": - case SQLTYPES.DECIMAL: - datatype = "numeric"; + sqlDataType = _mapDefaults(targetDatatype); break; + } + break; + case db.DBTYPE_SQLSERVER2000: case SQLTYPES.DATE: - datatype = "date"; + case SQLTYPES.DECIMAL: + case SQLTYPES.INTEGER: + case SQLTYPES.CHAR: + case SQLTYPES.VARCHAR: + sqlDataType = _mapDefaults(targetDatatype); break; - } + case db.DBTYPE_FIREBIRD250: + //TODO: firebird support? break; } - - if(pLength == undefined) - pLength = ""; - else if(pLength != "") + + if (sqlDataType == undefined) { + throw new Error("sqlDataType");//TODO: add usefull message + } + + if(targetLength == undefined) + targetLength = ""; + else if(targetLength != "") { - if(typeof(pLength == "object") && (pLength instanceof Array)) - pLength = "(" + pLength.join(", ") + ")"; + if(typeof(targetLength == "object") && (targetLength instanceof Array)) + targetLength = "(" + targetLength.join(", ") + ")"; else - pLength = "(" + pLength + ")"; + targetLength = "(" + targetLength + ")"; } + + sqlPart = functionName + "(" + field + " as " + sqlDataType + targetLength + ")"; + return sqlPart; + } +} - return func + "(" + pField + " as " + datatype + pLength + ")"; - } - +/** + *Class containing utilities for SQL + *@deprecated use SqlMaskingUtils + *@class + */ +function LegacySqlUtils() +{ + var that = this; /** * masks the cast function for lob datatypes(clob, blob) * diff --git a/process/_test_clientProcess/_test_clientProcess.aod b/process/_test_clientProcess/_test_clientProcess.aod new file mode 100644 index 0000000000000000000000000000000000000000..2d2705e6a54f6da60f77a06eae59912ed7249776 --- /dev/null +++ b/process/_test_clientProcess/_test_clientProcess.aod @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7"> + <name>_test_clientProcess</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/_test_clientProcess/process.js</process> + <alias>Data_alias</alias> +</process> diff --git a/process/_test_clientProcess/process.js b/process/_test_clientProcess/process.js new file mode 100644 index 0000000000000000000000000000000000000000..c0f670200b5bac184044e2778c259e66628ad490 --- /dev/null +++ b/process/_test_clientProcess/process.js @@ -0,0 +1,103 @@ +import("system.SQLTYPES"); +import("system.util"); +import("system.logging"); +import("system.vars"); +import("system.db"); + +var u = {}; +(function (object) { + + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function InvalidCharacterError(message) { + this.message = message; + } + InvalidCharacterError.prototype = new Error; + InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + + // encoder + // [https://gist.github.com/999166] by [https://github.com/nignag] + object.btoa || ( + object.btoa = function (input) { + var str = String(input); + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars, output = ''; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8) + ) { + charCode = str.charCodeAt(idx += 3/4); + if (charCode > 0xFF) { + throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + } + block = block << 8 | charCode; + } + return output; + }); + + // decoder + // [https://gist.github.com/1020396] by [https://github.com/atk] + object.atob || ( + object.atob = function (input) { + var str = String(input).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /= + if (str.length % 4 == 1) { + throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + } + for ( + // initialize result and counters + var bc = 0, bs, buffer, idx = 0, output = ''; + // get next character + buffer = str.charAt(idx++); + // character found in table? initialize bit storage and add its ascii value; + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + // try to find character in table (0-63, not found => -1) + buffer = chars.indexOf(buffer); + } + return output; + }); + +}(u)); + + + +function uuidToBase64(uuid) { + return hexToBase64(uuid.replace("-", "", "g")); +} + +function hexToBase64(hexstring) { + return u.btoa(hexstring.match(/\w{2}/g).map(function(a) { + return String.fromCharCode(parseInt(a, 16)); + }).join("")); +} + + + + + + + + + +var id; +id = util.getNewUUID();//b592c499-84d9-4066-b883-0d79b5245bc1 +id = "b592c499-84d9-4066-b883-0d79b5245bc1"; +id = uuidToBase64(id); + +var cols = ["TESTID", "DATA", "USER_NEW", "DATE_NEW"]; +var vals = [id, "datahere", vars.get("$sys.user"), vars.get("$sys.staticdate")]; +var types = null; +//db.insertData("TEST", cols, types, vals); +var q = ["select " + cols.join(", ") + " from TEST where TESTID = ?", [ + [id, SQLTYPES.BINARY] +]]; +logging.log("query:" + db.translateStatement(q)); +logging.show(db.array(db.ROW, q)); \ No newline at end of file