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