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 addQuestion(
107         long userId, java.lang.String title, java.lang.String description,
108         int expirationDateMonth, int expirationDateDay, int expirationDateYear,
109         int expirationDateHour, int expirationDateMinute, boolean neverExpire,
110         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
111         com.liferay.portal.service.ServiceContext serviceContext)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         return getService()
115                    .addQuestion(userId, title, description,
116             expirationDateMonth, expirationDateDay, expirationDateYear,
117             expirationDateHour, expirationDateMinute, neverExpire, choices,
118             serviceContext);
119     }
120 
121     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
122         java.lang.String uuid, long userId, java.lang.String title,
123         java.lang.String description, int expirationDateMonth,
124         int expirationDateDay, int expirationDateYear, int expirationDateHour,
125         int expirationDateMinute, boolean neverExpire,
126         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
127         com.liferay.portal.service.ServiceContext serviceContext)
128         throws com.liferay.portal.PortalException,
129             com.liferay.portal.SystemException {
130         return getService()
131                    .addQuestion(uuid, userId, title, description,
132             expirationDateMonth, expirationDateDay, expirationDateYear,
133             expirationDateHour, expirationDateMinute, neverExpire, choices,
134             serviceContext);
135     }
136 
137     public static void addQuestionResources(long questionId,
138         boolean addCommunityPermissions, boolean addGuestPermissions)
139         throws com.liferay.portal.PortalException,
140             com.liferay.portal.SystemException {
141         getService()
142             .addQuestionResources(questionId, addCommunityPermissions,
143             addGuestPermissions);
144     }
145 
146     public static void addQuestionResources(
147         com.liferay.portlet.polls.model.PollsQuestion question,
148         boolean addCommunityPermissions, boolean addGuestPermissions)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException {
151         getService()
152             .addQuestionResources(question, addCommunityPermissions,
153             addGuestPermissions);
154     }
155 
156     public static void addQuestionResources(long questionId,
157         java.lang.String[] communityPermissions,
158         java.lang.String[] guestPermissions)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException {
161         getService()
162             .addQuestionResources(questionId, communityPermissions,
163             guestPermissions);
164     }
165 
166     public static void addQuestionResources(
167         com.liferay.portlet.polls.model.PollsQuestion question,
168         java.lang.String[] communityPermissions,
169         java.lang.String[] guestPermissions)
170         throws com.liferay.portal.PortalException,
171             com.liferay.portal.SystemException {
172         getService()
173             .addQuestionResources(question, communityPermissions,
174             guestPermissions);
175     }
176 
177     public static void deleteQuestion(long questionId)
178         throws com.liferay.portal.PortalException,
179             com.liferay.portal.SystemException {
180         getService().deleteQuestion(questionId);
181     }
182 
183     public static void deleteQuestion(
184         com.liferay.portlet.polls.model.PollsQuestion question)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException {
187         getService().deleteQuestion(question);
188     }
189 
190     public static void deleteQuestions(long groupId)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         getService().deleteQuestions(groupId);
194     }
195 
196     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
197         long questionId)
198         throws com.liferay.portal.PortalException,
199             com.liferay.portal.SystemException {
200         return getService().getQuestion(questionId);
201     }
202 
203     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
204         long groupId) throws com.liferay.portal.SystemException {
205         return getService().getQuestions(groupId);
206     }
207 
208     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
209         long groupId, int start, int end)
210         throws com.liferay.portal.SystemException {
211         return getService().getQuestions(groupId, start, end);
212     }
213 
214     public static int getQuestionsCount(long groupId)
215         throws com.liferay.portal.SystemException {
216         return getService().getQuestionsCount(groupId);
217     }
218 
219     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
220         long userId, long questionId, java.lang.String title,
221         java.lang.String description, int expirationDateMonth,
222         int expirationDateDay, int expirationDateYear, int expirationDateHour,
223         int expirationDateMinute, boolean neverExpire)
224         throws com.liferay.portal.PortalException,
225             com.liferay.portal.SystemException {
226         return getService()
227                    .updateQuestion(userId, questionId, title, description,
228             expirationDateMonth, expirationDateDay, expirationDateYear,
229             expirationDateHour, expirationDateMinute, neverExpire);
230     }
231 
232     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
233         long userId, long questionId, java.lang.String title,
234         java.lang.String description, int expirationDateMonth,
235         int expirationDateDay, int expirationDateYear, int expirationDateHour,
236         int expirationDateMinute, boolean neverExpire,
237         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
238         com.liferay.portal.service.ServiceContext serviceContext)
239         throws com.liferay.portal.PortalException,
240             com.liferay.portal.SystemException {
241         return getService()
242                    .updateQuestion(userId, questionId, title, description,
243             expirationDateMonth, expirationDateDay, expirationDateYear,
244             expirationDateHour, expirationDateMinute, neverExpire, choices,
245             serviceContext);
246     }
247 
248     public static PollsQuestionLocalService getService() {
249         if (_service == null) {
250             throw new RuntimeException("PollsQuestionLocalService is not set");
251         }
252 
253         return _service;
254     }
255 
256     public void setService(PollsQuestionLocalService service) {
257         _service = service;
258     }
259 
260     private static PollsQuestionLocalService _service;
261 }