File Source: BookmarkManager.java
/*
P/P * Method: org.apache.roller.weblogger.business.BookmarkManager__static_init
*/
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.weblogger.business;
20
21 import java.util.List;
22 import org.apache.roller.weblogger.WebloggerException;
23 import org.apache.roller.weblogger.pojos.WeblogBookmark;
24 import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
25 import org.apache.roller.weblogger.pojos.Weblog;
26
27
28 /**
29 * Interface to Bookmark Management. Provides methods for retrieving, storing,
30 * moving, removing and querying for folders and bookmarks.
31 */
32 public interface BookmarkManager {
33
34
35 /**
36 * Save a Folder.
37 *
38 * Also saves any bookmarks in the folder. This method should enforce the
39 * fact that a weblog cannot have 2 folders with the same path.
40 *
41 * @param folder The folder to be saved.
42 * @throws WebloggerException If there is a problem.
43 */
44 public void saveFolder(WeblogBookmarkFolder folder) throws WebloggerException;
45
46
47 /**
48 * Remove a Folder.
49 *
50 * Also removes any subfolders and bookmarks.
51 *
52 * @param folder The folder to be removed.
53 * @throws WebloggerException If there is a problem.
54 */
55 public void removeFolder(WeblogBookmarkFolder folder) throws WebloggerException;
56
57
58 /**
59 * Move a folder under another folder.
60 *
61 * This moves the src folder itself and all children and associated bookmarks.
62 */
63 public void moveFolder(WeblogBookmarkFolder src,
64
65 WeblogBookmarkFolder dest
66 )
67 throws WebloggerException;
68
69
70 /**
71 * Lookup a folder by ID.
72 *
73 * @param id The id of the folder to lookup.
74 * @returns FolderData The folder, or null if not found.
75 * @throws WebloggerException If there is a problem.
76 */
77 public WeblogBookmarkFolder getFolder(String id) throws WebloggerException;
78
79
80 /**
81 * Get all folders for a weblog.
82 *
83 * @param weblog The weblog we want the folders from.
84 * @returns List The list of FolderData objects from the weblog.
85 * @throws WebloggerException If there is a problem.
86 */
87 public List getAllFolders(Weblog weblog) throws WebloggerException;
88
89
90 /**
91 * Get root folder for a weblog.
92 * All weblogs should have only 1 root folder.
93 *
94 * @param weblog The weblog we want the root folder from.
95 * @returns FolderData The root folder, or null if not found.
96 * @throws WebloggerException If there is a problem.
97 */
98 public WeblogBookmarkFolder getRootFolder(Weblog weblog) throws WebloggerException;
99
100
101 /**
102 * Get a folder from a weblog based on its path.
103 *
104 * @param weblog The weblog we want the folder from.
105 * @param path The full path of the folder.
106 * @returns FolderData The folder from the given path, or null if not found.
107 * @throws WebloggerException If there is a problem.
108 */
109 public WeblogBookmarkFolder getFolder(Weblog weblog, String path)
110 throws WebloggerException;
111
112
113 /**
114 * Save a Bookmark.
115 *
116 * @param bookmark The bookmark to be saved.
117 * @throws WebloggerException If there is a problem.
118 */
119 public void saveBookmark(WeblogBookmark bookmark) throws WebloggerException;
120
121
122 /**
123 * Remove a Bookmark.
124 *
125 * @param bookmark The bookmark to be removed.
126 * @throws WebloggerException If there is a problem.
127 */
128 public void removeBookmark(WeblogBookmark bookmark) throws WebloggerException;
129
130
131 /**
132 * Lookup a Bookmark by ID.
133 *
134 * @param id The id of the bookmark to lookup.
135 * @returns BookmarkData The bookmark, or null if not found.
136 * @throws WebloggerException If there is a problem.
137 */
138 public WeblogBookmark getBookmark(String id) throws WebloggerException;
139
140
141 /**
142 * Lookup all Bookmarks in a folder, optionally search recursively.
143 *
144 * @param folder The folder to get the bookmarks from.
145 * @param recurse True if bookmarks should be included.
146 * @returns List The list of bookmarks found.
147 * @throws WebloggerException If there is a problem.
148 */
149 public List getBookmarks(WeblogBookmarkFolder folder, boolean recurse)
150 throws WebloggerException;
151
152
153 /**
154 * Import bookmarks and folders from OPML string into the specified folder.
155 *
156 * @param weblog The weblog to import the OPML into.
157 * @param folder The NEW folder name to import the OPML into.
158 * @param opml OPML data to be imported.
159 */
160 public void importBookmarks(Weblog weblog, String folder, String opml)
161 throws WebloggerException;
162
163
164 /**
165 * Release all resources associated with Roller session.
166 */
167 public void release();
168
169 }
SofCheck Inspector Build Version : 2.18479
| BookmarkManager.java |
2009-Jan-02 14:25:24 |
| BookmarkManager.class |
2009-Sep-04 03:12:30 |