001/* 002 * (C) Copyright 2006-2008 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 */ 019 020package org.nuxeo.ecm.webapp.tree; 021 022import static org.jboss.seam.ScopeType.PAGE; 023import static org.jboss.seam.annotations.Install.FRAMEWORK; 024 025import java.util.List; 026 027import org.jboss.seam.annotations.Install; 028import org.jboss.seam.annotations.Name; 029import org.jboss.seam.annotations.Scope; 030 031/** 032 * Manages the tree for reduced utilization, like for popup. Performs additional work when a node is selected such as 033 * saving the selection and redirecting towards the required page. 034 * <p> 035 * The scope is PAGE to reinitialize the tree for new utilization. 036 * 037 * @author <a href="mailto:tmartins@nuxeo.com">Thierry Martins</a> 038 */ 039@Scope(PAGE) 040@Name("reducedTreeActions") 041@Install(precedence = FRAMEWORK) 042public class ReducedTreeActionsBean extends TreeActionsBean { 043 044 private static final long serialVersionUID = 1L; 045 046 @Override 047 public List<DocumentTreeNode> getTreeRoots() { 048 return getTreeRoots(true); 049 } 050 051 /** 052 * @since 5.4 053 * @return a list containing a DocumentTreeNode for the Root document 054 */ 055 public List<DocumentTreeNode> getRootNode() { 056 return getTreeRoots(true, documentManager.getRootDocument()); 057 } 058 059}