KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > file > collectors > I_CmsResourceCollector


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/file/collectors/I_CmsResourceCollector.java,v $
3  * Date : $Date: 2006/03/27 14:52:50 $
4  * Version: $Revision: 1.8 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.file.collectors;
33
34 import org.opencms.file.CmsDataAccessException;
35 import org.opencms.file.CmsObject;
36 import org.opencms.main.CmsException;
37
38 import java.util.List JavaDoc;
39
40 /**
41  * A collector that generates list of {@link org.opencms.file.CmsResource} objects from the VFS.<p>
42  *
43  * @author Alexander Kandzior
44  *
45  * @version $Revision: 1.8 $
46  *
47  * @since 6.0.0
48  */

49 public interface I_CmsResourceCollector extends Comparable JavaDoc {
50
51     /**
52      * Returns a list of all collector names (Strings) this collector implementation supports.<p>
53      *
54      * @return a list of all collector names this collector implementation supports
55      */

56     List JavaDoc getCollectorNames();
57
58     /**
59      * Returns the link that must be executed when a user clicks on the direct edit
60      * "new" button on a list created by the default collector.<p>
61      *
62      * If this method returns <code>null</code>,
63      * it indicated that the selected collector implementation does not support a "create link",
64      * and so no "new" button will should shown on lists generated with this collector.<p>
65      *
66      * @param cms the current CmsObject
67      *
68      * @return the link to execute after a "new" button was clicked
69      *
70      * @throws CmsException if something goes wrong
71      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
72      * @see #getCreateParam(CmsObject, String, String)
73      *
74      */

75     String JavaDoc getCreateLink(CmsObject cms) throws CmsException, CmsDataAccessException;
76
77     /**
78      * Returns the link that must be executed when a user clicks on the direct edit
79      * "new" button on a list created by the named collector.<p>
80      *
81      * If this method returns <code>null</code>,
82      * it indicated that the selected collector implementation does not support a "create link",
83      * and so no "new" button will should shown on lists generated with this collector.<p>
84      *
85      * @param cms the current CmsObject
86      * @param collectorName the name of the collector to use
87      * @param param an optional collector parameter
88      *
89      * @return the link to execute after a "new" button was clicked
90      *
91      * @throws CmsException if something goes wrong
92      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
93      * @see #getCreateParam(CmsObject, String, String)
94      *
95      */

96     String JavaDoc getCreateLink(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) throws CmsException, CmsDataAccessException;
97     
98     /**
99      * Returns the default parameter that must be passed to the
100      * {@link #getCreateLink(CmsObject, String, String)} method.<p>
101      *
102      * If this method returns <code>null</code>,
103      * it indicates that the selected collector implementation does not support a "create link",
104      * and so no "new" button will should shown on lists generated with this collector.<p>
105      *
106      * @param cms the current CmsObject
107      *
108      * @return the parameter that will be passed to the {@link #getCreateLink(CmsObject, String, String)} method, or null
109      *
110      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
111      *
112      * @see #getCreateLink(CmsObject, String, String)
113      */

114     String JavaDoc getCreateParam(CmsObject cms) throws CmsDataAccessException;
115
116     /**
117      * Returns the parameter that must be passed to the
118      * {@link #getCreateLink(CmsObject, String, String)} method.<p>
119      *
120      * If this method returns <code>null</code>,
121      * it indicates that the selected collector implementation does not support a "create link",
122      * and so no "new" button will should shown on lists generated with this collector.<p>
123      *
124      * @param cms the current CmsObject
125      * @param collectorName the name of the collector to use
126      * @param param an optional collector parameter from the current page context
127      *
128      * @return the parameter that will be passed to the {@link #getCreateLink(CmsObject, String, String)} method, or null
129      *
130      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
131      *
132      * @see #getCreateLink(CmsObject, String, String)
133      */

134     String JavaDoc getCreateParam(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) throws CmsDataAccessException;
135     
136     /**
137      * Returns the default collector name to use for collecting resources.<p>
138      *
139      * @return the default collector name
140      */

141     String JavaDoc getDefaultCollectorName();
142
143     /**
144      * Returns the default collector parameter to use for collecting resources.<p>
145      *
146      * @return the default collector parameter
147      */

148     String JavaDoc getDefaultCollectorParam();
149
150     /**
151      * Returns the "order weight" of this collector.<p>
152      *
153      * The "order weight" is important because two collector classes may provide a collector with
154      * the same name. If this is the case, the collector implementation with the higher
155      * order number "overrules" the lower order number classs.<p>
156      *
157      * @return the "order weight" of this collector
158      */

159     int getOrder();
160     
161     /**
162      * Returns a list of {@link org.opencms.file.CmsResource} Objects that are
163      * gathered in the VFS using the default collector name and parameter.<p>
164      *
165      * @param cms the current CmsObject
166      *
167      * @return a list of CmsXmlContent objects
168      *
169      * @throws CmsException if something goes wrong
170      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
171      */

172     List JavaDoc getResults(CmsObject cms) throws CmsDataAccessException, CmsException;
173     
174     /**
175      * Returns a list of {@link org.opencms.file.CmsResource} Objects that are
176      * gathered in the VFS using the named collector.<p>
177      *
178      * @param cms the current CmsObject
179      * @param collectorName the name of the collector to use
180      * @param param an optional collector parameter
181      *
182      * @return a list of CmsXmlContent objects
183      *
184      * @throws CmsException if something goes wrong
185      * @throws CmsDataAccessException if the param attrib of the corresponding collector tag is invalid
186      */

187     List JavaDoc getResults(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) throws CmsDataAccessException, CmsException;
188     
189     /**
190      * Sets the default collector name to use for collecting resources.<p>
191      *
192      * @param collectorName the default collector name
193      */

194     void setDefaultCollectorName(String JavaDoc collectorName);
195     
196     /**
197      * Sets the default collector parameter to use for collecting resources.<p>
198      *
199      * @param param the default collector parameter
200      */

201     void setDefaultCollectorParam(String JavaDoc param);
202     
203     /**
204      * Sets the "order weight" of this collector.<p>
205      *
206      * @param order the order weight to set
207      *
208      * @see #getOrder()
209      */

210     void setOrder(int order);
211 }
Popular Tags