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 578 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 579 * result set. 580 * </p> 581 * 582 * @param userId the primary key of the user 583 * @param start the lower bound of the range of groups to consider 584 * @param end the upper bound of the range of groups to consider (not 585 inclusive) 586 * @return the range of groups associated with the user's organizations 587 * @throws PortalException if a user with the primary key could not be found 588 or if another portal exception occurred 589 */ 590 public static com.liferay.portal.model.GroupSoap[] getUserOrganizationsGroups( 591 long userId, int start, int end) throws RemoteException { 592 try { 593 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserOrganizationsGroups(userId, 594 start, end); 595 596 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 597 } 598 catch (Exception e) { 599 _log.error(e, e); 600 601 throw new RemoteException(e.getMessage()); 602 } 603 } 604 605 /** 606 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 607 String[], boolean, int)} 608 */ 609 @Deprecated 610 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 611 long userId, java.lang.String[] classNames, 612 boolean includeControlPanel, int max) throws RemoteException { 613 try { 614 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(userId, 615 classNames, includeControlPanel, max); 616 617 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 618 } 619 catch (Exception e) { 620 _log.error(e, e); 621 622 throw new RemoteException(e.getMessage()); 623 } 624 } 625 626 /** 627 * Returns the user's groups "sites" associated with the group 628 * entity class names, including the Control Panel group if the user is 629 * permitted to view the Control Panel. 630 * 631 * <ul> 632 * <li> 633 * Class name "User" includes the user's layout set 634 * group. 635 * </li> 636 * <li> 637 * Class name "Organization" includes the user's 638 * immediate organization groups and inherited organization groups. 639 * </li> 640 * <li> 641 * Class name "Group" includes the user's immediate 642 * organization groups and site groups. 643 * </li> 644 * <li> 645 * A <code>classNames</code> 646 * value of <code>null</code> includes the user's layout set group, 647 * organization groups, inherited organization groups, and site groups. 648 * </li> 649 * </ul> 650 * 651 * @param userId the primary key of the user 652 * @param classNames the group entity class names (optionally 653 <code>null</code>). For more information see {@link 654 #getUserSitesGroups(long, String[], int)}. 655 * @param max the maximum number of groups to return 656 * @return the user's groups "sites" 657 * @throws PortalException if a portal exception occurred 658 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 659 String[], int)} 660 */ 661 @Deprecated 662 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 663 long userId, java.lang.String[] classNames, int max) 664 throws RemoteException { 665 try { 666 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(userId, 667 classNames, max); 668 669 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 670 } 671 catch (Exception e) { 672 _log.error(e, e); 673 674 throw new RemoteException(e.getMessage()); 675 } 676 } 677 678 /** 679 * Returns the guest or current user's groups "sites" associated 680 * with the group entity class names, including the Control Panel group if 681 * the user is permitted to view the Control Panel. 682 * 683 * <ul> 684 * <li> 685 * Class name "User" includes the user's layout set 686 * group. 687 * </li> 688 * <li> 689 * Class name "Organization" includes the user's 690 * immediate organization groups and inherited organization groups. 691 * </li> 692 * <li> 693 * Class name "Group" includes the user's immediate 694 * organization groups and site groups. 695 * </li> 696 * <li> 697 * A <code>classNames</code> 698 * value of <code>null</code> includes the user's layout set group, 699 * organization groups, inherited organization groups, and site groups. 700 * </li> 701 * </ul> 702 * 703 * @param classNames the group entity class names (optionally 704 <code>null</code>). For more information see {@link 705 #getUserSitesGroups(String[], int)}. 706 * @param max the maximum number of groups to return 707 * @return the user's groups "sites" 708 * @throws PortalException if a portal exception occurred 709 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(String[], 710 int)} 711 */ 712 @Deprecated 713 public static com.liferay.portal.model.GroupSoap[] getUserPlaces( 714 java.lang.String[] classNames, int max) throws RemoteException { 715 try { 716 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserPlaces(classNames, 717 max); 718 719 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 720 } 721 catch (Exception e) { 722 _log.error(e, e); 723 724 throw new RemoteException(e.getMessage()); 725 } 726 } 727 728 /** 729 * Returns the number of the guest or current user's groups 730 * "sites" associated with the group entity class names, including 731 * the Control Panel group if the user is permitted to view the Control 732 * Panel. 733 * 734 * @return the number of user's groups "sites" 735 * @throws PortalException if a portal exception occurred 736 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroupsCount()} 737 */ 738 @Deprecated 739 public static int getUserPlacesCount() throws RemoteException { 740 try { 741 int returnValue = GroupServiceUtil.getUserPlacesCount(); 742 743 return returnValue; 744 } 745 catch (Exception e) { 746 _log.error(e, e); 747 748 throw new RemoteException(e.getMessage()); 749 } 750 } 751 752 /** 753 * Returns the guest or current user's layout set group, organization 754 * groups, inherited organization groups, and site groups. 755 * 756 * @return the user's layout set group, organization groups, and 757 inherited organization groups, and site groups 758 * @throws PortalException if a portal exception occurred 759 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups} 760 */ 761 @Deprecated 762 public static com.liferay.portal.model.GroupSoap[] getUserSites() 763 throws RemoteException { 764 try { 765 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSites(); 766 767 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 768 } 769 catch (Exception e) { 770 _log.error(e, e); 771 772 throw new RemoteException(e.getMessage()); 773 } 774 } 775 776 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups() 777 throws RemoteException { 778 try { 779 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(); 780 781 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 782 } 783 catch (Exception e) { 784 _log.error(e, e); 785 786 throw new RemoteException(e.getMessage()); 787 } 788 } 789 790 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 791 long userId, java.lang.String[] classNames, 792 boolean includeControlPanel, int max) throws RemoteException { 793 try { 794 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(userId, 795 classNames, includeControlPanel, max); 796 797 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 798 } 799 catch (Exception e) { 800 _log.error(e, e); 801 802 throw new RemoteException(e.getMessage()); 803 } 804 } 805 806 /** 807 * Returns the user's groups "sites" associated with the group 808 * entity class names, including the Control Panel group if the user is 809 * permitted to view the Control Panel. 810 * 811 * <ul> 812 * <li> 813 * Class name "User" includes the user's layout set 814 * group. 815 * </li> 816 * <li> 817 * Class name "Organization" includes the user's 818 * immediate organization groups and inherited organization groups. 819 * </li> 820 * <li> 821 * Class name "Group" includes the user's immediate 822 * organization groups and site groups. 823 * </li> 824 * <li> 825 * A <code>classNames</code> 826 * value of <code>null</code> includes the user's layout set group, 827 * organization groups, inherited organization groups, and site groups. 828 * </li> 829 * </ul> 830 * 831 * @param userId the primary key of the user 832 * @param classNames the group entity class names (optionally 833 <code>null</code>). For more information see {@link 834 #getUserSitesGroups(long, String[], boolean, int)}. 835 * @param max the maximum number of groups to return 836 * @return the user's groups "sites" 837 * @throws PortalException if a portal exception occurred 838 */ 839 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 840 long userId, java.lang.String[] classNames, int max) 841 throws RemoteException { 842 try { 843 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(userId, 844 classNames, 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 guest or current user's groups "sites" associated 857 * with the group entity class names, including the Control Panel group if 858 * the user is permitted to view the Control Panel. 859 * 860 * <ul> 861 * <li> 862 * Class name "User" includes the user's layout set 863 * group. 864 * </li> 865 * <li> 866 * Class name "Organization" includes the user's 867 * immediate organization groups and inherited organization groups. 868 * </li> 869 * <li> 870 * Class name "Group" includes the user's immediate 871 * organization groups and site groups. 872 * </li> 873 * <li> 874 * A <code>classNames</code> 875 * value of <code>null</code> includes the user's layout set group, 876 * organization groups, inherited organization groups, and site groups. 877 * </li> 878 * </ul> 879 * 880 * @param classNames the group entity class names (optionally 881 <code>null</code>). For more information see {@link 882 #getUserSitesGroups(long, String[], boolean, int)}. 883 * @param max the maximum number of groups to return 884 * @return the user's groups "sites" 885 * @throws PortalException if a portal exception occurred 886 */ 887 public static com.liferay.portal.model.GroupSoap[] getUserSitesGroups( 888 java.lang.String[] classNames, int max) throws RemoteException { 889 try { 890 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserSitesGroups(classNames, 891 max); 892 893 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 894 } 895 catch (Exception e) { 896 _log.error(e, e); 897 898 throw new RemoteException(e.getMessage()); 899 } 900 } 901 902 /** 903 * Returns the number of the guest or current user's groups 904 * "sites" associated with the group entity class names, including 905 * the Control Panel group if the user is permitted to view the Control 906 * Panel. 907 * 908 * @return the number of user's groups "sites" 909 * @throws PortalException if a portal exception occurred 910 */ 911 public static int getUserSitesGroupsCount() throws RemoteException { 912 try { 913 int returnValue = GroupServiceUtil.getUserSitesGroupsCount(); 914 915 return returnValue; 916 } 917 catch (Exception e) { 918 _log.error(e, e); 919 920 throw new RemoteException(e.getMessage()); 921 } 922 } 923 924 /** 925 * Returns <code>true</code> if the user is associated with the group, 926 * including the user's inherited organizations and user groups. System and 927 * staged groups are not included. 928 * 929 * @param userId the primary key of the user 930 * @param groupId the primary key of the group 931 * @return <code>true</code> if the user is associated with the group; 932 <code>false</code> otherwise 933 * @throws PortalException if the current user did not have permission to 934 view the user or group members 935 */ 936 public static boolean hasUserGroup(long userId, long groupId) 937 throws RemoteException { 938 try { 939 boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId); 940 941 return returnValue; 942 } 943 catch (Exception e) { 944 _log.error(e, e); 945 946 throw new RemoteException(e.getMessage()); 947 } 948 } 949 950 /** 951 * Returns an ordered range of all the site groups and organization groups 952 * that match the name and description, optionally including the user's 953 * inherited organization groups and user groups. System and staged groups 954 * are not included. 955 * 956 * <p> 957 * Useful when paginating results. Returns a maximum of <code>end - 958 * start</code> instances. <code>start</code> and <code>end</code> are not 959 * primary keys, they are indexes in the result set. Thus, <code>0</code> 960 * refers to the first result in the set. Setting both <code>start</code> 961 * and <code>end</code> to {@link 962 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 963 * result set. 964 * </p> 965 * 966 * @param companyId the primary key of the company 967 * @param name the group's name (optionally <code>null</code>) 968 * @param description the group's description (optionally 969 <code>null</code>) 970 * @param params the finder params (optionally <code>null</code>). To 971 include the user's inherited organizations and user groups in the 972 search, add entries having "usersGroups" and 973 "inherit" as keys mapped to the the user's ID. For more 974 information see {@link 975 com.liferay.portal.service.persistence.GroupFinder}. 976 * @param start the lower bound of the range of groups to return 977 * @param end the upper bound of the range of groups to return (not 978 inclusive) 979 * @return the matching groups ordered by name 980 * @throws PortalException if a portal exception occurred 981 */ 982 public static com.liferay.portal.model.GroupSoap[] search(long companyId, 983 java.lang.String name, java.lang.String description, 984 java.lang.String[] params, int start, int end) 985 throws RemoteException { 986 try { 987 java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.search(companyId, 988 name, description, params, start, end); 989 990 return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue); 991 } 992 catch (Exception e) { 993 _log.error(e, e); 994 995 throw new RemoteException(e.getMessage()); 996 } 997 } 998 999 /** 1000 * Returns the number of groups and organization groups that match the name 1001 * and description, optionally including the user's inherited organizations 1002 * and user groups. System and staged groups are not included. 1003 * 1004 * @param companyId the primary key of the company 1005 * @param name the group's name (optionally <code>null</code>) 1006 * @param description the group's description (optionally 1007 <code>null</code>) 1008 * @param params the finder params (optionally <code>null</code>). To 1009 include the user's inherited organizations and user groups in the 1010 search, add entries having "usersGroups" and 1011 "inherit" as keys mapped to the the user's ID. For more 1012 information see {@link 1013 com.liferay.portal.service.persistence.GroupFinder}. 1014 * @return the number of matching groups 1015 */ 1016 public static int searchCount(long companyId, java.lang.String name, 1017 java.lang.String description, java.lang.String[] params) 1018 throws RemoteException { 1019 try { 1020 int returnValue = GroupServiceUtil.searchCount(companyId, name, 1021 description, params); 1022 1023 return returnValue; 1024 } 1025 catch (Exception e) { 1026 _log.error(e, e); 1027 1028 throw new RemoteException(e.getMessage()); 1029 } 1030 } 1031 1032 /** 1033 * Sets the groups associated with the role, removing and adding 1034 * associations as necessary. 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 1039 update the role 1040 */ 1041 public static void setRoleGroups(long roleId, long[] groupIds) 1042 throws RemoteException { 1043 try { 1044 GroupServiceUtil.setRoleGroups(roleId, groupIds); 1045 } 1046 catch (Exception e) { 1047 _log.error(e, e); 1048 1049 throw new RemoteException(e.getMessage()); 1050 } 1051 } 1052 1053 /** 1054 * Removes the groups from the role. 1055 * 1056 * @param roleId the primary key of the role 1057 * @param groupIds the primary keys of the groups 1058 * @throws PortalException if the user did not have permission to update the 1059 role 1060 */ 1061 public static void unsetRoleGroups(long roleId, long[] groupIds) 1062 throws RemoteException { 1063 try { 1064 GroupServiceUtil.unsetRoleGroups(roleId, groupIds); 1065 } 1066 catch (Exception e) { 1067 _log.error(e, e); 1068 1069 throw new RemoteException(e.getMessage()); 1070 } 1071 } 1072 1073 /** 1074 * Updates the group's friendly URL. 1075 * 1076 * @param groupId the primary key of the group 1077 * @param friendlyURL the group's new friendlyURL (optionally 1078 <code>null</code>) 1079 * @return the group 1080 * @throws PortalException if the user did not have permission to update the 1081 group, if a group with the primary key could not be found, or if 1082 a valid friendly URL could not be created for the group 1083 */ 1084 public static com.liferay.portal.model.GroupSoap updateFriendlyURL( 1085 long groupId, java.lang.String friendlyURL) throws RemoteException { 1086 try { 1087 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateFriendlyURL(groupId, 1088 friendlyURL); 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 public static com.liferay.portal.model.GroupSoap updateGroup(long groupId, 1100 long parentGroupId, java.lang.String[] nameMapLanguageIds, 1101 java.lang.String[] nameMapValues, 1102 java.lang.String[] descriptionMapLanguageIds, 1103 java.lang.String[] descriptionMapValues, int type, 1104 boolean manualMembership, int membershipRestriction, 1105 java.lang.String friendlyURL, boolean inheritContent, boolean active, 1106 com.liferay.portal.service.ServiceContext serviceContext) 1107 throws RemoteException { 1108 try { 1109 Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(nameMapLanguageIds, 1110 nameMapValues); 1111 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds, 1112 descriptionMapValues); 1113 1114 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId, 1115 parentGroupId, nameMap, descriptionMap, type, 1116 manualMembership, membershipRestriction, friendlyURL, 1117 inheritContent, active, serviceContext); 1118 1119 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1120 } 1121 catch (Exception e) { 1122 _log.error(e, e); 1123 1124 throw new RemoteException(e.getMessage()); 1125 } 1126 } 1127 1128 /** 1129 * Updates the group. 1130 * 1131 * @param groupId the primary key of the group 1132 * @param parentGroupId the primary key of the parent group 1133 * @param name the group's name 1134 * @param description the group's new description (optionally 1135 <code>null</code>) 1136 * @param type the group's new type. For more information see {@link 1137 GroupConstants}. 1138 * @param manualMembership whether manual membership is allowed for the 1139 group 1140 * @param membershipRestriction the group's membership restriction. For 1141 more information see {@link GroupConstants}. 1142 * @param friendlyURL the group's new friendlyURL (optionally 1143 <code>null</code>) 1144 * @param active whether the group is active 1145 * @param serviceContext the service context to be applied (optionally 1146 <code>null</code>). Can set the asset category IDs and asset 1147 tag names for the group. 1148 * @return the group 1149 * @throws PortalException if the user did not have permission to update 1150 the group, if a group with the primary key could not be 1151 found, if the friendly URL was invalid or could one not be 1152 created 1153 * @deprecated As of 7.0.0, replaced by {@link #updateGroup(long, long, Map, 1154 Map, int, boolean, int, String, boolean, boolean, 1155 ServiceContext)} 1156 */ 1157 @Deprecated 1158 public static com.liferay.portal.model.GroupSoap updateGroup(long groupId, 1159 long parentGroupId, java.lang.String name, 1160 java.lang.String description, int type, boolean manualMembership, 1161 int membershipRestriction, java.lang.String friendlyURL, 1162 boolean inheritContent, boolean active, 1163 com.liferay.portal.service.ServiceContext serviceContext) 1164 throws RemoteException { 1165 try { 1166 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId, 1167 parentGroupId, name, description, type, manualMembership, 1168 membershipRestriction, friendlyURL, inheritContent, active, 1169 serviceContext); 1170 1171 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1172 } 1173 catch (Exception e) { 1174 _log.error(e, e); 1175 1176 throw new RemoteException(e.getMessage()); 1177 } 1178 } 1179 1180 /** 1181 * Updates the group's type settings. 1182 * 1183 * @param groupId the primary key of the group 1184 * @param typeSettings the group's new type settings (optionally 1185 <code>null</code>) 1186 * @return the group 1187 * @throws PortalException if the user did not have permission to update the 1188 group or if a group with the primary key could not be found 1189 */ 1190 public static com.liferay.portal.model.GroupSoap updateGroup(long groupId, 1191 java.lang.String typeSettings) throws RemoteException { 1192 try { 1193 com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId, 1194 typeSettings); 1195 1196 return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue); 1197 } 1198 catch (Exception e) { 1199 _log.error(e, e); 1200 1201 throw new RemoteException(e.getMessage()); 1202 } 1203 } 1204 1205 private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class); 1206 }