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