001
014
015 package com.liferay.portlet.asset.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.asset.service.AssetVocabularyServiceUtil;
025
026
056 public class AssetVocabularyServiceHttp {
057 public static com.liferay.portlet.asset.model.AssetVocabulary addVocabulary(
058 HttpPrincipal httpPrincipal,
059 java.util.Map<java.util.Locale, java.lang.String> titleMap,
060 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
061 java.lang.String settings,
062 com.liferay.portal.service.ServiceContext serviceContext)
063 throws com.liferay.portal.kernel.exception.PortalException,
064 com.liferay.portal.kernel.exception.SystemException {
065 try {
066 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
067 "addVocabulary", java.util.Map.class, java.util.Map.class,
068 java.lang.String.class,
069 com.liferay.portal.service.ServiceContext.class);
070
071 MethodHandler methodHandler = new MethodHandler(methodKey,
072 titleMap, descriptionMap, settings, serviceContext);
073
074 Object returnObj = null;
075
076 try {
077 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
078 }
079 catch (Exception e) {
080 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081 throw (com.liferay.portal.kernel.exception.PortalException)e;
082 }
083
084 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085 throw (com.liferay.portal.kernel.exception.SystemException)e;
086 }
087
088 throw new com.liferay.portal.kernel.exception.SystemException(e);
089 }
090
091 return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
092 }
093 catch (com.liferay.portal.kernel.exception.SystemException se) {
094 _log.error(se, se);
095
096 throw se;
097 }
098 }
099
100 public static void deleteVocabulary(HttpPrincipal httpPrincipal,
101 long vocabularyId)
102 throws com.liferay.portal.kernel.exception.PortalException,
103 com.liferay.portal.kernel.exception.SystemException {
104 try {
105 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
106 "deleteVocabulary", long.class);
107
108 MethodHandler methodHandler = new MethodHandler(methodKey,
109 vocabularyId);
110
111 try {
112 TunnelUtil.invoke(httpPrincipal, methodHandler);
113 }
114 catch (Exception e) {
115 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
116 throw (com.liferay.portal.kernel.exception.PortalException)e;
117 }
118
119 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
120 throw (com.liferay.portal.kernel.exception.SystemException)e;
121 }
122
123 throw new com.liferay.portal.kernel.exception.SystemException(e);
124 }
125 }
126 catch (com.liferay.portal.kernel.exception.SystemException se) {
127 _log.error(se, se);
128
129 throw se;
130 }
131 }
132
133 public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getCompanyVocabularies(
134 HttpPrincipal httpPrincipal, long companyId)
135 throws com.liferay.portal.kernel.exception.PortalException,
136 com.liferay.portal.kernel.exception.SystemException {
137 try {
138 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
139 "getCompanyVocabularies", long.class);
140
141 MethodHandler methodHandler = new MethodHandler(methodKey, companyId);
142
143 Object returnObj = null;
144
145 try {
146 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
147 }
148 catch (Exception e) {
149 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150 throw (com.liferay.portal.kernel.exception.PortalException)e;
151 }
152
153 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154 throw (com.liferay.portal.kernel.exception.SystemException)e;
155 }
156
157 throw new com.liferay.portal.kernel.exception.SystemException(e);
158 }
159
160 return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
161 }
162 catch (com.liferay.portal.kernel.exception.SystemException se) {
163 _log.error(se, se);
164
165 throw se;
166 }
167 }
168
169 public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getGroupsVocabularies(
170 HttpPrincipal httpPrincipal, long[] groupIds)
171 throws com.liferay.portal.kernel.exception.PortalException,
172 com.liferay.portal.kernel.exception.SystemException {
173 try {
174 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
175 "getGroupsVocabularies", long[].class);
176
177 MethodHandler methodHandler = new MethodHandler(methodKey, groupIds);
178
179 Object returnObj = null;
180
181 try {
182 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
183 }
184 catch (Exception e) {
185 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
186 throw (com.liferay.portal.kernel.exception.PortalException)e;
187 }
188
189 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
190 throw (com.liferay.portal.kernel.exception.SystemException)e;
191 }
192
193 throw new com.liferay.portal.kernel.exception.SystemException(e);
194 }
195
196 return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
197 }
198 catch (com.liferay.portal.kernel.exception.SystemException se) {
199 _log.error(se, se);
200
201 throw se;
202 }
203 }
204
205 public static java.util.List<com.liferay.portlet.asset.model.AssetVocabulary> getGroupVocabularies(
206 HttpPrincipal httpPrincipal, long groupId)
207 throws com.liferay.portal.kernel.exception.PortalException,
208 com.liferay.portal.kernel.exception.SystemException {
209 try {
210 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
211 "getGroupVocabularies", long.class);
212
213 MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
214
215 Object returnObj = null;
216
217 try {
218 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
219 }
220 catch (Exception e) {
221 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
222 throw (com.liferay.portal.kernel.exception.PortalException)e;
223 }
224
225 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
226 throw (com.liferay.portal.kernel.exception.SystemException)e;
227 }
228
229 throw new com.liferay.portal.kernel.exception.SystemException(e);
230 }
231
232 return (java.util.List<com.liferay.portlet.asset.model.AssetVocabulary>)returnObj;
233 }
234 catch (com.liferay.portal.kernel.exception.SystemException se) {
235 _log.error(se, se);
236
237 throw se;
238 }
239 }
240
241 public static com.liferay.portlet.asset.model.AssetVocabulary getVocabulary(
242 HttpPrincipal httpPrincipal, long vocabularyId)
243 throws com.liferay.portal.kernel.exception.PortalException,
244 com.liferay.portal.kernel.exception.SystemException {
245 try {
246 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
247 "getVocabulary", long.class);
248
249 MethodHandler methodHandler = new MethodHandler(methodKey,
250 vocabularyId);
251
252 Object returnObj = null;
253
254 try {
255 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
256 }
257 catch (Exception e) {
258 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
259 throw (com.liferay.portal.kernel.exception.PortalException)e;
260 }
261
262 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
263 throw (com.liferay.portal.kernel.exception.SystemException)e;
264 }
265
266 throw new com.liferay.portal.kernel.exception.SystemException(e);
267 }
268
269 return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
270 }
271 catch (com.liferay.portal.kernel.exception.SystemException se) {
272 _log.error(se, se);
273
274 throw se;
275 }
276 }
277
278 public static com.liferay.portlet.asset.model.AssetVocabulary updateVocabulary(
279 HttpPrincipal httpPrincipal, long vocabularyId,
280 java.util.Map<java.util.Locale, java.lang.String> titleMap,
281 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
282 java.lang.String settings,
283 com.liferay.portal.service.ServiceContext serviceContext)
284 throws com.liferay.portal.kernel.exception.PortalException,
285 com.liferay.portal.kernel.exception.SystemException {
286 try {
287 MethodKey methodKey = new MethodKey(AssetVocabularyServiceUtil.class.getName(),
288 "updateVocabulary", long.class, java.util.Map.class,
289 java.util.Map.class, java.lang.String.class,
290 com.liferay.portal.service.ServiceContext.class);
291
292 MethodHandler methodHandler = new MethodHandler(methodKey,
293 vocabularyId, titleMap, descriptionMap, settings,
294 serviceContext);
295
296 Object returnObj = null;
297
298 try {
299 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
300 }
301 catch (Exception e) {
302 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
303 throw (com.liferay.portal.kernel.exception.PortalException)e;
304 }
305
306 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
307 throw (com.liferay.portal.kernel.exception.SystemException)e;
308 }
309
310 throw new com.liferay.portal.kernel.exception.SystemException(e);
311 }
312
313 return (com.liferay.portlet.asset.model.AssetVocabulary)returnObj;
314 }
315 catch (com.liferay.portal.kernel.exception.SystemException se) {
316 _log.error(se, se);
317
318 throw se;
319 }
320 }
321
322 private static Log _log = LogFactoryUtil.getLog(AssetVocabularyServiceHttp.class);
323 }