AnsweredAssumed Answered

Problems querying relationships

Question asked by gressho on Oct 19, 2009
Hello,

I'm using the Alfresco 3.2 Community Edition.
I've managed to create relationships (easy) but fail to query them. I tried several ways and no one leads to results:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200901">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getChildren>
         <ns:repositoryId>e91c97bc-9892-4a82-89da-44485ff8e8d8</ns:repositoryId>
         <ns:folderId>workspace://SpacesStore/f8b9f845-a094-4ca7-87f5-e0afbfe3a9ce</ns:folderId>
         <ns:type>F/ma_organisation</ns:type>
         <ns:filter></ns:filter>
         <ns:includeAllowableActions>false</ns:includeAllowableActions>
         <ns:includeRelationships>true</ns:includeRelationships>
         <ns:maxItems>20</ns:maxItems>
         <ns:skipCount>0</ns:skipCount>
         <!–Optional:–>
         <!–ns:orderBy>?</ns:orderBy–>
      </ns:getChildren>
   </soapenv:Body>
</soapenv:Envelope>

lead s to the answer


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsu:Timestamp wsu:Id="Timestamp-1039863588" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2009-10-19T14:45:37.463Z</wsu:Created>
            <wsu:Expires>2009-10-19T14:50:37.463Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <getChildrenResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200901">
         <ns2:object>
            <ns2:properties>
               <ns2:propertyId ns2:name="ParentId">
                  <ns2:value>workspace://SpacesStore/f8b9f845-a094-4ca7-87f5-e0afbfe3a9ce</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="AllowedChildObjectTypeIds">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyId>
               <ns2:propertyString ns2:name="ma_orgPlace">
                  <ns2:value>Münster</ns2:value>
               </ns2:propertyString>
               <ns2:propertyDateTime ns2:name="CreationDate">
                  <ns2:value>2009-08-24T15:08:59.803+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="LastModifiedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ChangeToken">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgName">
                  <ns2:value>Westfälische Wilhelmsuniversität</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="Name">
                  <ns2:value>Westfälische Wilhelmsuniversität, Münster</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgGKDId">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyUri ns2:name="Uri">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyUri>
               <ns2:propertyDateTime ns2:name="LastModificationDate">
                  <ns2:value>2009-08-24T15:08:59.834+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="CreatedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyId ns2:name="ObjectTypeId">
                  <ns2:value>F/ma_organisation</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="ObjectId">
                  <ns2:value>workspace://SpacesStore/09216551-9d55-444e-a16d-d3be46fcb5b6</ns2:value>
               </ns2:propertyId>
            </ns2:properties>
         </ns2:object>
         <ns2:object>
            <ns2:properties>
               <ns2:propertyId ns2:name="ParentId">
                  <ns2:value>workspace://SpacesStore/f8b9f845-a094-4ca7-87f5-e0afbfe3a9ce</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="AllowedChildObjectTypeIds">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyId>
               <ns2:propertyString ns2:name="ma_orgPlace">
                  <ns2:value>Münster, Westfalen</ns2:value>
               </ns2:propertyString>
               <ns2:propertyDateTime ns2:name="CreationDate">
                  <ns2:value>2009-10-15T15:28:14.558+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="LastModifiedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ChangeToken">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgName">
                  <ns2:value>Universität</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="Name">
                  <ns2:value>Universität [Münster, Westfalen]</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgGKDId">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyUri ns2:name="Uri">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyUri>
               <ns2:propertyDateTime ns2:name="LastModificationDate">
                  <ns2:value>2009-10-16T09:45:44.449+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="CreatedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyId ns2:name="ObjectTypeId">
                  <ns2:value>F/ma_organisation</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="ObjectId">
                  <ns2:value>workspace://SpacesStore/078db532-5d89-4599-835c-818a6c2f8207</ns2:value>
               </ns2:propertyId>
            </ns2:properties>
         </ns2:object>
         <ns2:object>
            <ns2:properties>
               <ns2:propertyId ns2:name="ParentId">
                  <ns2:value>workspace://SpacesStore/f8b9f845-a094-4ca7-87f5-e0afbfe3a9ce</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="AllowedChildObjectTypeIds">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyId>
               <ns2:propertyString ns2:name="ma_orgPlace">
                  <ns2:value>Münster, Westfalen%Steinfurt</ns2:value>
               </ns2:propertyString>
               <ns2:propertyDateTime ns2:name="CreationDate">
                  <ns2:value>2009-10-15T15:44:36.391+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="LastModifiedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ChangeToken">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgName">
                  <ns2:value>Fachhochschule</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="Name">
                  <ns2:value>Fachhochschule [Münster, Westfalen; Steinfurt]</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgGKDId">
                  <ns2:value/>
               </ns2:propertyString>
               <ns2:propertyUri ns2:name="Uri">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyUri>
               <ns2:propertyDateTime ns2:name="LastModificationDate">
                  <ns2:value>2009-10-16T11:46:54.128+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="CreatedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyId ns2:name="ObjectTypeId">
                  <ns2:value>F/ma_organisation</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="ObjectId">
                  <ns2:value>workspace://SpacesStore/9a500c66-eb5e-4914-bc82-1cb78f616c37</ns2:value>
               </ns2:propertyId>
            </ns2:properties>
         </ns2:object>
         <ns2:object>
            <ns2:properties>
               <ns2:propertyId ns2:name="ParentId">
                  <ns2:value>workspace://SpacesStore/f8b9f845-a094-4ca7-87f5-e0afbfe3a9ce</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="AllowedChildObjectTypeIds">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyId>
               <ns2:propertyString ns2:name="ma_orgPlace">
                  <ns2:value>Münster%Steinfurt</ns2:value>
               </ns2:propertyString>
               <ns2:propertyDateTime ns2:name="CreationDate">
                  <ns2:value>2009-10-19T10:30:23.244+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="LastModifiedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ChangeToken">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgName">
                  <ns2:value>Fachhochschule</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="Name">
                  <ns2:value>Fachhochschule [Münster; Steinfurt]</ns2:value>
               </ns2:propertyString>
               <ns2:propertyString ns2:name="ma_orgGKDId">
                  <ns2:value/>
               </ns2:propertyString>
               <ns2:propertyUri ns2:name="Uri">
                  <ns2:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance'/>
               </ns2:propertyUri>
               <ns2:propertyDateTime ns2:name="LastModificationDate">
                  <ns2:value>2009-10-19T10:30:23.259+02:00</ns2:value>
               </ns2:propertyDateTime>
               <ns2:propertyString ns2:name="CreatedBy">
                  <ns2:value>admin</ns2:value>
               </ns2:propertyString>
               <ns2:propertyId ns2:name="ObjectTypeId">
                  <ns2:value>F/ma_organisation</ns2:value>
               </ns2:propertyId>
               <ns2:propertyId ns2:name="ObjectId">
                  <ns2:value>workspace://SpacesStore/d6829fdb-52b9-474b-a263-accd27aaf0b4</ns2:value>
               </ns2:propertyId>
            </ns2:properties>
         </ns2:object>
         <hasMoreItems>false</hasMoreItems>
      </getChildrenResponse>
   </soap:Body>
</soap:Envelope>

The elements workspace://SpacesStore/d6829fdb-52b9-474b-a263-accd27aaf0b4 and workspace://SpacesStore/9a500c66-eb5e-4914-bc82-1cb78f616c37
have a relation which I can see with the node browser in the alfresco explorer.

The request


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200901">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getRelationships>
         <ns:repositoryId>e91c97bc-9892-4a82-89da-44485ff8e8d8</ns:repositoryId>
         <ns:objectId>workspace://SpacesStore/9a500c66-eb5e-4914-bc82-1cb78f616c37</ns:objectId>
         <ns:typeId>R/ma_orgSuccessorOf</ns:typeId>
         <ns:maxItems>10</ns:maxItems>
         <ns:skipCount>0</ns:skipCount>
      </ns:getRelationships>
   </soapenv:Body>
</soapenv:Envelope>

leads to


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsu:Timestamp wsu:Id="Timestamp-578416978" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2009-10-19T14:42:31.568Z</wsu:Created>
            <wsu:Expires>2009-10-19T14:47:31.568Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <getRelationshipsResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200901">
         <hasMoreItems>false</hasMoreItems>
      </getRelationshipsResponse>
   </soap:Body>
</soap:Envelope>

so I don't see a way to query relations.
Is there a solution (update to 3.2r), am I missing something?

Best wishes

Werner

Outcomes