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 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
063 int expirationDateHour, int expirationDateMinute, int priority,
064 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, expirationDateMonth,
075 expirationDateDay, expirationDateYear, expirationDateHour,
076 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 void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
105 throws com.liferay.portal.kernel.exception.PortalException,
106 com.liferay.portal.kernel.exception.SystemException {
107 try {
108 MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class.getName(),
109 "deleteEntry", _deleteEntryParameterTypes1);
110
111 MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
112
113 try {
114 TunnelUtil.invoke(httpPrincipal, methodHandler);
115 }
116 catch (Exception e) {
117 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118 throw (com.liferay.portal.kernel.exception.PortalException)e;
119 }
120
121 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
122 throw (com.liferay.portal.kernel.exception.SystemException)e;
123 }
124
125 throw new com.liferay.portal.kernel.exception.SystemException(e);
126 }
127 }
128 catch (com.liferay.portal.kernel.exception.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
136 HttpPrincipal httpPrincipal, long entryId, java.lang.String title,
137 java.lang.String content, java.lang.String url, java.lang.String type,
138 int displayDateMonth, int displayDateDay, int displayDateYear,
139 int displayDateHour, int displayDateMinute, int expirationDateMonth,
140 int expirationDateDay, int expirationDateYear, int expirationDateHour,
141 int expirationDateMinute, int priority)
142 throws com.liferay.portal.kernel.exception.PortalException,
143 com.liferay.portal.kernel.exception.SystemException {
144 try {
145 MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class.getName(),
146 "updateEntry", _updateEntryParameterTypes2);
147
148 MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
149 title, content, url, type, displayDateMonth,
150 displayDateDay, displayDateYear, displayDateHour,
151 displayDateMinute, expirationDateMonth, expirationDateDay,
152 expirationDateYear, expirationDateHour,
153 expirationDateMinute, priority);
154
155 Object returnObj = null;
156
157 try {
158 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
159 }
160 catch (Exception e) {
161 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
162 throw (com.liferay.portal.kernel.exception.PortalException)e;
163 }
164
165 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
166 throw (com.liferay.portal.kernel.exception.SystemException)e;
167 }
168
169 throw new com.liferay.portal.kernel.exception.SystemException(e);
170 }
171
172 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
173 }
174 catch (com.liferay.portal.kernel.exception.SystemException se) {
175 _log.error(se, se);
176
177 throw se;
178 }
179 }
180
181 private static Log _log = LogFactoryUtil.getLog(AnnouncementsEntryServiceHttp.class);
182 private static final Class<?>[] _addEntryParameterTypes0 = new Class[] {
183 long.class, long.class, long.class, java.lang.String.class,
184 java.lang.String.class, java.lang.String.class,
185 java.lang.String.class, int.class, int.class, int.class, int.class,
186 int.class, int.class, int.class, int.class, int.class, int.class,
187 int.class, boolean.class
188 };
189 private static final Class<?>[] _deleteEntryParameterTypes1 = new Class[] {
190 long.class
191 };
192 private static final Class<?>[] _updateEntryParameterTypes2 = new Class[] {
193 long.class, java.lang.String.class, java.lang.String.class,
194 java.lang.String.class, java.lang.String.class, int.class, int.class,
195 int.class, int.class, int.class, int.class, int.class, int.class,
196 int.class, int.class, int.class
197 };
198 }