public class OrganizationLocalServiceImpl extends OrganizationLocalServiceBaseImpl
addressLocalService, addressPersistence, assetCategoryFinder, assetCategoryLocalService, assetCategoryPersistence, assetEntryFinder, assetEntryLocalService, assetEntryPersistence, assetTagFinder, assetTagLocalService, assetTagPersistence, companyLocalService, companyPersistence, counterLocalService, countryPersistence, emailAddressLocalService, emailAddressPersistence, expandoRowLocalService, expandoRowPersistence, groupFinder, groupLocalService, groupPersistence, listTypeLocalService, listTypePersistence, organizationFinder, organizationLocalService, organizationPersistence, passwordPolicyFinder, passwordPolicyLocalService, passwordPolicyPersistence, passwordPolicyRelLocalService, passwordPolicyRelPersistence, persistedModelLocalServiceRegistry, phoneLocalService, phonePersistence, regionPersistence, resourceLocalService, roleFinder, roleLocalService, rolePersistence, userFinder, userGroupRoleFinder, userGroupRoleLocalService, userGroupRolePersistence, userLocalService, userPersistence, websiteLocalService, websitePersistence
Constructor and Description |
---|
OrganizationLocalServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addGroupOrganization(long groupId,
long organizationId)
Adds the organization to the group.
|
void |
addGroupOrganization(long groupId,
com.liferay.portal.kernel.model.Organization organization)
Adds the organization to the group.
|
void |
addGroupOrganizations(long groupId,
List<com.liferay.portal.kernel.model.Organization> organizations)
Adds the organizations to the group.
|
void |
addGroupOrganizations(long groupId,
long[] organizationIds)
Adds the organizations to the group.
|
com.liferay.portal.kernel.model.Organization |
addOrganization(long userId,
long parentOrganizationId,
String name,
boolean site)
Adds an organization.
|
com.liferay.portal.kernel.model.Organization |
addOrganization(long userId,
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 |
addOrganizationResources(long userId,
com.liferay.portal.kernel.model.Organization organization)
Adds a resource for each type of permission available on the
organization.
|
void |
addPasswordPolicyOrganizations(long passwordPolicyId,
long[] organizationIds)
Assigns the password policy to the organizations, removing any other
currently assigned password policies.
|
protected void |
addSuborganizations(List<com.liferay.portal.kernel.model.Organization> allSuborganizations,
List<com.liferay.portal.kernel.model.Organization> organizations) |
protected com.liferay.portal.kernel.search.SearchContext |
buildSearchContext(long companyId,
long parentOrganizationId,
String name,
String type,
String street,
String city,
String zip,
Long regionId,
Long countryId,
LinkedHashMap<String,Object> params,
boolean andSearch,
int start,
int end,
com.liferay.portal.kernel.search.Sort sort) |
protected com.liferay.portal.kernel.search.SearchContext |
buildSearchContext(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,
com.liferay.portal.kernel.search.Sort sort) |
void |
deleteLogo(long organizationId)
Deletes the organization's logo.
|
com.liferay.portal.kernel.model.Organization |
deleteOrganization(long organizationId)
Deletes the organization.
|
com.liferay.portal.kernel.model.Organization |
deleteOrganization(com.liferay.portal.kernel.model.Organization organization)
Deletes the organization.
|
com.liferay.portal.kernel.model.Organization |
fetchOrganization(long companyId,
String name)
Returns the organization with the name.
|
List<com.liferay.portal.kernel.model.Organization> |
getGroupUserOrganizations(long groupId,
long userId) |
List<com.liferay.portal.kernel.model.Organization> |
getNoAssetOrganizations() |
com.liferay.portal.kernel.model.Organization |
getOrganization(long companyId,
String name)
Returns the organization with the name.
|
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[] organizationIds)
Returns the organizations with the primary keys.
|
List<com.liferay.portal.kernel.model.Organization> |
getOrganizations(long userId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc) |
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.
|
List<com.liferay.portal.kernel.model.Organization> |
getOrganizations(long companyId,
long parentOrganizationId,
String name,
int start,
int end) |
List<com.liferay.portal.kernel.model.Organization> |
getOrganizations(long companyId,
String treePath) |
int |
getOrganizationsCount(long companyId,
long parentOrganizationId)
Returns the number of organizations belonging to the parent organization.
|
int |
getOrganizationsCount(long companyId,
long parentOrganizationId,
String name) |
protected long |
getParentOrganizationId(long companyId,
long parentOrganizationId) |
List<com.liferay.portal.kernel.model.Organization> |
getParentOrganizations(long organizationId)
Returns the parent organizations in order by closest ancestor.
|
protected long[] |
getReindexOrganizationIds(com.liferay.portal.kernel.model.Organization organization) |
List<com.liferay.portal.kernel.model.Organization> |
getSuborganizations(List<com.liferay.portal.kernel.model.Organization> organizations)
Returns the suborganizations of the organizations.
|
List<com.liferay.portal.kernel.model.Organization> |
getSuborganizations(long companyId,
long organizationId)
Returns the suborganizations of the organization.
|
int |
getSuborganizationsCount(long companyId,
long organizationId)
Returns the count of suborganizations of the organization.
|
List<com.liferay.portal.kernel.model.Organization> |
getSubsetOrganizations(List<com.liferay.portal.kernel.model.Organization> allOrganizations,
List<com.liferay.portal.kernel.model.Organization> availableOrganizations)
Returns the intersection of
allOrganizations and
availableOrganizations . |
long[] |
getUserOrganizationIds(long userId,
boolean includeAdministrative)
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.
|
List<com.liferay.portal.kernel.model.Organization> |
getUserOrganizations(long userId,
boolean includeAdministrative)
Returns all the organizations with which the user is explicitly
associated, optionally including the organizations that the user
administers or owns.
|
boolean |
hasPasswordPolicyOrganization(long passwordPolicyId,
long organizationId)
Returns
true if the password policy has been assigned to the
organization. |
boolean |
hasUserOrganization(long userId,
long organizationId,
boolean inheritSuborganizations,
boolean includeSpecifiedOrganization)
Returns
true if the user is a member of the organization,
optionally focusing on suborganizations or the specified organization. |
protected boolean |
isOrganizationGroup(long organizationId,
long groupId) |
protected boolean |
isParentOrganization(long parentOrganizationId,
long organizationId) |
protected boolean |
isUseCustomSQL(LinkedHashMap<String,Object> params) |
void |
rebuildTree(long companyId)
Rebuilds the organization's tree.
|
protected void |
reindex(long companyId,
long[] userIds) |
protected void |
reindexUsers(List<com.liferay.portal.kernel.model.Organization> organizations) |
protected void |
reindexUsers(long organizationId) |
protected void |
reindexUsers(long[] organizationIds) |
protected void |
reindexUsers(com.liferay.portal.kernel.model.Organization organization) |
com.liferay.portal.kernel.search.Hits |
search(long companyId,
long parentOrganizationId,
String keywords,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.search.Sort sort)
Returns an ordered range of all the organizations that match the
keywords, using the indexer.
|
List<com.liferay.portal.kernel.model.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.
|
List<com.liferay.portal.kernel.model.Organization> |
search(long companyId,
long parentOrganizationId,
String keywords,
String type,
Long regionId,
Long countryId,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc)
Returns an ordered range of all the organizations that match the
keywords, type, region, and country, without using the indexer.
|
List<com.liferay.portal.kernel.model.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.
|
List<com.liferay.portal.kernel.model.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,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc)
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.
|
com.liferay.portal.kernel.search.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,
com.liferay.portal.kernel.search.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.
|
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.
|
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.
|
com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.Organization> |
searchOrganizations(long companyId,
long parentOrganizationId,
String keywords,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.search.Sort sort) |
com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.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,
com.liferay.portal.kernel.search.Sort sort) |
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.
|
void |
updateAsset(long userId,
com.liferay.portal.kernel.model.Organization organization,
long[] assetCategoryIds,
String[] assetTagNames)
Updates the organization's asset with the new asset categories and tag
names, removing and adding asset categories and tag names as necessary.
|
com.liferay.portal.kernel.model.Organization |
updateOrganization(long companyId,
long organizationId,
long parentOrganizationId,
String name,
String type,
long regionId,
long countryId,
long statusId,
String comments,
boolean logo,
byte[] logoBytes,
boolean site,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
Updates the organization.
|
com.liferay.portal.kernel.model.Organization |
updateOrganization(long companyId,
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)
Deprecated.
As of Wilberforce (7.0.x), replaced by
updateOrganization(long, long, long, String, String, long,
long, long, String, boolean, byte[], boolean,
ServiceContext) |
protected void |
validate(long companyId,
long organizationId,
long parentOrganizationId,
String name,
String type,
long countryId,
long statusId) |
protected void |
validate(long companyId,
long parentOrganizationId,
String name,
String type,
long countryId,
long statusId) |
addOrganization, addUserOrganization, addUserOrganization, addUserOrganizations, addUserOrganizations, afterPropertiesSet, clearGroupOrganizations, clearUserOrganizations, createOrganization, deleteGroupOrganization, deleteGroupOrganization, deleteGroupOrganizations, deleteGroupOrganizations, deletePersistedModel, deleteUserOrganization, deleteUserOrganization, deleteUserOrganizations, deleteUserOrganizations, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchOrganization, fetchOrganizationByUuidAndCompanyId, getActionableDynamicQuery, getAddressLocalService, getAddressPersistence, getAssetCategoryFinder, getAssetCategoryLocalService, getAssetCategoryPersistence, getAssetEntryFinder, getAssetEntryLocalService, getAssetEntryPersistence, getAssetTagFinder, getAssetTagLocalService, getAssetTagPersistence, getCompanyLocalService, getCompanyPersistence, getCounterLocalService, getCountryPersistence, getEmailAddressLocalService, getEmailAddressPersistence, getExpandoRowLocalService, getExpandoRowPersistence, getExportActionableDynamicQuery, getGroupFinder, getGroupLocalService, getGroupOrganizations, getGroupOrganizations, getGroupOrganizations, getGroupOrganizationsCount, getGroupPersistence, getGroupPrimaryKeys, getIndexableActionableDynamicQuery, getListTypeLocalService, getListTypePersistence, getModelClass, getModelClassName, getOrganization, getOrganizationByUuidAndCompanyId, getOrganizationFinder, getOrganizationLocalService, getOrganizationPersistence, getOrganizations, getOrganizationsCount, getOSGiServiceIdentifier, getPasswordPolicyFinder, getPasswordPolicyLocalService, getPasswordPolicyPersistence, getPasswordPolicyRelLocalService, getPasswordPolicyRelPersistence, getPersistedModel, getPhoneLocalService, getPhonePersistence, getRegionPersistence, getResourceLocalService, getRoleFinder, getRoleLocalService, getRolePersistence, getUserFinder, getUserGroupRoleFinder, getUserGroupRoleLocalService, getUserGroupRolePersistence, getUserLocalService, getUserOrganizations, getUserOrganizations, getUserOrganizations, getUserOrganizationsCount, getUserPersistence, getUserPrimaryKeys, getWebsiteLocalService, getWebsitePersistence, hasGroupOrganization, hasGroupOrganizations, hasUserOrganization, hasUserOrganizations, initActionableDynamicQuery, runSQL, setAddressLocalService, setAddressPersistence, setAssetCategoryFinder, setAssetCategoryLocalService, setAssetCategoryPersistence, setAssetEntryFinder, setAssetEntryLocalService, setAssetEntryPersistence, setAssetTagFinder, setAssetTagLocalService, setAssetTagPersistence, setCompanyLocalService, setCompanyPersistence, setCounterLocalService, setCountryPersistence, setEmailAddressLocalService, setEmailAddressPersistence, setExpandoRowLocalService, setExpandoRowPersistence, setGroupFinder, setGroupLocalService, setGroupOrganizations, setGroupPersistence, setListTypeLocalService, setListTypePersistence, setOrganizationFinder, setOrganizationLocalService, setOrganizationPersistence, setPasswordPolicyFinder, setPasswordPolicyLocalService, setPasswordPolicyPersistence, setPasswordPolicyRelLocalService, setPasswordPolicyRelPersistence, setPhoneLocalService, setPhonePersistence, setRegionPersistence, setResourceLocalService, setRoleFinder, setRoleLocalService, setRolePersistence, setUserFinder, setUserGroupRoleFinder, setUserGroupRoleLocalService, setUserGroupRolePersistence, setUserLocalService, setUserOrganizations, setUserPersistence, setWebsiteLocalService, setWebsitePersistence, updateOrganization
public void addGroupOrganization(long groupId, long organizationId)
addGroupOrganization
in interface com.liferay.portal.kernel.service.OrganizationLocalService
addGroupOrganization
in class OrganizationLocalServiceBaseImpl
groupId
- the primary key of the grouporganizationId
- the primary key of the organizationpublic void addGroupOrganization(long groupId, com.liferay.portal.kernel.model.Organization organization)
addGroupOrganization
in interface com.liferay.portal.kernel.service.OrganizationLocalService
addGroupOrganization
in class OrganizationLocalServiceBaseImpl
groupId
- the primary key of the grouporganization
- the organizationpublic void addGroupOrganizations(long groupId, List<com.liferay.portal.kernel.model.Organization> organizations)
addGroupOrganizations
in interface com.liferay.portal.kernel.service.OrganizationLocalService
addGroupOrganizations
in class OrganizationLocalServiceBaseImpl
groupId
- the primary key of the grouporganizations
- the organizationspublic void addGroupOrganizations(long groupId, long[] organizationIds)
addGroupOrganizations
in interface com.liferay.portal.kernel.service.OrganizationLocalService
addGroupOrganizations
in class OrganizationLocalServiceBaseImpl
groupId
- the primary key of the grouporganizationIds
- the primary keys of the organizationspublic com.liferay.portal.kernel.model.Organization addOrganization(long userId, long parentOrganizationId, String name, boolean site) throws com.liferay.portal.kernel.exception.PortalException
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)
.
userId
- the primary key of the creator/owner of the organizationparentOrganizationId
- the primary key of the organization's parent
organizationname
- the organization's namesite
- whether the organization is to be associated with a main
sitecom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Organization addOrganization(long userId, 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
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)
.
userId
- the primary key of the creator/owner of the organizationparentOrganizationId
- the primary key of the organization's parent
organizationname
- the organization's nametype
- the organization's typeregionId
- the primary key of the organization's regioncountryId
- the primary key of the organization's countrystatusId
- the organization's workflow statuscomments
- the comments about the organizationsite
- whether the organization is to be associated with a main
siteserviceContext
- the service context to be applied (optionally
null
). Can set asset category IDs, asset tag names,
and expando bridge attributes for the organization.com.liferay.portal.kernel.exception.PortalException
public void addOrganizationResources(long userId, com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException
userId
- the primary key of the creator/owner of the organizationorganization
- the organizationcom.liferay.portal.kernel.exception.PortalException
public void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
passwordPolicyId
- the primary key of the password policyorganizationIds
- the primary keys of the organizationspublic void deleteLogo(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
organizationId
- the primary key of the organizationcom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Organization deleteOrganization(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
deleteOrganization
in interface com.liferay.portal.kernel.service.OrganizationLocalService
deleteOrganization
in class OrganizationLocalServiceBaseImpl
organizationId
- the primary key of the organizationcom.liferay.portal.kernel.exception.PortalException
- if a organization with the primary key could not be found@SystemEvent(type=1) public com.liferay.portal.kernel.model.Organization deleteOrganization(com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException
deleteOrganization
in interface com.liferay.portal.kernel.service.OrganizationLocalService
deleteOrganization
in class OrganizationLocalServiceBaseImpl
organization
- the organizationcom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Organization fetchOrganization(long companyId, String name)
companyId
- the primary key of the organization's companyname
- the organization's namenull
if no
organization could be foundpublic List<com.liferay.portal.kernel.model.Organization> getGroupUserOrganizations(long groupId, long userId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Organization> getNoAssetOrganizations()
public com.liferay.portal.kernel.model.Organization getOrganization(long companyId, String name) throws com.liferay.portal.kernel.exception.PortalException
companyId
- the primary key of the organization's companyname
- the organization's namecom.liferay.portal.kernel.exception.PortalException
public long getOrganizationId(long companyId, String name)
companyId
- the primary key of the organization's companyname
- the organization's name0
if the organization could not be foundpublic List<com.liferay.portal.kernel.model.Organization> getOrganizations(long userId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, long parentOrganizationId)
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationpublic List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, long parentOrganizationId, int start, int end)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationstart
- the lower bound of the range of organizations to returnend
- the upper bound of the range of organizations to return (not
inclusive)OrganizationPersistence.findByC_P(
long, long, int, int)
public List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, long parentOrganizationId, String name, int start, int end)
public List<com.liferay.portal.kernel.model.Organization> getOrganizations(long companyId, String treePath)
public List<com.liferay.portal.kernel.model.Organization> getOrganizations(long[] organizationIds) throws com.liferay.portal.kernel.exception.PortalException
organizationIds
- the primary keys of the organizationscom.liferay.portal.kernel.exception.PortalException
public int getOrganizationsCount(long companyId, long parentOrganizationId)
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationpublic int getOrganizationsCount(long companyId, long parentOrganizationId, String name)
public List<com.liferay.portal.kernel.model.Organization> getParentOrganizations(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
organizationId
- the primary key of the organizationcom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Organization> getSuborganizations(List<com.liferay.portal.kernel.model.Organization> organizations)
organizations
- the organizations from which to get
suborganizationspublic List<com.liferay.portal.kernel.model.Organization> getSuborganizations(long companyId, long organizationId)
companyId
- the primary key of the organization's companyorganizationId
- the primary key of the organizationpublic int getSuborganizationsCount(long companyId, long organizationId)
companyId
- the primary key of the organization's companyorganizationId
- the primary key of the organizationpublic List<com.liferay.portal.kernel.model.Organization> getSubsetOrganizations(List<com.liferay.portal.kernel.model.Organization> allOrganizations, List<com.liferay.portal.kernel.model.Organization> availableOrganizations)
allOrganizations
and
availableOrganizations
.allOrganizations
- the organizations to check for availabilityavailableOrganizations
- the available organizationsallOrganizations
and
availableOrganizations
public long[] getUserOrganizationIds(long userId, boolean includeAdministrative) throws com.liferay.portal.kernel.exception.PortalException
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.
userId
- the primary key of the userincludeAdministrative
- whether to include the IDs of organizations
that the user administers or owns, even if he's not a member of
the organizationscom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Organization> getUserOrganizations(long userId, boolean includeAdministrative) throws com.liferay.portal.kernel.exception.PortalException
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.
userId
- the primary key of the userincludeAdministrative
- whether to include the IDs of organizations
that the user administers or owns, even if he's not a member of
the organizationscom.liferay.portal.kernel.exception.PortalException
public boolean hasPasswordPolicyOrganization(long passwordPolicyId, long organizationId)
true
if the password policy has been assigned to the
organization.passwordPolicyId
- the primary key of the password policyorganizationId
- the primary key of the organizationtrue
if the password policy has been assigned to the
organization; false
otherwisepublic boolean hasUserOrganization(long userId, long organizationId, boolean inheritSuborganizations, boolean includeSpecifiedOrganization) throws com.liferay.portal.kernel.exception.PortalException
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.
inheritSuborganizations=false
:
the method checks whether the user belongs to the organization specified
by organizationId
. The parameter
includeSpecifiedOrganization
is ignored.
includeSpecifiedOrganization
is
ignored unless inheritSuborganizations
is also
true
.
inheritSuborganizations=true
and
includeSpecifiedOrganization=false
: the method
checks
whether the user belongs to one of the child organizations of the one
specified by organizationId
.
inheritSuborganizations=true
and
includeSpecifiedOrganization=true
: the method
checks whether
the user belongs to the organization specified by
organizationId
or any of
its child organizations.
userId
- the primary key of the organization's userorganizationId
- the primary key of the organizationinheritSuborganizations
- if true
suborganizations are
considered in the determinationincludeSpecifiedOrganization
- if true
the
organization specified by organizationId
is
considered in the determinationtrue
if the user has access to the organization;
false
otherwisecom.liferay.portal.kernel.exception.PortalException
OrganizationFinder
public void rebuildTree(long companyId) throws com.liferay.portal.kernel.exception.PortalException
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.
companyId
- the primary key of the organization's companycom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.search.Hits search(long companyId, long parentOrganizationId, String keywords, LinkedHashMap<String,Object> params, int start, int end, com.liferay.portal.kernel.search.Sort sort)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationkeywords
- 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
). For
more information see OrganizationIndexer
start
- the lower bound of the range of organizations to returnend
- the upper bound of the range of organizations to return (not
inclusive)sort
- the field and direction by which to sort (optionally
null
)OrganizationIndexer
public List<com.liferay.portal.kernel.model.Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationkeywords
- 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 returnend
- the upper bound of the range of organizations to return (not
inclusive)OrganizationFinder
public List<com.liferay.portal.kernel.model.Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationkeywords
- 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 returnend
- the upper bound of the range of organizations to return (not
inclusive)obc
- the comparator to order the organizations (optionally
null
)obc
OrganizationFinder
public List<com.liferay.portal.kernel.model.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)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parentname
- 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 returnend
- the upper bound of the range of organizations to return (not
inclusive)OrganizationFinder
public List<com.liferay.portal.kernel.model.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, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Organization> obc)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationname
- 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 returnend
- the upper bound of the range of organizations to return (not
inclusive)obc
- the comparator to order the organizations (optionally
null
)obc
OrganizationFinder
public com.liferay.portal.kernel.search.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, com.liferay.portal.kernel.search.Sort sort)
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.
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationname
- 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
). For
more information see OrganizationIndexer
.andSearch
- whether every field must match its keywords or just one
fieldstart
- the lower bound of the range of organizations to returnend
- the upper bound of the range of organizations to return (not
inclusive)sort
- the field and direction by which to sort (optionally
null
)sort
OrganizationIndexer
public int searchCount(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params)
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationkeywords
- 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
OrganizationFinder
public 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)
companyId
- the primary key of the organization's companyparentOrganizationId
- the primary key of the organization's parent
organizationname
- 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'".OrganizationFinder
public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.Organization> searchOrganizations(long companyId, long parentOrganizationId, String keywords, LinkedHashMap<String,Object> params, int start, int end, com.liferay.portal.kernel.search.Sort sort) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.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, com.liferay.portal.kernel.search.Sort sort) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public void unsetGroupOrganizations(long groupId, long[] organizationIds)
groupId
- the primary key of the grouporganizationIds
- the primary keys of the organizationspublic void unsetPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
passwordPolicyId
- the primary key of the password policyorganizationIds
- the primary keys of the organizationspublic void updateAsset(long userId, com.liferay.portal.kernel.model.Organization organization, long[] assetCategoryIds, String[] assetTagNames) throws com.liferay.portal.kernel.exception.PortalException
userId
- the primary key of the userorganization
- the organizationassetCategoryIds
- the primary keys of the asset categoriesassetTagNames
- the asset tag namescom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Organization updateOrganization(long companyId, long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean logo, byte[] logoBytes, boolean site, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException
companyId
- the primary key of the organization's companyorganizationId
- the primary key of the organizationparentOrganizationId
- the primary key of organization's parent
organizationname
- the organization's nametype
- the organization's typeregionId
- the primary key of the organization's regioncountryId
- the primary key of the organization's countrystatusId
- the organization's workflow statuscomments
- the comments about the organizationlogo
- whether to update the ogranization's logologoBytes
- the new logo image datasite
- whether the organization is to be associated with a main
siteserviceContext
- 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.com.liferay.portal.kernel.exception.PortalException
@Deprecated public com.liferay.portal.kernel.model.Organization updateOrganization(long companyId, 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
updateOrganization(long, long, long, String, String, long,
long, long, String, boolean, byte[], boolean,
ServiceContext)
companyId
- the primary key of the organization's companyorganizationId
- the primary key of the organizationparentOrganizationId
- the primary key of organization's parent
organizationname
- the organization's nametype
- the organization's typeregionId
- the primary key of the organization's regioncountryId
- the primary key of the organization's countrystatusId
- the organization's workflow statuscomments
- the comments about the organizationsite
- whether the organization is to be associated with a main
siteserviceContext
- 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.com.liferay.portal.kernel.exception.PortalException
protected void addSuborganizations(List<com.liferay.portal.kernel.model.Organization> allSuborganizations, List<com.liferay.portal.kernel.model.Organization> organizations)
protected com.liferay.portal.kernel.search.SearchContext buildSearchContext(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, com.liferay.portal.kernel.search.Sort sort)
protected com.liferay.portal.kernel.search.SearchContext buildSearchContext(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, com.liferay.portal.kernel.search.Sort sort)
protected long getParentOrganizationId(long companyId, long parentOrganizationId)
protected long[] getReindexOrganizationIds(com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected boolean isOrganizationGroup(long organizationId, long groupId)
protected boolean isParentOrganization(long parentOrganizationId, long organizationId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected boolean isUseCustomSQL(LinkedHashMap<String,Object> params)
protected void reindex(long companyId, long[] userIds) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void reindexUsers(List<com.liferay.portal.kernel.model.Organization> organizations) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void reindexUsers(long organizationId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void reindexUsers(long[] organizationIds) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void reindexUsers(com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void validate(long companyId, long organizationId, long parentOrganizationId, String name, String type, long countryId, long statusId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void validate(long companyId, long parentOrganizationId, String name, String type, long countryId, long statusId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException