* @return Nodes filled with data
* @return
*/
public static TreeNode standardTraverseTree(
TreeNode node, TreeNode _node, DataModelConfiguration currentConfiguration) {
DigitalObject o = null;
boolean proceedOk = true;
if (_node != null) {
if (_node.getData() != null) {
try {
URI uri = ((RegistryPropertyImpl)_node.getData()).getUri();
log.info("#### StorageBackingBean DoTreeView standardTraverseTree() uri: " + uri);
o = dr.getDataManager(uri).retrieve(uri);
} catch (Exception e) {
log.info("StorageBackingBean DoTreeView standardTraverseTree() error: " + e.getMessage());
proceedOk = false;
}
if (o != null)
log.info("StorageBackingBean DoTreeView standardTraverseTree() digitalObject: " + o.toString());
}
}
if (o != null && proceedOk) {
log.info("StorageBackingBean DoTreeView standardTraverseTree() o != null currentConfiguration: " + currentConfiguration);
if (currentConfiguration.equals(DataModelConfiguration.PLANETS)) {
TreeNodeImpl childNode = new TreeNodeImpl();
childNode.setData(ModelConfiguration.DIGITAL_OBJECT_MODEL.name());
childNode.setParent(node);
node.removeChild(NODE_ID);
node.addChild(NODE_ID, childNode);
if (o.getTitle() != null) {
addNode(childNode, ModelConfiguration.DigitalObjectModel.TITLE.name(), o.getTitle());
}
if (o.getPermanentUri() != null) {
addNode(childNode, ModelConfiguration.DigitalObjectModel.PLANETS_URI.name(),
o.getPermanentUri().toString());
}
if (o.getFormat() != null) {
addNode(childNode, ModelConfiguration.DigitalObjectModel.FORMAT.name(),
o.getFormat().toString());
}
if (o.getManifestationOf() != null) {
addNode(childNode, ModelConfiguration.DigitalObjectModel.MANIFESTATION_OF.name(),
o.getManifestationOf().toString());
}
describeMetadata(childNode, o);
describeEvents(childNode, o);
} else {
TreeNodeImpl childNode = new TreeNodeImpl();
childNode.setData(ModelConfiguration.PREMIS_MODEL.name());
childNode.setParent(node);
node.removeChild(NODE_ID);
node.addChild(NODE_ID, childNode);
TreeNode idNode = addNode(childNode, ModelConfiguration.PremisModel.OBJECT_IDENTIFIER.name());
if (o.getPermanentUri() != null) {
addNode(idNode, ModelConfiguration.PremisModel.ObjectIdentifier.TYPE.name(), "URI");
addNode(idNode, ModelConfiguration.PremisModel.ObjectIdentifier.VALUE.name(),
o.getPermanentUri().toString());
}
if (o.getTitle() != null) {
addNode(childNode, ModelConfiguration.PremisModel.ORIGINAL_NAME.name(), o.getTitle());
}
TreeNode charNode = addNode(childNode, ModelConfiguration.PremisModel.OBJECT_CHARACTERISTICS.name());
if (o.getFormat() != null) {
addNode(charNode, ModelConfiguration.PremisModel.ObjectCharacteristics.FORMAT.name(),
o.getFormat().toString());
}
TreeNode relationshipNode = addNode(childNode, ModelConfiguration.PremisModel.RELATIONSHIP.name());
addNode(relationshipNode,
ModelConfiguration.PremisModel.Relationship.RELATED_OBJECT_IDENTIFIER.name());
if (o.getManifestationOf() != null) {
addNode(idNode,
ModelConfiguration.PremisModel.Relationship.RelatedObjectIdentifier.TYPE.name(), "URI");
addNode(idNode, ModelConfiguration.PremisModel.Relationship.RelatedObjectIdentifier.VALUE.name(),
o.getManifestationOf().toString());
}
describeSignificantProperties(childNode, o);
describeLinkingEventIds(childNode, o);
}
}