001/*
002 * (C) Copyright 2006-2008 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id$
020 */
021
022package org.nuxeo.ecm.webapp.tree;
023
024import static org.jboss.seam.ScopeType.PAGE;
025import static org.jboss.seam.annotations.Install.FRAMEWORK;
026
027import java.util.List;
028
029import org.jboss.seam.annotations.Install;
030import org.jboss.seam.annotations.Name;
031import org.jboss.seam.annotations.Scope;
032
033/**
034 * Manages the tree for reduced utilization, like for popup. Performs additional work when a node is selected such as
035 * saving the selection and redirecting towards the required page.
036 * <p>
037 * The scope is PAGE to reinitialize the tree for new utilization.
038 *
039 * @author <a href="mailto:tmartins@nuxeo.com">Thierry Martins</a>
040 */
041@Scope(PAGE)
042@Name("reducedTreeActions")
043@Install(precedence = FRAMEWORK)
044public class ReducedTreeActionsBean extends TreeActionsBean {
045
046    private static final long serialVersionUID = 1L;
047
048    @Override
049    public List<DocumentTreeNode> getTreeRoots() {
050        return getTreeRoots(true);
051    }
052
053    /**
054     * @since 5.4
055     * @return a list containing a DocumentTreeNode for the Root document
056     */
057    public List<DocumentTreeNode> getRootNode() {
058        return getTreeRoots(true, documentManager.getRootDocument());
059    }
060
061}