String childId = relatedEntry.get("child").toString();
String parentId = relatedEntry.get("parent").toString();
String relType=relatedEntry.get("relation_type").toString();
String order = relatedEntry.get("tree_order").toString();
Relationship rel = RelationshipFactory.getRelationshipByRelationTypeValue(relType);
if(rel!=null && InodeUtils.isSet(rel.getInode())) {
boolean isSameStructRelationship = rel.getParentStructureInode().equalsIgnoreCase(rel.getChildStructureInode());
String propName = isSameStructRelationship ?
(con.getIdentifier().equals(parentId)?rel.getRelationTypeValue() + "-child":rel.getRelationTypeValue() + "-parent")
: rel.getRelationTypeValue();
String orderKey = rel.getRelationTypeValue()+"-order";
if(relatedEntry.get("relation_type").equals(rel.getRelationTypeValue())) {
String me = con.getIdentifier();
String related = me.equals(childId)? parentId : childId;
// put a pointer to the related content
m.put(propName, (m.get(propName) != null ? m.get(propName) : "") + related + " " );