Skip to content
Snippets Groups Projects
Commit 2da3aebd authored by S.Listl's avatar S.Listl
Browse files

Indexes added, attribute usage inheritance

parent 142dd3fb
No related branches found
No related tags found
No related merge requests found
Showing
with 197 additions and 14 deletions
......@@ -5130,5 +5130,77 @@
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/person/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>OFFER</name>
<title>Offer</title>
<icon>VAADIN:CART</icon>
<active v="false" />
<idColumn>OFFERID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js</query>
<resultContextNeon>Offer</resultContextNeon>
<affectedTables>
<element>OFFER</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/offer/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>SALESORDER</name>
<title>Order</title>
<icon>VAADIN:DOLLAR</icon>
<active v="false" />
<idColumn>SALESORDERID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js</query>
<resultContextNeon>Order</resultContextNeon>
<affectedTables>
<element>SALESORDER</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/salesorder/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>CONTRACT</name>
<title>Contract</title>
<icon>VAADIN:FILE_TEXT</icon>
<active v="false" />
<idColumn>CONTRACT</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<resultContextNeon>Contract</resultContextNeon>
<affectedTables>
<element>CONTRACT</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/contract/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>PRODUCT</name>
<title>Product</title>
<icon>VAADIN:HAMMER</icon>
<active v="false" />
<idColumn>PRODUCT</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<resultContextNeon>Product</resultContextNeon>
<affectedTables>
<element>PRODUCT</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/product/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>SALESPROJECT</name>
<title>Salesproject</title>
<icon>VAADIN:BOOK_DOLLAR</icon>
<active v="false" />
<idColumn>SALESPROJECT</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<resultContextNeon>Salesproject</resultContextNeon>
<affectedTables>
<element>SALESPROJECT</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/salesproject/affectedIds.js</affectedIds>
</indexSearchGroup>
</indexSearchGroups>
</aliasDefinition>
import("system.vars");
import("system.result");
result.object([vars.getString("$local.idvalue")]);
\ No newline at end of file
import("system.vars");
import("system.result");
result.object([vars.getString("$local.idvalue")]);
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.calendars");
import("system.db");
import("Sql_lib");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select OFFERID, "
+ "OFFERCODE as TITLECOLUMN, "
+ sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, OFFERCODE, ORGNAME, CUSTOMERCODE "
+ " from OFFER "
+ " join CONTACT on OFFER.CONTACT_ID = CONTACTID "
+ " join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID "
+ queryCondition + " order by OFFERCODE ";
result.string(sqlQuery);
\ No newline at end of file
import("system.vars");
import("system.result");
result.object([vars.getString("$local.idvalue")]);
\ No newline at end of file
import("system.vars");
import("system.result");
result.object([vars.getString("$local.idvalue")]);
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.calendars");
import("system.db");
import("Sql_lib");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select SALESORDERID, "
+ " ORDERCODE as TITLECOLUMN, "
+ sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, ORDERCODE, ORGNAME, CUSTOMERCODE "
+ " from SALESORDER "
+ " join RELATION on SALESORDER.RELATION_ID = RELATIONID "
+ " join ORG on ORGID = RELATION.ORG_ID "
+ queryCondition + " order by ORDERCODE ";
result.string(sqlQuery);
\ No newline at end of file
import("system.vars");
import("system.result");
result.object([vars.getString("$local.idvalue")]);
\ No newline at end of file
......@@ -99,6 +99,7 @@
<entityParameter>
<name>ObjectRowId_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
......
import("system.logging");
import("system.vars");
import("system.db");
import("system.result");
import("Sql_lib");
var cond = SqlCondition.begin()
.andPrepareVars("AB_ATTRIBUTERELATION.OBJECT_ROWID", "$param.ObjectRowId_param");
if (vars.exists("$param.FilteredAttributeIds_param") && vars.get("$param.FilteredAttributeIds_param"))
if (vars.exists("$param.ObjectRowId_param"))
logging.log(vars.get("$param.ObjectRowId_param"))
if (vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param")
&& vars.exists("$param.FilteredAttributeIds_param") && vars.get("$param.FilteredAttributeIds_param"))
{
var filteredIds = JSON.parse(vars.get("$param.FilteredAttributeIds_param"));
var filteredIdsCondition = new SqlCondition();
......
......@@ -13,7 +13,12 @@
<name>OBJECT_TYPE</name>
<title>Module</title>
<consumer>Context</consumer>
<valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/object_type/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/object_type/displayValueProcess.js</displayValueProcess>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>AB_ATTRIBUTEUSAGEID</name>
......@@ -71,6 +76,9 @@
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBInsert>%aditoprj%/entity/AttributeUsage_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
<onDBUpdate>%aditoprj%/entity/AttributeUsage_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<onDBDelete>%aditoprj%/entity/AttributeUsage_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<linkInformation>
<linkInformation>
<name>c30f5670-580e-4621-95dd-0fec4a99190f</name>
......
......@@ -3,4 +3,6 @@ import("system.result");
import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.AttributeId_param") && vars.get("$param.AttributeId_param") != null)
result.string(vars.get("$param.AttributeId_param"));
\ No newline at end of file
result.string(vars.get("$param.AttributeId_param"));
else if (vars.get("$field.AB_ATTRIBUTE_ID"))
result.string(vars.get("$field.AB_ATTRIBUTE_ID"));
\ No newline at end of file
import("system.vars");
//this is a workaround to get the old value in the onDBUpdate process
//@TODO replace this when it's possible to get the old value in onDBUpdate
vars.set("$context.originalObjectType", vars.get("$field.OBJECT_TYPE"));
\ No newline at end of file
import("system.vars");
import("Attribute_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
var objectType = vars.get("$field.OBJECT_TYPE");
AttributeUsageUtil.deleteChildrenUsages(attributeId, objectType);
\ No newline at end of file
import("system.vars");
import("Attribute_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
var objectType = vars.get("$field.OBJECT_TYPE");
AttributeUsageUtil.insertChildrenUsages(attributeId, objectType);
AttributeUsageUtil.removeDuplicates(attributeId);
\ No newline at end of file
import("system.vars");
import("Attribute_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
var oldObjectType = vars.get("$context.originalObjectType");
var newObjectType = vars.get("$field.OBJECT_TYPE");
AttributeUsageUtil.updateChildrenUsages(attributeId, oldObjectType, newObjectType);
AttributeUsageUtil.removeDuplicates(attributeId);
\ No newline at end of file
......@@ -240,6 +240,11 @@
<title>Name</title>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/name_with_type/valueProcess.js</valueProcess>
</entityField>
<entityActionField>
<name>tsest</name>
<fieldType>ACTION</fieldType>
<onActionProcess>%aditoprj%/entity/Attribute_entity/entityfields/tsest/onActionProcess.js</onActionProcess>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -8,5 +8,7 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.
{
var type = AttributeHandler.begin(vars.get("$field.ATTRIBUTE_PARENT_ID")).getAttributeType();
if (type == $AttributeTypes.COMBO)
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
result.string(neon.COMPONENTSTATE_READONLY);
}
else if (vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW)
result.string(neon.COMPONENTSTATE_READONLY);
\ No newline at end of file
import("system.vars");
import("system.result");
import("Attribute_lib");
result.string(vars.getString("$field.AB_ATTRIBUTEID"));
var type = vars.get("$field.ATTRIBUTE_TYPE").trim();
if (type == $AttributeTypes.GROUP || type == $AttributeTypes.COMBO)
result.string(vars.getString("$field.AB_ATTRIBUTEID"));
import("system.neon");
import("system.vars");
import("system.result");
var type;
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
type = "GETGROUPS";
else
type = vars.getString("$field.ATTRIBUTE_TYPE").trim()
result.string(type);
result.string(vars.getString("$field.ATTRIBUTE_TYPE").trim());
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