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