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