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