public override IDatabaseWriter GetWriter(string file, IDatabaseSource src)
        {
            var res = new DataArchiveWriter();

            res.FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(file);
            return(res);
        }
Exemple #2
0
 public JobReportProcessorBase(JobReportConfigurationBase config, JobCommand command)
 {
     Config    = config;
     Command   = command;
     FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(config.FilePlace.GetVirtualFile());
     FilePlace.SetFileHolderInfo(Config);
 }
Exemple #3
0
        public virtual IJobReportConfiguration Clone()
        {
            var res = (JobReportConfigurationBase)MemberwiseClone();

            res.FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(FilePlace.GetVirtualFile());
            return(res);
        }
        public override IDatabaseWriter GetWriter(string file, IDatabaseSource src)
        {
            var res = new SqlDatabaseWriter();

            res.UsedDialect = src.Dialect;
            res.FilePlace   = FilePlaceAddonType.PlaceFromVirtualFile(file);
            return(res);
        }
            public override void RunCommand()
            {
                if (Format == null)
                {
                    if (Outfile.EndsWith(".dbk"))
                    {
                        Format = "dbk";
                    }
                    else if (Outfile.EndsWith(".ddf"))
                    {
                        Format = "ddf";
                    }
                    else
                    {
                        throw new CommandLineError("DAE-00151 Unknown output format, cannot be deduced from file extension");
                    }
                }
                IDatabaseSource db = m_connection.GetConnection();

                Async.SafeOpen(db.Connection);
                try
                {
                    switch (Format)
                    {
                    case "ddf":
                    {
                        var s = new DatabaseStructure(db.InvokeLoadStructure(DatabaseStructureMembers.FullStructure, null));
                        s.Save(Outfile);
                    }
                    break;

                    case "dbk":
                    {
                        DataArchiveWriter dw = new DataArchiveWriter();
                        dw.FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(Outfile);
                        CopyDbJob.CopyDatabase(db, dw, null, new DatabaseCopyOptions {
                                CopyMembers = DatabaseStructureMembers.FullStructure
                            });
                        Async.SafeClose(db.Connection);
                    }
                    break;

                    default:
                        throw new CommandLineError("DAE-00152 Unknown format:" + Format);
                    }
                }
                finally
                {
                    Async.SafeClose(db.Connection);
                }
            }
Exemple #6
0
        public void DragDrop_CreateDataArchive(AppObject appobj)
        {
            var dobj = appobj as DatabaseAppObject;

            if (dobj == null)
            {
                return;
            }
            string dbname = dobj.DatabaseName;
            string fn     = System.IO.Path.Combine(Folder.FolderDiskPath, (dbname ?? "") + ".dbk");

            CopyDbWizard.Run(dobj.FindDatabaseConnection(ConnPack).CloneSource(),
                             new DataArchiveWriter {
                FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(fn)
            }
                             );
        }