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