[mapguide-users] Re: Upgrading MaestroAPI
Hans Milling
hm at geograf.dk
Tue Nov 22 07:41:28 EST 2011
Hi Gunter
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.
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.
v2.x v4.x
IServerConnection con = new HttpServerConnection(host, sessionid,
"en", true);
IServerConnection con =
ConnectionProviderRegistry.CreateConnection("Maestro.Http", "Url="
+ host +
";SessionId=" + sessionid +
";Locale=en;AllowUntestedVersion=true");
RuntimeMap map = con.GetRuntimeMap(mapid);
IMappingService mapSvc =
(IMappingService)con.GetService((int)ServiceType.Mapping);
RuntimeMap map = mapSvc.OpenMap(mapid);
new IMapDefinition()
ObjectFactory.CreateMapDefinition(con, map.Name);
RuntimeMap map = new RuntimeMap(mdef);
IMapDefinition mapDef =
(IMapDefinition)con.ResourceService.GetResource(mapid);
IMappingService mapSvc =
(IMappingService)con.GetService((int)ServiceType.Mapping);
RuntimeMap map = mapSvc.CreateMap(mapDef);
IWebLayout layout = con.GetWebLayout(webLayout);
IWebLayout layout =
(IWebLayout)con.ResourceService.GetResource(webLayout);
MapDefinition layer = con.GetMapDefinition(mapDefId);
IMapDefinition layout =
(IMapDefinition)con.ResourceService.GetResource(mapDefId);
MapDefinition.BaseMapDefinition
IMapDefinition.
for (int i = 0; i < mdef.BaseMap.FiniteDisplayScale.Count; i++)
foreach (double d in baseMap.FiniteDisplayScale)
RuntimeMapLayer.Geometry
RuntimeMapLayer.GeometryPropertyName
RuntimeMapLayer.Guid
RuntimeMapLayer.LayerDefinitionID
LayerDefinition ldef = con.GetLayerDefinition(rl.ResourceId);
ILayerDefinition ldef =
(ILayerDefinition)con.ResourceService.GetResource(rl.LayerDefinitionID);
FeatureSource fs = con.GetFeatureSource(vldef.ResourceId);
IFeatureSource fs = ObjectFactory.CreateFeatureSource(con,
vldef.ResourceId);
RuntimeMap.LayerGroups
RuntimeMap.Groups
map.Layers.RemoveAt(0);
Add:
using System.Linq;
To make this work.
con.SaveResourceAs(mdef, rtmDef);
con.ResourceService.SaveResourceAs(mdef, rtmDef);
ldef.Item as VectorLayerDefinitionType
ldef.SubLayer;
FeatureSetReader rd = layer.Query(filter, new string[] {
layer.Geometry })
IReader rd =
map.CurrentConnection.FeatureService.QueryFeatureSource(layer.FeatureSourceID,
layer.QualifiedClassName, new string[] {
layer.GeometryPropertyName })
VectorScaleRangeType.Items
IVectorScaleRange.PointStyle
IVectorScaleRange.LineStyle
IVectorScaleRange.AreaStyle
VectorScaleRange.MinScaleSpecified/MaxScaleSpecified
IVectorScaleRange.MinScale.HasValue/.MaxScale.HasValue
PointTypeStyleType
IPointVectorStyle
LineTypeStyleType
ILineVectorStyle
AreaTypeStyleType
IAreaVectorStyle
LineRuleType
ILineRule
PointRuleType.Item
IPointRule.PointSymbolization2D
LineRuleType.Item
ILineRule.Stroke
AreaRuleType.Item
IAreaRule.AreaSymbolization2D
AreaTypeStyleType.AreaRule
IAreaVectorStyle.Rules
GridLayerDefinitionType
IRasterLayerDefinition
LayerDefinition.Item
ILayerDefinition
LineTypeStyle.Items
ILineRule.Strokes
ServerConnectionI.GetLegendImage
IMappingServicea.RenderMapLegend
ServerConnectionI.DescribeFeatureSource
IServerConnection.FeatureService.DescribeFeatureSource
FeatureSourceReader.Read()
IReader.ReadNext()
FeatureSourceReader.Row.IsValueNull(column)
IReader.IsNull(column)
foreach (FeatureSetColumn fsc in fsr.Columns)
for (int i=0; i<fsr.FieldCount; i++)
FeatureSetReader.Columns.Length
IReader.FieldCount
FeatureSetReader.Columns[i].Type
IReader.GetFieldType(i)
FeatureSourceDescription.FeatureSourceSchema
FeatureSchema
RuntimeMapLayer.NeedRefresh
RuntimeMapLayer.NeedsRefresh (to get)
RuntimeMapLayer.ForceRefresh() (to set)
RuntimeMapLayer.ResourceID
RuntimeMapLayer.LayerDefinitionID
RuntimeMap.Extents
RuntimeMap.DataExtent
ServerConnectionI.HasFolder
con.ResourceService.ResourceExists(folderpath)
Make sure that folderpath ends with '/' to indicate it's a
folder
ServerConnectionI.CreateFolder
con.ResourceService.SetResourceXmlData(folderpath, null)
RuntimeMapLayer.ResourceId
RuntimeMapLayer.LayerDefinitionID
map.FiniteScales
IMapDefinition mdef =
(IMapDefinition)map.CurrentConnection.ResourceService.GetResource(map.MapDefinition);
IBaseMapDefinition bm = mdef.BaseMap;
bm.FiniteDisplayScale.ToArray();
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Upgrading-MaestroAPI-tp7019938p7020272.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20111122/87e9d6bf/attachment.html
More information about the mapguide-users
mailing list