KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > model > ThemeManager


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. The ASF licenses this file to You
4  * under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. For additional information regarding
15  * copyright in this work, please see the NOTICE file in the top level
16  * directory of this distribution.
17  */

18
19 package org.apache.roller.model;
20
21 import java.util.List JavaDoc;
22 import org.apache.roller.RollerException;
23 import org.apache.roller.ThemeNotFoundException;
24 import org.apache.roller.pojos.Theme;
25 import org.apache.roller.pojos.ThemeTemplate;
26 import org.apache.roller.pojos.WebsiteData;
27
28
29 /**
30  * Manager interface for accessing Theme related objects.
31  */

32 public interface ThemeManager {
33     
34     /**
35      * Get the Theme object with the given name.
36      *
37      * @throws ThemeNotFoundException If the named theme cannot be found.
38      * @throws RollerException If there is some kind of fatal backend error.
39      **/

40     public Theme getTheme(String JavaDoc name)
41         throws ThemeNotFoundException, RollerException;
42     
43     
44     /**
45      * Get the Theme object with the given theme id.
46      *
47      * @throws ThemeNotFoundException If the named theme cannot be found.
48      * @throws RollerException If there is some kind of fatal backend error.
49      */

50     public Theme getThemeById(String JavaDoc theme_id)
51         throws ThemeNotFoundException, RollerException;
52     
53     
54     /**
55      * Get a list of all available themes.
56      * This list is ordered alphabetically by default.
57      *
58      * NOTE: this only returns a list of theme names, not actual Theme objects.
59      **/

60     public List JavaDoc getThemesList();
61     
62     
63     /**
64      * Get a list of all theme names that are currently enabled.
65      * This list is ordered alphabetically by default.
66      *
67      * NOTE: this only returns a list of theme names, not actual Theme objects.
68      */

69     public List JavaDoc getEnabledThemesList();
70     
71     
72     /**
73      * Get the template from a given theme.
74      *
75      * @throws ThemeNotFoundException If the named theme cannot be found.
76      * @throws RollerException If there is some kind of fatal backend error.
77      */

78     public ThemeTemplate getTemplate(String JavaDoc theme_name, String JavaDoc template_name)
79         throws ThemeNotFoundException, RollerException;
80     
81     
82     /**
83      * Get the template from a given theme using the template id.
84      *
85      * Theme templates use a special id value when they come off the filesystem.
86      * When a theme is read off the filesystem it's templates are given an id
87      * like ... <theme name>:<template name>
88      *
89      * @throws ThemeNotFoundException If the named theme cannot be found.
90      * @throws RollerException If there is some kind of fatal backend error.
91      */

92     public ThemeTemplate getTemplateById(String JavaDoc template_id)
93         throws ThemeNotFoundException, RollerException;
94
95     
96     /**
97      * Get the template from a given theme using the template link value.
98      *
99      * Note that for themes we enforce the rule that
100      * Theme.name == Theme.link
101      *
102      * So doing a lookup by link is the same as doing a lookup by name.
103      *
104      * @throws ThemeNotFoundException If the named theme cannot be found.
105      * @throws RollerException If there is some kind of fatal backend error.
106      */

107     public ThemeTemplate getTemplateByLink(String JavaDoc theme_name, String JavaDoc template_link)
108         throws ThemeNotFoundException, RollerException;
109    
110     public void saveThemePages(WebsiteData website, Theme theme) throws RollerException;
111 }
112
Popular Tags