public PrepareForTransformationConsumer(IAssetManager assetManager, IScanProcessor scanProcessor, ITransformEngine transformEngine, IAssetPreparationEngine assetPreparationEngine)
 {
     this.assetManager           = assetManager;
     this.scanProcessor          = scanProcessor;
     this.transformEngine        = transformEngine;
     this.assetPreparationEngine = assetPreparationEngine;
     preparationSteps            = new List <Func <PrepareForTransformationMessage, Task <PreprocessingResult> > >();
 }
        private static void ConvertAreldaMetadataXml(string tempFolder, ITransformEngine transformEngine)
        {
            Log.Information("Converting arelda metadata.xml file...");

            var metadataFile       = Path.Combine(tempFolder, "header", "metadata.xml");
            var transformationFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Html", "Xslt", "areldaConvert.xsl");

            // IF one of the files does not exist, log warning and create an "error" index.html file.
            if (!File.Exists(transformationFile) || !File.Exists(metadataFile))
            {
                throw new Exception(
                          $"Could not find the transformation file or the source file to transform. Make sure the both file exists.\nTransformation file: {transformationFile}\nSource file: {metadataFile}");
            }

            var result = transformEngine.TransformXml(metadataFile, transformationFile, null);

            File.WriteAllText(metadataFile, result);
            Log.Information("Converted.");
        }
Exemplo n.º 3
0
        public AssetManager(ITextEngine textEngine, IRenderEngine renderEngine, ITransformEngine transformEngine, PasswordHelper passwordHelper,
                            IParameterHelper parameterHelper, IPdfManipulator pdfManipulator,
                            IPreparationTimeCalculator preparationCalculator, IPrimaerdatenAuftragAccess auftragAccess,
                            IRequestClient <FindArchiveRecordRequest> indexClient,
                            IPackagePriorizationEngine priorizationEngine, IBus bus)
        {
            this.textEngine            = textEngine;
            this.renderEngine          = renderEngine;
            this.transformEngine       = transformEngine;
            this.passwordHelper        = passwordHelper;
            this.parameterHelper       = parameterHelper;
            this.pdfManipulator        = pdfManipulator;
            this.preparationCalculator = preparationCalculator;
            this.auftragAccess         = auftragAccess;
            this.indexClient           = indexClient;
            this.priorizationEngine    = priorizationEngine;
            this.bus = bus;
            aufbereitungsZeitSettings = parameterHelper.GetSetting <SchaetzungAufbereitungszeitSettings>();
            // read and convert priorisierungs settings
            var settings = parameterHelper.GetSetting <AssetPriorisierungSettings>();

            packageSizeDefinition = JsonConvert.DeserializeObject <AssetPackageSizeDefinition>(settings.PackageSizes);
        }