Package jease.cms.domain

Examples of jease.cms.domain.Folder


      int lastSlash = path.lastIndexOf("/");
      if (lastSlash != -1) {
        String parentPath = path.substring(0, lastSlash);
        String filename = path.substring(lastSlash + 1, path.length());
        makeFolders(relativeRoot, parentPath, editor);
        Folder newFolder = newFolder(filename);
        newFolder.setEditor(editor);
        if (editor.getRole().containsType(newFolder.getClass())) {
          Nodes.append(
              relativeRoot.getChild(Filenames.asId(parentPath)),
              newFolder);
        } else {
          throw new NodeException.IllegalNesting();
        }
      } else {
        Folder newFolder = newFolder(path);
        newFolder.setEditor(editor);
        if (editor.getRole().containsType(newFolder.getClass())) {
          Nodes.append(relativeRoot, newFolder);
        } else {
          throw new NodeException.IllegalNesting();
        }
      }
View Full Code Here


      throw new NodeException.IllegalNesting();
    }
  }

  private static Folder newFolder(String filename) {
    Folder folder = new Folder();
    folder.setId(Filenames.asId(filename));
    folder.setTitle(filename);
    folder.setLastModified(new Date());
    return folder;
  }
View Full Code Here

  /**
   * Returns title (e.g. as page title) based on title of root node, the
   * default content of the root node and the title of given node.
   */
  public static String getPageTitle(Content content) {
    Folder root = (Folder) getRoot();
    if (root.getContent() != null && root.getContent() != content) {
      return String.format("%s - %s - %s", root.getTitle(), root
          .getContent().getTitle(), content.getTitle());
    } else {
      return String
          .format("%s - %s", root.getTitle(), content.getTitle());
    }
  }
View Full Code Here

    }
  }

  private void setupContent() {
    if (Nodes.getRoot() == null) {
      Folder folder = new Folder();
      folder.setId(ZK.getContextPath().replaceFirst("/", ""));
      folder.setTitle(I18N.get("Jease"));
      folder.setLastModified(new Date());
      folder.setVisible(true);
      Nodes.setRoot(folder);
      Nodes.save(folder);
    }
  }
View Full Code Here

TOP

Related Classes of jease.cms.domain.Folder

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.