1   /**
2    * Copyright (c) 2000-2007 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   * <a href="PollsQuestionLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portlet.polls.service.PollsQuestionLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory</code>
42   * is responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portlet.polls.service.PollsQuestionLocalService
48   * @see com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory
49   *
50   */
51  public class PollsQuestionLocalServiceUtil {
52      public static com.liferay.portlet.polls.model.PollsQuestion addPollsQuestion(
53          com.liferay.portlet.polls.model.PollsQuestion model)
54          throws com.liferay.portal.SystemException {
55          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
56  
57          return pollsQuestionLocalService.addPollsQuestion(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
64  
65          return pollsQuestionLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
72  
73          return pollsQuestionLocalService.dynamicQuery(queryInitializer, begin,
74              end);
75      }
76  
77      public static com.liferay.portlet.polls.model.PollsQuestion updatePollsQuestion(
78          com.liferay.portlet.polls.model.PollsQuestion model)
79          throws com.liferay.portal.SystemException {
80          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
81  
82          return pollsQuestionLocalService.updatePollsQuestion(model);
83      }
84  
85      public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
86          long userId, long plid, java.lang.String title,
87          java.lang.String description, int expirationDateMonth,
88          int expirationDateDay, int expirationDateYear, int expirationDateHour,
89          int expirationDateMinute, boolean neverExpire, java.util.List choices,
90          boolean addCommunityPermissions, boolean addGuestPermissions)
91          throws com.liferay.portal.PortalException, 
92              com.liferay.portal.SystemException {
93          PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
94  
95          return pollsQuestionLocalService.addQuestion(userId, plid, title,
96              description, expirationDateMonth, expirationDateDay,
97              expirationDateYear, expirationDateHour, expirationDateMinute,
98              neverExpire, choices, addCommunityPermissions, addGuestPermissions);
99      }
100 
101     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
102         long userId, long plid, java.lang.String title,
103         java.lang.String description, int expirationDateMonth,
104         int expirationDateDay, int expirationDateYear, int expirationDateHour,
105         int expirationDateMinute, boolean neverExpire, java.util.List choices,
106         java.lang.String[] communityPermissions,
107         java.lang.String[] guestPermissions)
108         throws com.liferay.portal.PortalException, 
109             com.liferay.portal.SystemException {
110         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
111 
112         return pollsQuestionLocalService.addQuestion(userId, plid, title,
113             description, expirationDateMonth, expirationDateDay,
114             expirationDateYear, expirationDateHour, expirationDateMinute,
115             neverExpire, choices, communityPermissions, guestPermissions);
116     }
117 
118     public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
119         long userId, long plid, java.lang.String title,
120         java.lang.String description, int expirationDateMonth,
121         int expirationDateDay, int expirationDateYear, int expirationDateHour,
122         int expirationDateMinute, boolean neverExpire, java.util.List choices,
123         java.lang.Boolean addCommunityPermissions,
124         java.lang.Boolean addGuestPermissions,
125         java.lang.String[] communityPermissions,
126         java.lang.String[] guestPermissions)
127         throws com.liferay.portal.PortalException, 
128             com.liferay.portal.SystemException {
129         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
130 
131         return pollsQuestionLocalService.addQuestion(userId, plid, title,
132             description, expirationDateMonth, expirationDateDay,
133             expirationDateYear, expirationDateHour, expirationDateMinute,
134             neverExpire, choices, addCommunityPermissions, addGuestPermissions,
135             communityPermissions, guestPermissions);
136     }
137 
138     public static void addQuestionResources(long questionId,
139         boolean addCommunityPermissions, boolean addGuestPermissions)
140         throws com.liferay.portal.PortalException, 
141             com.liferay.portal.SystemException {
142         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
143         pollsQuestionLocalService.addQuestionResources(questionId,
144             addCommunityPermissions, addGuestPermissions);
145     }
146 
147     public static void addQuestionResources(
148         com.liferay.portlet.polls.model.PollsQuestion question,
149         boolean addCommunityPermissions, boolean addGuestPermissions)
150         throws com.liferay.portal.PortalException, 
151             com.liferay.portal.SystemException {
152         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
153         pollsQuestionLocalService.addQuestionResources(question,
154             addCommunityPermissions, addGuestPermissions);
155     }
156 
157     public static void addQuestionResources(long questionId,
158         java.lang.String[] communityPermissions,
159         java.lang.String[] guestPermissions)
160         throws com.liferay.portal.PortalException, 
161             com.liferay.portal.SystemException {
162         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
163         pollsQuestionLocalService.addQuestionResources(questionId,
164             communityPermissions, guestPermissions);
165     }
166 
167     public static void addQuestionResources(
168         com.liferay.portlet.polls.model.PollsQuestion question,
169         java.lang.String[] communityPermissions,
170         java.lang.String[] guestPermissions)
171         throws com.liferay.portal.PortalException, 
172             com.liferay.portal.SystemException {
173         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
174         pollsQuestionLocalService.addQuestionResources(question,
175             communityPermissions, guestPermissions);
176     }
177 
178     public static void deleteQuestion(long questionId)
179         throws com.liferay.portal.PortalException, 
180             com.liferay.portal.SystemException {
181         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
182         pollsQuestionLocalService.deleteQuestion(questionId);
183     }
184 
185     public static void deleteQuestion(
186         com.liferay.portlet.polls.model.PollsQuestion question)
187         throws com.liferay.portal.PortalException, 
188             com.liferay.portal.SystemException {
189         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
190         pollsQuestionLocalService.deleteQuestion(question);
191     }
192 
193     public static void deleteQuestions(long groupId)
194         throws com.liferay.portal.PortalException, 
195             com.liferay.portal.SystemException {
196         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
197         pollsQuestionLocalService.deleteQuestions(groupId);
198     }
199 
200     public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
201         long questionId)
202         throws com.liferay.portal.PortalException, 
203             com.liferay.portal.SystemException {
204         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
205 
206         return pollsQuestionLocalService.getQuestion(questionId);
207     }
208 
209     public static java.util.List getQuestions(long groupId)
210         throws com.liferay.portal.SystemException {
211         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
212 
213         return pollsQuestionLocalService.getQuestions(groupId);
214     }
215 
216     public static java.util.List getQuestions(long groupId, int begin, int end)
217         throws com.liferay.portal.SystemException {
218         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
219 
220         return pollsQuestionLocalService.getQuestions(groupId, begin, end);
221     }
222 
223     public static int getQuestionsCount(long groupId)
224         throws com.liferay.portal.SystemException {
225         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
226 
227         return pollsQuestionLocalService.getQuestionsCount(groupId);
228     }
229 
230     public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
231         long userId, long questionId, java.lang.String title,
232         java.lang.String description, int expirationDateMonth,
233         int expirationDateDay, int expirationDateYear, int expirationDateHour,
234         int expirationDateMinute, boolean neverExpire, java.util.List choices)
235         throws com.liferay.portal.PortalException, 
236             com.liferay.portal.SystemException {
237         PollsQuestionLocalService pollsQuestionLocalService = PollsQuestionLocalServiceFactory.getService();
238 
239         return pollsQuestionLocalService.updateQuestion(userId, questionId,
240             title, description, expirationDateMonth, expirationDateDay,
241             expirationDateYear, expirationDateHour, expirationDateMinute,
242             neverExpire, choices);
243     }
244 }