- if (session.getWorkspace().getNodeTypeManager()
- .hasNodeType(prefix)) {
- String nodeType = prefix;
- if (!session.nodeExists(path))
- node = addNode(session, path, nodeType);
- else {
- node = session.getNode(path);
- if (!node.isNodeType(nodeType))
- throw new CmsException("Node " + path
- + " not of type " + nodeType);
- }
- } else if ("delete".equals(prefix)) {
- if (session.itemExists(path)) {
- Node nodeToDelete = session.getNode(path);
- // TODO "Are you sure?"
- nodeToDelete.remove();
- session.save();
- log.debug("Deleted " + path);
- navigateTo(previousState);
- } else
- throw new CmsException("Data " + path
- + " does not exist");
- } else {
- if (session.itemExists(path))
- node = session.getNode(path);
- else
- throw new CmsException("Data " + path
- + " does not exist");
- }
+ // if (session.getWorkspace().getNodeTypeManager()
+ // .hasNodeType(prefix)) {
+ // String nodeType = prefix;
+ // if (!session.nodeExists(path))
+ // node = addNode(session, path, nodeType);
+ // else {
+ // node = session.getNode(path);
+ // if (!node.isNodeType(nodeType))
+ // throw new CmsException("Node " + path
+ // + " not of type " + nodeType);
+ // }
+ // } else if ("delete".equals(prefix)) {
+ // if (session.itemExists(path)) {
+ // Node nodeToDelete = session.getNode(path);
+ // // TODO "Are you sure?"
+ // nodeToDelete.remove();
+ // session.save();
+ // log.debug("Deleted " + path);
+ // navigateTo(previousState);
+ // } else
+ // throw new CmsException("Data " + path
+ // + " does not exist");
+ // } else {
+ if (session.nodeExists(path))
+ node = session.getNode(path);
+ else
+ throw new CmsException("Data " + path + " does not exist");
+ // }