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