Interface OrganizationLocalService

All Superinterfaces:
BaseLocalService, CTService<Organization>, PersistedModelLocalService
All Known Implementing Classes:
OrganizationLocalServiceWrapper

Provides the local service interface for Organization. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Method Details

    • addGroupOrganization

      boolean addGroupOrganization(long groupId, long organizationId)
    • addGroupOrganization

      boolean addGroupOrganization(long groupId, Organization organization)
    • addGroupOrganizations

      boolean addGroupOrganizations(long groupId, List<Organization> organizations)
    • addGroupOrganizations

      boolean addGroupOrganizations(long groupId, long[] organizationIds)
    • addOrganization

      Organization addOrganization(long userId, long parentOrganizationId, String name, boolean site) throws PortalException
      Adds an organization.

      This method handles the creation and bookkeeping of the organization including its resources, metadata, and internal data structures. It is not necessary to make a subsequent call to addOrganizationResources(long, Organization).

      Parameters:
      userId - the primary key of the creator/owner of the organization
      parentOrganizationId - the primary key of the organization's parent organization
      name - the organization's name
      site - whether the organization is to be associated with a main site
      Returns:
      the organization
      Throws:
      PortalException
    • addOrganization

      @Indexable(type=REINDEX) Organization addOrganization(Organization organization)
      Adds the organization to the database. Also notifies the appropriate model listeners.

      Important: Inspect OrganizationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      organization - the organization
      Returns:
      the organization that was added
    • addOrganization

      Organization addOrganization(String externalReferenceCode, long userId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean site, ServiceContext serviceContext) throws PortalException
      Adds an organization.

      This method handles the creation and bookkeeping of the organization including its resources, metadata, and internal data structures. It is not necessary to make a subsequent call to addOrganizationResources(long, Organization).

      Parameters:
      userId - the primary key of the creator/owner of the organization
      parentOrganizationId - the primary key of the organization's parent organization
      name - the organization's name
      type - the organization's type
      regionId - the primary key of the organization's region
      countryId - the primary key of the organization's country
      statusListTypeId - the organization's workflow status
      comments - the comments about the organization
      site - whether the organization is to be associated with a main site
      serviceContext - the service context to be applied (optionally null). Can set asset category IDs, asset tag names, and expando bridge attributes for the organization.
      Returns:
      the organization
      Throws:
      PortalException
    • addOrganizationResources

      void addOrganizationResources(long userId, Organization organization) throws PortalException
      Adds a resource for each type of permission available on the organization.
      Parameters:
      userId - the primary key of the creator/owner of the organization
      organization - the organization
      Throws:
      PortalException
    • addOrganizationUserByEmailAddress

      User addOrganizationUserByEmailAddress(String emailAddress, long organizationId, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addOrUpdateOrganization

      Organization addOrUpdateOrganization(String externalReferenceCode, long userId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean hasLogo, byte[] logoBytes, boolean site, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addPasswordPolicyOrganizations

      void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
      Assigns the password policy to the organizations, removing any other currently assigned password policies.
      Parameters:
      passwordPolicyId - the primary key of the password policy
      organizationIds - the primary keys of the organizations
    • addUserOrganization

      boolean addUserOrganization(long userId, long organizationId)
    • addUserOrganization

      boolean addUserOrganization(long userId, Organization organization)
    • addUserOrganizationByEmailAddress

      void addUserOrganizationByEmailAddress(String emailAddress, long organizationId) throws PortalException
      Throws:
      PortalException
    • addUserOrganizations

      boolean addUserOrganizations(long userId, List<Organization> organizations)
    • addUserOrganizations

      boolean addUserOrganizations(long userId, long[] organizationIds)
    • clearGroupOrganizations

      void clearGroupOrganizations(long groupId)
    • clearUserOrganizations

      void clearUserOrganizations(long userId)
    • createOrganization

      @Transactional(enabled=false) Organization createOrganization(long organizationId)
      Creates a new organization with the primary key. Does not add the organization to the database.
      Parameters:
      organizationId - the primary key for the new organization
      Returns:
      the new organization
    • createPersistedModel

      PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      createPersistedModel in interface PersistedModelLocalService
      Throws:
      PortalException
    • deleteGroupOrganization

      void deleteGroupOrganization(long groupId, long organizationId)
    • deleteGroupOrganization

      void deleteGroupOrganization(long groupId, Organization organization)
    • deleteGroupOrganizations

      void deleteGroupOrganizations(long groupId, List<Organization> organizations)
    • deleteGroupOrganizations

      void deleteGroupOrganizations(long groupId, long[] organizationIds)
    • deleteLogo

      void deleteLogo(long organizationId) throws PortalException
      Deletes the organization's logo.
      Parameters:
      organizationId - the primary key of the organization
      Throws:
      PortalException
    • deleteOrganization

      @Indexable(type=DELETE) Organization deleteOrganization(long organizationId) throws PortalException
      Deletes the organization with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect OrganizationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      organizationId - the primary key of the organization
      Returns:
      the organization that was removed
      Throws:
      PortalException - if a organization with the primary key could not be found
    • deleteOrganization

      @Indexable(type=DELETE) @SystemEvent(type=1) Organization deleteOrganization(Organization organization) throws PortalException
      Deletes the organization from the database. Also notifies the appropriate model listeners.

      Important: Inspect OrganizationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      organization - the organization
      Returns:
      the organization that was removed
      Throws:
      PortalException
    • deletePersistedModel

      PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Specified by:
      deletePersistedModel in interface PersistedModelLocalService
      Throws:
      PortalException
    • deleteUserOrganization

      void deleteUserOrganization(long userId, long organizationId)
    • deleteUserOrganization

      void deleteUserOrganization(long userId, Organization organization)
    • deleteUserOrganizationByEmailAddress

      void deleteUserOrganizationByEmailAddress(String emailAddress, long organizationId) throws PortalException
      Throws:
      PortalException
    • deleteUserOrganizations

      void deleteUserOrganizations(long userId, List<Organization> organizations)
    • deleteUserOrganizations

      void deleteUserOrganizations(long userId, long[] organizationIds)
    • dslQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQuery in interface PersistedModelLocalService
    • dslQueryCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQueryCount in interface PersistedModelLocalService
    • dynamicQuery

    • dynamicQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.OrganizationModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
      Performs a dynamic query on the database and returns an ordered range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.OrganizationModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      @Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      @Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization fetchOrganization(long organizationId)
    • fetchOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization fetchOrganization(long companyId, String name)
      Returns the organization with the name.
      Parameters:
      companyId - the primary key of the organization's company
      name - the organization's name
      Returns:
      the organization with the name, or null if no organization could be found
    • fetchOrganizationByExternalReferenceCode

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization fetchOrganizationByExternalReferenceCode(String externalReferenceCode, long companyId)
    • fetchOrganizationByUuidAndCompanyId

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization fetchOrganizationByUuidAndCompanyId(String uuid, long companyId)
      Returns the organization with the matching UUID and company.
      Parameters:
      uuid - the organization's UUID
      companyId - the primary key of the company
      Returns:
      the matching organization, or null if a matching organization could not be found
    • getActionableDynamicQuery

    • getChildrenTypes

      @Transactional(propagation=SUPPORTS, readOnly=true) String[] getChildrenTypes(String type)
    • getExportActionableDynamicQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
    • getGroupOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getGroupOrganizations(long groupId)
    • getGroupOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getGroupOrganizations(long groupId, int start, int end)
    • getGroupOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getGroupOrganizations(long groupId, int start, int end, OrderByComparator<Organization> orderByComparator)
    • getGroupOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getGroupOrganizationsCount(long groupId)
    • getGroupPrimaryKeys

      @Transactional(propagation=SUPPORTS, readOnly=true) long[] getGroupPrimaryKeys(long organizationId)
      Returns the groupIds of the groups associated with the organization.
      Parameters:
      organizationId - the organizationId of the organization
      Returns:
      long[] the groupIds of groups associated with the organization
    • getGroupUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getGroupUserOrganizations(long groupId, long userId) throws PortalException
      Throws:
      PortalException
    • getIndexableActionableDynamicQuery

      @Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getNoAssetOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getNoAssetOrganizations()
    • getOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization getOrganization(long organizationId) throws PortalException
      Returns the organization with the primary key.
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      the organization
      Throws:
      PortalException - if a organization with the primary key could not be found
    • getOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization getOrganization(long companyId, String name) throws PortalException
      Returns the organization with the name.
      Parameters:
      companyId - the primary key of the organization's company
      name - the organization's name
      Returns:
      the organization with the name
      Throws:
      PortalException
    • getOrganizationByExternalReferenceCode

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization getOrganizationByExternalReferenceCode(String externalReferenceCode, long companyId) throws PortalException
      Throws:
      PortalException
    • getOrganizationByUuidAndCompanyId

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization getOrganizationByUuidAndCompanyId(String uuid, long companyId) throws PortalException
      Returns the organization with the matching UUID and company.
      Parameters:
      uuid - the organization's UUID
      companyId - the primary key of the company
      Returns:
      the matching organization
      Throws:
      PortalException - if a matching organization could not be found
    • getOrganizationId

      @Transactional(propagation=SUPPORTS, readOnly=true) long getOrganizationId(long companyId, String name)
      Returns the primary key of the organization with the name.
      Parameters:
      companyId - the primary key of the organization's company
      name - the organization's name
      Returns:
      the primary key of the organization with the name, or 0 if the organization could not be found
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(int start, int end)
      Returns a range of all the organizations.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.OrganizationModelImpl.

      Parameters:
      start - the lower bound of the range of organizations
      end - the upper bound of the range of organizations (not inclusive)
      Returns:
      the range of organizations
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long userId, int start, int end, OrderByComparator<Organization> orderByComparator) throws PortalException
      Throws:
      PortalException
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, long parentOrganizationId)
      Returns all the organizations belonging to the parent organization.
      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      Returns:
      the organizations belonging to the parent organization
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, long parentOrganizationId, int start, int end)
      Returns a range of all the organizations belonging to the parent organization.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      Returns:
      the range of organizations belonging to the parent organization
      See Also:
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, long parentOrganizationId, String name, int start, int end)
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, String treePath)
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, String name, int start, int end, OrderByComparator<Organization> orderByComparator)
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long[] organizationIds) throws PortalException
      Returns the organizations with the primary keys.
      Parameters:
      organizationIds - the primary keys of the organizations
      Returns:
      the organizations with the primary keys
      Throws:
      PortalException
    • getOrganizationsAndUsers

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Object> getOrganizationsAndUsers(long companyId, long parentOrganizationId, int status, int start, int end, OrderByComparator<?> orderByComparator)
      Returns all the organizations and users belonging to the parent organization.
      Parameters:
      companyId - the primary key of the organization and user's company
      parentOrganizationId - the primary key of the organization and user's parent organization
      status - the user's workflow status
      start - the lower bound of the range of organizations and users to return
      end - the upper bound of the range of organizations and users to return (not inclusive)
      orderByComparator - the comparator to order the organizations and users (optionally null)
      Returns:
      the organizations and users belonging to the parent organization
    • getOrganizationsAndUsersCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getOrganizationsAndUsersCount(long companyId, long parentOrganizationId, int status)
      Returns the number of organizations and users belonging to the parent organization.
      Parameters:
      companyId - the primary key of the organization and user's company
      parentOrganizationId - the primary key of the organization and user's parent organization
      status - the user's workflow status
      Returns:
      the number of organizations and users belonging to the parent organization
    • getOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getOrganizationsCount()
      Returns the number of organizations.
      Returns:
      the number of organizations
    • getOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getOrganizationsCount(long companyId, long parentOrganizationId)
      Returns the number of organizations belonging to the parent organization.
      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      Returns:
      the number of organizations belonging to the parent organization
    • getOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getOrganizationsCount(long companyId, long parentOrganizationId, String name)
    • getOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getOrganizationsCount(long companyId, String name)
    • getOSGiServiceIdentifier

      String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getParentOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getParentOrganizations(long organizationId) throws PortalException
      Returns the parent organizations in order by closest ancestor. The list starts with the organization itself.
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      the parent organizations in order by closest ancestor
      Throws:
      PortalException
    • getPersistedModel

      @Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      getPersistedModel in interface PersistedModelLocalService
      Throws:
      PortalException
    • getSuborganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getSuborganizations(List<Organization> organizations)
      Returns the suborganizations of the organizations.
      Parameters:
      organizations - the organizations from which to get suborganizations
      Returns:
      the suborganizations of the organizations
    • getSuborganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getSuborganizations(long companyId, long organizationId)
      Returns the suborganizations of the organization.
      Parameters:
      companyId - the primary key of the organization's company
      organizationId - the primary key of the organization
      Returns:
      the suborganizations of the organization
    • getSuborganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getSuborganizationsCount(long companyId, long organizationId)
      Returns the count of suborganizations of the organization.
      Parameters:
      companyId - the primary key of the organization's company
      organizationId - the primary key of the organization
      Returns:
      the count of suborganizations of the organization
    • getSubsetOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getSubsetOrganizations(List<Organization> allOrganizations, List<Organization> availableOrganizations)
      Returns the intersection of allOrganizations and availableOrganizations.
      Parameters:
      allOrganizations - the organizations to check for availability
      availableOrganizations - the available organizations
      Returns:
      the intersection of allOrganizations and availableOrganizations
    • getTypes

    • getUserOrganizationIds

      @Transactional(propagation=SUPPORTS, readOnly=true) long[] getUserOrganizationIds(long userId, boolean includeAdministrative) throws PortalException
      Returns all the IDs of organizations with which the user is explicitly associated, optionally including the IDs of organizations that the user administers or owns.

      A user is considered to be explicitly associated with an organization if his account is individually created within the organization or if the user is later added to it.

      Parameters:
      userId - the primary key of the user
      includeAdministrative - whether to include the IDs of organizations that the user administers or owns, even if he's not a member of the organizations
      Returns:
      the IDs of organizations with which the user is explicitly associated, optionally including the IDs of organizations that the user administers or owns
      Throws:
      PortalException
    • getUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getUserOrganizations(long userId)
    • getUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getUserOrganizations(long userId, boolean includeAdministrative) throws PortalException
      Returns all the organizations with which the user is explicitly associated, optionally including the organizations that the user administers or owns.

      A user is considered to be explicitly associated with an organization if his account is individually created within the organization or if the user is later added as a member.

      Parameters:
      userId - the primary key of the user
      includeAdministrative - whether to include the IDs of organizations that the user administers or owns, even if he's not a member of the organizations
      Returns:
      the organizations with which the user is explicitly associated, optionally including the organizations that the user administers or owns
      Throws:
      PortalException
    • getUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getUserOrganizations(long userId, int start, int end)
    • getUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getUserOrganizations(long userId, int start, int end, OrderByComparator<Organization> orderByComparator)
    • getUserOrganizationsCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int getUserOrganizationsCount(long userId)
    • getUserPrimaryKeys

      @Transactional(propagation=SUPPORTS, readOnly=true) long[] getUserPrimaryKeys(long organizationId)
      Returns the userIds of the users associated with the organization.
      Parameters:
      organizationId - the organizationId of the organization
      Returns:
      long[] the userIds of users associated with the organization
    • hasGroupOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasGroupOrganization(long groupId, long organizationId)
    • hasGroupOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasGroupOrganizations(long groupId)
    • hasPasswordPolicyOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasPasswordPolicyOrganization(long passwordPolicyId, long organizationId)
      Returns true if the password policy has been assigned to the organization.
      Parameters:
      passwordPolicyId - the primary key of the password policy
      organizationId - the primary key of the organization
      Returns:
      true if the password policy has been assigned to the organization; false otherwise
    • hasUserOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasUserOrganization(long userId, long organizationId)
    • hasUserOrganization

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasUserOrganization(long userId, long organizationId, boolean inheritSuborganizations, boolean includeSpecifiedOrganization) throws PortalException
      Returns true if the user is a member of the organization, optionally focusing on suborganizations or the specified organization. This method is usually called to determine if the user has view access to a resource belonging to the organization.
      1. If inheritSuborganizations=false: the method checks whether the user belongs to the organization specified by organizationId. The parameter includeSpecifiedOrganization is ignored.
      2. The parameter includeSpecifiedOrganization is ignored unless inheritSuborganizations is also true.
      3. If inheritSuborganizations=true and includeSpecifiedOrganization=false: the method checks whether the user belongs to one of the child organizations of the one specified by organizationId.
      4. If inheritSuborganizations=true and includeSpecifiedOrganization=true: the method checks whether the user belongs to the organization specified by organizationId or any of its child organizations.
      Parameters:
      userId - the primary key of the organization's user
      organizationId - the primary key of the organization
      inheritSuborganizations - if true suborganizations are considered in the determination
      includeSpecifiedOrganization - if true the organization specified by organizationId is considered in the determination
      Returns:
      true if the user has access to the organization; false otherwise
      Throws:
      PortalException
      See Also:
    • hasUserOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean hasUserOrganizations(long userId)
    • isCountryEnabled

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean isCountryEnabled(String type)
    • isCountryRequired

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean isCountryRequired(String type)
    • isRootable

      @Transactional(propagation=SUPPORTS, readOnly=true) boolean isRootable(String type)
    • rebuildTree

      void rebuildTree(long companyId) throws PortalException
      Rebuilds the organization's tree.

      Only call this method if the tree has become stale through operations other than normal CRUD. Under normal circumstances the tree is automatically rebuilt whenever necessary.

      Parameters:
      companyId - the primary key of the organization's company
      Throws:
      PortalException
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) Hits search(long companyId, long parentOrganizationId, String keywords, LinkedHashMap<String,Object> params, int start, int end, Sort sort)
      Returns an ordered range of all the organizations that match the keywords, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, street, city, zipcode, type, region or country (optionally null)
      params - the finder parameters (optionally null).
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      sort - the field and direction by which to sort (optionally null)
      Returns:
      the matching organizations ordered by name
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end)
      Returns a name ordered range of all the organizations that match the keywords, type, region, and country, without using the indexer. It is preferable to use the indexed version search(long, long, String, LinkedHashMap, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, street, city, or zipcode (optionally null)
      type - the organization's type (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder params. For more information see OrganizationFinder
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      Returns:
      the matching organizations ordered by name
      See Also:
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<Organization> orderByComparator)
      Returns an ordered range of all the organizations that match the keywords, type, region, and country, without using the indexer. It is preferable to use the indexed version search(long, long, String, String, String, String, String, String, String, LinkedHashMap, boolean, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, street, city, or zipcode (optionally null)
      type - the organization's type (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder params. For more information see OrganizationFinder
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      orderByComparator - the comparator to order the organizations (optionally null)
      Returns:
      the matching organizations ordered by comparator orderByComparator
      See Also:
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andOperator, int start, int end)
      Returns a name ordered range of all the organizations with the type, region, and country, and whose name, street, city, and zipcode match the keywords specified for them, without using the indexer. It is preferable to use the indexed version search(long, long, String, String, String, String, String, String, String, LinkedHashMap, boolean, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent
      name - the name keywords (space separated, optionally null)
      type - the organization's type (optionally null)
      street - the street keywords (optionally null)
      city - the city keywords (optionally null)
      zip - the zipcode keywords (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder parameters (optionally null). For more information see OrganizationFinder
      andOperator - whether every field must match its keywords, or just one field. For example, "organizations with the name 'Employees' and city 'Chicago'" vs "organizations with the name 'Employees' or the city 'Chicago'".
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      Returns:
      the matching organizations ordered by name
      See Also:
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andOperator, int start, int end, OrderByComparator<Organization> orderByComparator)
      Returns an ordered range of all the organizations with the type, region, and country, and whose name, street, city, and zipcode match the keywords specified for them, without using the indexer. It is preferable to use the indexed version search(long, long, String, String, String, String, String, String, String, LinkedHashMap, boolean, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      name - the name keywords (space separated, optionally null)
      type - the organization's type (optionally null)
      street - the street keywords (optionally null)
      city - the city keywords (optionally null)
      zip - the zipcode keywords (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder parameters (optionally null). For more information see OrganizationFinder
      andOperator - whether every field must match its keywords, or just one field. For example, "organizations with the name 'Employees' and city 'Chicago'" vs "organizations with the name 'Employees' or the city 'Chicago'".
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      orderByComparator - the comparator to order the organizations (optionally null)
      Returns:
      the matching organizations ordered by comparator orderByComparator
      See Also:
    • search

      @Transactional(propagation=SUPPORTS, readOnly=true) Hits search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, String region, String country, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
      Returns an ordered range of all the organizations whose name, type, or location fields match the keywords specified for them, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      name - the name keywords (space separated, optionally null)
      type - the type keywords (optionally null)
      street - the street keywords (optionally null)
      city - the city keywords (optionally null)
      zip - the zipcode keywords (optionally null)
      region - the region keywords (optionally null)
      country - the country keywords (optionally null)
      params - the finder parameters (optionally null).
      andSearch - whether every field must match its keywords or just one field
      start - the lower bound of the range of organizations to return
      end - the upper bound of the range of organizations to return (not inclusive)
      sort - the field and direction by which to sort (optionally null)
      Returns:
      the matching organizations ordered by sort
    • searchCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int searchCount(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params)
      Returns the number of organizations that match the keywords, type, region, and country.
      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, street, city, or zipcode (optionally null)
      type - the organization's type (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder parameters (optionally null). For more information see OrganizationFinder
      Returns:
      the number of matching organizations
      See Also:
    • searchCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int searchCount(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andOperator)
      Returns the number of organizations with the type, region, and country, and whose name, street, city, and zipcode match the keywords specified for them.
      Parameters:
      companyId - the primary key of the organization's company
      parentOrganizationId - the primary key of the organization's parent organization
      name - the name keywords (space separated, optionally null)
      type - the organization's type (optionally null)
      street - the street keywords (optionally null)
      city - the city keywords (optionally null)
      zip - the zipcode keywords (optionally null)
      regionId - the primary key of the organization's region (optionally null)
      countryId - the primary key of the organization's country (optionally null)
      params - the finder parameters (optionally null). For more information see OrganizationFinder
      andOperator - whether every field must match its keywords, or just one field. For example, "organizations with the name 'Employees' and city 'Chicago'" vs "organizations with the name 'Employees' or the city 'Chicago'".
      Returns:
      the number of matching organizations
      See Also:
    • searchOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) BaseModelSearchResult<Organization> searchOrganizations(long companyId, long parentOrganizationId, String keywords, LinkedHashMap<String,Object> params, int start, int end, Sort sort) throws PortalException
      Throws:
      PortalException
    • searchOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) BaseModelSearchResult<Organization> searchOrganizations(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, String region, String country, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort) throws PortalException
      Throws:
      PortalException
    • searchOrganizationsAndUsers

      @Transactional(propagation=SUPPORTS, readOnly=true) Hits searchOrganizationsAndUsers(long companyId, long parentOrganizationId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort[] sorts) throws PortalException
      Returns the organizations and users that match the keywords specified for them and belong to the parent organization.
      Parameters:
      companyId - the primary key of the organization and user's company
      parentOrganizationId - the primary key of the organization and user's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, type, or location fields or user's first name, middle name, last name, screen name, email address, or address fields
      status - user's workflow status
      params - the finder parameters (optionally null).
      start - the lower bound of the range of organizations and users to return
      end - the upper bound of the range of organizations and users to return (not inclusive)
      Returns:
      the matching organizations and users
      Throws:
      PortalException
    • searchOrganizationsAndUsersCount

      @Transactional(propagation=SUPPORTS, readOnly=true) int searchOrganizationsAndUsersCount(long companyId, long parentOrganizationId, String keywords, int status, LinkedHashMap<String,Object> params) throws PortalException
      Returns the number of organizations and users that match the keywords specified for them and belong to the parent organization.
      Parameters:
      companyId - the primary key of the organization and user's company
      parentOrganizationId - the primary key of the organization and user's parent organization
      keywords - the keywords (space separated), which may occur in the organization's name, type, or location fields or user's first name, middle name, last name, screen name, email address, or address fields
      status - user's workflow status
      params - the finder parameters (optionally null).
      Returns:
      the number of matching organizations and users
      Throws:
      PortalException
    • setGroupOrganizations

      void setGroupOrganizations(long groupId, long[] organizationIds)
    • setUserOrganizations

      void setUserOrganizations(long userId, long[] organizationIds)
    • unsetGroupOrganizations

      void unsetGroupOrganizations(long groupId, long[] organizationIds)
      Removes the organizations from the group.
      Parameters:
      groupId - the primary key of the group
      organizationIds - the primary keys of the organizations
    • unsetPasswordPolicyOrganizations

      void unsetPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
      Removes the organizations from the password policy.
      Parameters:
      passwordPolicyId - the primary key of the password policy
      organizationIds - the primary keys of the organizations
    • updateAsset

      void updateAsset(long userId, Organization organization, long[] assetCategoryIds, String[] assetTagNames) throws PortalException
      Updates the organization's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.
      Parameters:
      userId - the primary key of the user
      organization - the organization
      assetCategoryIds - the primary keys of the asset categories
      assetTagNames - the asset tag names
      Throws:
      PortalException
    • updateLogo

      Organization updateLogo(long organizationId, byte[] logoBytes) throws PortalException
      Throws:
      PortalException
    • updateOrganization

      @Indexable(type=REINDEX) Organization updateOrganization(Organization organization)
      Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect OrganizationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      organization - the organization
      Returns:
      the organization that was updated
    • updateOrganization

      Organization updateOrganization(String externalReferenceCode, long companyId, long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean hasLogo, byte[] logoBytes, boolean site, ServiceContext serviceContext) throws PortalException
      Updates the organization.
      Parameters:
      companyId - the primary key of the organization's company
      organizationId - the primary key of the organization
      parentOrganizationId - the primary key of organization's parent organization
      name - the organization's name
      type - the organization's type
      regionId - the primary key of the organization's region
      countryId - the primary key of the organization's country
      statusListTypeId - the organization's workflow status
      comments - the comments about the organization
      hasLogo - if the organization has a custom logo
      logoBytes - the new logo image data
      site - whether the organization is to be associated with a main site
      serviceContext - the service context to be applied (optionally null). Can set asset category IDs and asset tag names for the organization, and merge expando bridge attributes for the organization.
      Returns:
      the organization
      Throws:
      PortalException
    • getCTPersistence

      @Transactional(enabled=false) CTPersistence<Organization> getCTPersistence()
      Specified by:
      getCTPersistence in interface CTService<Organization>
    • getModelClass

      @Transactional(enabled=false) Class<Organization> getModelClass()
      Specified by:
      getModelClass in interface CTService<Organization>
    • updateWithUnsafeFunction

      @Transactional(rollbackFor=java.lang.Throwable.class) <R, E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Organization>,R,E> updateUnsafeFunction) throws E
      Specified by:
      updateWithUnsafeFunction in interface CTService<Organization>
      Throws:
      E extends Throwable