public Node getNode(String name) { Collection nodes = manager.getAllQueries(); for (Iterator iter = nodes.iterator(); iter.hasNext(); ) { Query node = (Query) iter.next(); if (node.getName().equals(name)) { return node; } } return null; }
public Node getNode(HttpServletRequest req) { Query query = new Query(); int id = getId(req); int pid = getParentId(req); String name = req.getParameter("name"); String desc = req.getParameter("description"); boolean isLeaf = WebUtil.getBooleanParameter(req, "isLeaf", false); query.setId(id); query.setIsLeaf(isLeaf); query.setName(name); query.setPid(pid); query.setDescription(desc); return query; }
public void updateNode(Object node) throws EntityExistException { Query db = (Query) node; manager.updateQuery(db.getId(), db.getName(), db.getDescription()); }
public String getNodeName(Node node) { Query query = (Query) node; return query.getName(); }
public void addNode(Object node) throws EntityExistException { Query query = (Query) node; manager.addQuery(query.getPid(), query.getName(), query.getDescription(), query.getIsLeaf()); }
public void copyNode(Object node) throws EntityExistException { Query query = (Query) node; manager.copyQuery(query.getId(), query.getName(), query.getDescription()); }