Package jease.cmf.domain

Examples of jease.cmf.domain.Node


  public NavigationTreeRenderer(ActionListener dropListener) {
    this.dropListener = dropListener;
  }

  public void render(Treeitem treeitem, Object value) throws Exception {
    Node node = (Node) value;
    treeitem.setLabel(node.getId());
    treeitem.setTooltiptext(node.getType());
    treeitem.setImage(JeaseSession.getConfig().getIcon(node));
    treeitem.setValue(node);
    if (dropListener != null) {
      if (!Arrays.contains(JeaseSession.getRoots(), node)) {
        treeitem.getTreerow().setDraggable(Node.class.getSimpleName());
View Full Code Here


  }

  private void selectPerformed() {
    Treeitem treeitem = getSelectedItem();
    if (treeitem != null) {
      Node value = (Node) treeitem.getValue();
      if (value != null) {
        JeaseSession.setContainer(value);
      }
    }
  }
View Full Code Here

    if (dragged instanceof Treerow) {
      draggedNodes = new Node[] { (Node) ((Treeitem) ((Treerow) dragged)
          .getParent()).getValue() };
    }
    try {
      Node parentNode = (Node) ((Treeitem) ((Treerow) target).getParent())
          .getValue();
      for (Node node : draggedNodes) {
        Nodes.append(parentNode, node);
      }
    } catch (NodeException e) {
View Full Code Here

      JeaseSession.setConfig(new Configuration());
      JeaseSession.setFilter(new NodeFilter(JeaseSession.getConfig()
          .newNodes()));
      JeaseSession.setRoots(user.getRoots());
      if (queryString != null) {
        Node node = Nodes.getByPath(queryString);
        if (JeaseSession.getFilter().isAccepted(node)) {
          JeaseSession.setContainer(node);
        }
      }
      if (JeaseSession.getContainer() == null
View Full Code Here

   * Append content contained in previously backuped XML-file to given
   * container and assign ownership to given user.
   */
  public static void restore(File backupFile, Node container, final User user)
      throws NodeException {
    Node node = backup.restore(backupFile);
    node.traverse(new Procedure<Node>() {
      public void execute(Node node) {
        ((Content) node).setEditor(user);
      }
    });
    Nodes.append(container, node);
View Full Code Here

    }
  }

  private static void makeFolders(Node relativeRoot, String path, User editor)
      throws NodeException {
    Node node = relativeRoot.getChild(Filenames.asId(path));
    if (node == null) {
      int lastSlash = path.lastIndexOf("/");
      if (lastSlash != -1) {
        String parentPath = path.substring(0, lastSlash);
        String filename = path.substring(lastSlash + 1, path.length());
View Full Code Here

  public File dump(Node node) {
    if (node == null) {
      return null;
    }
    try {
      Node nodeCopy = node.copy(true);
      nodeCopy.setParent(null);
      String filename = (Validations.isEmpty(nodeCopy.getId()) ? nodeCopy
          .getType() : nodeCopy.getId()) + ".xml";
      File dumpFile = new File(Files.createTempDirectory(), filename);
      Writer writer = Files.newWriter(dumpFile);
      toXML(nodeCopy, writer);
      writer.close();
      return Zipfiles.zip(dumpFile);
View Full Code Here

    if (dumpFile == null) {
      return null;
    }
    try {
      Reader reader = Files.newReader(Zipfiles.unzip(dumpFile));
      Node node = fromXML(reader);
      node.setId(Filenames.asId(dumpFile.getName()).replace(".xml.zip", ""));
      reader.close();
      return node;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

  private long nodeChange;
  private Node nodeContainer;

  public boolean isStale() {
    long lastNodeChange = Nodes.queryLastChange();
    Node lastNodeContainer = JeaseSession.getContainer();
    if (nodeContainer != lastNodeContainer || nodeChange < lastNodeChange) {
      nodeContainer = lastNodeContainer;
      nodeChange = lastNodeChange;
      return true;
    } else {
View Full Code Here

    refreshState.reset();
    refresh();
  }

  protected void refreshDesktop() {
    Node node = JeaseSession.getContainer();
    desktopPanel.clearToolbar();
    for (Node parent : node.getParents()) {
      desktopPanel.appendChildToToolbar(newNavigationButton(parent));
    }
    desktopPanel.appendChildToToolbar(newEditButton(node));
  }
View Full Code Here

TOP

Related Classes of jease.cmf.domain.Node

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.