[mapguide-commits] r5689 - in trunk/Tools/Maestro/Maestro.Editors:
Fusion Properties WebLayout
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Apr 7 10:27:51 EDT 2011
Author: jng
Date: 2011-04-07 07:27:51 -0700 (Thu, 07 Apr 2011)
New Revision: 5689
Modified:
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.resx
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.resx
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.resx
Log:
#1654: Show publish URL for web/flexible layout editors. The URL is only generated for saved or already existing layouts. New layouts don't have a publish URL generated until it is saved.
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.Designer.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.Designer.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -37,12 +37,18 @@
this.tplImageList = new System.Windows.Forms.ImageList(this.components);
this.txtTitle = new System.Windows.Forms.TextBox();
this.txtTemplateUrl = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.txtPublicUrl = new System.Windows.Forms.TextBox();
+ this.btnShowInBrowser = new System.Windows.Forms.Button();
this.contentPanel.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// contentPanel
//
+ this.contentPanel.Controls.Add(this.btnShowInBrowser);
+ this.contentPanel.Controls.Add(this.txtPublicUrl);
+ this.contentPanel.Controls.Add(this.label3);
this.contentPanel.Controls.Add(this.txtTemplateUrl);
this.contentPanel.Controls.Add(this.txtTitle);
this.contentPanel.Controls.Add(this.groupBox1);
@@ -92,9 +98,26 @@
this.txtTemplateUrl.Name = "txtTemplateUrl";
this.txtTemplateUrl.ReadOnly = true;
//
+ // label3
+ //
+ resources.ApplyResources(this.label3, "label3");
+ this.label3.Name = "label3";
+ //
+ // txtPublicUrl
+ //
+ resources.ApplyResources(this.txtPublicUrl, "txtPublicUrl");
+ this.txtPublicUrl.Name = "txtPublicUrl";
+ this.txtPublicUrl.ReadOnly = true;
+ //
+ // btnShowInBrowser
+ //
+ resources.ApplyResources(this.btnShowInBrowser, "btnShowInBrowser");
+ this.btnShowInBrowser.Name = "btnShowInBrowser";
+ this.btnShowInBrowser.UseVisualStyleBackColor = true;
+ this.btnShowInBrowser.Click += new System.EventHandler(this.btnShowInBrowser_Click);
+ //
// FlexLayoutSettingsCtrl
//
- resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.HeaderText = "Flexible Layout Settings";
this.Name = "FlexLayoutSettingsCtrl";
@@ -114,5 +137,8 @@
private System.Windows.Forms.ListView lstTemplates;
private System.Windows.Forms.ImageList tplImageList;
private System.Windows.Forms.TextBox txtTemplateUrl;
+ private System.Windows.Forms.Button btnShowInBrowser;
+ private System.Windows.Forms.TextBox txtPublicUrl;
+ private System.Windows.Forms.Label label3;
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -46,12 +46,16 @@
private IFusionService _fsvc;
private IApplicationDefinition _flexLayout;
private string _baseUrl;
+ private IEditorService _edsvc;
public override void Bind(IEditorService service)
{
+ _edsvc = service;
+ _edsvc.RegisterCustomNotifier(this);
+
try
{
- _fsvc = (IFusionService)service.GetService((int)ServiceType.Fusion);
+ _fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
_baseUrl = service.GetCustomProperty("BaseUrl").ToString();
if (!_baseUrl.EndsWith("/"))
@@ -61,14 +65,54 @@
{
throw new NotSupportedException(Properties.Resources.IncompatibleConnection);
}
- service.RegisterCustomNotifier(this);
+
+ _edsvc.Saved += OnSaved;
_flexLayout = (IApplicationDefinition)service.GetEditedResource();
+
TextBoxBinder.BindText(txtTemplateUrl, _flexLayout, "TemplateUrl");
TextBoxBinder.BindText(txtTitle, _flexLayout, "Title");
var templates = _fsvc.GetApplicationTemplates();
InitializeTemplateList(templates);
+
+ GeneratePreviewUrl();
}
+ protected override void UnsubscribeEventHandlers()
+ {
+ _edsvc.Saved -= OnSaved;
+ base.UnsubscribeEventHandlers();
+ }
+
+ void OnSaved(object sender, EventArgs e)
+ {
+ GeneratePreviewUrl();
+ }
+
+ private void GeneratePreviewUrl()
+ {
+ btnShowInBrowser.Enabled = false;
+ txtPublicUrl.Text = string.Empty;
+
+ try
+ {
+ var conn = _flexLayout.CurrentConnection;
+ string baseUrl = conn.GetCustomProperty("BaseUrl").ToString();
+ if (!baseUrl.EndsWith("/"))
+ baseUrl += "/";
+
+ if (!_edsvc.IsNew)
+ {
+ txtPublicUrl.Text = baseUrl + txtTemplateUrl.Text + "?ApplicationDefinition=" + _edsvc.ResourceID;
+ btnShowInBrowser.Enabled = true;
+ }
+ else
+ {
+ txtPublicUrl.Text = Properties.Resources.PreviewUrlNotAvailable;
+ }
+ }
+ catch { }
+ }
+
private void InitializeTemplateList(IApplicationDefinitionTemplateInfoSet templates)
{
lstTemplates.Clear();
@@ -122,6 +166,7 @@
var item = lstTemplates.SelectedItems[0];
var template = (IApplicationDefinitionTemplateInfo)item.Tag;
txtTemplateUrl.Text = template.LocationUrl;
+ GeneratePreviewUrl();
var handler = this.TemplateChanged;
if (handler != null)
{
@@ -129,5 +174,10 @@
}
}
}
+
+ private void btnShowInBrowser_Click(object sender, EventArgs e)
+ {
+ _edsvc.OpenUrl(txtPublicUrl.Text);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.resx 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexLayoutSettingsCtrl.resx 2011-04-07 14:27:51 UTC (rev 5689)
@@ -118,17 +118,95 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnShowInBrowser.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Right</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="btnShowInBrowser.Location" type="System.Drawing.Point, System.Drawing">
+ <value>398, 223</value>
+ </data>
+ <data name="btnShowInBrowser.Size" type="System.Drawing.Size, System.Drawing">
+ <value>35, 23</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnShowInBrowser.TabIndex" type="System.Int32, mscorlib">
+ <value>7</value>
+ </data>
+ <data name="btnShowInBrowser.Text" xml:space="preserve">
+ <value>Go</value>
+ </data>
+ <data name=">>btnShowInBrowser.Name" xml:space="preserve">
+ <value>btnShowInBrowser</value>
+ </data>
+ <data name=">>btnShowInBrowser.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnShowInBrowser.Parent" xml:space="preserve">
+ <value>contentPanel</value>
+ </data>
+ <data name=">>btnShowInBrowser.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <data name="txtPublicUrl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Left, Right</value>
+ </data>
+ <data name="txtPublicUrl.Location" type="System.Drawing.Point, System.Drawing">
+ <value>102, 225</value>
+ </data>
+ <data name="txtPublicUrl.Size" type="System.Drawing.Size, System.Drawing">
+ <value>293, 20</value>
+ </data>
+ <data name="txtPublicUrl.TabIndex" type="System.Int32, mscorlib">
+ <value>6</value>
+ </data>
+ <data name=">>txtPublicUrl.Name" xml:space="preserve">
+ <value>txtPublicUrl</value>
+ </data>
+ <data name=">>txtPublicUrl.Type" xml:space="preserve">
+ <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>txtPublicUrl.Parent" xml:space="preserve">
+ <value>contentPanel</value>
+ </data>
+ <data name=">>txtPublicUrl.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="label3.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
+ <value>20, 228</value>
+ </data>
+ <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
+ <value>61, 13</value>
+ </data>
+ <data name="label3.TabIndex" type="System.Int32, mscorlib">
+ <value>5</value>
+ </data>
+ <data name="label3.Text" xml:space="preserve">
+ <value>Public URL</value>
+ </data>
+ <data name=">>label3.Name" xml:space="preserve">
+ <value>label3</value>
+ </data>
+ <data name=">>label3.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label3.Parent" xml:space="preserve">
+ <value>contentPanel</value>
+ </data>
+ <data name=">>label3.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
<data name="txtTemplateUrl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="txtTemplateUrl.Location" type="System.Drawing.Point, System.Drawing">
- <value>93, 179</value>
+ <value>102, 199</value>
</data>
<data name="txtTemplateUrl.Size" type="System.Drawing.Size, System.Drawing">
- <value>340, 20</value>
+ <value>331, 20</value>
</data>
- <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtTemplateUrl.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
@@ -142,16 +220,16 @@
<value>contentPanel</value>
</data>
<data name=">>txtTemplateUrl.ZOrder" xml:space="preserve">
- <value>0</value>
+ <value>3</value>
</data>
<data name="txtTitle.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="txtTitle.Location" type="System.Drawing.Point, System.Drawing">
- <value>93, 17</value>
+ <value>102, 15</value>
</data>
<data name="txtTitle.Size" type="System.Drawing.Size, System.Drawing">
- <value>343, 20</value>
+ <value>331, 20</value>
</data>
<data name="txtTitle.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -166,7 +244,7 @@
<value>contentPanel</value>
</data>
<data name=">>txtTitle.ZOrder" xml:space="preserve">
- <value>1</value>
+ <value>4</value>
</data>
<data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
@@ -184,7 +262,7 @@
<value>3, 16</value>
</data>
<data name="lstTemplates.Size" type="System.Drawing.Size, System.Drawing">
- <value>416, 107</value>
+ <value>416, 133</value>
</data>
<data name="lstTemplates.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -202,10 +280,10 @@
<value>0</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
- <value>14, 43</value>
+ <value>14, 41</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
- <value>422, 126</value>
+ <value>422, 152</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -223,22 +301,22 @@
<value>contentPanel</value>
</data>
<data name=">>groupBox1.ZOrder" xml:space="preserve">
- <value>2</value>
+ <value>5</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
- <value>20, 182</value>
+ <value>20, 202</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
- <value>67, 13</value>
+ <value>76, 13</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label2.Text" xml:space="preserve">
- <value>Template Url</value>
+ <value>Template URL</value>
</data>
<data name=">>label2.Name" xml:space="preserve">
<value>label2</value>
@@ -250,13 +328,13 @@
<value>contentPanel</value>
</data>
<data name=">>label2.ZOrder" xml:space="preserve">
- <value>3</value>
+ <value>6</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
- <value>20, 20</value>
+ <value>20, 18</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>27, 13</value>
@@ -277,7 +355,7 @@
<value>contentPanel</value>
</data>
<data name=">>label1.ZOrder" xml:space="preserve">
- <value>4</value>
+ <value>7</value>
</data>
<data name=">>contentPanel.Name" xml:space="preserve">
<value>contentPanel</value>
@@ -294,9 +372,6 @@
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
- <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
- <value>6, 13</value>
- </data>
<data name=">>tplImageList.Name" xml:space="preserve">
<value>tplImageList</value>
</data>
@@ -307,6 +382,6 @@
<value>FlexLayoutSettingsCtrl</value>
</data>
<data name=">>$this.Type" xml:space="preserve">
- <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.Designer.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.Designer.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -63,8 +63,8 @@
//
// FlexibleLayoutEditor
//
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
resources.ApplyResources(this, "$this");
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.widgetsCtrl);
this.Controls.Add(this.mapsCtrl);
this.Controls.Add(this.settingsCtrl);
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.resx 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditor.resx 2011-04-07 14:27:51 UTC (rev 5689)
@@ -126,7 +126,7 @@
<value>0, 0</value>
</data>
<data name="settingsCtrl.Size" type="System.Drawing.Size, System.Drawing">
- <value>698, 238</value>
+ <value>681, 285</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="settingsCtrl.TabIndex" type="System.Int32, mscorlib">
@@ -136,7 +136,7 @@
<value>settingsCtrl</value>
</data>
<data name=">>settingsCtrl.Type" xml:space="preserve">
- <value>Maestro.Editors.Fusion.FlexLayoutSettingsCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Fusion.FlexLayoutSettingsCtrl, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>settingsCtrl.Parent" xml:space="preserve">
<value>$this</value>
@@ -148,10 +148,10 @@
<value>Top</value>
</data>
<data name="mapsCtrl.Location" type="System.Drawing.Point, System.Drawing">
- <value>0, 238</value>
+ <value>0, 285</value>
</data>
<data name="mapsCtrl.Size" type="System.Drawing.Size, System.Drawing">
- <value>698, 490</value>
+ <value>681, 490</value>
</data>
<data name="mapsCtrl.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -160,7 +160,7 @@
<value>mapsCtrl</value>
</data>
<data name=">>mapsCtrl.Type" xml:space="preserve">
- <value>Maestro.Editors.Fusion.MapSettingsCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Fusion.MapSettingsCtrl, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>mapsCtrl.Parent" xml:space="preserve">
<value>$this</value>
@@ -172,10 +172,10 @@
<value>Top</value>
</data>
<data name="widgetsCtrl.Location" type="System.Drawing.Point, System.Drawing">
- <value>0, 728</value>
+ <value>0, 775</value>
</data>
<data name="widgetsCtrl.Size" type="System.Drawing.Size, System.Drawing">
- <value>698, 319</value>
+ <value>681, 319</value>
</data>
<data name="widgetsCtrl.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -184,7 +184,7 @@
<value>widgetsCtrl</value>
</data>
<data name=">>widgetsCtrl.Type" xml:space="preserve">
- <value>Maestro.Editors.Fusion.WidgetSettingsCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Fusion.WidgetSettingsCtrl, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>widgetsCtrl.Parent" xml:space="preserve">
<value>$this</value>
@@ -195,19 +195,16 @@
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
- <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
- <value>6, 13</value>
- </data>
<data name="$this.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
- <value>698, 574</value>
+ <value>681, 574</value>
</data>
<data name=">>$this.Name" xml:space="preserve">
<value>FlexibleLayoutEditor</value>
</data>
<data name=">>$this.Type" xml:space="preserve">
- <value>Maestro.Editors.EditorBase, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.EditorBase, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -2077,6 +2077,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to The Preview URL is not currently available.
+ /// </summary>
+ internal static string PreviewUrlNotAvailable {
+ get {
+ return ResourceManager.GetString("PreviewUrlNotAvailable", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Processed: {0}.
/// </summary>
internal static string ProcessedItem {
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-04-07 14:27:51 UTC (rev 5689)
@@ -1157,4 +1157,7 @@
<data name="NoConnectionSet" xml:space="preserve">
<value>Could not determine the validity of this feature source. Please test the connection first to ensure a valid connection.</value>
</data>
+ <data name="PreviewUrlNotAvailable" xml:space="preserve">
+ <value>The Preview URL is not currently available</value>
+ </data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.Designer.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.Designer.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -334,6 +334,7 @@
resources.ApplyResources(this.btnShowInBrowser, "btnShowInBrowser");
this.btnShowInBrowser.Name = "btnShowInBrowser";
this.btnShowInBrowser.UseVisualStyleBackColor = true;
+ this.btnShowInBrowser.Click += new System.EventHandler(this.btnShowInBrowser_Click);
//
// chkPingServer
//
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs 2011-04-07 14:27:51 UTC (rev 5689)
@@ -56,9 +56,11 @@
{
_edsvc = service;
_edsvc.RegisterCustomNotifier(this);
+ _edsvc.Saved += OnSaved;
_wl = (IWebLayout)_edsvc.GetEditedResource();
-
+ GeneratePreviewUrl();
+
_view = _wl.Map.InitialView;
if (_view == null)
{
@@ -110,6 +112,35 @@
_wl.ZoomControl.PropertyChanged += OnWebLayoutPropertyChanged;
}
+ private void GeneratePreviewUrl()
+ {
+ btnShowInBrowser.Enabled = false;
+ txtAjaxViewerUrl.Text = string.Empty;
+ try
+ {
+ var conn = _wl.CurrentConnection;
+ string baseUrl = conn.GetCustomProperty("BaseUrl").ToString();
+ if (!baseUrl.EndsWith("/"))
+ baseUrl += "/";
+
+ if (!_edsvc.IsNew)
+ {
+ txtAjaxViewerUrl.Text = baseUrl + "mapviewerajax/?WEBLAYOUT=" + _edsvc.ResourceID;
+ btnShowInBrowser.Enabled = true;
+ }
+ else
+ {
+ txtAjaxViewerUrl.Text = Properties.Resources.PreviewUrlNotAvailable;
+ }
+ }
+ catch { }
+ }
+
+ void OnSaved(object sender, EventArgs e)
+ {
+ GeneratePreviewUrl();
+ }
+
void OnWebLayoutPropertyChanged(object sender, PropertyChangedEventArgs e)
{
OnResourceChanged();
@@ -119,6 +150,8 @@
{
try
{
+ _edsvc.Saved -= OnSaved;
+
if (_wl != null)
{
_wl.PropertyChanged -= OnWebLayoutPropertyChanged;
@@ -190,5 +223,10 @@
}
}
}
+
+ private void btnShowInBrowser_Click(object sender, EventArgs e)
+ {
+ _edsvc.OpenUrl(txtAjaxViewerUrl.Text);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.resx 2011-04-07 13:36:46 UTC (rev 5688)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.resx 2011-04-07 14:27:51 UTC (rev 5689)
@@ -1140,6 +1140,6 @@
<value>WebLayoutSettingsCtrl</value>
</data>
<data name=">>$this.Type" xml:space="preserve">
- <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
\ No newline at end of file
More information about the mapguide-commits
mailing list