KickJava   Java API By Example, From Geeks To Geeks.

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


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.pojos.Assoc;
24 import org.apache.roller.pojos.BookmarkData;
25 import org.apache.roller.pojos.FolderData;
26 import org.apache.roller.pojos.WebsiteData;
27
28
29 /**
30  * Interface to Bookmark Management. Provides methods for retrieving, storing,
31  * moving, removing and querying for folders and bookmarks.
32  */

33 public interface BookmarkManager {
34     
35     
36     public void saveBookmark(BookmarkData bookmark) throws RollerException;
37     
38     
39     /**
40      * Delete bookmark.
41      */

42     public void removeBookmark(BookmarkData bookmark) throws RollerException;
43     
44     /**
45      * Retrieve bookmark by ID, a persistent instance.
46      */

47     public BookmarkData getBookmark(String JavaDoc id) throws RollerException;
48     
49     
50     /**
51      * @param data
52      * @param subfolders
53      * @return
54      */

55     public List JavaDoc getBookmarks(FolderData data, boolean subfolders)
56             throws RollerException;
57     
58     
59     public void saveFolder(FolderData folder) throws RollerException;
60     
61     
62     public void removeFolder(FolderData folder) throws RollerException;
63     
64     
65     /**
66      * Retrieve folder by ID, a persistent instance.
67      */

68     public FolderData getFolder(String JavaDoc id) throws RollerException;
69     
70     
71     /**
72      * Get all folders for a website.
73      *
74      * @param website Website.
75      */

76     public List JavaDoc getAllFolders(WebsiteData wd) throws RollerException;
77     
78     
79     /**
80      * Get top level folders for a website.
81      *
82      * @param website Website.
83      */

84     public FolderData getRootFolder(WebsiteData website) throws RollerException;
85     
86     
87     /**
88      * Get folder specified by website and folderPath.
89      *
90      * @param website Website of folder.
91      * @param folderPath Path of folder, relative to folder root.
92      */

93     public FolderData getFolder(WebsiteData website, String JavaDoc folderPath)
94             throws RollerException;
95     
96     /**
97      * Get absolute path to folder, appropriate for use by getFolderByPath().
98      *
99      * @param folder Folder.
100      * @return Forward slash separated path string.
101      */

102     public String JavaDoc getPath(FolderData folder) throws RollerException;
103     
104     
105     /**
106      * Get subfolder by path relative to specified folder.
107      *
108      * @param folder Root of path or null to start at top of folder tree.
109      * @param path Path of folder to be located.
110      * @param website Website of folders.
111      * @return FolderData specified by path or null if not found.
112      */

113     public FolderData getFolderByPath(WebsiteData wd, FolderData folder, String JavaDoc string)
114             throws RollerException;
115     
116     
117     /**
118      * Determine if folder is in use. A folder is <em>in use</em> if it contains any bookmarks
119      * or has any children.
120      *
121      * @param folder
122      * @return true if the folder contains bookmarks or has children, false otherwise.
123      * @throws RollerException
124      */

125     public boolean isFolderInUse(FolderData folder) throws RollerException;
126     
127     
128     /**
129      * Check duplicate folder name.
130      */

131     public boolean isDuplicateFolderName(FolderData data) throws RollerException;
132     
133     
134     /**
135      * Determines if folder is descendent of folder.
136      */

137     public boolean isDescendentOf(FolderData data, FolderData ancestor) throws RollerException;
138     
139     
140     /**
141      */

142     public Assoc getFolderParentAssoc(FolderData data) throws RollerException;
143     
144     /**
145      */

146     public List JavaDoc getFolderChildAssocs(FolderData data) throws RollerException;
147     
148     /**
149      */

150     public List JavaDoc getAllFolderDecscendentAssocs(FolderData data) throws RollerException;
151     
152     /**
153      */

154     public List JavaDoc getFolderAncestorAssocs(FolderData data) throws RollerException;
155     
156     
157     /**
158      * Import bookmarks from OPML string into specified folder.
159      *
160      * @param site Website.
161      * @param folder Name of folder to hold bookmarks.
162      * @param opml OPML data to be imported.
163      */

164     public void importBookmarks(WebsiteData site, String JavaDoc folder, String JavaDoc opml)
165             throws RollerException;
166     
167     
168     /**
169      * Move contents of folder to another folder.
170      *
171      * @param src Source folder.
172      * @param dest Destination folder.
173      */

174     public void moveFolderContents(FolderData src, FolderData dest)
175             throws RollerException;
176     
177     
178     /**
179      * Delete contents of specified folder.
180      */

181     public void removeFolderContents(FolderData src) throws RollerException;
182     
183     
184     /**
185      * Release all resources associated with Roller session.
186      */

187     public void release();
188     
189 }
190
191
Popular Tags