001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.http; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.log.Log; 020 import com.liferay.portal.kernel.log.LogFactoryUtil; 021 import com.liferay.portal.service.GroupServiceUtil; 022 023 import java.rmi.RemoteException; 024 025 /** 026 * Provides the SOAP utility for the 027 * {@link com.liferay.portal.service.GroupServiceUtil} service utility. The 028 * static methods of this class calls the same methods of the service utility. 029 * However, the signatures are different because it is difficult for SOAP to 030 * support certain types. 031 * 032 * <p> 033 * ServiceBuilder follows certain rules in translating the methods. For example, 034 * if the method in the service utility returns a {@link java.util.List}, that 035 * is translated to an array of {@link com.liferay.portal.model.GroupSoap}. 036 * If the method in the service utility returns a 037 * {@link com.liferay.portal.model.Group}, that is translated to a 038 * {@link com.liferay.portal.model.GroupSoap}. Methods that SOAP cannot 039 * safely wire are skipped. 040 * </p> 041 * 042 * <p> 043 * The benefits of using the SOAP utility is that it is cross platform 044 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 045 * even Perl, to call the generated services. One drawback of SOAP is that it is 046 * slow because it needs to serialize all calls into a text format (XML). 047 * </p> 048 * 049 * <p> 050 * You can see a list of services at http://localhost:8080/api/axis. Set the 051 * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 052 * security. 053 * </p> 054 * 055 * <p> 056 * The SOAP utility is only generated for remote services. 057 * </p> 058 * 059 * @author Brian Wing Shun Chan 060 * @see GroupServiceHttp 061 * @see com.liferay.portal.model.GroupSoap 062 * @see com.liferay.portal.service.GroupServiceUtil 063 * @generated 064 */ 065 @ProviderType 066 public class GroupServiceSoap { 067 /** 068 * Adds a group. 069 * 070 * @param parentGroupId the primary key of the parent group 071 * @param liveGroupId the primary key of the live group 072 * @param name the entity's name 073 * @param description the group's description (optionally 074 <code>null</code>) 075 * @param type the group's type. For more information see {@link 076 com.liferay.portal.model.GroupConstants} 077 * @param friendlyURL the group's friendlyURL (optionally 078 <code>null</code>) 079 * @param site whether the group is to be associated with a main site 080 * @param active whether the group is active 081 * @param serviceContext the service context to be applied (optionally 082 <code>null</code>). Can set the asset category IDs and asset tag 083 names for the group, and can set whether the group is for staging 084 * @return the group 085 * @throws PortalException if the user did not have permission to add the 086 group, if a creator could not be found, if the group's 087 information was invalid, if a layout could not be found, or if a 088 valid friendly URL could not be created for the group 089 * @throws SystemException if a system exception occurred 090 */ 091 public static com.liferay.portal.model.GroupSoap addGroup( 092 long parentGroupId, long liveGroupId, java.lang.String name, 093 java.lang.String description, int type, boolean manualMembership, 094 int membershipRestriction, java.lang.String friendlyURL, boolean site, 095 boolean active, com.liferay.portal.service.ServiceContext serviceContext) 096 throws RemoteException { 097 try { 098 com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(parentGroupId, 099 liveGroupId, name, description, type, manualMembership, 100 membershipRestriction, friendlyURL, site, active, 101 serviceContext); 102 103 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 104 } 105 catch (Exception e) { 106 _log.error(e, e); 107 108 throw new RemoteException(e.getMessage()); 109 } 110 } 111 112 /** 113 * Adds the group using the group default live group ID. 114 * 115 * @param parentGroupId the primary key of the parent group 116 * @param name the entity's name 117 * @param description the group's description (optionally 118 <code>null</code>) 119 * @param type the group's type. For more information see {@link 120 com.liferay.portal.model.GroupConstants} 121 * @param friendlyURL the group's friendlyURL 122 * @param site whether the group is to be associated with a main site 123 * @param active whether the group is active 124 * @param serviceContext the service context to be applied (optionally 125 <code>null</code>). Can set asset category IDs and asset tag 126 names for the group, and can set whether the group is for 127 staging 128 * @return the group 129 * @throws PortalException if the user did not have permission to add 130 the group, if a creator could not be found, if the group's 131 information was invalid, if a layout could not be found, or 132 if a valid friendly URL could not be created for the group 133 * @throws SystemException if a system exception occurred 134 * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, long, String, 135 String, int, boolean, int, String, boolean, boolean, 136 ServiceContext)} 137 */ 138 public static com.liferay.portal.model.GroupSoap addGroup( 139 long parentGroupId, java.lang.String name, 140 java.lang.String description, int type, java.lang.String friendlyURL, 141 boolean site, boolean active, 142 com.liferay.portal.service.ServiceContext serviceContext) 143 throws RemoteException { 144 try { 145 com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(parentGroupId, 146 name, description, type, friendlyURL, site, active, 147 serviceContext); 148 149 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 150 } 151 catch (Exception e) { 152 _log.error(e, e); 153 154 throw new RemoteException(e.getMessage()); 155 } 156 } 157 158 /** 159 * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, String, 160 String, int, String, boolean, boolean, ServiceContext)} 161 */ 162 public static com.liferay.portal.model.GroupSoap addGroup( 163 java.lang.String name, java.lang.String description, int type, 164 java.lang.String friendlyURL, boolean site, boolean active, 165 com.liferay.portal.service.ServiceContext serviceContext) 166 throws RemoteException { 167 try { 168 com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name, 169 description, type, friendlyURL, site, active, serviceContext); 170 171 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 172 } 173 catch (Exception e) { 174 _log.error(e, e); 175 176 throw new RemoteException(e.getMessage()); 177 } 178 } 179 180 /** 181 * Adds the groups to the role. 182 * 183 * @param roleId the primary key of the role 184 * @param groupIds the primary keys of the groups 185 * @throws PortalException if the user did not have permission to update the 186 role 187 * @throws SystemException if a system exception occurred 188 */ 189 public static void addRoleGroups(long roleId, long[] groupIds) 190 throws RemoteException { 191 try { 192 GroupServiceUtil.addRoleGroups(roleId, groupIds); 193 } 194 catch (Exception e) { 195 _log.error(e, e); 196 197 throw new RemoteException(e.getMessage()); 198 } 199 } 200 201 /** 202 * Checks that the current user is permitted to use the group for Remote 203 * Staging. 204 * 205 * @param groupId the primary key of the group 206 * @throws PortalException if a group with the primary key could not be 207 found, if the current user did not have permission to view the 208 group, or if the group's company was different from the current 209 user's company 210 * @throws SystemException if a system exception occurred 211 */ 212 public static void checkRemoteStagingGroup(long groupId) 213 throws RemoteException { 214 try { 215 GroupServiceUtil.checkRemoteStagingGroup(groupId); 216 } 217 catch (Exception e) { 218 _log.error(e, e); 219 220 throw new RemoteException(e.getMessage()); 221 } 222 } 223 224 /** 225 * Deletes the group. 226 * 227 * <p> 228 * The group is unstaged and its assets and resources including layouts, 229 * membership requests, subscriptions, teams, blogs, bookmarks, calendar 230 * events, image gallery, journals, message boards, polls, shopping related 231 * entities, software catalog, and wikis are also deleted. 232 * </p> 233 * 234 * @param groupId the primary key of the group 235 * @throws PortalException if the user did not have permission to delete the 236 group or its assets or resources, if a group with the primary key 237 could not be found, or if the group was a system group 238 * @throws SystemException if a system exception occurred 239 */ 240 public static void deleteGroup(long groupId) throws RemoteException { 241 try { 242 GroupServiceUtil.deleteGroup(groupId); 243 } 244 catch (Exception e) { 245 _log.error(e, e); 246 247 throw new RemoteException(e.getMessage()); 248 } 249 } 250 251 public static void disableStaging(long groupId) throws RemoteException { 252 try { 253 GroupServiceUtil.disableStaging(groupId); 254 } 255 catch (Exception e) { 256 _log.error(e, e); 257 258 throw new RemoteException(e.getMessage()); 259 } 260 } 261 262 public static void enableStaging(long groupId) throws RemoteException { 263 try { 264 GroupServiceUtil.enableStaging(groupId); 265 } 266 catch (Exception e) { 267 _log.error(e, e); 268 269 throw new RemoteException(e.getMessage()); 270 } 271 } 272 273 /** 274 * Returns the company group. 275 * 276 * @param companyId the primary key of the company 277 * @return the group associated with the company 278 * @throws PortalException if a matching group could not be found 279 * @throws SystemException if a system exception occurred 280 */ 281 public static com.liferay.portal.model.GroupSoap getCompanyGroup( 282 long companyId) throws RemoteException { 283 try { 284 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getCompanyGroup(companyId); 285 286 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 287 } 288 catch (Exception e) { 289 _log.error(e, e); 290 291 throw new RemoteException(e.getMessage()); 292 } 293 } 294 295 /** 296 * Returns the group with the primary key. 297 * 298 * @param groupId the primary key of the group 299 * @return the group with the primary key 300 * @throws PortalException if a group with the primary key could not be 301 found or if the current user did not have permission to view the 302 group 303 * @throws SystemException if a system exception occurred 304 */ 305 public static com.liferay.portal.model.GroupSoap getGroup(long groupId) 306 throws RemoteException { 307 try { 308 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId); 309 310 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 311 } 312 catch (Exception e) { 313 _log.error(e, e); 314 315 throw new RemoteException(e.getMessage()); 316 } 317 } 318 319 /** 320 * Returns the group with the name. 321 * 322 * @param companyId the primary key of the company 323 * @param name the group's name 324 * @return the group with the name 325 * @throws PortalException if a matching group could not be found or if the 326 current user did not have permission to view the group 327 * @throws SystemException if a system exception occurred 328 */ 329 public static com.liferay.portal.model.GroupSoap getGroup(long companyId, 330 java.lang.String name) throws RemoteException { 331 try { 332 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId, 333 name); 334 335 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 336 } 337 catch (Exception e) { 338 _log.error(e, e); 339 340 throw new RemoteException(e.getMessage()); 341 } 342 } 343 344 /** 345 * Returns all the groups that are direct children of the parent group. 346 * 347 * @param companyId the primary key of the company 348 * @param parentGroupId the primary key of the parent group 349 * @param site whether the group is to be associated with a main site 350 * @return the matching groups, or <code>null</code> if no matches were 351 found 352 * @throws PortalException if the user did not have permission to view the 353 group or if a portal exception occurred 354 * @throws SystemException if a system exception occurred 355 */ 356 public static com.liferay.portal.model.GroupSoap[] getGroups( 357 long companyId, long parentGroupId, boolean site) 358 throws RemoteException { 359 try { 360 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getGroups(companyId, 361 parentGroupId, site); 362 363 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 364 } 365 catch (Exception e) { 366 _log.error(e, e); 367 368 throw new RemoteException(e.getMessage()); 369 } 370 } 371 372 /** 373 * Returns a range of all the site groups for which the user has control 374 * panel access. 375 * 376 * @param portlets the portlets to manage 377 * @param max the upper bound of the range of groups to consider (not 378 inclusive) 379 * @return the range of site groups for which the user has Control Panel 380 access 381 * @throws PortalException if a portal exception occurred 382 * @throws SystemException if a system exception occurred 383 */ 384 public static com.liferay.portal.model.GroupSoap[] getManageableSiteGroups( 385 java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max) 386 throws RemoteException { 387 try { 388 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getManageableSiteGroups(portlets, 389 max); 390 391 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 392 } 393 catch (Exception e) { 394 _log.error(e, e); 395 396 throw new RemoteException(e.getMessage()); 397 } 398 } 399 400 /** 401 * Returns a range of all the site groups for which the user has control 402 * panel access. 403 * 404 * @param portlets the portlets to manage 405 * @param max the upper bound of the range of groups to consider (not 406 inclusive) 407 * @return the range of site groups for which the user has Control Panel 408 access 409 * @throws PortalException if a portal exception occurred 410 * @throws SystemException if a system exception occurred 411 * @deprecated As of 6.2.0, replaced by {@link 412 #getManageableSiteGroups(Collection, int)} 413 */ 414 public static com.liferay.portal.model.GroupSoap[] getManageableSites( 415 java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max) 416 throws RemoteException { 417 try { 418 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getManageableSites(portlets, 419 max); 420 421 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 422 } 423 catch (Exception e) { 424 _log.error(e, e); 425 426 throw new RemoteException(e.getMessage()); 427 } 428 } 429 430 /** 431 * Returns the groups associated with the organizations. 432 * 433 * @param organizations the organizations 434 * @return the groups associated with the organizations 435 * @throws PortalException if a portal exception occurred 436 * @throws SystemException if a system exception occurred 437 */ 438 public static com.liferay.portal.model.GroupSoap[] getOrganizationsGroups( 439 com.liferay.portal.model.OrganizationSoap[] organizations) 440 throws RemoteException { 441 try { 442 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getOrganizationsGroups(com.liferay.portal.model.impl.OrganizationModelImpl.toModels( 443 organizations)); 444 445 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 446 } 447 catch (Exception e) { 448 _log.error(e, e); 449 450 throw new RemoteException(e.getMessage()); 451 } 452 } 453 454 /** 455 * Returns the group associated with the user. 456 * 457 * @param companyId the primary key of the company 458 * @param userId the primary key of the user 459 * @return the group associated with the user 460 * @throws PortalException if a matching group could not be found or if the 461 current user did not have permission to view the group 462 * @throws SystemException if a system exception occurred 463 */ 464 public static com.liferay.portal.model.GroupSoap getUserGroup( 465 long companyId, long userId) throws RemoteException { 466 try { 467 com.liferay.portal.model.Group returnValue = GroupServiceUtil.getUserGroup(companyId, 468 userId); 469 470 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 471 } 472 catch (Exception e) { 473 _log.error(e, e); 474 475 throw new RemoteException(e.getMessage()); 476 } 477 } 478 479 /** 480 * Returns the groups associated with the user groups. 481 * 482 * @param userGroups the user groups 483 * @return the groups associated with the user groups 484 * @throws PortalException if any one of the user group's group could not be 485 found 486 * @throws SystemException if a system exception occurred 487 */ 488 public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups( 489 com.liferay.portal.model.UserGroupSoap[] userGroups) 490 throws RemoteException { 491 try { 492 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserGroupsGroups(com.liferay.portal.model.impl.UserGroupModelImpl.toModels( 493 userGroups)); 494 495 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 496 } 497 catch (Exception e) { 498 _log.error(e, e); 499 500 throw new RemoteException(e.getMessage()); 501 } 502 } 503 504 /** 505 * Returns the range of all groups associated with the user's organization 506 * groups, including the ancestors of the organization groups, unless portal 507 * property <code>organizations.membership.strict</code> is set to 508 * <code>true</code>. 509 * 510 * <p> 511 * Useful when paginating results. Returns a maximum of <code>end - 512 * start</code> instances. <code>start</code> and <code>end</code> are not 513 * primary keys, they are indexes in the result set. Thus, <code>0</code> 514 * refers to the first result in the set. Setting both <code>start</code> 515 * and <code>end</code> to {@link 516 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 517 * result set. 518 * </p> 519 * 520 * @param userId the primary key of the user 521 * @param start the lower bound of the range of groups to consider 522 * @param end the upper bound of the range of groups to consider (not 523 inclusive) 524 * @return the range of groups associated with the user's organizations 525 * @throws PortalException if a user with the primary key could not be found 526 or if another portal exception occurred 527 * @throws SystemException if a system exception occurred 528 */ 529 public static com.liferay.portal.model.GroupSoap[] getUserOrganizationsGroups( 530 long userId, int start, int end) throws RemoteException { 531 try { 532 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserOrganizationsGroups(userId, 533 start, end); 534 535 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 536 } 537 catch (Exception e) { 538 _log.error(e, e); 539 540 throw new RemoteException(e.getMessage()); 541 } 542 } 543 544 /** 545 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 546 String[], boolean, int)} 547 */ 548 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 549 long userId, java.lang.String[] classNames, 550 boolean includeControlPanel, int max) throws RemoteException { 551 try { 552 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(userId, 553 classNames, includeControlPanel, max); 554 555 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 556 } 557 catch (Exception e) { 558 _log.error(e, e); 559 560 throw new RemoteException(e.getMessage()); 561 } 562 } 563 564 /** 565 * Returns the user's groups "sites" associated with the group 566 * entity class names, including the Control Panel group if the user is 567 * permitted to view the Control Panel. 568 * 569 * <ul> 570 * <li> 571 * Class name "User" includes the user's layout set 572 * group. 573 * </li> 574 * <li> 575 * Class name "Organization" includes the user's 576 * immediate organization groups and inherited organization groups. 577 * </li> 578 * <li> 579 * Class name "Group" includes the user's immediate 580 * organization groups and site groups. 581 * </li> 582 * <li> 583 * A <code>classNames</code> 584 * value of <code>null</code> includes the user's layout set group, 585 * organization groups, inherited organization groups, and site groups. 586 * </li> 587 * </ul> 588 * 589 * @param userId the primary key of the user 590 * @param classNames the group entity class names (optionally 591 <code>null</code>). For more information see {@link 592 #getUserSitesGroups(long, String[], int)} 593 * @param max the maximum number of groups to return 594 * @return the user's groups "sites" 595 * @throws PortalException if a portal exception occurred 596 * @throws SystemException if a system exception occurred 597 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 598 String[], int)} 599 */ 600 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 601 long userId, java.lang.String[] classNames, int max) 602 throws RemoteException { 603 try { 604 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(userId, 605 classNames, max); 606 607 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 608 } 609 catch (Exception e) { 610 _log.error(e, e); 611 612 throw new RemoteException(e.getMessage()); 613 } 614 } 615 616 /** 617 * Returns the guest or current user's groups "sites" associated 618 * with the group entity class names, including the Control Panel group if 619 * the user is permitted to view the Control Panel. 620 * 621 * <ul> 622 * <li> 623 * Class name "User" includes the user's layout set 624 * group. 625 * </li> 626 * <li> 627 * Class name "Organization" includes the user's 628 * immediate organization groups and inherited organization groups. 629 * </li> 630 * <li> 631 * Class name "Group" includes the user's immediate 632 * organization groups and site groups. 633 * </li> 634 * <li> 635 * A <code>classNames</code> 636 * value of <code>null</code> includes the user's layout set group, 637 * organization groups, inherited organization groups, and site groups. 638 * </li> 639 * </ul> 640 * 641 * @param classNames the group entity class names (optionally 642 <code>null</code>). For more information see {@link 643 #getUserSitesGroups(String[], int)} 644 * @param max the maximum number of groups to return 645 * @return the user's groups "sites" 646 * @throws PortalException if a portal exception occurred 647 * @throws SystemException if a system exception occurred 648 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups( 649 String[], int)} 650 */ 651 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 652 java.lang.String[] classNames, int max) throws RemoteException { 653 try { 654 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(classNames, 655 max); 656 657 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 658 } 659 catch (Exception e) { 660 _log.error(e, e); 661 662 throw new RemoteException(e.getMessage()); 663 } 664 } 665 666 /** 667 * Returns the number of the guest or current user's groups 668 * "sites" associated with the group entity class names, including 669 * the Control Panel group if the user is permitted to view the Control 670 * Panel. 671 * 672 * @return the number of user's groups "sites" 673 * @throws PortalException if a portal exception occurred 674 * @throws SystemException if a system exception occurred 675 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroupsCount()} 676 */ 677 public static int getUserPlacesCount() throws RemoteException { 678 try { 679 int returnValue = GroupServiceUtil.getUserPlacesCount(); 680 681 return returnValue; 682 } 683 catch (Exception e) { 684 _log.error(e, e); 685 686 throw new RemoteException(e.getMessage()); 687 } 688 } 689 690 /** 691 * Returns the guest or current user's layout set group, organization 692 * groups, inherited organization groups, and site groups. 693 * 694 * @return the user's layout set group, organization groups, and 695 inherited organization groups, and site groups 696 * @throws PortalException if a portal exception occurred 697 * @throws SystemException if a system exception occurred 698 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups} 699 */ 700 public static com.liferay.portal.model.GroupSoap[] getUserSites() 701 throws RemoteException { 702 try { 703 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSites(); 704 705 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 706 } 707 catch (Exception e) { 708 _log.error(e, e); 709 710 throw new RemoteException(e.getMessage()); 711 } 712 } 713 714 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups() 715 throws RemoteException { 716 try { 717 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(); 718 719 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 720 } 721 catch (Exception e) { 722 _log.error(e, e); 723 724 throw new RemoteException(e.getMessage()); 725 } 726 } 727 728 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 729 long userId, java.lang.String[] classNames, 730 boolean includeControlPanel, int max) throws RemoteException { 731 try { 732 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(userId, 733 classNames, includeControlPanel, max); 734 735 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 736 } 737 catch (Exception e) { 738 _log.error(e, e); 739 740 throw new RemoteException(e.getMessage()); 741 } 742 } 743 744 /** 745 * Returns the user's groups "sites" associated with the group 746 * entity class names, including the Control Panel group if the user is 747 * permitted to view the Control Panel. 748 * 749 * <ul> 750 * <li> 751 * Class name "User" includes the user's layout set 752 * group. 753 * </li> 754 * <li> 755 * Class name "Organization" includes the user's 756 * immediate organization groups and inherited organization groups. 757 * </li> 758 * <li> 759 * Class name "Group" includes the user's immediate 760 * organization groups and site groups. 761 * </li> 762 * <li> 763 * A <code>classNames</code> 764 * value of <code>null</code> includes the user's layout set group, 765 * organization groups, inherited organization groups, and site groups. 766 * </li> 767 * </ul> 768 * 769 * @param userId the primary key of the user 770 * @param classNames the group entity class names (optionally 771 <code>null</code>). For more information see {@link 772 #getUserSitesGroups(long, String[], boolean, int)} 773 * @param max the maximum number of groups to return 774 * @return the user's groups "sites" 775 * @throws PortalException if a portal exception occurred 776 * @throws SystemException if a system exception occurred 777 */ 778 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 779 long userId, java.lang.String[] classNames, int max) 780 throws RemoteException { 781 try { 782 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(userId, 783 classNames, max); 784 785 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 786 } 787 catch (Exception e) { 788 _log.error(e, e); 789 790 throw new RemoteException(e.getMessage()); 791 } 792 } 793 794 /** 795 * Returns the guest or current user's groups "sites" associated 796 * with the group entity class names, including the Control Panel group if 797 * the user is permitted to view the Control Panel. 798 * 799 * <ul> 800 * <li> 801 * Class name "User" includes the user's layout set 802 * group. 803 * </li> 804 * <li> 805 * Class name "Organization" includes the user's 806 * immediate organization groups and inherited organization groups. 807 * </li> 808 * <li> 809 * Class name "Group" includes the user's immediate 810 * organization groups and site groups. 811 * </li> 812 * <li> 813 * A <code>classNames</code> 814 * value of <code>null</code> includes the user's layout set group, 815 * organization groups, inherited organization groups, and site groups. 816 * </li> 817 * </ul> 818 * 819 * @param classNames the group entity class names (optionally 820 <code>null</code>). For more information see {@link 821 #getUserSitesGroups(long, String[], boolean, int)} 822 * @param max the maximum number of groups to return 823 * @return the user's groups "sites" 824 * @throws PortalException if a portal exception occurred 825 * @throws SystemException if a system exception occurred 826 */ 827 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 828 java.lang.String[] classNames, int max) throws RemoteException { 829 try { 830 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(classNames, 831 max); 832 833 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 834 } 835 catch (Exception e) { 836 _log.error(e, e); 837 838 throw new RemoteException(e.getMessage()); 839 } 840 } 841 842 /** 843 * Returns the number of the guest or current user's groups 844 * "sites" associated with the group entity class names, including 845 * the Control Panel group if the user is permitted to view the Control 846 * Panel. 847 * 848 * @return the number of user's groups "sites" 849 * @throws PortalException if a portal exception occurred 850 * @throws SystemException if a system exception occurred 851 */ 852 public static int getUserSitesGroupsCount() throws RemoteException { 853 try { 854 int returnValue = GroupServiceUtil.getUserSitesGroupsCount(); 855 856 return returnValue; 857 } 858 catch (Exception e) { 859 _log.error(e, e); 860 861 throw new RemoteException(e.getMessage()); 862 } 863 } 864 865 /** 866 * Returns <code>true</code> if the user is associated with the group, 867 * including the user's inherited organizations and user groups. System and 868 * staged groups are not included. 869 * 870 * @param userId the primary key of the user 871 * @param groupId the primary key of the group 872 * @return <code>true</code> if the user is associated with the group; 873 <code>false</code> otherwise 874 * @throws PortalException if the current user did not have permission to 875 view the user or group members 876 * @throws SystemException if a system exception occurred 877 */ 878 public static boolean hasUserGroup(long userId, long groupId) 879 throws RemoteException { 880 try { 881 boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId); 882 883 return returnValue; 884 } 885 catch (Exception e) { 886 _log.error(e, e); 887 888 throw new RemoteException(e.getMessage()); 889 } 890 } 891 892 /** 893 * Returns an ordered range of all the site groups and organization groups 894 * that match the name and description, optionally including the user's 895 * inherited organization groups and user groups. System and staged groups 896 * are not included. 897 * 898 * <p> 899 * Useful when paginating results. Returns a maximum of <code>end - 900 * start</code> instances. <code>start</code> and <code>end</code> are not 901 * primary keys, they are indexes in the result set. Thus, <code>0</code> 902 * refers to the first result in the set. Setting both <code>start</code> 903 * and <code>end</code> to {@link 904 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 905 * result set. 906 * </p> 907 * 908 * @param companyId the primary key of the company 909 * @param name the group's name (optionally <code>null</code>) 910 * @param description the group's description (optionally 911 <code>null</code>) 912 * @param params the finder params (optionally <code>null</code>). To 913 include the user's inherited organizations and user groups in the 914 search, add entries having "usersGroups" and 915 "inherit" as keys mapped to the the user's ID. For more 916 information see {@link 917 com.liferay.portal.service.persistence.GroupFinder} 918 * @param start the lower bound of the range of groups to return 919 * @param end the upper bound of the range of groups to return (not 920 inclusive) 921 * @return the matching groups ordered by name 922 * @throws PortalException if a portal exception occurred 923 * @throws SystemException if a system exception occurred 924 */ 925 public static com.liferay.portal.model.GroupSoap[] search(long companyId, 926 java.lang.String name, java.lang.String description, 927 java.lang.String[] params, int start, int end) 928 throws RemoteException { 929 try { 930 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.search(companyId, 931 name, description, params, start, end); 932 933 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 934 } 935 catch (Exception e) { 936 _log.error(e, e); 937 938 throw new RemoteException(e.getMessage()); 939 } 940 } 941 942 /** 943 * Returns the number of groups and organization groups that match the name 944 * and description, optionally including the user's inherited organizations 945 * and user groups. System and staged groups are not included. 946 * 947 * @param companyId the primary key of the company 948 * @param name the group's name (optionally <code>null</code>) 949 * @param description the group's description (optionally 950 <code>null</code>) 951 * @param params the finder params (optionally <code>null</code>). To 952 include the user's inherited organizations and user groups in the 953 search, add entries having "usersGroups" and 954 "inherit" as keys mapped to the the user's ID. For more 955 information see {@link 956 com.liferay.portal.service.persistence.GroupFinder} 957 * @return the number of matching groups 958 * @throws SystemException if a system exception occurred 959 */ 960 public static int searchCount(long companyId, java.lang.String name, 961 java.lang.String description, java.lang.String[] params) 962 throws RemoteException { 963 try { 964 int returnValue = GroupServiceUtil.searchCount(companyId, name, 965 description, params); 966 967 return returnValue; 968 } 969 catch (Exception e) { 970 _log.error(e, e); 971 972 throw new RemoteException(e.getMessage()); 973 } 974 } 975 976 /** 977 * Sets the groups associated with the role, removing and adding 978 * associations as necessary. 979 * 980 * @param roleId the primary key of the role 981 * @param groupIds the primary keys of the groups 982 * @throws PortalException if the user did not have permission to update 983 update the role 984 * @throws SystemException if a system exception occurred 985 */ 986 public static void setRoleGroups(long roleId, long[] groupIds) 987 throws RemoteException { 988 try { 989 GroupServiceUtil.setRoleGroups(roleId, groupIds); 990 } 991 catch (Exception e) { 992 _log.error(e, e); 993 994 throw new RemoteException(e.getMessage()); 995 } 996 } 997 998 /** 999 * Removes the groups from the role. 1000 * 1001 * @param roleId the primary key of the role 1002 * @param groupIds the primary keys of the groups 1003 * @throws PortalException if the user did not have permission to update the 1004 role 1005 * @throws SystemException if a system exception occurred 1006 */ 1007 public static void unsetRoleGroups(long roleId, long[] groupIds) 1008 throws RemoteException { 1009 try { 1010 GroupServiceUtil.unsetRoleGroups(roleId, groupIds); 1011 } 1012 catch (Exception e) { 1013 _log.error(e, e); 1014 1015 throw new RemoteException(e.getMessage()); 1016 } 1017 } 1018 1019 /** 1020 * Updates the group's friendly URL. 1021 * 1022 * @param groupId the primary key of the group 1023 * @param friendlyURL the group's new friendlyURL (optionally 1024 <code>null</code>) 1025 * @return the group 1026 * @throws PortalException if the user did not have permission to update the 1027 group, if a group with the primary key could not be found, or if 1028 a valid friendly URL could not be created for the group 1029 * @throws SystemException if a system exception occurred 1030 */ 1031 public static com.liferay.portal.model.GroupSoap updateFriendlyURL( 1032 long groupId, java.lang.String friendlyURL) throws RemoteException { 1033 try { 1034 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateFriendlyURL(groupId, 1035 friendlyURL); 1036 1037 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1038 } 1039 catch (Exception e) { 1040 _log.error(e, e); 1041 1042 throw new RemoteException(e.getMessage()); 1043 } 1044 } 1045 1046 /** 1047 * Updates the group. 1048 * 1049 * @param groupId the primary key of the group 1050 * @param parentGroupId the primary key of the parent group 1051 * @param name the group's new name 1052 * @param description the group's new description (optionally 1053 <code>null</code>) 1054 * @param type the group's new type. For more information see {@link 1055 com.liferay.portal.model.GroupConstants} 1056 * @param friendlyURL the group's new friendlyURL (optionally 1057 <code>null</code>) 1058 * @param active whether the group is active 1059 * @param serviceContext the service context to be applied (optionally 1060 <code>null</code>). Can set the asset category IDs and asset tag 1061 names for the group. 1062 * @return the group 1063 * @throws PortalException if the user did not have permission to update the 1064 group, if a group with the primary key could not be found, if the 1065 friendly URL was invalid or could one not be created 1066 * @throws SystemException if a system exception occurred 1067 */ 1068 public static com.liferay.portal.model.GroupSoap updateGroup(long groupId, 1069 long parentGroupId, java.lang.String name, 1070 java.lang.String description, int type, boolean manualMembership, 1071 int membershipRestriction, java.lang.String friendlyURL, 1072 boolean active, com.liferay.portal.service.ServiceContext serviceContext) 1073 throws RemoteException { 1074 try { 1075 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId, 1076 parentGroupId, name, description, type, manualMembership, 1077 membershipRestriction, friendlyURL, active, serviceContext); 1078 1079 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1080 } 1081 catch (Exception e) { 1082 _log.error(e, e); 1083 1084 throw new RemoteException(e.getMessage()); 1085 } 1086 } 1087 1088 /** 1089 * Updates the group's type settings. 1090 * 1091 * @param groupId the primary key of the group 1092 * @param typeSettings the group's new type settings (optionally 1093 <code>null</code>) 1094 * @return the group 1095 * @throws PortalException if the user did not have permission to update the 1096 group or if a group with the primary key could not be found 1097 * @throws SystemException if a system exception occurred 1098 */ 1099 public static com.liferay.portal.model.GroupSoap updateGroup(long groupId, 1100 java.lang.String typeSettings) throws RemoteException { 1101 try { 1102 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId, 1103 typeSettings); 1104 1105 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1106 } 1107 catch (Exception e) { 1108 _log.error(e, e); 1109 1110 throw new RemoteException(e.getMessage()); 1111 } 1112 } 1113 1114 private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class); 1115 }