1
22
23 package com.liferay.portlet.blogs.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.blogs.service.BlogsCategoryServiceUtil;
35
36
73 public class BlogsCategoryServiceHttp {
74 public static com.liferay.portlet.blogs.model.BlogsCategory addCategory(
75 HttpPrincipal httpPrincipal, long parentCategoryId,
76 java.lang.String name, java.lang.String description,
77 boolean addCommunityPermissions, boolean addGuestPermissions)
78 throws com.liferay.portal.SystemException,
79 com.liferay.portal.PortalException {
80 try {
81 Object paramObj0 = new LongWrapper(parentCategoryId);
82 Object paramObj1 = name;
83
84 if (name == null) {
85 paramObj1 = new NullWrapper("java.lang.String");
86 }
87
88 Object paramObj2 = description;
89
90 if (description == null) {
91 paramObj2 = new NullWrapper("java.lang.String");
92 }
93
94 Object paramObj3 = new BooleanWrapper(addCommunityPermissions);
95 Object paramObj4 = new BooleanWrapper(addGuestPermissions);
96 MethodWrapper methodWrapper = new MethodWrapper(BlogsCategoryServiceUtil.class.getName(),
97 "addCategory",
98 new Object[] {
99 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
100 });
101 Object returnObj = null;
102
103 try {
104 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
105 }
106 catch (Exception e) {
107 if (e instanceof com.liferay.portal.SystemException) {
108 throw (com.liferay.portal.SystemException)e;
109 }
110
111 if (e instanceof com.liferay.portal.PortalException) {
112 throw (com.liferay.portal.PortalException)e;
113 }
114
115 throw new com.liferay.portal.SystemException(e);
116 }
117
118 return (com.liferay.portlet.blogs.model.BlogsCategory)returnObj;
119 }
120 catch (com.liferay.portal.SystemException se) {
121 _log.error(se, se);
122 throw se;
123 }
124 }
125
126 public static com.liferay.portlet.blogs.model.BlogsCategory addCategory(
127 HttpPrincipal httpPrincipal, long parentCategoryId,
128 java.lang.String name, java.lang.String description,
129 java.lang.String[] communityPermissions,
130 java.lang.String[] guestPermissions)
131 throws com.liferay.portal.SystemException,
132 com.liferay.portal.PortalException {
133 try {
134 Object paramObj0 = new LongWrapper(parentCategoryId);
135 Object paramObj1 = name;
136
137 if (name == null) {
138 paramObj1 = new NullWrapper("java.lang.String");
139 }
140
141 Object paramObj2 = description;
142
143 if (description == null) {
144 paramObj2 = new NullWrapper("java.lang.String");
145 }
146
147 Object paramObj3 = communityPermissions;
148
149 if (communityPermissions == null) {
150 paramObj3 = new NullWrapper("[Ljava.lang.String;");
151 }
152
153 Object paramObj4 = guestPermissions;
154
155 if (guestPermissions == null) {
156 paramObj4 = new NullWrapper("[Ljava.lang.String;");
157 }
158
159 MethodWrapper methodWrapper = new MethodWrapper(BlogsCategoryServiceUtil.class.getName(),
160 "addCategory",
161 new Object[] {
162 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
163 });
164 Object returnObj = null;
165
166 try {
167 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
168 }
169 catch (Exception e) {
170 if (e instanceof com.liferay.portal.SystemException) {
171 throw (com.liferay.portal.SystemException)e;
172 }
173
174 if (e instanceof com.liferay.portal.PortalException) {
175 throw (com.liferay.portal.PortalException)e;
176 }
177
178 throw new com.liferay.portal.SystemException(e);
179 }
180
181 return (com.liferay.portlet.blogs.model.BlogsCategory)returnObj;
182 }
183 catch (com.liferay.portal.SystemException se) {
184 _log.error(se, se);
185 throw se;
186 }
187 }
188
189 public static void deleteCategory(HttpPrincipal httpPrincipal,
190 long categoryId)
191 throws com.liferay.portal.SystemException,
192 com.liferay.portal.PortalException {
193 try {
194 Object paramObj0 = new LongWrapper(categoryId);
195 MethodWrapper methodWrapper = new MethodWrapper(BlogsCategoryServiceUtil.class.getName(),
196 "deleteCategory", new Object[] { paramObj0 });
197
198 try {
199 TunnelUtil.invoke(httpPrincipal, methodWrapper);
200 }
201 catch (Exception e) {
202 if (e instanceof com.liferay.portal.SystemException) {
203 throw (com.liferay.portal.SystemException)e;
204 }
205
206 if (e instanceof com.liferay.portal.PortalException) {
207 throw (com.liferay.portal.PortalException)e;
208 }
209
210 throw new com.liferay.portal.SystemException(e);
211 }
212 }
213 catch (com.liferay.portal.SystemException se) {
214 _log.error(se, se);
215 throw se;
216 }
217 }
218
219 public static com.liferay.portlet.blogs.model.BlogsCategory getCategory(
220 HttpPrincipal httpPrincipal, long categoryId)
221 throws com.liferay.portal.SystemException,
222 com.liferay.portal.PortalException {
223 try {
224 Object paramObj0 = new LongWrapper(categoryId);
225 MethodWrapper methodWrapper = new MethodWrapper(BlogsCategoryServiceUtil.class.getName(),
226 "getCategory", new Object[] { paramObj0 });
227 Object returnObj = null;
228
229 try {
230 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
231 }
232 catch (Exception e) {
233 if (e instanceof com.liferay.portal.SystemException) {
234 throw (com.liferay.portal.SystemException)e;
235 }
236
237 if (e instanceof com.liferay.portal.PortalException) {
238 throw (com.liferay.portal.PortalException)e;
239 }
240
241 throw new com.liferay.portal.SystemException(e);
242 }
243
244 return (com.liferay.portlet.blogs.model.BlogsCategory)returnObj;
245 }
246 catch (com.liferay.portal.SystemException se) {
247 _log.error(se, se);
248 throw se;
249 }
250 }
251
252 public static com.liferay.portlet.blogs.model.BlogsCategory updateCategory(
253 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
254 java.lang.String name, java.lang.String description)
255 throws com.liferay.portal.SystemException,
256 com.liferay.portal.PortalException {
257 try {
258 Object paramObj0 = new LongWrapper(categoryId);
259 Object paramObj1 = new LongWrapper(parentCategoryId);
260 Object paramObj2 = name;
261
262 if (name == null) {
263 paramObj2 = new NullWrapper("java.lang.String");
264 }
265
266 Object paramObj3 = description;
267
268 if (description == null) {
269 paramObj3 = new NullWrapper("java.lang.String");
270 }
271
272 MethodWrapper methodWrapper = new MethodWrapper(BlogsCategoryServiceUtil.class.getName(),
273 "updateCategory",
274 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
275 Object returnObj = null;
276
277 try {
278 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
279 }
280 catch (Exception e) {
281 if (e instanceof com.liferay.portal.SystemException) {
282 throw (com.liferay.portal.SystemException)e;
283 }
284
285 if (e instanceof com.liferay.portal.PortalException) {
286 throw (com.liferay.portal.PortalException)e;
287 }
288
289 throw new com.liferay.portal.SystemException(e);
290 }
291
292 return (com.liferay.portlet.blogs.model.BlogsCategory)returnObj;
293 }
294 catch (com.liferay.portal.SystemException se) {
295 _log.error(se, se);
296 throw se;
297 }
298 }
299
300 private static Log _log = LogFactoryUtil.getLog(BlogsCategoryServiceHttp.class);
301 }