return TreeAwareNode.Util.getTreeNode(node, NODE_FILTER);
}
@Override
protected void onBeforeRender() {
Workspace workspace = workspaceModel.getObject();
BrixNode node;
try {
node = getModelObject();
}
catch (JcrException e) {
if (e.getCause() instanceof ItemNotFoundException) {
node = SitePlugin.get().getSiteRootNode(workspace.getId());
getModel().setObject(null);
selectNode(node);
setupDefaultEditor();
tree.invalidateAll();
} else {
throw (e);
}
}
String nodeWorkspaceName = node.getSession().getWorkspace().getName();
if (!nodeWorkspaceName.equals(workspace.getId())) {
// we have to either update node or workspace
if (oldWorkspaceId != null && workspace.getId().equals(oldWorkspaceId)) {
// the node changed, need to update the workspace
Workspace newWorkspace = node.getBrix().getWorkspaceManager().getWorkspace(
nodeWorkspaceName);
workspaceModel.setObject(newWorkspace);
} else {
// the workspace has changed, update the node
// 1 try to get node with same UUID, 2 try to get node with same