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

Employee_entity

parent 7f8b3186
No related branches found
No related tags found
No related merge requests found
Showing
with 345 additions and 0 deletions
<?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.3.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.0">
<name>Employee_entity</name>
<title>Employee</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<iconId>VAADIN:GROUP</iconId>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
</entityField>
<entityField>
<name>TITLE</name>
<title>Title</title>
<mandatory v="true" />
<onValidation>%aditoprj%/entity/Employee_entity/entityfields/title/onValidation.js</onValidation>
</entityField>
<entityField>
<name>CONTACT_ID</name>
</entityField>
<entityField>
<name>FIRSTNAME</name>
<title>Firstname</title>
</entityField>
<entityField>
<name>LASTNAME</name>
<title>Lastname</title>
</entityField>
<entityField>
<name>ISACTIVE</name>
<title>Active</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Employee_entity/entityfields/isactive/possibleItemsProcess.js</possibleItemsProcess>
<valueProcess>%aditoprj%/entity/Employee_entity/entityfields/isactive/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>EMAIL_ADDRESS</name>
<title>Email address</title>
</entityField>
<entityField>
<name>PASSWORD</name>
<title>Password</title>
<contentType>PASSWORD</contentType>
<onValidation>%aditoprj%/entity/Employee_entity/entityfields/password/onValidation.js</onValidation>
</entityField>
<entityField>
<name>CONFIRM_PASSWORD</name>
<title>Confirm password</title>
<contentType>PASSWORD</contentType>
<onValidation>%aditoprj%/entity/Employee_entity/entityfields/confirm_password/onValidation.js</onValidation>
</entityField>
<entityActionField>
<name>setPassword</name>
<fieldType>ACTION</fieldType>
<title>Set Password</title>
<onActionProcess>%aditoprj%/entity/Employee_entity/entityfields/setpassword/onActionProcess.js</onActionProcess>
</entityActionField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/Employee_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<onInsert>%aditoprj%/entity/Employee_entity/recordcontainers/jdito/onInsert.js</onInsert>
<onUpdate>%aditoprj%/entity/Employee_entity/recordcontainers/jdito/onUpdate.js</onUpdate>
<onDelete>%aditoprj%/entity/Employee_entity/recordcontainers/jdito/onDelete.js</onDelete>
<recordFields>
<element>UID.value</element>
<element>TITLE.value</element>
<element>ISACTIVE.value</element>
<element>FIRSTNAME.value</element>
<element>LASTNAME.value</element>
<element>EMAIL_ADDRESS.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.translate");
import("system.result");
import("system.vars");
if (vars.get("$field.PASSWORD") != vars.get("$field.CONFIRM_PASSWORD"))
result.string(translate.text("Password and confirmation must be the same!"));
\ No newline at end of file
import("system.translate");
import("system.result");
result.object({
"true" : translate.text("Yes"),
"false" : translate.text("No")
});
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
result.string("true");
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.vars");
if (vars.get("$field.PASSWORD") != vars.get("$field.CONFIRM_PASSWORD"))
result.string(translate.text("Password and confirmation must be the same!"));
\ No newline at end of file
import("system.vars");
import("system.neon");
neon.openContext("Employee", "EmployeePassword_view", [vars.get("$field.TITLE")], neon.OPERATINGSTATE_EDIT, null);
\ No newline at end of file
import("system.translate");
import("system.neon");
import("system.vars");
import("system.result");
import("system.tools");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.TITLE") && tools.existUsers(vars.get("$field.TITLE")))
result.string(translate.text("The title already exists!"));
import("system.vars");
import("system.result");
import("system.tools");
import("Util_lib");
var users;
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues"))
users = vars.get("$local.idvalues");
else
users = tools.getStoredUsers().map(function (row) {return row[1];});
users = users.map(function (user)
{
user = tools.getUser(user);
return [
user.title,
user.title,
user.params.isActive,
user.params.firstname,
user.params.lastname,
user.params.email
];
});
result.object(users);
\ No newline at end of file
import("system.vars");
import("system.tools");
tools.deleteUser(vars.get("$field.TITLE"));
\ No newline at end of file
import("system.vars");
import("system.tools");
var user = {};
var parameters = []; //this has to be an array
parameters[tools.FIRSTNAME] = vars.get("$field.FIRSTNAME");
parameters[tools.LASTNAME] = vars.get("$field.LASTNAME");
parameters[tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS");
user[tools.TITLE] = vars.get("$field.TITLE");
user[tools.PARAMS] = params;
tools.insertUser(user);
\ No newline at end of file
import("system.vars");
import("system.tools");
var user = tools.getUser(vars.get("$field.TITLE"));
user.params[tools.FIRSTNAME] = vars.get("$field.FIRSTNAME");
user.params[tools.LASTNAME] = vars.get("$field.LASTNAME");
user.params[tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS");
if (vars.get("$field.PASSWORD") && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD"))
{
user[tools.PASSWORD] = vars.get("$field.PASSWORD");
}
tools.updateUser(user);
\ No newline at end of file
......@@ -130,6 +130,10 @@
<key>Medium</key>
<value>Medium</value>
</entry>
<entry>
<key>The title already exists!</key>
<value>Der Titel existiert bereits!</value>
</entry>
<entry>
<key>Internet</key>
<value>Internet</value>
......
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0">
<name>Employee</name>
<title>Employee</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<mainview>EmployeeMain_view</mainview>
<filterview>EmployeeFilter_view</filterview>
<editview>EmployeeEdit_view</editview>
<preview>EmployeePreview_view</preview>
<entity>Employee_entity</entity>
<references>
<neonViewReference>
<name>51816f14-17da-4c96-80d8-f3b5280863b8</name>
<view>EmployeeFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>91c2bbc7-89fb-4688-881e-6fa21e96b211</name>
<view>EmployeeEdit_view</view>
</neonViewReference>
<neonViewReference>
<name>6a36e3cf-5918-4c60-94d9-a3a7ed50ffce</name>
<view>EmployeePreview_view</view>
</neonViewReference>
<neonViewReference>
<name>215e8e26-662f-45f6-9c61-c0b0b1129e66</name>
<view>EmployeeMain_view</view>
</neonViewReference>
<neonViewReference>
<name>a01b0910-cd32-4fa7-a739-0b9eb19debc2</name>
<view>EmployeePassword_view</view>
</neonViewReference>
</references>
</neonContext>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>EmployeeEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<genericViewTemplate>
<name>Generic</name>
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>aff1892e-9fca-45cd-bcd6-d2b857e2cb7b</name>
<entityField>TITLE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>9170856b-45c2-4d8a-864d-4db36bfe4a8c</name>
<entityField>ISACTIVE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>7d36467f-8b79-4647-b8e5-5759bdbf37a7</name>
<entityField>FIRSTNAME</entityField>
</entityFieldLink>
<entityFieldLink>
<name>00a2dedb-67f5-4662-b053-bf841b30e365</name>
<entityField>LASTNAME</entityField>
</entityFieldLink>
<entityFieldLink>
<name>6155e6b7-ee2c-45b4-87f5-9e506ffc5775</name>
<entityField>EMAIL_ADDRESS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>EmployeeFilter_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<tableViewTemplate>
<name>Employees</name>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
<name>3e3552f9-9591-45ae-a0bb-a85210c2b382</name>
<entityField>TITLE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>307dfdad-a0b2-436f-b8a1-9825821dba0c</name>
<entityField>ISACTIVE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>18b974f1-81ea-4ca0-83bf-a1505f763446</name>
<entityField>FIRSTNAME</entityField>
</neonTableColumn>
<neonTableColumn>
<name>27c4199c-157a-4c3e-a851-01aa1d82dfd2</name>
<entityField>LASTNAME</entityField>
</neonTableColumn>
</columns>
</tableViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>EmployeeMain_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<masterSlaveLayout>
<name>layout</name>
<master>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</master>
</masterSlaveLayout>
</layout>
<children>
<neonViewReference>
<name>f9ae631b-48ad-4d7c-a3a1-6cb00230e5c7</name>
<entityField>#ENTITY</entityField>
<view>EmployeePreview_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>EmployeePassword_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<genericViewTemplate>
<name>Password</name>
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>632294e8-f9ec-4bd1-afe4-87e3b5fc84c4</name>
<entityField>PASSWORD</entityField>
</entityFieldLink>
<entityFieldLink>
<name>66a7726a-c226-4d74-95a4-ea88950920bf</name>
<entityField>CONFIRM_PASSWORD</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>EmployeePreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<cardViewTemplate>
<name>Card</name>
<titleField>TITLE</titleField>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
</children>
</neonView>
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