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