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.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 /** 020 * Provides a wrapper for {@link GroupService}. 021 * 022 * @author Brian Wing Shun Chan 023 * @see GroupService 024 * @generated 025 */ 026 @ProviderType 027 public class GroupServiceWrapper implements GroupService, 028 ServiceWrapper<GroupService> { 029 public GroupServiceWrapper(GroupService groupService) { 030 _groupService = groupService; 031 } 032 033 /** 034 * Adds a group. 035 * 036 * @param parentGroupId the primary key of the parent group 037 * @param liveGroupId the primary key of the live group 038 * @param name the entity's name 039 * @param description the group's description (optionally 040 <code>null</code>) 041 * @param type the group's type. For more information see {@link 042 GroupConstants}. 043 * @param manualMembership whether manual membership is allowed for the 044 group 045 * @param membershipRestriction the group's membership restriction. For 046 more information see {@link GroupConstants}. 047 * @param friendlyURL the group's friendlyURL (optionally 048 <code>null</code>) 049 * @param site whether the group is to be associated with a main site 050 * @param active whether the group is active 051 * @param serviceContext the service context to be applied (optionally 052 <code>null</code>). Can set the asset category IDs and asset 053 tag names for the group, and can set whether the group is for 054 staging 055 * @return the group 056 * @throws PortalException if a portal exception occurred 057 * @deprecated As of 7.0.0, replaced by {@link #addGroup(long, long, Map, 058 Map, int, boolean, int, String, boolean, boolean, 059 ServiceContext)} 060 */ 061 @Deprecated 062 @Override 063 public com.liferay.portal.kernel.model.Group addGroup(long parentGroupId, 064 long liveGroupId, java.lang.String name, java.lang.String description, 065 int type, boolean manualMembership, int membershipRestriction, 066 java.lang.String friendlyURL, boolean site, boolean active, 067 com.liferay.portal.kernel.service.ServiceContext serviceContext) 068 throws com.liferay.portal.kernel.exception.PortalException { 069 return _groupService.addGroup(parentGroupId, liveGroupId, name, 070 description, type, manualMembership, membershipRestriction, 071 friendlyURL, site, active, serviceContext); 072 } 073 074 @Override 075 public com.liferay.portal.kernel.model.Group addGroup(long parentGroupId, 076 long liveGroupId, 077 java.util.Map<java.util.Locale, java.lang.String> nameMap, 078 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 079 int type, boolean manualMembership, int membershipRestriction, 080 java.lang.String friendlyURL, boolean site, boolean active, 081 com.liferay.portal.kernel.service.ServiceContext serviceContext) 082 throws com.liferay.portal.kernel.exception.PortalException { 083 return _groupService.addGroup(parentGroupId, liveGroupId, nameMap, 084 descriptionMap, type, manualMembership, membershipRestriction, 085 friendlyURL, site, active, serviceContext); 086 } 087 088 @Override 089 public com.liferay.portal.kernel.model.Group addGroup(long parentGroupId, 090 long liveGroupId, 091 java.util.Map<java.util.Locale, java.lang.String> nameMap, 092 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 093 int type, boolean manualMembership, int membershipRestriction, 094 java.lang.String friendlyURL, boolean site, boolean inheritContent, 095 boolean active, 096 com.liferay.portal.kernel.service.ServiceContext serviceContext) 097 throws com.liferay.portal.kernel.exception.PortalException { 098 return _groupService.addGroup(parentGroupId, liveGroupId, nameMap, 099 descriptionMap, type, manualMembership, membershipRestriction, 100 friendlyURL, site, inheritContent, active, serviceContext); 101 } 102 103 /** 104 * Adds the groups to the role. 105 * 106 * @param roleId the primary key of the role 107 * @param groupIds the primary keys of the groups 108 * @throws PortalException if a portal exception occurred 109 */ 110 @Override 111 public void addRoleGroups(long roleId, long[] groupIds) 112 throws com.liferay.portal.kernel.exception.PortalException { 113 _groupService.addRoleGroups(roleId, groupIds); 114 } 115 116 /** 117 * Checks that the current user is permitted to use the group for Remote 118 * Staging. 119 * 120 * @param groupId the primary key of the group 121 * @throws PortalException if a portal exception occurred 122 */ 123 @Override 124 public void checkRemoteStagingGroup(long groupId) 125 throws com.liferay.portal.kernel.exception.PortalException { 126 _groupService.checkRemoteStagingGroup(groupId); 127 } 128 129 /** 130 * Deletes the group. 131 * 132 * <p> 133 * The group is unstaged and its assets and resources including layouts, 134 * membership requests, subscriptions, teams, blogs, bookmarks, calendar 135 * events, image gallery, journals, message boards, polls, shopping related 136 * entities, and wikis are also deleted. 137 * </p> 138 * 139 * @param groupId the primary key of the group 140 * @throws PortalException if a portal exception occurred 141 */ 142 @Override 143 public void deleteGroup(long groupId) 144 throws com.liferay.portal.kernel.exception.PortalException { 145 _groupService.deleteGroup(groupId); 146 } 147 148 @Override 149 public void disableStaging(long groupId) 150 throws com.liferay.portal.kernel.exception.PortalException { 151 _groupService.disableStaging(groupId); 152 } 153 154 @Override 155 public void enableStaging(long groupId) 156 throws com.liferay.portal.kernel.exception.PortalException { 157 _groupService.enableStaging(groupId); 158 } 159 160 /** 161 * Returns the company group. 162 * 163 * @param companyId the primary key of the company 164 * @return the group associated with the company 165 * @throws PortalException if a portal exception occurred 166 */ 167 @Override 168 public com.liferay.portal.kernel.model.Group getCompanyGroup(long companyId) 169 throws com.liferay.portal.kernel.exception.PortalException { 170 return _groupService.getCompanyGroup(companyId); 171 } 172 173 /** 174 * Returns the group with the name. 175 * 176 * @param companyId the primary key of the company 177 * @param groupKey the group key 178 * @return the group with the group key 179 * @throws PortalException if a portal exception occurred 180 */ 181 @Override 182 public com.liferay.portal.kernel.model.Group getGroup(long companyId, 183 java.lang.String groupKey) 184 throws com.liferay.portal.kernel.exception.PortalException { 185 return _groupService.getGroup(companyId, groupKey); 186 } 187 188 /** 189 * Returns the group with the primary key. 190 * 191 * @param groupId the primary key of the group 192 * @return the group with the primary key 193 * @throws PortalException if a portal exception occurred 194 */ 195 @Override 196 public com.liferay.portal.kernel.model.Group getGroup(long groupId) 197 throws com.liferay.portal.kernel.exception.PortalException { 198 return _groupService.getGroup(groupId); 199 } 200 201 /** 202 * Returns the group's display URL. 203 * 204 * @param groupId the primary key of the group 205 * @param privateLayout whether the layout set is private to the group 206 * @param secureConnection whether the generated URL uses a secure 207 connection 208 * @return the group's display URL 209 * @throws PortalException if a group with the primary key could not be 210 found or if a portal exception occurred 211 */ 212 @Override 213 public java.lang.String getGroupDisplayURL(long groupId, 214 boolean privateLayout, boolean secureConnection) 215 throws com.liferay.portal.kernel.exception.PortalException { 216 return _groupService.getGroupDisplayURL(groupId, privateLayout, 217 secureConnection); 218 } 219 220 /** 221 * Returns all the groups that are direct children of the parent group. 222 * 223 * @param companyId the primary key of the company 224 * @param parentGroupId the primary key of the parent group 225 * @param site whether the group is to be associated with a main site 226 * @return the matching groups, or <code>null</code> if no matches were 227 found 228 * @throws PortalException if a portal exception occurred 229 */ 230 @Override 231 public java.util.List<com.liferay.portal.kernel.model.Group> getGroups( 232 long companyId, long parentGroupId, boolean site) 233 throws com.liferay.portal.kernel.exception.PortalException { 234 return _groupService.getGroups(companyId, parentGroupId, site); 235 } 236 237 /** 238 * Returns a range of all the site groups for which the user has control 239 * panel access. 240 * 241 * @param portlets the portlets to manage 242 * @param max the upper bound of the range of groups to consider (not 243 inclusive) 244 * @return the range of site groups for which the user has Control Panel 245 access 246 * @throws PortalException if a portal exception occurred 247 */ 248 @Override 249 public java.util.List<com.liferay.portal.kernel.model.Group> getManageableSiteGroups( 250 java.util.Collection<com.liferay.portal.kernel.model.Portlet> portlets, 251 int max) throws com.liferay.portal.kernel.exception.PortalException { 252 return _groupService.getManageableSiteGroups(portlets, max); 253 } 254 255 /** 256 * Returns the OSGi service identifier. 257 * 258 * @return the OSGi service identifier 259 */ 260 @Override 261 public java.lang.String getOSGiServiceIdentifier() { 262 return _groupService.getOSGiServiceIdentifier(); 263 } 264 265 /** 266 * Returns the groups associated with the organizations. 267 * 268 * @param organizations the organizations 269 * @return the groups associated with the organizations 270 * @throws PortalException if a portal exception occurred 271 */ 272 @Override 273 public java.util.List<com.liferay.portal.kernel.model.Group> getOrganizationsGroups( 274 java.util.List<com.liferay.portal.kernel.model.Organization> organizations) 275 throws com.liferay.portal.kernel.exception.PortalException { 276 return _groupService.getOrganizationsGroups(organizations); 277 } 278 279 /** 280 * Returns the group directly associated with the user. 281 * 282 * @param companyId the primary key of the company 283 * @param userId the primary key of the user 284 * @return the group directly associated with the user 285 * @throws PortalException if a portal exception occurred 286 */ 287 @Override 288 public com.liferay.portal.kernel.model.Group getUserGroup(long companyId, 289 long userId) throws com.liferay.portal.kernel.exception.PortalException { 290 return _groupService.getUserGroup(companyId, userId); 291 } 292 293 /** 294 * Returns the groups associated with the user groups. 295 * 296 * @param userGroups the user groups 297 * @return the groups associated with the user groups 298 * @throws PortalException if a portal exception occurred 299 */ 300 @Override 301 public java.util.List<com.liferay.portal.kernel.model.Group> getUserGroupsGroups( 302 java.util.List<com.liferay.portal.kernel.model.UserGroup> userGroups) 303 throws com.liferay.portal.kernel.exception.PortalException { 304 return _groupService.getUserGroupsGroups(userGroups); 305 } 306 307 /** 308 * Returns the range of all groups associated with the user's organization 309 * groups, including the ancestors of the organization groups, unless portal 310 * property <code>organizations.membership.strict</code> is set to 311 * <code>true</code>. 312 * 313 * <p> 314 * Useful when paginating results. Returns a maximum of <code>end - 315 * start</code> instances. <code>start</code> and <code>end</code> are not 316 * primary keys, they are indexes in the result set. Thus, <code>0</code> 317 * refers to the first result in the set. Setting both <code>start</code> 318 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 319 * result set. 320 * </p> 321 * 322 * @param userId the primary key of the user 323 * @param start the lower bound of the range of groups to consider 324 * @param end the upper bound of the range of groups to consider (not 325 inclusive) 326 * @return the range of groups associated with the user's organizations 327 * @throws PortalException if a portal exception occurred 328 */ 329 @Override 330 public java.util.List<com.liferay.portal.kernel.model.Group> getUserOrganizationsGroups( 331 long userId, int start, int end) 332 throws com.liferay.portal.kernel.exception.PortalException { 333 return _groupService.getUserOrganizationsGroups(userId, start, end); 334 } 335 336 @Override 337 public java.util.List<com.liferay.portal.kernel.model.Group> getUserSitesGroups() 338 throws com.liferay.portal.kernel.exception.PortalException { 339 return _groupService.getUserSitesGroups(); 340 } 341 342 /** 343 * Returns the guest or current user's groups "sites" associated 344 * with the group entity class names, including the Control Panel group if 345 * the user is permitted to view the Control Panel. 346 * 347 * <ul> 348 * <li> 349 * Class name "User" includes the user's layout set 350 * group. 351 * </li> 352 * <li> 353 * Class name "Organization" includes the user's 354 * immediate organization groups and inherited organization groups. 355 * </li> 356 * <li> 357 * Class name "Group" includes the user's immediate 358 * organization groups and site groups. 359 * </li> 360 * <li> 361 * A <code>classNames</code> 362 * value of <code>null</code> includes the user's layout set group, 363 * organization groups, inherited organization groups, and site groups. 364 * </li> 365 * </ul> 366 * 367 * @param classNames the group entity class names (optionally 368 <code>null</code>). For more information see {@link 369 #getUserSitesGroups(long, String[], int)}. 370 * @param max the maximum number of groups to return 371 * @return the user's groups "sites" 372 * @throws PortalException if a portal exception occurred 373 */ 374 @Override 375 public java.util.List<com.liferay.portal.kernel.model.Group> getUserSitesGroups( 376 java.lang.String[] classNames, int max) 377 throws com.liferay.portal.kernel.exception.PortalException { 378 return _groupService.getUserSitesGroups(classNames, max); 379 } 380 381 /** 382 * Returns the user's groups "sites" associated with the group 383 * entity class names, including the Control Panel group if the user is 384 * permitted to view the Control Panel. 385 * 386 * <ul> 387 * <li> 388 * Class name "User" includes the user's layout set 389 * group. 390 * </li> 391 * <li> 392 * Class name "Organization" includes the user's 393 * immediate organization groups and inherited organization groups. 394 * </li> 395 * <li> 396 * Class name "Group" includes the user's immediate 397 * organization groups and site groups. 398 * </li> 399 * <li> 400 * A <code>classNames</code> 401 * value of <code>null</code> includes the user's layout set group, 402 * organization groups, inherited organization groups, and site groups. 403 * </li> 404 * </ul> 405 * 406 * @param userId the primary key of the user 407 * @param classNames the group entity class names (optionally 408 <code>null</code>). For more information see {@link 409 #getUserSitesGroups(long, String[], int)}. 410 * @param max the maximum number of groups to return 411 * @return the user's groups "sites" 412 * @throws PortalException if a portal exception occurred 413 */ 414 @Override 415 public java.util.List<com.liferay.portal.kernel.model.Group> getUserSitesGroups( 416 long userId, java.lang.String[] classNames, int max) 417 throws com.liferay.portal.kernel.exception.PortalException { 418 return _groupService.getUserSitesGroups(userId, classNames, max); 419 } 420 421 /** 422 * Returns the number of the guest or current user's groups 423 * "sites" associated with the group entity class names, including 424 * the Control Panel group if the user is permitted to view the Control 425 * Panel. 426 * 427 * @return the number of user's groups "sites" 428 * @throws PortalException if a portal exception occurred 429 */ 430 @Override 431 public int getUserSitesGroupsCount() 432 throws com.liferay.portal.kernel.exception.PortalException { 433 return _groupService.getUserSitesGroupsCount(); 434 } 435 436 /** 437 * Returns <code>true</code> if the user is associated with the group, 438 * including the user's inherited organizations and user groups. System and 439 * staged groups are not included. 440 * 441 * @param userId the primary key of the user 442 * @param groupId the primary key of the group 443 * @return <code>true</code> if the user is associated with the group; 444 <code>false</code> otherwise 445 * @throws PortalException if a portal exception occurred 446 */ 447 @Override 448 public boolean hasUserGroup(long userId, long groupId) 449 throws com.liferay.portal.kernel.exception.PortalException { 450 return _groupService.hasUserGroup(userId, groupId); 451 } 452 453 @Override 454 public java.util.List<com.liferay.portal.kernel.model.Group> search( 455 long companyId, long[] classNameIds, java.lang.String keywords, 456 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 457 int start, int end, 458 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Group> obc) 459 throws com.liferay.portal.kernel.exception.PortalException { 460 return _groupService.search(companyId, classNameIds, keywords, params, 461 start, end, obc); 462 } 463 464 @Override 465 public java.util.List<com.liferay.portal.kernel.model.Group> search( 466 long companyId, long[] classNameIds, java.lang.String name, 467 java.lang.String description, 468 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 469 boolean andOperator, int start, int end, 470 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Group> obc) 471 throws com.liferay.portal.kernel.exception.PortalException { 472 return _groupService.search(companyId, classNameIds, name, description, 473 params, andOperator, start, end, obc); 474 } 475 476 /** 477 * Returns an ordered range of all the site groups and organization groups 478 * that match the name and description, optionally including the user's 479 * inherited organization groups and user groups. System and staged groups 480 * are not included. 481 * 482 * <p> 483 * Useful when paginating results. Returns a maximum of <code>end - 484 * start</code> instances. <code>start</code> and <code>end</code> are not 485 * primary keys, they are indexes in the result set. Thus, <code>0</code> 486 * refers to the first result in the set. Setting both <code>start</code> 487 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 488 * result set. 489 * </p> 490 * 491 * @param companyId the primary key of the company 492 * @param name the group's name (optionally <code>null</code>) 493 * @param description the group's description (optionally 494 <code>null</code>) 495 * @param params the finder params (optionally <code>null</code>). To 496 include the user's inherited organizations and user groups in the 497 search, add entries having "usersGroups" and 498 "inherit" as keys mapped to the the user's ID. For more 499 information see {@link 500 com.liferay.portal.kernel.service.persistence.GroupFinder}. 501 * @param start the lower bound of the range of groups to return 502 * @param end the upper bound of the range of groups to return (not 503 inclusive) 504 * @return the matching groups ordered by name 505 * @throws PortalException if a portal exception occurred 506 */ 507 @Override 508 public java.util.List<com.liferay.portal.kernel.model.Group> search( 509 long companyId, java.lang.String name, java.lang.String description, 510 java.lang.String[] params, int start, int end) 511 throws com.liferay.portal.kernel.exception.PortalException { 512 return _groupService.search(companyId, name, description, params, 513 start, end); 514 } 515 516 /** 517 * Returns the number of groups and organization groups that match the name 518 * and description, optionally including the user's inherited organizations 519 * and user groups. System and staged groups are not included. 520 * 521 * @param companyId the primary key of the company 522 * @param name the group's name (optionally <code>null</code>) 523 * @param description the group's description (optionally 524 <code>null</code>) 525 * @param params the finder params (optionally <code>null</code>). To 526 include the user's inherited organizations and user groups in the 527 search, add entries having "usersGroups" and 528 "inherit" as keys mapped to the the user's ID. For more 529 information see {@link 530 com.liferay.portal.kernel.service.persistence.GroupFinder}. 531 * @return the number of matching groups 532 */ 533 @Override 534 public int searchCount(long companyId, java.lang.String name, 535 java.lang.String description, java.lang.String[] params) { 536 return _groupService.searchCount(companyId, name, description, params); 537 } 538 539 /** 540 * Sets the groups associated with the role, removing and adding 541 * associations as necessary. 542 * 543 * @param roleId the primary key of the role 544 * @param groupIds the primary keys of the groups 545 * @throws PortalException if a portal exception occurred 546 */ 547 @Override 548 public void setRoleGroups(long roleId, long[] groupIds) 549 throws com.liferay.portal.kernel.exception.PortalException { 550 _groupService.setRoleGroups(roleId, groupIds); 551 } 552 553 /** 554 * Removes the groups from the role. 555 * 556 * @param roleId the primary key of the role 557 * @param groupIds the primary keys of the groups 558 * @throws PortalException if a portal exception occurred 559 */ 560 @Override 561 public void unsetRoleGroups(long roleId, long[] groupIds) 562 throws com.liferay.portal.kernel.exception.PortalException { 563 _groupService.unsetRoleGroups(roleId, groupIds); 564 } 565 566 /** 567 * Updates the group's friendly URL. 568 * 569 * @param groupId the primary key of the group 570 * @param friendlyURL the group's new friendlyURL (optionally 571 <code>null</code>) 572 * @return the group 573 * @throws PortalException if a portal exception occurred 574 */ 575 @Override 576 public com.liferay.portal.kernel.model.Group updateFriendlyURL( 577 long groupId, java.lang.String friendlyURL) 578 throws com.liferay.portal.kernel.exception.PortalException { 579 return _groupService.updateFriendlyURL(groupId, friendlyURL); 580 } 581 582 /** 583 * Updates the group. 584 * 585 * @param groupId the primary key of the group 586 * @param parentGroupId the primary key of the parent group 587 * @param name the group's name 588 * @param description the group's new description (optionally 589 <code>null</code>) 590 * @param type the group's new type. For more information see {@link 591 GroupConstants}. 592 * @param manualMembership whether manual membership is allowed for the 593 group 594 * @param membershipRestriction the group's membership restriction. For 595 more information see {@link GroupConstants}. 596 * @param friendlyURL the group's new friendlyURL (optionally 597 <code>null</code>) 598 * @param inheritContent whether to inherit content from the parent 599 group 600 * @param active whether the group is active 601 * @param serviceContext the service context to be applied (optionally 602 <code>null</code>). Can set the asset category IDs and asset 603 tag names for the group. 604 * @return the group 605 * @throws PortalException if a portal exception occurred 606 * @deprecated As of 7.0.0, replaced by {@link #updateGroup(long, long, Map, 607 Map, int, boolean, int, String, boolean, boolean, 608 ServiceContext)} 609 */ 610 @Deprecated 611 @Override 612 public com.liferay.portal.kernel.model.Group updateGroup(long groupId, 613 long parentGroupId, java.lang.String name, 614 java.lang.String description, int type, boolean manualMembership, 615 int membershipRestriction, java.lang.String friendlyURL, 616 boolean inheritContent, boolean active, 617 com.liferay.portal.kernel.service.ServiceContext serviceContext) 618 throws com.liferay.portal.kernel.exception.PortalException { 619 return _groupService.updateGroup(groupId, parentGroupId, name, 620 description, type, manualMembership, membershipRestriction, 621 friendlyURL, inheritContent, active, serviceContext); 622 } 623 624 @Override 625 public com.liferay.portal.kernel.model.Group updateGroup(long groupId, 626 long parentGroupId, 627 java.util.Map<java.util.Locale, java.lang.String> nameMap, 628 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 629 int type, boolean manualMembership, int membershipRestriction, 630 java.lang.String friendlyURL, boolean inheritContent, boolean active, 631 com.liferay.portal.kernel.service.ServiceContext serviceContext) 632 throws com.liferay.portal.kernel.exception.PortalException { 633 return _groupService.updateGroup(groupId, parentGroupId, nameMap, 634 descriptionMap, type, manualMembership, membershipRestriction, 635 friendlyURL, inheritContent, active, serviceContext); 636 } 637 638 /** 639 * Updates the group's type settings. 640 * 641 * @param groupId the primary key of the group 642 * @param typeSettings the group's new type settings (optionally 643 <code>null</code>) 644 * @return the group 645 * @throws PortalException if a portal exception occurred 646 */ 647 @Override 648 public com.liferay.portal.kernel.model.Group updateGroup(long groupId, 649 java.lang.String typeSettings) 650 throws com.liferay.portal.kernel.exception.PortalException { 651 return _groupService.updateGroup(groupId, typeSettings); 652 } 653 654 @Override 655 public void updateStagedPortlets(long groupId, 656 java.util.Map<java.lang.String, java.lang.String> stagedPortletIds) 657 throws com.liferay.portal.kernel.exception.PortalException { 658 _groupService.updateStagedPortlets(groupId, stagedPortletIds); 659 } 660 661 @Override 662 public GroupService getWrappedService() { 663 return _groupService; 664 } 665 666 @Override 667 public void setWrappedService(GroupService groupService) { 668 _groupService = groupService; 669 } 670 671 private GroupService _groupService; 672 }