001
014
015 package com.liferay.portlet.polls.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class PollsQuestionServiceUtil {
035
040 public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
041 java.util.Map<java.util.Locale, java.lang.String> titleMap,
042 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
043 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
044 int expirationDateHour, int expirationDateMinute, boolean neverExpire,
045 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
046 com.liferay.portal.service.ServiceContext serviceContext)
047 throws com.liferay.portal.kernel.exception.PortalException,
048 com.liferay.portal.kernel.exception.SystemException {
049 return getService()
050 .addQuestion(titleMap, descriptionMap, expirationDateMonth,
051 expirationDateDay, expirationDateYear, expirationDateHour,
052 expirationDateMinute, neverExpire, choices, serviceContext);
053 }
054
055 public static void deleteQuestion(long questionId)
056 throws com.liferay.portal.kernel.exception.PortalException,
057 com.liferay.portal.kernel.exception.SystemException {
058 getService().deleteQuestion(questionId);
059 }
060
061 public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
062 long questionId)
063 throws com.liferay.portal.kernel.exception.PortalException,
064 com.liferay.portal.kernel.exception.SystemException {
065 return getService().getQuestion(questionId);
066 }
067
068 public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
069 long questionId,
070 java.util.Map<java.util.Locale, java.lang.String> titleMap,
071 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
072 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
073 int expirationDateHour, int expirationDateMinute, boolean neverExpire,
074 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
075 com.liferay.portal.service.ServiceContext serviceContext)
076 throws com.liferay.portal.kernel.exception.PortalException,
077 com.liferay.portal.kernel.exception.SystemException {
078 return getService()
079 .updateQuestion(questionId, titleMap, descriptionMap,
080 expirationDateMonth, expirationDateDay, expirationDateYear,
081 expirationDateHour, expirationDateMinute, neverExpire, choices,
082 serviceContext);
083 }
084
085 public static PollsQuestionService getService() {
086 if (_service == null) {
087 _service = (PollsQuestionService)PortalBeanLocatorUtil.locate(PollsQuestionService.class.getName());
088
089 ReferenceRegistry.registerReference(PollsQuestionServiceUtil.class,
090 "_service");
091 MethodCache.remove(PollsQuestionService.class);
092 }
093
094 return _service;
095 }
096
097 public void setService(PollsQuestionService service) {
098 MethodCache.remove(PollsQuestionService.class);
099
100 _service = service;
101
102 ReferenceRegistry.registerReference(PollsQuestionServiceUtil.class,
103 "_service");
104 MethodCache.remove(PollsQuestionService.class);
105 }
106
107 private static PollsQuestionService _service;
108 }