@ProviderType
public class OrganizationServiceUtil
extends Object
OrganizationServiceImpl
and is the
primary access point for service operations in application layer code running
on a remote server. Methods of this service are expected to have security
checks based on the propagated JAAS credentials because this service can be
accessed remotely.OrganizationService
,
OrganizationServiceBaseImpl
,
OrganizationServiceImpl
Constructor and Description |
---|
OrganizationServiceUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addGroupOrganizations(long groupId,
long[] organizationIds)
Adds the organizations to the group.
|
static Organization |
addOrganization(long parentOrganizationId,
String name,
String type,
long regionId,
long countryId,
long statusId,
String comments,
boolean site,
List<Address> addresses,
List<EmailAddress> emailAddresses,
List<OrgLabor> orgLabors,
List<Phone> phones,
List<Website> websites,
ServiceContext serviceContext)
Adds an organization with additional parameters.
|
static Organization |
addOrganization(long parentOrganizationId,
String name,
String type,
long regionId,
long countryId,
long statusId,
String comments,
boolean site,
ServiceContext serviceContext)
Adds an organization.
|
static void |
addPasswordPolicyOrganizations(long passwordPolicyId,
long[] organizationIds)
Assigns the password policy to the organizations, removing any other
currently assigned password policies.
|
static void |
deleteLogo(long organizationId)
Deletes the organization's logo.
|
static void |
deleteOrganization(long organizationId)
Deletes the organization.
|
static Organization |
fetchOrganization(long organizationId)
Returns the organization with the primary key.
|
static List<Organization> |
getGtOrganizations(long gtOrganizationId,
long companyId,
long parentOrganizationId,
int size) |
static Organization |
getOrganization(long organizationId)
Returns the organization with the primary key.
|
static long |
getOrganizationId(long companyId,
String name)
Returns the primary key of the organization with the name.
|
static List<Organization> |
getOrganizations(long companyId,
long parentOrganizationId)
Returns all the organizations belonging to the parent organization.
|
static List<Organization> |
getOrganizations(long companyId,
long parentOrganizationId,
int start,
int end)
Returns a range of all the organizations belonging to the parent
organization.
|
static List<Organization> |
getOrganizations(long companyId,
long parentOrganizationId,
String name,
int start,
int end) |
static int |
getOrganizationsCount(long companyId,
long parentOrganizationId)
Returns the number of organizations belonging to the parent organization.
|
static int |
getOrganizationsCount(long companyId,
long parentOrganizationId,
String name) |
static String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
static OrganizationService |
getService() |
static List<Organization> |
getUserOrganizations(long userId)
Returns all the organizations with which the user is explicitly
associated.
|
static void |
setGroupOrganizations(long groupId,
long[] organizationIds)
Sets the organizations in the group, removing and adding organizations to
the group as necessary.
|
static void |
unsetGroupOrganizations(long groupId,
long[] organizationIds)
Removes the organizations from the group.
|
static void |
unsetPasswordPolicyOrganizations(long passwordPolicyId,
long[] organizationIds)
Removes the organizations from the password policy.
|
static 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<Address> addresses,
List<EmailAddress> emailAddresses,
List<OrgLabor> orgLabors,
List<Phone> phones,
List<Website> websites,
ServiceContext serviceContext)
Updates the organization with additional parameters.
|
static Organization |
updateOrganization(long organizationId,
long parentOrganizationId,
String name,
String type,
long regionId,
long countryId,
long statusId,
String comments,
boolean site,
List<Address> addresses,
List<EmailAddress> emailAddresses,
List<OrgLabor> orgLabors,
List<Phone> phones,
List<Website> websites,
ServiceContext serviceContext)
Deprecated.
As of Wilberforce (7.0.x), replaced by
updateOrganization(long, long, String, String, long, long,
long, String, boolean, byte[], boolean, List, List, List,
List, List, ServiceContext) |
static Organization |
updateOrganization(long organizationId,
long parentOrganizationId,
String name,
String type,
long regionId,
long countryId,
long statusId,
String comments,
boolean site,
ServiceContext serviceContext)
Updates the organization.
|
public static void addGroupOrganizations(long groupId, long[] organizationIds) throws PortalException
groupId
- the primary key of the grouporganizationIds
- the primary keys of the organizationsPortalException
public static Organization addOrganization(long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, List<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
This method handles the creation and bookkeeping of the organization including its resources, metadata, and internal data structures.
parentOrganizationId
- 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
siteaddresses
- the organization's addressesemailAddresses
- the organization's email addressesorgLabors
- the organization's hours of operationphones
- the organization's phone numberswebsites
- the organization's websitesserviceContext
- the service context to be applied (optionally
null
). Can set asset category IDs, asset tag names,
and expando bridge attributes for the organization.PortalException
public static Organization addOrganization(long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, ServiceContext serviceContext) throws PortalException
This method handles the creation and bookkeeping of the organization including its resources, metadata, and internal data structures.
parentOrganizationId
- 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.PortalException
public static void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds) throws PortalException
passwordPolicyId
- the primary key of the password policyorganizationIds
- the primary keys of the organizationsPortalException
public static void deleteLogo(long organizationId) throws PortalException
organizationId
- the primary key of the organizationPortalException
public static void deleteOrganization(long organizationId) throws PortalException
organizationId
- the primary key of the organizationPortalException
public static Organization fetchOrganization(long organizationId) throws PortalException
organizationId
- the primary key of the organizationnull
if an
organization with the primary key could not be found or if the
user did not have permission to view the organizationPortalException
public static List<Organization> getGtOrganizations(long gtOrganizationId, long companyId, long parentOrganizationId, int size)
public static Organization getOrganization(long organizationId) throws PortalException
organizationId
- the primary key of the organizationPortalException
public static long getOrganizationId(long companyId, String name) throws PortalException
companyId
- the primary key of the organization's companyname
- the organization's name0
if the organization could not be foundPortalException
public static List<Organization> getOrganizations(long companyId, long parentOrganizationId)
companyId
- the primary key of the organizations' companyparentOrganizationId
- the primary key of the organizations' parent
organizationpublic static List<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 organizations' companyparentOrganizationId
- the primary key of the organizations' parent
organizationstart
- the lower bound of the range of organizations to returnend
- the upper bound of the range of organizations to return (not
inclusive)public static List<Organization> getOrganizations(long companyId, long parentOrganizationId, String name, int start, int end)
public static int getOrganizationsCount(long companyId, long parentOrganizationId)
companyId
- the primary key of the organizations' companyparentOrganizationId
- the primary key of the organizations' parent
organizationpublic static int getOrganizationsCount(long companyId, long parentOrganizationId, String name) throws PortalException
PortalException
public static String getOSGiServiceIdentifier()
public static List<Organization> getUserOrganizations(long userId) throws 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 userPortalException
public static void setGroupOrganizations(long groupId, long[] organizationIds) throws PortalException
groupId
- the primary key of the grouporganizationIds
- the primary keys of the organizationsPortalException
public static void unsetGroupOrganizations(long groupId, long[] organizationIds) throws PortalException
groupId
- the primary key of the grouporganizationIds
- the primary keys of the organizationsPortalException
public static void unsetPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds) throws PortalException
passwordPolicyId
- the primary key of the password policyorganizationIds
- the primary keys of the organizationsPortalException
public static 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<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
organizationId
- the primary key 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 organizationlogo
- whether to update the ogranization's logologoBytes
- the new logo image datasite
- whether the organization is to be associated with a main
siteaddresses
- the organization's addressesemailAddresses
- the organization's email addressesorgLabors
- the organization's hours of operationphones
- the organization's phone numberswebsites
- the organization's websitesserviceContext
- 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.PortalException
@Deprecated public static Organization updateOrganization(long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, List<Address> addresses, List<EmailAddress> emailAddresses, List<OrgLabor> orgLabors, List<Phone> phones, List<Website> websites, ServiceContext serviceContext) throws PortalException
updateOrganization(long, long, String, String, long, long,
long, String, boolean, byte[], boolean, List, List, List,
List, List, ServiceContext)
organizationId
- the primary key 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
siteaddresses
- the organization's addressesemailAddresses
- the organization's email addressesorgLabors
- the organization's hours of operationphones
- the organization's phone numberswebsites
- the organization's websitesserviceContext
- 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.PortalException
public static Organization updateOrganization(long organizationId, long parentOrganizationId, String name, String type, long regionId, long countryId, long statusId, String comments, boolean site, ServiceContext serviceContext) throws PortalException
organizationId
- the primary key 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 and asset tag
names for the organization, and merge expando bridge attributes
for the organization.PortalException
public static OrganizationService getService()