Package jease.cms.domain

Examples of jease.cms.domain.Trash


   * directly. If the given content is a Trash-Object, the Trash-Object is
   * deleted only when it is empty, otherwise the Trash will be emptied.
   */
  public static void delete(Content content) {
    if (content instanceof Trash) {
      Trash trash = (Trash) content;
      if (trash.isEmpty()) {
        Nodes.delete(trash);
      } else {
        for (Content child : trash.getChildren(Content.class)) {
          if (child.getParent() != null
              && Contents.isDeletable(child)) {
            delete(child);
          }
        }
        Nodes.save(trash);
      }
    } else {
      Trash trash = content.getParent() != null ? ((Content) content
          .getParent()).getGuard(Trash.class) : null;
      if (trash == null || content.isDescendant(trash)) {
        if (isDeletable(content)) {
          deleteReferences(content);
          Nodes.delete(content);
        }
      } else {
        trash.appendChild(content);
        Nodes.save(trash);
      }
    }
  }
View Full Code Here

TOP

Related Classes of jease.cms.domain.Trash

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.