001
014
015 package com.liferay.portlet.bookmarks.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.bookmarks.service.BookmarksFolderServiceUtil;
025
026
056 public class BookmarksFolderServiceHttp {
057 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
058 HttpPrincipal httpPrincipal, long parentFolderId,
059 java.lang.String name, java.lang.String description,
060 com.liferay.portal.service.ServiceContext serviceContext)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
065 "addFolder", _addFolderParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey,
068 parentFolderId, name, description, serviceContext);
069
070 Object returnObj = null;
071
072 try {
073 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074 }
075 catch (Exception e) {
076 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077 throw (com.liferay.portal.kernel.exception.PortalException)e;
078 }
079
080 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081 throw (com.liferay.portal.kernel.exception.SystemException)e;
082 }
083
084 throw new com.liferay.portal.kernel.exception.SystemException(e);
085 }
086
087 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
088 }
089 catch (com.liferay.portal.kernel.exception.SystemException se) {
090 _log.error(se, se);
091
092 throw se;
093 }
094 }
095
096 public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
097 throws com.liferay.portal.kernel.exception.PortalException,
098 com.liferay.portal.kernel.exception.SystemException {
099 try {
100 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
101 "deleteFolder", _deleteFolderParameterTypes1);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
104
105 try {
106 TunnelUtil.invoke(httpPrincipal, methodHandler);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110 throw (com.liferay.portal.kernel.exception.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114 throw (com.liferay.portal.kernel.exception.SystemException)e;
115 }
116
117 throw new com.liferay.portal.kernel.exception.SystemException(e);
118 }
119 }
120 catch (com.liferay.portal.kernel.exception.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 public static com.liferay.portlet.bookmarks.model.BookmarksFolder getFolder(
128 HttpPrincipal httpPrincipal, long folderId)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
133 "getFolder", _getFolderParameterTypes2);
134
135 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
136
137 Object returnObj = null;
138
139 try {
140 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153
154 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
155 }
156 catch (com.liferay.portal.kernel.exception.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static com.liferay.portlet.bookmarks.model.BookmarksFolder updateFolder(
164 HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
165 java.lang.String name, java.lang.String description,
166 boolean mergeWithParentFolder,
167 com.liferay.portal.service.ServiceContext serviceContext)
168 throws com.liferay.portal.kernel.exception.PortalException,
169 com.liferay.portal.kernel.exception.SystemException {
170 try {
171 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class.getName(),
172 "updateFolder", _updateFolderParameterTypes3);
173
174 MethodHandler methodHandler = new MethodHandler(methodKey,
175 folderId, parentFolderId, name, description,
176 mergeWithParentFolder, serviceContext);
177
178 Object returnObj = null;
179
180 try {
181 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
182 }
183 catch (Exception e) {
184 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
185 throw (com.liferay.portal.kernel.exception.PortalException)e;
186 }
187
188 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
189 throw (com.liferay.portal.kernel.exception.SystemException)e;
190 }
191
192 throw new com.liferay.portal.kernel.exception.SystemException(e);
193 }
194
195 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
196 }
197 catch (com.liferay.portal.kernel.exception.SystemException se) {
198 _log.error(se, se);
199
200 throw se;
201 }
202 }
203
204 private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceHttp.class);
205 private static final Class<?>[] _addFolderParameterTypes0 = new Class[] {
206 long.class, java.lang.String.class, java.lang.String.class,
207 com.liferay.portal.service.ServiceContext.class
208 };
209 private static final Class<?>[] _deleteFolderParameterTypes1 = new Class[] {
210 long.class
211 };
212 private static final Class<?>[] _getFolderParameterTypes2 = new Class[] {
213 long.class
214 };
215 private static final Class<?>[] _updateFolderParameterTypes3 = new Class[] {
216 long.class, long.class, java.lang.String.class,
217 java.lang.String.class, boolean.class,
218 com.liferay.portal.service.ServiceContext.class
219 };
220 }