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 pollsQuestion)
56          throws com.liferay.portal.SystemException {
57          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
58  
59          return pollsQuestionLocalService.addPollsQuestion(pollsQuestion);
60      }
61  
62      public static void deletePollsQuestion(long questionId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
66  
67          pollsQuestionLocalService.deletePollsQuestion(questionId);
68      }
69  
70      public static void deletePollsQuestion(
71          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
75  
76          pollsQuestionLocalService.deletePollsQuestion(pollsQuestion);
77      }
78  
79      public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
83  
84          return pollsQuestionLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
91  
92          return pollsQuestionLocalService.dynamicQuery(queryInitializer, begin,
93              end);
94      }
95  
96      public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
97          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
98          throws com.liferay.portal.SystemException {
99          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
100 
101         return pollsQuestionLocalService.updatePollsQuestion(pollsQuestion);
102     }
103 
104     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
105         long userId, long plid, java.lang.String title,
106         java.lang.String description, int expirationDateMonth,
107         int expirationDateDay, int expirationDateYear, int expirationDateHour,
108         int expirationDateMinute, boolean neverExpire,
109         boolean addCommunityPermissions, boolean addGuestPermissions)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
113 
114         return pollsQuestionLocalService.addQuestion(userId, plid, title,
115             description, expirationDateMonth, expirationDateDay,
116             expirationDateYear, expirationDateHour, expirationDateMinute,
117             neverExpire, addCommunityPermissions, addGuestPermissions);
118     }
119 
120     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
121         java.lang.String uuid, long userId, long plid, java.lang.String title,
122         java.lang.String description, int expirationDateMonth,
123         int expirationDateDay, int expirationDateYear, int expirationDateHour,
124         int expirationDateMinute, boolean neverExpire,
125         boolean addCommunityPermissions, boolean addGuestPermissions)
126         throws com.liferay.portal.PortalException,
127             com.liferay.portal.SystemException {
128         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
129 
130         return pollsQuestionLocalService.addQuestion(uuid, userId, plid, title,
131             description, expirationDateMonth, expirationDateDay,
132             expirationDateYear, expirationDateHour, expirationDateMinute,
133             neverExpire, addCommunityPermissions, addGuestPermissions);
134     }
135 
136     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
137         long userId, long plid, java.lang.String title,
138         java.lang.String description, int expirationDateMonth,
139         int expirationDateDay, int expirationDateYear, int expirationDateHour,
140         int expirationDateMinute, boolean neverExpire,
141         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
142         boolean addCommunityPermissions, boolean addGuestPermissions)
143         throws com.liferay.portal.PortalException,
144             com.liferay.portal.SystemException {
145         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
146 
147         return pollsQuestionLocalService.addQuestion(userId, plid, title,
148             description, expirationDateMonth, expirationDateDay,
149             expirationDateYear, expirationDateHour, expirationDateMinute,
150             neverExpire, choices, addCommunityPermissions, addGuestPermissions);
151     }
152 
153     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
154         long userId, long plid, java.lang.String title,
155         java.lang.String description, int expirationDateMonth,
156         int expirationDateDay, int expirationDateYear, int expirationDateHour,
157         int expirationDateMinute, boolean neverExpire,
158         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
159         java.lang.String[] communityPermissions,
160         java.lang.String[] guestPermissions)
161         throws com.liferay.portal.PortalException,
162             com.liferay.portal.SystemException {
163         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
164 
165         return pollsQuestionLocalService.addQuestion(userId, plid, title,
166             description, expirationDateMonth, expirationDateDay,
167             expirationDateYear, expirationDateHour, expirationDateMinute,
168             neverExpire, choices, communityPermissions, guestPermissions);
169     }
170 
171     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
172         java.lang.String uuid, long userId, long plid, java.lang.String title,
173         java.lang.String description, int expirationDateMonth,
174         int expirationDateDay, int expirationDateYear, int expirationDateHour,
175         int expirationDateMinute, boolean neverExpire,
176         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
177         java.lang.Boolean addCommunityPermissions,
178         java.lang.Boolean addGuestPermissions,
179         java.lang.String[] communityPermissions,
180         java.lang.String[] guestPermissions)
181         throws com.liferay.portal.PortalException,
182             com.liferay.portal.SystemException {
183         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
184 
185         return pollsQuestionLocalService.addQuestion(uuid, userId, plid, title,
186             description, expirationDateMonth, expirationDateDay,
187             expirationDateYear, expirationDateHour, expirationDateMinute,
188             neverExpire, choices, addCommunityPermissions, addGuestPermissions,
189             communityPermissions, guestPermissions);
190     }
191 
192     public static void addQuestionResources(long questionId,
193         boolean addCommunityPermissions, boolean addGuestPermissions)
194         throws com.liferay.portal.PortalException,
195             com.liferay.portal.SystemException {
196         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
197 
198         pollsQuestionLocalService.addQuestionResources(questionId,
199             addCommunityPermissions, addGuestPermissions);
200     }
201 
202     public static void addQuestionResources(
203         com.liferay.portlet.polls.model.PollsQuestion question,
204         boolean addCommunityPermissions, boolean addGuestPermissions)
205         throws com.liferay.portal.PortalException,
206             com.liferay.portal.SystemException {
207         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
208 
209         pollsQuestionLocalService.addQuestionResources(question,
210             addCommunityPermissions, addGuestPermissions);
211     }
212 
213     public static void addQuestionResources(long questionId,
214         java.lang.String[] communityPermissions,
215         java.lang.String[] guestPermissions)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
219 
220         pollsQuestionLocalService.addQuestionResources(questionId,
221             communityPermissions, guestPermissions);
222     }
223 
224     public static void addQuestionResources(
225         com.liferay.portlet.polls.model.PollsQuestion question,
226         java.lang.String[] communityPermissions,
227         java.lang.String[] guestPermissions)
228         throws com.liferay.portal.PortalException,
229             com.liferay.portal.SystemException {
230         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
231 
232         pollsQuestionLocalService.addQuestionResources(question,
233             communityPermissions, guestPermissions);
234     }
235 
236     public static void deleteQuestion(long questionId)
237         throws com.liferay.portal.PortalException,
238             com.liferay.portal.SystemException {
239         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
240 
241         pollsQuestionLocalService.deleteQuestion(questionId);
242     }
243 
244     public static void deleteQuestion(
245         com.liferay.portlet.polls.model.PollsQuestion question)
246         throws com.liferay.portal.PortalException,
247             com.liferay.portal.SystemException {
248         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
249 
250         pollsQuestionLocalService.deleteQuestion(question);
251     }
252 
253     public static void deleteQuestions(long groupId)
254         throws com.liferay.portal.PortalException,
255             com.liferay.portal.SystemException {
256         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
257 
258         pollsQuestionLocalService.deleteQuestions(groupId);
259     }
260 
261     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
262         long questionId)
263         throws com.liferay.portal.PortalException,
264             com.liferay.portal.SystemException {
265         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
266 
267         return pollsQuestionLocalService.getQuestion(questionId);
268     }
269 
270     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
271         long groupId) throws com.liferay.portal.SystemException {
272         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
273 
274         return pollsQuestionLocalService.getQuestions(groupId);
275     }
276 
277     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
278         long groupId, int begin, int end)
279         throws com.liferay.portal.SystemException {
280         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
281 
282         return pollsQuestionLocalService.getQuestions(groupId, begin, end);
283     }
284 
285     public static int getQuestionsCount(long groupId)
286         throws com.liferay.portal.SystemException {
287         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
288 
289         return pollsQuestionLocalService.getQuestionsCount(groupId);
290     }
291 
292     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
293         long userId, long questionId, java.lang.String title,
294         java.lang.String description, int expirationDateMonth,
295         int expirationDateDay, int expirationDateYear, int expirationDateHour,
296         int expirationDateMinute, boolean neverExpire)
297         throws com.liferay.portal.PortalException,
298             com.liferay.portal.SystemException {
299         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
300 
301         return pollsQuestionLocalService.updateQuestion(userId, questionId,
302             title, description, expirationDateMonth, expirationDateDay,
303             expirationDateYear, expirationDateHour, expirationDateMinute,
304             neverExpire);
305     }
306 
307     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
308         long userId, long questionId, java.lang.String title,
309         java.lang.String description, int expirationDateMonth,
310         int expirationDateDay, int expirationDateYear, int expirationDateHour,
311         int expirationDateMinute, boolean neverExpire,
312         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices)
313         throws com.liferay.portal.PortalException,
314             com.liferay.portal.SystemException {
315         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
316 
317         return pollsQuestionLocalService.updateQuestion(userId, questionId,
318             title, description, expirationDateMonth, expirationDateDay,
319             expirationDateYear, expirationDateHour, expirationDateMinute,
320             neverExpire, choices);
321     }
322 }