<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Service Properties Layer and Table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/service-properties-layer-and-table/m-p/376982#M29766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am making a script that will find, primarily, database (sde) connection information for each layer and table view within each mxd&amp;nbsp;that has been published as a service across a number of ArcGIS servers. Then it inserts the info back into an Oracle&amp;nbsp;table. This is to help with administration. So, I have it working for layers via the service properties attribute. But I don't see a service properties like attribute for a table view object? How can I get database user name (for DBA connections) and the database server for tables in an mxd?&amp;nbsp;The only thing I see like this is the table data source.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/tableview-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/tableview-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TableView—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Layer—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see my two functions&amp;nbsp;below. The working layers one and the table view outline...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;find_conn_prop_tbl&lt;/SPAN&gt;(mxd_source):
    &lt;SPAN style="color: #808080;"&gt;ags &lt;/SPAN&gt;= mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;].split(os.path.sep)[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;ags_service &lt;/SPAN&gt;= os.path.basename(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;])[:-&lt;SPAN style="color: #6897bb;"&gt;4&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;ags_service_path &lt;/SPAN&gt;= mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;toc_type &lt;/SPAN&gt;= &lt;SPAN style="color: #a5c261;"&gt;'table_view'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;mxd = arcpy.mapping.MapDocument(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.mapping.ListDataFrames(mxd):
        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
            &lt;SPAN style="color: #808080;"&gt;data_frame_name &lt;/SPAN&gt;= df.name
            table_list = arcpy.mapping.ListTableViews(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df)
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;table_list &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
                &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;table &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;table_list:
                    &lt;SPAN style="color: #808080;"&gt;# ?????????
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;table
            &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;table_list
    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df


&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;find_conn_prop_fc&lt;/SPAN&gt;(mxd_source):
    ags = mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;].split(os.path.sep)[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]
    ags_service = os.path.basename(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;])[:-&lt;SPAN style="color: #6897bb;"&gt;4&lt;/SPAN&gt;]
    ags_service_path = mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;]
    toc_type = &lt;SPAN style="color: #a5c261;"&gt;'layer'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;mxd = arcpy.mapping.MapDocument(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.mapping.ListDataFrames(mxd):
        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
            data_frame_name = df.name
            layer_list = arcpy.mapping.ListLayers(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df)
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;layer_list &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
                &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;layer &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;layer_list:
                    &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;layer.supports(&lt;SPAN style="color: #a5c261;"&gt;'SERVICEPROPERTIES'&lt;/SPAN&gt;):
                        toc_path = layer.longName
                        prop_dict = layer.serviceProperties
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS'&lt;/SPAN&gt;] = ags
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS_Service'&lt;/SPAN&gt;] = ags_service
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS_Service_Path'&lt;/SPAN&gt;] = ags_service_path
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'TOC_Path'&lt;/SPAN&gt;] = toc_path
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'TOC_Type'&lt;/SPAN&gt;] = toc_type
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'Data_Frame'&lt;/SPAN&gt;] = data_frame_name
                        oracle_injector.inject(prop_dict)
                    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;layer
            &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;layer_list
    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:24:32 GMT</pubDate>
    <dc:creator>forestknutsen1</dc:creator>
    <dc:date>2021-12-11T17:24:32Z</dc:date>
    <item>
      <title>Service Properties Layer and Table</title>
      <link>https://community.esri.com/t5/python-questions/service-properties-layer-and-table/m-p/376982#M29766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am making a script that will find, primarily, database (sde) connection information for each layer and table view within each mxd&amp;nbsp;that has been published as a service across a number of ArcGIS servers. Then it inserts the info back into an Oracle&amp;nbsp;table. This is to help with administration. So, I have it working for layers via the service properties attribute. But I don't see a service properties like attribute for a table view object? How can I get database user name (for DBA connections) and the database server for tables in an mxd?&amp;nbsp;The only thing I see like this is the table data source.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/tableview-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/tableview-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TableView—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Layer—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see my two functions&amp;nbsp;below. The working layers one and the table view outline...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;find_conn_prop_tbl&lt;/SPAN&gt;(mxd_source):
    &lt;SPAN style="color: #808080;"&gt;ags &lt;/SPAN&gt;= mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;].split(os.path.sep)[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;ags_service &lt;/SPAN&gt;= os.path.basename(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;])[:-&lt;SPAN style="color: #6897bb;"&gt;4&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;ags_service_path &lt;/SPAN&gt;= mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;toc_type &lt;/SPAN&gt;= &lt;SPAN style="color: #a5c261;"&gt;'table_view'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;mxd = arcpy.mapping.MapDocument(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.mapping.ListDataFrames(mxd):
        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
            &lt;SPAN style="color: #808080;"&gt;data_frame_name &lt;/SPAN&gt;= df.name
            table_list = arcpy.mapping.ListTableViews(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df)
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;table_list &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
                &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;table &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;table_list:
                    &lt;SPAN style="color: #808080;"&gt;# ?????????
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;table
            &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;table_list
    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df


&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;find_conn_prop_fc&lt;/SPAN&gt;(mxd_source):
    ags = mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;].split(os.path.sep)[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]
    ags_service = os.path.basename(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;])[:-&lt;SPAN style="color: #6897bb;"&gt;4&lt;/SPAN&gt;]
    ags_service_path = mxd_source[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;]
    toc_type = &lt;SPAN style="color: #a5c261;"&gt;'layer'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;mxd = arcpy.mapping.MapDocument(mxd_source[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.mapping.ListDataFrames(mxd):
        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;df &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
            data_frame_name = df.name
            layer_list = arcpy.mapping.ListLayers(mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df)
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;layer_list &lt;SPAN style="color: #cc7832;"&gt;is not &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;None&lt;/SPAN&gt;:
                &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;layer &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;layer_list:
                    &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;layer.supports(&lt;SPAN style="color: #a5c261;"&gt;'SERVICEPROPERTIES'&lt;/SPAN&gt;):
                        toc_path = layer.longName
                        prop_dict = layer.serviceProperties
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS'&lt;/SPAN&gt;] = ags
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS_Service'&lt;/SPAN&gt;] = ags_service
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'AGS_Service_Path'&lt;/SPAN&gt;] = ags_service_path
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'TOC_Path'&lt;/SPAN&gt;] = toc_path
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'TOC_Type'&lt;/SPAN&gt;] = toc_type
                        prop_dict[&lt;SPAN style="color: #a5c261;"&gt;'Data_Frame'&lt;/SPAN&gt;] = data_frame_name
                        oracle_injector.inject(prop_dict)
                    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;layer
            &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;layer_list
    &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;mxd&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;df&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/service-properties-layer-and-table/m-p/376982#M29766</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2021-12-11T17:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Service Properties Layer and Table</title>
      <link>https://community.esri.com/t5/python-questions/service-properties-layer-and-table/m-p/376983#M29767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any thoughts on this one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2019 20:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/service-properties-layer-and-table/m-p/376983#M29767</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2019-02-25T20:45:49Z</dc:date>
    </item>
  </channel>
</rss>

