<?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 Problems when updating metadata properties via cmislib in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32055#M13567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Have you tried to update properties via CMIS after a repo.query with python cmislib ?&amp;nbsp;&lt;BR /&gt;I created a little script that searchs for two documents (kk.txt and kk3.txt) and&amp;nbsp;tries to set / update a property on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that someDoc.updateProperties(props) should work, where props are the proper dictionary for the properties. But I don't see what's wrong in the second&amp;nbsp;case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG&gt;# This part works&lt;/STRONG&gt;&lt;BR /&gt; docu = repo.getObjectByPath('/Test/kk.txt')&lt;BR /&gt; print docu&lt;BR /&gt; props = {'cmis:name': 'kk2.txt'}&lt;BR /&gt; docu.updateProperties(props)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# This results in error&lt;/STRONG&gt;&lt;BR /&gt; results = repo.query("SELECT * FROM cmis:document where cmis:name = 'kk3.txt' ")&lt;BR /&gt; someDoc = results[0]&lt;BR /&gt; print someDoc&lt;BR /&gt; props = {'cmis:name': 'kk4.txt'}&lt;BR /&gt; someDoc.updateProperties(props)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;File "simple.py", line 35, in &amp;lt;module&amp;gt;&lt;BR /&gt; someDoc.updateProperties(props)&lt;BR /&gt; File "/usr/lib/python2.6/site-packages/cmislib_alfresco_extension-0.3.2-py2.6.egg/cmislibalf/extension.py", line 185, in updateProperties&lt;BR /&gt; selfUrl = self._getSelfLink()&lt;BR /&gt; File "/usr/lib/python2.6/site-packages/cmislib-0.5.1-py2.6.egg/cmislib/model.py", line 2169, in _getSelfLink&lt;BR /&gt; &lt;STRONG&gt;assert len(url) &amp;gt; 0, "Could not determine the self link."&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;TypeError: object of type 'NoneType' has no len()&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I see no problems on permissions or allowable actions. Did I miss something ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I use cmis 0.5.1 library with Alfresco 4.2.6 EE and CMIS 1.1 endpoint&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;--C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Mar 2017 14:09:26 GMT</pubDate>
    <dc:creator>cesarista</dc:creator>
    <dc:date>2017-03-31T14:09:26Z</dc:date>
    <item>
      <title>Problems when updating metadata properties via cmislib</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32055#M13567</link>
      <description>Hi:Have you tried to update properties via CMIS after a repo.query with python cmislib ?&amp;nbsp;I created a little script that searchs for two documents (kk.txt and kk3.txt) and&amp;nbsp;tries to set / update a property on it.It seems that someDoc.updateProperties(props) should work, where props are the proper dict</description>
      <pubDate>Fri, 31 Mar 2017 14:09:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32055#M13567</guid>
      <dc:creator>cesarista</dc:creator>
      <dc:date>2017-03-31T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when updating metadata properties via cmislib</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32056#M13568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wasn't there a bug in 0.5.1 with Alfresco cmis, returning less elements than expected on repo.query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried iterating over result and accessing name as property of the element ( for result in results: print result.name )?&lt;/P&gt;&lt;P&gt;Maybe that helps...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 16:36:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32056#M13568</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-03-31T16:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when updating metadata properties via cmislib</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32057#M13569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Martin, it is quite strange. I didn't lose elements. Iterating over the result does not help... it seems that the objects resulting from repo.query is somehow different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I walkarounded doing an extra repo.getObject query with the results of the repo.query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;results = repo.query("SELECT * FROM cmis:document where cmis:name = 'kk3.txt' ")&lt;BR /&gt;#someDoc = results[0]&lt;/P&gt;&lt;P&gt;someDoc = repo.getObject('workspace://SpacesStore/'+results[0].id)&lt;BR /&gt;print someDoc&lt;BR /&gt;pprint(someDoc)&lt;BR /&gt;props = {'cmis:name': 'kk4.txt'}&lt;BR /&gt;someDoc.updateProperties(props)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It is for 2M documents so I'll lose some time in the extra query &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;--C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 19:02:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32057#M13569</guid>
      <dc:creator>cesarista</dc:creator>
      <dc:date>2017-03-31T19:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when updating metadata properties via cmislib</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32058#M13570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cesar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it MUST be the version problem, even if the document is not versioned. Try&lt;/P&gt;&lt;P&gt;someDoc=results[0].getLatestVersion()&lt;/P&gt;&lt;P&gt;Hope it works...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 19:45:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32058#M13570</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-03-31T19:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problems when updating metadata properties via cmislib</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32059#M13571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works like a charm Martin, thank you very much.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;--C.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 23:17:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problems-when-updating-metadata-properties-via-cmislib/m-p/32059#M13571</guid>
      <dc:creator>cesarista</dc:creator>
      <dc:date>2017-03-31T23:17:31Z</dc:date>
    </item>
  </channel>
</rss>

