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