001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id$
018 */
019package org.nuxeo.ecm.webapp.tree;
020
021import java.io.Serializable;
022import java.util.List;
023
024import org.nuxeo.ecm.core.api.DocumentModel;
025import org.nuxeo.ecm.core.api.quota.QuotaStats;
026
027/**
028 * Tree node of documents.
029 *
030 * @author Anahide Tchertchian
031 */
032public interface DocumentTreeNode extends Serializable {
033
034    List<DocumentTreeNode> getChildren();
035
036    String getId();
037
038    String getPath();
039
040    /**
041     * Returns the {@link QuotaStats} adapter for the underlying document of this {@code DocumentTreeNode}.
042     *
043     * @since 5.5
044     */
045    QuotaStats getQuotaStats();
046
047    /**
048     * Returns true if node represents current document, or if it's the direct parent of a non-folderish document that
049     * is not be represented in the tree.
050     *
051     * @since 5.7
052     * @param currentDocument
053     */
054    boolean isSelected(DocumentModel currentDocument);
055
056    /**
057     * Returns the document corresponding to this node
058     */
059    DocumentModel getDocument();
060
061    void resetChildren();
062
063    void fetchChildren();
064
065    /**
066     * @since 6.0
067     */
068    void setExpanded(boolean expanded);
069
070    /**
071     * @since 6.0
072     */
073    boolean isExpanded();
074
075}