Skip to content
Snippets Groups Projects
Commit f47c7560 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

1079700 remove communication blacklist

parent a4395edf
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 174 deletions
<?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="create_communicationBlacklist.xml"/>
<include relativeToChangelogFile="true" file="insert_blacklistTypeKeyword.xml"/>
</databaseChangeLog>
\ No newline at end of file
<?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="s.listl" id="9415eb4f-ea93-433c-8a69-1bdb77c6ec87">
<createTable tableName="COMMUNICATIONBLACKLIST">
<column name="COMMUNICATIONBLACKLISTID" type="CHAR(36)">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_COMMUNICATIONBLACKLISTID"/>
</column>
<column name="BLACKLIST_TYPE" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
<column name="BLACKLIST_FILTER" type="NCLOB"/>
<column name="REASON" type="NVARCHAR(500)"/>
<column name="START_DATE" type="DATETIME"/>
<column name="END_DATE" type="DATETIME"/>
<column name="DATE_NEW" type="DATETIME">
<constraints nullable="false"/>
</column>
<column name="USER_NEW" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
<column name="DATE_EDIT" type="DATETIME"/>
<column name="USER_EDIT" type="VARCHAR(50)"/>
</createTable>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?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="s.listl" id="89ba3828-288c-4af7-bf98-feccc01ce312">
<insert tableName="AB_KEYWORD_CATEGORY">
<column name="AB_KEYWORD_CATEGORYID" value="e980999c-0f8e-484b-852b-92d60c38c14f"/>
<column name="NAME" value="CommunicationBlacklistType"/>
<column name="SORTINGBY" valueNumeric="0"/>
<column name="SORTINGDIRECTION" value="ASC"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="a1c8d2c6-54c7-4e9d-9792-dd576ac6f43e"/>
<column name="AB_KEYWORD_CATEGORY_ID" value="e980999c-0f8e-484b-852b-92d60c38c14f"/>
<column name="KEYID" value="BLACKLIST_TYPE_EMAILRECIPIENT_FILTER"/>
<column name="TITLE" value="Recipient filter"/>
<column name="CONTAINER" value="CommunicationBlacklistType"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="0"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -5,7 +5,6 @@
<include relativeToChangelogFile="true" file="LinkManagement/changelog.xml"/>
<include relativeToChangelogFile="true" file="CommunicationSettings/changelog.xml"/>
<include relativeToChangelogFile="true" file="Interest/changelog.xml"/>
<include relativeToChangelogFile="true" file="CommunicationBlacklist/changelog.xml"/>
<include relativeToChangelogFile="true" file="Checklists/changelog.xml"/>
<include relativeToChangelogFile="true" file="Planning/changelog.xml"/>
<include relativeToChangelogFile="true" file="alter_origin_attribute.xml"/>
......
......@@ -204,10 +204,6 @@
<name>Interest</name>
<kind v="10077" />
</entityNode>
<entityNode>
<name>CommunicationBlacklist</name>
<kind v="10077" />
</entityNode>
</childNodes>
</entityNode>
<entityNode>
......
......@@ -313,16 +313,6 @@
<readonly v="true" />
</linkInformation>
</linkInformation>
<filterExtensions>
<filterExtension>
<name>Blacklist_filter</name>
<title>Blacklist</title>
<contentType>BOOLEAN</contentType>
<filterValuesProcess>%aditoprj%/entity/BulkMailRecipient_entity/recordcontainers/db/filterextensions/blacklist_filter/filterValuesProcess.js</filterValuesProcess>
<filterConditionProcess>%aditoprj%/entity/BulkMailRecipient_entity/recordcontainers/db/filterextensions/blacklist_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtension>
</filterExtensions>
</dbRecordContainer>
</recordContainers>
</entity>
......@@ -7,7 +7,6 @@ import("Sql_lib");
import("MarketingCondition_lib");
var excludeWithCommunicationRejection = Utils.toBoolean(vars.get("$param.ExcludeCommunicationRejecting_param"));
var excludeBlacklisted = Utils.toBoolean(vars.get("$param.ExcludeBlacklisted_param"));
var excludedStatus = Utils.parseJSON(vars.get("$param.ExcludedStatus_param"));
var isTestMail = Utils.toBoolean(vars.get("$param.IsTestMail_param"));
......@@ -26,10 +25,6 @@ else
.existNoSettings()
.buildCondition());
}
if (excludeBlacklisted)
{
condition.and("not (" + CommunicationBlacklist.getMailRecipientBlacklist().buildCondition() + ")");
}
if (!Utils.isNullOrEmpty(excludedStatus))
{
condition.and("BULKMAILRECIPIENT.STATUS", excludedStatus, SqlBuilder.NOT_IN());
......
import("Sql_lib");
import("system.result");
import("Util_lib");
import("system.vars");
import("MarketingCondition_lib");
var operator = vars.get("$local.operator2").trim();
var fetchBlacklisted = Utils.toBoolean(vars.get("$local.rawvalue"));
var condition = newWhere();
if (operator == "<>")
{
fetchBlacklisted = !fetchBlacklisted;
operator = "=";
}
if (operator == "=")
{
var blacklistCondition = CommunicationBlacklist.getMailRecipientBlacklist().getCondition();
if (fetchBlacklisted && blacklistCondition.hasCondition())
condition.and(blacklistCondition);
else if (fetchBlacklisted)
condition.noResult();
else if (blacklistCondition.hasCondition())
condition.and(null, blacklistCondition, SqlBuilder.NOT());
}
else
{
condition.noResult();
}
result.string(condition.toString("1=1"));
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.translate");
result.object([
["true", translate.text("Yes")],
["false", translate.text("No")]
]);
\ No newline at end of file
......@@ -405,9 +405,6 @@ $KeywordRegistry.interestLinkStatus$notSubscribed = function(){return "INTERESTL
$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";};
$KeywordRegistry.weblinkActionType = function(){return "WeblinkActionType";};
$KeywordRegistry.weblinkActionType$startWorkflow = function(){return "LINKACTION_STARTWORKFLOW";};
$KeywordRegistry.weblinkActionType$sendWorkflowSignal = function(){return "LINKACTION_SENDSIGNAL";};
\ No newline at end of file
......@@ -149,58 +149,3 @@ CommunicationSettingsCondition.prototype.buildCondition = function ()
{
return newWhere(null, this.buildSelect(), this._existsOperator);
}
/* required functionality:
* - make communication settings condition
* - make interest condition
* - make blacklist condition
* - make full condition
* - check for single contact
*/
function CommunicationBlacklist ()
{
this.filter = null;
}
/**
* @return {CommunicationBlacklist}
*/
CommunicationBlacklist.getMailRecipientBlacklist = function ()
{
var currentDate = vars.get("$sys.date");
var filters = newSelect("BLACKLIST_FILTER")
.from("COMMUNICATIONBLACKLIST")
.where("COMMUNICATIONBLACKLIST.BLACKLIST_TYPE", $KeywordRegistry.communicationBlacklistType$emailRecipientFilter())
.and(newWhere("COMMUNICATIONBLACKLIST.START_DATE", currentDate, SqlBuilder.GREATER_OR_EQUAL())
.or("COMMUNICATIONBLACKLIST.START_DATE is null"))
.and(newWhere("COMMUNICATIONBLACKLIST.END_DATE", currentDate, SqlBuilder.LESS_OR_EQUAL()))
.or("COMMUNICATIONBLACKLIST.END_DATE is null")
.table();
var filterMappingFn = function ([blacklistFilter])
{
blacklistFilter = JSON.parse(blacklistFilter);
if (!blacklistFilter.filter || blacklistFilter.entity != "BulkMailRecipient_entity" || Utils.isNullOrEmpty(blacklistFilter.filter.childs))
return null;
return blacklistFilter.filter;
};
var blacklist = new CommunicationBlacklist();
blacklist.filter = {
type: "group",
operator: "AND",
childs: filters.map(filterMappingFn).filter(Utils.isObject)
};
return blacklist;
}
CommunicationBlacklist.prototype.getCondition = function ()
{
return new FilterSqlTranslator()
.filter(this.filter)
.table("BULKMAILRECIPIENT")
.getSqlCondition();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment