Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ segments_2i
**/Client/dist/*
**/nuget-local/*.*pkg

/examples/DancingGoat/Properties/PublishProfiles
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.2.2" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="29.2.2" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="29.2.2" />
<PackageVersion Include="kentico.xperience.webapp" Version="29.2.2" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="30.5.1" />
<PackageVersion Include="kentico.xperience.azurestorage" Version="30.5.1" />
<PackageVersion Include="kentico.xperience.imageprocessing" Version="30.5.1" />
<PackageVersion Include="kentico.xperience.webapp" Version="30.5.1" />
<PackageVersion Include="CsvHelper" Version="33.0.1" />
<PackageVersion Include="Kentico.Xperience.ContactsImporter" Version="" Condition="'$(LOCAL_NUGET)' == 'true'" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
Expand Down
6 changes: 3 additions & 3 deletions Kentico.Xperience.Contacts.Importer.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
#
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion =
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8864B8E5-2F23-4778-BBF7-DDEFD166950B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{ED0957C3-0B03-4EFE-9282-B37ABB6CDB24}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
Directory.build.targets = Directory.build.targets
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{85B04BD2-2182-450B-BD91-83023633E95E}"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Enables bulk importing of Contacts into an Xperience by Kentico solution using a

### Prerequisites

- Xperience by Kentico >= 29.2.2
- Xperience by Kentico >= 30.5.1

- <https://docs.kentico.com/changelog#hotfix-july-11-2024>
- <https://docs.kentico.com/documentation/changelog#hotfix-may-22-2025>

### Installation

Expand Down Expand Up @@ -73,9 +73,15 @@ Notes:
| ContactFirstName | string | no |
| ContactLastName | string | no |
| ContactEmail | string | no |
| ContactAge | Int32 | no |
| ContactAddress1 | string | no |
| ContactMiddleName | string | no |

In the CSV file, define the first row as a header containing the names of the individual columns.
Header validation is performed during the file upload. See example file [Contact Sample](https://github.com/Kentico/xperience-by-kentico-contacts-importer/blob/main/data/contact_sample.csv).

> [!IMPORTANT]
> For correct functionality, please make sure to add a newline at the end of the CSV file.

## Contributing

To see the guidelines for Contributing to Kentico open source software, please see [Kentico's `CONTRIBUTING.md`](https://github.com/Kentico/.github/blob/main/CONTRIBUTING.md) for more information and follow the [Kentico's `CODE_OF_CONDUCT`](https://github.com/Kentico/.github/blob/main/CODE_OF_CONDUCT.md).
Expand Down
51 changes: 51 additions & 0 deletions data/contact_sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
ContactGUID,ContactCreated,ContactFirstName,ContactLastName,ContactEmail,ContactAddress1,ContactMiddleName
00b48dc5-66e9-b26d-4994-95bd49e10dc4,05/03/2023 03:25:36,Latoya,Ziemann,Una.Jones@hotmail.com,20636 Wilfredo Rapid,Latoya
336620dc-0d78-dda2-35d5-e7fa9496daaf,03/01/2023 19:05:19,Kay,Hoeger,Aida27@gmail.com,976 Adams Crescent,Kay
744a8485-71f6-22eb-f56d-7641751fc3e9,06/01/2023 09:46:08,Johnnie,Armstrong,Arden34@hotmail.com,4755 Floy Skyway,Johnnie
322a5689-c4d8-dc06-0797-08db75ac0b49,01/09/2023 02:00:09,Crystal,Breitenberg,Magdalen_Bergnaum@hotmail.com,71226 Elisa Gateway,Crystal
ba446880-03b5-a06c-919d-b8dce02253e4,06/08/2023 20:32:57,Lynne,Koss,Zelma.Rice@gmail.com,603 Torey Avenue,Lynne
6c783262-0ca5-ceb3-ef18-2f605cdea686,07/28/2023 14:55:19,Jake,Strosin,Michale.Upton@gmail.com,19776 Gutkowski Hills,Jake
93f22585-fedb-0c2a-0bb1-64c182a73a79,02/25/2023 04:21:51,Sally,Schneider,Shad.Lowe25@gmail.com,6670 Hoppe Vista,Sally
3201affa-73c8-4316-cb52-9a8170a8fba9,07/04/2023 22:13:34,Juanita,Roob,Seamus4@gmail.com,4075 Junius Lodge,Juanita
289cdc32-002e-df32-5da8-d307f94de4cf,03/22/2023 07:20:17,Jennie,MacGyver,Benton_Barton13@yahoo.com,99035 Amiya Station,Jennie
fbeb4f3e-59ff-f429-c934-fb59e68f8d56,03/02/2023 11:40:48,Cindy,Ledner,Dolly.Trantow@gmail.com,66654 Mills Mills,Cindy
a99c132b-676f-6d37-706e-5d627876b779,07/11/2023 03:10:55,Bobby,Buckridge,Burdette_Stokes@yahoo.com,40264 Quitzon Village,Bobby
6ad8a8ab-5fcf-b440-dc9d-e2676ef333b1,07/18/2023 12:45:41,Jody,Maggio,Alberto.Hermann94@hotmail.com,829 Maci Groves,Jody
bb2bb5ca-4d11-feaa-6449-77f7cbc2a321,02/28/2023 14:47:12,Kari,Klocko,Marisol30@yahoo.com,32006 Hand Mountains,Kari
4df8d0eb-ee34-8adb-c7ef-a255bd86389b,07/27/2023 11:44:44,Shannon,Kuphal,Lamar2@gmail.com,103 Katlynn Stravenue,Shannon
3ac04951-d232-46bd-a8bb-f1bd5402f2ff,05/21/2023 10:59:33,Angie,White,Tom75@hotmail.com,5979 Howe Lodge,Angie
4ce9d802-e4fc-f92b-93cc-cc85012f1752,02/25/2023 22:18:21,Maggie,Lesch,Jeffry8@gmail.com,980 Terrance Light,Maggie
c2b47d95-289b-41fc-c8cc-2d12846f5773,06/25/2023 20:11:14,Stacey,Shanahan,Vanessa_Weissnat27@yahoo.com,71067 Zack Parkways,Stacey
303faac1-55fc-d4c4-4eb4-5ae15acac7b8,04/21/2023 04:27:35,Darin,Macejkovic,Janiya50@hotmail.com,868 Trever Corners,Darin
b9574610-6a5f-f4a9-b563-8579a6c3f11b,01/07/2023 07:36:42,Melba,Gottlieb,Lorena.VonRueden@gmail.com,88021 Barry Spring,Melba
5d31e730-7146-11b7-562a-a354c6950845,07/17/2023 07:22:35,Fredrick,Smitham,Colin_Medhurst@hotmail.com,7955 Orlo Skyway,Fredrick
595185b9-df75-d0c7-7b4d-1131a0cee8cf,05/16/2023 01:40:56,Jane,Hauck,Norma.Gutmann@gmail.com,8445 Ruecker Camp,Jane
c6f33da5-e6e3-ef97-3932-c2dec8929a98,04/16/2023 05:07:36,Simon,Marvin,Jaeden_Cummerata@gmail.com,334 Abernathy Skyway,Simon
5b9c5c65-3d40-74b3-22f1-ef101ecc4668,06/25/2023 11:56:53,Sophia,Nitzsche,Rosina_Hills96@yahoo.com,03264 Hegmann Drives,Sophia
2c6c51e2-82fc-0882-c2aa-c0e835473120,05/13/2023 00:53:40,Rochelle,Keebler,Aniyah53@gmail.com,96539 Gracie Court,Rochelle
a060f914-af76-e92a-c398-8624f0d92946,05/14/2023 03:08:56,Darin,Schmeler,Isidro.Kling@yahoo.com,82931 Marvin Ports,Darin
16651e99-0305-5bb7-abdc-2e928438ca8c,06/18/2023 15:59:12,Dwight,Greenfelder,Lucious69@hotmail.com,645 Huels Port,Dwight
7db302b5-e93d-c111-f4ef-427c344e3e0b,01/20/2023 01:11:49,Troy,Lakin,Koby.Boehm41@yahoo.com,964 Marquardt Glens,Troy
c2d53da5-0fd3-3a46-737c-fa8ef60d4ccc,05/27/2023 05:02:30,Elisa,Goyette,Alexie.Wunsch@yahoo.com,373 Rowe Highway,Elisa
76b9d9d5-9f1d-3931-d759-e00afd56f71e,01/14/2023 11:05:22,Rolando,Rosenbaum,Samara_Daniel@yahoo.com,598 Klocko Path,Rolando
8db7a044-1560-e136-6444-340578f725fc,05/25/2023 09:15:26,Floyd,Swift,Kirk_Bauch@gmail.com,53296 Verner Stravenue,Floyd
92443d3b-dbe6-cdab-3370-efb8eb195078,01/21/2023 18:51:51,Juan,Zulauf,Ashleigh.Nikolaus@yahoo.com,78783 Mervin Trail,Juan
8d21c044-5147-b445-21d7-734981d5e999,05/15/2023 21:47:31,Archie,Goldner,Giuseppe.VonRueden@hotmail.com,522 Hessel Drive,Archie
6e48f3a6-6506-04f9-be95-213ec1fd2215,02/02/2023 08:53:20,Celia,Murazik,Bobby52@hotmail.com,0234 Ritchie Mission,Celia
d4e52f15-80a8-b975-09ce-15f182716700,06/15/2023 01:06:23,Mitchell,Rogahn,Maurice.Altenwerth@gmail.com,1058 Harvey Prairie,Mitchell
656517a3-8801-4164-e9e9-80d789d44087,04/23/2023 04:00:29,Edith,Graham,Linda.Pollich@hotmail.com,875 Bailey Overpass,Edith
6ffa9b52-9b9a-50d7-fc9f-14c3557a75bc,05/17/2023 00:11:29,Elizabeth,Blanda,Lennie77@yahoo.com,350 Grady Hollow,Elizabeth
104acfa4-cf42-c69a-b985-69457596c0ea,04/27/2023 07:07:00,Kimberly,Spinka,Randal68@gmail.com,2882 Shanahan Meadow,Kimberly
695b2f6d-a44b-c365-dee6-743a30ed1f25,01/16/2023 00:29:42,Madeline,Rippin,Hermina.Klocko@yahoo.com,23039 Flatley River,Madeline
b8701c86-8a86-f643-1e0d-3756ae4c4b2c,02/09/2023 05:24:49,Luke,Conn,Joel_Terry@yahoo.com,56307 Schumm Mission,Luke
c60e314f-fd09-ab9a-c000-643df1eae41a,07/08/2023 05:56:11,Dominic,Rowe,Alec_OKon50@hotmail.com,52379 Nikki Path,Dominic
7f3f1e3e-42d9-bad3-9d32-89f12111a57b,06/02/2023 08:20:36,Oliver,Bednar,Guadalupe.Okuneva@hotmail.com,35197 Kreiger Centers,Oliver
1df0a011-d699-2048-7544-22473b8995aa,04/02/2023 08:49:50,Owen,Schuster,Rene30@hotmail.com,1729 Mraz River,Owen
dc1fb2ac-0afd-4598-0627-3b1e429fcd62,07/09/2023 22:02:39,Johnny,Mante,Benjamin.Gibson@hotmail.com,2186 Ryder Harbor,Johnny
02746522-ed29-4a58-8241-fe1d26353c95,06/02/2023 02:52:09,Abraham,Windler,Marianna86@gmail.com,251 Ryan Wells,Abraham
66b84ede-f0a2-ec9c-04df-e1dbccda7140,03/27/2023 01:31:59,Antonia,Hills,Kathryne38@gmail.com,7066 Amalia Pike,Antonia
a0759ac0-da4d-a14c-9751-e888489e0892,07/26/2023 22:50:31,Steven,Glover,Loma.Cronin@yahoo.com,210 Zboncak Burgs,Steven
63db861c-4abf-6cd2-8b7b-2d1f87026e0f,01/12/2023 16:15:57,Seth,Keebler,Eden_Kemmer@hotmail.com,806 Keeling Inlet,Seth
765945a4-009c-a24a-0ca2-533d003e4d28,07/02/2023 17:04:16,Lori,Boyle,Douglas.Mayert@yahoo.com,15810 Edna Groves,Lori
cb4f4687-3a6a-f5e9-4c92-a733feb4b4e0,05/14/2023 22:59:31,Natalie,Cummerata,Joannie.Schiller63@gmail.com,05126 Bailey Loaf,Natalie
8ce7f635-8168-ce43-33eb-bf81e0a779de,04/01/2023 09:34:50,Terrence,Lubowitz,Sallie.Maggio@gmail.com,357 Kris Gateway,Terrence
14 changes: 6 additions & 8 deletions examples/DancingGoat/Components/Sections/ZoneRestrictions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.Linq;

using Kentico.PageBuilder.Web.Mvc;


using DancingGoat.Widgets;

using Kentico.Builder.Web.Mvc;

using WidgetDefinition = Kentico.PageBuilder.Web.Mvc.WidgetDefinition;

namespace DancingGoat.Sections
{
/// <summary>
Expand Down Expand Up @@ -51,11 +52,8 @@ public static IEnumerable<string> GetWideZoneRestrictions()
}


private static IEnumerable<string> GetWidgetsIdentifiers()
{
return new ComponentDefinitionProvider<WidgetDefinition>()
private static IEnumerable<string> GetWidgetsIdentifiers() => new ComponentDefinitionProvider<WidgetDefinition>()
.GetAll()
.Select(definition => definition.Identifier);
}
}
}
4 changes: 2 additions & 2 deletions examples/DancingGoat/DancingGoat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<PropertyGroup Condition="'$(SeparatedAdmin)' == 'true'">
<DefineConstants>$(DefineConstants);SEPARATED_ADMIN</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Kentico.Xperience.Contacts.Importer\Kentico.Xperience.Contacts.Importer.csproj" />
<ItemGroup>
<ProjectReference Include="..\..\src\Kentico.Xperience.Contacts.Importer\Kentico.Xperience.Contacts.Importer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="kentico.xperience.admin" Condition="'$(SeparatedAdmin)' == 'false'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ internal void RegisterSamples()
accountContactInfoProvider, accountInfoProvider, bizFormInfoProvider));
PersonalDataCollectorRegister.Instance.Add(new SampleMemberDataCollector());

PersonalDataEraserRegister.Instance.Add(new SampleContactPersonalDataEraser(consentAgreementInfoProvider, bizFormInfoProvider, accountContactInfoProvider, contactInfoProvider));
PersonalDataEraserRegister.Instance.Add(new SampleContactPersonalDataEraser(consentAgreementInfoProvider, bizFormInfoProvider, accountContactInfoProvider, contactInfoProvider, activityInfoProvider));
PersonalDataEraserRegister.Instance.Add(new SampleMemberPersonalDataEraser(memberInfoProvider));

RegisterConsentRevokeHandler();
Expand All @@ -121,7 +121,7 @@ internal void DeleteContactActivities(ContactInfo contact)
{ "deleteActivities", true }
};

new SampleContactPersonalDataEraser(consentAgreementInfoProvider, bizFormInfoProvider, accountContactInfoProvider, contactInfoProvider)
new SampleContactPersonalDataEraser(consentAgreementInfoProvider, bizFormInfoProvider, accountContactInfoProvider, contactInfoProvider, activityInfoProvider)
.Erase(new[] { contact }, configuration);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<ContactInfo> contactInfoProvider;
private readonly IInfoProvider<ActivityInfo> activityInfoProvider;


/// <summary>
Expand All @@ -48,16 +49,19 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
/// <param name="bizFormInfoProvider">BizForm info provider.</param>
/// <param name="accountContactInfoProvider">Account contact info provider.</param>
/// <param name="contactInfoProvider">Contact info provider.</param>
/// <param name="activityInfoProvider">Activity info provider.</param>
public SampleContactPersonalDataEraser(
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider,
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<ContactInfo> contactInfoProvider)
IInfoProvider<ContactInfo> contactInfoProvider,
IInfoProvider<ActivityInfo> activityInfoProvider)
{
this.consentAgreementInfoProvider = consentAgreementInfoProvider;
this.bizFormInfoProvider = bizFormInfoProvider;
this.accountContactInfoProvider = accountContactInfoProvider;
this.contactInfoProvider = contactInfoProvider;
this.activityInfoProvider = activityInfoProvider;
}


Expand Down Expand Up @@ -119,7 +123,7 @@ private void DeleteSubmittedFormsActivities(ICollection<int> contactIds, IDictio
if (configuration.TryGetValue("DeleteSubmittedFormsActivities", out object deleteSubmittedFormsActivities)
&& ValidationHelper.GetBoolean(deleteSubmittedFormsActivities, false))
{
ActivityInfoProvider.ProviderObject.BulkDelete(new WhereCondition().WhereEquals("ActivityType", PredefinedActivityType.BIZFORM_SUBMIT)
activityInfoProvider.BulkDelete(new WhereCondition().WhereEquals("ActivityType", PredefinedActivityType.BIZFORM_SUBMIT)
.WhereIn("ActivityContactID", contactIds));
}
}
Expand Down Expand Up @@ -173,7 +177,7 @@ private void DeleteActivities(List<int> contactIds, IDictionary<string, object>
if (configuration.TryGetValue("deleteActivities", out object deleteActivities)
&& ValidationHelper.GetBoolean(deleteActivities, false))
{
ActivityInfoProvider.ProviderObject.BulkDelete(new WhereCondition().WhereIn("ActivityContactID", contactIds));
activityInfoProvider.BulkDelete(new WhereCondition().WhereIn("ActivityContactID", contactIds));
}
}

Expand Down
10 changes: 5 additions & 5 deletions examples/DancingGoat/Helpers/AreaRestrictionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
using System.Collections.Generic;
using System.Linq;

using Kentico.PageBuilder.Web.Mvc;
using Kentico.Builder.Web.Mvc;

using WidgetDefinition = Kentico.PageBuilder.Web.Mvc.WidgetDefinition;


namespace DancingGoat.Helpers
{
Expand All @@ -24,11 +27,8 @@ public static string[] GetLandingPageRestrictions()
}


private static IEnumerable<string> GetWidgetsIdentifiers()
{
return new ComponentDefinitionProvider<WidgetDefinition>()
private static IEnumerable<string> GetWidgetsIdentifiers() => new ComponentDefinitionProvider<WidgetDefinition>()
.GetAll()
.Select(definition => definition.Identifier);
}
}
}
1 change: 1 addition & 0 deletions examples/DancingGoat/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

app.UseAuthentication();

app.UseContactsImport();

app.UseKentico();

Expand Down
24 changes: 11 additions & 13 deletions examples/DancingGoat/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4095",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"DancingGoat": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:4095",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "http://localhost:4095"
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4095",
"sslPort": 0
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void AddDancingGoatServices(this IServiceCollection services)
{
AddViewComponentServices(services);
AddRepositories(services);
services.AddContactsImport();

services.AddSingleton<ICurrentWebsiteChannelPrimaryLanguageRetriever, CurrentWebsiteChannelPrimaryLanguageRetriever>();
}
Expand Down
38 changes: 19 additions & 19 deletions examples/DancingGoat/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"KenticoEventLog": {
"LogLevel": {
"Default": "Error",
"Microsoft.AspNetCore.Server.Kestrel": "None"
}
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"CMSConnectionString": ""
},
"CMSHashStringSalt": "88e46b3a-fe6e-472c-b265-e0bc8419c68e"
}
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"KenticoEventLog": {
"LogLevel": {
"Default": "Error",
"Microsoft.AspNetCore.Server.Kestrel": "None"
}
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"CMSConnectionString": ""
},
"CMSHashStringSalt": "88e46b3a-fe6e-472c-b265-e0bc8419c68e"
}
Loading