Skip to content
Snippets Groups Projects
Commit 41f7b926 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong: Committed by Johannes Goderbauer
Browse files

AttributeRelation refactored to make sure uids don't change

(cherry picked from commit cb3fa119)
parent ab33750b
No related branches found
No related tags found
No related merge requests found
Showing
with 225 additions and 37 deletions
......@@ -5,6 +5,9 @@
<documentation>%aditoprj%/entity/Leadimport_entity/documentation.adoc</documentation>
<icon>NEON:IMPORT</icon>
<title>Lead Import</title>
<grantUpdate v="true" />
<grantUpdateProcess>%aditoprj%/entity/Leadimport_entity/grantUpdateProcess.js</grantUpdateProcess>
<grantDelete v="true" />
<grantDeleteProcess>%aditoprj%/entity/Leadimport_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/Leadimport_entity/contentTitleProcess.js</contentTitleProcess>
<iconId>NEON:IMPORT</iconId>
......@@ -55,6 +58,9 @@
<name>bindata</name>
<title>File</title>
<contentType>FILE</contentType>
<mandatory v="true" />
<mandatoryProcess>%aditoprj%/entity/Leadimport_entity/entityfields/bindata/mandatoryProcess.js</mandatoryProcess>
<stateProcess>%aditoprj%/entity/Leadimport_entity/entityfields/bindata/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/bindata/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Leadimport_entity/entityfields/bindata/displayValueProcess.js</displayValueProcess>
</entityField>
......@@ -66,6 +72,7 @@
<title>Transfer data</title>
<onActionProcess>%aditoprj%/entity/Leadimport_entity/entityfields/transferdata/onActionProcess.js</onActionProcess>
<isMenuAction v="true" />
<isObjectAction v="false" />
<isSelectionAction v="false" />
<iconId>VAADIN:INBOX</iconId>
</entityActionField>
......@@ -245,6 +252,7 @@
</entityField>
<entityField>
<name>loadedData</name>
<state>AUTO</state>
</entityField>
<entityActionField>
<name>Load_Data</name>
......@@ -252,6 +260,7 @@
<onActionProcess>%aditoprj%/entity/Leadimport_entity/entityfields/load_data/onActionProcess.js</onActionProcess>
<isMenuAction v="true" />
<iconId>VAADIN:CLOUD_DOWNLOAD</iconId>
<state>INVISIBLE</state>
</entityActionField>
<entityConsumer>
<name>LeadTempC</name>
......
import("system.vars");
import("system.result");
import("system.neon");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
result.string("true");
else
result.string("false");
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW)
result.string("EDITABLE");
else
result.string("READONLY");
\ No newline at end of file
......@@ -4,6 +4,7 @@ import("system.vars");
import("KeywordRegistry_basic");
import("Sql_lib");
import("system.db");
import("system.neon");
let leadimportId = vars.get("$field.LEADIMPORTID");
......@@ -32,6 +33,8 @@ newWhere("LEAD.LEADIMPORT_ID", leadimportId)
// Ändern des Status auf Created
newWhere("LEADIMPORT.LEADIMPORTID", leadimportId).updateData(true, "LEADIMPORT", ["Status"], null, [$KeywordRegistry.importStatus$created()]);
neon.refreshAll();
/**
* Deletes the Data with was created by the Leadimport of the given table
*
......@@ -41,11 +44,12 @@ newWhere("LEADIMPORT.LEADIMPORTID", leadimportId).updateData(true, "LEADIMPORT",
*/
function _deleteData (pTableName, pleadimportId, pdateADayBefor)
{
let uTableName = pTableName.charAt(0);
newWhere(pTableName + "." + pTableName + "ID",
newSelect(pTableName + "." + pTableName + "ID")
.from(pTableName)
.join("LEADLOG", "LEADLOG.DATE_NEW = " + pTableName + ".DATE_NEW")
.where(pTableName + ".USER_NEW = LEADLOG.USER_NEW")
.from(pTableName, uTableName)
.join("LEADLOG", "LEADLOG.DATE_NEW = " + uTableName + ".DATE_NEW")
.where(uTableName + ".USER_NEW = LEADLOG.USER_NEW")
.and("LEADLOG.LEADIMPORT_ID", pleadimportId)
.and("LEADLOG.DATE_NEW", pdateADayBefor.getTime(), "# >= ?"), SqlBuilder.IN())
.from(pTableName)
......
......@@ -10,4 +10,4 @@ var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("Task_entity", "Tasks", {ObjectId_param : currentContext, RowId_param : rowId}) //Tasks
.validate();
result.string(canDelete);
\ No newline at end of file
result.string(canDelete);
import("system.vars");
import("system.result");
import("KeywordRegistry_basic");
result.string((vars.get("$field.STATUS") != $KeywordRegistry.importStatus$transfered()).toString());
\ No newline at end of file
......@@ -12,7 +12,7 @@ var assignmentRowId = vars.get("$field.LEADIMPORTID");
var bindata = DocumentUtil.getBindataFromUpload(vars.get("$field.bindata"));
var filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.bindata"));
var fieldSep = ExportTemplateUtils.getSentenceSeparator(vars.get("$field.FIELDSEPARATOR"));
var fieldSep = ExportTemplateUtils.getFieldSeparator(vars.get("$field.FIELDSEPARATOR"));
var fieldLimit = ExportTemplateUtils.getFieldDeLimiter(vars.get("$field.FIELDDELIMITERS"));
var recordSep = ExportTemplateUtils.getSentenceSeparator(vars.get("$field.SENTENCESEPARATOR"));
......
......@@ -15,5 +15,9 @@
<name>37f81868-7e5e-48c1-bb76-3215c7bfe87b</name>
<view>ImportFieldEdit_view</view>
</neonViewReference>
<neonViewReference>
<name>e5940438-2213-49f8-8715-330963b677d9</name>
<view>ImportFieldFilterMapping_view</view>
</neonViewReference>
</references>
</neonContext>
......@@ -14,5 +14,9 @@
<name>3e5f7e73-5a5c-4004-9b08-95f495e84a06</name>
<view>LeadLogPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>3ebb0277-6ff4-4ade-ae5c-32b2a2c02c41</name>
<view>LeadLogFilterDrawer_view</view>
</neonViewReference>
</references>
</neonContext>
......@@ -31,5 +31,17 @@
<name>2ffd1242-8512-4f44-a3de-6e5c9501e3c9</name>
<view>LeadimportDocEdit_view</view>
</neonViewReference>
<neonViewReference>
<name>a7355bc9-f925-4d6d-8284-3ebfc775d5a9</name>
<view>LeadimportLeadFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>63565f2e-7a0c-45e7-b25b-44de482e7be5</name>
<view>LeadimportLog_view</view>
</neonViewReference>
<neonViewReference>
<name>3c62f291-95ec-4156-8b0a-974027c75722</name>
<view>LeadimportLeadTempFilter_view</view>
</neonViewReference>
</references>
</neonContext>
......@@ -15,5 +15,9 @@
<name>32181ad2-2766-4d52-a04b-4b74bcbd2453</name>
<view>LogHistoryPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>74b1ccb3-8a37-47df-a844-af03d3418e92</name>
<view>LogHistoryFilterDrawer_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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>ImportFieldFilterMapping_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<titledListViewTemplate>
<name>ImportFieldFilterMappingTitledList</name>
<titleField>FIELDNAME</titleField>
<titleFieldFullWidth v="false" />
<fixedDrawer v="true" />
<entityField>#ENTITY</entityField>
<isDeletable v="false" />
<isCreatable v="false" />
<columns>
<neonTitledListTableColumn>
<name>97d7d6e2-cead-4d86-87bf-e300b2d743a5</name>
<entityField>MAPPINGFIELD</entityField>
</neonTitledListTableColumn>
</columns>
</titledListViewTemplate>
</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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>LeadLogFilterDrawer_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<drawerLayout>
<name>layout</name>
<layoutCaption>Import Logs</layoutCaption>
<fixedDrawer v="false" />
</drawerLayout>
</layout>
<children>
<neonViewReference>
<name>bfdfa657-c635-4cb7-b083-5243044d6d08</name>
<entityField>#ENTITY</entityField>
<view>LeadLogFilter_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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>LeadimportLeadFilter_view</name>
<title>Transferdaten</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterable v="true" />
<layout>
<drawerLayout>
<name>layout</name>
<layoutCaption></layoutCaption>
<fixedDrawer v="true" />
</drawerLayout>
</layout>
<children>
<actionsViewTemplate>
<name>Actions</name>
<actions>
<element>LeadimportReset</element>
<element>TransferData</element>
</actions>
<entityField>#ENTITY</entityField>
<devices>
<element>MOBILE</element>
<element>TABLET</element>
<element>DESKTOP</element>
</devices>
</actionsViewTemplate>
<neonViewReference>
<name>43c63616-3587-48e4-b317-8cfb80d18b45</name>
<entityField>LeadC</entityField>
<view>LeadFilter_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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>LeadimportLeadTempFilter_view</name>
<title>Import Daten</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterable v="true" />
<layout>
<drawerLayout>
<name>layout</name>
<fixedDrawer v="true" />
</drawerLayout>
</layout>
<children>
<actionsViewTemplate>
<name>Actions</name>
<actions>
<element>Load_Data</element>
</actions>
<entityField>#ENTITY</entityField>
</actionsViewTemplate>
<neonViewReference>
<name>b3432200-c946-4ffb-bf32-df292e1c8a73</name>
<entityField>LeadTempC</entityField>
<view>LeadTempFilter_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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>LeadimportLog_view</name>
<title>Logs</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<neonViewReference>
<name>0664bb5c-d976-43be-8239-da4ba36d9c61</name>
<entityField>LeadLogC</entityField>
<view>LeadLogFilterDrawer_view</view>
</neonViewReference>
<neonViewReference>
<name>0406b319-3d33-4077-b65e-b519ee62a670</name>
<entityField>LogHistoryC</entityField>
<view>LogHistoryFilterDrawer_view</view>
</neonViewReference>
</children>
</neonView>
......@@ -15,24 +15,24 @@
<view>LeadimportPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>3c787fee-a6bf-4579-bab6-7cf4318bfd47</name>
<entityField>ImportFieldID</entityField>
<view>ImportFieldFilter_view</view>
<name>0ac7276f-4677-41e2-9ad5-57b0d2711b8b</name>
<entityField>#ENTITY</entityField>
<view>LeadimportLeadTempFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>0dcbd908-51ef-43ad-b2a2-58304aa65770</name>
<entityField>LeadTempC</entityField>
<view>LeadTempFilter_view</view>
<name>51132482-3f97-44a0-ba08-bf395686e6b7</name>
<entityField>ImportFieldID</entityField>
<view>ImportFieldFilterMapping_view</view>
</neonViewReference>
<neonViewReference>
<name>d0109d4a-b0f4-45f8-a161-235bd3837384</name>
<entityField>LeadC</entityField>
<view>LeadFilter_view</view>
<name>5a6123d2-a2a4-416d-a138-fac6cdc5fb82</name>
<entityField>#ENTITY</entityField>
<view>LeadimportLeadFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>19633cbf-79a3-4bed-93cb-2a1cc62fb6f3</name>
<entityField>LeadLogC</entityField>
<view>LeadLogFilter_view</view>
<name>b085a160-f739-487c-a24c-5d12898aa6f1</name>
<entityField>#ENTITY</entityField>
<view>LeadimportLog_view</view>
</neonViewReference>
<neonViewReference>
<name>61237df6-2af1-41bd-bb56-da0bc624afb5</name>
......@@ -44,15 +44,5 @@
<entityField>Tasks</entityField>
<view>TaskFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>97f93e38-e955-485a-998a-3be4d07d4972</name>
<entityField>DocumentC</entityField>
<view>DocumentFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>6cacd3bb-1937-4cf3-9a26-e205f8edebaa</name>
<entityField>LogHistoryC</entityField>
<view>LogHistoryFilter_view</view>
</neonViewReference>
</children>
</neonView>
......@@ -50,17 +50,8 @@
<name>97a8978c-0e17-4a8d-a90b-fedfb7a4ff86</name>
<entityField>FIELDDELIMITERS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Generic</name>
<showDrawer v="true" />
<drawerCaption>File</drawerCaption>
<hideLabels v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>24d3036f-be4e-418c-a13f-e21c44112edf</name>
<name>76f80b3e-51be-41b8-93c0-a1ac0b5dc24f</name>
<entityField>bindata</entityField>
</entityFieldLink>
</fields>
......
<?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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>LogHistoryFilterDrawer_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<drawerLayout>
<name>layout</name>
<layoutCaption>Logs</layoutCaption>
<fixedDrawer v="true" />
</drawerLayout>
</layout>
<children>
<neonViewReference>
<name>f05e7816-2448-4b99-af5d-8b9f17a1cc89</name>
<entityField>#ENTITY</entityField>
<view>LogHistoryFilter_view</view>
</neonViewReference>
</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