Skip to content

Commit

Permalink
Merge pull request #29 from Kentico/feat/handleNewDataType
Browse files Browse the repository at this point in the history
Handle new data type
  • Loading branch information
DanielJurcaBS authored Aug 22, 2024
2 parents 72f5115 + c05bf94 commit 59c5153
Show file tree
Hide file tree
Showing 28 changed files with 617 additions and 523 deletions.
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.0.0" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="29.0.0" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="29.0.0" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="29.0.0" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.3.0" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="29.3.0" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="29.3.0" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="29.3.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.6.0.74858" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public class SampleDataGeneratorApplication : OverviewPageBase

private readonly IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer;
private readonly IEventLogService eventLogService;
private readonly IConsentInfoProvider consentInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IContactGroupInfoProvider contactGroupInfoProvider;
private readonly ISettingsKeyInfoProvider settingsKeyInfoProvider;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;
private readonly IInfoProvider<ContactGroupInfo> contactGroupInfoProvider;
private readonly IInfoProvider<SettingsKeyInfo> settingsKeyInfoProvider;
private readonly IInfoProvider<WebsiteChannelInfo> websiteChannelInfoProvider;


Expand All @@ -60,10 +60,10 @@ public class SampleDataGeneratorApplication : OverviewPageBase
public SampleDataGeneratorApplication(
IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer,
IEventLogService eventLogService,
IConsentInfoProvider consentInfoProvider,
IBizFormInfoProvider bizFormInfoProvider,
IContactGroupInfoProvider contactGroupInfoProvider,
ISettingsKeyInfoProvider settingsKeyInfoProvider,
IInfoProvider<ConsentInfo> consentInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider,
IInfoProvider<ContactGroupInfo> contactGroupInfoProvider,
IInfoProvider<SettingsKeyInfo> settingsKeyInfoProvider,
IInfoProvider<WebsiteChannelInfo> websiteChannelInfoProvider)
{
this.formBuilderConfigurationSerializer = formBuilderConfigurationSerializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Threading.Tasks;

using CMS.ContactManagement;
using CMS.DataEngine;
using CMS.DataProtection;
using CMS.Websites;
using CMS.Websites.Routing;
Expand All @@ -17,7 +18,7 @@ namespace DancingGoat.ViewComponents
{
public class TrackingConsentViewComponent : ViewComponent
{
private readonly IConsentInfoProvider consentInfoProvider;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;
private readonly IConsentAgreementService consentAgreementService;
private readonly IPreferredLanguageRetriever currentLanguageRetriever;
private readonly IWebPageDataContextRetriever webPageDataContextRetriever;
Expand All @@ -26,7 +27,7 @@ public class TrackingConsentViewComponent : ViewComponent


public TrackingConsentViewComponent(
IConsentInfoProvider consentInfoProvider,
IInfoProvider<ConsentInfo> consentInfoProvider,
IConsentAgreementService consentAgreementService,
IPreferredLanguageRetriever currentLanguageRetriever,
IWebPageDataContextRetriever webPageDataContextRetriever,
Expand Down
5 changes: 3 additions & 2 deletions examples/DancingGoat/Controllers/ConsentController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CMS.ContactManagement;
using CMS.DataEngine;
using CMS.DataProtection;
using CMS.Helpers;

Expand All @@ -13,10 +14,10 @@ public class ConsentController : Controller
{
private readonly ICurrentCookieLevelProvider cookieLevelProvider;
private readonly IConsentAgreementService consentAgreementService;
private readonly IConsentInfoProvider consentInfoProvider;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;


public ConsentController(ICurrentCookieLevelProvider cookieLevelProvider, IConsentAgreementService consentAgreementService, IConsentInfoProvider consentInfoProvider)
public ConsentController(ICurrentCookieLevelProvider cookieLevelProvider, IConsentAgreementService consentAgreementService, IInfoProvider<ConsentInfo> consentInfoProvider)
{
this.cookieLevelProvider = cookieLevelProvider;
this.consentAgreementService = consentAgreementService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;

using CMS.ContactManagement;
using CMS.DataEngine;
using CMS.DataProtection;

using DancingGoat;
Expand All @@ -24,7 +25,7 @@ public class DancingGoatPrivacyController : Controller
private const string ERROR_RESULT = "error";

private readonly IConsentAgreementService consentAgreementService;
private readonly IConsentInfoProvider consentInfoProvider;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;
private readonly IPreferredLanguageRetriever currentLanguageRetriever;
private ContactInfo currentContact;

Expand All @@ -43,7 +44,7 @@ private ContactInfo CurrentContact
}


public DancingGoatPrivacyController(IConsentAgreementService consentAgreementService, IConsentInfoProvider consentInfoProvider, IPreferredLanguageRetriever currentLanguageRetriever)
public DancingGoatPrivacyController(IConsentAgreementService consentAgreementService, IInfoProvider<ConsentInfo> consentInfoProvider, IPreferredLanguageRetriever currentLanguageRetriever)
{
this.consentAgreementService = consentAgreementService;
this.consentInfoProvider = consentInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ internal class DancingGoatSamplesModule : Module
{
private const string DATA_PROTECTION_SAMPLES_ENABLED_SETTINGS_KEY_NAME = "DataProtectionSamplesEnabled";

private IContactInfoProvider contactInfoProvider;
private IMemberInfoProvider memberInfoProvider;
private IConsentAgreementInfoProvider consentAgreementInfoProvider;
private IBizFormInfoProvider bizFormInfoProvider;
private IAccountContactInfoProvider accountContactInfoProvider;
private ISettingsKeyInfoProvider settingsKeyInfoProvider;
private IActivityInfoProvider activityInfoProvider;
private ICountryInfoProvider countryInfoProvider;
private IStateInfoProvider stateInfoProvider;
private IAccountInfoProvider accountInfoProvider;
private IInfoProvider<ContactInfo> contactInfoProvider;
private IInfoProvider<MemberInfo> memberInfoProvider;
private IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private IInfoProvider<BizFormInfo> bizFormInfoProvider;
private IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private IInfoProvider<SettingsKeyInfo> settingsKeyInfoProvider;
private IInfoProvider<ActivityInfo> activityInfoProvider;
private IInfoProvider<CountryInfo> countryInfoProvider;
private IInfoProvider<StateInfo> stateInfoProvider;
private IInfoProvider<AccountInfo> accountInfoProvider;


/// <summary>
Expand All @@ -57,16 +57,16 @@ protected override void OnInit()
{
base.OnInit();

contactInfoProvider = Service.Resolve<IContactInfoProvider>();
memberInfoProvider = Service.Resolve<IMemberInfoProvider>();
consentAgreementInfoProvider = Service.Resolve<IConsentAgreementInfoProvider>();
bizFormInfoProvider = Service.Resolve<IBizFormInfoProvider>();
accountContactInfoProvider = Service.Resolve<IAccountContactInfoProvider>();
settingsKeyInfoProvider = Service.Resolve<ISettingsKeyInfoProvider>();
activityInfoProvider = Service.Resolve<IActivityInfoProvider>();
countryInfoProvider = Service.Resolve<ICountryInfoProvider>();
stateInfoProvider = Service.Resolve<IStateInfoProvider>();
accountInfoProvider = Service.Resolve<IAccountInfoProvider>();
contactInfoProvider = Service.Resolve<IInfoProvider<ContactInfo>>();
memberInfoProvider = Service.Resolve<IInfoProvider<MemberInfo>>();
consentAgreementInfoProvider = Service.Resolve<IInfoProvider<ConsentAgreementInfo>>();
bizFormInfoProvider = Service.Resolve<IInfoProvider<BizFormInfo>>();
accountContactInfoProvider = Service.Resolve<IInfoProvider<AccountContactInfo>>();
settingsKeyInfoProvider = Service.Resolve<IInfoProvider<SettingsKeyInfo>>();
activityInfoProvider = Service.Resolve<IInfoProvider<ActivityInfo>>();
countryInfoProvider = Service.Resolve<IInfoProvider<CountryInfo>>();
stateInfoProvider = Service.Resolve<IInfoProvider<StateInfo>>();
accountInfoProvider = Service.Resolve<IInfoProvider<AccountInfo>>();

InitializeSamples();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleContactInfoIdentityCollector : IIdentityCollector
{
private readonly IContactInfoProvider contactInfoProvider;
private readonly IInfoProvider<ContactInfo> contactInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="SampleContactInfoIdentityCollector"/> class.
/// </summary>
/// <param name="contactInfoProvider">Contact info provider.</param>
public SampleContactInfoIdentityCollector(IContactInfoProvider contactInfoProvider)
public SampleContactInfoIdentityCollector(IInfoProvider<ContactInfo> contactInfoProvider)
{
this.contactInfoProvider = contactInfoProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleMemberInfoIdentityCollector : IIdentityCollector
{
private readonly IMemberInfoProvider memberInfoProvider;
private readonly IInfoProvider<MemberInfo> memberInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="SampleMemberInfoIdentityCollector"/> class.
/// </summary>
/// <param name="memberInfoProvider">Member info provider.</param>
public SampleMemberInfoIdentityCollector(IMemberInfoProvider memberInfoProvider)
public SampleMemberInfoIdentityCollector(IInfoProvider<MemberInfo> memberInfoProvider)
{
this.memberInfoProvider = memberInfoProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleContactDataCollector : IPersonalDataCollector
{
private readonly IActivityInfoProvider activityInfoProvider;
private readonly ICountryInfoProvider countryInfoProvider;
private readonly IStateInfoProvider stateInfoProvider;
private readonly IConsentAgreementInfoProvider consentAgreementInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IAccountInfoProvider accountInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IInfoProvider<ActivityInfo> activityInfoProvider;
private readonly IInfoProvider<CountryInfo> countryInfoProvider;
private readonly IInfoProvider<StateInfo> stateInfoProvider;
private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<AccountInfo> accountInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;


/// <summary>
Expand All @@ -34,13 +34,13 @@ internal class SampleContactDataCollector : IPersonalDataCollector
/// <param name="accountInfoProvider">Account info provider.</param>
/// <param name="bizFormInfoProvider">BizForm info provider.</param>
public SampleContactDataCollector(
IActivityInfoProvider activityInfoProvider,
ICountryInfoProvider countryInfoProvider,
IStateInfoProvider stateInfoProvider,
IConsentAgreementInfoProvider consentAgreementInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IAccountInfoProvider accountInfoProvider,
IBizFormInfoProvider bizFormInfoProvider)
IInfoProvider<ActivityInfo> activityInfoProvider,
IInfoProvider<CountryInfo> countryInfoProvider,
IInfoProvider<StateInfo> stateInfoProvider,
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<AccountInfo> accountInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider)
{
this.activityInfoProvider = activityInfoProvider;
this.countryInfoProvider = countryInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ namespace Samples.DancingGoat
internal class SampleContactDataCollectorCore
{
private readonly IPersonalDataWriter writer;
private readonly IActivityInfoProvider activityInfoProvider;
private readonly ICountryInfoProvider countryInfoProvider;
private readonly IStateInfoProvider stateInfoProvider;
private readonly IConsentAgreementInfoProvider consentAgreementInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IAccountInfoProvider accountInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IInfoProvider<ActivityInfo> activityInfoProvider;
private readonly IInfoProvider<CountryInfo> countryInfoProvider;
private readonly IInfoProvider<StateInfo> stateInfoProvider;
private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<AccountInfo> accountInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;

// Lists store Tuples of database column names and their corresponding display names.
private readonly List<CollectedColumn> contactInfoColumns = new List<CollectedColumn> {
Expand Down Expand Up @@ -325,13 +325,13 @@ private object TransformConsentAction(string columnName, object columnValue)
/// <param name="bizFormInfoProvider">BizForm info provider.</param>
public SampleContactDataCollectorCore(
IPersonalDataWriter writer,
IActivityInfoProvider activityInfoProvider,
ICountryInfoProvider countryInfoProvider,
IStateInfoProvider stateInfoProvider,
IConsentAgreementInfoProvider consentAgreementInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IAccountInfoProvider accountInfoProvider,
IBizFormInfoProvider bizFormInfoProvider)
IInfoProvider<ActivityInfo> activityInfoProvider,
IInfoProvider<CountryInfo> countryInfoProvider,
IInfoProvider<StateInfo> stateInfoProvider,
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<AccountInfo> accountInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider)
{
this.writer = writer;
this.activityInfoProvider = activityInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
{ new Guid("DAAA080A-7B6B-489E-8150-290B1F24E715"), "Email" }
};

private readonly IConsentAgreementInfoProvider consentAgreementInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IContactInfoProvider contactInfoProvider;
private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<ContactInfo> contactInfoProvider;


/// <summary>
Expand All @@ -49,10 +49,10 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
/// <param name="accountContactInfoProvider">Account contact info provider.</param>
/// <param name="contactInfoProvider">Contact info provider.</param>
public SampleContactPersonalDataEraser(
IConsentAgreementInfoProvider consentAgreementInfoProvider,
IBizFormInfoProvider bizFormInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IContactInfoProvider contactInfoProvider)
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider,
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<ContactInfo> contactInfoProvider)
{
this.consentAgreementInfoProvider = consentAgreementInfoProvider;
this.bizFormInfoProvider = bizFormInfoProvider;
Expand Down Expand Up @@ -210,4 +210,4 @@ private void DeleteContacts(IEnumerable<ContactInfo> contacts, IDictionary<strin
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleMemberPersonalDataEraser : IPersonalDataEraser
{
private readonly IMemberInfoProvider memberInfoProvider;
private readonly IInfoProvider<MemberInfo> memberInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="SampleMemberPersonalDataEraser"/> class.
/// </summary>
/// <param name="memberInfoProvider">Member info provider.</param>
public SampleMemberPersonalDataEraser(IMemberInfoProvider memberInfoProvider)
public SampleMemberPersonalDataEraser(IInfoProvider<MemberInfo> memberInfoProvider)
{
this.memberInfoProvider = memberInfoProvider;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CMS.ContactManagement;
using CMS.DataEngine;
using CMS.MacroEngine;
using CMS.Membership;

Expand All @@ -9,14 +10,14 @@ public class FormContactGroupGenerator
private const string CONTACT_GROUP_DISPLAY_NAME = "Coffee samples applicants";
private const string CONTACT_GROUP_NAME = "CoffeeSamplesApplicants";

private readonly IContactGroupInfoProvider contactGroupInfoProvider;
private readonly IInfoProvider<ContactGroupInfo> contactGroupInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="FormContactGroupGenerator"/> class.
/// </summary>
/// <param name="contactGroupInfoProvider">Contact group info provider.</param>
public FormContactGroupGenerator(IContactGroupInfoProvider contactGroupInfoProvider)
public FormContactGroupGenerator(IInfoProvider<ContactGroupInfo> contactGroupInfoProvider)
{
this.contactGroupInfoProvider = contactGroupInfoProvider;
}
Expand Down
Loading

0 comments on commit 59c5153

Please sign in to comment.