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

[Projekt: Entwicklung - Neon][TicketNr.: 1032314][Attribut-Entity erstellen]

parent ca2795c0
No related branches found
No related tags found
No related merge requests found
Showing
with 391 additions and 1 deletion
......@@ -26,6 +26,13 @@
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node>
</node>
<node name="Administration" kind="123" title="Administration">
<icon>NEON:WRENCH</icon>
<node name="Group3" kind="123" title="">
<node name="Attribute_context" kind="10077" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node>
</node>
</entityNode>
<company>
<name>company</name>
......
......@@ -66,7 +66,7 @@
</entityField>
<entityField>
<name>STATE</name>
<title>State</title>
<title>${ADDRESS_STATE}</title>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/state/mandatoryProcess.js</mandatoryProcess>
</entityField>
<entityField>
......
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.1.1">
<name>AttributeRelation_entity</name>
<title>Attributes</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainer>db</recordContainer>
<entityFields>
<entityIncomingField>
<name>#INCOMING</name>
</entityIncomingField>
<entityField>
<name>AB_ATTRIBUTERELATIONID</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>AB_ATTRIBUTE_ID</name>
<title>Attribute</title>
<mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js</possibleItemsProcess>
<stateProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js</stateProcess>
</entityField>
<entityField>
<name>OBJECT_ROWID</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>OBJECT_TYPE</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_NEW</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_EDIT</name>
</entityField>
<entityField>
<name>USER_NEW</name>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/user_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_EDIT</name>
</entityField>
<entityField>
<name>ATTRIBUTERELATION_VALUE</name>
<title>Value</title>
<contentTypeProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js</contentTypeProcess>
<valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js</valueProcess>
<onValueChange>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>CHAR_VALUE</name>
<state>EDITABLE</state>
</entityField>
<entityIncomingField>
<name>OrgAttr_dfi</name>
<fieldType>DEPENDENCY_IN</fieldType>
<recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>2226c7fc-45d4-45e8-a5d3-a5e13dff4b59</name>
<entityName>Org_entity</entityName>
<fieldName>OrgAttr_dfo</fieldName>
<isOutgoing v="false" />
</entityDependency>
</dependencies>
</entityIncomingField>
<entityField>
<name>ATTRIBUTE_NAME</name>
</entityField>
<entityParameter>
<name>objectRowId</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>DATE_VALUE</name>
<contentType>DATE</contentType>
<state>EDITABLE</state>
</entityField>
<entityField>
<name>NUMBER_VALUE</name>
<contentType>NUMBER</contentType>
<state>EDITABLE</state>
</entityField>
<entityField>
<name>ATTRIBUTE_TYPE</name>
</entityField>
<entityParameter>
<name>objectType</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>1ffc8a7d-56a2-4516-abd9-071e857058e9</name>
<tableName>AB_ATTRIBUTERELATION</tableName>
<primaryKey>AB_ATTRIBUTERELATIONID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>AB_ATTRIBUTE_ID.value</name>
<recordfield>AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_ATTRIBUTERELATIONID.value</name>
<recordfield>AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_ROWID.value</name>
<recordfield>AB_ATTRIBUTERELATION.OBJECT_ROWID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_TYPE.value</name>
<recordfield>AB_ATTRIBUTERELATION.OBJECT_TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<recordfield>AB_ATTRIBUTERELATION.DATE_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<recordfield>AB_ATTRIBUTERELATION.DATE_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<recordfield>AB_ATTRIBUTERELATION.USER_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<recordfield>AB_ATTRIBUTERELATION.USER_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CHAR_VALUE.value</name>
<recordfield>AB_ATTRIBUTERELATION.CHAR_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_VALUE.value</name>
<recordfield>AB_ATTRIBUTERELATION.DATE_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>NUMBER_VALUE.value</name>
<recordfield>AB_ATTRIBUTERELATION.NUMBER_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ATTRIBUTE_NAME.value</name>
<expression>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ATTRIBUTE_TYPE.value</name>
<expression>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
import("system.db");
import("system.result");
import("Sql_lib");
//get all attributes for that context
var attrSql = "select AB_ATTRIBUTEID, ATTRIBUTE_NAME from AB_ATTRIBUTE";
attrSql = SqlCondition.begin() //TODO: add condition
.buildSelect(attrSql);
result.object(db.table(attrSql));
\ No newline at end of file
//import("system.vars");
//import("system.result");
//
//if (vars.get("$field.ATTRIBUTERELATION_VALUE"))
// result.string("READONLY");
\ No newline at end of file
import("system.neon");
import("system.util");
import("system.vars");
import("system.result");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(util.getNewUUID());
\ No newline at end of file
import("system.vars");
import("system.result");
import("Attribute_lib");
var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeType();
result.string(attrType);
\ No newline at end of file
import("system.logging");
import("system.vars");
import("Entity_lib");
import("Attribute_lib");
attrValue = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.ATTRIBUTERELATION_VALUE"));
var attribute = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID"));
attribute.setAttributeValue(attrValue);
//logging.log("field is " + field + " and attrvalue is " + attrValue)
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.vars");
import("Attribute_lib");
var attrValue = vars.getString("$field.ATTRIBUTERELATION_VALUE");
var attrValue = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeValue();
if (attrValue != "")
{
logging.log("value of " + vars.get("$field.AB_ATTRIBUTERELATIONID") + " (" + vars.get("$field.ATTRIBUTE_NAME") + ") = " + attrValue)
result.string(attrValue);
}
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(vars.getString("$sys.date"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectRowId") && vars.get("$param.objectRowId") != null)
result.string(vars.get("$param.objectRowId"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectType") && vars.get("$param.objectType") != null)
result.string(vars.get("$param.objectType"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(vars.getString("$sys.user"));
\ No newline at end of file
import("system.db");
import("system.vars");
import("system.result");
import("Sql_lib");
if (vars.exists("$param.objectRowId"))
{
cond = SqlCondition.begin()
.andPrepare("AB_ATTRIBUTERELATION.OBJECT_ROWID", vars.get("$param.objectRowId"))
.build();
result.string(db.translateCondition(cond));
}
else
result.string("1 = 2");
\ No newline at end of file
import("system.result");
result.string("select ATTRIBUTE_NAME from AB_ATTRIBUTE where AB_ATTRIBUTE.AB_ATTRIBUTEID = AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID");
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.1.1">
<name>Attribute_entity</name>
<title>Attributes</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<iconId>VAADIN:TAG</iconId>
<recordContainer>db</recordContainer>
<entityFields>
<entityIncomingField>
<name>#INCOMING</name>
</entityIncomingField>
<entityField>
<name>ATTRIBUTE_NAME</name>
<title>Name</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>ATTRIBUTE_TYPE</name>
<title>Type</title>
<mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityField>
<name>AB_ATTRIBUTEID</name>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/ab_attributeid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>ATTRIBUTE_PARENT_ID</name>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_NEW</name>
<contentType>DATE</contentType>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_EDIT</name>
<contentType>DATE</contentType>
</entityField>
<entityField>
<name>USER_NEW</name>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/user_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_EDIT</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Attribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>b5fd38e1-b315-4e66-bd68-569dfc04710c</name>
<tableName>AB_ATTRIBUTE</tableName>
<primaryKey>AB_ATTRIBUTEID</primaryKey>
<isUIDTable v="true" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>AB_ATTRIBUTEID.value</name>
<recordfield>AB_ATTRIBUTE.AB_ATTRIBUTEID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ATTRIBUTE_NAME.value</name>
<recordfield>AB_ATTRIBUTE.ATTRIBUTE_NAME</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ATTRIBUTE_PARENT_ID.value</name>
<recordfield>AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ATTRIBUTE_TYPE.value</name>
<recordfield>AB_ATTRIBUTE.ATTRIBUTE_TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<recordfield>AB_ATTRIBUTE.DATE_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<recordfield>AB_ATTRIBUTE.DATE_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<recordfield>AB_ATTRIBUTE.USER_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<recordfield>AB_ATTRIBUTE.USER_NEW</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(util.getNewUUID());
\ No newline at end of file
import("system.vars");
import("system.result");
if (vars.exists("$field.AB_ATTRIBUTEID"))
result.string(vars.get("$field.AB_ATTRIBUTEID"));
\ No newline at end of file
import("system.translate");
import("system.result");
var contentTypes = [
["PARENT", translate.text("Group")],
["TEXT", translate.text("Text")],
["NUMBER", translate.text("Number")],
["DATE", translate.text("Date")],
["BOOLEAN", translate.text("Checkbox")]
];
result.object(contentTypes);
\ 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