1 /*******************************************************************************
2 * Copyright (c) 2005 Gabriel Handford.
3 * All rights reserved.
4 *
5 * Contributors:
6 * Gabriel Handford -
7 *******************************************************************************/
8 package net.sf.tacos.services;
9
10 import java.util.List;
11
12
13 /**
14 * This class reads the sitemap configuration, and provides access to
15 * basic relationship information, such as page categories, bread crumbs, and
16 * other information, that the application may need to ease navigation.
17 *
18 * @author Gabriel Handford
19 */
20 public interface SiteMap {
21
22 /**
23 * Get list of named categories.
24 * @return The category listing
25 */
26 public List getCategories();
27
28 /**
29 * Get category info for named category.
30 * @param name The category name
31 * @return The category info
32 */
33 public CategoryInfo getCategoryInfo(String name);
34
35 /**
36 * Get page information.
37 * @param name The page name
38 * @return The page descriptor
39 */
40 public PageInfo getPageInfo(String name);
41
42 /**
43 * Get the category info for the page name.
44 * @param pageName The page name.
45 * @return The first category associated with this page.
46 */
47 public CategoryInfo getCategoryFromPage(String pageName);
48
49 /**
50 * Check if page name is in the specified category.
51 * @param pageName Page name
52 * @param category Category
53 * @return True if in the specified category
54 */
55 public boolean inCategory(String pageName, String category);
56
57 /**
58 * Get the default page description.
59 * @param category Category
60 * @return Category default page description
61 */
62 public String getDefaultPageDesc(String category);
63
64 /**
65 * Get pages for a specific page names category.
66 * @param pageName Page name
67 * @return Pages
68 */
69 public List getCategoryPages(String pageName);
70
71 /**
72 * Get the default page.
73 * @param category Category
74 * @return Default page
75 */
76 public PageInfo getDefaultPage(String category);
77
78 /**
79 * Check if page name is contained in the page element tree.
80 * @param parent The page to start at.
81 * @param pageName The page to find.
82 * @return True if the parent contains the page in its tree.
83 */
84 public boolean contains(String parent, String pageName);
85
86 /**
87 * Get bread crumbs.
88 * @param pageName The page name.
89 * @return The bread crumbs (page name list).
90 */
91 public List getBreadCrumbs(String pageName);
92 }