Пример #1
0
        protected override void PopulatePluginTypesLists(object[] attributeList, Type type)
        {
            // REVIEW: Taking first friendly name only if multiple friendly name attributes were specified on the phase.  Is this OK or should I raise and error/warning?
            if (attributeList != null && attributeList.Length > 0)
            {
                if (attributeList.Length > MaxAttributeCount || attributeList.Length < MinAttributeCount)
                {
                    MessageEngine.Trace(Severity.Warning, Resources.WarningMultiplePhaseFriendlyNames, type.AssemblyQualifiedName);
                }

                foreach (TPluginAttribute attribute in attributeList)
                {
                    string attributeString = attribute.ToString();

                    if (PluginTypesByAttribute.ContainsKey(attribute))
                    {
                        MessageEngine.Trace(Severity.Error, Resources.ErrorDuplicatePhaseFriendlyNameFound, attributeString);
                    }

                    PluginTypesByAttribute.Add(attribute, type);

                    if (PluginTypesByAttributeString.ContainsKey(attributeString))
                    {
                        //// Notice that this check is not a strict duplicate of the one above, since the string conversion could create dupes depending on attribute
                        MessageEngine.Trace(Severity.Error, Resources.ErrorDuplicatePhaseFriendlyNameFound, attributeString);
                    }

                    PluginTypesByAttributeString.Add(attributeString, type);
                }
            }
        }
Пример #2
0
 public SSIS2008EmitterPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     _guid = Guid.NewGuid();
     _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString()));
     _pluginLoader = new PluginLoader<ISSISEmitter, PhysicalIRMappingAttribute>(null, 1, 1);
 }
Пример #3
0
        public PhaseWorkflow(string Name)
        {
            this._Name = Name;
            this._PhaseWorkflow = new List<PhaseExecutionHost>();
            this._PhaseExecutionHostsByWorkflowUniqueName = new Dictionary<string, PhaseExecutionHost>();
            this._PhaseExecutionStatusByWorkflowUniqueName = new Dictionary<string, bool>();

            this.Message = MessageEngine.Create(String.Format("__PHASE WORKFLOW: {0}", Name));
        }
Пример #4
0
        public SsisPipelineTask(PipelineTask objETL, SSISEmitterContext context)
            : base(objETL, context)
        {
            _logicalETL = objETL;

            _guid = Guid.NewGuid();
            // TODO: Do this for everything
            _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "__SSIS2008Emitter:SSISDataFlow {0}", _guid.ToString()));
            _componentList = new List<SsisComponent>();
        }
Пример #5
0
        public static MessageEngine Create(string Name)
        {
            if (_MessageEnginesByName.ContainsKey(Name))
            {
                _GlobalMessageEngine.Trace(Severity.Error, Resources.ErrorMessageEngineNameDuplicate, Name);
            }
            MessageEngine CreatedMessageEngine = new MessageEngine(Name);
            _MessageEnginesByName.Add(Name, CreatedMessageEngine);

            return CreatedMessageEngine;
        }
Пример #6
0
        public static MessageEngine Create(string Name)
        {
            if (_MessageEnginesByName.ContainsKey(Name))
            {
                _GlobalMessageEngine.Trace(Severity.Error, Resources.ErrorMessageEngineNameDuplicate, Name);
            }
            MessageEngine CreatedMessageEngine = new MessageEngine(Name);

            _MessageEnginesByName.Add(Name, CreatedMessageEngine);

            return(CreatedMessageEngine);
        }
Пример #7
0
 internal SSISEmitterContext(SsisPackage package, SsisSequence parentSequence, PluginLoader<ISSISEmitter, PhysicalIRMappingAttribute> pluginLoader)
 {
     _package = package;
     _ssisSequence = parentSequence;
     _guid = Guid.NewGuid();
     _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString()));
     if (_ssisSequence != null)
     {
         _parentContainer = _ssisSequence.DTSSequence;
     }
     _pluginLoader = pluginLoader;
 }
Пример #8
0
        public static IIR MergeIRList(string callerPhaseName, Collection <IIR> list)
        {
            if (list.Count == 0)
            {
                MessageEngine.Trace(Severity.Error, Resources.ErrorPhaseInputIRListEmpty, callerPhaseName);
                return(null);
            }

            if (list.Count > 1)
            {
                MessageEngine.Trace(Severity.Error, Resources.ErrorIRMergingNotYetSupported, callerPhaseName);
                return(null);
            }

            return(list[0]);
        }
Пример #9
0
        public PluginLoader(string pluginSubPath, int MinAttributeCount, int MaxAttributeCount)
        {
            this._pluginTypesByAttribute       = new Dictionary <PluginAttributeType, Type>();
            this._pluginTypesByAttributeString = new Dictionary <string, Type>();
            this._pluginTypesByFullName        = new Dictionary <string, Type>();

            this._minAttributeCount = MinAttributeCount;
            this._maxAttributeCount = MaxAttributeCount;

            this._message = MessageEngine.Global;

            if (pluginSubPath != null)
            {
                this._pluginFolder = PathManager.GetToolSubpath(pluginSubPath);
            }

            LoadPlugins(Assembly.GetCallingAssembly());
        }
Пример #10
0
 protected XmlIR(XmlIR xmlIR)
 {
     this._isValidated = xmlIR._isValidated;
     this._documents = xmlIR._documents;
     this._xmlSchemaSet = xmlIR._xmlSchemaSet;
     this._id = xmlIR._id;
     this._message = xmlIR._message;
     this._documentsLoaded = xmlIR._documentsLoaded;
 }
Пример #11
0
 public PhasePluginLoader()
 {
     this._PluginLoader = new PluginLoader<IPhase, PhaseFriendlyNameAttribute>(Settings.Default.SubpathPhasePluginFolder, 0, 1);
     this._Message = MessageEngine.Create("__PHASE PLUGIN LOADER");
 }
Пример #12
0
        public PhaseExecutionHost(string WorkflowUniqueName, IPhase HostedPhase)
        {
            this._WorkflowUniqueName = WorkflowUniqueName;
            this._HostedPhase = HostedPhase;
            this._Predecessors = new List<PhaseExecutionHost>();
            this._Successors = new List<PhaseExecutionHost>();
            this._PredecessorIRs = new Dictionary<PhaseExecutionHost, IIR>();

            this.ExecutionStarted = false;
            this.ExecutionComplete = false;

            this.Message = MessageEngine.Create(String.Format("__PHASE EXECUTION HOST: {0}", WorkflowUniqueName));
        }
Пример #13
0
 public XmlSchemaValidatorPhase(string WorkflowUniqueName)
 {
     this._WorkflowUniqueName = WorkflowUniqueName;
     this.Message = MessageEngine.Create(WorkflowUniqueName);
 }
Пример #14
0
 public AdvancedFeaturesPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     this._message = MessageEngine.Create(WorkflowUniqueName);
 }
Пример #15
0
 static MessageEngine()
 {
     _MessageEnginesByName = new Dictionary<string, MessageEngine>();
     _GlobalMessageEngine = new MessageEngine("__GLOBAL");
     _MessageEnginesByName.Add("__GLOBAL", _GlobalMessageEngine);
 }
Пример #16
0
        public XmlIR()
        {
            // TODO: Cleanup up schema handling - put it all in a configured location
            _xmlSchemaSet = new XmlSchemaSet();
            _xmlSchemaSet.Add(null, PathManager.GetToolSubpath("xsd\\vulcan2.xsd"));

            this._documents = new Dictionary<XmlIRDocumentType, List<XDocument>>();
            this._documentsLoaded = new HashSet<string>();

            foreach (XmlIRDocumentType docType in Enum.GetValues(typeof(XmlIRDocumentType)))
            {
                this._documents.Add(docType, new List<XDocument>());
            }

            this._id = Guid.NewGuid();
            this._isValidated = false;
            this._message = MessageEngine.Create(String.Format("__XmlIR: {0}", this._id));
        }
Пример #17
0
 static MessageEngine()
 {
     _MessageEnginesByName = new Dictionary <string, MessageEngine>();
     _GlobalMessageEngine  = new MessageEngine("__GLOBAL");
     _MessageEnginesByName.Add("__GLOBAL", _GlobalMessageEngine);
 }
Пример #18
0
 public XmlXsltTransformPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     this._message = MessageEngine.Create(this.WorkflowUniqueName);
 }
Пример #19
0
        public static int Main(string[] args)
        {
            int errorCount = 0;

            MessageEngine.Trace(Severity.Notification, Resources.VulcanStart, Assembly.GetAssembly(typeof(XmlIR)).GetName().Version);
            try
            {
                var           workflowLoader = new PhaseWorkflowLoader();
                PhaseWorkflow workflow       = workflowLoader.PhaseWorkflowsByName[workflowLoader.DefaultWorkflowName];

                var cmdLineParser = new SimpleCommandLineParser("-/", args);

                if (args.Length == 0 || cmdLineParser["?"] != null)
                {
                    DisplayHelpMenu();
                    return(errorCount);
                }

                if (cmdLineParser["t"] != null && cmdLineParser["t"].Count > 0)
                {
                    PathManager.TargetPath = Path.GetFullPath(cmdLineParser["t"][0]); //// +Path.DirectorySeparatorChar;
                }
                else
                {
                    PathManager.TargetPath = Path.GetFullPath(".");
                }

                var xmlIR = new XmlIR();

                foreach (string filename in cmdLineParser.NoSwitchArguments)
                {
                    if (File.Exists(filename))
                    {
                        xmlIR.AddXml(Path.GetFullPath(filename), XmlIRDocumentType.Source, true);
                    }
                    else
                    {
                        MessageEngine.Trace(Severity.Error, new FileNotFoundException("Vulcan File Not Found", filename), Resources.VulcanFileNotFound, filename);
                    }
                }

                IList <string> includedFiles = cmdLineParser["i"];

                if (includedFiles != null)
                {
                    foreach (string filename in includedFiles)
                    {
                        if (File.Exists(filename))
                        {
                            xmlIR.AddXml(Path.GetFullPath(filename), XmlIRDocumentType.Include, true);
                        }
                    }
                }

                workflow.ExecutePhaseWorkflowGraph(xmlIR);
            }
            catch (Exception ex)
            {
                MessageEngine.Trace(Severity.Error, ex, "One or more fatal errors were encountered!");
            }

            errorCount = (MessageEngine.ErrorCount + MessageEngine.WarningCount) * -1;
            return(errorCount);
        } // end main
Пример #20
0
        public static int Main(string[] args)
        {
            int errorCount = 0;

            MessageEngine Message = MessageEngine.Create("__VULCAN MAIN");

            Message.Trace(Severity.Notification, Resources.VulcanStart + Assembly.GetAssembly(typeof(XmlIR)).GetName().Version);

#if DEBUG
            Message.Trace(Severity.Notification, "DEBUG VERSION");
#endif

            // TODO: Can we set permissions so that only PhaseworkflowLoader can see the workflow editing methods?  (Vsabella: yes you can if you make it its own dll and mark the classes internal)
            PhaseWorkflowLoader WorkflowLoader = new PhaseWorkflowLoader();
            PhaseWorkflow       Workflow       = WorkflowLoader.PhaseWorkflowsByName[WorkflowLoader.DefaultWorkflowName];

            SimpleCommandLineParser cmdLineParser = new SimpleCommandLineParser("-/", args);

            if (args.Length == 0 || cmdLineParser["?"] != null)
            {
                DisplayHelpMenu();
                return(errorCount);
            }

            if (cmdLineParser["t"] != null && cmdLineParser["t"].Count > 0)
            {
                PathManager.TargetPath = Path.GetFullPath(cmdLineParser["t"][0]);// +Path.DirectorySeparatorChar;
            }
            else
            {
                PathManager.TargetPath = Path.GetFullPath(".");
            }

            XmlIR xmlIR = new XmlIR();

            if (cmdLineParser["r"] != null && cmdLineParser["r"].Count > 0)
            {
                string[] rootPath = cmdLineParser["r"][0].Split(new char[] { '=' });

                if (rootPath != null && rootPath.Length == 2 && Directory.Exists(rootPath[1]))
                {
                    xmlIR.SetDocumentRoot(rootPath[0].ToUpperInvariant(), Path.GetFullPath(rootPath[1]));
                }
            }

            foreach (string filename in cmdLineParser.NoSwitchArguments)
            {
                if (File.Exists(filename))
                {
                    VulcanEngine.IR.XmlIRDocumentType docType = XmlIRDocumentType.SOURCE;
                    xmlIR.AddXml(Path.GetFullPath(filename), docType);
                }
                else
                {
                    Message.Trace(Severity.Error, new FileNotFoundException("Vulcan File Not Found", filename), Resources.VulcanFileNotFound, filename);
                }
            }

            IList <string> includedFiles = cmdLineParser["i"];

            if (includedFiles != null)
            {
                foreach (string filename in includedFiles)
                {
                    if (File.Exists(filename))
                    {
                        VulcanEngine.IR.XmlIRDocumentType docType = XmlIRDocumentType.INCLUDE;
                        xmlIR.AddXml(Path.GetFullPath(filename), docType);
                    }
                }
            }

            Workflow.ExecutePhaseWorkflowGraph(xmlIR);
            errorCount = (MessageEngine.AllEnginesErrorCount + MessageEngine.AllEnginesWarningCount) * -1;
            return(errorCount);
        }// end main