@Transient public String getDisplayName() { StringBuilder sb = new StringBuilder(); Node node = this; sb.append(node.getName()); node = node.getParent(); while (node != null) { sb.insert(0, " - "); sb.insert(0, node.getName()); node = node.getParent(); } return sb.toString(); }
@Transient public List<Node> getHierarchy() { List<Node> hierarchy = new LinkedList<Node>(); Node node = this; while (node != null) { hierarchy.add(0, node); node = node.getParent(); } return hierarchy; }
@Transient public void updateHtmlStatus() { Node node = this; while (node != null) { if (node.getGenerate()) { if (StringUtils.isNotBlank(node.getHtml())) { node.setHtmlStatus(HTML_TOBE_UPDATE); } else { node.setHtmlStatus(HTML_TOBE_GENERATE); } } else { if (StringUtils.isNotBlank(node.getHtml())) { node.setHtmlStatus(HTML_TOBE_DELETE); } else { node.setHtmlStatus(HTML_DISABLED); } } node = node.getParent(); } }