Try something like this:

def UpdateLayerTooltips(conn, folder, tooltip):
    """
    Updates the tooltip of all Layer Definitions under the specified folder
    """
    resList = conn.ResourceService.GetRepositoryResources(folder,
"LayerDefinition")
    for child in resList.Children:
        ldf = conn.ResourceService.GetResource(child.ResourceId)
        print "Updating: %s" % (child.ResourceId)
        ldf.SubLayer.ToolTip = tooltip
        # Save the changes back
        conn.ResourceService.SaveResource(ldf)
        print "Updated tooltip in: %s" % (child.ResourceId)

Usage:

conn = app.GetConnection(app.GetConnectionNames()[0])
UpdateLayerTooltips(conn, "Library://Path/To/My/Layers/",
"MyNewTooltipExpression")



- Jackie



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Python-user-scripts-for-MapGuide-Maestro-5-0-tp5067941p5144349.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to