001
014
015 package com.liferay.portlet.polls.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LocalizationUtil;
020
021 import com.liferay.portlet.polls.service.PollsQuestionServiceUtil;
022
023 import java.rmi.RemoteException;
024
025 import java.util.Locale;
026 import java.util.Map;
027
028
070 public class PollsQuestionServiceSoap {
071 public static com.liferay.portlet.polls.model.PollsQuestionSoap addQuestion(
072 java.lang.String[] titleMapLanguageIds,
073 java.lang.String[] titleMapValues,
074 java.lang.String[] descriptionMapLanguageIds,
075 java.lang.String[] descriptionMapValues, int expirationDateMonth,
076 int expirationDateDay, int expirationDateYear, int expirationDateHour,
077 int expirationDateMinute, boolean neverExpire,
078 com.liferay.portlet.polls.model.PollsChoiceSoap[] choices,
079 com.liferay.portal.service.ServiceContext serviceContext)
080 throws RemoteException {
081 try {
082 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
083 titleMapValues);
084 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
085 descriptionMapValues);
086
087 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.addQuestion(titleMap,
088 descriptionMap, expirationDateMonth, expirationDateDay,
089 expirationDateYear, expirationDateHour,
090 expirationDateMinute, neverExpire,
091 com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl.toModels(
092 choices), serviceContext);
093
094 return com.liferay.portlet.polls.model.PollsQuestionSoap.toSoapModel(returnValue);
095 }
096 catch (Exception e) {
097 _log.error(e, e);
098
099 throw new RemoteException(e.getMessage());
100 }
101 }
102
103 public static void deleteQuestion(long questionId)
104 throws RemoteException {
105 try {
106 PollsQuestionServiceUtil.deleteQuestion(questionId);
107 }
108 catch (Exception e) {
109 _log.error(e, e);
110
111 throw new RemoteException(e.getMessage());
112 }
113 }
114
115 public static com.liferay.portlet.polls.model.PollsQuestionSoap getQuestion(
116 long questionId) throws RemoteException {
117 try {
118 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.getQuestion(questionId);
119
120 return com.liferay.portlet.polls.model.PollsQuestionSoap.toSoapModel(returnValue);
121 }
122 catch (Exception e) {
123 _log.error(e, e);
124
125 throw new RemoteException(e.getMessage());
126 }
127 }
128
129 public static com.liferay.portlet.polls.model.PollsQuestionSoap updateQuestion(
130 long questionId, java.lang.String[] titleMapLanguageIds,
131 java.lang.String[] titleMapValues,
132 java.lang.String[] descriptionMapLanguageIds,
133 java.lang.String[] descriptionMapValues, int expirationDateMonth,
134 int expirationDateDay, int expirationDateYear, int expirationDateHour,
135 int expirationDateMinute, boolean neverExpire,
136 com.liferay.portlet.polls.model.PollsChoiceSoap[] choices,
137 com.liferay.portal.service.ServiceContext serviceContext)
138 throws RemoteException {
139 try {
140 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
141 titleMapValues);
142 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
143 descriptionMapValues);
144
145 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.updateQuestion(questionId,
146 titleMap, descriptionMap, expirationDateMonth,
147 expirationDateDay, expirationDateYear, expirationDateHour,
148 expirationDateMinute, neverExpire,
149 com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl.toModels(
150 choices), serviceContext);
151
152 return com.liferay.portlet.polls.model.PollsQuestionSoap.toSoapModel(returnValue);
153 }
154 catch (Exception e) {
155 _log.error(e, e);
156
157 throw new RemoteException(e.getMessage());
158 }
159 }
160
161 private static Log _log = LogFactoryUtil.getLog(PollsQuestionServiceSoap.class);
162 }