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