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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.6.2</Version>
<Version>10.6.3</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<Title>Excel Provider</Title>
<Description>Excel Provider</Description>
Expand Down
19 changes: 7 additions & 12 deletions src/ExcelProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dynamicweb.Core;
using Dynamicweb.Core.Helpers;
using Dynamicweb.DataIntegration.Integration;
using Dynamicweb.DataIntegration.Integration.Interfaces;
using Dynamicweb.Extensibility.AddIns;
Expand Down Expand Up @@ -57,22 +58,16 @@ public override Schema GetOriginalDestinationSchema()

public override Schema GetOriginalSourceSchema()
{
Schema result = new Schema();

string currentPath = SourceFile;
if (!string.IsNullOrEmpty(workingDirectory))
{
currentPath = workingDirectory.CombinePaths(SourceFile);
}
Schema result = new Schema();

var sourceFilePath = GetSourceFilePath();
if (File.Exists(sourceFilePath))
{
try
{
if (currentPath.EndsWith(".xls", StringComparison.OrdinalIgnoreCase) ||
currentPath.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase) ||
currentPath.EndsWith(".xlsm", StringComparison.OrdinalIgnoreCase))
if (SourceFile.EndsWith(".xls", StringComparison.OrdinalIgnoreCase) ||
SourceFile.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase) ||
SourceFile.EndsWith(".xlsm", StringComparison.OrdinalIgnoreCase))
{
Dictionary<string, ExcelReader> excelReaders = new Dictionary<string, ExcelReader>
{
Expand Down Expand Up @@ -116,11 +111,11 @@ private string GetSourceFilePath()
{
if (SourceFile.StartsWith(".."))
{
srcFilePath = (this.WorkingDirectory.CombinePaths(SourceFile.TrimStart(new char[] { '.' })).Replace("\\", "/"));
srcFilePath = WorkingDirectory.CombinePaths(SourceFile.TrimStart(new char[] { '.' })).Replace("\\", "/");
}
else
{
srcFilePath = this.WorkingDirectory.CombinePaths(FilesFolderName, SourceFile).Replace("\\", "/");
srcFilePath = SystemInformation.MapPath(FilePathHelper.GetRelativePath(SourceFile, "/Files"));
}
}
return srcFilePath;
Expand Down