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