[mapguide-commits] r7152 - in branches/2.4/MgDev/Desktop: MapViewer MapViewer/AppLayoutEngine MgAppLayout MgDesktop
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Oct 24 21:21:09 PDT 2012
Author: jng
Date: 2012-10-24 21:21:08 -0700 (Wed, 24 Oct 2012)
New Revision: 7152
Modified:
branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs
branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs
branches/2.4/MgDev/Desktop/MapViewer/MgQueryComponent.cs
branches/2.4/MgDev/Desktop/MapViewer/MgQueryControlImpl.cs
branches/2.4/MgDev/Desktop/MgAppLayout/Sheboygan.AppLayout
branches/2.4/MgDev/Desktop/MgDesktop/changelog.txt
Log:
mg-desktop: This submission contains the following changes:
- #2140: Add a new LayerList property to MgQueryComponent allowing for the list of queryable layers in the UI to be restricted to what's in this list.
- Update the AppLayout engine:
- Added support for overriding the default label of Component Definitions
- Added support for string arrays component property values (needed to support #2140). Such values should be specified in an AppLayout in the form (stringarray:value1,value2,value3)
Modified: branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs 2012-10-25 04:21:08 UTC (rev 7152)
@@ -379,6 +379,9 @@
public string ComponentID { get; set; }
[XmlElement]
+ public string Label { get; set; }
+
+ [XmlElement]
public string ClassName { get; set; }
[XmlElement]
@@ -418,5 +421,6 @@
public const string ENUM = "enum:"; //NOXLATE
public const string VIEWERID = "viewer:"; //NOXLATE
public const string TASKPANEID = "taskpane:"; //NOXLATE
+ public const string STRINGARRAY = "stringarray:"; //NOXLATE
}
}
Modified: branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs 2012-10-25 04:21:08 UTC (rev 7152)
@@ -369,6 +369,9 @@
throw new InvalidOperationException(string.Format(Strings.ErrorComponentAlreadyExists, compDef.ComponentID));
var comp = (MgComponent)Activator.CreateInstance(type);
_components[compDef.ComponentID] = comp;
+ //Override default label if specified
+ if (!string.IsNullOrEmpty(compDef.Label))
+ comp.Label = compDef.Label;
break;
}
}
@@ -432,6 +435,12 @@
throw new InvalidOperationException(Strings.ErrorMalformedEnumString);
comp.SetPropertyValue(prop.Name, Enum.Parse(Type.GetType(tokens[1]), tokens[2]));
}
+ else if (prop.Value.StartsWith(StringPrefixes.STRINGARRAY))
+ {
+ var csvList = prop.Value.Substring(StringPrefixes.STRINGARRAY.Length);
+ var values = csvList.Split(',');
+ comp.SetPropertyValue(prop.Name, values);
+ }
else if (prop.Value.StartsWith(StringPrefixes.TASKPANEID)) //NOTE: only one taskpane instance, but we're checking this as a forward-looking measure
{
comp.SetPropertyValue(prop.Name, taskPane);
Modified: branches/2.4/MgDev/Desktop/MapViewer/MgQueryComponent.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgQueryComponent.cs 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgQueryComponent.cs 2012-10-25 04:21:08 UTC (rev 7152)
@@ -17,9 +17,22 @@
this.Label = this.ToolTipText = Strings.TitleQuery;
}
+ [Category("MapGuide Component Properties")] //NOXLATE
+ [Description("An optional list of layer names that will be displayed in the list of queryable layers. If left empty, all layers from the map will be displayed in the list of queryable layers")] //NOXLATE
+ [DefaultValue(MeasurementUnit.Meters)]
+ [MgComponentProperty]
+ public string[] LayerList
+ {
+ get;
+ set;
+ }
+
protected override MgControlView CreateControlView()
{
- return new MgQueryControlImpl(this.Viewer);
+ if (this.LayerList == null || this.LayerList.Length == 0)
+ return new MgQueryControlImpl(this.Viewer);
+ else
+ return new MgQueryControlImpl(this.Viewer, this.LayerList);
}
}
}
Modified: branches/2.4/MgDev/Desktop/MapViewer/MgQueryControlImpl.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgQueryControlImpl.cs 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgQueryControlImpl.cs 2012-10-25 04:21:08 UTC (rev 7152)
@@ -17,9 +17,19 @@
private BindingList<MgDataPropertyDefinition> _properties;
private BindingList<MgLayerBase> _layers;
- public MgQueryControlImpl(IMapViewer viewer)
+ private string[] _restrictedLayerList;
+
+ public MgQueryControlImpl(IMapViewer viewer, string[] layerList)
{
InitializeComponent();
+ _restrictedLayerList = layerList;
+ InitBase(viewer);
+ LoadLayerList(viewer);
+ cmbLayer.SelectedIndex = 0;
+ }
+
+ private void InitBase(IMapViewer viewer)
+ {
this.Title = Strings.TitleQuery;
this.Disposed += new EventHandler(OnDisposed);
_viewer = viewer;
@@ -33,14 +43,38 @@
cmbProperty.DataSource = _properties;
cmbOperator.SelectedIndex = 0;
-
+ }
+
+ public MgQueryControlImpl(IMapViewer viewer)
+ {
+ InitializeComponent();
+ InitBase(viewer);
+ LoadLayerList(viewer);
+ cmbLayer.SelectedIndex = 0;
+ }
+
+ private void LoadLayerList(IMapViewer viewer)
+ {
var map = viewer.GetMap();
var layers = map.GetLayers();
- for (var i = 0; i < layers.GetCount(); i++)
+ if (_restrictedLayerList != null && _restrictedLayerList.Length > 0)
{
- _layers.Add(layers.GetItem(i));
+ foreach (var name in _restrictedLayerList)
+ {
+ if (layers.IndexOf(name) < 0)
+ continue;
+
+ var layer = layers.GetItem(name);
+ _layers.Add(layer);
+ }
}
- cmbLayer.SelectedIndex = 0;
+ else
+ {
+ for (var i = 0; i < layers.GetCount(); i++)
+ {
+ _layers.Add(layers.GetItem(i));
+ }
+ }
}
void OnDisposed(object sender, EventArgs e)
@@ -191,12 +225,7 @@
private void lnkRefreshLayers_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
_layers.Clear();
- var map = _viewer.GetMap();
- var layers = map.GetLayers();
- for (var i = 0; i < layers.GetCount(); i++)
- {
- _layers.Add(layers.GetItem(i));
- }
+ LoadLayerList(_viewer);
if (cmbLayer.SelectedIndex != 0)
cmbLayer.SelectedIndex = 0;
else
Modified: branches/2.4/MgDev/Desktop/MgAppLayout/Sheboygan.AppLayout
===================================================================
--- branches/2.4/MgDev/Desktop/MgAppLayout/Sheboygan.AppLayout 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MgAppLayout/Sheboygan.AppLayout 2012-10-25 04:21:08 UTC (rev 7152)
@@ -185,6 +185,10 @@
<ShowLabel>false</ShowLabel>
</ItemBase>
<ItemBase xsi:type="CommandItem">
+ <ComponentID>QueryRestricted</ComponentID>
+ <ShowLabel>false</ShowLabel>
+ </ItemBase>
+ <ItemBase xsi:type="CommandItem">
<ComponentID>Theme</ComponentID>
<ShowLabel>false</ShowLabel>
</ItemBase>
@@ -255,6 +259,10 @@
<ShowLabel>false</ShowLabel>
</ItemBase>
<ItemBase xsi:type="CommandItem">
+ <ComponentID>QueryRestricted</ComponentID>
+ <ShowLabel>false</ShowLabel>
+ </ItemBase>
+ <ItemBase xsi:type="CommandItem">
<ComponentID>Theme</ComponentID>
<ShowLabel>false</ShowLabel>
</ItemBase>
@@ -289,6 +297,10 @@
<ShowLabel>false</ShowLabel>
</ItemBase>
<ItemBase xsi:type="CommandItem">
+ <ComponentID>QueryRestricted</ComponentID>
+ <ShowLabel>false</ShowLabel>
+ </ItemBase>
+ <ItemBase xsi:type="CommandItem">
<ComponentID>Theme</ComponentID>
<ShowLabel>false</ShowLabel>
</ItemBase>
@@ -412,6 +424,25 @@
</Properties>
</ComponentDefinition>
<ComponentDefinition>
+ <ComponentID>QueryRestricted</ComponentID>
+ <Label>Query (restricted)</Label>
+ <ClassName>OSGeo.MapGuide.Viewer.MgQueryComponent</ClassName>
+ <Properties>
+ <NameValue>
+ <Name>Target</Name>
+ <Value>enum:OSGeo.MapGuide.Viewer.MgViewerTarget:TaskPane</Value>
+ </NameValue>
+ <NameValue>
+ <Name>TaskPane</Name>
+ <Value>taskpane:</Value>
+ </NameValue>
+ <NameValue>
+ <Name>LayerList</Name>
+ <Value>stringarray:Parcels,Roads</Value>
+ </NameValue>
+ </Properties>
+ </ComponentDefinition>
+ <ComponentDefinition>
<ComponentID>Quit</ComponentID>
<ClassName>OSGeo.MapGuide.Viewer.AppLayoutEngine.MgQuitComponent</ClassName>
</ComponentDefinition>
Modified: branches/2.4/MgDev/Desktop/MgDesktop/changelog.txt
===================================================================
--- branches/2.4/MgDev/Desktop/MgDesktop/changelog.txt 2012-10-22 12:44:10 UTC (rev 7151)
+++ branches/2.4/MgDev/Desktop/MgDesktop/changelog.txt 2012-10-25 04:21:08 UTC (rev 7152)
@@ -1,3 +1,13 @@
+Viewer Changelog:
+
+ - Query component now supports a LayerList property allowing the list of queryable layers in the UI to be restricted to what is in this list.
+ - AppLayout component definitions can have their labels overridden by specifying a <Label> element in the ComponentDefinition.
+ - AppLayout engine support for string array property values
+ - Fix issue when selecting objects from a layer with no property display mappings.
+
+2.4.0.7096 (Oct 9 2012)
+=======================
+
API Changelog:
- MgdPlatform::Terminate() did not call MgdFdoConnectionPool::Cleanup() leaving that to the static initializer to cleanup. This caused problems for the GDAL provider if connection pooling is enabled. The call has been put into MgdPlatform::Terminate() and connection pooling for the GDAL provider has been re-enabled in Platform.ini
More information about the mapguide-commits
mailing list