private void finaliseRelations() {
		if (tempRelations == null)
			return;
		
		PageLayout layout = page.getLayout();
		Relations relations = layout.getRelations();
		if (relations == null)
			return;
		
		for (int i=0; i<tempRelations.size(); i++) {
			List<String> rel = tempRelations.get(i);
			if (rel != null && rel.size() == 5) {
				RelationType type = "link".equals(rel.get(0)) ? RelationType.Link : RelationType.Join;
				String custom = rel.get(1);
				String comments = rel.get(2);
				String id1 = rel.get(3);
				String id2 = rel.get(4);
				
				ContentObject obj1 = contentObjects.get(id1);
				ContentObject obj2 = contentObjects.get(id2);
				
				if (obj1 != null && obj2 != null) {
					ContentObjectRelation relation = new ContentObjectRelation(obj1, obj2, type);
					relation.setCustomField(custom);
					relation.setComments(comments);
					relations.addRelation(relation);
				}
			}
		}
	}