001    /*******************************************************************************
002     * Copyright (c) 2005 Gabriel Handford.
003     * All rights reserved.
004     *
005     * Contributors:
006     *    Gabriel Handford -
007     *******************************************************************************/
008    package net.sf.tacos.services;
009    
010    import java.util.List;
011    
012    
013    /**
014     * This class reads the sitemap configuration, and provides access to
015     * basic relationship information, such as page categories, bread crumbs, and
016     * other information, that the application may need to ease navigation.
017     *
018     * @author Gabriel Handford
019     */
020    public interface SiteMap {
021    
022        /**
023         * Get list of named categories.
024         * @return The category listing
025         */
026        public List getCategories();
027    
028        /**
029         * Get category info for named category.
030         * @param name The category name
031         * @return The category info
032         */
033        public CategoryInfo getCategoryInfo(String name);
034    
035        /**
036         * Get page information.
037         * @param name The page name
038         * @return The page descriptor
039         */
040        public PageInfo getPageInfo(String name);
041    
042        /**
043         * Get the category info for the page name.
044         * @param pageName The page name.
045         * @return The first category associated with this page.
046         */
047        public CategoryInfo getCategoryFromPage(String pageName);
048        
049        /**
050         * Check if page name is in the specified category.
051         * @param pageName Page name
052         * @param category Category
053         * @return True if in the specified category
054         */
055        public boolean inCategory(String pageName, String category);
056        
057        /**
058         * Get the default page description.
059         * @param category Category
060         * @return Category default page description
061         */
062        public String getDefaultPageDesc(String category);
063        
064        /**
065         * Get pages for a specific page names category.
066         * @param pageName Page name
067         * @return Pages
068         */
069        public List getCategoryPages(String pageName);
070        
071        /**
072         * Get the default page.
073         * @param category Category
074         * @return Default page
075         */
076        public PageInfo getDefaultPage(String category);
077    
078        /**
079         * Check if page name is contained in the page element tree.
080         * @param parent The page to start at.
081         * @param pageName The page to find.
082         * @return True if the parent contains the page in its tree.
083         */
084        public boolean contains(String parent, String pageName);
085    
086        /**
087         * Get bread crumbs.
088         * @param pageName The page name.
089         * @return The bread crumbs (page name list).
090         */
091        public List getBreadCrumbs(String pageName);
092    }