cancel
Showing results for 
Search instead for 
Did you mean: 

Relationship

menza
Champ in-the-making
Champ in-the-making
Hello together,

I am trying to do some work using the CMIS interface. I stumbled upon the problem that programatically, I do not see any Relationships, even when the repository browser displays them:

Repository:
RelationshipSource Id   Target Idworkspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121df;1.0   workspace://SpacesStore/018675d0-7841-48af-9867-95f8471e9924;1.0Propertiescmis:targetId   workspace://SpacesStore/018675d0-7841-48af-9867-95f8471e9924;1.0cmis:objectTypeId   R:ws:primaryImagecmis:lastModifiedBy   admincmis:sourceId   workspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121df;1.0cmis:name   75714|workspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121df|workspace://SpacesStore/018675d0-7841-48af-9867-95f8471e9924|{http://www.alfresco.org/model/website/1.0}primaryImagecmis:createdBy   admincmis:objectId   assoc:75714cmis:creationDate   2010-05-01T00:00:00.000+02:00cmis:changeToken   cmis:baseTypeId   cmis:relationshipalfcmis:nodeRef   75714|workspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121df|workspace://SpacesStore/018675d0-7841-48af-9867-95f8471e9924|{http://www.alfresco.org/model/website/1.0}primaryImagecmis:lastModificationDate   2010-05-01T00:00:00.000+02:00‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


I use the following java code:
                CmisObject doc = null;      try {          doc = ses.getObjectByPath("/Sites/wcmqs/documentLibrary/Alfresco Quick Start/Quick Start Editorial/root/news/global/article3.html",                           context);      }      catch (Exception e) {         System.err.println("not authorized");      }               System.out.println(doc.getAllowableActions().toString());            // cast to document      Document document = (Document) doc;            System.out.println("————————————–");      System.out.println("          Properties");      System.out.println("————————————–");      for (PropertyData<?> property : doc.getProperties()) {          String queryName = property.getQueryName();              Object value = property.getFirstValue();              System.out.println(queryName + ": " + value);      }            System.out.println("————————————–");      System.out.println("          Relationships");      System.out.println("————————————–");      for (Relationship rel : doc.getRelationships()) {         System.out.println("Name: " + rel.getName());                   for (PropertyData<?> property : rel.getProperties()) {             String queryName = property.getQueryName();                 Object value = property.getFirstValue();                 System.out.println(queryName + ": " + value);         }                    }      System.out.println("————————————–");‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


getting this result:
————————————–          Properties————————————–cmis:contentStreamLength: 3247cmis:objectTypeId: D:ws:articlecmis:versionSeriesCheckedOutBy: nullcmis:versionSeriesCheckedOutId: nullcmis:versionSeriesId: workspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121dfcmis:isLatestVersion: truecmis:versionLabel: 0.0cmis:isVersionSeriesCheckedOut: falsecmis:lastModifiedBy: admincmis:createdBy: adminalfcmis:nodeRef: nullcmis:isLatestMajorVersion: falsecmis:contentStreamId: store://2012/11/6/14/44/bae919c5-6bf7-4f04-83e9-27fcca541943.bincmis:name: article3.htmlcmis:contentStreamMimeType: text/htmlcmis:creationDate: java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2010,MONTH=6,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=22,DAY_OF_YEAR=1,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=15,MINUTE=3,SECOND=42,MILLISECOND=222,ZONE_OFFSET=7200000,DST_OFFSET=0]cmis:changeToken: nullcmis:checkinComment: nullcmis:objectId: workspace://SpacesStore/24c24588-39cb-48a6-b10f-3407590121dfcmis:isMajorVersion: falsecmis:isImmutable: falsecmis:baseTypeId: cmis:documentcmis:lastModificationDate: java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+01:00",offset=3600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2010,MONTH=10,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=10,DAY_OF_YEAR=1,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=8,MINUTE=46,SECOND=46,MILLISECOND=800,ZONE_OFFSET=3600000,DST_OFFSET=0]cmis:contentStreamFileName: article3.html————————————–          Relationships————————————–————————————–‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


So from the ID you can see it is the same object but the relationships show up empty. What is wrong with my code?

Alex
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Have you called setIncludeRelationships on your operation context?

Jeff

menza
Champ in-the-making
Champ in-the-making
Ah, that fixed it. I am still very new to CMIS, so sorry for asking dumb questions.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.