KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > blog > logic > BlogController


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenChronicle
5  *
6  * $Id: BlogController.java,v 1.4 2007/01/07 06:04:32 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21  
22 package org.opensubsystems.blog.logic;
23
24 import java.rmi.RemoteException JavaDoc;
25 import java.util.List JavaDoc;
26
27 import org.opensubsystems.blog.data.Blog;
28 import org.opensubsystems.core.error.OSSException;
29 import org.opensubsystems.core.logic.ModifiableDataController;
30
31 /**
32  * This interface define business logic related to blogs.
33  *
34  * @version $Id: BlogController.java,v 1.4 2007/01/07 06:04:32 bastafidli Exp $
35  * @author Miro Halas
36  * @code.reviewer Miro Halas
37  * @code.reviewed Initial revision
38  */

39 public interface BlogController extends ModifiableDataController
40 {
41    /**
42     * Get blog knowing just the folder where it's entries are displayed.
43     *
44     * @param strFolder - folder where entries for given folder are displayed
45     * @return Blog - specified blog or null if not found
46     * @throws OSSException - an error has occured
47     * @throws RemoteException - required since this method can be called remotely
48     */

49    Blog get(
50       String JavaDoc strFolder
51    ) throws OSSException,
52             RemoteException JavaDoc;
53
54    /**
55     * Get all entries for a given blog.
56     *
57     * @param iBlogId - id of a blog to get entries for
58     * @return List - list of Entry objects or null if blog doesn't contain any
59     * entries
60     * @throws OSSException - an error has occured
61     * @throws RemoteException - required since this method can be called remotely
62     */

63    List JavaDoc getEntries(
64       int iBlogId
65    ) throws OSSException,
66             RemoteException JavaDoc;
67    
68    /**
69     * Get blog and its entries knowing just the folder where it's entries
70     * are displayed.
71     *
72     * @param strFolder - folder where entries for given folder are displayed
73     * @return Object[] - index 0 is blog and index 1 is list of its entries
74     * @throws OSSException - an error has occured
75     * @throws RemoteException - required since this method can be called remotely
76     */

77    Object JavaDoc[] getWithEntries(
78       String JavaDoc strFolder
79    ) throws OSSException,
80             RemoteException JavaDoc;
81
82    /**
83     * Get blog and entry knowing just the folder where the entry are displayed
84     * and the id of the entry.
85     *
86     * @param strFolder - folder where entries for given folder are displayed
87     * @param iEntryId - id of the blog entry to load
88     * @return Object[] - index 0 is blog and index 1 is the entry
89     * @throws OSSException - an error has occured
90     * @throws RemoteException - required since this method can be called remotely
91     */

92    Object JavaDoc[] getWithEntry(
93       String JavaDoc strFolder,
94       int iEntryId
95    ) throws OSSException,
96             RemoteException JavaDoc;
97
98    /**
99     * Get blog and entry knowing just the id of the blog and the id of the entry.
100     *
101     * @param iBlogId - id of the blog to load
102     * @param iEntryId - id of the blog entry to load
103     * @return Object[] - index 0 is blog and index 1 is the entry
104     * @throws OSSException - an error has occured
105     * @throws RemoteException - required since this method can be called remotely
106     */

107    Object JavaDoc[] getWithEntry(
108       int iBlogId,
109       int iEntryId
110    ) throws OSSException,
111             RemoteException JavaDoc;
112
113    /**
114     * Get all blogs.
115     *
116     * @return List - list of blogs objects sorted alphabetically
117     * @throws OSSException - an error has occured
118     * @throws RemoteException - required since this method can be called remotely
119     */

120    List JavaDoc getAll(
121    ) throws OSSException,
122             RemoteException JavaDoc;
123
124    /**
125     * Delete entry. We have to define separate method for this operation since
126     * the default data type for this controller is blog and therefore the default
127     * implementation will just delete blogs.
128     *
129     * @param iId - id of the entry to delete
130     * @throws OSSException - an error has occured
131     * @throws RemoteException - required since this method can be called remotely
132     */

133    void deleteEntry(
134       int iId
135    ) throws OSSException,
136             RemoteException JavaDoc;
137 }
138
Popular Tags