<?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 Re: Enable Sync capability on a read-only feature service with Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492011#M38558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, so I have finally gotten to the bottom of this. Turns out that when parsing the xml document of the sddraft to enable feature access&amp;nbsp;web capabilities, as enumerated in the Esri help guide for ArcPy (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm"&gt;CreateMapSDDraft—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;), grabbing the dom element by tag name 'Info' at index &lt;STRONG&gt;[0]&lt;/STRONG&gt; returns the&amp;nbsp;&lt;STRONG&gt;Mapping&lt;/STRONG&gt; capabilities for the service (which are set to Data, Map, Query by default), and not the actual&amp;nbsp;&lt;STRONG&gt;Feature Access&lt;/STRONG&gt; capabilities for editing and syncing. The correct index (inside the portion of the following screenshot highlighted in red) should actually be &lt;STRONG&gt;[7]&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/216929_pastedImage_538.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is, if you are doing your parsing&amp;nbsp;with xml.minidom like the guide shows. I actually changed my code to use xml.etree instead of xml.minidom to parse the sddraft, so for me the index was [6], but&amp;nbsp;I coded it to exclude the first instance of the tag 'Info' since it was not a child of the tags in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how many people will run into this again, but Esri may want to update their help guide &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Greg Smith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Aug 2016 22:22:38 GMT</pubDate>
    <dc:creator>GregSmith2</dc:creator>
    <dc:date>2016-08-18T22:22:38Z</dc:date>
    <item>
      <title>Enable Sync capability on a read-only feature service with Python</title>
      <link>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492008#M38555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have written a Python script tool that publishes map services for my organization. It works great, except that I am trying to publish read-only feature services with the "Sync" capability for offline mobile use. After following examples from Esri/other forums, I set the capabilities in my script by parsing the service definition draft as an xml document, as shown here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #808080;"&gt;# turn on feature access if service is editable&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;service.endswith(&lt;SPAN style="color: #a5c261;"&gt;"Editable"&lt;/SPAN&gt;) &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;or &lt;/SPAN&gt;service.endswith(&lt;SPAN style="color: #a5c261;"&gt;"Redlining"&lt;/SPAN&gt;) &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;or &lt;/SPAN&gt;allowSync:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; featAccessSettings = doc.getElementsByTagName(&lt;SPAN style="color: #a5c261;"&gt;"TypeName"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;featAccessSetting &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;featAccessSettings:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;featAccessSetting.firstChild.data == &lt;SPAN style="color: #a5c261;"&gt;"FeatureServer"&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; featAccessSetting.parentNode.getElementsByTagName(&lt;SPAN style="color: #a5c261;"&gt;"Enabled"&lt;/SPAN&gt;)[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].firstChild.data = &lt;SPAN style="color: #a5c261;"&gt;"true"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;configProps = doc.getElementsByTagName(&lt;SPAN style="color: #a5c261;"&gt;"Info"&lt;/SPAN&gt;)[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;]&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; propArray = configProps.firstChild&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; propSets = propArray.childNodes&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;propSet &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;propSets:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; keyValues = propSet.childNodes&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;keyValue &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;keyValues:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;keyValue.tagName == &lt;SPAN style="color: #a5c261;"&gt;"Key"&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;keyValue.firstChild.data == &lt;SPAN style="color: #a5c261;"&gt;"WebCapabilities"&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;(service.endswith(&lt;SPAN style="color: #a5c261;"&gt;"Editable"&lt;/SPAN&gt;)) &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;or &lt;/SPAN&gt;(service.endswith(&lt;SPAN style="color: #a5c261;"&gt;"Redlining"&lt;/SPAN&gt;)):&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; keyValue.nextSibling.firstChild.data == &lt;SPAN style="color: #a5c261;"&gt;"Query,Create,Update,Delete,Uploads,Editing"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;else&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp; keyValue.nextSibling.firstChild.data == &lt;SPAN style="color: #a5c261;"&gt;"Query,Sync"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the last line, to create a read-only feature service (according to this guide: &lt;A href="http://server.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use.htm" title="http://server.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use.htm"&gt;Prepare data for offline use—Documentation | ArcGIS for Server&lt;/A&gt; ), I set the web capabilities to only &lt;STRONG&gt;Query and Sync&lt;/STRONG&gt;, but when the tool completes running, the publish service still has full editing capabilities and Sync disabled. If I try to publish the service with the user interface inside ArcMap or ArcCatalog, the web capability settings come across correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another parameter that needs to be set programmatically, that I am missing here? I know the data has to be configured correctly to use Sync, but again, the data I've been testing with works fine when published though the UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2016 21:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492008#M38555</guid>
      <dc:creator>GregSmith2</dc:creator>
      <dc:date>2016-08-09T21:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Enable Sync capability on a read-only feature service with Python</title>
      <link>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492009#M38556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An alternative method is to disable editing on AGOL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 02:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492009#M38556</guid>
      <dc:creator>JeffSegal</dc:creator>
      <dc:date>2016-08-11T02:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Enable Sync capability on a read-only feature service with Python</title>
      <link>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492010#M38557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response! I probably should have clarified- the services my tool handles are not being published to AGOL. Rather, the tool publishes to my organization's ArcGIS Server. Unfortunately, I cannot disable edits across the board because some of our services being published do need to have editing capabilities. My tool iterates through multiple map documents in a batch, so that is why I am trying to have the option to enable sync on specified ones, to avoid any additional configuration after the fact.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 16:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492010#M38557</guid>
      <dc:creator>GregSmith2</dc:creator>
      <dc:date>2016-08-11T16:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Enable Sync capability on a read-only feature service with Python</title>
      <link>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492011#M38558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, so I have finally gotten to the bottom of this. Turns out that when parsing the xml document of the sddraft to enable feature access&amp;nbsp;web capabilities, as enumerated in the Esri help guide for ArcPy (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm"&gt;CreateMapSDDraft—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;), grabbing the dom element by tag name 'Info' at index &lt;STRONG&gt;[0]&lt;/STRONG&gt; returns the&amp;nbsp;&lt;STRONG&gt;Mapping&lt;/STRONG&gt; capabilities for the service (which are set to Data, Map, Query by default), and not the actual&amp;nbsp;&lt;STRONG&gt;Feature Access&lt;/STRONG&gt; capabilities for editing and syncing. The correct index (inside the portion of the following screenshot highlighted in red) should actually be &lt;STRONG&gt;[7]&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/216929_pastedImage_538.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is, if you are doing your parsing&amp;nbsp;with xml.minidom like the guide shows. I actually changed my code to use xml.etree instead of xml.minidom to parse the sddraft, so for me the index was [6], but&amp;nbsp;I coded it to exclude the first instance of the tag 'Info' since it was not a child of the tags in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how many people will run into this again, but Esri may want to update their help guide &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Greg Smith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 22:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enable-sync-capability-on-a-read-only-feature/m-p/492011#M38558</guid>
      <dc:creator>GregSmith2</dc:creator>
      <dc:date>2016-08-18T22:22:38Z</dc:date>
    </item>
  </channel>
</rss>

