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