@@ -0,0 +1,2105 @@
+/*%0A * Copyright  1999-2004 The Apache Software Foundation%0A *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  you may not use this file except in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A *%0A */%0A%0Apackage org.apache.lenya.cms.publication;%0A%0Aimport java.util.List;%0A%0A/**%0A * @version $Id: PublicationHelper.java,v 1.1 2004/08/26 22:18:19 roku Exp $%0A */%0Apublic final class PublicationHelper %7B%0A%0A    private Publication publication;%0A%0A    public PublicationHelper(Publication publication) %7B%0A        this.publication = publication;%0A    %7D%0A%0A    /**%0A     * Returns all documents of a publication.%0A     * @param area%0A     * @return%0A     * @see Document%0A     * @see Publication%0A     */%0A    public Document%5B%5D getAllDocuments(String area, String language) throws DocumentException %7B%0A        try %7B%0A            List allNodes = getPublication().getSiteTree(area).getNode(%22/%22).preOrder();%0A            Document%5B%5D documents = new Document%5BallNodes.size()-1%5D;%0A        %0A            for(int i=1; i%3CallNodes.size(); i++) %7B%0A                documents%5Bi-1%5D = DefaultDocumentBuilder.getInstance().createDocument(getPublication(), area,%0A                        ((SiteTreeNode)allNodes.get(i)).getAbsoluteId(), language);%0A            %7D%0A            return documents;%0A        %7D catch(SiteTreeException e) %7B%0A            throw new DocumentException(%22Can not access sitetree to get document ids.%22, e);%0A        %7D catch(DocumentBuildException e) %7B%0A            throw new DocumentException(%22Can not build document from id obtained from sitetree.%22, e);%0A        %7D        %0A    %7D%0A%0A    /**%0A     * @return Returns the publication.%0A     */%0A    public Publication getPublication() %7B%0A        return publication;%0A    %7D%0A%7D

Support for getting al docs from a pub via sitetree