private void ImportSubStorages(Database db)
        {
            if (0 < this.Data.SubStorages.Count)
            {
                using (var storagesView = new View(db, "SELECT `Name`, `Data` FROM `_Storages`"))
                {
                    foreach (var subStorage in this.Data.SubStorages)
                    {
                        var transformFile = Path.Combine(this.IntermediateFolder, String.Concat(subStorage.Name, ".mst"));

                        // Bind the transform.
                        var command = new BindTransformCommand(this.Messaging, this.BackendHelper, this.FileSystemManager, this.IntermediateFolder, subStorage.Data, transformFile, this.TableDefinitions);
                        command.Execute();

                        if (this.Messaging.EncounteredError)
                        {
                            continue;
                        }

                        // Add the storage to the database.
                        using (var record = new Record(2))
                        {
                            record.SetString(1, subStorage.Name);
                            record.SetStream(2, transformFile);
                            storagesView.Modify(ModifyView.Assign, record);
                        }
                    }
                }
            }
        }
Example #2
0
        private void BindTransform(Output transform, string outputPath)
        {
            var command = new BindTransformCommand();

            command.Messaging         = this.Messaging;
            command.Extensions        = this.Extensions;
            command.TempFilesLocation = this.IntermediateFolder;
            command.Transform         = transform;
            command.OutputPath        = outputPath;
            command.TableDefinitions  = this.TableDefinitions;
            command.Execute();
        }