diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/AddBulkmailStatus.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/AddBulkmailStatus.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/AddBulkmailStatus.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/AddBulkmailStatus.xml diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/AlterBulkmail.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/AlterBulkmail.xml similarity index 94% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/AlterBulkmail.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/AlterBulkmail.xml index 581dfadfd5423241b87118d8ab067b794e5718ea..e82543b3b4810d41c3a4992cb7ff7570d87dd3c2 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/AlterBulkmail.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/AlterBulkmail.xml @@ -3,6 +3,7 @@ <changeSet author="m.groppe" id="96816f54-3067-470d-b698-dc7ad7685d84"> <addColumn tableName="BULKMAIL"> <column name="DATE_TO_SEND" type="DATETIME"/> + <column name="INTEREST_ID" type="char(36)"/> </addColumn> <renameColumn tableName="BULKMAIL" oldColumnName="SENDER" newColumnName="SENDER_EMAIL_ADDRESS "/> </changeSet> diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/AlterBulkmailRecipient.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/AlterBulkmailRecipient.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/AlterBulkmailRecipient.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/AlterBulkmailRecipient.xml diff --git a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/addDeviceTypeKeyword.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/addDeviceTypeKeyword.xml new file mode 100644 index 0000000000000000000000000000000000000000..2e5fef20dcf00f187275ba5a7d3ccc3b5bc4cc3c --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/addDeviceTypeKeyword.xml @@ -0,0 +1,65 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="m.groppe" id="15e13453-42c1-413e-bc0d-611a23486890"> + + <insert tableName="AB_KEYWORD_CATEGORY"> + <column name="AB_KEYWORD_CATEGORYID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="NAME" value="DeviceType"/> + <column name="SORTINGBY" valueNumeric="0"/> + <column name="SORTINGDIRECTION" value="ASC"/> + </insert> + + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="54b767c8-5347-4e1d-95db-96f6d40f9fb7"/> + <column name="KEYID" value="console"/> + <column name="TITLE" value="Console"/> + <column name="CONTAINER" value="DeviceType"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="SORTING" valueNumeric="0"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="de0f5a77-bbb4-4109-bf93-3c0807239980"/> + <column name="KEYID" value="mobile"/> + <column name="TITLE" value="Mobile"/> + <column name="CONTAINER" value="DeviceType"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="SORTING" valueNumeric="1"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="806143e9-be70-47ff-ba37-5bc64fa88f3b"/> + <column name="KEYID" value="tablet"/> + <column name="TITLE" value="Tablet"/> + <column name="CONTAINER" value="DeviceType"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="SORTING" valueNumeric="2"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="689e5978-ddb2-46f8-98a0-97ec0a95ee6f"/> + <column name="KEYID" value="smarttv"/> + <column name="TITLE" value="Smart TV"/> + <column name="CONTAINER" value="DeviceType"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="SORTING" valueNumeric="3"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="fba7888e-a1a6-45f4-8389-e5c4b98ca13b"/> + <column name="KEYID" value="desktop"/> + <column name="TITLE" value="Desktop"/> + <column name="CONTAINER" value="DeviceType"/> + <column name="AB_KEYWORD_CATEGORY_ID" value="d37c3935-c029-44d5-b19d-af7c3a2a21dd"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="1"/> + </insert> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/changelog.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/changelog.xml similarity index 90% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/changelog.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/changelog.xml index 9e7e286eb613f2b8965736c389d52e45cef31354..58da09a2dc981f1639bdbafbd3815cfc5b29171f 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/changelog.xml @@ -6,7 +6,7 @@ <include relativeToChangelogFile="true" file="AddBulkmailStatus"/> <include relativeToChangelogFile="true" file="createMailLog.xml"/> <include relativeToChangelogFile="true" file="createMailRun.xml"/> - <include relativeToChangelogFile="true" file="createMailOpener.xml"/> <include relativeToChangelogFile="true" file="createBulkMailTestRecipient.xml"/> <include relativeToChangelogFile="true" file="AlterBulkmailRecipient.xml"/> + <<include relativeToChangelogFile="true" file="addDeviceTypeKeyword.xml"/> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createBulkMailTestRecipient.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createBulkMailTestRecipient.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/createBulkMailTestRecipient.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/createBulkMailTestRecipient.xml diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailOpener.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml similarity index 54% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailOpener.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml index e54c981b095c773bfee03e49d2cc07fe507e518e..c2e7315e43fd59ee9560555f2eb92d210f481bf0 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailOpener.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml @@ -1,13 +1,20 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> - <changeSet author="m.groppe" id="3323c8a8-7a20-4836-b7b1-36b4ec2caf3d"> - <createTable tableName="mail_opener"> - <column name="MAIL_OPENERID" type="CHAR(36)"> + <changeSet author="m.groppe" id="e60dc52b-87dc-4f73-80e7-adc5b46d6935"> + <createTable tableName="LINK_CLICK"> + <column name="LINK_CLICKID" type="CHAR(36)"> <constraints nullable="false" primaryKey="true"/> </column> <column name="IP_ADDRESS" type="VARCHAR(50)"/> + <column name="LINK_ID" type="CHAR(36)"/> <column name="MAIL_LOG_ID" type="CHAR(36)"/> - <column defaultValueComputed="NULL" name="DATE_OPENED" type="datetime"/> + <column name="DEVICE_TYPE" type="VARCHAR(255)"/> + <column name="OPERATING_SYSTEM" type="VARCHAR(255)"/> + <column name="BROWSER" type="VARCHAR(255)"/> + <column name="DATE_OPENED" type="datetime"/> </createTable> + <createIndex tableName="LINK_CLICK" indexName="IDX_LINK_CLICK_MAIL_LOG_ID"> + <column name="MAIL_LOG_ID"/> + </createIndex> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailLog.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml similarity index 75% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailLog.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml index dcd979f5093db616811474a9d124a6de5b697272..a1b61bd322d8fee54840c73a227c9fc18f6284b1 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailLog.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml @@ -1,7 +1,7 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> <changeSet author="m.groppe" id="9d8f3580-92c5-423e-b709-09383969ccf0"> - <createTable tableName="mail_log"> + <createTable tableName="MAIL_LOG"> <column name="MAIL_LOGID" type="CHAR(36)"> <constraints nullable="false" primaryKey="true"/> </column> @@ -14,7 +14,13 @@ <column name="RECIPIENT_EMAIL" type="VARCHAR(255)"/> <column name="MAILING_SUBJECT" type="VARCHAR(100)"/> <column name="DATE_SEND" type ="DATETIME"/> - <column name="FILEPATH" type="VARCHAR(255)"/> + <column name="OPENER_LINK_CLICK_ID" type="char(36)"/> </createTable> + <createIndex tableName="MAIL_LOG" indexName="IDX_MAIL_LOG_MAIL_RUN_ID"> + <column name="MAIL_RUN_ID"/> + </createIndex> + <createIndex tableName="MAIL_LOG" indexName="IDX_MAIL_LOG_OPENER_LINK_CLICK_ID"> + <column name="OPENER_LINK_CLICK_ID"/> + </createIndex> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailRun.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml similarity index 86% rename from .liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailRun.xml rename to .liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml index be6e99e582f478cc6e34b155f62dbf3f144e20c9..d822f108f848add003682591f271ea89c38dcd71 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/Bulkmail/createMailRun.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml @@ -1,7 +1,7 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> <changeSet author="m.groppe" id="6c910d60-43b1-400b-8e31-e3a1a93155e6"> - <createTable tableName="mail_run"> + <createTable tableName="MAIL_RUN"> <column name="MAIL_RUNID" type="CHAR(36)"> <constraints nullable="false" primaryKey="true"/> </column> @@ -13,5 +13,8 @@ <column defaultValueComputed="NULL" name="DATE_RUN_START" type="datetime"/> <column defaultValueComputed="NULL" name="DATE_RUN_FINISHED" type="datetime"/> </createTable> + <createIndex tableName="LINK_CLICK" indexName="IDX_MAIL_RUN_INTEREST_ID"> + <column name="INTEREST_ID"/> + </createIndex> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/LinkManagement/CreateLink.xml b/.liquibase/Data_alias/basic/2021.0.3/LinkManagement/CreateLink.xml similarity index 89% rename from .liquibase/Data_alias/basic/2021.0.2/LinkManagement/CreateLink.xml rename to .liquibase/Data_alias/basic/2021.0.3/LinkManagement/CreateLink.xml index ee8b19525db258dae22daaf1909bf751ae90ed3b..6d28b1fbe90c80114206b386066687ca3832f9ff 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/LinkManagement/CreateLink.xml +++ b/.liquibase/Data_alias/basic/2021.0.3/LinkManagement/CreateLink.xml @@ -15,6 +15,8 @@ <column name="DATE_NEW" type="DATETIME"/> <column name="USER_EDIT" type="NVARCHAR(50)"/> <column name="DATE_EDIT" type="DATETIME"/> + <column name="REDIRECT" type="SMALLINT"/> + <column name="WORKFLOWPROCESSDEFINITION_KEY" type="VARCHAR(255)"/> </createTable> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/LinkManagement/CreateLinktags.xml b/.liquibase/Data_alias/basic/2021.0.3/LinkManagement/CreateLinktags.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/LinkManagement/CreateLinktags.xml rename to .liquibase/Data_alias/basic/2021.0.3/LinkManagement/CreateLinktags.xml diff --git a/.liquibase/Data_alias/basic/2021.0.2/LinkManagement/addLinkManagementKeywords.xml b/.liquibase/Data_alias/basic/2021.0.3/LinkManagement/addLinkManagementKeywords.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/LinkManagement/addLinkManagementKeywords.xml rename to .liquibase/Data_alias/basic/2021.0.3/LinkManagement/addLinkManagementKeywords.xml diff --git a/.liquibase/Data_alias/basic/2021.0.2/LinkManagement/changelog.xml b/.liquibase/Data_alias/basic/2021.0.3/LinkManagement/changelog.xml similarity index 100% rename from .liquibase/Data_alias/basic/2021.0.2/LinkManagement/changelog.xml rename to .liquibase/Data_alias/basic/2021.0.3/LinkManagement/changelog.xml diff --git a/.liquibase/Data_alias/basic/2021.0.3/changelog.xml b/.liquibase/Data_alias/basic/2021.0.3/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..94916616a3ddca9520bedf22f5bafe3c10182680 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.0.3/changelog.xml @@ -0,0 +1,6 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <include relativeToChangelogFile="true" file="Bulkmail/changelog.xml"/> + <include relativeToChangelogFile="true" file="LinkManagement/changelog.xml"/> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index 7011168d6cefd0a8907ac29a9fc325ef7970ca1b..cbc824888d44f90198e781d7765852c5c8df0823 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -22,6 +22,7 @@ <include relativeToChangelogFile="true" file="basic/2021.0.0/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.0.1/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.0.2/changelog.xml"/> + <include relativeToChangelogFile="true" file="basic/2021.0.3/changelog.xml"/> <!--enable this only when you definetly want to overwrite the existing data with demo records:--> <include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index d2efab6fb2dcbdc8ad9b15821a721d085f9ad094..2eccacb1e91b45634e2eaf76a36a4196747a97fc 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -18665,6 +18665,34 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>WORKFLOWPROCESSDEFINITION_KEY</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>REDIRECT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="5" /> + <size v="5" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -18859,6 +18887,48 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>BROWSER</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DEVICE_TYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>OPERATING_SYSTEM</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -19729,6 +19799,138 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>LINK_CLICK</name> + <dbName></dbName> + <idColumn>LINK_CLICKID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>BROWSER</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DEVICE_TYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LINK_CLICKID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MAIL_LOG_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>IP_ADDRESS</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LINK_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>OPERATING_SYSTEM</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_OPENED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="19" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> <entityDb> <name>COMMUNICATIONBLACKLIST</name> <dbName></dbName> diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index ccbe256ca3480172b003b3316838627421965891..d01cbf0e5efff9e0ff7630efc819ab9ea2d78074 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -90,6 +90,12 @@ <fieldName>Contacts</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>cb874ee2-e147-4311-bdf1-a94df537bb9e</name> + <entityName>LinkClick_entity</entityName> + <fieldName>Contacts</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityProvider> diff --git a/entity/BulkMail_entity/BulkMail_entity.aod b/entity/BulkMail_entity/BulkMail_entity.aod index 5f36bbf278ea9e4878eb4326f43887681e7276cd..64ad1c607ad57a54b6157ce8205a2ec5a6d51302 100644 --- a/entity/BulkMail_entity/BulkMail_entity.aod +++ b/entity/BulkMail_entity/BulkMail_entity.aod @@ -364,6 +364,38 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>Clicks</name> + <dependency> + <name>dependency</name> + <entityName>LinkClick_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/clicks/children/objectrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/clicks/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>INTEREST_ID</name> + <title>Interest</title> + <consumer>Interests</consumer> + <displayValueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/interests_id/displayValueProcess.js</displayValueProcess> + </entityField> + <entityConsumer> + <name>Interests</name> + <dependency> + <name>dependency</name> + <entityName>Interest_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -445,6 +477,10 @@ <name>DATE_TO_SEND.value</name> <recordfield>BULKMAIL.DATE_TO_SEND</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>INTEREST_ID.value</name> + <recordfield>BULKMAIL.INTEREST_ID</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/BulkMail_entity/entityfields/clicks/children/objectrowid_param/valueProcess.js b/entity/BulkMail_entity/entityfields/clicks/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8aa64f3404b7d77bd5dfade6cc48235558f0d988 --- /dev/null +++ b/entity/BulkMail_entity/entityfields/clicks/children/objectrowid_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.vars"); +import("system.result"); +result.string(vars.get("$field.BULKMAILID")); \ No newline at end of file diff --git a/entity/BulkMail_entity/entityfields/clicks/children/objecttype_param/valueProcess.js b/entity/BulkMail_entity/entityfields/clicks/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/BulkMail_entity/entityfields/clicks/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/BulkMail_entity/entityfields/interests_id/displayValueProcess.js b/entity/BulkMail_entity/entityfields/interests_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e2c5bbf9152d5d220ccba334f4f7b8d2bb15e8f1 --- /dev/null +++ b/entity/BulkMail_entity/entityfields/interests_id/displayValueProcess.js @@ -0,0 +1,5 @@ +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 diff --git a/entity/Interest_entity/Interest_entity.aod b/entity/Interest_entity/Interest_entity.aod index 02ed4c95117ae0fe30720d6de2694302d66e762d..f2485ca1f25930f9712a6e510a4c5ee0dd1769bc 100644 --- a/entity/Interest_entity/Interest_entity.aod +++ b/entity/Interest_entity/Interest_entity.aod @@ -18,6 +18,12 @@ <fieldName>Interests</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>3b09958b-0175-47fa-9528-2d5570c21162</name> + <entityName>BulkMail_entity</entityName> + <fieldName>Interests</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityProvider> diff --git a/entity/LinkClick_entity/LinkClick_entity.aod b/entity/LinkClick_entity/LinkClick_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..6988cda6d1256f65db1b80f2a9b065d2e9015020 --- /dev/null +++ b/entity/LinkClick_entity/LinkClick_entity.aod @@ -0,0 +1,231 @@ +<?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> diff --git a/entity/LinkClick_entity/entityfields/contact_id/linkedContextProcess.js b/entity/LinkClick_entity/entityfields/contact_id/linkedContextProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..95bad245448809f807648349f7f23be11a6b3eca --- /dev/null +++ b/entity/LinkClick_entity/entityfields/contact_id/linkedContextProcess.js @@ -0,0 +1,7 @@ +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 diff --git a/entity/LinkClick_entity/recordcontainers/db/conditionProcess.js b/entity/LinkClick_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..47e1c6b2efbdd45130cd4bd7a35480ada554c1b5 --- /dev/null +++ b/entity/LinkClick_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,8 @@ +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 diff --git a/entity/LinkClick_entity/recordcontainers/db/fromClauseProcess.js b/entity/LinkClick_entity/recordcontainers/db/fromClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..05dc3db6349d8eadbf1d33f8973c1dd9e2f7e63f --- /dev/null +++ b/entity/LinkClick_entity/recordcontainers/db/fromClauseProcess.js @@ -0,0 +1,11 @@ +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 diff --git a/entity/LinkClick_entity/recordcontainers/db/orderClauseProcess.js b/entity/LinkClick_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..df83830d321e9e8bbb65899a14cff856740c81e1 --- /dev/null +++ b/entity/LinkClick_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,6 @@ +import("system.db"); +import("system.result"); + +result.object({ + "LINK_CLICK.DATE_OPENED" : db.DESCENDING +}); \ No newline at end of file diff --git a/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/contact_id.displayvalue/expression.js b/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/contact_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..72d1600cff8a2f7f9cd33dd3551e372cdec7790c --- /dev/null +++ b/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/contact_id.displayvalue/expression.js @@ -0,0 +1,4 @@ +import("Contact_lib"); +import("system.result"); + +result.string(ContactUtils.getResolvingDisplaySubSql("MAIL_LOG.CONTACT_ID")); \ No newline at end of file diff --git a/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/device_type.displayvalue/expression.js b/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/device_type.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..3b14a9b790acf04dca63eb88ea168126196f8422 --- /dev/null +++ b/entity/LinkClick_entity/recordcontainers/db/recordfieldmappings/device_type.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.deviceType(), "LINK_CLICK.DEVICE_TYPE"); +result.string(sql); diff --git a/entity/Link_entity/Link_entity.aod b/entity/Link_entity/Link_entity.aod index 2a32a4d8f20d27b7002d7b08ca44c5f3cae10fa3..b44e8481e0478d5e7676c7a3defbd79c72047cc8 100644 --- a/entity/Link_entity/Link_entity.aod +++ b/entity/Link_entity/Link_entity.aod @@ -98,6 +98,42 @@ <displayValueProcess>%aditoprj%/entity/Link_entity/entityfields/placeholder/displayValueProcess.js</displayValueProcess> <onValidation>%aditoprj%/entity/Link_entity/entityfields/placeholder/onValidation.js</onValidation> </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> <recordContainers> <dbRecordContainer> @@ -152,6 +188,14 @@ <name>PLACEHOLDER.value</name> <recordfield>LINK.PLACEHOLDER</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>WORKFLOWPROCESSDEFINITION_KEY.value</name> + <recordfield>LINK.WORKFLOWPROCESSDEFINITION_KEY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>REDIRECT.value</name> + <recordfield>LINK.REDIRECT</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/Link_entity/entityfields/clicks/children/linkid_param/valueProcess.js b/entity/Link_entity/entityfields/clicks/children/linkid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..bfece7cf1e2f5dcfef117abd70abe899d309ef89 --- /dev/null +++ b/entity/Link_entity/entityfields/clicks/children/linkid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.LINKID")); \ No newline at end of file diff --git a/entity/Link_entity/entityfields/placeholder/onValidation.js b/entity/Link_entity/entityfields/placeholder/onValidation.js index fc499ca653bb8d359e1061626bd0c616294975cd..0da4919b8b107f2a01689de6cf33b3078c2591b6 100644 --- a/entity/Link_entity/entityfields/placeholder/onValidation.js +++ b/entity/Link_entity/entityfields/placeholder/onValidation.js @@ -4,11 +4,16 @@ import("Placeholder_lib"); import("Sql_lib"); if (vars.get("$local.value")){ - var LinkPlaceholders = PlaceholderUtils.getPlaceholders().concat(PlaceholderUtils.getLinkPlaceholders()); - - if (LinkPlaceholders.map(function(a){ + var defaultPlaceholders = PlaceholderUtils.getPlaceholders(); + var linkPlaceholders = newSelect("LINK.PLACEHOLDER") + .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 - }).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") } diff --git a/entity/Link_entity/entityfields/redirect/stateProcess.js b/entity/Link_entity/entityfields/redirect/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d44e58ad8e3be9b92472212ee2fb46f5813d72a6 --- /dev/null +++ b/entity/Link_entity/entityfields/redirect/stateProcess.js @@ -0,0 +1,12 @@ +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 diff --git a/entity/Link_entity/entityfields/redirect/valueProcess.js b/entity/Link_entity/entityfields/redirect/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4e9b28e10759f126432a2a9d86d3684f4ac33ad2 --- /dev/null +++ b/entity/Link_entity/entityfields/redirect/valueProcess.js @@ -0,0 +1,8 @@ +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 diff --git a/entity/Link_entity/entityfields/url/onValidation.js b/entity/Link_entity/entityfields/url/onValidation.js index 57a945a4a1f49df29eaebbbd882faceb0d90ea43..22aae71223326a50bba80331df560878c8167e83 100644 --- a/entity/Link_entity/entityfields/url/onValidation.js +++ b/entity/Link_entity/entityfields/url/onValidation.js @@ -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()) 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")); + } +} + diff --git a/entity/Link_entity/entityfields/workflowprocessdefinition_key/displayValueProcess.js b/entity/Link_entity/entityfields/workflowprocessdefinition_key/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4172453ca7446af20c19646ab6677cb871c5f06b --- /dev/null +++ b/entity/Link_entity/entityfields/workflowprocessdefinition_key/displayValueProcess.js @@ -0,0 +1,5 @@ +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 diff --git a/entity/Link_entity/entityfields/workflowprocessdefinition_key/stateProcess.js b/entity/Link_entity/entityfields/workflowprocessdefinition_key/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..063de00448b4f5fba5df78374f26f5ef2c4c9572 --- /dev/null +++ b/entity/Link_entity/entityfields/workflowprocessdefinition_key/stateProcess.js @@ -0,0 +1,15 @@ +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 diff --git a/entity/MailLog_entity/MailLog_entity.aod b/entity/MailLog_entity/MailLog_entity.aod index 11f79c4f33c0d708f88e8c12049837a0c59f49d9..a72d503f7b22573b4ff8006afe91df4281ced77f 100644 --- a/entity/MailLog_entity/MailLog_entity.aod +++ b/entity/MailLog_entity/MailLog_entity.aod @@ -95,7 +95,7 @@ </entityProvider> <entityField> <name>DATE_SEND</name> - <title>Date</title> + <title>Send Date</title> <contentType>DATE</contentType> <resolution>MINUTE</resolution> </entityField> @@ -125,6 +125,12 @@ <title>Test Run</title> <contentType>BOOLEAN</contentType> </entityField> + <entityField> + <name>DATE_OPENED</name> + <title>Opening Date</title> + <contentType>DATE</contentType> + <resolution>MINUTE</resolution> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -203,29 +209,40 @@ <recordfield>MAIL_RUN.TESTRUN</recordfield> <isFilterable v="true" /> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_OPENED.value</name> + <recordfield>LINK_CLICK.DATE_OPENED</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> - <name>edad8141-91fd-4869-9368-5d4ce3553b12</name> + <name>6b1b4cc2-cdc1-4c15-a1d7-6b1236332884</name> <tableName>MAIL_LOG</tableName> <primaryKey>MAIL_LOGID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> <linkInformation> - <name>3ceea898-a14c-478c-8022-d7351210dc2a</name> + <name>f3319573-943a-40e8-85b7-e01192c55c1d</name> <tableName>MAIL_RUN</tableName> <primaryKey>MAIL_RUNID</primaryKey> <isUIDTable v="false" /> <readonly v="true" /> </linkInformation> <linkInformation> - <name>e02574d4-abac-4e33-b2b5-12823683ea2e</name> + <name>04a01533-28bc-4b89-b3f2-b06b7c12f393</name> <tableName>CONTACT</tableName> <primaryKey>CONTACTID</primaryKey> <isUIDTable v="false" /> <readonly v="true" /> </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> </dbRecordContainer> </recordContainers> diff --git a/entity/MailLog_entity/recordcontainers/db/fromClauseProcess.js b/entity/MailLog_entity/recordcontainers/db/fromClauseProcess.js index bfd2b1c86263e4d047ed4cb65298698ade840e3e..153f1d252acf0a767af8c8fd0a5bb66b5d4574d2 100644 --- a/entity/MailLog_entity/recordcontainers/db/fromClauseProcess.js +++ b/entity/MailLog_entity/recordcontainers/db/fromClauseProcess.js @@ -1,3 +1,4 @@ import("system.result"); 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"); \ No newline at end of file + join CONTACT on CONTACT.CONTACTID = MAIL_LOG.CONTACT_ID\n\ + left join LINK_CLICK on LINK_CLICK.LINK_CLICKID = MAIL_LOG.OPENER_LINK_CLICK_ID"); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod index 17bfa5940323c1306ad8b4a09841f9e3cc53e973..2e3b5cf4c79988e301d128a980fcb23e82b54162 100644 --- a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod +++ b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod @@ -28,6 +28,12 @@ <fieldName>WorkflowDefinitions</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>349ab9d2-edbb-4571-be14-3fb749bfff50</name> + <entityName>Link_entity</entityName> + <fieldName>WorkflowDefinitions</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityField> diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 12c920d14bcab3c66c5ef9046c07f4b8e7aa2983..757a9b87c352dbd71b363ee1c9a33e50aadfca44 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -8190,6 +8190,39 @@ <entry> <key>Not subscribed</key> </entry> + <entry> + <key>Test Run</key> + </entry> + <entry> + <key>Placeholder</key> + </entry> + <entry> + <key>Link Type</key> + </entry> + <entry> + <key>Clicks</key> + </entry> + <entry> + <key>Device Type</key> + </entry> + <entry> + <key>Mobile</key> + </entry> + <entry> + <key>Console</key> + </entry> + <entry> + <key>IP Address</key> + </entry> + <entry> + <key>Operating System</key> + </entry> + <entry> + <key>Date Clicked</key> + </entry> + <entry> + <key>Send Date</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 9b4aa94ed2e73c3b05cebc79b5b28ebc3933035f..fe6b0952f301b795c9bd66f0d0cb23987a85b360 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -22,6 +22,10 @@ <key>Set Test Recipient</key> <value>Testempfänger setzen</value> </entry> + <entry> + <key>Opening Date</key> + <value>Öffnungsdatum</value> + </entry> <entry> <key>The max participants count can not be equal or less then 0</key> <value>Die maximale Teilnehmerzahl muss größer 0 sein!</value> @@ -51,14 +55,26 @@ <key>EML files can't be edited here. You can download, edit and reupload the template to change the content.</key> <value>Das Bearbeiten von EML-Dateien ist hier nicht möglich. Um den Inhalt zu ändern, können Sie die Vorlage herunterladen, bearbeiten und erneut hochladen.</value> </entry> + <entry> + <key>Date Clicked</key> + <value>Klickdatum</value> + </entry> <entry> <key>Checklist entries</key> <value>Checklisteneinträge</value> </entry> + <entry> + <key>Operating System</key> + <value>Betriebssystem</value> + </entry> <entry> <key>Project team: \"Project manager\"</key> <value>Projektteam: \"Projektmanager\"</value> </entry> + <entry> + <key>Send Date</key> + <value>Versanddatum</value> + </entry> <entry> <key>Checklist entry</key> <value>Checklisteneintrag</value> @@ -79,6 +95,10 @@ <key>To skip a salesproject phase isn't allowed.</key> <value>Das Überspringen einer Vertriebsprojektphase ist nicht erlaubt.</value> </entry> + <entry> + <key>IP Address</key> + <value>IP-Adresse</value> + </entry> <entry> <key>Its not allowed to step over some salesproject phases.</key> <value>Es ist nicht erlaubt Vertriebsprojektphasen zu überspringen.</value> @@ -919,6 +939,10 @@ <key>Extend - request count</key> <value>Verlängert - Anfrageanzahl</value> </entry> + <entry> + <key>Console</key> + <value>Konsole</value> + </entry> <entry> <key>The person is already associated with another employee!</key> <value>Die Person ist bereits mit einem anderen Mitarbeiter verknüpft!</value> @@ -2367,6 +2391,10 @@ <key>subject</key> <value>Betreff</value> </entry> + <entry> + <key>Mobile</key> + <value>Handy</value> + </entry> <entry> <key>Document templates</key> <value>Dokumentvorlagen</value> @@ -2919,6 +2947,10 @@ <key>Taiwan</key> <value>Taiwan</value> </entry> + <entry> + <key>Clicks</key> + <value>Klicks</value> + </entry> <entry> <key>Central African Republic</key> <value>Zentralafrikanische Republik</value> @@ -3051,6 +3083,10 @@ <key>It lists all areas that the user has to take care of.</key> <value>Es werden alle Gebiete aufgelistet, die der Benutzer betreuen muss.</value> </entry> + <entry> + <key>Device Type</key> + <value>Geräteart</value> + </entry> <entry> <key>Company_size</key> <value>Unternehmen_Größe</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index c7be186ebedfdb0b81b96a5c2e7fb284cffc8b96..318acfbfa89838ee010b3d075da0a26fc28c86fc 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -8271,6 +8271,39 @@ <entry> <key>Not subscribed</key> </entry> + <entry> + <key>Test Run</key> + </entry> + <entry> + <key>Placeholder</key> + </entry> + <entry> + <key>Link Type</key> + </entry> + <entry> + <key>Clicks</key> + </entry> + <entry> + <key>Device Type</key> + </entry> + <entry> + <key>Mobile</key> + </entry> + <entry> + <key>Console</key> + </entry> + <entry> + <key>IP Address</key> + </entry> + <entry> + <key>Operating System</key> + </entry> + <entry> + <key>Date Clicked</key> + </entry> + <entry> + <key>Send Date</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/LinkClick/LinkClick.aod b/neonContext/LinkClick/LinkClick.aod new file mode 100644 index 0000000000000000000000000000000000000000..b0a1810501032143fa13ab2afbf5a62b7804824a --- /dev/null +++ b/neonContext/LinkClick/LinkClick.aod @@ -0,0 +1,13 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> + <name>LinkClick</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterView>LinkClickFilter_view</filterView> + <entity>LinkClick_entity</entity> + <references> + <neonViewReference> + <name>27fd3309-5cb7-4e27-85e3-68ce4ad2e60e</name> + <view>LinkClickFilter_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/BulkMailEdit_view/BulkMailEdit_view.aod b/neonView/BulkMailEdit_view/BulkMailEdit_view.aod index 2dbb4bea8358d3d2e1ea6f9ba29c0cc39c26e39d..6e234a5ab8e2adc42e80d17e1d25983814896cb0 100644 --- a/neonView/BulkMailEdit_view/BulkMailEdit_view.aod +++ b/neonView/BulkMailEdit_view/BulkMailEdit_view.aod @@ -76,6 +76,10 @@ <name>06f08869-5a81-41cb-8c7e-51be6a7041a7</name> <entityField>DESCRIPTION</entityField> </entityFieldLink> + <entityFieldLink> + <name>1891cd3a-34a5-4c7d-9e35-635640476c63</name> + <entityField>INTEREST_ID</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <genericViewTemplate> diff --git a/neonView/BulkMailMain_view/BulkMailMain_view.aod b/neonView/BulkMailMain_view/BulkMailMain_view.aod index f47bc71ab7f2b4eb452ab4043eca7fc2c9afb607..86095cc750d89b9c47b374218bf86a30b4992b82 100644 --- a/neonView/BulkMailMain_view/BulkMailMain_view.aod +++ b/neonView/BulkMailMain_view/BulkMailMain_view.aod @@ -34,6 +34,11 @@ <entityField>BulkMailTestRecipients</entityField> <view>BulkMailTestRecipientFilter_view</view> </neonViewReference> + <neonViewReference> + <name>bd3876a9-492e-4e2e-bcca-e86455475dca</name> + <entityField>Clicks</entityField> + <view>LinkClickFilter_view</view> + </neonViewReference> <neonViewReference> <name>49eb2dd2-0df9-4b58-bdae-f941200be8d9</name> <entityField>LogHistories</entityField> diff --git a/neonView/BulkMailPreview_view/BulkMailPreview_view.aod b/neonView/BulkMailPreview_view/BulkMailPreview_view.aod index db906f7eb30231bb607eb7b2a67ab32affdb7976..3cd10ec5dd64fc83bc30ae6601b7e51d83acdab2 100644 --- a/neonView/BulkMailPreview_view/BulkMailPreview_view.aod +++ b/neonView/BulkMailPreview_view/BulkMailPreview_view.aod @@ -55,6 +55,10 @@ <name>65546b24-3f6d-4639-b144-491ff5c478c1</name> <entityField>USE_TEMPLATE_ATTACHMENTS</entityField> </entityFieldLink> + <entityFieldLink> + <name>9f3df668-6741-4faf-9afc-a0d761db990a</name> + <entityField>INTEREST_ID</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> diff --git a/neonView/LinkClickFilter_view/LinkClickFilter_view.aod b/neonView/LinkClickFilter_view/LinkClickFilter_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..5a3ac3d04c95c2af914d49bf86f54a1ee3f5cebe --- /dev/null +++ b/neonView/LinkClickFilter_view/LinkClickFilter_view.aod @@ -0,0 +1,46 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>LinkClickFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> + <layout> + <groupLayout> + <name>layout</name> + </groupLayout> + </layout> + <children> + <tableViewTemplate> + <name>table</name> + <columns> + <neonTableColumn> + <name>49a61a9f-2f93-4f97-8829-1297327be796</name> + <entityField>URL</entityField> + </neonTableColumn> + <neonTableColumn> + <name>7651e2ad-a70b-43aa-892d-20bae6d745ff</name> + <entityField>CONTACT_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>b0052499-74c5-4ed8-aa99-7905b1686b1c</name> + <entityField>DATE_OPENED</entityField> + </neonTableColumn> + <neonTableColumn> + <name>8a018eda-e3c4-4284-aa61-92df079869cf</name> + <entityField>DEVICE_TYPE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>d484312d-23e9-4b72-83f8-c449fc546117</name> + <entityField>BROWSER</entityField> + </neonTableColumn> + <neonTableColumn> + <name>5dbbd7c3-dffe-4a98-9efa-de9b88ed5da2</name> + <entityField>OPERATING_SYSTEM</entityField> + </neonTableColumn> + <neonTableColumn> + <name>65a6fa62-e067-46a1-8996-7f8706f1c8f2</name> + <entityField>IP_ADDRESS</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/LinkEdit_view/LinkEdit_view.aod b/neonView/LinkEdit_view/LinkEdit_view.aod index 85fe37356363388bd909e8ac8fa2c1f8b1c5cc40..9ee5c3ecaf61f32c550ee9c7cde647331c970972 100644 --- a/neonView/LinkEdit_view/LinkEdit_view.aod +++ b/neonView/LinkEdit_view/LinkEdit_view.aod @@ -31,6 +31,14 @@ <name>4313c2fb-3551-4c66-81c9-ad950c44a105</name> <entityField>PLACEHOLDER</entityField> </entityFieldLink> + <entityFieldLink> + <name>2b22fb4a-5e7e-48ee-b6d1-3ee4381fb419</name> + <entityField>REDIRECT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>90ab2682-bc2d-4989-ab7b-b47045a3cbf3</name> + <entityField>WORKFLOWPROCESSDEFINITION_KEY</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> diff --git a/neonView/LinkPreview_view/LinkPreview_view.aod b/neonView/LinkPreview_view/LinkPreview_view.aod index b6a5566afbeea8772996990a797c9c2d3e944605..5712a77d7f8ecb0b6650338cfcc6a69bed5ba8cd 100644 --- a/neonView/LinkPreview_view/LinkPreview_view.aod +++ b/neonView/LinkPreview_view/LinkPreview_view.aod @@ -28,6 +28,14 @@ <name>92bb0227-5418-4a61-a7cd-eccc8def83f9</name> <entityField>PLACEHOLDER</entityField> </entityFieldLink> + <entityFieldLink> + <name>840b0f8d-763f-402d-b318-6317402a7c6c</name> + <entityField>REDIRECT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>a807f6b9-252c-4545-a2c9-266c64012097</name> + <entityField>WORKFLOWPROCESSDEFINITION_KEY</entityField> + </entityFieldLink> </fields> </genericViewTemplate> </children> diff --git a/neonView/LinktMain_view/LinktMain_view.aod b/neonView/LinktMain_view/LinktMain_view.aod index 7ec87a63f4eb80c7c879dc720e390432fa5689f3..677f6043a9ce9feb7dbae4f0055423d8c8fde41b 100644 --- a/neonView/LinktMain_view/LinktMain_view.aod +++ b/neonView/LinktMain_view/LinktMain_view.aod @@ -19,5 +19,10 @@ <entityField>#ENTITY</entityField> <view>LinkDrawer_view</view> </neonViewReference> + <neonViewReference> + <name>303de4e6-03de-419d-9875-42e10b912a1f</name> + <entityField>Clicks</entityField> + <view>LinkClickFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/MailLogFilter_view/MailLogFilter_view.aod b/neonView/MailLogFilter_view/MailLogFilter_view.aod index 9c87d390518d5216bd3313968908ff4e7a29f0b1..1bf071b561b14d3ee3d61aae946a6e414152ce0b 100644 --- a/neonView/MailLogFilter_view/MailLogFilter_view.aod +++ b/neonView/MailLogFilter_view/MailLogFilter_view.aod @@ -41,6 +41,10 @@ <name>2f5bd92d-61a1-4c45-99bf-ef6230541768</name> <entityField>DATE_SEND</entityField> </neonTableColumn> + <neonTableColumn> + <name>83d29954-ca19-4df1-8022-59e785f24eb5</name> + <entityField>DATE_OPENED</entityField> + </neonTableColumn> </columns> </tableViewTemplate> <treeTableViewTemplate> diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index e2f169b247f42930d8870f0f15c789c10625d430..b42d96038ce9581e28bc46d34d4e3d2d120e0cdd 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -21,6 +21,9 @@ import("Email_lib"); import("system.process"); import("system.notification"); import("Document_lib"); +import("system.db"); +import("system.workflow"); +import("system.logging"); /** * Functions for bulk mails. @@ -82,6 +85,7 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) useTemplateAttachments = Utils.toBoolean(useTemplateAttachments); var template = BulkMailUtils.getBulkMailTemplate(pBulkMailId, templateId, true, useTemplateAttachments); + var recipientData; var testRecipientData; var recipientLoadConfig = entities.createConfigForLoadingRows() @@ -95,6 +99,13 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) if (pIsTestRun) { + recipientData = newSelect("BULKMAILRECIPIENTID, BULKMAILRECIPIENT.CONTACT_ID, BULKMAILRECIPIENT.EMAIL_ADDRESS, PERSON_ID, ORGANISATION_ID") + .from("CONTACT") + .join("BULKMAILRECIPIENT", "BULKMAILRECIPIENT.CONTACT_ID = CONTACT.CONTACTID") + .where("BULKMAILRECIPIENT.BULKMAIL_ID", pBulkMailId) + .and("BULKMAILRECIPIENT.TEST_RECIPIENT",1) + .table(); + testRecipientData = newSelect("BULKMAILTESTRECIPIENT.CONTACT_ID, BULKMAILTESTRECIPIENT.EMAIL_ADDRESS") .from("BULKMAILTESTRECIPIENT") .where("BULKMAILTESTRECIPIENT.BULKMAIL_ID", pBulkMailId) @@ -525,6 +536,89 @@ BulkMailUtils.getEmlFile = function(pBulkMailId,pMailRunId, pMailLogId){ var fullPath = path + filename; return (fileIO.getData(fullPath,util.DATA_BINARY)); } + +/* + *Gets the redirecturl for a link in a bulkmail + * + * @param {String} pLinkId <p> + * The id of the link.<br> + * + * @return {String} <p> + * The url<br> + **/ +BulkMailUtils.getRedirectLink = function(pLinkId){ + var url ; + if (pLinkId){ + url =newSelect("LINK.URL").from("LINK").where("LINK.LINKID", pLinkId).cell(); + } + return url; +} +/* + *Inserts the Redirect into the link_click table. + * + *If its the first Click the Id gets put as opener in mail_log + * + * @param {String} pMailLogId (required)<p> + * The id of the mail log.<br> + * @param {String} pIpAddress <p> + * the ip address of the client.<br> + * @param {String} pLinkId <p> + * The id of link.<br> + * @param {String} pBrowsername <p> + * The browser that was used to open the link.<br> + * @param {String} pOperatingSystemName <p> + * The Operating System that was used to open the link.<br> + * @param {String} pDeviceType <p> + * The device type that was used to open the link.<br> + **/ + +BulkMailUtils.insertClick = function(pMailLogId,pIpAddress,pLinkId,pBrowsername,pOperatingSystemName,pDeviceType){ + if (!pMailLogId || !pLinkId) { + return + } + + var link_clickid = util.getNewUUID(); + db.insertData("LINK_CLICK" + , ["LINK_CLICKID","LINK_ID","DEVICE_TYPE","OPERATING_SYSTEM","BROWSER","IP_ADDRESS","MAIL_LOG_ID","DATE_OPENED"] + ,null + , [link_clickid,pLinkId,pDeviceType||"desktop",pOperatingSystemName||"",pBrowsername||"",pIpAddress,pMailLogId,vars.get("$sys.date")] + ); + + + newWhere("MAIL_LOG.MAIL_LOGID", pMailLogId) + .and("MAIL_LOG.OPENER_LINK_CLICK_ID is null") + .updateData(true, "MAIL_LOG", ["MAIL_LOG.OPENER_LINK_CLICK_ID"], null, [link_clickid]); +} + +/*@TODO: Abändern nachdem geklärt ist wie wir IP-Adresse erhalten. Momentan bekommen wir nur Loadbalancer Ip. + * + **/ + +BulkMailUtils.getIpAddressFromHeader = function(pHttpHeader){ + + var ipAddress; + + ipAddress = pHttpHeader["X-forwarded-for"].split(",")[0]; + + return ipAddress; +} + +BulkMailUtils.startBulkmailWorkFlow = function(pMailLogId,pLinkId){ + if (!pMailLogId || !pLinkId) { + return + } + var workFlowKey = newSelect("WORKFLOWPROCESSDEFINITION_KEY").from("LINK").where("LINK.LINKID",pLinkId).cell(); + if (workFlowKey){ + var variables = { + "MAILLOGID": pMailLogId + }; + workflow.startProcessByKey(workFlowKey, variables); + } + +} + + + function SerialLetterUtils () {} /** diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index c653469b40f1867b5889e7c3d60a77802e30d897..63c9f6f118e2277e7b5b0fe4a773fa037eca7c8a 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -378,5 +378,7 @@ $KeywordRegistry.interestLinkStatus = function(){return "InterestLinkStatus";}; $KeywordRegistry.interestLinkStatus$subscribed = function(){return "INTERESTLINK_SUBSCRIBED";}; $KeywordRegistry.interestLinkStatus$notSubscribed = function(){return "INTERESTLINK_NOTSUBSCRIBED";}; +$KeywordRegistry.deviceType = function(){return "DeviceType";};$KeywordRegistry.interestLinkStatus$notSubscribed = function(){return "INTERESTLINK_NOTSUBSCRIBED";}; + $KeywordRegistry.communicationBlacklistType = function(){return "CommunicationBlacklistType";}; $KeywordRegistry.communicationBlacklistType$emailRecipientFilter = function(){return "BLACKLIST_TYPE_EMAILRECIPIENT_FILTER";}; \ No newline at end of file diff --git a/process/UserAgentParser_lib/UserAgentParser_lib.aod b/process/UserAgentParser_lib/UserAgentParser_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..3af7739cd1371f4f262239bef668c0e0d982084a --- /dev/null +++ b/process/UserAgentParser_lib/UserAgentParser_lib.aod @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.2"> + <name>UserAgentParser_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/UserAgentParser_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/UserAgentParser_lib/process.js b/process/UserAgentParser_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..c65f44d00d5c83eee785dab469f6593ac3861262 --- /dev/null +++ b/process/UserAgentParser_lib/process.js @@ -0,0 +1,852 @@ +/*!@license + * UAParser.js v0.7.26 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2021 Faisal Salman <f@faisalman.com> + * Licensed under MIT License + */ + + + +////////////// +// Constants +///////////// + + +var LIBVERSION = '0.7.26', +EMPTY = '', +UNKNOWN = '?', +FUNC_TYPE = 'function', +UNDEF_TYPE = 'undefined', +OBJ_TYPE = 'object', +STR_TYPE = 'string', +MAJOR = 'major', // deprecated +MODEL = 'model', +NAME = 'name', +TYPE = 'type', +VENDOR = 'vendor', +VERSION = 'version', +ARCHITECTURE= 'architecture', +CONSOLE = 'console', +MOBILE = 'mobile', +TABLET = 'tablet', +SMARTTV = 'smarttv', +WEARABLE = 'wearable', +EMBEDDED = 'embedded', +UA_MAX_LENGTH = 255; + + +/////////// +// Helper +////////// + + +var UserAgentParser_util = { + extend : function (regexes, extensions) { + var mergedRegexes = {}; + for (var i in regexes) { + if (extensions[i] && extensions[i].length % 2 === 0) { + mergedRegexes[i] = extensions[i].concat(regexes[i]); + } else { + mergedRegexes[i] = regexes[i]; + } + } + return mergedRegexes; + }, + has : function (str1, str2) { + return typeof str1 === STR_TYPE ? str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1 : false; + }, + lowerize : function (str) { + return str.toLowerCase(); + }, + major : function (version) { + return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g,'').split(".")[0] : undefined; + }, + trim : function (str, len) { + str = str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); + } +}; + + +/////////////// +// Map helper +////////////// + + +var mapper = { + + rgx : function (ua, arrays) { + + var i = 0, j, k, p, q, matches, match; + + // loop through all regexes maps + while (i < arrays.length && !matches) { + + var regex = arrays[i], // even sequence (0,2,4,..) + props = arrays[i + 1]; // odd sequence (1,3,5,..) + j = k = 0; + + // try matching uastring with regexes + while (j < regex.length && !matches) { + + matches = regex[j++].exec(ua); + + if (!!matches) { + for (p = 0; p < props.length; p++) { + match = matches[++k]; + q = props[p]; + // check if given property is actually array + if (typeof q === OBJ_TYPE && q.length > 0) { + if (q.length == 2) { + if (typeof q[1] == FUNC_TYPE) { + // assign modified match + this[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + this[q[0]] = q[1]; + } + } else if (q.length == 3) { + // check whether function or regex + if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) { + // call function (usually string mapper) + this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; + } else { + // sanitize match using given regex + this[q[0]] = match ? match.replace(q[1], q[2]) : undefined; + } + } else if (q.length == 4) { + this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; + } + } else { + this[q] = match ? match : undefined; + } + } + } + } + i += 2; + } + }, + + str : function (str, map) { + + for (var i in map) { + // check if array + if (typeof map[i] === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (UserAgentParser_util.has(map[i][j], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + } else if (UserAgentParser_util.has(map[i], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + return str; + } +}; + + +/////////////// +// String map +////////////// + + +var maps = { + + browser : { + // Safari < 3.0 + oldSafari : { + version : { + '1.0' : '/8', + '1.2' : '/1', + '1.3' : '/3', + '2.0' : '/412', + '2.0.2' : '/416', + '2.0.3' : '/417', + '2.0.4' : '/419', + '?' : '/' + } + }, + oldEdge : { + version : { + '0.1' : '12.', + '21' : '13.', + '31' : '14.', + '39' : '15.', + '41' : '16.', + '42' : '17.', + '44' : '18.' + } + } + }, + + os : { + windows : { + version : { + 'ME' : '4.90', + 'NT 3.11' : 'NT3.51', + 'NT 4.0' : 'NT4.0', + '2000' : 'NT 5.0', + 'XP' : ['NT 5.1', 'NT 5.2'], + 'Vista' : 'NT 6.0', + '7' : 'NT 6.1', + '8' : 'NT 6.2', + '8.1' : 'NT 6.3', + '10' : ['NT 6.4', 'NT 10.0'], + 'RT' : 'ARM' + } + } + } +}; + + +////////////// +// Regex map +///////////// + + +var regexes = { + + browser : [[ + + /\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS + ], [VERSION, [NAME, 'Chrome']], [ + /(?:edgios|edga|edg)\/([\w\.]+)/i // Microsoft Edge + ], [VERSION, [NAME, 'Edge']], [ + /edge\/([\w\.]+)/i // Old Edge (Trident) + ], [[VERSION, mapper.str, maps.browser.oldEdge.version], [NAME, 'Edge']], [ + + // Presto based + /(opera\smini)\/([\w\.-]+)/i, // Opera Mini + /(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i, // Opera Mobi/Tablet + /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 + /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 + ], [NAME, VERSION], [ + /opios[\/\s]+([\w\.]+)/i // Opera mini on iphone >= 8.0 + ], [VERSION, [NAME, 'Opera Mini']], [ + /\sopr\/([\w\.]+)/i // Opera Webkit + ], [VERSION, [NAME, 'Opera']], [ + + // Mixed + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer|instagram)[\/\s]?([\w\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer/Instagram + // Trident based + /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser + /(ba?idubrowser)[\/\s]?([\w\.]+)/i, // Baidu Browser + /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based + /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i, + // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon + /(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i, // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ + /(weibo)__([\d\.]+)/i // Weibo + ], [NAME, VERSION], [ + /(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i // UCBrowser + ], [VERSION, [NAME, 'UCBrowser']], [ + /(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i // WeChat Desktop for Windows Built-in Browser + ], [VERSION, [NAME, 'WeChat(Win) Desktop']], [ + /micromessenger\/([\w\.]+)/i // WeChat + ], [VERSION, [NAME, 'WeChat']], [ + /konqueror\/([\w\.]+)/i // Konqueror + ], [VERSION, [NAME, 'Konqueror']], [ + /trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i // IE11 + ], [VERSION, [NAME, 'IE']], [ + /yabrowser\/([\w\.]+)/i // Yandex + ], [VERSION, [NAME, 'Yandex']], [ + /(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser + ], [[NAME, /(.+)/, '$1 Secure Browser'], VERSION], [ + /focus\/([\w\.]+)/i // Firefox Focus + ], [VERSION, [NAME, 'Firefox Focus']], [ + /opt\/([\w\.]+)/i // Opera Touch + ], [VERSION, [NAME, 'Opera Touch']], [ + /coc_coc_browser\/([\w\.]+)/i // Coc Coc Browser + ], [VERSION, [NAME, 'Coc Coc']], [ + /dolfin\/([\w\.]+)/i // Dolphin + ], [VERSION, [NAME, 'Dolphin']], [ + /coast\/([\w\.]+)/i // Opera Coast + ], [VERSION, [NAME, 'Opera Coast']], + [/xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser + ], [VERSION, [NAME, 'MIUI Browser']], [ + /fxios\/([\w\.-]+)/i // Firefox for iOS + ], [VERSION, [NAME, 'Firefox']], [ + /(qihu|qhbrowser|qihoobrowser|360browser)/i // 360 + ], [[NAME, '360 Browser']], [ + /(oculus|samsung|sailfish)browser\/([\w\.]+)/i + ], [[NAME, /(.+)/, '$1 Browser'], VERSION], [ // Oculus/Samsung/Sailfish Browser + /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon + ], [[NAME, /_/g, ' '], VERSION], [ + /m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser + ], [NAME, VERSION], [ + /(MetaSr)[\/\s]?([\w\.]+)/i, // SouGouBrowser + /(LBBROWSER)/i // LieBao Browser + ], [NAME], [ + + // WebView + /;fbav\/([\w\.]+);/i // Facebook App for iOS & Android with version + ], [VERSION, [NAME, 'Facebook']], [ + /FBAN\/FBIOS|FB_IAB\/FB4A/i // Facebook App for iOS & Android without version + ], [[NAME, 'Facebook']], [ + /\s(electron)\/([\w\.]+)\ssafari/i, // Electron-based App + /safari\s(line)\/([\w\.]+)/i, // Line App for iOS + /\b(line)\/([\w\.]+)\/iab/i // Line App for Android + ], [NAME, VERSION], [ + /\bgsa\/([\w\.]+)\s.*safari\//i // Google Search Appliance on iOS + ], [VERSION, [NAME, 'GSA']], [ + + /headlesschrome(?:\/([\w\.]+)|\s)/i // Chrome Headless + ], [VERSION, [NAME, 'Chrome Headless']], [ + + /\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView + ], [[NAME, 'Chrome WebView'], VERSION], [ + + /droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i // Android Browser + ], [VERSION, [NAME, 'Android Browser']], [ + + /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia + ], [NAME, VERSION], [ + + /version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i // Mobile Safari + ], [VERSION, [NAME, 'Mobile Safari']], [ + /version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i // Safari & Safari Mobile + ], [VERSION, NAME], [ + /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 + ], [NAME, [VERSION, mapper.str, maps.browser.oldSafari.version]], [ + + /(webkit|khtml)\/([\w\.]+)/i + ], [NAME, VERSION], [ + + // Gecko based + /(navigator|netscape)\/([\w\.-]+)/i // Netscape + ], [[NAME, 'Netscape'], VERSION], [ + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror + /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, // Other Firefox-based + /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir + /(links)\s\(([\w\.]+)/i, // Links + /(gobrowser)\/?([\w\.]*)/i, // GoBrowser + /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser + /(mosaic)[\/\s]([\w\.]+)/i // Mosaic + ], [NAME, VERSION] + ], + + cpu : [[ + + /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64 (x64) + ], [[ARCHITECTURE, 'amd64']], [ + + /(ia32(?=;))/i // IA32 (quicktime) + ], [[ARCHITECTURE, UserAgentParser_util.lowerize]], [ + + /((?:i[346]|x)86)[;\)]/i // IA32 (x86) + ], [[ARCHITECTURE, 'ia32']], [ + + /\b(aarch64|armv?8e?l?)\b/i // ARM64 + ], [[ARCHITECTURE, 'arm64']], [ + + /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i // ARMHF + ], [[ARCHITECTURE, 'armhf']], [ + + // PocketPC mistakenly identified as PowerPC + /windows\s(ce|mobile);\sppc;/i + ], [[ARCHITECTURE, 'arm']], [ + + /((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC + ], [[ARCHITECTURE, /ower/, '', UserAgentParser_util.lowerize]], [ + + /(sun4\w)[;\)]/i // SPARC + ], [[ARCHITECTURE, 'sparc']], [ + + /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i + // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC + ], [[ARCHITECTURE, UserAgentParser_util.lowerize]] + ], + + device : [[ + + ////////////////////// + // MOBILES & TABLETS + ///////////////////// + + // Samsung + /\b(sch-i[89]0\d|shw-m380s|sm-p(?:605|610|587)|sm-t\w+|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus\s10)/i, + ], [MODEL, [VENDOR, 'Samsung'], [TYPE, TABLET]], [ + /(s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+)/i, + /\ssamsung[\s-]([\w-]+)/i, + /sec-(sgh\w+)/i + ], [MODEL, [VENDOR, 'Samsung'], [TYPE, MOBILE]], [ + + // Apple + /\((ip(?:hone|od)[\s\w]*);/i // iPod/iPhone + ], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [ + /\((ipad);[\w\s\),;-]+(apple)/i // iPad + ], [MODEL, VENDOR, [TYPE, TABLET]], [ + /applecoremedia\/[\w\.]+\s\((ipad)/i + ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [ + + // Huawei + /d\/huawei([\w\s-]+)[;\)]/i, + /\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i, + /\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i + ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [ + /\b(bah2?-a?[lw]\d{2})/i // Huawei MediaPad + ], [MODEL, [VENDOR, 'Huawei'], [TYPE, TABLET]], [ + + // Xiaomi + /\b(poco[\s\w]+)(?:\sbuild|\))/i, // Xiaomi POCO + /\b;\s(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models + /\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, // Xiaomi Hongmi + /\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i, // Xiaomi Redmi + /\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i // Xiaomi Mi + ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [ + /\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i // Mi Pad tablets + ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [ + + // OPPO + /;\s(\w+)\sbuild.+\soppo/i, + /\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i + ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [ + + // Vivo + /\svivo\s(\w+)(?:\sbuild|\))/i, + /\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i + ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [ + + // Realme + /\s(rmx[12]\d{3})(?:\sbuild|;)/i + ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [ + + // Motorola + /\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i, + /\smot[\s-](\w*)/i, + /(moto[\s\w\(\)]+(?=\sbuild|\)))/i, + /(xt\d{3,4})\sbuild\//i, + /(nexus\s6)/i + ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [ + /\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i + ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [ + + // LG + /((?=lg)?[vl]k\-?\d{3})\s+build|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i + ], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [ + /(nexus\s[45])/i, + /lg[e;\s\/-]+((?!browser|netcast)\w+)/i, + /\blg(\-?[\d\w]+)\s+build/i + ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [ + + // Lenovo + /(ideatab[\w\-\s]+)/i, + /lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|[\w-]+)/i // Lenovo tablets + ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [ + + // Nokia + /(?:maemo|nokia).*(n900|lumia\s\d+)/i, + /nokia[\s_-]?([\w\.-]*)/i + ], [MODEL, [VENDOR, 'Nokia'], [TYPE, MOBILE]], [ + + // Google + /droid.+;\s(pixel\sc)[\s)]/i // Google Pixel C + ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [ + /droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i // Google Pixel + ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [ + + // Sony + /droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i + ], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [ + /sony\stablet\s[ps]\sbuild\//i, + /(?:sony)?sgp\w+(?:\sbuild\/|\))/i + ], [[MODEL, 'Xperia Tablet'], [VENDOR, 'Sony'], [TYPE, TABLET]], [ + + // OnePlus + /\s(kb2005|in20[12]5|be20[12][59])\b/i, + /\ba000(1)\s+build/i, // OnePlus + /\boneplus\s(a\d{4})[\s)]/i + ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [ + + // Amazon + /(alexa)webm/i, + /(kf[a-z]+)(\sbuild\/|\)).+silk\//i // Kindle Fire HD + ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [ + /(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i // Fire Phone + ], [[MODEL, 'Fire Phone'], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [ + + // BlackBerry + /\((playbook);[\w\s\),;-]+(rim)/i // BlackBerry PlayBook + ], [MODEL, VENDOR, [TYPE, TABLET]], [ + /\(bb10;\s(\w+)/i // BlackBerry 10 + ], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [ + + // Asus + /\b(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00c)/i + ], [MODEL, [VENDOR, 'ASUS'], [TYPE, TABLET]], [ + /\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i + ], [MODEL, [VENDOR, 'ASUS'], [TYPE, MOBILE]], [ + + // HTC + /(nexus\s9)/i // HTC Nexus 9 + ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [ + /(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, // HTC + + // ZTE + /(zte)-(\w*)/i, + /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony + ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [ + + // Acer + /droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i + ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [ + + // Meizu + /droid.+;\s(m[1-5]\snote)\sbuild/i, + /\bmz-([\w-]{2,})/i + ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [ + + // MIXED + /(blackberry)[\s-]?(\w+)/i, // BlackBerry + /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, + // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron + /(hp)\s([\w\s]+\w)/i, // HP iPAQ + /(asus)-?(\w+)/i, // Asus + /(microsoft);\s(lumia[\s\w]+)/i, // Microsoft Lumia + /(lenovo)[_\s-]?([\w-]+)/i, // Lenovo + /linux;.+(jolla);/i, // Jolla + /droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i // OPPO + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + + /(archos)\s(gamepad2?)/i, // Archos + /(hp).+(touchpad)/i, // HP TouchPad + /(hp).+(tablet)/i, // HP Tablet + /(kindle)\/([\w\.]+)/i, // Kindle + /\s(nook)[\w\s]+build\/(\w+)/i, // Nook + /(dell)\s(strea[kpr\s\d]*[\dko])/i, // Dell Streak + /[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i, // Le Pan Tablets + /[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i, // Trinity Tablets + /\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i, // Gigaset Tablets + /\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i // Vodafone + ], [VENDOR, MODEL, [TYPE, TABLET]], [ + + /\s(surface\sduo)\s/i // Surface Duo + ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, TABLET]], [ + /\s(u304aa)\sbuild/i // AT&T + ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [ + /sie-(\w*)/i // Siemens + ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [ + /[;\/]\s?(rct\w+)\sbuild/i // RCA Tablets + ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [ + /[;\/\s](venue[\d\s]{2,7})\sbuild/i // Dell Venue Tablets + ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [ + /[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i // Verizon Tablet + ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [ + /[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i // Barnes & Noble Tablet + ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [ + /[;\/]\s(tm\d{3}\w+)\sbuild/i + ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [ + /;\s(k88)\sbuild/i // ZTE K Series Tablet + ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [ + /;\s(nx\d{3}j)\sbuild/i // ZTE Nubia + ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [ + /[;\/]\s?(gen\d{3})\sbuild.*49h/i // Swiss GEN Mobile + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [ + /[;\/]\s?(zur\d{3})\sbuild/i // Swiss ZUR Tablet + ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [ + /[;\/]\s?((zeki)?tb.*\b)\sbuild/i // Zeki Tablets + ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [ + /[;\/]\s([yr]\d{2})\sbuild/i, + /[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i // Dragon Touch Tablet + ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [ + /[;\/]\s?(ns-?\w{0,9})\sbuild/i // Insignia Tablets + ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [ + /[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i // NextBook Tablets + ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [ + /[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i + ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones + /[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i // LvTel Phones + ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [ + /;\s(ph-1)\s/i + ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ // Essential PH-1 + /[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i // Envizen Tablets + ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [ + /[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i // MachSpeed Tablets + ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [ + /[;\/]\s?tu_(1491)\sbuild/i // Rotor Tablets + ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [ + /(shield[\w\s]+)\sbuild/i // Nvidia Shield Tablets + ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [ + /(sprint)\s(\w+)/i // Sprint Phones + ], [VENDOR, MODEL, [TYPE, MOBILE]], [ + /(kin\.[onetw]{3})/i // Microsoft Kin + ], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [ + /droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra + ], [MODEL, [VENDOR, 'Zebra'], [TYPE, TABLET]], [ + /droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i + ], [MODEL, [VENDOR, 'Zebra'], [TYPE, MOBILE]], [ + + /////////////////// + // CONSOLES + /////////////////// + + /\s(ouya)\s/i, // Ouya + /(nintendo)\s([wids3utch]+)/i // Nintendo + ], [VENDOR, MODEL, [TYPE, CONSOLE]], [ + /droid.+;\s(shield)\sbuild/i // Nvidia + ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [ + /(playstation\s[345portablevi]+)/i // Playstation + ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [ + /[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i // Microsoft Xbox + ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [ + + /////////////////// + // SMARTTVS + /////////////////// + + /smart-tv.+(samsung)/i // Samsung + ], [VENDOR, [TYPE, SMARTTV], MODEL], [ + /hbbtv.+maple;(\d+)/i + ], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [ + /linux;\snetcast.+smarttv/i, // LG SmartTV + /lg\snetcast\.tv-201\d/i + ], [[VENDOR, 'LG'], MODEL, [TYPE, SMARTTV]], [ + /(apple)\s?tv/i // Apple TV + ], [VENDOR, [MODEL, 'Apple TV'], [TYPE, SMARTTV]], [ + /crkey/i // Google Chromecast + ], [[MODEL, 'Chromecast'], [VENDOR, 'Google'], [TYPE, SMARTTV]], [ + /droid.+aft([\w])(\sbuild\/|\))/i // Fire TV + ], [MODEL, [VENDOR, 'Amazon'], [TYPE, SMARTTV]], [ + /\(dtv[\);].+(aquos)/i // Sharp + ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [ + /hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices + ], [[VENDOR, UserAgentParser_util.trim], [MODEL, UserAgentParser_util.trim], [TYPE, SMARTTV]], [ + /[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i // SmartTV from Unidentified Vendors + ], [[TYPE, SMARTTV]], [ + + /////////////////// + // WEARABLES + /////////////////// + + /((pebble))app\/[\d\.]+\s/i // Pebble + ], [VENDOR, MODEL, [TYPE, WEARABLE]], [ + /droid.+;\s(glass)\s\d/i // Google Glass + ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [ + /droid\s[\d\.]+;\s(wt63?0{2,3})\)/i + ], [MODEL, [VENDOR, 'Zebra'], [TYPE, WEARABLE]], [ + + //////////////////// + // MIXED (GENERIC) + /////////////////// + + /droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i // Android Phones from Unidentified Vendors + ], [MODEL, [TYPE, MOBILE]], [ + /droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors + ], [MODEL, [TYPE, TABLET]], [ + /\s(tablet|tab)[;\/]/i, // Unidentifiable Tablet + /\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile + ], [[TYPE, UserAgentParser_util.lowerize]], [ + /(android[\w\.\s\-]{0,9});.+build/i // Generic Android Device + ], [MODEL, [VENDOR, 'Generic']], [ + /(phone)/i + ], [[TYPE, MOBILE]] + ], + + engine : [[ + + /windows.+\sedge\/([\w\.]+)/i // EdgeHTML + ], [VERSION, [NAME, 'EdgeHTML']], [ + + /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink + ], [VERSION, [NAME, 'Blink']], [ + + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, + // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna + /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab + ], [NAME, VERSION], [ + + /rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko + ], [VERSION, NAME] + ], + + os : [[ + + // Windows + /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) + ], [NAME, VERSION], [ + /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT + /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, // Windows Phone + /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i + ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ + /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i + ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ + + // iOS/macOS + /ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i, // iOS + /cfnetwork\/.+darwin/i + ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ + /(mac\sos\sx)\s?([\w\s\.]*)/i, + /(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i // Mac OS + ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ + + // Mobile OSes + /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i, + // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS + /(blackberry)\w*\/([\w\.]*)/i, // Blackberry + /(tizen|kaios)[\/\s]([\w\.]+)/i // Tizen/KaiOS + ], [NAME, VERSION], [ + /\(bb(10);/i // BlackBerry 10 + ], [VERSION, [NAME, 'BlackBerry']], [ + /(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i // Symbian + ], [VERSION, [NAME, 'Symbian']], [ + /\((series40);/i // Series 40 + ], [NAME], [ + /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS + ], [[NAME, 'Firefox OS']], [ + /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS + ], [VERSION, [NAME, 'webOS']], [ + + // Google Chromecast + /crkey\/([\d\.]+)/i // Google Chromecast + ], [VERSION, [NAME, 'Chromecast']], [ + + // Console + /(nintendo|playstation)\s([wids345portablevuch]+)/i, // Nintendo/Playstation + /(xbox);\s+xbox\s([^\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S) + + // GNU/Linux based + /(mint)[\/\s\(\)]?(\w*)/i, // Mint + /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux + /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i, + // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware + // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus + /(hurd|linux)\s?([\w\.]*)/i, // Hurd/Linux + /(gnu)\s?([\w\.]*)/i // GNU + ], [NAME, VERSION], [ + + /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS + ], [[NAME, 'Chromium OS'], VERSION],[ + + // Solaris + /(sunos)\s?([\w\.\d]*)/i // Solaris + ], [[NAME, 'Solaris'], VERSION], [ + + // BSD based + /\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly + ], [NAME, VERSION],[ + + /(haiku)\s(\w+)/i // Haiku + ], [NAME, VERSION],[ + + // Other + /((?:open)?solaris)[\/\s-]?([\w\.]*)/i, // Solaris + /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, // AIX + /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, + // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS/Fuchsia + /(unix)\s?([\w\.]*)/i // UNIX + ], [NAME, VERSION] + ] +}; + +/*Slightly Modified Version of https://github.com/faisalman/ua-parser-js + *(removed all the window code used in browsers, renamed util) + * + *Constructor for an UserAgentParser to get Information about used device/os/browser + * + *@param {String} ua The User Agent part of the http header + * + *@param {object} extensions Optional Parameter for your own custom detections. + * Example: + * var myOwnListOfBrowsers = [ + * [/(mybrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION] + * ]; + * var UserAgentParser = new UAParser(ua,myOwnListOfBrowsers); + * + * for further Information look at the git repository + **/ +var UAParser = function (ua, extensions) { + + if (typeof ua === 'object') { + extensions = ua; + ua = undefined; + } + + if (!(this instanceof UAParser)) { + return new UAParser(ua, extensions).getResult(); + } + + var _ua = ua || EMPTY; + var _rgxmap = extensions ? UserAgentParser_util.extend(regexes, extensions) : regexes; + + this.getBrowser = function () { + var _browser = { + name: undefined, + version: undefined + }; + mapper.rgx.call(_browser, _ua, _rgxmap.browser); + _browser.major = UserAgentParser_util.major(_browser.version); // deprecated + return _browser; + }; + this.getCPU = function () { + var _cpu = { + architecture: undefined + }; + mapper.rgx.call(_cpu, _ua, _rgxmap.cpu); + return _cpu; + }; + this.getDevice = function () { + var _device = { + vendor: undefined, + model: undefined, + type: undefined + }; + mapper.rgx.call(_device, _ua, _rgxmap.device); + return _device; + }; + this.getEngine = function () { + var _engine = { + name: undefined, + version: undefined + }; + mapper.rgx.call(_engine, _ua, _rgxmap.engine); + return _engine; + }; + this.getOS = function () { + var _os = { + name: undefined, + version: undefined + }; + mapper.rgx.call(_os, _ua, _rgxmap.os); + return _os; + }; + this.getResult = function () { + return { + ua : this.getUA(), + browser : this.getBrowser(), + engine : this.getEngine(), + os : this.getOS(), + device : this.getDevice(), + cpu : this.getCPU() + }; + }; + this.getUA = function () { + return _ua; + }; + this.setUA = function (ua) { + _ua = ua.length > UA_MAX_LENGTH ? UserAgentParser_util.trim(ua, UA_MAX_LENGTH) : ua; + return this; + }; + this.setUA(_ua); + return this; +}; + + + + + + diff --git a/process/redirect_rest/process.js b/process/redirect_rest/process.js index fe542e60083ebae56bacd14f02bff8b8a81a2787..c567e0b9926232f1c7cd5e258dc4f147af8d62c3 100644 --- a/process/redirect_rest/process.js +++ b/process/redirect_rest/process.js @@ -1,18 +1,32 @@ +import("system.logging"); import("Workflow_lib"); import("Util_lib"); import("system.util"); +import("Bulkmail_lib"); +import("UserAgentParser_lib"); function restget (pRequest) { + var request = JSON.parse(pRequest); - var action = WorkflowLinkActions.parseAction(request.query.act); + var linkId = request.query.link; + var mailLogId = request.query.log; + var ipAddress = BulkMailUtils.getIpAddressFromHeader(request.header); + var redirectLink = BulkMailUtils.getRedirectLink(linkId); + var UserAgentObject = new UAParser(request.header["User-agent"]).getResult(); + + BulkMailUtils.insertClick(mailLogId,ipAddress,linkId,UserAgentObject.browser.name,UserAgentObject.os.name,UserAgentObject.device.type); + + BulkMailUtils.startBulkmailWorkFlow(mailLogId,linkId); + - action.run(); + - if (action.redirectLink) + if (redirectLink) { request.response.httpStatusCode = 302; //found, redirect - request.response.header.Location = action.redirectLink; + + request.response.header.Location = redirectLink; } else { diff --git a/process/redirect_rest/redirect_rest.aod b/process/redirect_rest/redirect_rest.aod index bda233f7990cbcde49e43a759006b8fd964fc26d..83abc318c0a0b898ae6e89367bb5979eb934e886 100644 --- a/process/redirect_rest/redirect_rest.aod +++ b/process/redirect_rest/redirect_rest.aod @@ -8,6 +8,7 @@ <loginTypeId> <element>internal.none</element> </loginTypeId> + <alias>Data_alias</alias> <variants> <element>EXECUTABLE</element> </variants>