1
14
15 package com.liferay.portlet.bookmarks.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil;
25
26
63 public class BookmarksFolderServiceHttp {
64 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
65 HttpPrincipal httpPrincipal, long parentFolderId,
66 java.lang.String name, java.lang.String description,
67 com.liferay.portal.service.ServiceContext serviceContext)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 try {
71 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
72 "addFolder", _addFolderParameterTypes0);
73
74 MethodHandler methodHandler = new MethodHandler(methodKey,
75 parentFolderId, name, description, serviceContext);
76
77 Object returnObj = null;
78
79 try {
80 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
81 }
82 catch (Exception e) {
83 if (e instanceof com.liferay.portal.PortalException) {
84 throw (com.liferay.portal.PortalException)e;
85 }
86
87 if (e instanceof com.liferay.portal.SystemException) {
88 throw (com.liferay.portal.SystemException)e;
89 }
90
91 throw new com.liferay.portal.SystemException(e);
92 }
93
94 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
95 }
96 catch (com.liferay.portal.SystemException se) {
97 _log.error(se, se);
98
99 throw se;
100 }
101 }
102
103 public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
104 throws com.liferay.portal.PortalException,
105 com.liferay.portal.SystemException {
106 try {
107 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
108 "deleteFolder", _deleteFolderParameterTypes1);
109
110 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
111
112 try {
113 TunnelUtil.invoke(httpPrincipal, methodHandler);
114 }
115 catch (Exception e) {
116 if (e instanceof com.liferay.portal.PortalException) {
117 throw (com.liferay.portal.PortalException)e;
118 }
119
120 if (e instanceof com.liferay.portal.SystemException) {
121 throw (com.liferay.portal.SystemException)e;
122 }
123
124 throw new com.liferay.portal.SystemException(e);
125 }
126 }
127 catch (com.liferay.portal.SystemException se) {
128 _log.error(se, se);
129
130 throw se;
131 }
132 }
133
134 public static com.liferay.portlet.bookmarks.model.BookmarksFolder getFolder(
135 HttpPrincipal httpPrincipal, long folderId)
136 throws com.liferay.portal.PortalException,
137 com.liferay.portal.SystemException {
138 try {
139 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
140 "getFolder", _getFolderParameterTypes2);
141
142 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
143
144 Object returnObj = null;
145
146 try {
147 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
148 }
149 catch (Exception e) {
150 if (e instanceof com.liferay.portal.PortalException) {
151 throw (com.liferay.portal.PortalException)e;
152 }
153
154 if (e instanceof com.liferay.portal.SystemException) {
155 throw (com.liferay.portal.SystemException)e;
156 }
157
158 throw new com.liferay.portal.SystemException(e);
159 }
160
161 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
162 }
163 catch (com.liferay.portal.SystemException se) {
164 _log.error(se, se);
165
166 throw se;
167 }
168 }
169
170 public static com.liferay.portlet.bookmarks.model.BookmarksFolder updateFolder(
171 HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
172 java.lang.String name, java.lang.String description,
173 boolean mergeWithParentFolder,
174 com.liferay.portal.service.ServiceContext serviceContext)
175 throws com.liferay.portal.PortalException,
176 com.liferay.portal.SystemException {
177 try {
178 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
179 "updateFolder", _updateFolderParameterTypes3);
180
181 MethodHandler methodHandler = new MethodHandler(methodKey,
182 folderId, parentFolderId, name, description,
183 mergeWithParentFolder, serviceContext);
184
185 Object returnObj = null;
186
187 try {
188 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
189 }
190 catch (Exception e) {
191 if (e instanceof com.liferay.portal.PortalException) {
192 throw (com.liferay.portal.PortalException)e;
193 }
194
195 if (e instanceof com.liferay.portal.SystemException) {
196 throw (com.liferay.portal.SystemException)e;
197 }
198
199 throw new com.liferay.portal.SystemException(e);
200 }
201
202 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
203 }
204 catch (com.liferay.portal.SystemException se) {
205 _log.error(se, se);
206
207 throw se;
208 }
209 }
210
211 private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceHttp.class);
212 private static final Class<?>[] _addFolderParameterTypes0 = new Class[] {
213 long.class, java.lang.String.class, java.lang.String.class,
214 com.liferay.portal.service.ServiceContext.class
215 };
216 private static final Class<?>[] _deleteFolderParameterTypes1 = new Class[] {
217 long.class
218 };
219 private static final Class<?>[] _getFolderParameterTypes2 = new Class[] {
220 long.class
221 };
222 private static final Class<?>[] _updateFolderParameterTypes3 = new Class[] {
223 long.class, long.class, java.lang.String.class,
224 java.lang.String.class, boolean.class,
225 com.liferay.portal.service.ServiceContext.class
226 };
227 }