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