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