001
014
015 package com.liferay.portlet.announcements.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.BooleanWrapper;
020 import com.liferay.portal.kernel.util.IntegerWrapper;
021 import com.liferay.portal.kernel.util.LongWrapper;
022 import com.liferay.portal.kernel.util.MethodWrapper;
023 import com.liferay.portal.kernel.util.NullWrapper;
024 import com.liferay.portal.security.auth.HttpPrincipal;
025 import com.liferay.portal.service.http.TunnelUtil;
026
027 import com.liferay.portlet.announcements.service.AnnouncementsEntryServiceUtil;
028
029
059 public class AnnouncementsEntryServiceHttp {
060 public static com.liferay.portlet.announcements.model.AnnouncementsEntry addEntry(
061 HttpPrincipal httpPrincipal, long plid, long classNameId, long classPK,
062 java.lang.String title, java.lang.String content, java.lang.String url,
063 java.lang.String type, int displayDateMonth, int displayDateDay,
064 int displayDateYear, int displayDateHour, int displayDateMinute,
065 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
066 int expirationDateHour, int expirationDateMinute, int priority,
067 boolean alert)
068 throws com.liferay.portal.kernel.exception.PortalException,
069 com.liferay.portal.kernel.exception.SystemException {
070 try {
071 Object paramObj0 = new LongWrapper(plid);
072
073 Object paramObj1 = new LongWrapper(classNameId);
074
075 Object paramObj2 = new LongWrapper(classPK);
076
077 Object paramObj3 = title;
078
079 if (title == null) {
080 paramObj3 = new NullWrapper("java.lang.String");
081 }
082
083 Object paramObj4 = content;
084
085 if (content == null) {
086 paramObj4 = new NullWrapper("java.lang.String");
087 }
088
089 Object paramObj5 = url;
090
091 if (url == null) {
092 paramObj5 = new NullWrapper("java.lang.String");
093 }
094
095 Object paramObj6 = type;
096
097 if (type == null) {
098 paramObj6 = new NullWrapper("java.lang.String");
099 }
100
101 Object paramObj7 = new IntegerWrapper(displayDateMonth);
102
103 Object paramObj8 = new IntegerWrapper(displayDateDay);
104
105 Object paramObj9 = new IntegerWrapper(displayDateYear);
106
107 Object paramObj10 = new IntegerWrapper(displayDateHour);
108
109 Object paramObj11 = new IntegerWrapper(displayDateMinute);
110
111 Object paramObj12 = new IntegerWrapper(expirationDateMonth);
112
113 Object paramObj13 = new IntegerWrapper(expirationDateDay);
114
115 Object paramObj14 = new IntegerWrapper(expirationDateYear);
116
117 Object paramObj15 = new IntegerWrapper(expirationDateHour);
118
119 Object paramObj16 = new IntegerWrapper(expirationDateMinute);
120
121 Object paramObj17 = new IntegerWrapper(priority);
122
123 Object paramObj18 = new BooleanWrapper(alert);
124
125 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
126 "addEntry",
127 new Object[] {
128 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
129 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
130 paramObj10, paramObj11, paramObj12, paramObj13,
131 paramObj14, paramObj15, paramObj16, paramObj17,
132 paramObj18
133 });
134
135 Object returnObj = null;
136
137 try {
138 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
139 }
140 catch (Exception e) {
141 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
142 throw (com.liferay.portal.kernel.exception.PortalException)e;
143 }
144
145 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
146 throw (com.liferay.portal.kernel.exception.SystemException)e;
147 }
148
149 throw new com.liferay.portal.kernel.exception.SystemException(e);
150 }
151
152 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
153 }
154 catch (com.liferay.portal.kernel.exception.SystemException se) {
155 _log.error(se, se);
156
157 throw se;
158 }
159 }
160
161 public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
162 throws com.liferay.portal.kernel.exception.PortalException,
163 com.liferay.portal.kernel.exception.SystemException {
164 try {
165 Object paramObj0 = new LongWrapper(entryId);
166
167 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
168 "deleteEntry", new Object[] { paramObj0 });
169
170 try {
171 TunnelUtil.invoke(httpPrincipal, methodWrapper);
172 }
173 catch (Exception e) {
174 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
175 throw (com.liferay.portal.kernel.exception.PortalException)e;
176 }
177
178 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
179 throw (com.liferay.portal.kernel.exception.SystemException)e;
180 }
181
182 throw new com.liferay.portal.kernel.exception.SystemException(e);
183 }
184 }
185 catch (com.liferay.portal.kernel.exception.SystemException se) {
186 _log.error(se, se);
187
188 throw se;
189 }
190 }
191
192 public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
193 HttpPrincipal httpPrincipal, long entryId, java.lang.String title,
194 java.lang.String content, java.lang.String url, java.lang.String type,
195 int displayDateMonth, int displayDateDay, int displayDateYear,
196 int displayDateHour, int displayDateMinute, int expirationDateMonth,
197 int expirationDateDay, int expirationDateYear, int expirationDateHour,
198 int expirationDateMinute, int priority)
199 throws com.liferay.portal.kernel.exception.PortalException,
200 com.liferay.portal.kernel.exception.SystemException {
201 try {
202 Object paramObj0 = new LongWrapper(entryId);
203
204 Object paramObj1 = title;
205
206 if (title == null) {
207 paramObj1 = new NullWrapper("java.lang.String");
208 }
209
210 Object paramObj2 = content;
211
212 if (content == null) {
213 paramObj2 = new NullWrapper("java.lang.String");
214 }
215
216 Object paramObj3 = url;
217
218 if (url == null) {
219 paramObj3 = new NullWrapper("java.lang.String");
220 }
221
222 Object paramObj4 = type;
223
224 if (type == null) {
225 paramObj4 = new NullWrapper("java.lang.String");
226 }
227
228 Object paramObj5 = new IntegerWrapper(displayDateMonth);
229
230 Object paramObj6 = new IntegerWrapper(displayDateDay);
231
232 Object paramObj7 = new IntegerWrapper(displayDateYear);
233
234 Object paramObj8 = new IntegerWrapper(displayDateHour);
235
236 Object paramObj9 = new IntegerWrapper(displayDateMinute);
237
238 Object paramObj10 = new IntegerWrapper(expirationDateMonth);
239
240 Object paramObj11 = new IntegerWrapper(expirationDateDay);
241
242 Object paramObj12 = new IntegerWrapper(expirationDateYear);
243
244 Object paramObj13 = new IntegerWrapper(expirationDateHour);
245
246 Object paramObj14 = new IntegerWrapper(expirationDateMinute);
247
248 Object paramObj15 = new IntegerWrapper(priority);
249
250 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
251 "updateEntry",
252 new Object[] {
253 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
254 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
255 paramObj10, paramObj11, paramObj12, paramObj13,
256 paramObj14, paramObj15
257 });
258
259 Object returnObj = null;
260
261 try {
262 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
263 }
264 catch (Exception e) {
265 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
266 throw (com.liferay.portal.kernel.exception.PortalException)e;
267 }
268
269 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
270 throw (com.liferay.portal.kernel.exception.SystemException)e;
271 }
272
273 throw new com.liferay.portal.kernel.exception.SystemException(e);
274 }
275
276 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
277 }
278 catch (com.liferay.portal.kernel.exception.SystemException se) {
279 _log.error(se, se);
280
281 throw se;
282 }
283 }
284
285 private static Log _log = LogFactoryUtil.getLog(AnnouncementsEntryServiceHttp.class);
286 }