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", long.class, long.class, long.class,
070 java.lang.String.class, java.lang.String.class,
071 java.lang.String.class, java.lang.String.class, int.class,
072 int.class, int.class, int.class, int.class, int.class,
073 int.class, int.class, int.class, int.class, int.class,
074 boolean.class);
075
076 MethodHandler methodHandler = new MethodHandler(methodKey, plid,
077 classNameId, classPK, title, content, url, type,
078 displayDateMonth, displayDateDay, displayDateYear,
079 displayDateHour, displayDateMinute, expirationDateMonth,
080 expirationDateDay, expirationDateYear, expirationDateHour,
081 expirationDateMinute, priority, alert);
082
083 Object returnObj = null;
084
085 try {
086 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
087 }
088 catch (Exception e) {
089 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
090 throw (com.liferay.portal.kernel.exception.PortalException)e;
091 }
092
093 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
094 throw (com.liferay.portal.kernel.exception.SystemException)e;
095 }
096
097 throw new com.liferay.portal.kernel.exception.SystemException(e);
098 }
099
100 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
101 }
102 catch (com.liferay.portal.kernel.exception.SystemException se) {
103 _log.error(se, se);
104
105 throw se;
106 }
107 }
108
109 public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
110 throws com.liferay.portal.kernel.exception.PortalException,
111 com.liferay.portal.kernel.exception.SystemException {
112 try {
113 MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class.getName(),
114 "deleteEntry", long.class);
115
116 MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
117
118 try {
119 TunnelUtil.invoke(httpPrincipal, methodHandler);
120 }
121 catch (Exception e) {
122 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
123 throw (com.liferay.portal.kernel.exception.PortalException)e;
124 }
125
126 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
127 throw (com.liferay.portal.kernel.exception.SystemException)e;
128 }
129
130 throw new com.liferay.portal.kernel.exception.SystemException(e);
131 }
132 }
133 catch (com.liferay.portal.kernel.exception.SystemException se) {
134 _log.error(se, se);
135
136 throw se;
137 }
138 }
139
140 public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
141 HttpPrincipal httpPrincipal, long entryId, java.lang.String title,
142 java.lang.String content, java.lang.String url, java.lang.String type,
143 int displayDateMonth, int displayDateDay, int displayDateYear,
144 int displayDateHour, int displayDateMinute, int expirationDateMonth,
145 int expirationDateDay, int expirationDateYear, int expirationDateHour,
146 int expirationDateMinute, int priority)
147 throws com.liferay.portal.kernel.exception.PortalException,
148 com.liferay.portal.kernel.exception.SystemException {
149 try {
150 MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class.getName(),
151 "updateEntry", long.class, java.lang.String.class,
152 java.lang.String.class, java.lang.String.class,
153 java.lang.String.class, int.class, int.class, int.class,
154 int.class, int.class, int.class, int.class, int.class,
155 int.class, int.class, int.class);
156
157 MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
158 title, content, url, type, displayDateMonth,
159 displayDateDay, displayDateYear, displayDateHour,
160 displayDateMinute, expirationDateMonth, expirationDateDay,
161 expirationDateYear, expirationDateHour,
162 expirationDateMinute, priority);
163
164 Object returnObj = null;
165
166 try {
167 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
168 }
169 catch (Exception e) {
170 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
171 throw (com.liferay.portal.kernel.exception.PortalException)e;
172 }
173
174 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
175 throw (com.liferay.portal.kernel.exception.SystemException)e;
176 }
177
178 throw new com.liferay.portal.kernel.exception.SystemException(e);
179 }
180
181 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
182 }
183 catch (com.liferay.portal.kernel.exception.SystemException se) {
184 _log.error(se, se);
185
186 throw se;
187 }
188 }
189
190 private static Log _log = LogFactoryUtil.getLog(AnnouncementsEntryServiceHttp.class);
191 }