Interface OrganizationService

All Superinterfaces:
BaseService
All Known Implementing Classes:
OrganizationServiceWrapper

Provides the remote service interface for Organization. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Method Details

    • addGroupOrganizations

      void addGroupOrganizations(long groupId, long[] organizationIds) throws PortalException
      Adds the organizations to the group.
      Parameters:
      groupId - the primary key of the group
      organizationIds - the primary keys of the organizations
      Throws:
      PortalException
    • addOrganization

      Organization addOrganization(String externalReferenceCode, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean site, List<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
      Adds an organization with additional parameters.

      This method handles the creation and bookkeeping of the organization including its resources, metadata, and internal data structures.

      Parameters:
      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
      addresses - the organization's addresses
      emailAddresses - the organization's email addresses
      orgLabors - the organization's hours of operation
      phones - the organization's phone numbers
      websites - the organization's websites
      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
    • addOrganization

      Organization addOrganization(String externalReferenceCode, 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.

      Parameters:
      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
    • addOrganizationUserByEmailAddress

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

      Organization addOrUpdateOrganization(String externalReferenceCode, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean hasLogo, byte[] logoBytes, boolean site, List<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addPasswordPolicyOrganizations

      void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds) throws PortalException
      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
      Throws:
      PortalException
    • addUserOrganizationByEmailAddress

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

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

      void deleteOrganization(long organizationId) throws PortalException
      Deletes the organization. The organization's associated resources and assets are also deleted.
      Parameters:
      organizationId - the primary key of the organization
      Throws:
      PortalException
    • deleteUserOrganizationByEmailAddress

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

      @Transactional(propagation=SUPPORTS, readOnly=true) Organization fetchOrganization(long organizationId) throws PortalException
      Returns the organization with the primary key.
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      the organization with the primary key, or null if an organization with the primary key could not be found or if the user did not have permission to view the organization
      Throws:
      PortalException
    • fetchOrganizationByExternalReferenceCode

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

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getGtOrganizations(long gtOrganizationId, long companyId, long parentOrganizationId, int size)
    • 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 with the primary key
      Throws:
      PortalException
    • getOrganizationByExternalReferenceCode

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

      @Transactional(propagation=SUPPORTS, readOnly=true) long getOrganizationId(long companyId, String name) throws PortalException
      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
      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 organizations' company
      parentOrganizationId - the primary key of the organizations' 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 organizations' company
      parentOrganizationId - the primary key of the organizations' 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
    • getOrganizations

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getOrganizations(long companyId, long parentOrganizationId, int start, int end, OrderByComparator<Organization> orderByComparator)
    • 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, long parentOrganizationId, String name, int start, int end, OrderByComparator<Organization> orderByComparator)
    • 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 organizations' company
      parentOrganizationId - the primary key of the organizations' 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) throws PortalException
      Throws:
      PortalException
    • getOSGiServiceIdentifier

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

      @Transactional(propagation=SUPPORTS, readOnly=true) List<Organization> getUserOrganizations(long userId) throws PortalException
      Returns all the organizations with which the user is explicitly associated.

      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
      Returns:
      the organizations with which the user is explicitly associated
      Throws:
      PortalException
    • setGroupOrganizations

      void setGroupOrganizations(long groupId, long[] organizationIds) throws PortalException
      Sets the organizations in the group, removing and adding organizations to the group as necessary.
      Parameters:
      groupId - the primary key of the group
      organizationIds - the primary keys of the organizations
      Throws:
      PortalException
    • unsetGroupOrganizations

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

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

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

      Organization updateOrganization(String externalReferenceCode, long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean hasLogo, byte[] logoBytes, boolean site, List<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
      Updates the organization with additional parameters.
      Parameters:
      organizationId - the primary key 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
      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
      addresses - the organization's addresses
      emailAddresses - the organization's email addresses
      orgLabors - the organization's hours of operation
      phones - the organization's phone numbers
      websites - the organization's websites
      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
    • updateOrganization

      Organization updateOrganization(String externalReferenceCode, long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusListTypeId, String comments, boolean site, ServiceContext serviceContext) throws PortalException
      Updates the organization.
      Parameters:
      organizationId - the primary key 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 and asset tag names for the organization, and merge expando bridge attributes for the organization.
      Returns:
      the organization
      Throws:
      PortalException