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