1   /**
2    * Copyright (c) 2000-2009 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   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portlet.polls.service.PollsQuestionLocalService
45   *
46   */
47  public class PollsQuestionLocalServiceUtil {
48      public static com.liferay.portlet.polls.model.PollsQuestion addPollsQuestion(
49          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
50          throws com.liferay.portal.SystemException {
51          return getService().addPollsQuestion(pollsQuestion);
52      }
53  
54      public static com.liferay.portlet.polls.model.PollsQuestion createPollsQuestion(
55          long questionId) {
56          return getService().createPollsQuestion(questionId);
57      }
58  
59      public static void deletePollsQuestion(long questionId)
60          throws com.liferay.portal.PortalException,
61              com.liferay.portal.SystemException {
62          getService().deletePollsQuestion(questionId);
63      }
64  
65      public static void deletePollsQuestion(
66          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
67          throws com.liferay.portal.SystemException {
68          getService().deletePollsQuestion(pollsQuestion);
69      }
70  
71      public static java.util.List<Object> dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
73          throws com.liferay.portal.SystemException {
74          return getService().dynamicQuery(dynamicQuery);
75      }
76  
77      public static java.util.List<Object> dynamicQuery(
78          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
79          int end) throws com.liferay.portal.SystemException {
80          return getService().dynamicQuery(dynamicQuery, start, end);
81      }
82  
83      public static com.liferay.portlet.polls.model.PollsQuestion getPollsQuestion(
84          long questionId)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException {
87          return getService().getPollsQuestion(questionId);
88      }
89  
90      public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getPollsQuestions(
91          int start, int end) throws com.liferay.portal.SystemException {
92          return getService().getPollsQuestions(start, end);
93      }
94  
95      public static int getPollsQuestionsCount()
96          throws com.liferay.portal.SystemException {
97          return getService().getPollsQuestionsCount();
98      }
99  
100     public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
101         com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
102         throws com.liferay.portal.SystemException {
103         return getService().updatePollsQuestion(pollsQuestion);
104     }
105 
106     public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
107         com.liferay.portlet.polls.model.PollsQuestion pollsQuestion,
108         boolean merge) throws com.liferay.portal.SystemException {
109         return getService().updatePollsQuestion(pollsQuestion, merge);
110     }
111 
112     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
113         long userId, java.lang.String title, java.lang.String description,
114         int expirationDateMonth, int expirationDateDay, int expirationDateYear,
115         int expirationDateHour, int expirationDateMinute, boolean neverExpire,
116         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
117         com.liferay.portal.service.ServiceContext serviceContext)
118         throws com.liferay.portal.PortalException,
119             com.liferay.portal.SystemException {
120         return getService()
121                    .addQuestion(userId, title, description,
122             expirationDateMonth, expirationDateDay, expirationDateYear,
123             expirationDateHour, expirationDateMinute, neverExpire, choices,
124             serviceContext);
125     }
126 
127     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
128         java.lang.String uuid, long userId, java.lang.String title,
129         java.lang.String description, int expirationDateMonth,
130         int expirationDateDay, int expirationDateYear, int expirationDateHour,
131         int expirationDateMinute, boolean neverExpire,
132         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
133         com.liferay.portal.service.ServiceContext serviceContext)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException {
136         return getService()
137                    .addQuestion(uuid, userId, title, description,
138             expirationDateMonth, expirationDateDay, expirationDateYear,
139             expirationDateHour, expirationDateMinute, neverExpire, choices,
140             serviceContext);
141     }
142 
143     public static void addQuestionResources(long questionId,
144         boolean addCommunityPermissions, boolean addGuestPermissions)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException {
147         getService()
148             .addQuestionResources(questionId, addCommunityPermissions,
149             addGuestPermissions);
150     }
151 
152     public static void addQuestionResources(
153         com.liferay.portlet.polls.model.PollsQuestion question,
154         boolean addCommunityPermissions, boolean addGuestPermissions)
155         throws com.liferay.portal.PortalException,
156             com.liferay.portal.SystemException {
157         getService()
158             .addQuestionResources(question, addCommunityPermissions,
159             addGuestPermissions);
160     }
161 
162     public static void addQuestionResources(long questionId,
163         java.lang.String[] communityPermissions,
164         java.lang.String[] guestPermissions)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException {
167         getService()
168             .addQuestionResources(questionId, communityPermissions,
169             guestPermissions);
170     }
171 
172     public static void addQuestionResources(
173         com.liferay.portlet.polls.model.PollsQuestion question,
174         java.lang.String[] communityPermissions,
175         java.lang.String[] guestPermissions)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException {
178         getService()
179             .addQuestionResources(question, communityPermissions,
180             guestPermissions);
181     }
182 
183     public static void deleteQuestion(long questionId)
184         throws com.liferay.portal.PortalException,
185             com.liferay.portal.SystemException {
186         getService().deleteQuestion(questionId);
187     }
188 
189     public static void deleteQuestion(
190         com.liferay.portlet.polls.model.PollsQuestion question)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         getService().deleteQuestion(question);
194     }
195 
196     public static void deleteQuestions(long groupId)
197         throws com.liferay.portal.PortalException,
198             com.liferay.portal.SystemException {
199         getService().deleteQuestions(groupId);
200     }
201 
202     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
203         long questionId)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException {
206         return getService().getQuestion(questionId);
207     }
208 
209     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
210         long groupId) throws com.liferay.portal.SystemException {
211         return getService().getQuestions(groupId);
212     }
213 
214     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
215         long groupId, int start, int end)
216         throws com.liferay.portal.SystemException {
217         return getService().getQuestions(groupId, start, end);
218     }
219 
220     public static int getQuestionsCount(long groupId)
221         throws com.liferay.portal.SystemException {
222         return getService().getQuestionsCount(groupId);
223     }
224 
225     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
226         long userId, long questionId, java.lang.String title,
227         java.lang.String description, int expirationDateMonth,
228         int expirationDateDay, int expirationDateYear, int expirationDateHour,
229         int expirationDateMinute, boolean neverExpire)
230         throws com.liferay.portal.PortalException,
231             com.liferay.portal.SystemException {
232         return getService()
233                    .updateQuestion(userId, questionId, title, description,
234             expirationDateMonth, expirationDateDay, expirationDateYear,
235             expirationDateHour, expirationDateMinute, neverExpire);
236     }
237 
238     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
239         long userId, long questionId, java.lang.String title,
240         java.lang.String description, int expirationDateMonth,
241         int expirationDateDay, int expirationDateYear, int expirationDateHour,
242         int expirationDateMinute, boolean neverExpire,
243         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
244         com.liferay.portal.service.ServiceContext serviceContext)
245         throws com.liferay.portal.PortalException,
246             com.liferay.portal.SystemException {
247         return getService()
248                    .updateQuestion(userId, questionId, title, description,
249             expirationDateMonth, expirationDateDay, expirationDateYear,
250             expirationDateHour, expirationDateMinute, neverExpire, choices,
251             serviceContext);
252     }
253 
254     public static PollsQuestionLocalService getService() {
255         if (_service == null) {
256             throw new RuntimeException("PollsQuestionLocalService is not set");
257         }
258 
259         return _service;
260     }
261 
262     public void setService(PollsQuestionLocalService service) {
263         _service = service;
264     }
265 
266     private static PollsQuestionLocalService _service;
267 }