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