001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.transaction.Isolation; 020 import com.liferay.portal.kernel.transaction.Propagation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 023 /** 024 * The interface for the user group local service. 025 * 026 * <p> 027 * 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. 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see UserGroupLocalServiceUtil 032 * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl 034 * @generated 035 */ 036 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 037 PortalException.class, SystemException.class}) 038 public interface UserGroupLocalService extends BaseLocalService, 039 PersistedModelLocalService { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify or reference this interface directly. Always use {@link UserGroupLocalServiceUtil} to access the user group local service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 044 */ 045 046 /** 047 * Adds the user group to the database. Also notifies the appropriate model listeners. 048 * 049 * @param userGroup the user group 050 * @return the user group that was added 051 * @throws SystemException if a system exception occurred 052 */ 053 public com.liferay.portal.model.UserGroup addUserGroup( 054 com.liferay.portal.model.UserGroup userGroup) 055 throws com.liferay.portal.kernel.exception.SystemException; 056 057 /** 058 * Creates a new user group with the primary key. Does not add the user group to the database. 059 * 060 * @param userGroupId the primary key for the new user group 061 * @return the new user group 062 */ 063 public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId); 064 065 /** 066 * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param userGroupId the primary key of the user group 069 * @return the user group that was removed 070 * @throws PortalException if a user group with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public com.liferay.portal.model.UserGroup deleteUserGroup(long userGroupId) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Deletes the user group from the database. Also notifies the appropriate model listeners. 079 * 080 * @param userGroup the user group 081 * @return the user group that was removed 082 * @throws PortalException 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portal.model.UserGroup deleteUserGroup( 086 com.liferay.portal.model.UserGroup userGroup) 087 throws com.liferay.portal.kernel.exception.PortalException, 088 com.liferay.portal.kernel.exception.SystemException; 089 090 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 091 092 /** 093 * Performs a dynamic query on the database and returns the matching rows. 094 * 095 * @param dynamicQuery the dynamic query 096 * @return the matching rows 097 * @throws SystemException if a system exception occurred 098 */ 099 @SuppressWarnings("rawtypes") 100 public java.util.List dynamicQuery( 101 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 102 throws com.liferay.portal.kernel.exception.SystemException; 103 104 /** 105 * Performs a dynamic query on the database and returns a range of the matching rows. 106 * 107 * <p> 108 * 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. 109 * </p> 110 * 111 * @param dynamicQuery the dynamic query 112 * @param start the lower bound of the range of model instances 113 * @param end the upper bound of the range of model instances (not inclusive) 114 * @return the range of matching rows 115 * @throws SystemException if a system exception occurred 116 */ 117 @SuppressWarnings("rawtypes") 118 public java.util.List dynamicQuery( 119 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 120 int end) throws com.liferay.portal.kernel.exception.SystemException; 121 122 /** 123 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 124 * 125 * <p> 126 * 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. 127 * </p> 128 * 129 * @param dynamicQuery the dynamic query 130 * @param start the lower bound of the range of model instances 131 * @param end the upper bound of the range of model instances (not inclusive) 132 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 133 * @return the ordered range of matching rows 134 * @throws SystemException if a system exception occurred 135 */ 136 @SuppressWarnings("rawtypes") 137 public java.util.List dynamicQuery( 138 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 139 int end, 140 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 141 throws com.liferay.portal.kernel.exception.SystemException; 142 143 /** 144 * Returns the number of rows that match the dynamic query. 145 * 146 * @param dynamicQuery the dynamic query 147 * @return the number of rows that match the dynamic query 148 * @throws SystemException if a system exception occurred 149 */ 150 public long dynamicQueryCount( 151 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 152 throws com.liferay.portal.kernel.exception.SystemException; 153 154 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 155 public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId) 156 throws com.liferay.portal.kernel.exception.SystemException; 157 158 /** 159 * Returns the user group with the primary key. 160 * 161 * @param userGroupId the primary key of the user group 162 * @return the user group 163 * @throws PortalException if a user group with the primary key could not be found 164 * @throws SystemException if a system exception occurred 165 */ 166 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 167 public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId) 168 throws com.liferay.portal.kernel.exception.PortalException, 169 com.liferay.portal.kernel.exception.SystemException; 170 171 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 172 public com.liferay.portal.model.PersistedModel getPersistedModel( 173 java.io.Serializable primaryKeyObj) 174 throws com.liferay.portal.kernel.exception.PortalException, 175 com.liferay.portal.kernel.exception.SystemException; 176 177 /** 178 * Returns a range of all the user groups. 179 * 180 * <p> 181 * 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. 182 * </p> 183 * 184 * @param start the lower bound of the range of user groups 185 * @param end the upper bound of the range of user groups (not inclusive) 186 * @return the range of user groups 187 * @throws SystemException if a system exception occurred 188 */ 189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 190 public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 191 int start, int end) 192 throws com.liferay.portal.kernel.exception.SystemException; 193 194 /** 195 * Returns the number of user groups. 196 * 197 * @return the number of user groups 198 * @throws SystemException if a system exception occurred 199 */ 200 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 201 public int getUserGroupsCount() 202 throws com.liferay.portal.kernel.exception.SystemException; 203 204 /** 205 * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 206 * 207 * @param userGroup the user group 208 * @return the user group that was updated 209 * @throws SystemException if a system exception occurred 210 */ 211 public com.liferay.portal.model.UserGroup updateUserGroup( 212 com.liferay.portal.model.UserGroup userGroup) 213 throws com.liferay.portal.kernel.exception.SystemException; 214 215 /** 216 * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 217 * 218 * @param userGroup the user group 219 * @param merge whether to merge the user group with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 220 * @return the user group that was updated 221 * @throws SystemException if a system exception occurred 222 */ 223 public com.liferay.portal.model.UserGroup updateUserGroup( 224 com.liferay.portal.model.UserGroup userGroup, boolean merge) 225 throws com.liferay.portal.kernel.exception.SystemException; 226 227 /** 228 * Returns the Spring bean ID for this bean. 229 * 230 * @return the Spring bean ID for this bean 231 */ 232 public java.lang.String getBeanIdentifier(); 233 234 /** 235 * Sets the Spring bean ID for this bean. 236 * 237 * @param beanIdentifier the Spring bean ID for this bean 238 */ 239 public void setBeanIdentifier(java.lang.String beanIdentifier); 240 241 /** 242 * Adds the user groups to the group. 243 * 244 * @param groupId the primary key of the group 245 * @param userGroupIds the primary keys of the user groups 246 * @throws SystemException if a system exception occurred 247 */ 248 public void addGroupUserGroups(long groupId, long[] userGroupIds) 249 throws com.liferay.portal.kernel.exception.SystemException; 250 251 /** 252 * Adds the user groups to the team. 253 * 254 * @param teamId the primary key of the team 255 * @param userGroupIds the primary keys of the user groups 256 * @throws SystemException if a system exception occurred 257 */ 258 public void addTeamUserGroups(long teamId, long[] userGroupIds) 259 throws com.liferay.portal.kernel.exception.SystemException; 260 261 /** 262 * Adds a user group. 263 * 264 * <p> 265 * This method handles the creation and bookkeeping of the user group, 266 * including its resources, metadata, and internal data structures. It is 267 * not necessary to make subsequent calls to setup default groups and 268 * resources for the user group. 269 * </p> 270 * 271 * @param userId the primary key of the user 272 * @param companyId the primary key of the user group's company 273 * @param name the user group's name 274 * @param description the user group's description 275 * @return the user group 276 * @throws PortalException if the user group's information was invalid 277 * @throws SystemException if a system exception occurred 278 */ 279 public com.liferay.portal.model.UserGroup addUserGroup(long userId, 280 long companyId, java.lang.String name, java.lang.String description) 281 throws com.liferay.portal.kernel.exception.PortalException, 282 com.liferay.portal.kernel.exception.SystemException; 283 284 /** 285 * Clears all associations between the user and its user groups and clears 286 * the permissions cache. 287 * 288 * <p> 289 * This method is called from {@link #deleteUserGroup(UserGroup)}. 290 * </p> 291 * 292 * @param userId the primary key of the user 293 * @throws SystemException if a system exception occurred 294 */ 295 public void clearUserUserGroups(long userId) 296 throws com.liferay.portal.kernel.exception.SystemException; 297 298 /** 299 * Copies the user group's layouts to the users who are not already members 300 * of the user group. 301 * 302 * @param userGroupId the primary key of the user group 303 * @param userIds the primary keys of the users 304 * @throws PortalException if any one of the users could not be found or 305 if a portal exception occurred 306 * @throws SystemException if a system exception occurred 307 * @deprecated 308 */ 309 public void copyUserGroupLayouts(long userGroupId, long[] userIds) 310 throws com.liferay.portal.kernel.exception.PortalException, 311 com.liferay.portal.kernel.exception.SystemException; 312 313 /** 314 * Copies the user groups' layouts to the user. 315 * 316 * @param userGroupIds the primary keys of the user groups 317 * @param userId the primary key of the user 318 * @throws PortalException if a user with the primary key could not be 319 found or if a portal exception occurred 320 * @throws SystemException if a system exception occurred 321 * @deprecated 322 */ 323 public void copyUserGroupLayouts(long[] userGroupIds, long userId) 324 throws com.liferay.portal.kernel.exception.PortalException, 325 com.liferay.portal.kernel.exception.SystemException; 326 327 /** 328 * Copies the user group's layout to the user. 329 * 330 * @param userGroupId the primary key of the user group 331 * @param userId the primary key of the user 332 * @throws PortalException if a user with the primary key could not be 333 found or if a portal exception occurred 334 * @throws SystemException if a system exception occurred 335 * @deprecated 336 */ 337 public void copyUserGroupLayouts(long userGroupId, long userId) 338 throws com.liferay.portal.kernel.exception.PortalException, 339 com.liferay.portal.kernel.exception.SystemException; 340 341 /** 342 * Returns the user group with the name. 343 * 344 * @param companyId the primary key of the user group's company 345 * @param name the user group's name 346 * @return Returns the user group with the name 347 * @throws PortalException if a user group with the name could not be found 348 * @throws SystemException if a system exception occurred 349 */ 350 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 351 public com.liferay.portal.model.UserGroup getUserGroup(long companyId, 352 java.lang.String name) 353 throws com.liferay.portal.kernel.exception.PortalException, 354 com.liferay.portal.kernel.exception.SystemException; 355 356 /** 357 * Returns all the user groups belonging to the company. 358 * 359 * @param companyId the primary key of the user groups' company 360 * @return the user groups belonging to the company 361 * @throws SystemException if a system exception occurred 362 */ 363 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 364 public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 365 long companyId) 366 throws com.liferay.portal.kernel.exception.SystemException; 367 368 /** 369 * Returns all the user groups with the primary keys. 370 * 371 * @param userGroupIds the primary keys of the user groups 372 * @return the user groups with the primary keys 373 * @throws PortalException if any one of the user groups could not be found 374 * @throws SystemException if a system exception occurred 375 */ 376 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 377 public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 378 long[] userGroupIds) 379 throws com.liferay.portal.kernel.exception.PortalException, 380 com.liferay.portal.kernel.exception.SystemException; 381 382 /** 383 * Returns all the user groups to which the user belongs. 384 * 385 * @param userId the primary key of the user 386 * @return the user groups to which the user belongs 387 * @throws SystemException if a system exception occurred 388 */ 389 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 390 public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 391 long userId) throws com.liferay.portal.kernel.exception.SystemException; 392 393 /** 394 * Returns <code>true</code> if the user group is associated with the group. 395 * 396 * @param groupId the primary key of the group 397 * @param userGroupId the primary key of the user group 398 * @return <code>true</code> if the user group belongs to the group; 399 <code>false</code> otherwise 400 * @throws SystemException if a system exception occurred 401 */ 402 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 403 public boolean hasGroupUserGroup(long groupId, long userGroupId) 404 throws com.liferay.portal.kernel.exception.SystemException; 405 406 /** 407 * Returns <code>true</code> if the user group belongs to the team. 408 * 409 * @param teamId the primary key of the team 410 * @param userGroupId the primary key of the user group 411 * @return <code>true</code> if the user group belongs to the team; 412 <code>false</code> otherwise 413 * @throws SystemException if a system exception occurred 414 */ 415 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 416 public boolean hasTeamUserGroup(long teamId, long userGroupId) 417 throws com.liferay.portal.kernel.exception.SystemException; 418 419 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 420 public java.util.List<com.liferay.portal.model.UserGroup> search( 421 long companyId, java.lang.String keywords, 422 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 423 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 424 throws com.liferay.portal.kernel.exception.SystemException; 425 426 /** 427 * Returns an ordered range of all the user groups that match the name and 428 * description. 429 * 430 * <p> 431 * Useful when paginating results. Returns a maximum of <code>end - 432 * start</code> instances. <code>start</code> and <code>end</code> are not 433 * primary keys, they are indexes in the result set. Thus, <code>0</code> 434 * refers to the first result in the set. Setting both <code>start</code> 435 * and <code>end</code> to {@link 436 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 437 * result set. 438 * </p> 439 * 440 * @param companyId the primary key of the user group's company 441 * @param name the user group's name (optionally <code>null</code>) 442 * @param description the user group's description (optionally 443 <code>null</code>) 444 * @param params the finder params (optionally <code>null</code>). For more 445 information see {@link 446 com.liferay.portal.service.persistence.UserGroupFinder} 447 * @param start the lower bound of the range of user groups to return 448 * @param end the upper bound of the range of user groups to return (not 449 inclusive) 450 * @param obc the comparator to order the user groups (optionally 451 <code>null</code>) 452 * @return the matching user groups ordered by comparator <code>obc</code> 453 * @throws SystemException if a system exception occurred 454 * @see com.liferay.portal.service.persistence.UserGroupFinder 455 */ 456 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 457 public java.util.List<com.liferay.portal.model.UserGroup> search( 458 long companyId, java.lang.String name, java.lang.String description, 459 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 460 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 461 throws com.liferay.portal.kernel.exception.SystemException; 462 463 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 464 public int searchCount(long companyId, java.lang.String keywords, 465 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 466 throws com.liferay.portal.kernel.exception.SystemException; 467 468 /** 469 * Returns the number of user groups that match the name and description. 470 * 471 * @param companyId the primary key of the user group's company 472 * @param name the user group's name (optionally <code>null</code>) 473 * @param description the user group's description (optionally 474 <code>null</code>) 475 * @param params the finder params (optionally <code>null</code>). For more 476 information see {@link 477 com.liferay.portal.service.persistence.UserGroupFinder} 478 * @return the number of matching user groups 479 * @throws SystemException if a system exception occurred 480 * @see com.liferay.portal.service.persistence.UserGroupFinder 481 */ 482 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 483 public int searchCount(long companyId, java.lang.String name, 484 java.lang.String description, 485 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 486 throws com.liferay.portal.kernel.exception.SystemException; 487 488 /** 489 * Sets the user groups associated with the user copying the user group 490 * layouts and removing and adding user group associations for the user as 491 * necessary. 492 * 493 * @param userId the primary key of the user 494 * @param userGroupIds the primary keys of the user groups 495 * @throws PortalException if a portal exception occurred 496 * @throws SystemException if a system exception occurred 497 */ 498 public void setUserUserGroups(long userId, long[] userGroupIds) 499 throws com.liferay.portal.kernel.exception.PortalException, 500 com.liferay.portal.kernel.exception.SystemException; 501 502 /** 503 * Removes the user groups from the group. 504 * 505 * @param groupId the primary key of the group 506 * @param userGroupIds the primary keys of the user groups 507 * @throws SystemException if a system exception occurred 508 */ 509 public void unsetGroupUserGroups(long groupId, long[] userGroupIds) 510 throws com.liferay.portal.kernel.exception.SystemException; 511 512 /** 513 * Removes the user groups from the team. 514 * 515 * @param teamId the primary key of the team 516 * @param userGroupIds the primary keys of the user groups 517 * @throws SystemException if a system exception occurred 518 */ 519 public void unsetTeamUserGroups(long teamId, long[] userGroupIds) 520 throws com.liferay.portal.kernel.exception.SystemException; 521 522 /** 523 * Updates the user group. 524 * 525 * @param companyId the primary key of the user group's company 526 * @param userGroupId the primary key of the user group 527 * @param name the user group's name 528 * @param description the user group's description 529 * @return the user group 530 * @throws PortalException if a user group with the primary key could not be 531 found or if the new information was invalid 532 * @throws SystemException if a system exception occurred 533 */ 534 public com.liferay.portal.model.UserGroup updateUserGroup(long companyId, 535 long userGroupId, java.lang.String name, java.lang.String description) 536 throws com.liferay.portal.kernel.exception.PortalException, 537 com.liferay.portal.kernel.exception.SystemException; 538 }