Beispiel #1
0
 @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();
 }
Beispiel #2
0
 @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;
 }
Beispiel #3
0
 @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();
   }
 }