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