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