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