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 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the user group local service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 022 * 023 * <p> 024 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see UserGroupLocalService 029 * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl 030 * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl 031 * @generated 032 */ 033 public class UserGroupLocalServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Adds the user group to the database. Also notifies the appropriate model listeners. 042 * 043 * @param userGroup the user group 044 * @return the user group that was added 045 * @throws SystemException if a system exception occurred 046 */ 047 public static com.liferay.portal.model.UserGroup addUserGroup( 048 com.liferay.portal.model.UserGroup userGroup) 049 throws com.liferay.portal.kernel.exception.SystemException { 050 return getService().addUserGroup(userGroup); 051 } 052 053 /** 054 * Creates a new user group with the primary key. Does not add the user group to the database. 055 * 056 * @param userGroupId the primary key for the new user group 057 * @return the new user group 058 */ 059 public static com.liferay.portal.model.UserGroup createUserGroup( 060 long userGroupId) { 061 return getService().createUserGroup(userGroupId); 062 } 063 064 /** 065 * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param userGroupId the primary key of the user group 068 * @return the user group that was removed 069 * @throws PortalException if a user group with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public static com.liferay.portal.model.UserGroup deleteUserGroup( 073 long userGroupId) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException { 076 return getService().deleteUserGroup(userGroupId); 077 } 078 079 /** 080 * Deletes the user group from the database. Also notifies the appropriate model listeners. 081 * 082 * @param userGroup the user group 083 * @return the user group that was removed 084 * @throws PortalException 085 * @throws SystemException if a system exception occurred 086 */ 087 public static com.liferay.portal.model.UserGroup deleteUserGroup( 088 com.liferay.portal.model.UserGroup userGroup) 089 throws com.liferay.portal.kernel.exception.PortalException, 090 com.liferay.portal.kernel.exception.SystemException { 091 return getService().deleteUserGroup(userGroup); 092 } 093 094 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 095 return getService().dynamicQuery(); 096 } 097 098 /** 099 * Performs a dynamic query on the database and returns the matching rows. 100 * 101 * @param dynamicQuery the dynamic query 102 * @return the matching rows 103 * @throws SystemException if a system exception occurred 104 */ 105 @SuppressWarnings("rawtypes") 106 public static java.util.List dynamicQuery( 107 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 108 throws com.liferay.portal.kernel.exception.SystemException { 109 return getService().dynamicQuery(dynamicQuery); 110 } 111 112 /** 113 * Performs a dynamic query on the database and returns a range of the matching rows. 114 * 115 * <p> 116 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 117 * </p> 118 * 119 * @param dynamicQuery the dynamic query 120 * @param start the lower bound of the range of model instances 121 * @param end the upper bound of the range of model instances (not inclusive) 122 * @return the range of matching rows 123 * @throws SystemException if a system exception occurred 124 */ 125 @SuppressWarnings("rawtypes") 126 public static java.util.List dynamicQuery( 127 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 128 int end) throws com.liferay.portal.kernel.exception.SystemException { 129 return getService().dynamicQuery(dynamicQuery, start, end); 130 } 131 132 /** 133 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 134 * 135 * <p> 136 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 137 * </p> 138 * 139 * @param dynamicQuery the dynamic query 140 * @param start the lower bound of the range of model instances 141 * @param end the upper bound of the range of model instances (not inclusive) 142 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 143 * @return the ordered range of matching rows 144 * @throws SystemException if a system exception occurred 145 */ 146 @SuppressWarnings("rawtypes") 147 public static java.util.List dynamicQuery( 148 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 149 int end, 150 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 151 throws com.liferay.portal.kernel.exception.SystemException { 152 return getService() 153 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 154 } 155 156 /** 157 * Returns the number of rows that match the dynamic query. 158 * 159 * @param dynamicQuery the dynamic query 160 * @return the number of rows that match the dynamic query 161 * @throws SystemException if a system exception occurred 162 */ 163 public static long dynamicQueryCount( 164 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 165 throws com.liferay.portal.kernel.exception.SystemException { 166 return getService().dynamicQueryCount(dynamicQuery); 167 } 168 169 public static com.liferay.portal.model.UserGroup fetchUserGroup( 170 long userGroupId) 171 throws com.liferay.portal.kernel.exception.SystemException { 172 return getService().fetchUserGroup(userGroupId); 173 } 174 175 /** 176 * Returns the user group with the primary key. 177 * 178 * @param userGroupId the primary key of the user group 179 * @return the user group 180 * @throws PortalException if a user group with the primary key could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public static com.liferay.portal.model.UserGroup getUserGroup( 184 long userGroupId) 185 throws com.liferay.portal.kernel.exception.PortalException, 186 com.liferay.portal.kernel.exception.SystemException { 187 return getService().getUserGroup(userGroupId); 188 } 189 190 public static com.liferay.portal.model.PersistedModel getPersistedModel( 191 java.io.Serializable primaryKeyObj) 192 throws com.liferay.portal.kernel.exception.PortalException, 193 com.liferay.portal.kernel.exception.SystemException { 194 return getService().getPersistedModel(primaryKeyObj); 195 } 196 197 /** 198 * Returns a range of all the user groups. 199 * 200 * <p> 201 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 202 * </p> 203 * 204 * @param start the lower bound of the range of user groups 205 * @param end the upper bound of the range of user groups (not inclusive) 206 * @return the range of user groups 207 * @throws SystemException if a system exception occurred 208 */ 209 public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 210 int start, int end) 211 throws com.liferay.portal.kernel.exception.SystemException { 212 return getService().getUserGroups(start, end); 213 } 214 215 /** 216 * Returns the number of user groups. 217 * 218 * @return the number of user groups 219 * @throws SystemException if a system exception occurred 220 */ 221 public static int getUserGroupsCount() 222 throws com.liferay.portal.kernel.exception.SystemException { 223 return getService().getUserGroupsCount(); 224 } 225 226 /** 227 * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 228 * 229 * @param userGroup the user group 230 * @return the user group that was updated 231 * @throws SystemException if a system exception occurred 232 */ 233 public static com.liferay.portal.model.UserGroup updateUserGroup( 234 com.liferay.portal.model.UserGroup userGroup) 235 throws com.liferay.portal.kernel.exception.SystemException { 236 return getService().updateUserGroup(userGroup); 237 } 238 239 /** 240 * Returns the Spring bean ID for this bean. 241 * 242 * @return the Spring bean ID for this bean 243 */ 244 public static java.lang.String getBeanIdentifier() { 245 return getService().getBeanIdentifier(); 246 } 247 248 /** 249 * Sets the Spring bean ID for this bean. 250 * 251 * @param beanIdentifier the Spring bean ID for this bean 252 */ 253 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 254 getService().setBeanIdentifier(beanIdentifier); 255 } 256 257 /** 258 * Adds the user groups to the group. 259 * 260 * @param groupId the primary key of the group 261 * @param userGroupIds the primary keys of the user groups 262 * @throws SystemException if a system exception occurred 263 */ 264 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 265 throws com.liferay.portal.kernel.exception.SystemException { 266 getService().addGroupUserGroups(groupId, userGroupIds); 267 } 268 269 /** 270 * Adds the user groups to the team. 271 * 272 * @param teamId the primary key of the team 273 * @param userGroupIds the primary keys of the user groups 274 * @throws SystemException if a system exception occurred 275 */ 276 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 277 throws com.liferay.portal.kernel.exception.SystemException { 278 getService().addTeamUserGroups(teamId, userGroupIds); 279 } 280 281 /** 282 * Adds a user group. 283 * 284 * <p> 285 * This method handles the creation and bookkeeping of the user group, 286 * including its resources, metadata, and internal data structures. It is 287 * not necessary to make subsequent calls to setup default groups and 288 * resources for the user group. 289 * </p> 290 * 291 * @param userId the primary key of the user 292 * @param companyId the primary key of the user group's company 293 * @param name the user group's name 294 * @param description the user group's description 295 * @return the user group 296 * @throws PortalException if the user group's information was invalid 297 * @throws SystemException if a system exception occurred 298 * @deprecated {@link #addUserGroup(long, long, String, String, 299 ServiceContext)} 300 */ 301 public static com.liferay.portal.model.UserGroup addUserGroup(long userId, 302 long companyId, java.lang.String name, java.lang.String description) 303 throws com.liferay.portal.kernel.exception.PortalException, 304 com.liferay.portal.kernel.exception.SystemException { 305 return getService().addUserGroup(userId, companyId, name, description); 306 } 307 308 /** 309 * Adds a user group. 310 * 311 * <p> 312 * This method handles the creation and bookkeeping of the user group, 313 * including its resources, metadata, and internal data structures. It is 314 * not necessary to make subsequent calls to setup default groups and 315 * resources for the user group. 316 * </p> 317 * 318 * @param userId the primary key of the user 319 * @param companyId the primary key of the user group's company 320 * @param name the user group's name 321 * @param description the user group's description 322 * @param serviceContext the user group's service context (optionally 323 <code>null</code>). Can set expando bridge attributes for the 324 user group. 325 * @return the user group 326 * @throws PortalException if the user group's information was invalid 327 * @throws SystemException if a system exception occurred 328 */ 329 public static com.liferay.portal.model.UserGroup addUserGroup(long userId, 330 long companyId, java.lang.String name, java.lang.String description, 331 com.liferay.portal.service.ServiceContext serviceContext) 332 throws com.liferay.portal.kernel.exception.PortalException, 333 com.liferay.portal.kernel.exception.SystemException { 334 return getService() 335 .addUserGroup(userId, companyId, name, description, 336 serviceContext); 337 } 338 339 /** 340 * Clears all associations between the user and its user groups and clears 341 * the permissions cache. 342 * 343 * <p> 344 * This method is called from {@link #deleteUserGroup(UserGroup)}. 345 * </p> 346 * 347 * @param userId the primary key of the user 348 * @throws SystemException if a system exception occurred 349 */ 350 public static void clearUserUserGroups(long userId) 351 throws com.liferay.portal.kernel.exception.SystemException { 352 getService().clearUserUserGroups(userId); 353 } 354 355 /** 356 * Copies the user group's layouts to the users who are not already members 357 * of the user group. 358 * 359 * @param userGroupId the primary key of the user group 360 * @param userIds the primary keys of the users 361 * @throws PortalException if any one of the users could not be found or 362 if a portal exception occurred 363 * @throws SystemException if a system exception occurred 364 * @deprecated 365 */ 366 public static void copyUserGroupLayouts(long userGroupId, long[] userIds) 367 throws com.liferay.portal.kernel.exception.PortalException, 368 com.liferay.portal.kernel.exception.SystemException { 369 getService().copyUserGroupLayouts(userGroupId, userIds); 370 } 371 372 /** 373 * Copies the user groups' layouts to the user. 374 * 375 * @param userGroupIds the primary keys of the user groups 376 * @param userId the primary key of the user 377 * @throws PortalException if a user with the primary key could not be 378 found or if a portal exception occurred 379 * @throws SystemException if a system exception occurred 380 * @deprecated 381 */ 382 public static void copyUserGroupLayouts(long[] userGroupIds, long userId) 383 throws com.liferay.portal.kernel.exception.PortalException, 384 com.liferay.portal.kernel.exception.SystemException { 385 getService().copyUserGroupLayouts(userGroupIds, userId); 386 } 387 388 /** 389 * Copies the user group's layout to the user. 390 * 391 * @param userGroupId the primary key of the user group 392 * @param userId the primary key of the user 393 * @throws PortalException if a user with the primary key could not be 394 found or if a portal exception occurred 395 * @throws SystemException if a system exception occurred 396 * @deprecated 397 */ 398 public static void copyUserGroupLayouts(long userGroupId, long userId) 399 throws com.liferay.portal.kernel.exception.PortalException, 400 com.liferay.portal.kernel.exception.SystemException { 401 getService().copyUserGroupLayouts(userGroupId, userId); 402 } 403 404 /** 405 * Returns the user group with the name. 406 * 407 * @param companyId the primary key of the user group's company 408 * @param name the user group's name 409 * @return Returns the user group with the name 410 * @throws PortalException if a user group with the name could not be found 411 * @throws SystemException if a system exception occurred 412 */ 413 public static com.liferay.portal.model.UserGroup getUserGroup( 414 long companyId, java.lang.String name) 415 throws com.liferay.portal.kernel.exception.PortalException, 416 com.liferay.portal.kernel.exception.SystemException { 417 return getService().getUserGroup(companyId, name); 418 } 419 420 /** 421 * Returns all the user groups belonging to the company. 422 * 423 * @param companyId the primary key of the user groups' company 424 * @return the user groups belonging to the company 425 * @throws SystemException if a system exception occurred 426 */ 427 public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 428 long companyId) 429 throws com.liferay.portal.kernel.exception.SystemException { 430 return getService().getUserGroups(companyId); 431 } 432 433 /** 434 * Returns all the user groups with the primary keys. 435 * 436 * @param userGroupIds the primary keys of the user groups 437 * @return the user groups with the primary keys 438 * @throws PortalException if any one of the user groups could not be found 439 * @throws SystemException if a system exception occurred 440 */ 441 public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 442 long[] userGroupIds) 443 throws com.liferay.portal.kernel.exception.PortalException, 444 com.liferay.portal.kernel.exception.SystemException { 445 return getService().getUserGroups(userGroupIds); 446 } 447 448 /** 449 * Returns all the user groups to which the user belongs. 450 * 451 * @param userId the primary key of the user 452 * @return the user groups to which the user belongs 453 * @throws SystemException if a system exception occurred 454 */ 455 public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 456 long userId) throws com.liferay.portal.kernel.exception.SystemException { 457 return getService().getUserUserGroups(userId); 458 } 459 460 /** 461 * Returns <code>true</code> if the user group is associated with the group. 462 * 463 * @param groupId the primary key of the group 464 * @param userGroupId the primary key of the user group 465 * @return <code>true</code> if the user group belongs to the group; 466 <code>false</code> otherwise 467 * @throws SystemException if a system exception occurred 468 */ 469 public static boolean hasGroupUserGroup(long groupId, long userGroupId) 470 throws com.liferay.portal.kernel.exception.SystemException { 471 return getService().hasGroupUserGroup(groupId, userGroupId); 472 } 473 474 /** 475 * Returns <code>true</code> if the user group belongs to the team. 476 * 477 * @param teamId the primary key of the team 478 * @param userGroupId the primary key of the user group 479 * @return <code>true</code> if the user group belongs to the team; 480 <code>false</code> otherwise 481 * @throws SystemException if a system exception occurred 482 */ 483 public static boolean hasTeamUserGroup(long teamId, long userGroupId) 484 throws com.liferay.portal.kernel.exception.SystemException { 485 return getService().hasTeamUserGroup(teamId, userGroupId); 486 } 487 488 /** 489 * Returns an ordered range of all the user groups that match the keywords. 490 * 491 * <p> 492 * Useful when paginating results. Returns a maximum of <code>end - 493 * start</code> instances. <code>start</code> and <code>end</code> are not 494 * primary keys, they are indexes in the result set. Thus, <code>0</code> 495 * refers to the first result in the set. Setting both <code>start</code> 496 * and <code>end</code> to {@link 497 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 498 * result set. 499 * </p> 500 * 501 * @param companyId the primary key of the user group's company 502 * @param keywords the keywords (space separated), which may occur in the 503 user group's name or description (optionally <code>null</code>) 504 * @param params the finder params (optionally <code>null</code>). For more 505 information see {@link 506 com.liferay.portal.service.persistence.UserGroupFinder} 507 * @param start the lower bound of the range of user groups to return 508 * @param end the upper bound of the range of user groups to return (not 509 inclusive) 510 * @param obc the comparator to order the user groups (optionally 511 <code>null</code>) 512 * @return the matching user groups ordered by comparator <code>obc</code> 513 * @throws SystemException if a system exception occurred 514 * @see com.liferay.portal.service.persistence.UserGroupFinder 515 */ 516 public static java.util.List<com.liferay.portal.model.UserGroup> search( 517 long companyId, java.lang.String keywords, 518 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 519 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 520 throws com.liferay.portal.kernel.exception.SystemException { 521 return getService().search(companyId, keywords, params, start, end, obc); 522 } 523 524 /** 525 * Returns an ordered range of all the user groups that match the keywords, 526 * using the indexer. It is preferable to use this method instead of the 527 * non-indexed version whenever possible for performance reasons. 528 * 529 * <p> 530 * Useful when paginating results. Returns a maximum of <code>end - 531 * start</code> instances. <code>start</code> and <code>end</code> are not 532 * primary keys, they are indexes in the result set. Thus, <code>0</code> 533 * refers to the first result in the set. Setting both <code>start</code> 534 * and <code>end</code> to {@link 535 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 536 * result set. 537 * </p> 538 * 539 * @param companyId the primary key of the user group's company 540 * @param keywords the keywords (space separated), which may occur in the 541 user group's name or description (optionally <code>null</code>) 542 * @param params the finder params (optionally <code>null</code>). For more 543 information see {@link 544 com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer} 545 * @param start the lower bound of the range of user groups to return 546 * @param end the upper bound of the range of user groups to return (not 547 inclusive) 548 * @param sort the field and direction by which to sort (optionally 549 <code>null</code>) 550 * @return the matching user groups ordered by sort 551 * @throws SystemException if a system exception occurred 552 * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer 553 */ 554 public static com.liferay.portal.kernel.search.Hits search(long companyId, 555 java.lang.String keywords, 556 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 557 int start, int end, com.liferay.portal.kernel.search.Sort sort) 558 throws com.liferay.portal.kernel.exception.SystemException { 559 return getService().search(companyId, keywords, params, start, end, sort); 560 } 561 562 /** 563 * Returns an ordered range of all the user groups that match the name and 564 * description. It is preferable to use this method instead of the 565 * non-indexed version whenever possible for performance reasons. 566 * 567 * <p> 568 * Useful when paginating results. Returns a maximum of <code>end - 569 * start</code> instances. <code>start</code> and <code>end</code> are not 570 * primary keys, they are indexes in the result set. Thus, <code>0</code> 571 * refers to the first result in the set. Setting both <code>start</code> 572 * and <code>end</code> to {@link 573 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 574 * result set. 575 * </p> 576 * 577 * @param companyId the primary key of the user group's company 578 * @param name the user group's name (optionally <code>null</code>) 579 * @param description the user group's description (optionally 580 <code>null</code>) 581 * @param params the finder params (optionally <code>null</code>). For more 582 information see {@link 583 com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer} 584 * @param andSearch whether every field must match its keywords or just one 585 field 586 * @param start the lower bound of the range of user groups to return 587 * @param end the upper bound of the range of user groups to return (not 588 inclusive) 589 * @param sort the field and direction by which to sort (optionally 590 <code>null</code>) 591 * @return the matching user groups ordered by sort 592 * @throws SystemException if a system exception occurred 593 * @see com.liferay.portal.service.persistence.UserGroupFinder 594 */ 595 public static com.liferay.portal.kernel.search.Hits search(long companyId, 596 java.lang.String name, java.lang.String description, 597 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 598 boolean andSearch, int start, int end, 599 com.liferay.portal.kernel.search.Sort sort) 600 throws com.liferay.portal.kernel.exception.SystemException { 601 return getService() 602 .search(companyId, name, description, params, andSearch, 603 start, end, sort); 604 } 605 606 /** 607 * Returns an ordered range of all the user groups that match the name and 608 * description. 609 * 610 * <p> 611 * Useful when paginating results. Returns a maximum of <code>end - 612 * start</code> instances. <code>start</code> and <code>end</code> are not 613 * primary keys, they are indexes in the result set. Thus, <code>0</code> 614 * refers to the first result in the set. Setting both <code>start</code> 615 * and <code>end</code> to {@link 616 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 617 * result set. 618 * </p> 619 * 620 * @param companyId the primary key of the user group's company 621 * @param name the user group's name (optionally <code>null</code>) 622 * @param description the user group's description (optionally 623 <code>null</code>) 624 * @param params the finder params (optionally <code>null</code>). For more 625 information see {@link 626 com.liferay.portal.service.persistence.UserGroupFinder} 627 * @param start the lower bound of the range of user groups to return 628 * @param end the upper bound of the range of user groups to return (not 629 inclusive) 630 * @param obc the comparator to order the user groups (optionally 631 <code>null</code>) 632 * @return the matching user groups ordered by comparator <code>obc</code> 633 * @throws SystemException if a system exception occurred 634 * @see com.liferay.portal.service.persistence.UserGroupFinder 635 */ 636 public static java.util.List<com.liferay.portal.model.UserGroup> search( 637 long companyId, java.lang.String name, java.lang.String description, 638 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 639 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 640 throws com.liferay.portal.kernel.exception.SystemException { 641 return getService() 642 .search(companyId, name, description, params, start, end, obc); 643 } 644 645 /** 646 * Returns the number of user groups that match the keywords 647 * 648 * @param companyId the primary key of the user group's company 649 * @param keywords the keywords (space separated), which may occur in the 650 user group's name or description (optionally <code>null</code>) 651 * @param params the finder params (optionally <code>null</code>). For more 652 information see {@link 653 com.liferay.portal.service.persistence.UserGroupFinder} 654 * @return the number of matching user groups 655 * @throws SystemException if a system exception occurred 656 * @see com.liferay.portal.service.persistence.UserGroupFinder 657 */ 658 public static int searchCount(long companyId, java.lang.String keywords, 659 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 660 throws com.liferay.portal.kernel.exception.SystemException { 661 return getService().searchCount(companyId, keywords, params); 662 } 663 664 /** 665 * Returns the number of user groups that match the name and description. 666 * 667 * @param companyId the primary key of the user group's company 668 * @param name the user group's name (optionally <code>null</code>) 669 * @param description the user group's description (optionally 670 <code>null</code>) 671 * @param params the finder params (optionally <code>null</code>). For more 672 information see {@link 673 com.liferay.portal.service.persistence.UserGroupFinder} 674 * @return the number of matching user groups 675 * @throws SystemException if a system exception occurred 676 * @see com.liferay.portal.service.persistence.UserGroupFinder 677 */ 678 public static int searchCount(long companyId, java.lang.String name, 679 java.lang.String description, 680 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 681 throws com.liferay.portal.kernel.exception.SystemException { 682 return getService().searchCount(companyId, name, description, params); 683 } 684 685 /** 686 * Sets the user groups associated with the user copying the user group 687 * layouts and removing and adding user group associations for the user as 688 * necessary. 689 * 690 * @param userId the primary key of the user 691 * @param userGroupIds the primary keys of the user groups 692 * @throws PortalException if a portal exception occurred 693 * @throws SystemException if a system exception occurred 694 */ 695 public static void setUserUserGroups(long userId, long[] userGroupIds) 696 throws com.liferay.portal.kernel.exception.PortalException, 697 com.liferay.portal.kernel.exception.SystemException { 698 getService().setUserUserGroups(userId, userGroupIds); 699 } 700 701 /** 702 * Removes the user groups from the group. 703 * 704 * @param groupId the primary key of the group 705 * @param userGroupIds the primary keys of the user groups 706 * @throws SystemException if a system exception occurred 707 */ 708 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 709 throws com.liferay.portal.kernel.exception.SystemException { 710 getService().unsetGroupUserGroups(groupId, userGroupIds); 711 } 712 713 /** 714 * Removes the user groups from the team. 715 * 716 * @param teamId the primary key of the team 717 * @param userGroupIds the primary keys of the user groups 718 * @throws SystemException if a system exception occurred 719 */ 720 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 721 throws com.liferay.portal.kernel.exception.SystemException { 722 getService().unsetTeamUserGroups(teamId, userGroupIds); 723 } 724 725 /** 726 * Updates the user group. 727 * 728 * @param companyId the primary key of the user group's company 729 * @param userGroupId the primary key of the user group 730 * @param name the user group's name 731 * @param description the user group's description 732 * @return the user group 733 * @throws PortalException if a user group with the primary key could 734 not be found or if the new information was invalid 735 * @throws SystemException if a system exception occurred 736 * @deprecated {@link #updateUserGroup(long, long, String, String, 737 ServiceContext)} 738 */ 739 public static com.liferay.portal.model.UserGroup updateUserGroup( 740 long companyId, long userGroupId, java.lang.String name, 741 java.lang.String description) 742 throws com.liferay.portal.kernel.exception.PortalException, 743 com.liferay.portal.kernel.exception.SystemException { 744 return getService() 745 .updateUserGroup(companyId, userGroupId, name, description); 746 } 747 748 /** 749 * Updates the user group. 750 * 751 * @param companyId the primary key of the user group's company 752 * @param userGroupId the primary key of the user group 753 * @param name the user group's name 754 * @param description the user group's description 755 * @param serviceContext the user group's service context (optionally 756 <code>null</code>). Can set expando bridge attributes for the 757 user group. 758 * @return the user group 759 * @throws PortalException if a user group with the primary key could not be 760 found or if the new information was invalid 761 * @throws SystemException if a system exception occurred 762 */ 763 public static com.liferay.portal.model.UserGroup updateUserGroup( 764 long companyId, long userGroupId, java.lang.String name, 765 java.lang.String description, 766 com.liferay.portal.service.ServiceContext serviceContext) 767 throws com.liferay.portal.kernel.exception.PortalException, 768 com.liferay.portal.kernel.exception.SystemException { 769 return getService() 770 .updateUserGroup(companyId, userGroupId, name, description, 771 serviceContext); 772 } 773 774 public static UserGroupLocalService getService() { 775 if (_service == null) { 776 _service = (UserGroupLocalService)PortalBeanLocatorUtil.locate(UserGroupLocalService.class.getName()); 777 778 ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class, 779 "_service"); 780 } 781 782 return _service; 783 } 784 785 /** 786 * @deprecated 787 */ 788 public void setService(UserGroupLocalService service) { 789 } 790 791 private static UserGroupLocalService _service; 792 }