Skip to content
Snippets Groups Projects
Commit 63e9db21 authored by Martin Groppe's avatar Martin Groppe
Browse files

merged 1077540_redirect_webservice into dev_xrm_marketing

parents 26f69235 a7fc442d
No related branches found
No related tags found
No related merge requests found
Showing
with 416 additions and 10 deletions
import("system.vars");
import("system.result");
import("Context_lib");
result.string(ContextUtils.loadContentTitle("Interest_entity", vars.get("$field.INTEREST_ID")));
\ No newline at end of file
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<fieldName>Interests</fieldName> <fieldName>Interests</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>3b09958b-0175-47fa-9528-2d5570c21162</name>
<entityName>BulkMail_entity</entityName>
<fieldName>Interests</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
</entityProvider> </entityProvider>
<entityProvider> <entityProvider>
......
<?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.18" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.18">
<name>LinkClick_entity</name>
<title>Click</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<grantCreate v="false" />
<grantUpdate v="false" />
<grantDelete v="false" />
<titlePlural>Clicks</titlePlural>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
<dependencies>
<entityDependency>
<name>cd0eb69c-917b-43ba-b02f-2b05bff34cdd</name>
<entityName>BulkMail_entity</entityName>
<fieldName>Clicks</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>cf3f4f2c-43bb-44c3-9099-95966d05623f</name>
<entityName>Link_entity</entityName>
<fieldName>Clicks</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityField>
<name>BROWSER</name>
<title>Browser</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>DATE_OPENED</name>
<title>Date Clicked</title>
<contentType>DATE</contentType>
<mandatory v="true" />
</entityField>
<entityField>
<name>DEVICE_TYPE</name>
<title>Device Type</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>IP_ADDRESS</name>
<title>IP Address</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>LINK_CLICKID</name>
</entityField>
<entityField>
<name>LINK_ID</name>
<mandatory v="true" />
</entityField>
<entityField>
<name>OBJECT_TYPE</name>
<mandatory v="true" />
</entityField>
<entityField>
<name>OPERATING_SYSTEM</name>
<title>Operating System</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>CONTACT_ID</name>
<title>Contact</title>
<consumer>Contacts</consumer>
<linkedContextProcess>%aditoprj%/entity/LinkClick_entity/entityfields/contact_id/linkedContextProcess.js</linkedContextProcess>
<mandatory v="true" />
</entityField>
<entityField>
<name>OBJECT_ROWID</name>
<mandatory v="true" />
</entityField>
<entityField>
<name>INTEREST_ID</name>
<title>Interest</title>
<mandatory v="true" />
</entityField>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>URL</name>
<title>Url</title>
</entityField>
<entityParameter>
<name>LinkId_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>ObjectType_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>ObjectRowId_param</name>
<expose v="true" />
</entityParameter>
<entityField>
<name>PERSON_ID</name>
</entityField>
<entityField>
<name>ORGANISATION_ID</name>
</entityField>
<entityConsumer>
<name>Contacts</name>
<dependency>
<name>dependency</name>
<entityName>AnyContact_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<fromClauseProcess>%aditoprj%/entity/LinkClick_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/LinkClick_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/LinkClick_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<alias>Data_alias</alias>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>BROWSER.value</name>
<recordfield>LINK_CLICK.BROWSER</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_OPENED.value</name>
<recordfield>LINK_CLICK.DATE_OPENED</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DEVICE_TYPE.value</name>
<recordfield>LINK_CLICK.DEVICE_TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>IP_ADDRESS.value</name>
<recordfield>LINK_CLICK.IP_ADDRESS</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>LINK_CLICKID.value</name>
<recordfield>LINK_CLICK.LINK_CLICKID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>LINK_ID.value</name>
<recordfield>LINK_CLICK.LINK_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_TYPE.value</name>
<recordfield>MAIL_RUN.OBJECT_TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OPERATING_SYSTEM.value</name>
<recordfield>LINK_CLICK.OPERATING_SYSTEM</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTACT_ID.value</name>
<recordfield>MAIL_LOG.CONTACT_ID</recordfield>
<isFilterable v="true" />
<isLookupFilter v="true" />
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_ROWID.value</name>
<recordfield>MAIL_RUN.OBJECT_ROWID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>INTEREST_ID.value</name>
<recordfield>MAIL_RUN.INTEREST_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTACT_ID.displayValue</name>
<expression>%aditoprj%/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/contact_id.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>URL.value</name>
<recordfield>LINK.URL</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PERSON_ID.value</name>
<recordfield>CONTACT.PERSON_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ORGANISATION_ID.value</name>
<recordfield>CONTACT.ORGANISATION_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DEVICE_TYPE.displayValue</name>
<expression>%aditoprj%/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/device_type.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
<name>d64f4f8d-4478-456d-a29e-d7e9a2981f0f</name>
<tableName>LINK_CLICK</tableName>
<primaryKey>LINK_CLICKID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
<linkInformation>
<name>bf0b73b1-f99a-482a-aa10-d6cc1cee759d</name>
<tableName>MAIL_LOG</tableName>
<primaryKey>MAIL_LOGID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
<linkInformation>
<name>5f0fd2d6-390b-4614-ab82-a9b1f0306fe9</name>
<tableName>MAIL_RUN</tableName>
<primaryKey>MAIL_RUNID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
<linkInformation>
<name>d4b3c72c-b8c5-4dad-b5aa-718fb1c78f3e</name>
<tableName>LINK</tableName>
<primaryKey>LINKID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
<linkInformation>
<name>34c55cb6-697c-4bc1-b15f-737b4743e6fb</name>
<tableName>CONTACT</tableName>
<primaryKey>CONTACTID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
</linkInformation>
</dbRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.result");
import("Contact_lib");
var res = ContactUtils.getContextByPersOrg(vars.get("$field.PERSON_ID"), vars.get("$field.ORGANISATION_ID"));
result.string(res||"Person");
\ No newline at end of file
import("system.result");
import("Sql_lib");
var cond = newWhereIfSet("LINK_CLICK.LINK_ID", "$param.LinkId_param")
.andIfSet("MAIL_RUN.OBJECT_TYPE", "$param.ObjectType_param")
.andIfSet("MAIL_RUN.OBJECT_ROWID", "$param.ObjectRowId_param");
result.string(cond.toString());
\ No newline at end of file
import("system.result");
import("Sql_lib");
var from = new SqlBuilder()
.from("LINK_CLICK")
.join("MAIL_LOG","MAIL_LOG.MAIL_LOGID = LINK_CLICK.MAIL_LOG_ID")
.join("MAIL_RUN","MAIL_RUN.MAIL_RUNID = MAIL_LOG.MAIL_RUN_ID")
.join("CONTACT","MAIL_LOG.CONTACT_ID = CONTACT.CONTACTID")
.join("LINK","LINK.LINKID = LINK_CLICK.LINK_ID");
result.string(from.toString());
\ No newline at end of file
import("system.db");
import("system.result");
result.object({
"LINK_CLICK.DATE_OPENED" : db.DESCENDING
});
\ No newline at end of file
import("Contact_lib");
import("system.result");
result.string(ContactUtils.getResolvingDisplaySubSql("MAIL_LOG.CONTACT_ID"));
\ No newline at end of file
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.deviceType(), "LINK_CLICK.DEVICE_TYPE");
result.string(sql);
...@@ -98,6 +98,42 @@ ...@@ -98,6 +98,42 @@
<displayValueProcess>%aditoprj%/entity/Link_entity/entityfields/placeholder/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/Link_entity/entityfields/placeholder/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/Link_entity/entityfields/placeholder/onValidation.js</onValidation> <onValidation>%aditoprj%/entity/Link_entity/entityfields/placeholder/onValidation.js</onValidation>
</entityField> </entityField>
<entityConsumer>
<name>Clicks</name>
<dependency>
<name>dependency</name>
<entityName>LinkClick_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
<children>
<entityParameter>
<name>LinkId_param</name>
<valueProcess>%aditoprj%/entity/Link_entity/entityfields/clicks/children/linkid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>WorkflowDefinitions</name>
<dependency>
<name>dependency</name>
<entityName>WorkflowDefinition_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
</entityConsumer>
<entityField>
<name>WORKFLOWPROCESSDEFINITION_KEY</name>
<title>Workflow</title>
<consumer>WorkflowDefinitions</consumer>
<stateProcess>%aditoprj%/entity/Link_entity/entityfields/workflowprocessdefinition_key/stateProcess.js</stateProcess>
<displayValueProcess>%aditoprj%/entity/Link_entity/entityfields/workflowprocessdefinition_key/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>REDIRECT</name>
<title>Redirect</title>
<contentType>BOOLEAN</contentType>
<stateProcess>%aditoprj%/entity/Link_entity/entityfields/redirect/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Link_entity/entityfields/redirect/valueProcess.js</valueProcess>
</entityField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
...@@ -152,6 +188,14 @@ ...@@ -152,6 +188,14 @@
<name>PLACEHOLDER.value</name> <name>PLACEHOLDER.value</name>
<recordfield>LINK.PLACEHOLDER</recordfield> <recordfield>LINK.PLACEHOLDER</recordfield>
</dbRecordFieldMapping> </dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>WORKFLOWPROCESSDEFINITION_KEY.value</name>
<recordfield>LINK.WORKFLOWPROCESSDEFINITION_KEY</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>REDIRECT.value</name>
<recordfield>LINK.REDIRECT</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings> </recordFieldMappings>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.LINKID"));
\ No newline at end of file
...@@ -4,11 +4,16 @@ import("Placeholder_lib"); ...@@ -4,11 +4,16 @@ import("Placeholder_lib");
import("Sql_lib"); import("Sql_lib");
if (vars.get("$local.value")){ if (vars.get("$local.value")){
var LinkPlaceholders = PlaceholderUtils.getPlaceholders().concat(PlaceholderUtils.getLinkPlaceholders()); var defaultPlaceholders = PlaceholderUtils.getPlaceholders();
var linkPlaceholders = newSelect("LINK.PLACEHOLDER")
if (LinkPlaceholders.map(function(a){ .from("LINK")
.where("LINK.LINKID",vars.get("$field.LINKID"),SqlBuilder.NOT_EQUAL())
.and("LINK.PLACEHOLDER is not null").arrayColumn();
if (defaultPlaceholders.map(function(a){
return a.placeholderName return a.placeholderName
}).indexOf(vars.get("$local.value"))!= -1){ }).indexOf(vars.get("$local.value"))!= -1 || linkPlaceholders.indexOf(vars.get("$local.value"))!= -1){
result.string("Placeholders must be unique") result.string("Placeholders must be unique")
} }
......
import("system.result");
import("system.vars");
import("KeywordRegistry_basic");
import("system.neon");
var linktype = vars.get("$field.LINKTYPE");
if(linktype == $KeywordRegistry.linkType$EMail()){
result.string(neon.COMPONENTSTATE_EDITABLE);
}else{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.vars");
if (!vars.get("$this.value") && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW )
{
result.string("0");
}
\ No newline at end of file
...@@ -8,4 +8,9 @@ if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$loca ...@@ -8,4 +8,9 @@ if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$loca
{ {
if(newSelect("URL").from("LINK").where("LINK.URL", vars.get("$local.value")).cell()) if(newSelect("URL").from("LINK").where("LINK.URL", vars.get("$local.value")).cell())
result.string(translate.text("Die Url muss eindeutig sein!")) result.string(translate.text("Die Url muss eindeutig sein!"))
}
\ No newline at end of file if(vars.get("$field.REDIRECT") == "1" && !/^(?:http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/g.test(vars.get("$local.value"))){
result.string(translate.text("Redirect needs a full Url with http/https"));
}
}
import("system.vars");
import("system.result");
import("Context_lib");
result.string(ContextUtils.loadContentTitle("WorkflowDefinition_entity", vars.get("$field.WORKFLOWPROCESSDEFINITION_KEY")));
\ No newline at end of file
import("system.result");
import("system.vars");
import("KeywordRegistry_basic");
import("system.neon");
var linktype = vars.get("$field.LINKTYPE");
var redirect = vars.get("$field.REDIRECT");
if(linktype == $KeywordRegistry.linkType$EMail() && redirect == "1"){
result.string(neon.COMPONENTSTATE_EDITABLE);
}else{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</entityProvider> </entityProvider>
<entityField> <entityField>
<name>DATE_SEND</name> <name>DATE_SEND</name>
<title>Date</title> <title>Send Date</title>
<contentType>DATE</contentType> <contentType>DATE</contentType>
<resolution>MINUTE</resolution> <resolution>MINUTE</resolution>
</entityField> </entityField>
...@@ -125,6 +125,12 @@ ...@@ -125,6 +125,12 @@
<title>Test Run</title> <title>Test Run</title>
<contentType>BOOLEAN</contentType> <contentType>BOOLEAN</contentType>
</entityField> </entityField>
<entityField>
<name>DATE_OPENED</name>
<title>Opening Date</title>
<contentType>DATE</contentType>
<resolution>MINUTE</resolution>
</entityField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
...@@ -203,29 +209,40 @@ ...@@ -203,29 +209,40 @@
<recordfield>MAIL_RUN.TESTRUN</recordfield> <recordfield>MAIL_RUN.TESTRUN</recordfield>
<isFilterable v="true" /> <isFilterable v="true" />
</dbRecordFieldMapping> </dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_OPENED.value</name>
<recordfield>LINK_CLICK.DATE_OPENED</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings> </recordFieldMappings>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>edad8141-91fd-4869-9368-5d4ce3553b12</name> <name>6b1b4cc2-cdc1-4c15-a1d7-6b1236332884</name>
<tableName>MAIL_LOG</tableName> <tableName>MAIL_LOG</tableName>
<primaryKey>MAIL_LOGID</primaryKey> <primaryKey>MAIL_LOGID</primaryKey>
<isUIDTable v="true" /> <isUIDTable v="true" />
<readonly v="false" /> <readonly v="false" />
</linkInformation> </linkInformation>
<linkInformation> <linkInformation>
<name>3ceea898-a14c-478c-8022-d7351210dc2a</name> <name>f3319573-943a-40e8-85b7-e01192c55c1d</name>
<tableName>MAIL_RUN</tableName> <tableName>MAIL_RUN</tableName>
<primaryKey>MAIL_RUNID</primaryKey> <primaryKey>MAIL_RUNID</primaryKey>
<isUIDTable v="false" /> <isUIDTable v="false" />
<readonly v="true" /> <readonly v="true" />
</linkInformation> </linkInformation>
<linkInformation> <linkInformation>
<name>e02574d4-abac-4e33-b2b5-12823683ea2e</name> <name>04a01533-28bc-4b89-b3f2-b06b7c12f393</name>
<tableName>CONTACT</tableName> <tableName>CONTACT</tableName>
<primaryKey>CONTACTID</primaryKey> <primaryKey>CONTACTID</primaryKey>
<isUIDTable v="false" /> <isUIDTable v="false" />
<readonly v="true" /> <readonly v="true" />
</linkInformation> </linkInformation>
<linkInformation>
<name>ad7f427d-fdd8-426d-b068-ce89e2dbeeda</name>
<tableName>LINK_CLICK</tableName>
<primaryKey>LINK_CLICKID</primaryKey>
<isUIDTable v="false" />
<readonly v="true" />
</linkInformation>
</linkInformation> </linkInformation>
</dbRecordContainer> </dbRecordContainer>
</recordContainers> </recordContainers>
......
import("system.result"); import("system.result");
result.string("MAIL_LOG join MAIL_RUN on MAIL_LOG.MAIL_RUN_ID = MAIL_RUN.MAIL_RUNID\n\ result.string("MAIL_LOG join MAIL_RUN on MAIL_LOG.MAIL_RUN_ID = MAIL_RUN.MAIL_RUNID\n\
join CONTACT on CONTACT.CONTACTID = MAIL_LOG.CONTACT_ID"); join CONTACT on CONTACT.CONTACTID = MAIL_LOG.CONTACT_ID\n\
\ No newline at end of file left join LINK_CLICK on LINK_CLICK.LINK_CLICKID = MAIL_LOG.OPENER_LINK_CLICK_ID");
\ No newline at end of file
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
<fieldName>WorkflowDefinitions</fieldName> <fieldName>WorkflowDefinitions</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>349ab9d2-edbb-4571-be14-3fb749bfff50</name>
<entityName>Link_entity</entityName>
<fieldName>WorkflowDefinitions</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
</entityProvider> </entityProvider>
<entityField> <entityField>
......
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