1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.polls.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="PollsQuestionLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link PollsQuestionLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       PollsQuestionLocalService
39   * @generated
40   */
41  public class PollsQuestionLocalServiceUtil {
42      public static com.liferay.portlet.polls.model.PollsQuestion addPollsQuestion(
43          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
44          throws com.liferay.portal.SystemException {
45          return getService().addPollsQuestion(pollsQuestion);
46      }
47  
48      public static com.liferay.portlet.polls.model.PollsQuestion createPollsQuestion(
49          long questionId) {
50          return getService().createPollsQuestion(questionId);
51      }
52  
53      public static void deletePollsQuestion(long questionId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException {
56          getService().deletePollsQuestion(questionId);
57      }
58  
59      public static void deletePollsQuestion(
60          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
61          throws com.liferay.portal.SystemException {
62          getService().deletePollsQuestion(pollsQuestion);
63      }
64  
65      @SuppressWarnings("rawtypes")
66      public static java.util.List dynamicQuery(
67          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
68          throws com.liferay.portal.SystemException {
69          return getService().dynamicQuery(dynamicQuery);
70      }
71  
72      @SuppressWarnings("rawtypes")
73      public static java.util.List dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end) throws com.liferay.portal.SystemException {
76          return getService().dynamicQuery(dynamicQuery, start, end);
77      }
78  
79      @SuppressWarnings("rawtypes")
80      public static java.util.List dynamicQuery(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
82          int end,
83          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
84          throws com.liferay.portal.SystemException {
85          return getService()
86                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
87      }
88  
89      public static int dynamicQueryCount(
90          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
91          throws com.liferay.portal.SystemException {
92          return getService().dynamicQueryCount(dynamicQuery);
93      }
94  
95      public static com.liferay.portlet.polls.model.PollsQuestion getPollsQuestion(
96          long questionId)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getPollsQuestion(questionId);
100     }
101 
102     public static com.liferay.portlet.polls.model.PollsQuestion getPollsQuestionByUuidAndGroupId(
103         java.lang.String uuid, long groupId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         return getService().getPollsQuestionByUuidAndGroupId(uuid, groupId);
107     }
108 
109     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getPollsQuestions(
110         int start, int end) throws com.liferay.portal.SystemException {
111         return getService().getPollsQuestions(start, end);
112     }
113 
114     public static int getPollsQuestionsCount()
115         throws com.liferay.portal.SystemException {
116         return getService().getPollsQuestionsCount();
117     }
118 
119     public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
120         com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
121         throws com.liferay.portal.SystemException {
122         return getService().updatePollsQuestion(pollsQuestion);
123     }
124 
125     public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
126         com.liferay.portlet.polls.model.PollsQuestion pollsQuestion,
127         boolean merge) throws com.liferay.portal.SystemException {
128         return getService().updatePollsQuestion(pollsQuestion, merge);
129     }
130 
131     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
132         long userId, java.lang.String title, java.lang.String description,
133         int expirationDateMonth, int expirationDateDay, int expirationDateYear,
134         int expirationDateHour, int expirationDateMinute, boolean neverExpire,
135         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
136         com.liferay.portal.service.ServiceContext serviceContext)
137         throws com.liferay.portal.PortalException,
138             com.liferay.portal.SystemException {
139         return getService()
140                    .addQuestion(userId, title, description,
141             expirationDateMonth, expirationDateDay, expirationDateYear,
142             expirationDateHour, expirationDateMinute, neverExpire, choices,
143             serviceContext);
144     }
145 
146     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
147         java.lang.String uuid, long userId, java.lang.String title,
148         java.lang.String description, int expirationDateMonth,
149         int expirationDateDay, int expirationDateYear, int expirationDateHour,
150         int expirationDateMinute, boolean neverExpire,
151         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
152         com.liferay.portal.service.ServiceContext serviceContext)
153         throws com.liferay.portal.PortalException,
154             com.liferay.portal.SystemException {
155         return getService()
156                    .addQuestion(uuid, userId, title, description,
157             expirationDateMonth, expirationDateDay, expirationDateYear,
158             expirationDateHour, expirationDateMinute, neverExpire, choices,
159             serviceContext);
160     }
161 
162     public static void addQuestionResources(long questionId,
163         boolean addCommunityPermissions, boolean addGuestPermissions)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException {
166         getService()
167             .addQuestionResources(questionId, addCommunityPermissions,
168             addGuestPermissions);
169     }
170 
171     public static void addQuestionResources(long questionId,
172         java.lang.String[] communityPermissions,
173         java.lang.String[] guestPermissions)
174         throws com.liferay.portal.PortalException,
175             com.liferay.portal.SystemException {
176         getService()
177             .addQuestionResources(questionId, communityPermissions,
178             guestPermissions);
179     }
180 
181     public static void addQuestionResources(
182         com.liferay.portlet.polls.model.PollsQuestion question,
183         boolean addCommunityPermissions, boolean addGuestPermissions)
184         throws com.liferay.portal.PortalException,
185             com.liferay.portal.SystemException {
186         getService()
187             .addQuestionResources(question, addCommunityPermissions,
188             addGuestPermissions);
189     }
190 
191     public static void addQuestionResources(
192         com.liferay.portlet.polls.model.PollsQuestion question,
193         java.lang.String[] communityPermissions,
194         java.lang.String[] guestPermissions)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         getService()
198             .addQuestionResources(question, communityPermissions,
199             guestPermissions);
200     }
201 
202     public static void deleteQuestion(long questionId)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         getService().deleteQuestion(questionId);
206     }
207 
208     public static void deleteQuestion(
209         com.liferay.portlet.polls.model.PollsQuestion question)
210         throws com.liferay.portal.PortalException,
211             com.liferay.portal.SystemException {
212         getService().deleteQuestion(question);
213     }
214 
215     public static void deleteQuestions(long groupId)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         getService().deleteQuestions(groupId);
219     }
220 
221     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
222         long questionId)
223         throws com.liferay.portal.PortalException,
224             com.liferay.portal.SystemException {
225         return getService().getQuestion(questionId);
226     }
227 
228     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
229         long groupId) throws com.liferay.portal.SystemException {
230         return getService().getQuestions(groupId);
231     }
232 
233     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> getQuestions(
234         long groupId, int start, int end)
235         throws com.liferay.portal.SystemException {
236         return getService().getQuestions(groupId, start, end);
237     }
238 
239     public static int getQuestionsCount(long groupId)
240         throws com.liferay.portal.SystemException {
241         return getService().getQuestionsCount(groupId);
242     }
243 
244     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
245         long userId, long questionId, java.lang.String title,
246         java.lang.String description, int expirationDateMonth,
247         int expirationDateDay, int expirationDateYear, int expirationDateHour,
248         int expirationDateMinute, boolean neverExpire)
249         throws com.liferay.portal.PortalException,
250             com.liferay.portal.SystemException {
251         return getService()
252                    .updateQuestion(userId, questionId, title, description,
253             expirationDateMonth, expirationDateDay, expirationDateYear,
254             expirationDateHour, expirationDateMinute, neverExpire);
255     }
256 
257     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
258         long userId, long questionId, java.lang.String title,
259         java.lang.String description, int expirationDateMonth,
260         int expirationDateDay, int expirationDateYear, int expirationDateHour,
261         int expirationDateMinute, boolean neverExpire,
262         java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
263         com.liferay.portal.service.ServiceContext serviceContext)
264         throws com.liferay.portal.PortalException,
265             com.liferay.portal.SystemException {
266         return getService()
267                    .updateQuestion(userId, questionId, title, description,
268             expirationDateMonth, expirationDateDay, expirationDateYear,
269             expirationDateHour, expirationDateMinute, neverExpire, choices,
270             serviceContext);
271     }
272 
273     public static PollsQuestionLocalService getService() {
274         if (_service == null) {
275             _service = (PollsQuestionLocalService)PortalBeanLocatorUtil.locate(PollsQuestionLocalService.class.getName());
276 
277             ReferenceRegistry.registerReference(PollsQuestionLocalServiceUtil.class,
278                 "_service");
279             MethodCache.remove(PollsQuestionLocalService.class);
280         }
281 
282         return _service;
283     }
284 
285     public void setService(PollsQuestionLocalService service) {
286         MethodCache.remove(PollsQuestionLocalService.class);
287 
288         _service = service;
289 
290         ReferenceRegistry.registerReference(PollsQuestionLocalServiceUtil.class,
291             "_service");
292         MethodCache.remove(PollsQuestionLocalService.class);
293     }
294 
295     private static PollsQuestionLocalService _service;
296 }