Liferay 7.0-ce-b8 portal-impl

com.liferay.portal.service.impl
Class OrganizationServiceImpl

java.lang.Object
  extended by com.liferay.portal.kernel.service.BaseServiceImpl
      extended by com.liferay.portal.service.base.OrganizationServiceBaseImpl
          extended by com.liferay.portal.service.impl.OrganizationServiceImpl
All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService, com.liferay.portal.kernel.service.BaseService, com.liferay.portal.kernel.service.OrganizationService

public class OrganizationServiceImpl
extends OrganizationServiceBaseImpl

Provides the remote service for accessing, adding, deleting, and updating organizations. Its methods include permission checks.


Field Summary
 
Fields inherited from class com.liferay.portal.service.base.OrganizationServiceBaseImpl
addressLocalService, addressPersistence, addressService, assetCategoryFinder, assetCategoryLocalService, assetCategoryPersistence, assetCategoryService, assetEntryFinder, assetEntryLocalService, assetEntryPersistence, assetEntryService, assetTagFinder, assetTagLocalService, assetTagPersistence, assetTagService, companyLocalService, companyPersistence, companyService, counterLocalService, countryPersistence, countryService, emailAddressLocalService, emailAddressPersistence, emailAddressService, expandoRowLocalService, expandoRowPersistence, groupFinder, groupLocalService, groupPersistence, groupService, listTypeLocalService, listTypePersistence, listTypeService, organizationFinder, organizationLocalService, organizationPersistence, organizationService, passwordPolicyFinder, passwordPolicyLocalService, passwordPolicyPersistence, passwordPolicyRelLocalService, passwordPolicyRelPersistence, passwordPolicyService, phoneLocalService, phonePersistence, phoneService, regionPersistence, regionService, resourceLocalService, roleFinder, roleLocalService, rolePersistence, roleService, userFinder, userGroupRoleFinder, userGroupRoleLocalService, userGroupRolePersistence, userGroupRoleService, userLocalService, userPersistence, userService, websiteLocalService, websitePersistence, websiteService
 
Fields inherited from class com.liferay.portal.kernel.service.BaseServiceImpl
ANONYMOUS_NAMES, JRUN_ANONYMOUS, ORACLE_ANONYMOUS, SUN_ANONYMOUS, WEBLOGIC_ANONYMOUS
 
Constructor Summary
OrganizationServiceImpl()
           
 
Method Summary
 void addGroupOrganizations(long groupId, long[] organizationIds)
          Adds the organizations to the group.
 com.liferay.portal.kernel.model.Organization addOrganization(long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.OrgLabor> orgLabors, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Adds an organization with additional parameters.
 com.liferay.portal.kernel.model.Organization addOrganization(long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Adds an organization.
 void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
          Assigns the password policy to the organizations, removing any other currently assigned password policies.
 void deleteLogo(long organizationId)
          Deletes the organization's logo.
 void deleteOrganization(long organizationId)
          Deletes the organization.
 com.liferay.portal.kernel.model.Organization fetchOrganization(long organizationId)
          Returns the organization with the primary key.
 com.liferay.portal.kernel.model.Organization getOrganization(long organizationId)
          Returns the organization with the primary key.
 long getOrganizationId(long companyId, String name)
          Returns the primary key of the organization with the name.
 List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, long parentOrganizationId)
          Returns all the organizations belonging to the parent organization.
 List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, long parentOrganizationId, int start, int end)
          Returns a range of all the organizations belonging to the parent organization.
 int getOrganizationsCount(long companyId, long parentOrganizationId)
          Returns the number of organizations belonging to the parent organization.
 List<com.liferay.portal.kernel.model.Organization> getUserOrganizations(long userId)
          Returns all the organizations with which the user is explicitly associated.
 void setGroupOrganizations(long groupId, long[] organizationIds)
          Sets the organizations in the group, removing and adding organizations to the group as necessary.
 void unsetGroupOrganizations(long groupId, long[] organizationIds)
          Removes the organizations from the group.
 void unsetPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
          Removes the organizations from the password policy.
 com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean logo, byte[] logoBytes, boolean site, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.OrgLabor> orgLabors, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Updates the organization with additional parameters.
 com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, List<com.liferay.portal.kernel.model.Address> addresses, List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses, List<com.liferay.portal.kernel.model.OrgLabor> orgLabors, List<com.liferay.portal.kernel.model.Phone> phones, List<com.liferay.portal.kernel.model.Website> websites, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Deprecated. As of 7.0.0, replaced by updateOrganization(long, long, String, String, long, long, long, String, boolean, byte[], boolean, List, List, List, List, List, ServiceContext)
 com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, com.liferay.portal.kernel.service.ServiceContext serviceContext)
          Updates the organization.
 
Methods inherited from class com.liferay.portal.service.base.OrganizationServiceBaseImpl
afterPropertiesSet, destroy, getAddressLocalService, getAddressPersistence, getAddressService, getAssetCategoryFinder, getAssetCategoryLocalService, getAssetCategoryPersistence, getAssetCategoryService, getAssetEntryFinder, getAssetEntryLocalService, getAssetEntryPersistence, getAssetEntryService, getAssetTagFinder, getAssetTagLocalService, getAssetTagPersistence, getAssetTagService, getCompanyLocalService, getCompanyPersistence, getCompanyService, getCounterLocalService, getCountryPersistence, getCountryService, getEmailAddressLocalService, getEmailAddressPersistence, getEmailAddressService, getExpandoRowLocalService, getExpandoRowPersistence, getGroupFinder, getGroupLocalService, getGroupPersistence, getGroupService, getListTypeLocalService, getListTypePersistence, getListTypeService, getModelClass, getModelClassName, getOrganizationFinder, getOrganizationLocalService, getOrganizationPersistence, getOrganizationService, getOSGiServiceIdentifier, getPasswordPolicyFinder, getPasswordPolicyLocalService, getPasswordPolicyPersistence, getPasswordPolicyRelLocalService, getPasswordPolicyRelPersistence, getPasswordPolicyService, getPhoneLocalService, getPhonePersistence, getPhoneService, getRegionPersistence, getRegionService, getResourceLocalService, getRoleFinder, getRoleLocalService, getRolePersistence, getRoleService, getUserFinder, getUserGroupRoleFinder, getUserGroupRoleLocalService, getUserGroupRolePersistence, getUserGroupRoleService, getUserLocalService, getUserPersistence, getUserService, getWebsiteLocalService, getWebsitePersistence, getWebsiteService, runSQL, setAddressLocalService, setAddressPersistence, setAddressService, setAssetCategoryFinder, setAssetCategoryLocalService, setAssetCategoryPersistence, setAssetCategoryService, setAssetEntryFinder, setAssetEntryLocalService, setAssetEntryPersistence, setAssetEntryService, setAssetTagFinder, setAssetTagLocalService, setAssetTagPersistence, setAssetTagService, setCompanyLocalService, setCompanyPersistence, setCompanyService, setCounterLocalService, setCountryPersistence, setCountryService, setEmailAddressLocalService, setEmailAddressPersistence, setEmailAddressService, setExpandoRowLocalService, setExpandoRowPersistence, setGroupFinder, setGroupLocalService, setGroupPersistence, setGroupService, setListTypeLocalService, setListTypePersistence, setListTypeService, setOrganizationFinder, setOrganizationLocalService, setOrganizationPersistence, setOrganizationService, setPasswordPolicyFinder, setPasswordPolicyLocalService, setPasswordPolicyPersistence, setPasswordPolicyRelLocalService, setPasswordPolicyRelPersistence, setPasswordPolicyService, setPhoneLocalService, setPhonePersistence, setPhoneService, setRegionPersistence, setRegionService, setResourceLocalService, setRoleFinder, setRoleLocalService, setRolePersistence, setRoleService, setUserFinder, setUserGroupRoleFinder, setUserGroupRoleLocalService, setUserGroupRolePersistence, setUserGroupRoleService, setUserLocalService, setUserPersistence, setUserService, setWebsiteLocalService, setWebsitePersistence, setWebsiteService
 
Methods inherited from class com.liferay.portal.kernel.service.BaseServiceImpl
getClassLoader, getGuestOrUser, getGuestOrUserId, getPermissionChecker, getUser, getUserId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrganizationServiceImpl

public OrganizationServiceImpl()
Method Detail

addGroupOrganizations

public void addGroupOrganizations(long groupId,
                                  long[] organizationIds)
                           throws com.liferay.portal.kernel.exception.PortalException
Adds the organizations to the group.

Parameters:
groupId - the primary key of the group
organizationIds - the primary keys of the organizations
Throws:
com.liferay.portal.kernel.exception.PortalException

addOrganization

public com.liferay.portal.kernel.model.Organization addOrganization(long parentOrganizationId,
                                                                    String name,
                                                                    String type,
                                                                    long regionId,
                                                                    long countryId,
                                                                    long statusId,
                                                                    String comments,
                                                                    boolean site,
                                                                    List<com.liferay.portal.kernel.model.Address> addresses,
                                                                    List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
                                                                    List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
                                                                    List<com.liferay.portal.kernel.model.Phone> phones,
                                                                    List<com.liferay.portal.kernel.model.Website> websites,
                                                                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
                                                             throws com.liferay.portal.kernel.exception.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
statusId - 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:
com.liferay.portal.kernel.exception.PortalException

addOrganization

public com.liferay.portal.kernel.model.Organization addOrganization(long parentOrganizationId,
                                                                    String name,
                                                                    String type,
                                                                    long regionId,
                                                                    long countryId,
                                                                    long statusId,
                                                                    String comments,
                                                                    boolean site,
                                                                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
                                                             throws com.liferay.portal.kernel.exception.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
statusId - 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:
com.liferay.portal.kernel.exception.PortalException

addPasswordPolicyOrganizations

public void addPasswordPolicyOrganizations(long passwordPolicyId,
                                           long[] organizationIds)
                                    throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

deleteLogo

public void deleteLogo(long organizationId)
                throws com.liferay.portal.kernel.exception.PortalException
Deletes the organization's logo.

Parameters:
organizationId - the primary key of the organization
Throws:
com.liferay.portal.kernel.exception.PortalException

deleteOrganization

public void deleteOrganization(long organizationId)
                        throws com.liferay.portal.kernel.exception.PortalException
Deletes the organization. The organization's associated resources and assets are also deleted.

Parameters:
organizationId - the primary key of the organization
Throws:
com.liferay.portal.kernel.exception.PortalException

fetchOrganization

public com.liferay.portal.kernel.model.Organization fetchOrganization(long organizationId)
                                                               throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

getOrganization

public com.liferay.portal.kernel.model.Organization getOrganization(long organizationId)
                                                             throws com.liferay.portal.kernel.exception.PortalException
Returns the organization with the primary key.

Parameters:
organizationId - the primary key of the organization
Returns:
the organization with the primary key
Throws:
com.liferay.portal.kernel.exception.PortalException

getOrganizationId

public long getOrganizationId(long companyId,
                              String name)
                       throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

getOrganizations

public List<com.liferay.portal.kernel.model.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

public List<com.liferay.portal.kernel.model.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

getOrganizationsCount

public 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

getUserOrganizations

public List<com.liferay.portal.kernel.model.Organization> getUserOrganizations(long userId)
                                                                        throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

setGroupOrganizations

public void setGroupOrganizations(long groupId,
                                  long[] organizationIds)
                           throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

unsetGroupOrganizations

public void unsetGroupOrganizations(long groupId,
                                    long[] organizationIds)
                             throws com.liferay.portal.kernel.exception.PortalException
Removes the organizations from the group.

Parameters:
groupId - the primary key of the group
organizationIds - the primary keys of the organizations
Throws:
com.liferay.portal.kernel.exception.PortalException

unsetPasswordPolicyOrganizations

public void unsetPasswordPolicyOrganizations(long passwordPolicyId,
                                             long[] organizationIds)
                                      throws com.liferay.portal.kernel.exception.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:
com.liferay.portal.kernel.exception.PortalException

updateOrganization

public com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId,
                                                                       long parentOrganizationId,
                                                                       String name,
                                                                       String type,
                                                                       long regionId,
                                                                       long countryId,
                                                                       long statusId,
                                                                       String comments,
                                                                       boolean logo,
                                                                       byte[] logoBytes,
                                                                       boolean site,
                                                                       List<com.liferay.portal.kernel.model.Address> addresses,
                                                                       List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
                                                                       List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
                                                                       List<com.liferay.portal.kernel.model.Phone> phones,
                                                                       List<com.liferay.portal.kernel.model.Website> websites,
                                                                       com.liferay.portal.kernel.service.ServiceContext serviceContext)
                                                                throws com.liferay.portal.kernel.exception.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
statusId - the organization's workflow status
comments - the comments about the organization
logo - whether to update the ogranization's 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:
com.liferay.portal.kernel.exception.PortalException

updateOrganization

@Deprecated
public com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId,
                                                                                  long parentOrganizationId,
                                                                                  String name,
                                                                                  String type,
                                                                                  long regionId,
                                                                                  long countryId,
                                                                                  long statusId,
                                                                                  String comments,
                                                                                  boolean site,
                                                                                  List<com.liferay.portal.kernel.model.Address> addresses,
                                                                                  List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
                                                                                  List<com.liferay.portal.kernel.model.OrgLabor> orgLabors,
                                                                                  List<com.liferay.portal.kernel.model.Phone> phones,
                                                                                  List<com.liferay.portal.kernel.model.Website> websites,
                                                                                  com.liferay.portal.kernel.service.ServiceContext serviceContext)
                                                                throws com.liferay.portal.kernel.exception.PortalException
Deprecated. As of 7.0.0, replaced by updateOrganization(long, long, String, String, long, long, long, String, boolean, byte[], boolean, List, List, List, List, List, ServiceContext)

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
statusId - 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 and asset tag names for the organization, and merge expando bridge attributes for the organization.
Returns:
the organization
Throws:
com.liferay.portal.kernel.exception.PortalException

updateOrganization

public com.liferay.portal.kernel.model.Organization updateOrganization(long organizationId,
                                                                       long parentOrganizationId,
                                                                       String name,
                                                                       String type,
                                                                       long regionId,
                                                                       long countryId,
                                                                       long statusId,
                                                                       String comments,
                                                                       boolean site,
                                                                       com.liferay.portal.kernel.service.ServiceContext serviceContext)
                                                                throws com.liferay.portal.kernel.exception.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
statusId - 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:
com.liferay.portal.kernel.exception.PortalException

Liferay 7.0-ce-b8 portal-impl