code: protected List<ObjectData> getRelationshipObjectData(
          CmsCmisCallContext context,
          CmsObject cms,
          CmsResource resource,
          RelationshipDirection relationshipDirection,
          Set<String> filterSet,
          boolean includeAllowableActions)
      throws CmsException {
  
          List<ObjectData> resultObjects = new ArrayList<ObjectData>();
          CmsRelationFilter relationFilter;
          if (relationshipDirection == RelationshipDirection.SOURCE) {
              relationFilter = CmsRelationFilter.TARGETS;
          } else if (relationshipDirection == RelationshipDirection.TARGET) {
              relationFilter = CmsRelationFilter.SOURCES;
          } else {
              relationFilter = CmsRelationFilter.ALL;
          }
  
          List<CmsRelation> unfilteredRelations = cms.getRelationsForResource(resource.getRootPath(), relationFilter);
          List<CmsRelation> relations = new ArrayList<CmsRelation>();
          for (CmsRelation relation : unfilteredRelations) {
              if (relation.getTargetId().isNullUUID() || relation.getSourceId().isNullUUID()) {
                  continue;
              }
              relations.add(relation);
          }
          CmsCmisRelationHelper helper = getRelationHelper();
          for (CmsRelation relation : relations) {
              ObjectData objData = helper.collectObjectData(
                  context,
                  cms,
                  resource,
                  relation,
                  filterSet,
                  includeAllowableActions,
                  false);
              resultObjects.add(objData);
          }
          return resultObjects;
      }
docs: Gets the relationship data for a given resource.<p>
  
  @param context the call context
  @param cms the CMS context
  @param resource the resource
  @param relationshipDirection the relationship direction
  @param filterSet the property filter
  @param includeAllowableActions true if allowable actions should be included
  @return the list of relationship data
  
  @throws CmsException if something goes wrong