@Test public void getParentForInvalidNode() { SpaceReference spaceReference = new SpaceReference("wiki", "Path"); when(this.entityTreeNodeIdConverter.convert(EntityReference.class, "space:wiki:Path")) .thenReturn(spaceReference); assertEquals(null, this.documentTreeNode.getParent("space:wiki:Path")); }
@Override protected EntityReference getParent(DocumentReference documentReference) throws Exception { if (getDefaultDocumentName().equals(documentReference.getName())) { EntityReference parentReference = documentReference.getParent().getParent(); if (parentReference.getType() == EntityType.SPACE) { return new DocumentReference(getDefaultDocumentName(), new SpaceReference(parentReference)); } else { return parentReference; } } else { return new DocumentReference(getDefaultDocumentName(), documentReference.getLastSpaceReference()); } }
DocumentTreeNode extends AbstractDocumentTreeNode implements Initializable { @Override protected EntityReference getParent(DocumentReference documentReference) throws Exception { if (getDefaultDocumentName().equals(documentReference.getName())) { EntityReference parentReference = documentReference.getParent().getParent(); if (parentReference.getType() == EntityType.SPACE) { return new DocumentReference(getDefaultDocumentName(), new SpaceReference(parentReference)); } else { return parentReference; } } else { return new DocumentReference(getDefaultDocumentName(), documentReference.getLastSpaceReference()); } } }
DocumentTreeNode extends AbstractDocumentTreeNode implements Initializable { @Override protected EntityReference getParent(DocumentReference documentReference) throws Exception { if (getDefaultDocumentName().equals(documentReference.getName())) { EntityReference parentReference = documentReference.getParent().getParent(); if (parentReference.getType() == EntityType.SPACE) { return new DocumentReference(getDefaultDocumentName(), new SpaceReference(parentReference)); } else { return parentReference; } } else { return new DocumentReference(getDefaultDocumentName(), documentReference.getLastSpaceReference()); } } DocumentTreeNode(); }
DocumentTreeNode extends AbstractDocumentTreeNode implements Initializable { @Override protected EntityReference getParent(DocumentReference documentReference) throws Exception { if (getDefaultDocumentName().equals(documentReference.getName())) { EntityReference parentReference = documentReference.getParent().getParent(); if (parentReference.getType() == EntityType.SPACE) { return new DocumentReference(getDefaultDocumentName(), new SpaceReference(parentReference)); } else { return parentReference; } } else { return new DocumentReference(getDefaultDocumentName(), documentReference.getLastSpaceReference()); } } DocumentTreeNode(); @Override void initialize(); }
DocumentTreeNode extends AbstractDocumentTreeNode implements Initializable { @Override protected EntityReference getParent(DocumentReference documentReference) throws Exception { if (getDefaultDocumentName().equals(documentReference.getName())) { EntityReference parentReference = documentReference.getParent().getParent(); if (parentReference.getType() == EntityType.SPACE) { return new DocumentReference(getDefaultDocumentName(), new SpaceReference(parentReference)); } else { return parentReference; } } else { return new DocumentReference(getDefaultDocumentName(), documentReference.getLastSpaceReference()); } } DocumentTreeNode(); @Override void initialize();  }