001 /** 002 * Copyright (c) 2000-2013 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.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 * Provides the local service interface for Organization. Methods of this 025 * service will not have security checks based on the propagated JAAS 026 * credentials because this service can only be accessed from within the same 027 * VM. 028 * 029 * @author Brian Wing Shun Chan 030 * @see OrganizationLocalServiceUtil 031 * @see com.liferay.portal.service.base.OrganizationLocalServiceBaseImpl 032 * @see com.liferay.portal.service.impl.OrganizationLocalServiceImpl 033 * @generated 034 */ 035 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 036 PortalException.class, SystemException.class}) 037 public interface OrganizationLocalService extends BaseLocalService, 038 PersistedModelLocalService { 039 /* 040 * NOTE FOR DEVELOPERS: 041 * 042 * Never modify or reference this interface directly. Always use {@link OrganizationLocalServiceUtil} to access the organization local service. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 043 */ 044 045 /** 046 * Adds the organization to the database. Also notifies the appropriate model listeners. 047 * 048 * @param organization the organization 049 * @return the organization that was added 050 * @throws SystemException if a system exception occurred 051 */ 052 public com.liferay.portal.model.Organization addOrganization( 053 com.liferay.portal.model.Organization organization) 054 throws com.liferay.portal.kernel.exception.SystemException; 055 056 /** 057 * Creates a new organization with the primary key. Does not add the organization to the database. 058 * 059 * @param organizationId the primary key for the new organization 060 * @return the new organization 061 */ 062 public com.liferay.portal.model.Organization createOrganization( 063 long organizationId); 064 065 /** 066 * Deletes the organization with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param organizationId the primary key of the organization 069 * @return the organization that was removed 070 * @throws PortalException if a organization with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public com.liferay.portal.model.Organization deleteOrganization( 074 long organizationId) 075 throws com.liferay.portal.kernel.exception.PortalException, 076 com.liferay.portal.kernel.exception.SystemException; 077 078 /** 079 * Deletes the organization from the database. Also notifies the appropriate model listeners. 080 * 081 * @param organization the organization 082 * @return the organization that was removed 083 * @throws PortalException 084 * @throws SystemException if a system exception occurred 085 */ 086 public com.liferay.portal.model.Organization deleteOrganization( 087 com.liferay.portal.model.Organization organization) 088 throws com.liferay.portal.kernel.exception.PortalException, 089 com.liferay.portal.kernel.exception.SystemException; 090 091 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 092 093 /** 094 * Performs a dynamic query on the database and returns the matching rows. 095 * 096 * @param dynamicQuery the dynamic query 097 * @return the matching rows 098 * @throws SystemException if a system exception occurred 099 */ 100 @SuppressWarnings("rawtypes") 101 public java.util.List dynamicQuery( 102 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 103 throws com.liferay.portal.kernel.exception.SystemException; 104 105 /** 106 * Performs a dynamic query on the database and returns a range of the matching rows. 107 * 108 * <p> 109 * 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.OrganizationModelImpl}. 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. 110 * </p> 111 * 112 * @param dynamicQuery the dynamic query 113 * @param start the lower bound of the range of model instances 114 * @param end the upper bound of the range of model instances (not inclusive) 115 * @return the range of matching rows 116 * @throws SystemException if a system exception occurred 117 */ 118 @SuppressWarnings("rawtypes") 119 public java.util.List dynamicQuery( 120 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 121 int end) throws com.liferay.portal.kernel.exception.SystemException; 122 123 /** 124 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 125 * 126 * <p> 127 * 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.OrganizationModelImpl}. 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. 128 * </p> 129 * 130 * @param dynamicQuery the dynamic query 131 * @param start the lower bound of the range of model instances 132 * @param end the upper bound of the range of model instances (not inclusive) 133 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 134 * @return the ordered range of matching rows 135 * @throws SystemException if a system exception occurred 136 */ 137 @SuppressWarnings("rawtypes") 138 public java.util.List dynamicQuery( 139 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 140 int end, 141 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 142 throws com.liferay.portal.kernel.exception.SystemException; 143 144 /** 145 * Returns the number of rows that match the dynamic query. 146 * 147 * @param dynamicQuery the dynamic query 148 * @return the number of rows that match the dynamic query 149 * @throws SystemException if a system exception occurred 150 */ 151 public long dynamicQueryCount( 152 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 153 throws com.liferay.portal.kernel.exception.SystemException; 154 155 /** 156 * Returns the number of rows that match the dynamic query. 157 * 158 * @param dynamicQuery the dynamic query 159 * @param projection the projection to apply to the query 160 * @return the number of rows that match the dynamic query 161 * @throws SystemException if a system exception occurred 162 */ 163 public long dynamicQueryCount( 164 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 165 com.liferay.portal.kernel.dao.orm.Projection projection) 166 throws com.liferay.portal.kernel.exception.SystemException; 167 168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 169 public com.liferay.portal.model.Organization fetchOrganization( 170 long organizationId) 171 throws com.liferay.portal.kernel.exception.SystemException; 172 173 /** 174 * Returns the organization with the matching UUID and company. 175 * 176 * @param uuid the organization's UUID 177 * @param companyId the primary key of the company 178 * @return the matching organization, or <code>null</code> if a matching organization could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public com.liferay.portal.model.Organization fetchOrganizationByUuidAndCompanyId( 183 java.lang.String uuid, long companyId) 184 throws com.liferay.portal.kernel.exception.SystemException; 185 186 /** 187 * Returns the organization with the primary key. 188 * 189 * @param organizationId the primary key of the organization 190 * @return the organization 191 * @throws PortalException if a organization with the primary key could not be found 192 * @throws SystemException if a system exception occurred 193 */ 194 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 195 public com.liferay.portal.model.Organization getOrganization( 196 long organizationId) 197 throws com.liferay.portal.kernel.exception.PortalException, 198 com.liferay.portal.kernel.exception.SystemException; 199 200 @Override 201 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 202 public com.liferay.portal.model.PersistedModel getPersistedModel( 203 java.io.Serializable primaryKeyObj) 204 throws com.liferay.portal.kernel.exception.PortalException, 205 com.liferay.portal.kernel.exception.SystemException; 206 207 /** 208 * Returns the organization with the matching UUID and company. 209 * 210 * @param uuid the organization's UUID 211 * @param companyId the primary key of the company 212 * @return the matching organization 213 * @throws PortalException if a matching organization could not be found 214 * @throws SystemException if a system exception occurred 215 */ 216 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 217 public com.liferay.portal.model.Organization getOrganizationByUuidAndCompanyId( 218 java.lang.String uuid, long companyId) 219 throws com.liferay.portal.kernel.exception.PortalException, 220 com.liferay.portal.kernel.exception.SystemException; 221 222 /** 223 * Returns a range of all the organizations. 224 * 225 * <p> 226 * 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.OrganizationModelImpl}. 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. 227 * </p> 228 * 229 * @param start the lower bound of the range of organizations 230 * @param end the upper bound of the range of organizations (not inclusive) 231 * @return the range of organizations 232 * @throws SystemException if a system exception occurred 233 */ 234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 235 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 236 int start, int end) 237 throws com.liferay.portal.kernel.exception.SystemException; 238 239 /** 240 * Returns the number of organizations. 241 * 242 * @return the number of organizations 243 * @throws SystemException if a system exception occurred 244 */ 245 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 246 public int getOrganizationsCount() 247 throws com.liferay.portal.kernel.exception.SystemException; 248 249 /** 250 * Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 251 * 252 * @param organization the organization 253 * @return the organization that was updated 254 * @throws SystemException if a system exception occurred 255 */ 256 public com.liferay.portal.model.Organization updateOrganization( 257 com.liferay.portal.model.Organization organization) 258 throws com.liferay.portal.kernel.exception.SystemException; 259 260 /** 261 * @throws SystemException if a system exception occurred 262 */ 263 public void addGroupOrganization(long groupId, long organizationId) 264 throws com.liferay.portal.kernel.exception.SystemException; 265 266 /** 267 * @throws SystemException if a system exception occurred 268 */ 269 public void addGroupOrganization(long groupId, 270 com.liferay.portal.model.Organization organization) 271 throws com.liferay.portal.kernel.exception.SystemException; 272 273 /** 274 * @throws PortalException 275 * @throws SystemException if a system exception occurred 276 */ 277 public void addGroupOrganizations(long groupId, long[] organizationIds) 278 throws com.liferay.portal.kernel.exception.PortalException, 279 com.liferay.portal.kernel.exception.SystemException; 280 281 /** 282 * @throws PortalException 283 * @throws SystemException if a system exception occurred 284 */ 285 public void addGroupOrganizations(long groupId, 286 java.util.List<com.liferay.portal.model.Organization> Organizations) 287 throws com.liferay.portal.kernel.exception.PortalException, 288 com.liferay.portal.kernel.exception.SystemException; 289 290 /** 291 * @throws SystemException if a system exception occurred 292 */ 293 public void clearGroupOrganizations(long groupId) 294 throws com.liferay.portal.kernel.exception.SystemException; 295 296 /** 297 * @throws SystemException if a system exception occurred 298 */ 299 public void deleteGroupOrganization(long groupId, long organizationId) 300 throws com.liferay.portal.kernel.exception.SystemException; 301 302 /** 303 * @throws SystemException if a system exception occurred 304 */ 305 public void deleteGroupOrganization(long groupId, 306 com.liferay.portal.model.Organization organization) 307 throws com.liferay.portal.kernel.exception.SystemException; 308 309 /** 310 * @throws SystemException if a system exception occurred 311 */ 312 public void deleteGroupOrganizations(long groupId, long[] organizationIds) 313 throws com.liferay.portal.kernel.exception.SystemException; 314 315 /** 316 * @throws SystemException if a system exception occurred 317 */ 318 public void deleteGroupOrganizations(long groupId, 319 java.util.List<com.liferay.portal.model.Organization> Organizations) 320 throws com.liferay.portal.kernel.exception.SystemException; 321 322 /** 323 * @throws SystemException if a system exception occurred 324 */ 325 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 326 public java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 327 long groupId) 328 throws com.liferay.portal.kernel.exception.SystemException; 329 330 /** 331 * @throws SystemException if a system exception occurred 332 */ 333 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 334 public java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 335 long groupId, int start, int end) 336 throws com.liferay.portal.kernel.exception.SystemException; 337 338 /** 339 * @throws SystemException if a system exception occurred 340 */ 341 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 342 public java.util.List<com.liferay.portal.model.Organization> getGroupOrganizations( 343 long groupId, int start, int end, 344 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 345 throws com.liferay.portal.kernel.exception.SystemException; 346 347 /** 348 * @throws SystemException if a system exception occurred 349 */ 350 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 351 public int getGroupOrganizationsCount(long groupId) 352 throws com.liferay.portal.kernel.exception.SystemException; 353 354 /** 355 * @throws SystemException if a system exception occurred 356 */ 357 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 358 public boolean hasGroupOrganization(long groupId, long organizationId) 359 throws com.liferay.portal.kernel.exception.SystemException; 360 361 /** 362 * @throws SystemException if a system exception occurred 363 */ 364 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 365 public boolean hasGroupOrganizations(long groupId) 366 throws com.liferay.portal.kernel.exception.SystemException; 367 368 /** 369 * @throws PortalException 370 * @throws SystemException if a system exception occurred 371 */ 372 public void setGroupOrganizations(long groupId, long[] organizationIds) 373 throws com.liferay.portal.kernel.exception.PortalException, 374 com.liferay.portal.kernel.exception.SystemException; 375 376 /** 377 * @throws SystemException if a system exception occurred 378 */ 379 public void addUserOrganization(long userId, long organizationId) 380 throws com.liferay.portal.kernel.exception.SystemException; 381 382 /** 383 * @throws SystemException if a system exception occurred 384 */ 385 public void addUserOrganization(long userId, 386 com.liferay.portal.model.Organization organization) 387 throws com.liferay.portal.kernel.exception.SystemException; 388 389 /** 390 * @throws SystemException if a system exception occurred 391 */ 392 public void addUserOrganizations(long userId, long[] organizationIds) 393 throws com.liferay.portal.kernel.exception.SystemException; 394 395 /** 396 * @throws SystemException if a system exception occurred 397 */ 398 public void addUserOrganizations(long userId, 399 java.util.List<com.liferay.portal.model.Organization> Organizations) 400 throws com.liferay.portal.kernel.exception.SystemException; 401 402 /** 403 * @throws SystemException if a system exception occurred 404 */ 405 public void clearUserOrganizations(long userId) 406 throws com.liferay.portal.kernel.exception.SystemException; 407 408 /** 409 * @throws SystemException if a system exception occurred 410 */ 411 public void deleteUserOrganization(long userId, long organizationId) 412 throws com.liferay.portal.kernel.exception.SystemException; 413 414 /** 415 * @throws SystemException if a system exception occurred 416 */ 417 public void deleteUserOrganization(long userId, 418 com.liferay.portal.model.Organization organization) 419 throws com.liferay.portal.kernel.exception.SystemException; 420 421 /** 422 * @throws SystemException if a system exception occurred 423 */ 424 public void deleteUserOrganizations(long userId, long[] organizationIds) 425 throws com.liferay.portal.kernel.exception.SystemException; 426 427 /** 428 * @throws SystemException if a system exception occurred 429 */ 430 public void deleteUserOrganizations(long userId, 431 java.util.List<com.liferay.portal.model.Organization> Organizations) 432 throws com.liferay.portal.kernel.exception.SystemException; 433 434 /** 435 * @throws SystemException if a system exception occurred 436 */ 437 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 438 public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 439 long userId) throws com.liferay.portal.kernel.exception.SystemException; 440 441 /** 442 * @throws SystemException if a system exception occurred 443 */ 444 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 445 public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 446 long userId, int start, int end) 447 throws com.liferay.portal.kernel.exception.SystemException; 448 449 /** 450 * @throws SystemException if a system exception occurred 451 */ 452 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 453 public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 454 long userId, int start, int end, 455 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 456 throws com.liferay.portal.kernel.exception.SystemException; 457 458 /** 459 * @throws SystemException if a system exception occurred 460 */ 461 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 462 public int getUserOrganizationsCount(long userId) 463 throws com.liferay.portal.kernel.exception.SystemException; 464 465 /** 466 * @throws SystemException if a system exception occurred 467 */ 468 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 469 public boolean hasUserOrganization(long userId, long organizationId) 470 throws com.liferay.portal.kernel.exception.SystemException; 471 472 /** 473 * @throws SystemException if a system exception occurred 474 */ 475 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 476 public boolean hasUserOrganizations(long userId) 477 throws com.liferay.portal.kernel.exception.SystemException; 478 479 /** 480 * @throws SystemException if a system exception occurred 481 */ 482 public void setUserOrganizations(long userId, long[] organizationIds) 483 throws com.liferay.portal.kernel.exception.SystemException; 484 485 /** 486 * Returns the Spring bean ID for this bean. 487 * 488 * @return the Spring bean ID for this bean 489 */ 490 public java.lang.String getBeanIdentifier(); 491 492 /** 493 * Sets the Spring bean ID for this bean. 494 * 495 * @param beanIdentifier the Spring bean ID for this bean 496 */ 497 public void setBeanIdentifier(java.lang.String beanIdentifier); 498 499 /** 500 * Adds an organization. 501 * 502 * <p> 503 * This method handles the creation and bookkeeping of the organization 504 * including its resources, metadata, and internal data structures. It is 505 * not necessary to make a subsequent call to {@link 506 * #addOrganizationResources(long, Organization)}. 507 * </p> 508 * 509 * @param userId the primary key of the creator/owner of the organization 510 * @param parentOrganizationId the primary key of the organization's parent 511 organization 512 * @param name the organization's name 513 * @param site whether the organization is to be associated with a main 514 site 515 * @return the organization 516 * @throws PortalException if a creator or parent organization with the 517 primary key could not be found or if the organization's 518 information was invalid 519 * @throws SystemException if a system exception occurred 520 */ 521 public com.liferay.portal.model.Organization addOrganization(long userId, 522 long parentOrganizationId, java.lang.String name, boolean site) 523 throws com.liferay.portal.kernel.exception.PortalException, 524 com.liferay.portal.kernel.exception.SystemException; 525 526 /** 527 * Adds an organization. 528 * 529 * <p> 530 * This method handles the creation and bookkeeping of the organization 531 * including its resources, metadata, and internal data structures. It is 532 * not necessary to make a subsequent call to {@link 533 * #addOrganizationResources(long, Organization)}. 534 * </p> 535 * 536 * @param userId the primary key of the creator/owner of the 537 organization 538 * @param parentOrganizationId the primary key of the organization's 539 parent organization 540 * @param name the organization's name 541 * @param type the organization's type 542 * @param recursable whether the permissions of the organization are to 543 be inherited by its suborganizations 544 * @param regionId the primary key of the organization's region 545 * @param countryId the primary key of the organization's country 546 * @param statusId the organization's workflow status 547 * @param comments the comments about the organization 548 * @param site whether the organization is to be associated with a main 549 site 550 * @param serviceContext the service context to be applied (optionally 551 <code>null</code>). Can set asset category IDs, asset tag 552 names, and expando bridge attributes for the organization. 553 * @return the organization 554 * @throws PortalException if a creator or parent organization with the 555 primary key could not be found or if the organization's 556 information was invalid 557 * @throws SystemException if a system exception occurred 558 * @deprecated As of 6.2.0, replaced by {@link #addOrganization(long, long, 559 String, String, long, long, int, String, boolean, 560 ServiceContext)} 561 */ 562 public com.liferay.portal.model.Organization addOrganization(long userId, 563 long parentOrganizationId, java.lang.String name, 564 java.lang.String type, boolean recursable, long regionId, 565 long countryId, int statusId, java.lang.String comments, boolean site, 566 com.liferay.portal.service.ServiceContext serviceContext) 567 throws com.liferay.portal.kernel.exception.PortalException, 568 com.liferay.portal.kernel.exception.SystemException; 569 570 /** 571 * Adds an organization. 572 * 573 * <p> 574 * This method handles the creation and bookkeeping of the organization 575 * including its resources, metadata, and internal data structures. It is 576 * not necessary to make a subsequent call to {@link 577 * #addOrganizationResources(long, Organization)}. 578 * </p> 579 * 580 * @param userId the primary key of the creator/owner of the organization 581 * @param parentOrganizationId the primary key of the organization's parent 582 organization 583 * @param name the organization's name 584 * @param type the organization's type 585 * @param regionId the primary key of the organization's region 586 * @param countryId the primary key of the organization's country 587 * @param statusId the organization's workflow status 588 * @param comments the comments about the organization 589 * @param site whether the organization is to be associated with a main 590 site 591 * @param serviceContext the service context to be applied (optionally 592 <code>null</code>). Can set asset category IDs, asset tag names, 593 and expando bridge attributes for the organization. 594 * @return the organization 595 * @throws PortalException if a creator or parent organization with the 596 primary key could not be found or if the organization's 597 information was invalid 598 * @throws SystemException if a system exception occurred 599 */ 600 public com.liferay.portal.model.Organization addOrganization(long userId, 601 long parentOrganizationId, java.lang.String name, 602 java.lang.String type, long regionId, long countryId, int statusId, 603 java.lang.String comments, boolean site, 604 com.liferay.portal.service.ServiceContext serviceContext) 605 throws com.liferay.portal.kernel.exception.PortalException, 606 com.liferay.portal.kernel.exception.SystemException; 607 608 /** 609 * Adds a resource for each type of permission available on the 610 * organization. 611 * 612 * @param userId the primary key of the creator/owner of the organization 613 * @param organization the organization 614 * @throws PortalException if a portal exception occurred 615 * @throws SystemException if a system exception occurred 616 */ 617 public void addOrganizationResources(long userId, 618 com.liferay.portal.model.Organization organization) 619 throws com.liferay.portal.kernel.exception.PortalException, 620 com.liferay.portal.kernel.exception.SystemException; 621 622 /** 623 * Assigns the password policy to the organizations, removing any other 624 * currently assigned password policies. 625 * 626 * @param passwordPolicyId the primary key of the password policy 627 * @param organizationIds the primary keys of the organizations 628 * @throws SystemException if a system exception occurred 629 */ 630 public void addPasswordPolicyOrganizations(long passwordPolicyId, 631 long[] organizationIds) 632 throws com.liferay.portal.kernel.exception.SystemException; 633 634 /** 635 * Deletes the logo of the organization. 636 * 637 * @param organizationId the primary key of the organization 638 * @throws PortalException if an organization or parent organization with 639 the primary key could not be found or if the organization's logo 640 could not be found 641 * @throws SystemException if a system exception occurred 642 */ 643 public void deleteLogo(long organizationId) 644 throws com.liferay.portal.kernel.exception.PortalException, 645 com.liferay.portal.kernel.exception.SystemException; 646 647 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 648 public com.liferay.portal.model.Organization fetchOrganization( 649 long companyId, java.lang.String name) 650 throws com.liferay.portal.kernel.exception.SystemException; 651 652 /** 653 * Returns the organization with the name. 654 * 655 * @param companyId the primary key of the organization's company 656 * @param name the organization's name 657 * @return the organization with the name 658 * @throws PortalException if the organization with the name could not be 659 found 660 * @throws SystemException if a system exception occurred 661 */ 662 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 663 public com.liferay.portal.model.Organization getOrganization( 664 long companyId, java.lang.String name) 665 throws com.liferay.portal.kernel.exception.PortalException, 666 com.liferay.portal.kernel.exception.SystemException; 667 668 /** 669 * Returns the primary key of the organization with the name. 670 * 671 * @param companyId the primary key of the organization's company 672 * @param name the organization's name 673 * @return the primary key of the organization with the name, or 674 <code>0</code> if the organization could not be found 675 * @throws SystemException if a system exception occurred 676 */ 677 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 678 public long getOrganizationId(long companyId, java.lang.String name) 679 throws com.liferay.portal.kernel.exception.SystemException; 680 681 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 682 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 683 long userId, int start, int end, 684 com.liferay.portal.kernel.util.OrderByComparator obc) 685 throws com.liferay.portal.kernel.exception.PortalException, 686 com.liferay.portal.kernel.exception.SystemException; 687 688 /** 689 * Returns all the organizations belonging to the parent organization. 690 * 691 * @param companyId the primary key of the organization's company 692 * @param parentOrganizationId the primary key of the organization's parent 693 organization 694 * @return the organizations belonging to the parent organization 695 * @throws SystemException if a system exception occurred 696 */ 697 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 698 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 699 long companyId, long parentOrganizationId) 700 throws com.liferay.portal.kernel.exception.SystemException; 701 702 /** 703 * Returns a range of all the organizations belonging to the parent 704 * organization. 705 * 706 * <p> 707 * Useful when paginating results. Returns a maximum of <code>end - 708 * start</code> instances. <code>start</code> and <code>end</code> are not 709 * primary keys, they are indexes in the result set. Thus, <code>0</code> 710 * refers to the first result in the set. Setting both <code>start</code> 711 * and <code>end</code> to {@link 712 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 713 * result set. 714 * </p> 715 * 716 * @param companyId the primary key of the organization's company 717 * @param parentOrganizationId the primary key of the organization's parent 718 organization 719 * @param start the lower bound of the range of organizations to return 720 * @param end the upper bound of the range of organizations to return (not 721 inclusive) 722 * @return the range of organizations belonging to the parent organization 723 * @throws SystemException if a system exception occurred 724 * @see com.liferay.portal.service.persistence.OrganizationPersistence#findByC_P( 725 long, long, int, int) 726 */ 727 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 728 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 729 long companyId, long parentOrganizationId, int start, int end) 730 throws com.liferay.portal.kernel.exception.SystemException; 731 732 /** 733 * Returns the organizations with the primary keys. 734 * 735 * @param organizationIds the primary keys of the organizations 736 * @return the organizations with the primary keys 737 * @throws PortalException if any one of the organizations could not be 738 found 739 * @throws SystemException if a system exception occurred 740 */ 741 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 742 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 743 long[] organizationIds) 744 throws com.liferay.portal.kernel.exception.PortalException, 745 com.liferay.portal.kernel.exception.SystemException; 746 747 /** 748 * Returns the number of organizations belonging to the parent organization. 749 * 750 * @param companyId the primary key of the organization's company 751 * @param parentOrganizationId the primary key of the organization's parent 752 organization 753 * @return the number of organizations belonging to the parent organization 754 * @throws SystemException if a system exception occurred 755 */ 756 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 757 public int getOrganizationsCount(long companyId, long parentOrganizationId) 758 throws com.liferay.portal.kernel.exception.SystemException; 759 760 /** 761 * Returns the parent organizations in order by closest ancestor. The list 762 * starts with the organization itself. 763 * 764 * @param organizationId the primary key of the organization 765 * @return the parent organizations in order by closest ancestor 766 * @throws PortalException if an organization with the primary key could not 767 be found 768 * @throws SystemException if a system exception occurred 769 */ 770 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 771 public java.util.List<com.liferay.portal.model.Organization> getParentOrganizations( 772 long organizationId) 773 throws com.liferay.portal.kernel.exception.PortalException, 774 com.liferay.portal.kernel.exception.SystemException; 775 776 /** 777 * Returns the suborganizations of the organizations. 778 * 779 * @param organizations the organizations from which to get 780 suborganizations 781 * @return the suborganizations of the organizations 782 * @throws SystemException if a system exception occurred 783 */ 784 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 785 public java.util.List<com.liferay.portal.model.Organization> getSuborganizations( 786 java.util.List<com.liferay.portal.model.Organization> organizations) 787 throws com.liferay.portal.kernel.exception.SystemException; 788 789 /** 790 * Returns the suborganizations of the organization. 791 * 792 * @param companyId the primary key of the organization's company 793 * @param organizationId the primary key of the organization 794 * @return the suborganizations of the organization 795 * @throws SystemException if a system exception occurred 796 */ 797 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 798 public java.util.List<com.liferay.portal.model.Organization> getSuborganizations( 799 long companyId, long organizationId) 800 throws com.liferay.portal.kernel.exception.SystemException; 801 802 /** 803 * Returns the count of suborganizations of the organization. 804 * 805 * @param companyId the primary key of the organization's company 806 * @param organizationId the primary key of the organization 807 * @return the count of suborganizations of the organization 808 * @throws SystemException if a system exception occurred 809 */ 810 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 811 public int getSuborganizationsCount(long companyId, long organizationId) 812 throws com.liferay.portal.kernel.exception.SystemException; 813 814 /** 815 * Returns the intersection of <code>allOrganizations</code> and 816 * <code>availableOrganizations</code>. 817 * 818 * @param allOrganizations the organizations to check for availability 819 * @param availableOrganizations the available organizations 820 * @return the intersection of <code>allOrganizations</code> and 821 <code>availableOrganizations</code> 822 */ 823 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 824 public java.util.List<com.liferay.portal.model.Organization> getSubsetOrganizations( 825 java.util.List<com.liferay.portal.model.Organization> allOrganizations, 826 java.util.List<com.liferay.portal.model.Organization> availableOrganizations); 827 828 /** 829 * Returns all the organizations associated with the user. If 830 * includeAdministrative is <code>true</code>, the result includes those 831 * organizations that are not directly associated to the user but he is an 832 * administrator or an owner of the organization. 833 * 834 * @param userId the primary key of the user 835 * @param includeAdministrative whether to includes organizations that are 836 indirectly associated to the user because he is an administrator 837 or an owner of the organization 838 * @return the organizations associated with the user 839 * @throws PortalException if a user with the primary key could not be found 840 * @throws SystemException if a system exception occurred 841 */ 842 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 843 public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 844 long userId, boolean includeAdministrative) 845 throws com.liferay.portal.kernel.exception.PortalException, 846 com.liferay.portal.kernel.exception.SystemException; 847 848 /** 849 * Returns <code>true</code> if the password policy has been assigned to the 850 * organization. 851 * 852 * @param passwordPolicyId the primary key of the password policy 853 * @param organizationId the primary key of the organization 854 * @return <code>true</code> if the password policy has been assigned to the 855 organization; <code>false</code> otherwise 856 * @throws SystemException if a system exception occurred 857 */ 858 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 859 public boolean hasPasswordPolicyOrganization(long passwordPolicyId, 860 long organizationId) 861 throws com.liferay.portal.kernel.exception.SystemException; 862 863 /** 864 * Returns <code>true</code> if the user is a member of the organization, 865 * optionally focusing on suborganizations or the specified organization. 866 * This method is usually called to determine if the user has view access to 867 * a resource belonging to the organization. 868 * 869 * <ol> 870 * <li> 871 * If <code>inheritSuborganizations=<code>false</code></code>: 872 * the method checks whether the user belongs to the organization specified 873 * by <code>organizationId</code>. The parameter 874 * <code>includeSpecifiedOrganization</code> is ignored. 875 * </li> 876 * <li> 877 * The parameter <code>includeSpecifiedOrganization</code> is 878 * ignored unless <code>inheritSuborganizations</code> is also 879 * <code>true</code>. 880 * </li> 881 * <li> 882 * If <code>inheritSuborganizations=<code>true</code></code> and 883 * <code>includeSpecifiedOrganization=<code>false</code></code>: the method 884 * checks 885 * whether the user belongs to one of the child organizations of the one 886 * specified by <code>organizationId</code>. 887 * </li> 888 * <li> 889 * If <code>inheritSuborganizations=<code>true</code></code> and 890 * <code>includeSpecifiedOrganization=<code>true</code></code>: the method 891 * checks whether 892 * the user belongs to the organization specified by 893 * <code>organizationId</code> or any of 894 * its child organizations. 895 * </li> 896 * </ol> 897 * 898 * @param userId the primary key of the organization's user 899 * @param organizationId the primary key of the organization 900 * @param inheritSuborganizations if <code>true</code> suborganizations are 901 considered in the determination 902 * @param includeSpecifiedOrganization if <code>true</code> the 903 organization specified by <code>organizationId</code> is 904 considered in the determination 905 * @return <code>true</code> if the user has access to the organization; 906 <code>false</code> otherwise 907 * @throws PortalException if an organization with the primary key could not 908 be found 909 * @throws SystemException if a system exception occurred 910 * @see com.liferay.portal.service.persistence.OrganizationFinder 911 */ 912 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 913 public boolean hasUserOrganization(long userId, long organizationId, 914 boolean inheritSuborganizations, boolean includeSpecifiedOrganization) 915 throws com.liferay.portal.kernel.exception.PortalException, 916 com.liferay.portal.kernel.exception.SystemException; 917 918 /** 919 * Rebuilds the organizations tree. 920 * 921 * <p> 922 * Only call this method if the tree has become stale through operations 923 * other than normal CRUD. Under normal circumstances the tree is 924 * automatically rebuilt whenever necessary. 925 * </p> 926 * 927 * @param companyId the primary key of the organization's company 928 * @throws PortalException if an organization with the primary key could not 929 be found 930 * @throws SystemException if a system exception occurred 931 */ 932 public void rebuildTree(long companyId) 933 throws com.liferay.portal.kernel.exception.PortalException, 934 com.liferay.portal.kernel.exception.SystemException; 935 936 /** 937 * Returns a range of all the organizations of the company. 938 * 939 * <p> 940 * Useful when paginating results. Returns a maximum of <code>end - 941 * start</code> instances. <code>start</code> and <code>end</code> are not 942 * primary keys, they are indexes in the result set. Thus, <code>0</code> 943 * refers to the first result in the set. Setting both <code>start</code> 944 * and <code>end</code> to {@link 945 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 946 * result set. 947 * </p> 948 * 949 * @param companyId the primary key of the company 950 * @param params the finder parameters (optionally <code>null</code>). For 951 more information see {@link 952 com.liferay.portlet.usersadmin.util.OrganizationIndexer} 953 * @param start the lower bound of the range of organizations to return 954 * @param end the upper bound of the range of organizations to return (not 955 inclusive) 956 * @return the range of all the organizations of the company 957 * @throws SystemException if a system exception occurred 958 */ 959 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 960 public java.util.List<com.liferay.portal.model.Organization> search( 961 long companyId, 962 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 963 int start, int end) 964 throws com.liferay.portal.kernel.exception.SystemException; 965 966 /** 967 * Returns an ordered range of all the organizations that match the 968 * keywords, using the indexer. It is preferable to use this method instead 969 * of the non-indexed version whenever possible for performance reasons. 970 * 971 * <p> 972 * Useful when paginating results. Returns a maximum of <code>end - 973 * start</code> instances. <code>start</code> and <code>end</code> are not 974 * primary keys, they are indexes in the result set. Thus, <code>0</code> 975 * refers to the first result in the set. Setting both <code>start</code> 976 * and <code>end</code> to {@link 977 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 978 * result set. 979 * </p> 980 * 981 * @param companyId the primary key of the organization's company 982 * @param parentOrganizationId the primary key of the organization's parent 983 organization 984 * @param keywords the keywords (space separated), which may occur in the 985 organization's name, street, city, zipcode, type, region or 986 country (optionally <code>null</code>) 987 * @param params the finder parameters (optionally <code>null</code>). For 988 more information see {@link 989 com.liferay.portlet.usersadmin.util.OrganizationIndexer} 990 * @param start the lower bound of the range of organizations to return 991 * @param end the upper bound of the range of organizations to return (not 992 inclusive) 993 * @param sort the field and direction by which to sort (optionally 994 <code>null</code>) 995 * @return the matching organizations ordered by name 996 * @throws SystemException if a system exception occurred 997 * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer 998 */ 999 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1000 public com.liferay.portal.kernel.search.Hits search(long companyId, 1001 long parentOrganizationId, java.lang.String keywords, 1002 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1003 int start, int end, com.liferay.portal.kernel.search.Sort sort) 1004 throws com.liferay.portal.kernel.exception.SystemException; 1005 1006 /** 1007 * Returns a name ordered range of all the organizations that match the 1008 * keywords, type, region, and country, without using the indexer. It is 1009 * preferable to use the indexed version {@link #search(long, long, String, 1010 * LinkedHashMap, int, int, Sort)} instead of this method wherever possible 1011 * for performance reasons. 1012 * 1013 * <p> 1014 * Useful when paginating results. Returns a maximum of <code>end - 1015 * start</code> instances. <code>start</code> and <code>end</code> are not 1016 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1017 * refers to the first result in the set. Setting both <code>start</code> 1018 * and <code>end</code> to {@link 1019 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1020 * result set. 1021 * </p> 1022 * 1023 * @param companyId the primary key of the organization's company 1024 * @param parentOrganizationId the primary key of the organization's parent 1025 organization 1026 * @param keywords the keywords (space separated), which may occur in the 1027 organization's name, street, city, or zipcode (optionally 1028 <code>null</code>) 1029 * @param type the organization's type (optionally <code>null</code>) 1030 * @param regionId the primary key of the organization's region (optionally 1031 <code>null</code>) 1032 * @param countryId the primary key of the organization's country 1033 (optionally <code>null</code>) 1034 * @param params the finder params. For more information see {@link 1035 com.liferay.portal.service.persistence.OrganizationFinder} 1036 * @param start the lower bound of the range of organizations to return 1037 * @param end the upper bound of the range of organizations to return (not 1038 inclusive) 1039 * @return the matching organizations ordered by name 1040 * @throws SystemException if a system exception occurred 1041 * @see com.liferay.portal.service.persistence.OrganizationFinder 1042 */ 1043 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1044 public java.util.List<com.liferay.portal.model.Organization> search( 1045 long companyId, long parentOrganizationId, java.lang.String keywords, 1046 java.lang.String type, java.lang.Long regionId, 1047 java.lang.Long countryId, 1048 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1049 int start, int end) 1050 throws com.liferay.portal.kernel.exception.SystemException; 1051 1052 /** 1053 * Returns an ordered range of all the organizations that match the 1054 * keywords, type, region, and country, without using the indexer. It is 1055 * preferable to use the indexed version {@link #search(long, long, String, 1056 * String, String, String, String, String, String, LinkedHashMap, boolean, 1057 * int, int, Sort)} instead of this method wherever possible for performance 1058 * reasons. 1059 * 1060 * <p> 1061 * Useful when paginating results. Returns a maximum of <code>end - 1062 * start</code> instances. <code>start</code> and <code>end</code> are not 1063 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1064 * refers to the first result in the set. Setting both <code>start</code> 1065 * and <code>end</code> to {@link 1066 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1067 * result set. 1068 * </p> 1069 * 1070 * @param companyId the primary key of the organization's company 1071 * @param parentOrganizationId the primary key of the organization's parent 1072 organization 1073 * @param keywords the keywords (space separated), which may occur in the 1074 organization's name, street, city, or zipcode (optionally 1075 <code>null</code>) 1076 * @param type the organization's type (optionally <code>null</code>) 1077 * @param regionId the primary key of the organization's region (optionally 1078 <code>null</code>) 1079 * @param countryId the primary key of the organization's country 1080 (optionally <code>null</code>) 1081 * @param params the finder params. For more information see {@link 1082 com.liferay.portal.service.persistence.OrganizationFinder} 1083 * @param start the lower bound of the range of organizations to return 1084 * @param end the upper bound of the range of organizations to return (not 1085 inclusive) 1086 * @param obc the comparator to order the organizations (optionally 1087 <code>null</code>) 1088 * @return the matching organizations ordered by comparator <code>obc</code> 1089 * @throws SystemException if a system exception occurred 1090 * @see com.liferay.portal.service.persistence.OrganizationFinder 1091 */ 1092 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1093 public java.util.List<com.liferay.portal.model.Organization> search( 1094 long companyId, long parentOrganizationId, java.lang.String keywords, 1095 java.lang.String type, java.lang.Long regionId, 1096 java.lang.Long countryId, 1097 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1098 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1099 throws com.liferay.portal.kernel.exception.SystemException; 1100 1101 /** 1102 * Returns a name ordered range of all the organizations with the type, 1103 * region, and country, and whose name, street, city, and zipcode match the 1104 * keywords specified for them, without using the indexer. It is preferable 1105 * to use the indexed version {@link #search(long, long, String, String, 1106 * String, String, String, String, String, LinkedHashMap, boolean, int, int, 1107 * Sort)} instead of this method wherever possible for performance reasons. 1108 * 1109 * <p> 1110 * Useful when paginating results. Returns a maximum of <code>end - 1111 * start</code> instances. <code>start</code> and <code>end</code> are not 1112 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1113 * refers to the first result in the set. Setting both <code>start</code> 1114 * and <code>end</code> to {@link 1115 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1116 * result set. 1117 * </p> 1118 * 1119 * @param companyId the primary key of the organization's company 1120 * @param parentOrganizationId the primary key of the organization's parent 1121 * @param name the name keywords (space separated, optionally 1122 <code>null</code>) 1123 * @param type the organization's type (optionally <code>null</code>) 1124 * @param street the street keywords (optionally <code>null</code>) 1125 * @param city the city keywords (optionally <code>null</code>) 1126 * @param zip the zipcode keywords (optionally <code>null</code>) 1127 * @param regionId the primary key of the organization's region (optionally 1128 <code>null</code>) 1129 * @param countryId the primary key of the organization's country 1130 (optionally <code>null</code>) 1131 * @param params the finder parameters (optionally <code>null</code>). For 1132 more information see {@link 1133 com.liferay.portal.service.persistence.OrganizationFinder} 1134 * @param andOperator whether every field must match its keywords, or just 1135 one field. For example, "organizations with the name 1136 'Employees' and city 'Chicago'" vs "organizations with 1137 the name 'Employees' or the city 'Chicago'". 1138 * @param start the lower bound of the range of organizations to return 1139 * @param end the upper bound of the range of organizations to return (not 1140 inclusive) 1141 * @return the matching organizations ordered by name 1142 * @throws SystemException if a system exception occurred 1143 * @see com.liferay.portal.service.persistence.OrganizationFinder 1144 */ 1145 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1146 public java.util.List<com.liferay.portal.model.Organization> search( 1147 long companyId, long parentOrganizationId, java.lang.String name, 1148 java.lang.String type, java.lang.String street, java.lang.String city, 1149 java.lang.String zip, java.lang.Long regionId, 1150 java.lang.Long countryId, 1151 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1152 boolean andOperator, int start, int end) 1153 throws com.liferay.portal.kernel.exception.SystemException; 1154 1155 /** 1156 * Returns an ordered range of all the organizations with the type, region, 1157 * and country, and whose name, street, city, and zipcode match the keywords 1158 * specified for them, without using the indexer. It is preferable to use 1159 * the indexed version {@link #search(long, long, String, String, String, 1160 * String, String, String, String, LinkedHashMap, boolean, int, int, Sort)} 1161 * instead of this method wherever possible for performance reasons. 1162 * 1163 * <p> 1164 * Useful when paginating results. Returns a maximum of <code>end - 1165 * start</code> instances. <code>start</code> and <code>end</code> are not 1166 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1167 * refers to the first result in the set. Setting both <code>start</code> 1168 * and <code>end</code> to {@link 1169 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1170 * result set. 1171 * </p> 1172 * 1173 * @param companyId the primary key of the organization's company 1174 * @param parentOrganizationId the primary key of the organization's parent 1175 organization 1176 * @param name the name keywords (space separated, optionally 1177 <code>null</code>) 1178 * @param type the organization's type (optionally <code>null</code>) 1179 * @param street the street keywords (optionally <code>null</code>) 1180 * @param city the city keywords (optionally <code>null</code>) 1181 * @param zip the zipcode keywords (optionally <code>null</code>) 1182 * @param regionId the primary key of the organization's region (optionally 1183 <code>null</code>) 1184 * @param countryId the primary key of the organization's country 1185 (optionally <code>null</code>) 1186 * @param params the finder parameters (optionally <code>null</code>). For 1187 more information see {@link 1188 com.liferay.portal.service.persistence.OrganizationFinder} 1189 * @param andOperator whether every field must match its keywords, or just 1190 one field. For example, "organizations with the name 1191 'Employees' and city 'Chicago'" vs "organizations with 1192 the name 'Employees' or the city 'Chicago'". 1193 * @param start the lower bound of the range of organizations to return 1194 * @param end the upper bound of the range of organizations to return (not 1195 inclusive) 1196 * @param obc the comparator to order the organizations (optionally 1197 <code>null</code>) 1198 * @return the matching organizations ordered by comparator <code>obc</code> 1199 * @throws SystemException if a system exception occurred 1200 * @see com.liferay.portal.service.persistence.OrganizationFinder 1201 */ 1202 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1203 public java.util.List<com.liferay.portal.model.Organization> search( 1204 long companyId, long parentOrganizationId, java.lang.String name, 1205 java.lang.String type, java.lang.String street, java.lang.String city, 1206 java.lang.String zip, java.lang.Long regionId, 1207 java.lang.Long countryId, 1208 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1209 boolean andOperator, int start, int end, 1210 com.liferay.portal.kernel.util.OrderByComparator obc) 1211 throws com.liferay.portal.kernel.exception.SystemException; 1212 1213 /** 1214 * Returns an ordered range of all the organizations whose name, type, or 1215 * location fields match the keywords specified for them, using the indexer. 1216 * It is preferable to use this method instead of the non-indexed version 1217 * whenever possible for performance reasons. 1218 * 1219 * <p> 1220 * Useful when paginating results. Returns a maximum of <code>end - 1221 * start</code> instances. <code>start</code> and <code>end</code> are not 1222 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1223 * refers to the first result in the set. Setting both <code>start</code> 1224 * and <code>end</code> to {@link 1225 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1226 * result set. 1227 * </p> 1228 * 1229 * @param companyId the primary key of the organization's company 1230 * @param parentOrganizationId the primary key of the organization's parent 1231 organization 1232 * @param name the name keywords (space separated, optionally 1233 <code>null</code>) 1234 * @param type the type keywords (optionally <code>null</code>) 1235 * @param street the street keywords (optionally <code>null</code>) 1236 * @param city the city keywords (optionally <code>null</code>) 1237 * @param zip the zipcode keywords (optionally <code>null</code>) 1238 * @param region the region keywords (optionally <code>null</code>) 1239 * @param country the country keywords (optionally <code>null</code>) 1240 * @param params the finder parameters (optionally <code>null</code>). For 1241 more information see {@link 1242 com.liferay.portlet.usersadmin.util.OrganizationIndexer}. 1243 * @param andSearch whether every field must match its keywords or just one 1244 field 1245 * @param start the lower bound of the range of organizations to return 1246 * @param end the upper bound of the range of organizations to return (not 1247 inclusive) 1248 * @param sort the field and direction by which to sort (optionally 1249 <code>null</code>) 1250 * @return the matching organizations ordered by <code>sort</code> 1251 * @throws SystemException if a system exception occurred 1252 * @see com.liferay.portlet.usersadmin.util.OrganizationIndexer 1253 */ 1254 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1255 public com.liferay.portal.kernel.search.Hits search(long companyId, 1256 long parentOrganizationId, java.lang.String name, 1257 java.lang.String type, java.lang.String street, java.lang.String city, 1258 java.lang.String zip, java.lang.String region, 1259 java.lang.String country, 1260 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1261 boolean andSearch, int start, int end, 1262 com.liferay.portal.kernel.search.Sort sort) 1263 throws com.liferay.portal.kernel.exception.SystemException; 1264 1265 /** 1266 * Returns the number of organizations that match the keywords, type, 1267 * region, and country. 1268 * 1269 * @param companyId the primary key of the organization's company 1270 * @param parentOrganizationId the primary key of the organization's parent 1271 organization 1272 * @param keywords the keywords (space separated), which may occur in the 1273 organization's name, street, city, or zipcode (optionally 1274 <code>null</code>) 1275 * @param type the organization's type (optionally <code>null</code>) 1276 * @param regionId the primary key of the organization's region (optionally 1277 <code>null</code>) 1278 * @param countryId the primary key of the organization's country 1279 (optionally <code>null</code>) 1280 * @param params the finder parameters (optionally <code>null</code>). For 1281 more information see {@link 1282 com.liferay.portal.service.persistence.OrganizationFinder} 1283 * @return the number of matching organizations 1284 * @throws SystemException if a system exception occurred 1285 * @see com.liferay.portal.service.persistence.OrganizationFinder 1286 */ 1287 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1288 public int searchCount(long companyId, long parentOrganizationId, 1289 java.lang.String keywords, java.lang.String type, 1290 java.lang.Long regionId, java.lang.Long countryId, 1291 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1292 throws com.liferay.portal.kernel.exception.SystemException; 1293 1294 /** 1295 * Returns the number of organizations with the type, region, and country, 1296 * and whose name, street, city, and zipcode match the keywords specified 1297 * for them. 1298 * 1299 * @param companyId the primary key of the organization's company 1300 * @param parentOrganizationId the primary key of the organization's parent 1301 organization 1302 * @param name the name keywords (space separated, optionally 1303 <code>null</code>) 1304 * @param type the organization's type (optionally <code>null</code>) 1305 * @param street the street keywords (optionally <code>null</code>) 1306 * @param city the city keywords (optionally <code>null</code>) 1307 * @param zip the zipcode keywords (optionally <code>null</code>) 1308 * @param regionId the primary key of the organization's region (optionally 1309 <code>null</code>) 1310 * @param countryId the primary key of the organization's country 1311 (optionally <code>null</code>) 1312 * @param params the finder parameters (optionally <code>null</code>). For 1313 more information see {@link 1314 com.liferay.portal.service.persistence.OrganizationFinder} 1315 * @param andOperator whether every field must match its keywords, or just 1316 one field. For example, "organizations with the name 1317 'Employees' and city 'Chicago'" vs "organizations with 1318 the name 'Employees' or the city 'Chicago'". 1319 * @return the number of matching organizations 1320 * @throws SystemException if a system exception occurred 1321 * @see com.liferay.portal.service.persistence.OrganizationFinder 1322 */ 1323 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1324 public int searchCount(long companyId, long parentOrganizationId, 1325 java.lang.String name, java.lang.String type, java.lang.String street, 1326 java.lang.String city, java.lang.String zip, java.lang.Long regionId, 1327 java.lang.Long countryId, 1328 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1329 boolean andOperator) 1330 throws com.liferay.portal.kernel.exception.SystemException; 1331 1332 /** 1333 * Removes the organizations from the group. 1334 * 1335 * @param groupId the primary key of the group 1336 * @param organizationIds the primary keys of the organizations 1337 * @throws PortalException if a portal exception occurred 1338 * @throws SystemException if a system exception occurred 1339 */ 1340 public void unsetGroupOrganizations(long groupId, long[] organizationIds) 1341 throws com.liferay.portal.kernel.exception.PortalException, 1342 com.liferay.portal.kernel.exception.SystemException; 1343 1344 /** 1345 * Removes the organizations from the password policy. 1346 * 1347 * @param passwordPolicyId the primary key of the password policy 1348 * @param organizationIds the primary keys of the organizations 1349 * @throws SystemException if a system exception occurred 1350 */ 1351 public void unsetPasswordPolicyOrganizations(long passwordPolicyId, 1352 long[] organizationIds) 1353 throws com.liferay.portal.kernel.exception.SystemException; 1354 1355 /** 1356 * Updates the organization's asset with the new asset categories and tag 1357 * names, removing and adding asset categories and tag names as necessary. 1358 * 1359 * @param userId the primary key of the user 1360 * @param organization the organization 1361 * @param assetCategoryIds the primary keys of the asset categories 1362 * @param assetTagNames the asset tag names 1363 * @throws PortalException if a user with the primary key could not be found 1364 * @throws SystemException if a system exception occurred 1365 */ 1366 public void updateAsset(long userId, 1367 com.liferay.portal.model.Organization organization, 1368 long[] assetCategoryIds, java.lang.String[] assetTagNames) 1369 throws com.liferay.portal.kernel.exception.PortalException, 1370 com.liferay.portal.kernel.exception.SystemException; 1371 1372 /** 1373 * Updates the organization. 1374 * 1375 * @param companyId the primary key of the organization's company 1376 * @param organizationId the primary key of the organization 1377 * @param parentOrganizationId the primary key of organization's parent 1378 organization 1379 * @param name the organization's name 1380 * @param type the organization's type 1381 * @param recursable whether permissions of the organization are to be 1382 inherited by its suborganizations 1383 * @param regionId the primary key of the organization's region 1384 * @param countryId the primary key of the organization's country 1385 * @param statusId the organization's workflow status 1386 * @param comments the comments about the organization 1387 * @param site whether the organization is to be associated with a main 1388 site 1389 * @param serviceContext the service context to be applied (optionally 1390 <code>null</code>). Can set asset category IDs and asset tag 1391 names for the organization, and merge expando bridge 1392 attributes for the organization. 1393 * @return the organization 1394 * @throws PortalException if an organization or parent organization 1395 with the primary key could not be found or if the new 1396 information was invalid 1397 * @throws SystemException if a system exception occurred 1398 * @deprecated As of 6.2.0, replaced by {@link #updateOrganization(long, 1399 long, long, String, String, long, long, int, String, boolean, 1400 ServiceContext)} 1401 */ 1402 public com.liferay.portal.model.Organization updateOrganization( 1403 long companyId, long organizationId, long parentOrganizationId, 1404 java.lang.String name, java.lang.String type, boolean recursable, 1405 long regionId, long countryId, int statusId, java.lang.String comments, 1406 boolean site, com.liferay.portal.service.ServiceContext serviceContext) 1407 throws com.liferay.portal.kernel.exception.PortalException, 1408 com.liferay.portal.kernel.exception.SystemException; 1409 1410 /** 1411 * Updates the organization. 1412 * 1413 * @param companyId the primary key of the organization's company 1414 * @param organizationId the primary key of the organization 1415 * @param parentOrganizationId the primary key of organization's parent 1416 organization 1417 * @param name the organization's name 1418 * @param type the organization's type 1419 * @param regionId the primary key of the organization's region 1420 * @param countryId the primary key of the organization's country 1421 * @param statusId the organization's workflow status 1422 * @param comments the comments about the organization 1423 * @param site whether the organization is to be associated with a main 1424 site 1425 * @param serviceContext the service context to be applied (optionally 1426 <code>null</code>). Can set asset category IDs and asset tag 1427 names for the organization, and merge expando bridge attributes 1428 for the organization. 1429 * @return the organization 1430 * @throws PortalException if an organization or parent organization with 1431 the primary key could not be found or if the new information was 1432 invalid 1433 * @throws SystemException if a system exception occurred 1434 */ 1435 public com.liferay.portal.model.Organization updateOrganization( 1436 long companyId, long organizationId, long parentOrganizationId, 1437 java.lang.String name, java.lang.String type, long regionId, 1438 long countryId, int statusId, java.lang.String comments, boolean site, 1439 com.liferay.portal.service.ServiceContext serviceContext) 1440 throws com.liferay.portal.kernel.exception.PortalException, 1441 com.liferay.portal.kernel.exception.SystemException; 1442 }