001
014
015 package com.liferay.portal.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.OrganizationServiceUtil;
023
024
054 public class OrganizationServiceHttp {
055 public static void addGroupOrganizations(HttpPrincipal httpPrincipal,
056 long groupId, long[] organizationIds)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 try {
060 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
061 "addGroupOrganizations", long.class, long[].class);
062
063 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
064 organizationIds);
065
066 try {
067 TunnelUtil.invoke(httpPrincipal, methodHandler);
068 }
069 catch (Exception e) {
070 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071 throw (com.liferay.portal.kernel.exception.PortalException)e;
072 }
073
074 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075 throw (com.liferay.portal.kernel.exception.SystemException)e;
076 }
077
078 throw new com.liferay.portal.kernel.exception.SystemException(e);
079 }
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static void addPasswordPolicyOrganizations(
089 HttpPrincipal httpPrincipal, long passwordPolicyId,
090 long[] organizationIds)
091 throws com.liferay.portal.kernel.exception.PortalException,
092 com.liferay.portal.kernel.exception.SystemException {
093 try {
094 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
095 "addPasswordPolicyOrganizations", long.class, long[].class);
096
097 MethodHandler methodHandler = new MethodHandler(methodKey,
098 passwordPolicyId, organizationIds);
099
100 try {
101 TunnelUtil.invoke(httpPrincipal, methodHandler);
102 }
103 catch (Exception e) {
104 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
105 throw (com.liferay.portal.kernel.exception.PortalException)e;
106 }
107
108 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
109 throw (com.liferay.portal.kernel.exception.SystemException)e;
110 }
111
112 throw new com.liferay.portal.kernel.exception.SystemException(e);
113 }
114 }
115 catch (com.liferay.portal.kernel.exception.SystemException se) {
116 _log.error(se, se);
117
118 throw se;
119 }
120 }
121
122 public static com.liferay.portal.model.Organization addOrganization(
123 HttpPrincipal httpPrincipal, long parentOrganizationId,
124 java.lang.String name, java.lang.String type, boolean recursable,
125 long regionId, long countryId, int statusId, java.lang.String comments,
126 com.liferay.portal.service.ServiceContext serviceContext)
127 throws com.liferay.portal.kernel.exception.PortalException,
128 com.liferay.portal.kernel.exception.SystemException {
129 try {
130 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
131 "addOrganization", long.class, java.lang.String.class,
132 java.lang.String.class, boolean.class, long.class,
133 long.class, int.class, java.lang.String.class,
134 com.liferay.portal.service.ServiceContext.class);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey,
137 parentOrganizationId, name, type, recursable, regionId,
138 countryId, statusId, comments, serviceContext);
139
140 Object returnObj = null;
141
142 try {
143 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
144 }
145 catch (Exception e) {
146 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
147 throw (com.liferay.portal.kernel.exception.PortalException)e;
148 }
149
150 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
151 throw (com.liferay.portal.kernel.exception.SystemException)e;
152 }
153
154 throw new com.liferay.portal.kernel.exception.SystemException(e);
155 }
156
157 return (com.liferay.portal.model.Organization)returnObj;
158 }
159 catch (com.liferay.portal.kernel.exception.SystemException se) {
160 _log.error(se, se);
161
162 throw se;
163 }
164 }
165
166 public static com.liferay.portal.model.Organization addOrganization(
167 HttpPrincipal httpPrincipal, long parentOrganizationId,
168 java.lang.String name, java.lang.String type, boolean recursable,
169 long regionId, long countryId, int statusId, java.lang.String comments,
170 java.util.List<com.liferay.portal.model.Address> addresses,
171 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
172 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
173 java.util.List<com.liferay.portal.model.Phone> phones,
174 java.util.List<com.liferay.portal.model.Website> websites,
175 com.liferay.portal.service.ServiceContext serviceContext)
176 throws com.liferay.portal.kernel.exception.PortalException,
177 com.liferay.portal.kernel.exception.SystemException {
178 try {
179 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
180 "addOrganization", long.class, java.lang.String.class,
181 java.lang.String.class, boolean.class, long.class,
182 long.class, int.class, java.lang.String.class,
183 java.util.List.class, java.util.List.class,
184 java.util.List.class, java.util.List.class,
185 java.util.List.class,
186 com.liferay.portal.service.ServiceContext.class);
187
188 MethodHandler methodHandler = new MethodHandler(methodKey,
189 parentOrganizationId, name, type, recursable, regionId,
190 countryId, statusId, comments, addresses, emailAddresses,
191 orgLabors, phones, websites, serviceContext);
192
193 Object returnObj = null;
194
195 try {
196 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
197 }
198 catch (Exception e) {
199 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
200 throw (com.liferay.portal.kernel.exception.PortalException)e;
201 }
202
203 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
204 throw (com.liferay.portal.kernel.exception.SystemException)e;
205 }
206
207 throw new com.liferay.portal.kernel.exception.SystemException(e);
208 }
209
210 return (com.liferay.portal.model.Organization)returnObj;
211 }
212 catch (com.liferay.portal.kernel.exception.SystemException se) {
213 _log.error(se, se);
214
215 throw se;
216 }
217 }
218
219 public static void deleteLogo(HttpPrincipal httpPrincipal,
220 long organizationId)
221 throws com.liferay.portal.kernel.exception.PortalException,
222 com.liferay.portal.kernel.exception.SystemException {
223 try {
224 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
225 "deleteLogo", long.class);
226
227 MethodHandler methodHandler = new MethodHandler(methodKey,
228 organizationId);
229
230 try {
231 TunnelUtil.invoke(httpPrincipal, methodHandler);
232 }
233 catch (Exception e) {
234 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
235 throw (com.liferay.portal.kernel.exception.PortalException)e;
236 }
237
238 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
239 throw (com.liferay.portal.kernel.exception.SystemException)e;
240 }
241
242 throw new com.liferay.portal.kernel.exception.SystemException(e);
243 }
244 }
245 catch (com.liferay.portal.kernel.exception.SystemException se) {
246 _log.error(se, se);
247
248 throw se;
249 }
250 }
251
252 public static void deleteOrganization(HttpPrincipal httpPrincipal,
253 long organizationId)
254 throws com.liferay.portal.kernel.exception.PortalException,
255 com.liferay.portal.kernel.exception.SystemException {
256 try {
257 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
258 "deleteOrganization", long.class);
259
260 MethodHandler methodHandler = new MethodHandler(methodKey,
261 organizationId);
262
263 try {
264 TunnelUtil.invoke(httpPrincipal, methodHandler);
265 }
266 catch (Exception e) {
267 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268 throw (com.liferay.portal.kernel.exception.PortalException)e;
269 }
270
271 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
272 throw (com.liferay.portal.kernel.exception.SystemException)e;
273 }
274
275 throw new com.liferay.portal.kernel.exception.SystemException(e);
276 }
277 }
278 catch (com.liferay.portal.kernel.exception.SystemException se) {
279 _log.error(se, se);
280
281 throw se;
282 }
283 }
284
285 public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
286 HttpPrincipal httpPrincipal, java.lang.String actionId, int max)
287 throws com.liferay.portal.kernel.exception.PortalException,
288 com.liferay.portal.kernel.exception.SystemException {
289 try {
290 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
291 "getManageableOrganizations", java.lang.String.class,
292 int.class);
293
294 MethodHandler methodHandler = new MethodHandler(methodKey,
295 actionId, max);
296
297 Object returnObj = null;
298
299 try {
300 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
301 }
302 catch (Exception e) {
303 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
304 throw (com.liferay.portal.kernel.exception.PortalException)e;
305 }
306
307 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
308 throw (com.liferay.portal.kernel.exception.SystemException)e;
309 }
310
311 throw new com.liferay.portal.kernel.exception.SystemException(e);
312 }
313
314 return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
315 }
316 catch (com.liferay.portal.kernel.exception.SystemException se) {
317 _log.error(se, se);
318
319 throw se;
320 }
321 }
322
323 public static com.liferay.portal.model.Organization getOrganization(
324 HttpPrincipal httpPrincipal, long organizationId)
325 throws com.liferay.portal.kernel.exception.PortalException,
326 com.liferay.portal.kernel.exception.SystemException {
327 try {
328 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
329 "getOrganization", long.class);
330
331 MethodHandler methodHandler = new MethodHandler(methodKey,
332 organizationId);
333
334 Object returnObj = null;
335
336 try {
337 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
338 }
339 catch (Exception e) {
340 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
341 throw (com.liferay.portal.kernel.exception.PortalException)e;
342 }
343
344 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
345 throw (com.liferay.portal.kernel.exception.SystemException)e;
346 }
347
348 throw new com.liferay.portal.kernel.exception.SystemException(e);
349 }
350
351 return (com.liferay.portal.model.Organization)returnObj;
352 }
353 catch (com.liferay.portal.kernel.exception.SystemException se) {
354 _log.error(se, se);
355
356 throw se;
357 }
358 }
359
360 public static long getOrganizationId(HttpPrincipal httpPrincipal,
361 long companyId, java.lang.String name)
362 throws com.liferay.portal.kernel.exception.SystemException {
363 try {
364 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
365 "getOrganizationId", long.class, java.lang.String.class);
366
367 MethodHandler methodHandler = new MethodHandler(methodKey,
368 companyId, name);
369
370 Object returnObj = null;
371
372 try {
373 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
374 }
375 catch (Exception e) {
376 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
377 throw (com.liferay.portal.kernel.exception.SystemException)e;
378 }
379
380 throw new com.liferay.portal.kernel.exception.SystemException(e);
381 }
382
383 return ((Long)returnObj).longValue();
384 }
385 catch (com.liferay.portal.kernel.exception.SystemException se) {
386 _log.error(se, se);
387
388 throw se;
389 }
390 }
391
392 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
393 HttpPrincipal httpPrincipal, long userId)
394 throws com.liferay.portal.kernel.exception.PortalException,
395 com.liferay.portal.kernel.exception.SystemException {
396 try {
397 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
398 "getUserOrganizations", long.class);
399
400 MethodHandler methodHandler = new MethodHandler(methodKey, userId);
401
402 Object returnObj = null;
403
404 try {
405 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
406 }
407 catch (Exception e) {
408 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
409 throw (com.liferay.portal.kernel.exception.PortalException)e;
410 }
411
412 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
413 throw (com.liferay.portal.kernel.exception.SystemException)e;
414 }
415
416 throw new com.liferay.portal.kernel.exception.SystemException(e);
417 }
418
419 return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
420 }
421 catch (com.liferay.portal.kernel.exception.SystemException se) {
422 _log.error(se, se);
423
424 throw se;
425 }
426 }
427
428 public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
429 HttpPrincipal httpPrincipal, long userId, boolean inheritUserGroups)
430 throws com.liferay.portal.kernel.exception.PortalException,
431 com.liferay.portal.kernel.exception.SystemException {
432 try {
433 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
434 "getUserOrganizations", long.class, boolean.class);
435
436 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
437 inheritUserGroups);
438
439 Object returnObj = null;
440
441 try {
442 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
443 }
444 catch (Exception e) {
445 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
446 throw (com.liferay.portal.kernel.exception.PortalException)e;
447 }
448
449 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
450 throw (com.liferay.portal.kernel.exception.SystemException)e;
451 }
452
453 throw new com.liferay.portal.kernel.exception.SystemException(e);
454 }
455
456 return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
457 }
458 catch (com.liferay.portal.kernel.exception.SystemException se) {
459 _log.error(se, se);
460
461 throw se;
462 }
463 }
464
465 public static void setGroupOrganizations(HttpPrincipal httpPrincipal,
466 long groupId, long[] organizationIds)
467 throws com.liferay.portal.kernel.exception.PortalException,
468 com.liferay.portal.kernel.exception.SystemException {
469 try {
470 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
471 "setGroupOrganizations", long.class, long[].class);
472
473 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
474 organizationIds);
475
476 try {
477 TunnelUtil.invoke(httpPrincipal, methodHandler);
478 }
479 catch (Exception e) {
480 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
481 throw (com.liferay.portal.kernel.exception.PortalException)e;
482 }
483
484 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
485 throw (com.liferay.portal.kernel.exception.SystemException)e;
486 }
487
488 throw new com.liferay.portal.kernel.exception.SystemException(e);
489 }
490 }
491 catch (com.liferay.portal.kernel.exception.SystemException se) {
492 _log.error(se, se);
493
494 throw se;
495 }
496 }
497
498 public static void unsetGroupOrganizations(HttpPrincipal httpPrincipal,
499 long groupId, long[] organizationIds)
500 throws com.liferay.portal.kernel.exception.PortalException,
501 com.liferay.portal.kernel.exception.SystemException {
502 try {
503 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
504 "unsetGroupOrganizations", long.class, long[].class);
505
506 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
507 organizationIds);
508
509 try {
510 TunnelUtil.invoke(httpPrincipal, methodHandler);
511 }
512 catch (Exception e) {
513 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
514 throw (com.liferay.portal.kernel.exception.PortalException)e;
515 }
516
517 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
518 throw (com.liferay.portal.kernel.exception.SystemException)e;
519 }
520
521 throw new com.liferay.portal.kernel.exception.SystemException(e);
522 }
523 }
524 catch (com.liferay.portal.kernel.exception.SystemException se) {
525 _log.error(se, se);
526
527 throw se;
528 }
529 }
530
531 public static void unsetPasswordPolicyOrganizations(
532 HttpPrincipal httpPrincipal, long passwordPolicyId,
533 long[] organizationIds)
534 throws com.liferay.portal.kernel.exception.PortalException,
535 com.liferay.portal.kernel.exception.SystemException {
536 try {
537 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
538 "unsetPasswordPolicyOrganizations", long.class, long[].class);
539
540 MethodHandler methodHandler = new MethodHandler(methodKey,
541 passwordPolicyId, organizationIds);
542
543 try {
544 TunnelUtil.invoke(httpPrincipal, methodHandler);
545 }
546 catch (Exception e) {
547 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
548 throw (com.liferay.portal.kernel.exception.PortalException)e;
549 }
550
551 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
552 throw (com.liferay.portal.kernel.exception.SystemException)e;
553 }
554
555 throw new com.liferay.portal.kernel.exception.SystemException(e);
556 }
557 }
558 catch (com.liferay.portal.kernel.exception.SystemException se) {
559 _log.error(se, se);
560
561 throw se;
562 }
563 }
564
565 public static com.liferay.portal.model.Organization updateOrganization(
566 HttpPrincipal httpPrincipal, long organizationId,
567 long parentOrganizationId, java.lang.String name,
568 java.lang.String type, boolean recursable, long regionId,
569 long countryId, int statusId, java.lang.String comments,
570 com.liferay.portal.service.ServiceContext serviceContext)
571 throws com.liferay.portal.kernel.exception.PortalException,
572 com.liferay.portal.kernel.exception.SystemException {
573 try {
574 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
575 "updateOrganization", long.class, long.class,
576 java.lang.String.class, java.lang.String.class,
577 boolean.class, long.class, long.class, int.class,
578 java.lang.String.class,
579 com.liferay.portal.service.ServiceContext.class);
580
581 MethodHandler methodHandler = new MethodHandler(methodKey,
582 organizationId, parentOrganizationId, name, type,
583 recursable, regionId, countryId, statusId, comments,
584 serviceContext);
585
586 Object returnObj = null;
587
588 try {
589 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
590 }
591 catch (Exception e) {
592 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
593 throw (com.liferay.portal.kernel.exception.PortalException)e;
594 }
595
596 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
597 throw (com.liferay.portal.kernel.exception.SystemException)e;
598 }
599
600 throw new com.liferay.portal.kernel.exception.SystemException(e);
601 }
602
603 return (com.liferay.portal.model.Organization)returnObj;
604 }
605 catch (com.liferay.portal.kernel.exception.SystemException se) {
606 _log.error(se, se);
607
608 throw se;
609 }
610 }
611
612 public static com.liferay.portal.model.Organization updateOrganization(
613 HttpPrincipal httpPrincipal, long organizationId,
614 long parentOrganizationId, java.lang.String name,
615 java.lang.String type, boolean recursable, long regionId,
616 long countryId, int statusId, java.lang.String comments,
617 java.util.List<com.liferay.portal.model.Address> addresses,
618 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
619 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
620 java.util.List<com.liferay.portal.model.Phone> phones,
621 java.util.List<com.liferay.portal.model.Website> websites,
622 com.liferay.portal.service.ServiceContext serviceContext)
623 throws com.liferay.portal.kernel.exception.PortalException,
624 com.liferay.portal.kernel.exception.SystemException {
625 try {
626 MethodKey methodKey = new MethodKey(OrganizationServiceUtil.class.getName(),
627 "updateOrganization", long.class, long.class,
628 java.lang.String.class, java.lang.String.class,
629 boolean.class, long.class, long.class, int.class,
630 java.lang.String.class, java.util.List.class,
631 java.util.List.class, java.util.List.class,
632 java.util.List.class, java.util.List.class,
633 com.liferay.portal.service.ServiceContext.class);
634
635 MethodHandler methodHandler = new MethodHandler(methodKey,
636 organizationId, parentOrganizationId, name, type,
637 recursable, regionId, countryId, statusId, comments,
638 addresses, emailAddresses, orgLabors, phones, websites,
639 serviceContext);
640
641 Object returnObj = null;
642
643 try {
644 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
645 }
646 catch (Exception e) {
647 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
648 throw (com.liferay.portal.kernel.exception.PortalException)e;
649 }
650
651 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
652 throw (com.liferay.portal.kernel.exception.SystemException)e;
653 }
654
655 throw new com.liferay.portal.kernel.exception.SystemException(e);
656 }
657
658 return (com.liferay.portal.model.Organization)returnObj;
659 }
660 catch (com.liferay.portal.kernel.exception.SystemException se) {
661 _log.error(se, se);
662
663 throw se;
664 }
665 }
666
667 private static Log _log = LogFactoryUtil.getLog(OrganizationServiceHttp.class);
668 }