Exemplo n.º 1
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();
   }
 }
Exemplo n.º 2
0
 @Transient
 public void applyDefaultValue() {
   if (getCreationDate() == null) {
     setCreationDate(new Timestamp(System.currentTimeMillis()));
   }
   if (getRefers() == null) {
     setRefers(0);
   }
   if (getViews() == null) {
     setViews(0);
   }
   if (getRealNode() == null) {
     setRealNode(true);
   }
   if (getHidden() == null) {
     setHidden(false);
   }
   if (getHtmlStatus() == null) {
     setHtmlStatus(HTML_DISABLED);
   }
 }