KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > list > CmsListResourcesCollector


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/workplace/list/CmsListResourcesCollector.java,v $
3  * Date : $Date: 2006/04/21 13:21:49 $
4  * Version: $Revision: 1.4 $
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.workplace.list;
33
34 import org.opencms.file.CmsObject;
35 import org.opencms.file.collectors.I_CmsResourceCollector;
36
37 import java.util.ArrayList JavaDoc;
38 import java.util.List JavaDoc;
39
40 /**
41  * Collector for receiving {@link org.opencms.file.CmsResource} from a {@link A_CmsListExplorerDialog}.<p>
42  *
43  * @author Michael Moossen
44  *
45  * @version $Revision: 1.4 $
46  *
47  * @since 6.1.2
48  */

49 public class CmsListResourcesCollector implements I_CmsResourceCollector {
50
51     /** Parameter of the default collector name. */
52     public static final String JavaDoc LIST_COLLECTOR_NAME = "listresources";
53
54     /** The collector name. */
55     private String JavaDoc m_collectorName;
56
57     /** Sort order. Not used yet. */
58     private int m_order;
59
60     /** The list of resources, in the display order. */
61     private final List JavaDoc m_resources;
62
63     /**
64      * Constructor, creates a new {@link CmsListResourcesCollector}.<p>
65      *
66      * @param resources a list of {@link org.opencms.file.CmsResource} objects.
67      */

68     public CmsListResourcesCollector(List JavaDoc resources) {
69
70         m_collectorName = LIST_COLLECTOR_NAME;
71         m_order = 0;
72         m_resources = resources;
73     }
74
75     /**
76      * @see java.lang.Comparable#compareTo(java.lang.Object)
77      */

78     public int compareTo(Object JavaDoc arg0) {
79
80         return 0;
81     }
82
83     /**
84      * @see org.opencms.file.collectors.I_CmsResourceCollector#getCollectorNames()
85      */

86     public List JavaDoc getCollectorNames() {
87
88         List JavaDoc names = new ArrayList JavaDoc();
89         names.add(LIST_COLLECTOR_NAME);
90         return names;
91     }
92
93     /**
94      * @see org.opencms.file.collectors.I_CmsResourceCollector#getCreateLink(org.opencms.file.CmsObject)
95      */

96     public String JavaDoc getCreateLink(CmsObject cms) {
97
98         return null;
99     }
100
101     /**
102      * @see org.opencms.file.collectors.I_CmsResourceCollector#getCreateLink(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
103      */

104     public String JavaDoc getCreateLink(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) {
105
106         return null;
107     }
108
109     /**
110      * @see org.opencms.file.collectors.I_CmsResourceCollector#getCreateParam(org.opencms.file.CmsObject)
111      */

112     public String JavaDoc getCreateParam(CmsObject cms) {
113
114         return null;
115     }
116
117     /**
118      * @see org.opencms.file.collectors.I_CmsResourceCollector#getCreateParam(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
119      */

120     public String JavaDoc getCreateParam(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) {
121
122         return null;
123     }
124
125     /**
126      * @see org.opencms.file.collectors.I_CmsResourceCollector#getDefaultCollectorName()
127      */

128     public String JavaDoc getDefaultCollectorName() {
129
130         return m_collectorName;
131     }
132
133     /**
134      * @see org.opencms.file.collectors.I_CmsResourceCollector#getDefaultCollectorParam()
135      */

136     public String JavaDoc getDefaultCollectorParam() {
137
138         return null;
139     }
140
141     /**
142      * @see org.opencms.file.collectors.I_CmsResourceCollector#getOrder()
143      */

144     public int getOrder() {
145
146         return m_order;
147     }
148
149     /**
150      * @see org.opencms.file.collectors.I_CmsResourceCollector#getResults(org.opencms.file.CmsObject)
151      */

152     public List JavaDoc getResults(CmsObject cms) {
153
154         return m_resources;
155     }
156
157     /**
158      * @see org.opencms.file.collectors.I_CmsResourceCollector#getResults(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
159      */

160     public List JavaDoc getResults(CmsObject cms, String JavaDoc collectorName, String JavaDoc param) {
161
162         return m_resources;
163     }
164
165     /**
166      * @see org.opencms.file.collectors.I_CmsResourceCollector#setDefaultCollectorName(java.lang.String)
167      */

168     public void setDefaultCollectorName(String JavaDoc collectorName) {
169
170         m_collectorName = collectorName;
171     }
172
173     /**
174      * @see org.opencms.file.collectors.I_CmsResourceCollector#setDefaultCollectorParam(java.lang.String)
175      */

176     public void setDefaultCollectorParam(String JavaDoc param) {
177
178         // no-param
179
}
180
181     /**
182      * @see org.opencms.file.collectors.I_CmsResourceCollector#setOrder(int)
183      */

184     public void setOrder(int order) {
185
186         m_order = order;
187     }
188 }
189
Popular Tags