<?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: Not able to set custom aspect property on document in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67325#M22494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must set the secondary type (aspect) before setting the properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://chemistry.apache.org/docs/cmis-samples/samples/properties/index.html#setting-secondary-types" rel="nofollow noopener noreferrer"&gt;https://chemistry.apache.org/docs/cmis-samples/samples/properties/index.html#setting-secondary-types&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2018 08:25:27 GMT</pubDate>
    <dc:creator>angelborroy</dc:creator>
    <dc:date>2018-08-29T08:25:27Z</dc:date>
    <item>
      <title>Not able to set custom aspect property on document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67324#M22493</link>
      <description>Hi,&amp;nbsp;I am currently using CMIS to create documents. I see lot of examples that update for aspect properties or custom properties on the document by updating the properties map and passing it to createDocument APIDo these documents&amp;nbsp;need to have any aspect associated upfront&amp;nbsp;before I set&amp;nbsp;a custom prope</description>
      <pubDate>Wed, 29 Aug 2018 07:59:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67324#M22493</guid>
      <dc:creator>kartech11</dc:creator>
      <dc:date>2018-08-29T07:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set custom aspect property on document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67325#M22494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must set the secondary type (aspect) before setting the properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://chemistry.apache.org/docs/cmis-samples/samples/properties/index.html#setting-secondary-types" rel="nofollow noopener noreferrer"&gt;https://chemistry.apache.org/docs/cmis-samples/samples/properties/index.html#setting-secondary-types&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 08:25:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67325#M22494</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-08-29T08:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set custom aspect property on document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67326#M22495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;Angel Borroy&lt;/B&gt;‌ - Thanks a lot for the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What will happen if I have two secondary types with different namespace but the same property name. In the below example from the link that you have provided, the secondary type gets added with namespace&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ropertyname but when the property is set it is set without the namespace. So if I have two namespace custom1 and custom2 and they have property called classification, how do I set it in the properties for both these namespaces&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;Map&amp;lt;String, Object&amp;gt; properties = &lt;/SPAN&gt;&lt;SPAN class="" style="color: #333333; background-color: #fcfdff; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt; HashMap&amp;lt;String, Object&amp;gt;(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #999988; background-color: #fcfdff;"&gt;// add the new secondary type&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;secondaryTypes.add(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144; background-color: #fcfdff;"&gt;"custom:classification"&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;properties.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, secondaryTypes); &lt;/SPAN&gt;&lt;SPAN class="" style="color: #999988; background-color: #fcfdff;"&gt;// set secondary type property&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;properties.put(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144; background-color: #fcfdff;"&gt;"classification"&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #dd1144; background-color: #fcfdff;"&gt;"public"&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #fcfdff;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 10:06:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67326#M22495</guid>
      <dc:creator>kartech11</dc:creator>
      <dc:date>2018-08-29T10:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set custom aspect property on document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67327#M22496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add also your prefix to property name, something like "custom:classification"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample for Alfresco available at:&amp;nbsp;&lt;A href="https://gist.github.com/jpotts/7242070" rel="nofollow noopener noreferrer"&gt;https://gist.github.com/jpotts/7242070&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 10:09:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67327#M22496</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-08-29T10:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to set custom aspect property on document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67328#M22497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how I am doing while uploading a document with properties. Sometimes the version of CMIS API might matter to the way we do things. I am using CMIS 1.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My pom dependency&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt;&amp;lt;dependency&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt; &amp;lt;groupId&amp;gt;org.apache.chemistry.opencmis&amp;lt;/groupId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt; &amp;lt;artifactId&amp;gt;chemistry-opencmis-client-api&amp;lt;/artifactId&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt; &amp;lt;version&amp;gt;&lt;STRONG&gt;0.13.0&lt;/STRONG&gt;&amp;lt;/version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt; &amp;lt;/dependency&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And my CMIS API endpoint&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'comic sans ms', sans-serif;"&gt;ttp://alfresco-server:8180/alfresco/api/-default-/public/cmis/versions/&lt;STRONG&gt;1.1&lt;/STRONG&gt;/atom&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code extract:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HashMap&amp;lt;String, Object&amp;gt; &lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties &lt;/STRONG&gt;= new HashMap&amp;lt;String, Object&amp;gt;();&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties&lt;/STRONG&gt;.put("&lt;STRONG&gt;cmis&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;bjectTypeId&lt;/STRONG&gt;", "&lt;STRONG&gt;D:slo:mdocument&lt;/STRONG&gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;String&amp;gt; secondaryTypes = new ArrayList&amp;lt;String&amp;gt;();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;secondaryTypes.add("&lt;STRONG&gt;P:slo:documentProperties&lt;/STRONG&gt;");&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties&lt;/STRONG&gt;.put("&lt;STRONG&gt;cmis:secondaryObjectTypeIds&lt;/STRONG&gt;", secondaryTypes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties&lt;/STRONG&gt;.put("&lt;STRONG&gt;slo:m_link&lt;/STRONG&gt;", value);&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties&lt;/STRONG&gt;.put("&lt;STRONG&gt;slo:m_category&lt;/STRONG&gt;", value);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InputStream stream = null;&lt;BR /&gt;byte[] content = mDocument.getBData();&lt;BR /&gt;stream = new ByteArrayInputStream(content);&lt;BR /&gt;ContentStream contentStream = cmisSession.getObjectFactory().createContentStream(&lt;BR /&gt;mDocument.getFileName(), Long.valueOf(content.length), mimeType, stream);&lt;BR /&gt;insertedDocument = entityFolder.createDocument(&lt;STRONG style="font-family: 'courier new', courier, monospace;"&gt;cmisDocumentProperties&lt;/STRONG&gt;, contentStream, VersioningState.MAJOR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My custom model xml:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;types&amp;gt;&lt;BR /&gt;&amp;lt;!-- custom document type --&amp;gt;&lt;BR /&gt;&amp;lt;type name="&lt;STRONG&gt;slo:mdocument&lt;/STRONG&gt;"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;SLO Document type&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;lt;parent&amp;gt;cm:content&amp;lt;/parent&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;!-- associations section - no associations as of now --&amp;gt;&lt;BR /&gt; &amp;lt;!-- aspect is defined to hold all the properties --&amp;gt;&lt;BR /&gt; &amp;lt;mandatory-aspects&amp;gt;&lt;BR /&gt; &amp;lt;&lt;STRONG&gt;aspect&lt;/STRONG&gt;&amp;gt;&lt;STRONG&gt;slo:documentProperties&lt;/STRONG&gt;&amp;lt;/aspect&amp;gt;&lt;BR /&gt; &amp;lt;/mandatory-aspects&amp;gt;&lt;BR /&gt;&amp;lt;/type&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/types&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;aspects&amp;gt;&lt;BR /&gt;&amp;lt;!-- There is one aspect with all the custom properties defined --&amp;gt;&lt;BR /&gt;&amp;lt;&lt;STRONG&gt;aspect&lt;/STRONG&gt; name="&lt;STRONG&gt;slo:documentProperties&lt;/STRONG&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;m document properties&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;properties&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;property name="&lt;STRONG&gt;slo:m_category&lt;/STRONG&gt;"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Category&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="&lt;STRONG&gt;slo:m_link&lt;/STRONG&gt;"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Link ID&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;lt;type&amp;gt;d:int&amp;lt;/type&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2018 15:58:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/not-able-to-set-custom-aspect-property-on-document/m-p/67328#M22497</guid>
      <dc:creator>sepgs2004</dc:creator>
      <dc:date>2018-08-30T15:58:43Z</dc:date>
    </item>
  </channel>
</rss>

