01: package org.sakaiproject.citation.api;
02:
03: public interface SearchDatabaseHierarchy {
04: public static final String ROOT_CATEGORY_NAME = "root";
05: public static final String ROOT_CATEGORY_ID = "!root";
06:
07: /**
08: * Returns an Asset representing the database with the given databaseId.
09: * This method is in place to provide individual database browse funcationality.
10: *
11: * @param databaseId String representing the id of the database requested
12: * @return an Asset if the database exists in this hierarchy, null otherwise.
13: *
14: public org.osid.repository.Asset getDatabase( String databaseId );
15: */
16:
17: /**
18: * Returns the category within this hierarchy with the given category id
19: *
20: * @param categoryId id of category to check
21: * @return SearchCategory within this hierarchy with given category id; null
22: * if the category id is not found in this hierarchy
23: */
24: public SearchCategory getCategory(String categoryId);
25:
26: /**
27: * Returns the number of hierarchical levels in this hierarchy.
28: *
29: * @return number of hierarchical levels in this hierarchy. One less than the number returned
30: * provides the number of categorization levels - examples:
31: * <ul>
32: * <li>return value of 1 indicates there are just databases (no categorization)</li>
33: * <li>return value of 5 indicates there are 4 categorization levels</li>
34: * </ul>
35: */
36: public int getNumLevels();
37:
38: /**
39: * Returns the maximum number of searchable databases within this hierarchy.
40: * This number defaults to 8 for now.
41: *
42: * @return max number of searchable databases within this hierarchy
43: */
44: public int getNumMaxSearchableDb();
45:
46: /**
47: * Returns a list containing all categories in this hierarchy.
48: * This list can be used to iterate through the entire hierarchy.
49: *
50: * @return list containing the SearchCategory objects in this hierarchy.
51: */
52: public java.util.List getCategoryListing();
53:
54: /**
55: * Returns the default category in this hierarchy. A default category will contain
56: * at least one database and no sub-categories.
57: *
58: * @return Default category in this hierarchy, or null if it does not exist.
59: */
60: public SearchCategory getDefaultCategory();
61:
62: /**
63: * Determines whether or not the given database is within this hierarchy.
64: *
65: * @param databaseId database id to check
66: * @return true if the database exists in this hierarchy,
67: * false if it does not
68: */
69: public boolean isSearchableDatabase(String databaseId);
70:
71: /**
72: * Get the Repository associated with this hierarchy
73: *
74: * @return Repository associated with this hierarchy
75: */
76: public org.osid.repository.Repository getRepository();
77:
78: /**
79: * Determines whether or not this hierarchy is properly configured.
80: * This hierarchy could not be properly configured if the config xml files
81: * are not found or there is an error in parsing them.
82: *
83: * @return true if hierarchy is properly configured, false otherwise.
84: */
85: public boolean isConfigured();
86: }
|