@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(); } }
@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); } }