protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!Page.IsPostBack || EditorParts[0].Display)
            {
                SPSTreeXML treeXML = GetTreeXML();
                if (treeXML != null)
                {
                    try
                    {
                        treeXML.Fill(_treeView, _rollupEngine.Data.Tables[0].DefaultView);
                        treeXML.Decorate(_treeView);
                    }
                    catch (Exception ex)
                    {
                        TrapSubsystemError(this,
                                           new SPSErrorArgs("Render", SPSRollUpEngine.GetResourceString("SPS_Err_TreeDefinition"), ex));
                    }
                }
                else
                {
                    TrapSubsystemError(this,
                                       new SPSErrorArgs("Render", SPSRollUpEngine.GetResourceString("SPS_Err_EmptyTreeDefinition"), null));
                }
            }
        }
Esempio n. 2
0
        private void InitializeEngine()
        {
            Debug.WriteLine("InitializeEngine " + Title);

            _camlPreprocessor = new CamlPreprocessor(CamlQuery);

            _rollupEngine = new SPSRollUpEngine(
                _topSite,
                _lists,
                _fields,
                _maxRecords,
                _camlQueryRecursive,
                _includeListData,
                _dateTimeISO,
                _fixLookUp,
                GetCacheService());

            _rollupEngine.OnError += TrapSubsystemError;
        }
        /// <summary>
        /// Gets the calendar items.
        /// </summary>
        /// <returns>CalendarItemCollection</returns>
        private SPSTreeXML GetTreeXML()
        {
            XmlSerializer serializer = new XmlSerializer(typeof(SPSTreeXML));

            if (!string.IsNullOrEmpty(Xsl))
            {
                try
                {
                    TextReader reader     = new StringReader(Xsl);
                    SPSTreeXML collection = (SPSTreeXML)serializer.Deserialize(reader);
                    return(collection);
                }
                catch (InvalidOperationException ex)
                {
                    TrapSubsystemError(this, new SPSErrorArgs(ex.TargetSite.Name,
                                                              SPSRollUpEngine.GetResourceString("SPS_Err_InvalidXMLTree"),
                                                              ex));
                }
            }
            return(null);
        }
Esempio n. 4
0
        protected override void CreateChildControls()
        {
            _topSite      = new TextBox();
            _topSite.Text = string.Empty;
            _topSite.ID   = "c1";
            Controls.Add(_topSite);

            _lists      = new TextBox();
            _lists.Text = string.Empty;
            _lists.ID   = "c2";
            Controls.Add(_lists);

            _fields      = new TextBox();
            _fields.Text = string.Empty;
            _fields.ID   = "c3";
            Controls.Add(_fields);

            _camlQuery      = new TextBox();
            _camlQuery.Text = string.Empty;
            _camlQuery.ID   = "c4";
            Controls.Add(_camlQuery);

            _xsl      = new TextBox();
            _xsl.Text = string.Empty;
            _xsl.ID   = "c5";
            Controls.Add(_xsl);

            _maxResults      = new TextBox();
            _maxResults.Text = string.Empty;
            _maxResults.ID   = "c6";
            Controls.Add(_maxResults);

            _camlQueryRecursive         = new CheckBox();
            _camlQueryRecursive.Text    = SPSRollUpEngine.GetResourceString("SPSEP_CAMLQueryRecursive");
            _camlQueryRecursive.Checked = false;
            Controls.Add(_camlQueryRecursive);

            _includeListData         = new CheckBox();
            _includeListData.Text    = SPSRollUpEngine.GetResourceString("SPSEP_IncludeListData");
            _includeListData.Checked = false;
            Controls.Add(_includeListData);

            _dateTimeISO         = new CheckBox();
            _dateTimeISO.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DateTimeInISO");
            _dateTimeISO.Checked = false;
            Controls.Add(_dateTimeISO);

            _fixLookUp         = new CheckBox();
            _fixLookUp.Text    = SPSRollUpEngine.GetResourceString("SPSEP_LookUpFix");
            _fixLookUp.Checked = false;
            Controls.Add(_fixLookUp);

            _debugResults         = new CheckBox();
            _debugResults.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugXMLResults");
            _debugResults.Checked = false;
            Controls.Add(_debugResults);

            _debugResultsXML         = new CheckBox();
            _debugResultsXML.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugXMLCalendar");
            _debugResultsXML.Checked = false;
            Controls.Add(_debugResultsXML);

            _debugQuery         = new CheckBox();
            _debugQuery.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugCAMLQuery");
            _debugQuery.Checked = false;
            Controls.Add(_debugQuery);

            _debugEvaluator         = new CheckBox();
            _debugEvaluator.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugEvaluator");
            _debugEvaluator.Checked = false;
            Controls.Add(_debugEvaluator);

            _showExtendedErrors         = new CheckBox();
            _showExtendedErrors.Text    = SPSRollUpEngine.GetResourceString("SPSEP_ShowDeveloperErrors");
            _showExtendedErrors.Checked = false;
            Controls.Add(_showExtendedErrors);
        }
Esempio n. 5
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSEditorPartsTools partsTools = new SPSEditorPartsTools(writer);

            partsTools.DecorateControls(Controls);
            partsTools.SectionBeginTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_TopSite"));
            partsTools.CreateTextBoxAndBuilder(_topSite);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_Lists"));
            partsTools.CreateTextBoxAndBuilder(_lists);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_Fields"));
            partsTools.CreateTextBoxAndBuilder(_fields);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_CAMLQuery"));
            partsTools.CreateTextBoxAndBuilderXml(_camlQuery);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_XSL"));
            partsTools.CreateTextBoxAndBuilderXml(_xsl);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag(SPSRollUpEngine.GetResourceString("SPSEP_MaxResults"));
            partsTools.CreateTextBoxAndBuilderXml(_maxResults);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _camlQueryRecursive.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _includeListData.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _dateTimeISO.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _fixLookUp.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _debugResults.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _debugResultsXML.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _debugQuery.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _debugEvaluator.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionHeaderTag();
            _showExtendedErrors.RenderControl(writer);
            partsTools.SectionFooterTag();

            partsTools.SectionEndTag();
        }
Esempio n. 6
0
        protected override void CreateChildControls()
        {
            _topSite      = new TextBox();
            _topSite.Text = string.Empty;
            _topSite.ID   = "c1";
            Controls.Add(_topSite);

            _lists      = new TextBox();
            _lists.Text = string.Empty;
            _lists.ID   = "c2";
            Controls.Add(_lists);

            _fields      = new TextBox();
            _fields.Text = string.Empty;
            _fields.ID   = "c3";
            Controls.Add(_fields);

            _camlQuery      = new TextBox();
            _camlQuery.Text = string.Empty;
            _camlQuery.ID   = "c4";
            Controls.Add(_camlQuery);

            _xsl      = new TextBox();
            _xsl.Text = string.Empty;
            _xsl.ID   = "c5";
            Controls.Add(_xsl);

            _maxResults      = new TextBox();
            _maxResults.Text = string.Empty;
            _maxResults.ID   = "c5a";
            Controls.Add(_maxResults);

            _width      = new TextBox();
            _width.Text = string.Empty;
            _width.ID   = "c6";
            Controls.Add(_width);

            _height      = new TextBox();
            _height.Text = string.Empty;
            _height.ID   = "c7";
            Controls.Add(_height);

            _chartType = new DropDownList();
            _chartType.Items.Add("Line");
            _chartType.Items.Add("Bar2D");
            _chartType.Items.Add("Area2D");
            _chartType.Items.Add("Column2D");
            _chartType.Items.Add("Column3D");
            _chartType.Items.Add("Pie2D");
            _chartType.Items.Add("Pie3D");
            _chartType.Items.Add("MSColumn3D");
            _chartType.Items.Add("MSColumn3DLineDY");
            _chartType.Items.Add("StackedColumn3D");
            _chartType.ID = "c8";
            Controls.Add(_chartType);

            _camlQueryRecursive         = new CheckBox();
            _camlQueryRecursive.Text    = SPSRollUpEngine.GetResourceString("SPSEP_CAMLQueryRecursive");
            _camlQueryRecursive.Checked = false;
            Controls.Add(_camlQueryRecursive);

            _includeListData         = new CheckBox();
            _includeListData.Text    = SPSRollUpEngine.GetResourceString("SPSEP_IncludeListData");
            _includeListData.Checked = false;
            Controls.Add(_includeListData);

            _dateTimeISO         = new CheckBox();
            _dateTimeISO.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DateTimeInISO");
            _dateTimeISO.Checked = false;
            Controls.Add(_dateTimeISO);

            _fixLookUp         = new CheckBox();
            _fixLookUp.Text    = SPSRollUpEngine.GetResourceString("SPSEP_LookUpFix");
            _fixLookUp.Checked = false;
            Controls.Add(_fixLookUp);

            _debugResults         = new CheckBox();
            _debugResults.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugXMLResults");
            _debugResults.Checked = false;
            Controls.Add(_debugResults);

            _debugResultsXML         = new CheckBox();
            _debugResultsXML.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugXMLChart");
            _debugResultsXML.Checked = false;
            Controls.Add(_debugResultsXML);

            _debugQuery         = new CheckBox();
            _debugQuery.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugCAMLQuery");
            _debugQuery.Checked = false;
            Controls.Add(_debugQuery);

            _debugEvaluator         = new CheckBox();
            _debugEvaluator.Text    = SPSRollUpEngine.GetResourceString("SPSEP_DebugEvaluator");
            _debugEvaluator.Checked = false;
            Controls.Add(_debugEvaluator);

            _showExtendedErrors         = new CheckBox();
            _showExtendedErrors.Text    = SPSRollUpEngine.GetResourceString("SPSEP_ShowDeveloperErrors");
            _showExtendedErrors.Checked = false;
            Controls.Add(_showExtendedErrors);
        }