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