<?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: Loading secondary types in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100916#M29065</link>
    <description>&lt;P&gt;Sadly, it doesn't seem to work&lt;/P&gt;</description>
    <pubDate>Tue, 18 Aug 2020 08:47:06 GMT</pubDate>
    <dc:creator>BenceKovacs</dc:creator>
    <dc:date>2020-08-18T08:47:06Z</dc:date>
    <item>
      <title>Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100914#M29063</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I'm using the Apache chemistry opencmis library to interact with Alfresco. To query documents there is a method called queryObjects, which takes in an OperationContext as an argument. On this context, I can set a boolean flag, called&amp;nbsp;setLoadSecondaryTypeProperties. However, even if I set it to true, it won't return the secondary type properties. I can only reach those properties if i use a SELECT query and join the two "tables" together on 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;bjectId.&lt;/P&gt;&lt;P&gt;The problem is, that the select query doesn't return cmis Document types, it returns QueryResult types, and it can't be casted, and I really need the Document.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Am I missing something here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Bence&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:02:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100914#M29063</guid>
      <dc:creator>BenceKovacs</dc:creator>
      <dc:date>2020-08-17T10:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100915#M29064</link>
      <description>&lt;P&gt;You can try&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;operationContext.setFilter(null);&lt;/PRE&gt;&lt;P&gt;It means select all properties from query type&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 14:55:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100915#M29064</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2020-08-17T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100916#M29065</link>
      <description>&lt;P&gt;Sadly, it doesn't seem to work&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 08:47:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100916#M29065</guid>
      <dc:creator>BenceKovacs</dc:creator>
      <dc:date>2020-08-18T08:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100917#M29066</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;Could you paste your code here ?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;what params did you pass to&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt; queryObjects(String typeId, String where, boolean searchAllVersions,
            OperationContext context);&lt;/PRE&gt;&lt;FONT&gt;Have you tried to pass typeId your specified type instead of cmis:document/cmis:folder?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Aug 2020 09:00:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100917#M29066</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2020-08-18T09:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100918#M29067</link>
      <description>&lt;P&gt;Yes, we have a custom type derived from cmis:document, lets call it invoiceScan&lt;/P&gt;&lt;PRE&gt;final OperationContext ctx = OperationContextUtils.createMaximumOperationContext();
		ctx.setLoadSecondaryTypeProperties(true);
		ctx.setFilter(null);
		
		final ItemIterable&amp;lt;CmisObject&amp;gt; result = session.queryObjects(
				"invoiceScan",
				"cmis:name = 'testName'",
				false,
				ctx);&lt;/PRE&gt;&lt;P&gt;This way i get back the desired document and all the properties from our specified custom type, i can see the "SecondaryTypeIds" property too, but i dont't get the properties OF the secondary type.&lt;/P&gt;&lt;P&gt;I've tried creating the minimum operation context, the maximum, the default from the OperationContextUtils aswell.&lt;/P&gt;&lt;P&gt;Now i use cmis:name in the where clause, but I'll want to use secondary type properties there if i somehow manage to get them.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 09:52:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100918#M29067</guid>
      <dc:creator>BenceKovacs</dc:creator>
      <dc:date>2020-08-18T09:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100919#M29068</link>
      <description>&lt;P&gt;I have tested it ,you are right,it did not work.The only opiton you can choose is to use session.query which returns QueryResult.&lt;BR /&gt;then you can iterate the query result and load the document one by one , or you can use session.queryObjects to batch query documents by uuids&lt;BR /&gt;If you want to use aspect properties ,you can get from QueryResult&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 04:03:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100919#M29068</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2020-08-19T04:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Loading secondary types</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100920#M29069</link>
      <description>&lt;P&gt;Thanks for your help! Currently I use session.query, then iterate over the result. Didn't wanted to use this method as I have to make severaly trips to the repository, but i have to, as I need to query these result by a secondary type property.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 06:43:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/loading-secondary-types/m-p/100920#M29069</guid>
      <dc:creator>BenceKovacs</dc:creator>
      <dc:date>2020-08-19T06:43:48Z</dc:date>
    </item>
  </channel>
</rss>

