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; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the remote service utility for Group. This utility wraps 024 * {@link com.liferay.portal.service.impl.GroupServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on a remote server. Methods of this service are expected to have security 027 * checks based on the propagated JAAS credentials because this service can be 028 * accessed remotely. 029 * 030 * @author Brian Wing Shun Chan 031 * @see GroupService 032 * @see com.liferay.portal.service.base.GroupServiceBaseImpl 033 * @see com.liferay.portal.service.impl.GroupServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class GroupServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.GroupServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, String, 046 String, int, String, boolean, boolean, ServiceContext)} 047 */ 048 @Deprecated 049 public static com.liferay.portal.model.Group addGroup( 050 java.lang.String name, java.lang.String description, int type, 051 java.lang.String friendlyURL, boolean site, boolean active, 052 com.liferay.portal.service.ServiceContext serviceContext) 053 throws com.liferay.portal.kernel.exception.PortalException { 054 return getService() 055 .addGroup(name, description, type, friendlyURL, site, 056 active, serviceContext); 057 } 058 059 /** 060 * Adds a group. 061 * 062 * @param parentGroupId the primary key of the parent group 063 * @param liveGroupId the primary key of the live group 064 * @param name the entity's name 065 * @param description the group's description (optionally 066 <code>null</code>) 067 * @param type the group's type. For more information see {@link 068 GroupConstants}. 069 * @param manualMembership whether manual membership is allowed for the 070 group 071 * @param membershipRestriction the group's membership restriction. For 072 more information see {@link GroupConstants}. 073 * @param friendlyURL the group's friendlyURL (optionally 074 <code>null</code>) 075 * @param site whether the group is to be associated with a main site 076 * @param active whether the group is active 077 * @param serviceContext the service context to be applied (optionally 078 <code>null</code>). Can set the asset category IDs and asset 079 tag names for the group, and can set whether the group is for 080 staging 081 * @return the group 082 * @throws PortalException if the user did not have permission to add 083 the group, if a creator could not be found, if the group's 084 information was invalid, if a layout could not be found, or 085 if a valid friendly URL could not be created for the group 086 * @deprecated As of 7.0.0, replaced by {@link #addGroup(long, long, Map, 087 Map, int, boolean, int, String, boolean, boolean, 088 ServiceContext)} 089 */ 090 @Deprecated 091 public static com.liferay.portal.model.Group addGroup(long parentGroupId, 092 long liveGroupId, java.lang.String name, java.lang.String description, 093 int type, boolean manualMembership, int membershipRestriction, 094 java.lang.String friendlyURL, boolean site, boolean active, 095 com.liferay.portal.service.ServiceContext serviceContext) 096 throws com.liferay.portal.kernel.exception.PortalException { 097 return getService() 098 .addGroup(parentGroupId, liveGroupId, name, description, 099 type, manualMembership, membershipRestriction, friendlyURL, site, 100 active, serviceContext); 101 } 102 103 public static com.liferay.portal.model.Group addGroup(long parentGroupId, 104 long liveGroupId, 105 java.util.Map<java.util.Locale, java.lang.String> nameMap, 106 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 107 int type, boolean manualMembership, int membershipRestriction, 108 java.lang.String friendlyURL, boolean site, boolean active, 109 com.liferay.portal.service.ServiceContext serviceContext) 110 throws com.liferay.portal.kernel.exception.PortalException { 111 return getService() 112 .addGroup(parentGroupId, liveGroupId, nameMap, 113 descriptionMap, type, manualMembership, membershipRestriction, 114 friendlyURL, site, active, serviceContext); 115 } 116 117 public static com.liferay.portal.model.Group addGroup(long parentGroupId, 118 long liveGroupId, 119 java.util.Map<java.util.Locale, java.lang.String> nameMap, 120 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 121 int type, boolean manualMembership, int membershipRestriction, 122 java.lang.String friendlyURL, boolean site, boolean inheritContent, 123 boolean active, com.liferay.portal.service.ServiceContext serviceContext) 124 throws com.liferay.portal.kernel.exception.PortalException { 125 return getService() 126 .addGroup(parentGroupId, liveGroupId, nameMap, 127 descriptionMap, type, manualMembership, membershipRestriction, 128 friendlyURL, site, inheritContent, active, serviceContext); 129 } 130 131 /** 132 * Adds the group using the group default live group ID. 133 * 134 * @param parentGroupId the primary key of the parent group 135 * @param name the entity's name 136 * @param description the group's description (optionally 137 <code>null</code>) 138 * @param type the group's type. For more information see {@link 139 GroupConstants}. 140 * @param friendlyURL the group's friendlyURL 141 * @param site whether the group is to be associated with a main site 142 * @param active whether the group is active 143 * @param serviceContext the service context to be applied (optionally 144 <code>null</code>). Can set asset category IDs and asset tag 145 names for the group, and can set whether the group is for 146 staging 147 * @return the group 148 * @throws PortalException if the user did not have permission to add 149 the group, if a creator could not be found, if the group's 150 information was invalid, if a layout could not be found, or 151 if a valid friendly URL could not be created for the group 152 * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, long, Map, 153 Map, int, boolean, int, String, boolean, boolean, 154 ServiceContext)} 155 */ 156 @Deprecated 157 public static com.liferay.portal.model.Group addGroup(long parentGroupId, 158 java.lang.String name, java.lang.String description, int type, 159 java.lang.String friendlyURL, boolean site, boolean active, 160 com.liferay.portal.service.ServiceContext serviceContext) 161 throws com.liferay.portal.kernel.exception.PortalException { 162 return getService() 163 .addGroup(parentGroupId, name, description, type, 164 friendlyURL, site, active, serviceContext); 165 } 166 167 /** 168 * Adds the groups to the role. 169 * 170 * @param roleId the primary key of the role 171 * @param groupIds the primary keys of the groups 172 * @throws PortalException if the user did not have permission to update the 173 role 174 */ 175 public static void addRoleGroups(long roleId, long[] groupIds) 176 throws com.liferay.portal.kernel.exception.PortalException { 177 getService().addRoleGroups(roleId, groupIds); 178 } 179 180 /** 181 * Checks that the current user is permitted to use the group for Remote 182 * Staging. 183 * 184 * @param groupId the primary key of the group 185 * @throws PortalException if a group with the primary key could not be 186 found, if the current user did not have permission to view the 187 group, or if the group's company was different from the current 188 user's company 189 */ 190 public static void checkRemoteStagingGroup(long groupId) 191 throws com.liferay.portal.kernel.exception.PortalException { 192 getService().checkRemoteStagingGroup(groupId); 193 } 194 195 /** 196 * Deletes the group. 197 * 198 * <p> 199 * The group is unstaged and its assets and resources including layouts, 200 * membership requests, subscriptions, teams, blogs, bookmarks, calendar 201 * events, image gallery, journals, message boards, polls, shopping related 202 * entities, software catalog, and wikis are also deleted. 203 * </p> 204 * 205 * @param groupId the primary key of the group 206 * @throws PortalException if the user did not have permission to delete the 207 group or its assets or resources, if a group with the primary key 208 could not be found, or if the group was a system group 209 */ 210 public static void deleteGroup(long groupId) 211 throws com.liferay.portal.kernel.exception.PortalException { 212 getService().deleteGroup(groupId); 213 } 214 215 public static void disableStaging(long groupId) 216 throws com.liferay.portal.kernel.exception.PortalException { 217 getService().disableStaging(groupId); 218 } 219 220 public static void enableStaging(long groupId) 221 throws com.liferay.portal.kernel.exception.PortalException { 222 getService().enableStaging(groupId); 223 } 224 225 /** 226 * Returns the Spring bean ID for this bean. 227 * 228 * @return the Spring bean ID for this bean 229 */ 230 public static java.lang.String getBeanIdentifier() { 231 return getService().getBeanIdentifier(); 232 } 233 234 /** 235 * Returns the company group. 236 * 237 * @param companyId the primary key of the company 238 * @return the group associated with the company 239 * @throws PortalException if a matching group could not be found 240 */ 241 public static com.liferay.portal.model.Group getCompanyGroup(long companyId) 242 throws com.liferay.portal.kernel.exception.PortalException { 243 return getService().getCompanyGroup(companyId); 244 } 245 246 /** 247 * Returns the group with the name. 248 * 249 * @param companyId the primary key of the company 250 * @param groupKey the group key 251 * @return the group with the group key 252 * @throws PortalException if a matching group could not be found or if the 253 current user did not have permission to view the group 254 */ 255 public static com.liferay.portal.model.Group getGroup(long companyId, 256 java.lang.String groupKey) 257 throws com.liferay.portal.kernel.exception.PortalException { 258 return getService().getGroup(companyId, groupKey); 259 } 260 261 /** 262 * Returns the group with the primary key. 263 * 264 * @param groupId the primary key of the group 265 * @return the group with the primary key 266 * @throws PortalException if a group with the primary key could not be 267 found or if the current user did not have permission to view the 268 group 269 */ 270 public static com.liferay.portal.model.Group getGroup(long groupId) 271 throws com.liferay.portal.kernel.exception.PortalException { 272 return getService().getGroup(groupId); 273 } 274 275 /** 276 * Returns all the groups that are direct children of the parent group. 277 * 278 * @param companyId the primary key of the company 279 * @param parentGroupId the primary key of the parent group 280 * @param site whether the group is to be associated with a main site 281 * @return the matching groups, or <code>null</code> if no matches were 282 found 283 * @throws PortalException if the user did not have permission to view the 284 group or if a portal exception occurred 285 */ 286 public static java.util.List<com.liferay.portal.model.Group> getGroups( 287 long companyId, long parentGroupId, boolean site) 288 throws com.liferay.portal.kernel.exception.PortalException { 289 return getService().getGroups(companyId, parentGroupId, site); 290 } 291 292 /** 293 * Returns a range of all the site groups for which the user has control 294 * panel access. 295 * 296 * @param portlets the portlets to manage 297 * @param max the upper bound of the range of groups to consider (not 298 inclusive) 299 * @return the range of site groups for which the user has Control Panel 300 access 301 * @throws PortalException if a portal exception occurred 302 */ 303 public static java.util.List<com.liferay.portal.model.Group> getManageableSiteGroups( 304 java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max) 305 throws com.liferay.portal.kernel.exception.PortalException { 306 return getService().getManageableSiteGroups(portlets, max); 307 } 308 309 /** 310 * Returns a range of all the site groups for which the user has control 311 * panel access. 312 * 313 * @param portlets the portlets to manage 314 * @param max the upper bound of the range of groups to consider (not 315 inclusive) 316 * @return the range of site groups for which the user has Control Panel 317 access 318 * @throws PortalException if a portal exception occurred 319 * @deprecated As of 6.2.0, replaced by {@link 320 #getManageableSiteGroups(Collection, int)} 321 */ 322 @Deprecated 323 public static java.util.List<com.liferay.portal.model.Group> getManageableSites( 324 java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max) 325 throws com.liferay.portal.kernel.exception.PortalException { 326 return getService().getManageableSites(portlets, max); 327 } 328 329 /** 330 * Returns the groups associated with the organizations. 331 * 332 * @param organizations the organizations 333 * @return the groups associated with the organizations 334 * @throws PortalException if a portal exception occurred 335 */ 336 public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups( 337 java.util.List<com.liferay.portal.model.Organization> organizations) 338 throws com.liferay.portal.kernel.exception.PortalException { 339 return getService().getOrganizationsGroups(organizations); 340 } 341 342 /** 343 * Returns the group directly associated with the user. 344 * 345 * @param companyId the primary key of the company 346 * @param userId the primary key of the user 347 * @return the group directly associated with the user 348 * @throws PortalException if a matching group could not be found or if the 349 current user did not have permission to view the group 350 */ 351 public static com.liferay.portal.model.Group getUserGroup(long companyId, 352 long userId) throws com.liferay.portal.kernel.exception.PortalException { 353 return getService().getUserGroup(companyId, userId); 354 } 355 356 /** 357 * Returns the groups associated with the user groups. 358 * 359 * @param userGroups the user groups 360 * @return the groups associated with the user groups 361 * @throws PortalException if any one of the user group's group could not be 362 found 363 */ 364 public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups( 365 java.util.List<com.liferay.portal.model.UserGroup> userGroups) 366 throws com.liferay.portal.kernel.exception.PortalException { 367 return getService().getUserGroupsGroups(userGroups); 368 } 369 370 /** 371 * Returns the range of all groups associated with the user's organization 372 * groups, including the ancestors of the organization groups, unless portal 373 * property <code>organizations.membership.strict</code> is set to 374 * <code>true</code>. 375 * 376 * <p> 377 * Useful when paginating results. Returns a maximum of <code>end - 378 * start</code> instances. <code>start</code> and <code>end</code> are not 379 * primary keys, they are indexes in the result set. Thus, <code>0</code> 380 * refers to the first result in the set. Setting both <code>start</code> 381 * and <code>end</code> to {@link 382 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 383 * result set. 384 * </p> 385 * 386 * @param userId the primary key of the user 387 * @param start the lower bound of the range of groups to consider 388 * @param end the upper bound of the range of groups to consider (not 389 inclusive) 390 * @return the range of groups associated with the user's organizations 391 * @throws PortalException if a user with the primary key could not be found 392 or if another portal exception occurred 393 */ 394 public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups( 395 long userId, int start, int end) 396 throws com.liferay.portal.kernel.exception.PortalException { 397 return getService().getUserOrganizationsGroups(userId, start, end); 398 } 399 400 /** 401 * Returns the guest or current user's groups "sites" associated 402 * with the group entity class names, including the Control Panel group if 403 * the user is permitted to view the Control Panel. 404 * 405 * <ul> 406 * <li> 407 * Class name "User" includes the user's layout set 408 * group. 409 * </li> 410 * <li> 411 * Class name "Organization" includes the user's 412 * immediate organization groups and inherited organization groups. 413 * </li> 414 * <li> 415 * Class name "Group" includes the user's immediate 416 * organization groups and site groups. 417 * </li> 418 * <li> 419 * A <code>classNames</code> 420 * value of <code>null</code> includes the user's layout set group, 421 * organization groups, inherited organization groups, and site groups. 422 * </li> 423 * </ul> 424 * 425 * @param classNames the group entity class names (optionally 426 <code>null</code>). For more information see {@link 427 #getUserSitesGroups(String[], int)}. 428 * @param max the maximum number of groups to return 429 * @return the user's groups "sites" 430 * @throws PortalException if a portal exception occurred 431 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(String[], 432 int)} 433 */ 434 @Deprecated 435 public static java.util.List<com.liferay.portal.model.Group> getUserPlaces( 436 java.lang.String[] classNames, int max) 437 throws com.liferay.portal.kernel.exception.PortalException { 438 return getService().getUserPlaces(classNames, max); 439 } 440 441 /** 442 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 443 String[], boolean, int)} 444 */ 445 @Deprecated 446 public static java.util.List<com.liferay.portal.model.Group> getUserPlaces( 447 long userId, java.lang.String[] classNames, 448 boolean includeControlPanel, int max) 449 throws com.liferay.portal.kernel.exception.PortalException { 450 return getService() 451 .getUserPlaces(userId, classNames, includeControlPanel, max); 452 } 453 454 /** 455 * Returns the user's groups "sites" associated with the group 456 * entity class names, including the Control Panel group if the user is 457 * permitted to view the Control Panel. 458 * 459 * <ul> 460 * <li> 461 * Class name "User" includes the user's layout set 462 * group. 463 * </li> 464 * <li> 465 * Class name "Organization" includes the user's 466 * immediate organization groups and inherited organization groups. 467 * </li> 468 * <li> 469 * Class name "Group" includes the user's immediate 470 * organization groups and site groups. 471 * </li> 472 * <li> 473 * A <code>classNames</code> 474 * value of <code>null</code> includes the user's layout set group, 475 * organization groups, inherited organization groups, and site groups. 476 * </li> 477 * </ul> 478 * 479 * @param userId the primary key of the user 480 * @param classNames the group entity class names (optionally 481 <code>null</code>). For more information see {@link 482 #getUserSitesGroups(long, String[], int)}. 483 * @param max the maximum number of groups to return 484 * @return the user's groups "sites" 485 * @throws PortalException if a portal exception occurred 486 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long, 487 String[], int)} 488 */ 489 @Deprecated 490 public static java.util.List<com.liferay.portal.model.Group> getUserPlaces( 491 long userId, java.lang.String[] classNames, int max) 492 throws com.liferay.portal.kernel.exception.PortalException { 493 return getService().getUserPlaces(userId, classNames, max); 494 } 495 496 /** 497 * Returns the number of the guest or current user's groups 498 * "sites" associated with the group entity class names, including 499 * the Control Panel group if the user is permitted to view the Control 500 * Panel. 501 * 502 * @return the number of user's groups "sites" 503 * @throws PortalException if a portal exception occurred 504 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroupsCount()} 505 */ 506 @Deprecated 507 public static int getUserPlacesCount() 508 throws com.liferay.portal.kernel.exception.PortalException { 509 return getService().getUserPlacesCount(); 510 } 511 512 /** 513 * Returns the guest or current user's layout set group, organization 514 * groups, inherited organization groups, and site groups. 515 * 516 * @return the user's layout set group, organization groups, and 517 inherited organization groups, and site groups 518 * @throws PortalException if a portal exception occurred 519 * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups} 520 */ 521 @Deprecated 522 public static java.util.List<com.liferay.portal.model.Group> getUserSites() 523 throws com.liferay.portal.kernel.exception.PortalException { 524 return getService().getUserSites(); 525 } 526 527 public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups() 528 throws com.liferay.portal.kernel.exception.PortalException { 529 return getService().getUserSitesGroups(); 530 } 531 532 /** 533 * Returns the guest or current user's groups "sites" associated 534 * with the group entity class names, including the Control Panel group if 535 * the user is permitted to view the Control Panel. 536 * 537 * <ul> 538 * <li> 539 * Class name "User" includes the user's layout set 540 * group. 541 * </li> 542 * <li> 543 * Class name "Organization" includes the user's 544 * immediate organization groups and inherited organization groups. 545 * </li> 546 * <li> 547 * Class name "Group" includes the user's immediate 548 * organization groups and site groups. 549 * </li> 550 * <li> 551 * A <code>classNames</code> 552 * value of <code>null</code> includes the user's layout set group, 553 * organization groups, inherited organization groups, and site groups. 554 * </li> 555 * </ul> 556 * 557 * @param classNames the group entity class names (optionally 558 <code>null</code>). For more information see {@link 559 #getUserSitesGroups(long, String[], boolean, int)}. 560 * @param max the maximum number of groups to return 561 * @return the user's groups "sites" 562 * @throws PortalException if a portal exception occurred 563 */ 564 public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups( 565 java.lang.String[] classNames, int max) 566 throws com.liferay.portal.kernel.exception.PortalException { 567 return getService().getUserSitesGroups(classNames, max); 568 } 569 570 public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups( 571 long userId, java.lang.String[] classNames, 572 boolean includeControlPanel, int max) 573 throws com.liferay.portal.kernel.exception.PortalException { 574 return getService() 575 .getUserSitesGroups(userId, classNames, includeControlPanel, 576 max); 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[], boolean, 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 */ 612 public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups( 613 long userId, java.lang.String[] classNames, int max) 614 throws com.liferay.portal.kernel.exception.PortalException { 615 return getService().getUserSitesGroups(userId, classNames, max); 616 } 617 618 /** 619 * Returns the number of the guest or current user's groups 620 * "sites" associated with the group entity class names, including 621 * the Control Panel group if the user is permitted to view the Control 622 * Panel. 623 * 624 * @return the number of user's groups "sites" 625 * @throws PortalException if a portal exception occurred 626 */ 627 public static int getUserSitesGroupsCount() 628 throws com.liferay.portal.kernel.exception.PortalException { 629 return getService().getUserSitesGroupsCount(); 630 } 631 632 /** 633 * Returns <code>true</code> if the user is associated with the group, 634 * including the user's inherited organizations and user groups. System and 635 * staged groups are not included. 636 * 637 * @param userId the primary key of the user 638 * @param groupId the primary key of the group 639 * @return <code>true</code> if the user is associated with the group; 640 <code>false</code> otherwise 641 * @throws PortalException if the current user did not have permission to 642 view the user or group members 643 */ 644 public static boolean hasUserGroup(long userId, long groupId) 645 throws com.liferay.portal.kernel.exception.PortalException { 646 return getService().hasUserGroup(userId, groupId); 647 } 648 649 public static java.util.List<com.liferay.portal.model.Group> search( 650 long companyId, long[] classNameIds, java.lang.String keywords, 651 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 652 int start, int end, 653 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc) 654 throws com.liferay.portal.kernel.exception.PortalException { 655 return getService() 656 .search(companyId, classNameIds, keywords, params, start, 657 end, obc); 658 } 659 660 public static java.util.List<com.liferay.portal.model.Group> search( 661 long companyId, long[] classNameIds, java.lang.String name, 662 java.lang.String description, 663 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 664 boolean andOperator, int start, int end, 665 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc) 666 throws com.liferay.portal.kernel.exception.PortalException { 667 return getService() 668 .search(companyId, classNameIds, name, description, params, 669 andOperator, start, end, obc); 670 } 671 672 /** 673 * Returns an ordered range of all the site groups and organization groups 674 * that match the name and description, optionally including the user's 675 * inherited organization groups and user groups. System and staged groups 676 * are not included. 677 * 678 * <p> 679 * Useful when paginating results. Returns a maximum of <code>end - 680 * start</code> instances. <code>start</code> and <code>end</code> are not 681 * primary keys, they are indexes in the result set. Thus, <code>0</code> 682 * refers to the first result in the set. Setting both <code>start</code> 683 * and <code>end</code> to {@link 684 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 685 * result set. 686 * </p> 687 * 688 * @param companyId the primary key of the company 689 * @param name the group's name (optionally <code>null</code>) 690 * @param description the group's description (optionally 691 <code>null</code>) 692 * @param params the finder params (optionally <code>null</code>). To 693 include the user's inherited organizations and user groups in the 694 search, add entries having "usersGroups" and 695 "inherit" as keys mapped to the the user's ID. For more 696 information see {@link 697 com.liferay.portal.service.persistence.GroupFinder}. 698 * @param start the lower bound of the range of groups to return 699 * @param end the upper bound of the range of groups to return (not 700 inclusive) 701 * @return the matching groups ordered by name 702 * @throws PortalException if a portal exception occurred 703 */ 704 public static java.util.List<com.liferay.portal.model.Group> search( 705 long companyId, java.lang.String name, java.lang.String description, 706 java.lang.String[] params, int start, int end) 707 throws com.liferay.portal.kernel.exception.PortalException { 708 return getService() 709 .search(companyId, name, description, params, start, end); 710 } 711 712 /** 713 * Returns the number of groups and organization groups that match the name 714 * and description, optionally including the user's inherited organizations 715 * and user groups. System and staged groups are not included. 716 * 717 * @param companyId the primary key of the company 718 * @param name the group's name (optionally <code>null</code>) 719 * @param description the group's description (optionally 720 <code>null</code>) 721 * @param params the finder params (optionally <code>null</code>). To 722 include the user's inherited organizations and user groups in the 723 search, add entries having "usersGroups" and 724 "inherit" as keys mapped to the the user's ID. For more 725 information see {@link 726 com.liferay.portal.service.persistence.GroupFinder}. 727 * @return the number of matching groups 728 */ 729 public static int searchCount(long companyId, java.lang.String name, 730 java.lang.String description, java.lang.String[] params) { 731 return getService().searchCount(companyId, name, description, params); 732 } 733 734 /** 735 * Sets the Spring bean ID for this bean. 736 * 737 * @param beanIdentifier the Spring bean ID for this bean 738 */ 739 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 740 getService().setBeanIdentifier(beanIdentifier); 741 } 742 743 /** 744 * Sets the groups associated with the role, removing and adding 745 * associations as necessary. 746 * 747 * @param roleId the primary key of the role 748 * @param groupIds the primary keys of the groups 749 * @throws PortalException if the user did not have permission to update 750 update the role 751 */ 752 public static void setRoleGroups(long roleId, long[] groupIds) 753 throws com.liferay.portal.kernel.exception.PortalException { 754 getService().setRoleGroups(roleId, groupIds); 755 } 756 757 /** 758 * Removes the groups from the role. 759 * 760 * @param roleId the primary key of the role 761 * @param groupIds the primary keys of the groups 762 * @throws PortalException if the user did not have permission to update the 763 role 764 */ 765 public static void unsetRoleGroups(long roleId, long[] groupIds) 766 throws com.liferay.portal.kernel.exception.PortalException { 767 getService().unsetRoleGroups(roleId, groupIds); 768 } 769 770 /** 771 * Updates the group's friendly URL. 772 * 773 * @param groupId the primary key of the group 774 * @param friendlyURL the group's new friendlyURL (optionally 775 <code>null</code>) 776 * @return the group 777 * @throws PortalException if the user did not have permission to update the 778 group, if a group with the primary key could not be found, or if 779 a valid friendly URL could not be created for the group 780 */ 781 public static com.liferay.portal.model.Group updateFriendlyURL( 782 long groupId, java.lang.String friendlyURL) 783 throws com.liferay.portal.kernel.exception.PortalException { 784 return getService().updateFriendlyURL(groupId, friendlyURL); 785 } 786 787 /** 788 * Updates the group. 789 * 790 * @param groupId the primary key of the group 791 * @param parentGroupId the primary key of the parent group 792 * @param name the group's name 793 * @param description the group's new description (optionally 794 <code>null</code>) 795 * @param type the group's new type. For more information see {@link 796 GroupConstants}. 797 * @param manualMembership whether manual membership is allowed for the 798 group 799 * @param membershipRestriction the group's membership restriction. For 800 more information see {@link GroupConstants}. 801 * @param friendlyURL the group's new friendlyURL (optionally 802 <code>null</code>) 803 * @param active whether the group is active 804 * @param serviceContext the service context to be applied (optionally 805 <code>null</code>). Can set the asset category IDs and asset 806 tag names for the group. 807 * @return the group 808 * @throws PortalException if the user did not have permission to update 809 the group, if a group with the primary key could not be 810 found, if the friendly URL was invalid or could one not be 811 created 812 * @deprecated As of 7.0.0, replaced by {@link #updateGroup(long, long, Map, 813 Map, int, boolean, int, String, boolean, boolean, 814 ServiceContext)} 815 */ 816 @Deprecated 817 public static com.liferay.portal.model.Group updateGroup(long groupId, 818 long parentGroupId, java.lang.String name, 819 java.lang.String description, int type, boolean manualMembership, 820 int membershipRestriction, java.lang.String friendlyURL, 821 boolean inheritContent, boolean active, 822 com.liferay.portal.service.ServiceContext serviceContext) 823 throws com.liferay.portal.kernel.exception.PortalException { 824 return getService() 825 .updateGroup(groupId, parentGroupId, name, description, 826 type, manualMembership, membershipRestriction, friendlyURL, 827 inheritContent, active, serviceContext); 828 } 829 830 public static com.liferay.portal.model.Group updateGroup(long groupId, 831 long parentGroupId, 832 java.util.Map<java.util.Locale, java.lang.String> nameMap, 833 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 834 int type, boolean manualMembership, int membershipRestriction, 835 java.lang.String friendlyURL, boolean inheritContent, boolean active, 836 com.liferay.portal.service.ServiceContext serviceContext) 837 throws com.liferay.portal.kernel.exception.PortalException { 838 return getService() 839 .updateGroup(groupId, parentGroupId, nameMap, 840 descriptionMap, type, manualMembership, membershipRestriction, 841 friendlyURL, inheritContent, active, serviceContext); 842 } 843 844 /** 845 * Updates the group's type settings. 846 * 847 * @param groupId the primary key of the group 848 * @param typeSettings the group's new type settings (optionally 849 <code>null</code>) 850 * @return the group 851 * @throws PortalException if the user did not have permission to update the 852 group or if a group with the primary key could not be found 853 */ 854 public static com.liferay.portal.model.Group updateGroup(long groupId, 855 java.lang.String typeSettings) 856 throws com.liferay.portal.kernel.exception.PortalException { 857 return getService().updateGroup(groupId, typeSettings); 858 } 859 860 public static void updateStagedPortlets(long groupId, 861 java.util.Map<java.lang.String, java.lang.String> stagedPortletIds) 862 throws com.liferay.portal.kernel.exception.PortalException { 863 getService().updateStagedPortlets(groupId, stagedPortletIds); 864 } 865 866 public static GroupService getService() { 867 if (_service == null) { 868 _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName()); 869 870 ReferenceRegistry.registerReference(GroupServiceUtil.class, 871 "_service"); 872 } 873 874 return _service; 875 } 876 877 /** 878 * @deprecated As of 6.2.0 879 */ 880 @Deprecated 881 public void setService(GroupService service) { 882 } 883 884 private static GroupService _service; 885 }