001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software GmbH & Co. KG, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.jsp;
029
030import org.opencms.file.CmsResource;
031
032import java.util.List;
033
034import javax.servlet.jsp.JspException;
035
036/**
037 * Provides access to a <code>{@link org.opencms.file.CmsResource}</code> object that was previously loaded by a parent tag.<p>
038 *
039 * @since 8.0
040 */
041public interface I_CmsResourceContainer {
042
043    /**
044     * Returns the name of the currently used resource collector.<p>
045     *
046     * @return the name of the currently used resource collector
047     */
048    String getCollectorName();
049
050    /**
051     * Returns the parameters of the currently used resource collector.<p>
052     *
053     * @return the parameters of the currently used resource collector
054     */
055    String getCollectorParam();
056
057    /**
058     * Returns the list of all currently loaded resources (instances of <code>{@link org.opencms.file.CmsResource}</code>).<p>
059     *
060     * @return the list of all currently loaded resources
061     */
062    List<CmsResource> getCollectorResult();
063
064    /**
065     * Returns the currently loaded resource.<p>
066     *
067     * @return the currently loaded resource
068     */
069    CmsResource getResource();
070
071    /**
072     * Returns the resource name in the VFS for the currently loaded resource.<p>
073     *
074     * @return the resource name in the VFS for the currently loaded resource
075     */
076    String getResourceName();
077
078    /**
079     * Resource iteration method to be used by JSP scriptlet code.<p>
080     *
081     * Calling this method will insert "direct edit" HTML to the output page (if required).<p>
082     *
083     * @return <code>true</code> if more resources are to be iterated
084     *
085     * @throws JspException in case something goes wrong
086     */
087    boolean hasMoreResources() throws JspException;
088
089    /**
090     * Resource iteration method to be used by JSP scriptlet code.<p>
091     *
092     * Calling this method will insert "direct edit" HTML to the output page (if required).<p>
093     *
094     * @return <code>true</code> if more resources are to be iterated
095     *
096     * @deprecated use {@link #hasMoreResources()}
097     *
098     * @throws JspException in case something goes wrong
099     */
100    @Deprecated
101    boolean hasMoreContent() throws JspException;
102
103    /**
104     * Returns <code>true</code> if this container is used as a resource preloader.<p>
105     *
106     * A resource preloader is used to load resources without looping through it.<p>
107     *
108     * @return <code>true</code> if this container is used as a resource preloader
109     */
110    boolean isPreloader();
111}