Skip to content
Snippets Groups Projects
Commit 2cf3de73 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Merge origin/master into #1035025_SALUTATION

Conflicts:
	entity/Person_entity/Person_entity.aod
	entity/Person_entity/entityfields/salutation/possibleItemsProcess.js
	others/db_changes/masterChangelog.xml
parents 1569043f e5f863eb
No related branches found
No related tags found
No related merge requests found
Showing
with 202 additions and 53 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/application/1.1.8"> <application xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/application/1.1.8">
<name>_____SYSTEM_APPLICATION</name> <name>_____SYSTEM_APPLICATION</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<entityNode name="_____SYSTEM_COMPANY" kind="200"> <entityNode name="_____SYSTEM_COMPANY" kind="200" />
<node name="Group" kind="123" title=""> <company>
<node name="Group2" kind="123" title=""> <name>company</name>
<node name="Util_lib" kind="103" /> <backgroundColor v="0xff83cbd8" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" /> </company>
</node> </application>
</node>
</entityNode>
<company>
<name>company</name>
<backgroundColor v="0xff83cbd8" />
</company>
</application>
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
<fieldName>AttributeChildren</fieldName> <fieldName>AttributeChildren</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>ba8046ba-f58c-48f1-9c35-fe897247534a</name>
<entityName>Person_entity</entityName>
<fieldName>Attributes</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
......
import("system.util"); import("system.util");
import("system.vars");
import("system.result"); import("system.result");
import("system.neon"); import("system.neon");
import("system.vars");
//the code (tasknumber) value is genereated before save to prevent duplicate numbers
//so: no need to display it on new
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(neon.COMPONENTSTATE_INVISIBLE); result.string(util.getNewUUID());
else \ No newline at end of file
result.string(neon.COMPONENTSTATE_READONLY);
\ No newline at end of file
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
<name>db</name> <name>db</name>
<alias>Data_alias</alias> <alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/KeywordAttribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <conditionProcess>%aditoprj%/entity/KeywordAttribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBDelete>%aditoprj%/entity/KeywordAttribute_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>bd113d67-34ab-4708-b0e5-60a44332e6b8</name> <name>bd113d67-34ab-4708-b0e5-60a44332e6b8</name>
......
import("Sql_lib");
import("system.db");
var cond = SqlCondition.begin().andPrepareVars("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ATTRIBUTE_ID", "$field.AB_KEYWORD_ATTRIBUTEID").build("1=2");
db.deleteData("AB_KEYWORD_ATTRIBUTERELATION", cond);
\ No newline at end of file
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<mandatory v="true" /> <mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/container/possibleItemsProcess.js</possibleItemsProcess> <possibleItemsProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/container/possibleItemsProcess.js</possibleItemsProcess>
<groupable v="true" /> <groupable v="true" />
<state>READONLY</state>
<stateProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/container/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>AB_KEYWORD_ENTRYID</name> <name>AB_KEYWORD_ENTRYID</name>
...@@ -30,10 +32,13 @@ ...@@ -30,10 +32,13 @@
</entityField> </entityField>
<entityField> <entityField>
<name>KEYID</name> <name>KEYID</name>
<documentation>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/documentation.adoc</documentation>
<title>Key</title> <title>Key</title>
<mandatory v="true" />
<state>READONLY</state> <state>READONLY</state>
<stateProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/stateProcess.js</stateProcess> <stateProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/valueProcess.js</valueProcess>
<onValidation>%aditoprj%/entity/KeywordEntry_entity/entityfields/keyid/onValidation.js</onValidation>
</entityField> </entityField>
<entityField> <entityField>
<name>TITLE</name> <name>TITLE</name>
...@@ -300,7 +305,7 @@ ...@@ -300,7 +305,7 @@
<alias>Data_alias</alias> <alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <conditionProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <orderClauseProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<onDBUpdate>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate> <onDBDelete>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>52acbfe0-57f4-4614-83af-9882e168f431</name> <name>52acbfe0-57f4-4614-83af-9882e168f431</name>
......
`CONTAINER` is the a name and used for grouping keyword-entries. This is was a keyword-container essentially is. `CONTAINER` is the a name and used for grouping keyword-entries. This is was a keyword-container essentially is.
\ No newline at end of file After creation of an entry it cannot be changed anymore.
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
/*allowing the CONTAINER to change later would result in a lot of problems like
* - what happens to SORTING-value?
* - what happens with already created keyword-attributerelations?
* - what happens when a key is specified twice after the change?
* - what happens when the keywordentry has been already used?
*
* Therefore just forbid to change it after the record has been inserted
*/
var fieldState;
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
fieldState = neon.COMPONENTSTATE_AUTO;
else
fieldState = neon.COMPONENTSTATE_READONLY;
result.string(fieldState);
\ No newline at end of file
The key of an keyword-entry is a internal, technical representation which is stored in references.
It's unique within a keyword-container but not within the whole keyword-module (like the `AB_KEYWORD_ENTRYID` is).
A UUID is generated and used as preset-value but it's possible to overwrite the `KEYID` with an own value (as long as the custom key follows the rules, like keyword-entry-level-uniqueness)
This could for example be ISO-standardised value or a value that is maintained within an ERP-system.
After creation of an entry it cannot be changed anymore.
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.db");
import("system.vars");
import("Sql_lib");
import("Entity_lib");
var container = vars.get("$field.CONTAINER");
var keyId = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.KEYID")).trim();
//a KEY has always to be unique within one container and since the user can specify the key on insert we've to ensure that it's unique
if (container && keyId)
{
var selfEntryId = vars.get("$field.AB_KEYWORD_ENTRYID");
var sqlMasks = new SqlMaskingUtils();
var alreadyExistsSql = SqlCondition.begin()
.andPrepare(sqlMasks.trim("AB_KEYWORD_ENTRY.KEYID"), keyId, null, SqlUtils.getSingleColumnType("AB_KEYWORD_ENTRY", "KEYID"))
.andPrepare("AB_KEYWORD_ENTRY.CONTAINER", container)
.andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", selfEntryId, "# != ?")
.buildSql("select AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID from AB_KEYWORD_ENTRY");
var alreadyExistantEntryId = db.cell(alreadyExistsSql);
if (alreadyExistantEntryId != "")
result.string(translate.text("the specified key has to be unique for that container but does already exist"));
}
\ No newline at end of file
...@@ -3,5 +3,5 @@ import("system.result"); ...@@ -3,5 +3,5 @@ import("system.result");
import("system.neon"); import("system.neon");
import("system.vars"); import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
result.string(util.getNewUUID()); result.string(util.getNewUUID());
\ No newline at end of file
import("Sql_lib");
import("system.db");
var cond = SqlCondition.begin().andPrepareVars("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID", "$field.AB_KEYWORD_ENTRYID").build("1=2");
db.deleteData("AB_KEYWORD_ATTRIBUTERELATION", cond);
\ No newline at end of file
import("system.translate");
import("system.db");
import("system.vars");
import("system.text");
import("system.neon");
import("Sql_lib");
var changedFields = vars.get("$local.changed");
//whenever the container is changed data that depends on the keyword-container has be "fixed" to keep consistency
//this could be information like Keyword-attributes or the sorting-position
// TODO: maybe it'd be better to lock KeywordContainer as read-only after creation
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && changedFields.indexOf("AB_KEYWORD_ENTRY.CONTAINER") > -1)
{
var keyContainer = vars.get("$field.CONTAINER");
if (keyContainer)
{
var cond = SqlCondition.begin().andPrepare("AB_KEYWORD_ENTRY.CONTAINER", keyContainer);
var maskingHelper = new SqlMaskingUtils();
var newCodeNumber = db.cell(cond.buildSql("select " + maskingHelper.max("AB_KEYWORD_ENTRY.SORTING") + " from AB_KEYWORD_ENTRY", "1 = 2"));
newCodeNumber = Number(newCodeNumber);//if no number exists till no, start value will be 1 (due to: ++0)
if (isNaN(newCodeNumber))
throw new TypeError(translate.text("The code number is not a valid number."));
var cols = ["SORTING"];
var vals = [++newCodeNumber];
cond.clear().andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", vars.get("$sys.uid"));
db.updateData("AB_KEYWORD_ENTRY", cols, null, vals, cond.build("1 = 2"));
}
}
\ No newline at end of file
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
<linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/linkedContextProcess.js</linkedContextProcess> <linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/linkedContextProcess.js</linkedContextProcess>
<mandatory v="true" /> <mandatory v="true" />
<stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js</stateProcess> <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/titleProcess.js</titleProcess>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>OBJECT2_TYPE</name> <name>OBJECT2_TYPE</name>
...@@ -153,6 +155,14 @@ ...@@ -153,6 +155,14 @@
<targetIdField>OBJECT2_ROWID</targetIdField> <targetIdField>OBJECT2_ROWID</targetIdField>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc</documentation> <documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc</documentation>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>cb49ee3d-4497-4edc-90b6-82d397464f75</name>
<entityName>Organisation_entity</entityName>
<fieldName>TaskObjectRelations</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children> <children>
<entityParameter> <entityParameter>
<name>AnyObjectRowid_param</name> <name>AnyObjectRowid_param</name>
...@@ -165,7 +175,7 @@ ...@@ -165,7 +175,7 @@
<entityParameter> <entityParameter>
<name>Object1Rowid_param</name> <name>Object1Rowid_param</name>
<expose v="true" /> <expose v="true" />
<mandatory v="true" /> <mandatory v="false" />
</entityParameter> </entityParameter>
<entityParameter> <entityParameter>
<name>Object1Type_param</name> <name>Object1Type_param</name>
...@@ -175,7 +185,7 @@ ...@@ -175,7 +185,7 @@
<entityParameter> <entityParameter>
<name>Object2Rowid_param</name> <name>Object2Rowid_param</name>
<expose v="true" /> <expose v="true" />
<mandatory v="true" /> <mandatory v="false" />
</entityParameter> </entityParameter>
<entityParameter> <entityParameter>
<name>Object2Type_param</name> <name>Object2Type_param</name>
...@@ -323,6 +333,14 @@ ...@@ -323,6 +333,14 @@
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityParameter>
<name>Object2RowidTitle_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>EMPTY</name>
</entityField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.neon");
import("system.vars");
import("system.result");
import("system.db");
import("Context_lib");
var recordstate = vars.get("$sys.recordstate");
if (recordstate == neon.OPERATINGSTATE_EDIT)
{
if (vars.exists("$field.OBJECT1_ROWID") && vars.get("$field.OBJECT1_ROWID") && vars.exists("$field.OBJECT1_TYPE") && vars.get("$field.OBJECT1_TYPE"))
{
result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.OBJECT1_TYPE"), vars.get("$field.OBJECT1_ROWID"))));
}
}
\ No newline at end of file
import("system.translate");
import("system.vars");
import("system.result");
import("Context_lib");
result.string(vars.exists("$param.Object2RowidTitle_param") ? vars.get("$param.Object2RowidTitle_param") : "Object 2");
\ No newline at end of file
...@@ -476,6 +476,57 @@ ...@@ -476,6 +476,57 @@
<fieldName>LanguagesISO3Code</fieldName> <fieldName>LanguagesISO3Code</fieldName>
</dependency> </dependency>
</entityConsumer> </entityConsumer>
<entityConsumer>
<name>Salesprojects</name>
<title>Salesprojects</title>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Salesproject_entity</entityName>
<fieldName>Salesprojects</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContactId_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/salesprojects/children/contactid_param/code.js</code>
</entityParameter>
</children>
</entityConsumer>
<entityActionField>
<name>newTask</name>
<fieldType>ACTION</fieldType>
<title>New task</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newtask/onActionProcess.js</onActionProcess>
<iconId>VAADIN:TASKS</iconId>
</entityActionField>
<entityConsumer>
<name>TaskObjectRelations</name>
<title>Tasks</title>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>ObjectRelation_entity</entityName>
<fieldName>BothObjects</fieldName>
</dependency>
<children>
<entityParameter>
<name>Object1Rowid_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/taskobjectrelations/children/object1rowid_param/code.js</code>
</entityParameter>
<entityParameter>
<name>Object1Type_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/taskobjectrelations/children/object1type_param/code.js</code>
</entityParameter>
<entityParameter>
<name>Object2Type_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/taskobjectrelations/children/object2type_param/code.js</code>
</entityParameter>
<entityParameter>
<name>Object2RowidTitle_param</name>
<code>%aditoprj%/entity/Organisation_entity/entityfields/taskobjectrelations/children/object2rowidtitle_param/code.js</code>
</entityParameter>
</children>
</entityConsumer>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
...@@ -486,14 +537,14 @@ ...@@ -486,14 +537,14 @@
<onDBUpdate>%aditoprj%/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate> <onDBUpdate>%aditoprj%/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>ff0fa64f-4d73-49b3-bc02-02018392e838</name> <name>47c6c065-ae0e-4cee-b913-335570e3221c</name>
<tableName>ORGANISATION</tableName> <tableName>ORGANISATION</tableName>
<primaryKey>ORGANISATIONID</primaryKey> <primaryKey>ORGANISATIONID</primaryKey>
<isUIDTable v="true" /> <isUIDTable v="true" />
<readonly v="false" /> <readonly v="false" />
</linkInformation> </linkInformation>
<linkInformation> <linkInformation>
<name>e3033b6f-966e-415a-9390-c61d5a1b19fc</name> <name>e6120ee7-e6c3-4f60-9327-417627ba1fac</name>
<tableName>CONTACT</tableName> <tableName>CONTACT</tableName>
<primaryKey>CONTACTID</primaryKey> <primaryKey>CONTACTID</primaryKey>
<isUIDTable v="false" /> <isUIDTable v="false" />
......
import("system.vars");
import("system.neon");
import("Context_lib");
var params = {};
params["ObjectType_param"] = ContextUtils.getCurrentContextId();
params["RowId_param"] = vars.get("$field.ORGANISATIONID");
neon.openContext("Task", null, null, neon.OPERATINGSTATE_NEW, params);
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.ORGANISATIONID"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.ORGANISATIONID"));
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment