Hi Gunter<br />
<br />
Last monday I began the conversion of an application from Maestro 2.x to 4.x and I ran into lots of problems. I've been bombarding Jackie with questions and I have this table of changes that is not complete but might help you on the way. In the near future I can put a page on the OSGeo website with code samples etc. But for now this may be able to help you and others.<br />
I need to say that I am not done and therefor the code cannot compile or run and none of the findings in this table has been confirmed to be correct. But most af them should be right.<br />
<br />
<table>
<tr><th>v2.x </th><th>v4.x</th></tr>
<tr>
<td>
IServerConnection con = new HttpServerConnection(host, sessionid, <span style="color:#FF0000;">"en"</span>, true);</td>
<td>
<span style="color:#3399FF;">IServerConnection</span> con =
<span style="color:#3399FF;">ConnectionProviderRegistry</span>.CreateConnection(<span style="color:#FF0000;">"Maestro.Http"</span>, <span style="color:#FF0000;">"Url="</span> + host +
<span style="color:#FF0000;">";SessionId="</span> + sessionid + <span style="color:#FF0000;">";Locale=en;AllowUntestedVersion=true"</span>);</td>
</tr>
<tr>
<td>
<span style="color:#3399FF;">RuntimeMap</span> map = con.GetRuntimeMap(mapid);<br />
</td>
<td>
<span style="color:#3399FF;">IMappingService</span> mapSvc = (<span style="color:#3399FF;">IMappingService</span>)con.GetService((<span style="color:#0000FF;">int</span>)<span style="color:#3399FF;">ServiceType</span>.Mapping);<br />
<span style="color:#3399FF;">RuntimeMap</span> map = mapSvc.OpenMap(mapid);
</td>
</tr>
<tr>
<td>
<span style="color:#0000FF;">new</span> IMapDefinition()</td>
<td>
ObjectFactory.CreateMapDefinition(con, map.Name);</td>
</tr>
<tr>
<td>
<span style="color:#3399FF;">RuntimeMap</span> map = new RuntimeMap(mdef);</td>
<td>
<span style="color:#3399FF;">IMapDefinition</span> mapDef = (<span style="color:#3399FF;">IMapDefinition</span>)con.ResourceService.GetResource(mapid);<br />
<span style="color:#3399FF;">IMappingService</span> mapSvc = (<span style="color:#3399FF;">IMappingService</span>)con.GetService((<span style="color:#0000FF;">int</span>)<span style="color:#3399FF;">ServiceType</span>.Mapping);<br />
<span style="color:#3399FF;">RuntimeMap</span> map = mapSvc.CreateMap(mapDef);
</td>
</tr>
<tr>
<td>
<span style="color:#3399FF;">IWebLayout</span> layout = con.GetWebLayout(webLayout);</td>
<td>
<span style="color:#3399FF;">IWebLayout</span> layout = (<span style="color:#3399FF;">IWebLayout</span>)con.ResourceService.GetResource(webLayout);</td>
</tr>
<tr>
<td>
<span style="color:#3399FF;">MapDefinition</span> layer = con.GetMapDefinition(mapDefId);
</td>
<td>
<span style="color:#3399FF;">IMapDefinition</span> layout = (<span style="color:#3399FF;">IMapDefinition</span>)con.ResourceService.GetResource(mapDefId);</td>
</tr>
<tr>
<td>
MapDefinition.BaseMapDefinition</td>
<td>
IMapDefinition.</td>
</tr>
<tr>
<td>
<span style="color:#0000FF;">for</span> (<span style="color:#0000FF;">int</span> i = 0; i < mdef.BaseMap.FiniteDisplayScale.Count; i++)</td>
<td>
<span style="color:#0000FF;">foreach</span> (<span style="color:#0000FF;">double</span> d <span style="color:#0000FF;">in</span> baseMap.FiniteDisplayScale)</td>
</tr>
<tr>
<td>
RuntimeMapLayer.Geometry</td>
<td>
RuntimeMapLayer.GeometryPropertyName</td>
</tr>
<tr>
<td>
RuntimeMapLayer.Guid</td>
<td>
RuntimeMapLayer.LayerDefinitionID</td>
</tr>
<tr>
<td>
<span style="color:#3399FF;">LayerDefinition</span> ldef = con.GetLayerDefinition(rl.ResourceId);</td>
<td>
<span style="color:#3399FF;">ILayerDefinition</span> ldef = (<span style="color:#3399FF;">ILayerDefinition</span>)con.ResourceService.GetResource(rl.LayerDefinitionID);</td>
</tr>
<tr>
<td>
FeatureSource fs = con.GetFeatureSource(vldef.ResourceId);</td>
<td>
<span style="color:#3399FF;">IFeatureSource</span> fs = <span style="color:#3399FF;">ObjectFactory</span>.CreateFeatureSource(con, vldef.ResourceId);</td>
</tr>
<tr>
<td>
RuntimeMap.LayerGroups</td>
<td>
RuntimeMap.Groups</td>
</tr>
<tr>
<td>
map.Layers.RemoveAt(0);</td>
<td>
Add:<br />
using System.Linq;
To make this work.
</td>
</tr>
<tr>
<td>
con.SaveResourceAs(mdef, rtmDef);</td>
<td>
con.ResourceService.SaveResourceAs(mdef, rtmDef);</td>
</tr>
<tr>
<td>
ldef.Item as VectorLayerDefinitionType</td>
<td>
ldef.SubLayer;</td>
</tr>
<tr>
<td>
FeatureSetReader rd = layer.Query(filter, new string[] { layer.Geometry })
</td>
<td>
<span style="color:#3399FF;">IReader</span> rd =
map.CurrentConnection.FeatureService.QueryFeatureSource(layer.FeatureSourceID,
layer.QualifiedClassName, <span style="color:#0000FF;">new string</span>[] { layer.GeometryPropertyName })</td>
</tr>
<tr>
<td>
VectorScaleRangeType.Items</td>
<td>
<span style="color:#3399FF;">IVectorScaleRange</span>.PointStyle<br />
<span style="color:#3399FF;">IVectorScaleRange</span>.LineStyle<br />
<span style="color:#3399FF;">IVectorScaleRange</span>.AreaStyle</td>
</tr>
<tr>
<td>
VectorScaleRange.MinScaleSpecified/MaxScaleSpecified</td>
<td>
<span style="color:#3399FF;">IVectorScaleRange.MinScale.HasValue/.MaxScale.HasValue</td>
</tr>
<tr>
<td>
PointTypeStyleType</td>
<td>
<span style="color:#3399FF;">IPointVectorStyle</span></td>
</tr>
<tr>
<td>
LineTypeStyleType</td>
<td>
<span style="color:#3399FF;">ILineVectorStyle</span></td>
</tr>
<tr>
<td>
AreaTypeStyleType</td>
<td>
<span style="color:#3399FF;">IAreaVectorStyle</span></td>
</tr>
<tr>
<td>
LineRuleType</td>
<td>
<span style="color:#3399FF;">ILineRule</span></td>
</tr>
<tr>
<td>
PointRuleType.Item</td>
<td>
<span style="color:#3399FF;">IPointRule</span>.PointSymbolization2D</td>
</tr>
<tr>
<td>
LineRuleType.Item</td>
<td>
<span style="color:#3399FF;">ILineRule</span>.Stroke</td>
</tr>
<tr>
<td>
AreaRuleType.Item</td>
<td>
<span style="color:#3399FF;">IAreaRule</span>.AreaSymbolization2D</td>
</tr>
<tr>
<td>
AreaTypeStyleType.AreaRule</td>
<td>
<span style="color:#3399FF;">IAreaVectorStyle.Rules</span></td>
</tr>
<tr>
<td>
GridLayerDefinitionType</td>
<td>
<span style="color:#3399FF;">IRasterLayerDefinition</span></td>
</tr>
<tr>
<td>
LayerDefinition.Item</td>
<td>
<span style="color:#3399FF;">ILayerDefinition</span></td>
</tr>
<tr>
<td>
LineTypeStyle.Items
</td>
<td>
<span style="color:#3399FF;">ILineRule</span>.Strokes
</td>
</tr>
<tr>
<td>
ServerConnectionI.GetLegendImage</td>
<td>
<span style="color:#3399FF;">IMappingServicea</span>.RenderMapLegend</td>
</tr>
<tr>
<td>
ServerConnectionI.DescribeFeatureSource</td>
<td>
<span style="color:#3399FF;">IServerConnection</span>.FeatureService.DescribeFeatureSource</td>
</tr>
<tr>
<td>
FeatureSourceReader.Read()</td>
<td>
IReader.ReadNext()</td>
</tr>
<tr>
<td>
FeatureSourceReader.Row.IsValueNull(column)</td>
<td>
IReader.IsNull(column)</td>
</tr>
<tr>
<td>
foreach (FeatureSetColumn fsc in fsr.Columns)</td>
<td>
for (int i=0; i<fsr.FieldCount; i++)</td>
</tr>
<tr>
<td>
FeatureSetReader.Columns.Length</td>
<td>
IReader.FieldCount</td>
</tr>
<tr>
<td>
FeatureSetReader.Columns[i].Type</td>
<td>
IReader.GetFieldType(i)</td>
</tr>
<tr>
<td>
FeatureSourceDescription.FeatureSourceSchema</td>
<td>
FeatureSchema</td>
</tr>
<tr>
<td>
RuntimeMapLayer.NeedRefresh</td>
<td>
RuntimeMapLayer.NeedsRefresh (to get) RuntimeMapLayer.ForceRefresh() (to set)</td>
</tr>
<tr>
<td>
RuntimeMapLayer.ResourceID</td>
<td>
RuntimeMapLayer.LayerDefinitionID</td>
</tr>
<tr>
<td>
RuntimeMap.Extents</td>
<td>
RuntimeMap.DataExtent</td>
</tr>
<tr>
<td>
ServerConnectionI.HasFolder</td>
<td>
con.ResourceService.ResourceExists(folderpath)<br />
Make sure that folderpath ends with '/' to indicate it's a folder
</td>
</tr>
<tr>
<td>
ServerConnectionI.CreateFolder</td>
<td>
con.ResourceService.SetResourceXmlData(folderpath, null)</td>
</tr>
<tr>
<td>
RuntimeMapLayer.ResourceId</td>
<td>
RuntimeMapLayer.LayerDefinitionID</td>
</tr>
<tr>
<td>
map.FiniteScales</td>
<td>
IMapDefinition mdef =
(IMapDefinition)map.CurrentConnection.ResourceService.GetResource(map.MapDefinition);<br />
IBaseMapDefinition bm = mdef.BaseMap;<br />
bm.FiniteDisplayScale.ToArray();</td>
</tr>
</table>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Upgrading-MaestroAPI-tp7019938p7020272.html">Re: Upgrading MaestroAPI</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/MapGuide-Users-f1803227.html">MapGuide Users mailing list archive</a> at Nabble.com.<br/>