[mapguide-commits] r5280 - in sandbox/maestro-3.0:
Maestro.Base/Editor Maestro.Editors/FeatureSource/Preview
MaestroFsPreview OSGeo.MapGuide.MaestroAPI.Http
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Oct 13 04:06:38 EDT 2010
Author: jng
Date: 2010-10-13 01:06:38 -0700 (Wed, 13 Oct 2010)
New Revision: 5280
Modified:
sandbox/maestro-3.0/Maestro.Base/Editor/FsEditorOptionPanel.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.resx
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/PreviewPane.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.resx
sandbox/maestro-3.0/MaestroFsPreview/
sandbox/maestro-3.0/MaestroFsPreview/MainForm.Designer.cs
sandbox/maestro-3.0/MaestroFsPreview/MainForm.cs
sandbox/maestro-3.0/MaestroFsPreview/MainForm.resx
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
Log:
3.0 sandbox changes:
- Log failed outbound http requests by logging the response object of the caught WebException
- Add expression editor support to local feature source preview to specify filters and computed properties
- Have local preview launched from editor initialized to the same resource id of the feature source being edited.
Modified: sandbox/maestro-3.0/Maestro.Base/Editor/FsEditorOptionPanel.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/FsEditorOptionPanel.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/FsEditorOptionPanel.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -69,7 +69,9 @@
private void btnLocalPreview_Click(object sender, EventArgs e)
{
- new MaestroFsPreview.MainForm(_fsvc, _rsvc).ShowDialog();
+ var dlg = new MaestroFsPreview.MainForm(_fsvc, _rsvc);
+ dlg.FeatureSourceID = _fs.ResourceID;
+ dlg.ShowDialog();
}
private void btnEditConfiguration_Click(object sender, EventArgs e)
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.Designer.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.Designer.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -138,7 +138,6 @@
// tabPreviews
//
this.tabPreviews.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tabPreviews.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tabPreviews.Location = new System.Drawing.Point(0, 0);
this.tabPreviews.Name = "tabPreviews";
this.tabPreviews.SelectedIndex = 0;
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -27,6 +27,7 @@
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.ObjectModels.Capabilities;
namespace Maestro.Editors.FeatureSource.Preview
{
@@ -59,9 +60,12 @@
set;
}
- public void ReloadTree(string fsId)
+ private FdoProviderCapabilities _caps;
+
+ public void ReloadTree(string fsId, FdoProviderCapabilities caps)
{
currentFsId = fsId;
+ _caps = caps;
ClearPreviewPanes();
trvSchema.Nodes.Clear();
var schema = _fsvc.DescribeFeatureSource(currentFsId);
@@ -118,7 +122,7 @@
private void btnRefresh_Click(object sender, EventArgs e)
{
- ReloadTree(currentFsId);
+ ReloadTree(currentFsId, _caps);
}
private void btnSql_Click(object sender, EventArgs e)
@@ -153,7 +157,7 @@
{
if (!hasSql)
{
- var pane = new PreviewPane(currentFsId, mode, cls, _fsvc);
+ var pane = new PreviewPane(currentFsId, mode, cls, _fsvc, _caps);
var page = new TabPage();
page.Text = Properties.Resources.SQLQuery;
page.Tag = mode;
@@ -165,7 +169,7 @@
}
else
{
- var pane = new PreviewPane(currentFsId, mode, cls, _fsvc);
+ var pane = new PreviewPane(currentFsId, mode, cls, _fsvc, _caps);
var page = new TabPage();
page.Text = Properties.Resources.StandardQuery + " - " + cls.QualifiedNameDecoded;
page.Tag = mode;
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.resx 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/LocalFeatureSourcePreviewCtrl.resx 2010-10-13 08:06:38 UTC (rev 5280)
@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAw
- DQAAAk1TRnQBSQFMAgEBBgEAAQwBAAEMAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ DQAAAk1TRnQBSQFMAgEBBgEAARQBAAEUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/PreviewPane.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/PreviewPane.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/PreviewPane.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -27,6 +27,7 @@
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Services;
using System.Diagnostics;
+using OSGeo.MapGuide.ObjectModels.Capabilities;
namespace Maestro.Editors.FeatureSource.Preview
{
@@ -40,9 +41,10 @@
private QueryMode _mode;
private ClassDefinition _cls;
private IFeatureService _featSvc;
+ private FdoProviderCapabilities _caps;
private string _fsId;
- public PreviewPane(string fsId, QueryMode mode, ClassDefinition cls, IFeatureService featSvc)
+ public PreviewPane(string fsId, QueryMode mode, ClassDefinition cls, IFeatureService featSvc, FdoProviderCapabilities caps)
: this()
{
_fsId = fsId;
@@ -58,7 +60,7 @@
_inner = ctrl;
break;
case QueryMode.Standard:
- ctrl = new StandardQueryCtrl(fsId, featSvc, cls);
+ ctrl = new StandardQueryCtrl(fsId, featSvc, cls, caps);
_inner = ctrl;
break;
}
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.Designer.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.Designer.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -83,6 +83,7 @@
this.btnCheckNone.TabIndex = 2;
this.btnCheckNone.Text = "Check None";
this.btnCheckNone.UseVisualStyleBackColor = true;
+ this.btnCheckNone.Click += new System.EventHandler(this.btnCheckNone_Click);
//
// btnCheckAll
//
@@ -93,6 +94,7 @@
this.btnCheckAll.TabIndex = 1;
this.btnCheckAll.Text = "Check All";
this.btnCheckAll.UseVisualStyleBackColor = true;
+ this.btnCheckAll.Click += new System.EventHandler(this.btnCheckAll_Click);
//
// chkProperties
//
@@ -113,7 +115,7 @@
this.TAB_COMPUTED.Location = new System.Drawing.Point(4, 25);
this.TAB_COMPUTED.Name = "TAB_COMPUTED";
this.TAB_COMPUTED.Padding = new System.Windows.Forms.Padding(3);
- this.TAB_COMPUTED.Size = new System.Drawing.Size(318, 136);
+ this.TAB_COMPUTED.Size = new System.Drawing.Size(305, 136);
this.TAB_COMPUTED.TabIndex = 1;
this.TAB_COMPUTED.Text = "Computed Properties";
this.TAB_COMPUTED.UseVisualStyleBackColor = true;
@@ -121,12 +123,14 @@
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.btnDelete.Enabled = false;
this.btnDelete.Location = new System.Drawing.Point(88, 107);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(75, 23);
this.btnDelete.TabIndex = 2;
this.btnDelete.Text = "Delete";
this.btnDelete.UseVisualStyleBackColor = true;
+ this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnAdd
//
@@ -137,6 +141,7 @@
this.btnAdd.TabIndex = 1;
this.btnAdd.Text = "Add";
this.btnAdd.UseVisualStyleBackColor = true;
+ this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// grdExpressions
//
@@ -174,6 +179,7 @@
this.txtFilter.Name = "txtFilter";
this.txtFilter.Size = new System.Drawing.Size(153, 139);
this.txtFilter.TabIndex = 10;
+ this.txtFilter.Click += new System.EventHandler(this.txtFilter_Click);
//
// lblFilter
//
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -27,6 +27,8 @@
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Services;
using System.Collections.Specialized;
+using Maestro.Editors.Common;
+using OSGeo.MapGuide.ObjectModels.Capabilities;
namespace Maestro.Editors.FeatureSource.Preview
{
@@ -40,13 +42,15 @@
private IFeatureService _featSvc;
private string _fsId;
private ClassDefinition _cls;
+ private FdoProviderCapabilities _caps;
- public StandardQueryCtrl(string fsId, IFeatureService featSvc, ClassDefinition cls)
+ public StandardQueryCtrl(string fsId, IFeatureService featSvc, ClassDefinition cls, FdoProviderCapabilities caps)
: this()
{
_fsId = fsId;
_featSvc = featSvc;
_cls = cls;
+ _caps = caps;
foreach (var prop in cls.Columns)
{
chkProperties.Items.Add(prop.Name, true);
@@ -83,5 +87,79 @@
{
get { return this; }
}
+
+ private void txtFilter_Click(object sender, EventArgs e)
+ {
+ var ed = new ExpressionEditor();
+ ed.Initialize(_featSvc, _caps, _cls, _fsId);
+ ed.Expression = txtFilter.Text;
+ if (ed.ShowDialog() == DialogResult.OK)
+ {
+ txtFilter.Text = ed.Expression;
+ }
+ }
+
+ private void btnCheckAll_Click(object sender, EventArgs e)
+ {
+ for (int i = 0; i < chkProperties.Items.Count; i++)
+ {
+ chkProperties.SetItemChecked(i, true);
+ }
+ }
+
+ private void btnCheckNone_Click(object sender, EventArgs e)
+ {
+ for (int i = 0; i < chkProperties.Items.Count; i++)
+ {
+ chkProperties.SetItemChecked(i, false);
+ }
+ }
+
+ private void btnAdd_Click(object sender, EventArgs e)
+ {
+ var ed = new ExpressionEditor();
+ ed.Initialize(_featSvc, _caps, _cls, _fsId);
+ if (ed.ShowDialog() == DialogResult.OK)
+ {
+ grdExpressions.Rows.Add(GenerateAlias(), ed.Expression);
+ }
+ }
+
+ private string GenerateAlias()
+ {
+ int counter = 1;
+ string name = "Expr" + counter;
+ while (AliasExists(name))
+ {
+ counter++;
+ name = "Expr" + counter;
+ }
+ return name;
+ }
+
+ private bool AliasExists(string name)
+ {
+ foreach (DataGridViewRow row in grdExpressions.Rows)
+ {
+ if (row.Cells[0].Value != null)
+ {
+ if (row.Cells[0].Value.ToString().Equals(name))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (grdExpressions.SelectedRows.Count == 1)
+ {
+ var row = grdExpressions.SelectedRows[0];
+ grdExpressions.Rows.Remove(row);
+ }
+ }
}
}
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.resx 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Preview/StandardQueryCtrl.resx 2010-10-13 08:06:38 UTC (rev 5280)
@@ -123,4 +123,10 @@
<metadata name="COL_EXPR.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+ <metadata name="COL_ALIAS.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="COL_EXPR.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
</root>
\ No newline at end of file
Property changes on: sandbox/maestro-3.0/MaestroFsPreview
___________________________________________________________________
Added: svn:ignore
+ obj
Modified: sandbox/maestro-3.0/MaestroFsPreview/MainForm.Designer.cs
===================================================================
--- sandbox/maestro-3.0/MaestroFsPreview/MainForm.Designer.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/MaestroFsPreview/MainForm.Designer.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -29,31 +29,18 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
- this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.fsPanel = new System.Windows.Forms.Panel();
this.btnBrowse = new System.Windows.Forms.Button();
this.txtFeatureSource = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.localFsPreviewCtrl = new Maestro.Editors.FeatureSource.Preview.LocalFeatureSourcePreviewCtrl();
- this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel();
- this.statusStrip1.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.fsPanel.SuspendLayout();
this.SuspendLayout();
//
- // statusStrip1
- //
- this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.lblStatus});
- this.statusStrip1.Location = new System.Drawing.Point(0, 340);
- this.statusStrip1.Name = "statusStrip1";
- this.statusStrip1.Size = new System.Drawing.Size(653, 22);
- this.statusStrip1.TabIndex = 0;
- this.statusStrip1.Text = "statusStrip1";
- //
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -69,7 +56,7 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.localFsPreviewCtrl);
- this.splitContainer1.Size = new System.Drawing.Size(653, 340);
+ this.splitContainer1.Size = new System.Drawing.Size(784, 562);
this.splitContainer1.SplitterDistance = 33;
this.splitContainer1.TabIndex = 1;
//
@@ -81,13 +68,13 @@
this.fsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.fsPanel.Location = new System.Drawing.Point(0, 0);
this.fsPanel.Name = "fsPanel";
- this.fsPanel.Size = new System.Drawing.Size(653, 33);
+ this.fsPanel.Size = new System.Drawing.Size(784, 33);
this.fsPanel.TabIndex = 0;
//
// btnBrowse
//
this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnBrowse.Location = new System.Drawing.Point(615, 4);
+ this.btnBrowse.Location = new System.Drawing.Point(746, 4);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(26, 23);
this.btnBrowse.TabIndex = 2;
@@ -102,7 +89,7 @@
this.txtFeatureSource.Location = new System.Drawing.Point(98, 6);
this.txtFeatureSource.Name = "txtFeatureSource";
this.txtFeatureSource.ReadOnly = true;
- this.txtFeatureSource.Size = new System.Drawing.Size(511, 20);
+ this.txtFeatureSource.Size = new System.Drawing.Size(642, 20);
this.txtFeatureSource.TabIndex = 1;
//
// label1
@@ -119,41 +106,31 @@
this.localFsPreviewCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.localFsPreviewCtrl.Location = new System.Drawing.Point(0, 0);
this.localFsPreviewCtrl.Name = "localFsPreviewCtrl";
- this.localFsPreviewCtrl.Size = new System.Drawing.Size(653, 303);
+ this.localFsPreviewCtrl.Size = new System.Drawing.Size(784, 525);
+ this.localFsPreviewCtrl.SupportsSQL = false;
this.localFsPreviewCtrl.TabIndex = 0;
//
- // lblStatus
- //
- this.lblStatus.Name = "lblStatus";
- this.lblStatus.Size = new System.Drawing.Size(0, 17);
- //
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(653, 362);
+ this.ClientSize = new System.Drawing.Size(784, 562);
this.Controls.Add(this.splitContainer1);
- this.Controls.Add(this.statusStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Feature Source Preview";
- this.statusStrip1.ResumeLayout(false);
- this.statusStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.fsPanel.ResumeLayout(false);
this.fsPanel.PerformLayout();
this.ResumeLayout(false);
- this.PerformLayout();
}
#endregion
- private System.Windows.Forms.StatusStrip statusStrip1;
- private System.Windows.Forms.ToolStripStatusLabel lblStatus;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Panel fsPanel;
private System.Windows.Forms.Button btnBrowse;
Modified: sandbox/maestro-3.0/MaestroFsPreview/MainForm.cs
===================================================================
--- sandbox/maestro-3.0/MaestroFsPreview/MainForm.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/MaestroFsPreview/MainForm.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -77,7 +77,7 @@
_fs = (IFeatureSource)resSvc.GetResource(this.FeatureSourceID);
var caps = featSvc.GetProviderCapabilities(_fs.Provider);
localFsPreviewCtrl.SupportsSQL = caps.Connection.SupportsSQL;
- localFsPreviewCtrl.ReloadTree(this.FeatureSourceID);
+ localFsPreviewCtrl.ReloadTree(this.FeatureSourceID, caps);
}
}
}
Modified: sandbox/maestro-3.0/MaestroFsPreview/MainForm.resx
===================================================================
--- sandbox/maestro-3.0/MaestroFsPreview/MainForm.resx 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/MaestroFsPreview/MainForm.resx 2010-10-13 08:06:38 UTC (rev 5280)
@@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2010-10-13 05:59:23 UTC (rev 5279)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2010-10-13 08:06:38 UTC (rev 5280)
@@ -282,6 +282,8 @@
}
catch (WebException wex)
{
+ LogFailedRequest(wex);
+
if (wex.Response != null)
{
try
@@ -334,6 +336,8 @@
}
catch (WebException wex)
{
+ LogFailedRequest(wex);
+
if (wex.Response != null)
{
try
@@ -527,6 +531,9 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+
Exception ex2 = Utility.ThrowAsWebException(ex);
if (ex2 != ex)
throw ex2;
@@ -547,11 +554,20 @@
#endif
}
- private void LogResponse(HttpWebResponse httpresp)
+ private void LogResponse(HttpWebResponse resp)
{
- OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", httpresp.StatusCode, httpresp.StatusDescription, httpresp.Method, new Uri(this.BaseURL).MakeRelativeUri(httpresp.ResponseUri)));
+ OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, new Uri(this.BaseURL).MakeRelativeUri(resp.ResponseUri)));
}
+ private void LogFailedRequest(WebException ex)
+ {
+ var resp = ex.Response as HttpWebResponse;
+ if (resp != null)
+ {
+ OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, new Uri(this.BaseURL).MakeRelativeUri(resp.ResponseUri)));
+ }
+ }
+
public FeatureSetReader ExecuteSqlQuery(string featureSourceID, string sql)
{
ResourceIdentifier.Validate(featureSourceID, ResourceTypes.FeatureSource);
@@ -599,13 +615,18 @@
rs.Flush();
}
+ var resp = (HttpWebResponse)req.GetResponse();
+ LogResponse(resp);
+
if (aggregate)
- return new XmlAggregateSetReader(req.GetResponse().GetResponseStream());
+ return new XmlAggregateSetReader(resp.GetResponseStream());
else
- return new XmlFeatureSetReader(req.GetResponse().GetResponseStream());
+ return new XmlFeatureSetReader(resp.GetResponseStream());
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
try
{
if (this.IsSessionExpiredException(ex) && this.AutoRestartSession && this.RestartSession(false))
@@ -654,6 +675,8 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
try
{
if (this.IsSessionExpiredException(ex) && this.AutoRestartSession && this.RestartSession(false))
@@ -1267,6 +1290,9 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+
if (!this.m_autoRestartSession || !this.IsSessionExpiredException(ex) || !this.RestartSession(false))
{
Exception ex2 = Utility.ThrowAsWebException(ex);
@@ -1314,6 +1340,9 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+
var sessionRecreated = this.RestartSession(false);
if (!this.m_autoRestartSession || !this.IsSessionExpiredException(ex) || !sessionRecreated)
{
@@ -1448,6 +1477,9 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+
Exception ex2 = Utility.ThrowAsWebException(ex);
if (ex2 != ex)
throw ex2;
@@ -1472,6 +1504,9 @@
}
catch (Exception ex)
{
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+
Exception ex2 = Utility.ThrowAsWebException(ex);
if (ex2 != ex)
throw ex2;
More information about the mapguide-commits
mailing list