1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.polls.service;
24  
25  
26  /**
27   * <a href="PollsQuestionLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.polls.service.PollsQuestionLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.polls.service.PollsQuestionLocalService
50   * @see com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory
51   *
52   */
53  public class PollsQuestionLocalServiceUtil {
54      public static com.liferay.portlet.polls.model.PollsQuestion addPollsQuestion(
55          com.liferay.portlet.polls.model.PollsQuestion model)
56          throws com.liferay.portal.SystemException {
57          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
58  
59          return pollsQuestionLocalService.addPollsQuestion(model);
60      }
61  
62      public static java.util.List dynamicQuery(
63          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
64          throws com.liferay.portal.SystemException {
65          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
66  
67          return pollsQuestionLocalService.dynamicQuery(queryInitializer);
68      }
69  
70      public static java.util.List dynamicQuery(
71          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
72          int begin, int end) throws com.liferay.portal.SystemException {
73          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
74  
75          return pollsQuestionLocalService.dynamicQuery(queryInitializer, begin,
76              end);
77      }
78  
79      public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
80          com.liferay.portlet.polls.model.PollsQuestion model)
81          throws com.liferay.portal.SystemException {
82          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
83  
84          return pollsQuestionLocalService.updatePollsQuestion(model);
85      }
86  
87      public static com.liferay.portlet.polls.service.persistence.PollsChoicePersistence getPollsChoicePersistence() {
88          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
89  
90          return pollsQuestionLocalService.getPollsChoicePersistence();
91      }
92  
93      public static void setPollsChoicePersistence(
94          com.liferay.portlet.polls.service.persistence.PollsChoicePersistence pollsChoicePersistence) {
95          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
96  
97          pollsQuestionLocalService.setPollsChoicePersistence(pollsChoicePersistence);
98      }
99  
100     public static com.liferay.portlet.polls.service.persistence.PollsChoiceFinder getPollsChoiceFinder() {
101         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
102 
103         return pollsQuestionLocalService.getPollsChoiceFinder();
104     }
105 
106     public static void setPollsChoiceFinder(
107         com.liferay.portlet.polls.service.persistence.PollsChoiceFinder pollsChoiceFinder) {
108         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
109 
110         pollsQuestionLocalService.setPollsChoiceFinder(pollsChoiceFinder);
111     }
112 
113     public static com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence getPollsQuestionPersistence() {
114         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
115 
116         return pollsQuestionLocalService.getPollsQuestionPersistence();
117     }
118 
119     public static void setPollsQuestionPersistence(
120         com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence pollsQuestionPersistence) {
121         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
122 
123         pollsQuestionLocalService.setPollsQuestionPersistence(pollsQuestionPersistence);
124     }
125 
126     public static com.liferay.portlet.polls.service.persistence.PollsVotePersistence getPollsVotePersistence() {
127         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
128 
129         return pollsQuestionLocalService.getPollsVotePersistence();
130     }
131 
132     public static void setPollsVotePersistence(
133         com.liferay.portlet.polls.service.persistence.PollsVotePersistence pollsVotePersistence) {
134         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
135 
136         pollsQuestionLocalService.setPollsVotePersistence(pollsVotePersistence);
137     }
138 
139     public static com.liferay.portal.service.persistence.ResourcePersistence getResourcePersistence() {
140         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
141 
142         return pollsQuestionLocalService.getResourcePersistence();
143     }
144 
145     public static void setResourcePersistence(
146         com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence) {
147         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
148 
149         pollsQuestionLocalService.setResourcePersistence(resourcePersistence);
150     }
151 
152     public static com.liferay.portal.service.persistence.ResourceFinder getResourceFinder() {
153         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
154 
155         return pollsQuestionLocalService.getResourceFinder();
156     }
157 
158     public static void setResourceFinder(
159         com.liferay.portal.service.persistence.ResourceFinder resourceFinder) {
160         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
161 
162         pollsQuestionLocalService.setResourceFinder(resourceFinder);
163     }
164 
165     public static com.liferay.portal.service.persistence.UserPersistence getUserPersistence() {
166         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
167 
168         return pollsQuestionLocalService.getUserPersistence();
169     }
170 
171     public static void setUserPersistence(
172         com.liferay.portal.service.persistence.UserPersistence userPersistence) {
173         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
174 
175         pollsQuestionLocalService.setUserPersistence(userPersistence);
176     }
177 
178     public static com.liferay.portal.service.persistence.UserFinder getUserFinder() {
179         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
180 
181         return pollsQuestionLocalService.getUserFinder();
182     }
183 
184     public static void setUserFinder(
185         com.liferay.portal.service.persistence.UserFinder userFinder) {
186         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
187 
188         pollsQuestionLocalService.setUserFinder(userFinder);
189     }
190 
191     public static void afterPropertiesSet() {
192         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
193 
194         pollsQuestionLocalService.afterPropertiesSet();
195     }
196 
197     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
198         long userId, long plid, java.lang.String title,
199         java.lang.String description, int expirationDateMonth,
200         int expirationDateDay, int expirationDateYear, int expirationDateHour,
201         int expirationDateMinute, boolean neverExpire,
202         boolean addCommunityPermissions, boolean addGuestPermissions)
203         throws com.liferay.portal.PortalException, 
204             com.liferay.portal.SystemException {
205         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
206 
207         return pollsQuestionLocalService.addQuestion(userId, plid, title,
208             description, expirationDateMonth, expirationDateDay,
209             expirationDateYear, expirationDateHour, expirationDateMinute,
210             neverExpire, addCommunityPermissions, addGuestPermissions);
211     }
212 
213     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
214         java.lang.String uuid, long userId, long plid, java.lang.String title,
215         java.lang.String description, int expirationDateMonth,
216         int expirationDateDay, int expirationDateYear, int expirationDateHour,
217         int expirationDateMinute, boolean neverExpire,
218         boolean addCommunityPermissions, boolean addGuestPermissions)
219         throws com.liferay.portal.PortalException, 
220             com.liferay.portal.SystemException {
221         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
222 
223         return pollsQuestionLocalService.addQuestion(uuid, userId, plid, title,
224             description, expirationDateMonth, expirationDateDay,
225             expirationDateYear, expirationDateHour, expirationDateMinute,
226             neverExpire, addCommunityPermissions, addGuestPermissions);
227     }
228 
229     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
230         long userId, long plid, java.lang.String title,
231         java.lang.String description, int expirationDateMonth,
232         int expirationDateDay, int expirationDateYear, int expirationDateHour,
233         int expirationDateMinute, boolean neverExpire, java.util.List choices,
234         boolean addCommunityPermissions, boolean addGuestPermissions)
235         throws com.liferay.portal.PortalException, 
236             com.liferay.portal.SystemException {
237         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
238 
239         return pollsQuestionLocalService.addQuestion(userId, plid, title,
240             description, expirationDateMonth, expirationDateDay,
241             expirationDateYear, expirationDateHour, expirationDateMinute,
242             neverExpire, choices, addCommunityPermissions, addGuestPermissions);
243     }
244 
245     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
246         long userId, long plid, java.lang.String title,
247         java.lang.String description, int expirationDateMonth,
248         int expirationDateDay, int expirationDateYear, int expirationDateHour,
249         int expirationDateMinute, boolean neverExpire, java.util.List choices,
250         java.lang.String[] communityPermissions,
251         java.lang.String[] guestPermissions)
252         throws com.liferay.portal.PortalException, 
253             com.liferay.portal.SystemException {
254         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
255 
256         return pollsQuestionLocalService.addQuestion(userId, plid, title,
257             description, expirationDateMonth, expirationDateDay,
258             expirationDateYear, expirationDateHour, expirationDateMinute,
259             neverExpire, choices, communityPermissions, guestPermissions);
260     }
261 
262     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
263         java.lang.String uuid, long userId, long plid, java.lang.String title,
264         java.lang.String description, int expirationDateMonth,
265         int expirationDateDay, int expirationDateYear, int expirationDateHour,
266         int expirationDateMinute, boolean neverExpire, java.util.List choices,
267         java.lang.Boolean addCommunityPermissions,
268         java.lang.Boolean addGuestPermissions,
269         java.lang.String[] communityPermissions,
270         java.lang.String[] guestPermissions)
271         throws com.liferay.portal.PortalException, 
272             com.liferay.portal.SystemException {
273         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
274 
275         return pollsQuestionLocalService.addQuestion(uuid, userId, plid, title,
276             description, expirationDateMonth, expirationDateDay,
277             expirationDateYear, expirationDateHour, expirationDateMinute,
278             neverExpire, choices, addCommunityPermissions, addGuestPermissions,
279             communityPermissions, guestPermissions);
280     }
281 
282     public static void addQuestionResources(long questionId,
283         boolean addCommunityPermissions, boolean addGuestPermissions)
284         throws com.liferay.portal.PortalException, 
285             com.liferay.portal.SystemException {
286         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
287 
288         pollsQuestionLocalService.addQuestionResources(questionId,
289             addCommunityPermissions, addGuestPermissions);
290     }
291 
292     public static void addQuestionResources(
293         com.liferay.portlet.polls.model.PollsQuestion question,
294         boolean addCommunityPermissions, boolean addGuestPermissions)
295         throws com.liferay.portal.PortalException, 
296             com.liferay.portal.SystemException {
297         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
298 
299         pollsQuestionLocalService.addQuestionResources(question,
300             addCommunityPermissions, addGuestPermissions);
301     }
302 
303     public static void addQuestionResources(long questionId,
304         java.lang.String[] communityPermissions,
305         java.lang.String[] guestPermissions)
306         throws com.liferay.portal.PortalException, 
307             com.liferay.portal.SystemException {
308         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
309 
310         pollsQuestionLocalService.addQuestionResources(questionId,
311             communityPermissions, guestPermissions);
312     }
313 
314     public static void addQuestionResources(
315         com.liferay.portlet.polls.model.PollsQuestion question,
316         java.lang.String[] communityPermissions,
317         java.lang.String[] guestPermissions)
318         throws com.liferay.portal.PortalException, 
319             com.liferay.portal.SystemException {
320         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
321 
322         pollsQuestionLocalService.addQuestionResources(question,
323             communityPermissions, guestPermissions);
324     }
325 
326     public static void deleteQuestion(long questionId)
327         throws com.liferay.portal.PortalException, 
328             com.liferay.portal.SystemException {
329         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
330 
331         pollsQuestionLocalService.deleteQuestion(questionId);
332     }
333 
334     public static void deleteQuestion(
335         com.liferay.portlet.polls.model.PollsQuestion question)
336         throws com.liferay.portal.PortalException, 
337             com.liferay.portal.SystemException {
338         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
339 
340         pollsQuestionLocalService.deleteQuestion(question);
341     }
342 
343     public static void deleteQuestions(long groupId)
344         throws com.liferay.portal.PortalException, 
345             com.liferay.portal.SystemException {
346         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
347 
348         pollsQuestionLocalService.deleteQuestions(groupId);
349     }
350 
351     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
352         long questionId)
353         throws com.liferay.portal.PortalException, 
354             com.liferay.portal.SystemException {
355         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
356 
357         return pollsQuestionLocalService.getQuestion(questionId);
358     }
359 
360     public static java.util.List getQuestions(long groupId)
361         throws com.liferay.portal.SystemException {
362         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
363 
364         return pollsQuestionLocalService.getQuestions(groupId);
365     }
366 
367     public static java.util.List getQuestions(long groupId, int begin, int end)
368         throws com.liferay.portal.SystemException {
369         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
370 
371         return pollsQuestionLocalService.getQuestions(groupId, begin, end);
372     }
373 
374     public static int getQuestionsCount(long groupId)
375         throws com.liferay.portal.SystemException {
376         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
377 
378         return pollsQuestionLocalService.getQuestionsCount(groupId);
379     }
380 
381     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
382         long userId, long questionId, java.lang.String title,
383         java.lang.String description, int expirationDateMonth,
384         int expirationDateDay, int expirationDateYear, int expirationDateHour,
385         int expirationDateMinute, boolean neverExpire)
386         throws com.liferay.portal.PortalException, 
387             com.liferay.portal.SystemException {
388         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
389 
390         return pollsQuestionLocalService.updateQuestion(userId, questionId,
391             title, description, expirationDateMonth, expirationDateDay,
392             expirationDateYear, expirationDateHour, expirationDateMinute,
393             neverExpire);
394     }
395 
396     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
397         long userId, long questionId, java.lang.String title,
398         java.lang.String description, int expirationDateMonth,
399         int expirationDateDay, int expirationDateYear, int expirationDateHour,
400         int expirationDateMinute, boolean neverExpire, java.util.List choices)
401         throws com.liferay.portal.PortalException, 
402             com.liferay.portal.SystemException {
403         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
404 
405         return pollsQuestionLocalService.updateQuestion(userId, questionId,
406             title, description, expirationDateMonth, expirationDateDay,
407             expirationDateYear, expirationDateHour, expirationDateMinute,
408             neverExpire, choices);
409     }
410 }