Retrieve "documentInfo" in a Map Service

965
6
Jump to solution
03-03-2012 10:03 PM
ArgoonChuang
New Contributor II
Hi,

I would like to retrieve the â??documentInfoâ?? properties of a map service. In its JSON I can see these values, i.e. author, keywords, credits etc (see below for example). How can I get these properties through the Flex API ?

Iâ??ve looked through the packages below but couldn't find it. I am expecting something like "(_layer as ArcGISDynamicMapServiceLayer).copyright" for the "service" level instead of "serviceLayer" level. Or I need to use the URL to get the JSON and then parse it anyway ?
- com.esri.ags.layers
- com.esri.ags.layers.supportClasses

Many thanks,
AG

{
  "currentVersion" : 10.03, 
  "serviceDescription" : null, 
  "mapName" : "Layers", 
  "description" : "", 
  "copyrightText" : "", 
  "layers" : [
    {
      "id" : 0, 
      "name" : "Borehole", 
      "parentLayerId" : -1, 
      "defaultVisibility" : true, 
      "subLayerIds" : null, 
      "minScale" : 25000, 
      "maxScale" : 15000
    }, 
    {
      "id" : 1, 
      "name" : "Borehole", 
      "parentLayerId" : -1, 
      "defaultVisibility" : true, 
      "subLayerIds" : null, 
      "minScale" : 15000, 
      "maxScale" : 6000
    }, 
  ], 
  "tables" : [
    
  ], 
  "spatialReference" : {
    "wkid" : 102100
  }, 
  "singleFusedMapCache" : false, 
  "initialExtent" : {
    "xmin" : 12708816.0155975, 
    "ymin" : 2548059.09125177, 
    "xmax" : 12712094.2096539, 
    "ymax" : 2550095.06407371, 
    "spatialReference" : {
      "wkid" : 102100
    }
  }, 
  "fullExtent" : {
    "xmin" : 12703415.4431405, 
    "ymin" : 2540388.24401408, 
    "xmax" : 12714214.9151815, 
    "ymax" : 2556966.94286627, 
    "spatialReference" : {
      "wkid" : 102100
    }
  }, 
  "units" : "esriMeters", 
  "supportedImageFormatTypes" : "PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP", 
  "documentInfo" : {
    "Title" : "title", 
    "Author" : "author", 
    "Comments" : "description", 
    "Subject" : "summary", 
    "Category" : "", 
    "Keywords" : "tag", 
    "Credits" : "credit", 
    "AntialiasingMode" : "None", 
    "TextAntialiasingMode" : "Force"
  }, 
  "capabilities" : "Map,Query,Data"
}
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Argoon,

   So here is a sample of how you have a call using httpService and parse the JSON results.  Maybe this will get you started.

http://forums.arcgis.com/threads/1974-How-do-you-determine-supported-operations-for-a-service-in-cod...

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:

View solution in original post

0 Kudos
6 Replies
MarkHoyland
Occasional Contributor II
Looks as though those details are not available from the api.
I think you would have to parse the json.

API reference:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html
0 Kudos
CalvinDwight
New Contributor
I think you would have to parse the json.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Argoon,

   So here is a sample of how you have a call using httpService and parse the JSON results.  Maybe this will get you started.

http://forums.arcgis.com/threads/1974-How-do-you-determine-supported-operations-for-a-service-in-cod...

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
ArgoonChuang
New Contributor II
Excellent! Exactly what I need.
Thanks so much Robert, as well as others confirmed my guess.

Got another question here related to "documentInfo", nothing about codes this time...

For the "documentInfo" in MapService, I understand it can be defined via the published MXD in the �??Map Document Properties�?� as shown below (though not perfectly match).

[ATTACH=CONFIG]12435[/ATTACH]  [ATTACH=CONFIG]12436[/ATTACH]

What about �??Description�?� and �?�Copyright Text�?� shown in the REST? Where/how can I set these properties ?

[ATTACH=CONFIG]12437[/ATTACH]

Many Thanks,
AG
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Argoon,


   The "Description" is coming from the Description block of the Data Frame Properties in ArcMap and the Copyright comes from the Credits in the Data Frame Properties.
0 Kudos
ArgoonChuang
New Contributor II
Brilliant! Cheers Robert.
0 Kudos