コード例 #1
0
ファイル: DataContextTest.cs プロジェクト: SKDon/Triphulcas
        public void DataContextTest_EnsureSchemaValidation()
        {
            var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"), true);

            MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);

            var hp = ctx.CWSHomes.First();

            Assert.IsNotNull(hp);
        }
コード例 #2
0
        public void DataContextTest_EnsureSchemaValidation()
        {
            var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"), true);

            MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);

            var hp = ctx.CWSHomes.First();

            Assert.IsNotNull(hp);
        }
コード例 #3
0
        private XslPreprocessManager GetManager(
            NodeDataProvider dataProvider,
            GraphicsInfo graphicsInfo
            )
        {
            XslPreprocessManager result = new XslPreprocessManager(this._model.DbFs);

            result.AvailablePreprocessors.Add(new GraphPreprocessor(dataProvider, graphicsInfo));
            result.AvailablePreprocessors.Add(new GraphPreprocessorDialog(dataProvider, graphicsInfo));
            result.AvailablePreprocessors.Add(new DataGridPreprocessorDialog(dataProvider, graphicsInfo));
            result.AvailablePreprocessors.Add(new HtmlPreprocessorDialog(dataProvider, graphicsInfo, result));
            // result.AvailablePreprocessors.Add(new RDLPreprocessorDialog(dataProvider, graphicsInfo));

            return(result);
        }
コード例 #4
0
ファイル: DataContextTest.cs プロジェクト: elrute/Triphulcas
 public void DataContextTest_ConstructFromExistingProvider()
 {
     var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));
     
     MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
 }
コード例 #5
0
ファイル: DataContextTest.cs プロジェクト: elrute/Triphulcas
 public void DataContextTest_FileMustExist()
 {
     var nodeProvider = new NodeDataProvider(@"C:\fakeFile.config");
 }
コード例 #6
0
ファイル: DataContextTest.cs プロジェクト: elrute/Triphulcas
 public void DataContextTest_FileNameRequired()
 {
     var nodeProvider = new NodeDataProvider(string.Empty);
 }
コード例 #7
0
ファイル: DataContextTest.cs プロジェクト: SKDon/Triphulcas
        public void DataContextTest_ConstructFromExistingProvider()
        {
            var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));

            MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
        }
コード例 #8
0
ファイル: DataContextTest.cs プロジェクト: SKDon/Triphulcas
 public void DataContextTest_FileMustExist()
 {
     var nodeProvider = new NodeDataProvider(@"C:\fakeFile.config");
 }
コード例 #9
0
ファイル: DataContextTest.cs プロジェクト: SKDon/Triphulcas
 public void DataContextTest_FileNameRequired()
 {
     var nodeProvider = new NodeDataProvider(string.Empty);
 }
コード例 #10
0
        public void onQueryResult(Task <NodeDataProvider> task)
        {
            if (this._EmailNotificationSettings == null)
            {
                log.ErrorFormat("job:'{0}'; EmailNotificationSettings node of UserSettings.xml is absent or empty", this._job);
                return;
            }

            NodeDataProvider dataProvider  = task.Result;
            Size             clientSize    = this._EmailNotificationSettings.chartSettings.ClientSize;
            float            floatOut      = 0.0F;
            float            dpiResolution = 92.0F;             //default value

            if (!string.IsNullOrEmpty(this._EmailNotificationSettings.chartSettings.ImageResolution))
            {
                if (float.TryParse(this._EmailNotificationSettings.chartSettings.ImageResolution, out floatOut))
                {
                    dpiResolution = floatOut;
                }
            }

            GraphicsInfo graphicsInfo = new GraphicsInfo(clientSize, dpiResolution);

            VisualizeData result = this._visualizeProcessor.GetVisualizeData(
                dataProvider,
                graphicsInfo
                );

            this._message = new MailMessage();

            if (result.PreprocessorAreas != null)
            {
                foreach (PreprocessorAreaData paData in result.PreprocessorAreas)
                {
                    foreach (PreprocessorData pData in paData.Preprocessors)
                    {
                        IContentFactory factory = pData.ContentFactory;

                        if (factory.CanCreateMailContent)
                        {
                            try
                            {
                                MailContent mailContent = factory.CreateMailContent();

                                this._messageHtml = mailContent.Message;

                                if (mailContent.Resource != null)
                                {
                                    this._linkedResources.Add(mailContent.Resource);
                                }
                            }
                            catch (Exception ex)
                            {
                                log.ErrorFormat("job:'{0}';Exception:'{1}'", this._job, ex);
                                return;
                            }
                        }
                    }
                }
            }

            this.sendMessage();
        }
コード例 #11
0
        public VisualizeData GetVisualizeData(
            NodeDataProvider dataProvider,
            GraphicsInfo graphicsInfo
            )
        {
            XmlDocument          xmlData       = dataProvider.XmlDocument;
            MultyQueryResultInfo queriesResult = dataProvider.QueryResult;

            VisualizeData result = new VisualizeData
            {
                NodeLastUpdated        = queriesResult.NodeLastUpdated,
                NodeLastUpdateDuration = queriesResult.NodeLastUpdateDuration
            };

            if (xmlData != null && xmlData.DocumentElement != null)
            {
                result.SourceXml = xmlData.FormatXml();
            }

            ConcreteTemplateNodeDefinition nodeDefinition = dataProvider.NodeDefinition;

            string xslFileName = GetXslFileName(nodeDefinition);

            if (xslFileName != null && File.Exists(xslFileName))
            {
                XmlDocument xslDoc = new XmlDocument();

                xslDoc.Load(xslFileName);

                ConnectionGroupInfo connectionGroup = nodeDefinition.Connection;

                if (AppVersionHelper.IsNotDebug() && !connectionGroup.IsExternal)
                {
                    CryptoProcessor cryptoProcessor = new CryptoProcessor(
                        this._model.Settings.SystemSettings.PublicKeyXmlSign,
                        this._model.Settings.SystemSettings.PrivateKeyXmlDecrypt
                        );

                    cryptoProcessor.DecryptXmlDocument(xslDoc);
                }

                try
                {
                    XslPreprocessManager preprocessManager = GetManager(
                        dataProvider,
                        graphicsInfo
                        );

                    List <PreprocessorAreaData> datas;

                    using (preprocessManager.ExecuteXslPreprocessing(xslDoc, out datas))
                    {
                    }

                    foreach (PreprocessorAreaData preprocessorAreaData in datas)
                    {
                        preprocessorAreaData.CheckPreprocessors();
                    }

                    result.PreprocessorAreas = datas.ToList();
                }
                catch (Exception ex)
                {
                    log.ErrorFormat(
                        "nodeDefinition.TemplateNode.Queries(.Name)='{0}';xslFileName='{1}';Exception:'{2}'",
                        nodeDefinition.TemplateNode.Queries.Select(q => q.QueryName).Join(", "),
                        xslFileName,
                        ex
                        );
                }
            }

            return(result);
        }