Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ExtractionSubdirectoryPattern #614

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
Expand Up @@ -57,7 +57,7 @@ protected override void PreInitializeImpl(IExtractCommand request, IDataLoadEven
switch (FlatFileType)
{
case ExecuteExtractionToFlatFileType.CSV:
OutputFile = Path.Combine(DirectoryPopulated.FullName, GetFilename() + ".csv");
OutputFile = Path.Combine(GetDirectoryFor(_request).FullName, GetFilename() + ".csv");
if (request.Configuration != null)
_output = new CSVOutputFormat(OutputFile, request.Configuration.Separator, DateFormat);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,13 @@ public interface IExecuteDatasetExtractionDestination : IPluginDataFlowComponent
/// <param name="globalToCheck"></param>
/// <returns></returns>
GlobalReleasePotential GetGlobalReleasabilityEvaluator(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ISupplementalExtractionResults globalResult, IMapsDirectlyToDatabaseTable globalToCheck);


/// <summary>
/// Returns where the output files will be generated including any pipeline level changes (i.e. overrides).
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DirectoryInfo GetDirectoryFor(IExtractCommand request);
}
}
7 changes: 3 additions & 4 deletions Rdmp.Core/Reports/ExtractionTime/WordDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public WordDataWriter(ExtractionPipelineUseCase executer)
Executer = executer;

_destination = Executer.Destination;

if(_destination == null)
throw new NotSupportedException(GetType().FullName + " only supports destinations which are " + typeof(ExecuteDatasetExtractionFlatFileDestination).FullName);
}

private static object oLockOnWordUsage = new object();
Expand All @@ -60,7 +57,9 @@ public void GenerateWordFile()
{
lock (oLockOnWordUsage)
{
using (var document = GetNewDocFile(new FileInfo(Path.Combine(_destination.DirectoryPopulated.FullName, _destination.GetFilename() + ".docx"))))
var destDir = _destination.GetDirectoryFor(Executer.ExtractCommand);

using (var document = GetNewDocFile(new FileInfo(Path.Combine(destDir.FullName, _destination.GetFilename() + ".docx"))))
{
InsertHeader(document,Executer.Source.Request.DatasetBundle.DataSet + " Meta Data");

Expand Down