Liferay 6.0-ee-sp2

com.liferay.portal.service
Class OrganizationLocalServiceUtil

java.lang.Object
  extended by com.liferay.portal.service.OrganizationLocalServiceUtil

public class OrganizationLocalServiceUtil
extends Object

The utility for the organization local service. This utility wraps com.liferay.portal.service.impl.OrganizationLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server.

This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
OrganizationLocalService, OrganizationLocalServiceBaseImpl, com.liferay.portal.service.impl.OrganizationLocalServiceImpl

Constructor Summary
OrganizationLocalServiceUtil()
           
 
Method Summary
static void addGroupOrganizations(long groupId, long[] organizationIds)
           
static Organization addOrganization(long userId, long parentOrganizationId, String name, String type, boolean recursable, long regionId, long countryId, int statusId, String comments, ServiceContext serviceContext)
           
static Organization addOrganization(Organization organization)
          Adds the organization to the database.
static void addOrganizationResources(long userId, Organization organization)
           
static void addPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
           
static Organization createOrganization(long organizationId)
          Creates a new organization with the primary key.
static void deleteLogo(long organizationId)
           
static void deleteOrganization(long organizationId)
          Deletes the organization with the primary key from the database.
static void deleteOrganization(Organization organization)
          Deletes the organization from the database.
static List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
static long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows that match the dynamic query.
static String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
static List<Organization> getGroupOrganizations(long groupId)
           
static Organization getOrganization(long organizationId)
          Returns the organization with the primary key.
static Organization getOrganization(long companyId, String name)
           
static long getOrganizationId(long companyId, String name)
           
static List<Organization> getOrganizations(int start, int end)
          Returns a range of all the organizations.
static List<Organization> getOrganizations(long[] organizationIds)
           
static List<Organization> getOrganizations(long companyId, long parentOrganizationId)
           
static List<Organization> getOrganizations(long companyId, long parentOrganizationId, int start, int end)
           
static int getOrganizationsCount()
          Returns the number of organizations.
static int getOrganizationsCount(long companyId, long parentOrganizationId)
           
static List<Organization> getParentOrganizations(long organizationId)
           
static PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
static OrganizationLocalService getService()
           
static List<Organization> getSuborganizations(List<Organization> organizations)
           
static List<Organization> getSubsetOrganizations(List<Organization> allOrganizations, List<Organization> availableOrganizations)
           
static List<Organization> getUserOrganizations(long userId)
           
static List<Organization> getUserOrganizations(long userId, boolean inheritUserGroups)
           
static List<Organization> getUserOrganizations(long userId, boolean inheritUserGroups, int start, int end)
           
static List<Organization> getUserOrganizations(long userId, int start, int end)
           
static int getUserOrganizationsCount(long userId)
           
static boolean hasGroupOrganization(long groupId, long organizationId)
           
static boolean hasPasswordPolicyOrganization(long passwordPolicyId, long organizationId)
           
static boolean hasUserOrganization(long userId, long organizationId)
           
static boolean hasUserOrganization(long userId, long organizationId, boolean inheritSuborganizations, boolean inheritUserGroups, boolean includeSpecifiedOrganization)
           
static void rebuildTree(long companyId, boolean force)
           
static Hits search(long companyId, long parentOrganizationId, String keywords, LinkedHashMap<String,Object> params, int start, int end, Sort sort)
           
static List<Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end)
           
static List<Organization> search(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator obc)
           
static List<Organization> search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andOperator, int start, int end)
           
static List<Organization> search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, Long regionId, Long countryId, LinkedHashMap<String,Object> params, boolean andOperator, int start, int end, OrderByComparator obc)
           
static Hits search(long companyId, long parentOrganizationId, String name, String type, String street, String city, String zip, String region, String country, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
           
static int searchCount(long companyId, long parentOrganizationId, String keywords, String type, Long regionId, Long countryId, LinkedHashMap<String,Object> params)
           
static 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)
           
static void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
static void setGroupOrganizations(long groupId, long[] organizationIds)
           
 void setService(OrganizationLocalService service)
           
static void unsetGroupOrganizations(long groupId, long[] organizationIds)
           
static void unsetPasswordPolicyOrganizations(long passwordPolicyId, long[] organizationIds)
           
static void updateAsset(long userId, Organization organization, long[] assetCategoryIds, String[] assetTagNames)
           
static Organization updateOrganization(long companyId, long organizationId, long parentOrganizationId, String name, String type, boolean recursable, long regionId, long countryId, int statusId, String comments, ServiceContext serviceContext)
           
static Organization updateOrganization(Organization organization)
          Updates the organization in the database or adds it if it does not yet exist.
static Organization updateOrganization(Organization organization, boolean merge)
          Updates the organization in the database or adds it if it does not yet exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrganizationLocalServiceUtil

public OrganizationLocalServiceUtil()
Method Detail

addOrganization

public static Organization addOrganization(Organization organization)
                                    throws SystemException
Adds the organization to the database. Also notifies the appropriate model listeners.

Parameters:
organization - the organization
Returns:
the organization that was added
Throws:
SystemException - if a system exception occurred

createOrganization

public static Organization createOrganization(long organizationId)
Creates a new organization with the primary key. Does not add the organization to the database.

Parameters:
organizationId - the primary key for the new organization
Returns:
the new organization

deleteOrganization

public static void deleteOrganization(long organizationId)
                               throws PortalException,
                                      SystemException
Deletes the organization with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
organizationId - the primary key of the organization
Throws:
PortalException - if a organization with the primary key could not be found
SystemException - if a system exception occurred

deleteOrganization

public static void deleteOrganization(Organization organization)
                               throws PortalException,
                                      SystemException
Deletes the organization from the database. Also notifies the appropriate model listeners.

Parameters:
organization - the organization
Throws:
PortalException
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery)
                         throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end)
                         throws SystemException
Performs a dynamic query on the database and returns a range of the matching rows.

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

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end,
                                OrderByComparator orderByComparator)
                         throws SystemException
Performs a dynamic query on the database and returns an ordered range of the matching rows.

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

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

public static long dynamicQueryCount(DynamicQuery dynamicQuery)
                              throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

getOrganization

public static Organization getOrganization(long organizationId)
                                    throws PortalException,
                                           SystemException
Returns the organization with the primary key.

Parameters:
organizationId - the primary key of the organization
Returns:
the organization
Throws:
PortalException - if a organization with the primary key could not be found
SystemException - if a system exception occurred

getPersistedModel

public static PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                        throws PortalException,
                                               SystemException
Throws:
PortalException
SystemException

getOrganizations

public static List<Organization> getOrganizations(int start,
                                                  int end)
                                           throws SystemException
Returns a range of all the organizations.

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

Parameters:
start - the lower bound of the range of organizations
end - the upper bound of the range of organizations (not inclusive)
Returns:
the range of organizations
Throws:
SystemException - if a system exception occurred

getOrganizationsCount

public static int getOrganizationsCount()
                                 throws SystemException
Returns the number of organizations.

Returns:
the number of organizations
Throws:
SystemException - if a system exception occurred

updateOrganization

public static Organization updateOrganization(Organization organization)
                                       throws SystemException
Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
organization - the organization
Returns:
the organization that was updated
Throws:
SystemException - if a system exception occurred

updateOrganization

public static Organization updateOrganization(Organization organization,
                                              boolean merge)
                                       throws SystemException
Updates the organization in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
organization - the organization
merge - whether to merge the organization with the current session. See BatchSession.update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean) for an explanation.
Returns:
the organization that was updated
Throws:
SystemException - if a system exception occurred

getBeanIdentifier

public static String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Returns:
the Spring bean ID for this bean

setBeanIdentifier

public static void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Parameters:
beanIdentifier - the Spring bean ID for this bean

addGroupOrganizations

public static void addGroupOrganizations(long groupId,
                                         long[] organizationIds)
                                  throws PortalException,
                                         SystemException
Throws:
PortalException
SystemException

addOrganization

public static Organization addOrganization(long userId,
                                           long parentOrganizationId,
                                           String name,
                                           String type,
                                           boolean recursable,
                                           long regionId,
                                           long countryId,
                                           int statusId,
                                           String comments,
                                           ServiceContext serviceContext)
                                    throws PortalException,
                                           SystemException
Throws:
PortalException
SystemException

addOrganizationResources

public static void addOrganizationResources(long userId,
                                            Organization organization)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

addPasswordPolicyOrganizations

public static void addPasswordPolicyOrganizations(long passwordPolicyId,
                                                  long[] organizationIds)
                                           throws SystemException
Throws:
SystemException

deleteLogo

public static void deleteLogo(long organizationId)
                       throws PortalException,
                              SystemException
Throws:
PortalException
SystemException

getGroupOrganizations

public static List<Organization> getGroupOrganizations(long groupId)
                                                throws SystemException
Throws:
SystemException

getOrganization

public static Organization getOrganization(long companyId,
                                           String name)
                                    throws PortalException,
                                           SystemException
Throws:
PortalException
SystemException

getOrganizationId

public static long getOrganizationId(long companyId,
                                     String name)
                              throws SystemException
Throws:
SystemException

getOrganizations

public static List<Organization> getOrganizations(long companyId,
                                                  long parentOrganizationId)
                                           throws SystemException
Throws:
SystemException

getOrganizations

public static List<Organization> getOrganizations(long companyId,
                                                  long parentOrganizationId,
                                                  int start,
                                                  int end)
                                           throws SystemException
Throws:
SystemException

getOrganizations

public static List<Organization> getOrganizations(long[] organizationIds)
                                           throws PortalException,
                                                  SystemException
Throws:
PortalException
SystemException

getOrganizationsCount

public static int getOrganizationsCount(long companyId,
                                        long parentOrganizationId)
                                 throws SystemException
Throws:
SystemException

getParentOrganizations

public static List<Organization> getParentOrganizations(long organizationId)
                                                 throws PortalException,
                                                        SystemException
Throws:
PortalException
SystemException

getSuborganizations

public static List<Organization> getSuborganizations(List<Organization> organizations)
                                              throws SystemException
Throws:
SystemException

getSubsetOrganizations

public static List<Organization> getSubsetOrganizations(List<Organization> allOrganizations,
                                                        List<Organization> availableOrganizations)

getUserOrganizations

public static List<Organization> getUserOrganizations(long userId)
                                               throws PortalException,
                                                      SystemException
Throws:
PortalException
SystemException

getUserOrganizations

public static List<Organization> getUserOrganizations(long userId,
                                                      boolean inheritUserGroups)
                                               throws PortalException,
                                                      SystemException
Throws:
PortalException
SystemException

getUserOrganizations

public static List<Organization> getUserOrganizations(long userId,
                                                      boolean inheritUserGroups,
                                                      int start,
                                                      int end)
                                               throws PortalException,
                                                      SystemException
Throws:
PortalException
SystemException

getUserOrganizations

public static List<Organization> getUserOrganizations(long userId,
                                                      int start,
                                                      int end)
                                               throws PortalException,
                                                      SystemException
Throws:
PortalException
SystemException

getUserOrganizationsCount

public static int getUserOrganizationsCount(long userId)
                                     throws SystemException
Throws:
SystemException

hasGroupOrganization

public static boolean hasGroupOrganization(long groupId,
                                           long organizationId)
                                    throws SystemException
Throws:
SystemException

hasPasswordPolicyOrganization

public static boolean hasPasswordPolicyOrganization(long passwordPolicyId,
                                                    long organizationId)
                                             throws SystemException
Throws:
SystemException

hasUserOrganization

public static boolean hasUserOrganization(long userId,
                                          long organizationId)
                                   throws SystemException
Throws:
SystemException

hasUserOrganization

public static boolean hasUserOrganization(long userId,
                                          long organizationId,
                                          boolean inheritSuborganizations,
                                          boolean inheritUserGroups,
                                          boolean includeSpecifiedOrganization)
                                   throws PortalException,
                                          SystemException
Throws:
PortalException
SystemException

rebuildTree

public static void rebuildTree(long companyId,
                               boolean force)
                        throws SystemException
Throws:
SystemException

search

public static Hits search(long companyId,
                          long parentOrganizationId,
                          String keywords,
                          LinkedHashMap<String,Object> params,
                          int start,
                          int end,
                          Sort sort)
                   throws SystemException
Throws:
SystemException

search

public static List<Organization> search(long companyId,
                                        long parentOrganizationId,
                                        String keywords,
                                        String type,
                                        Long regionId,
                                        Long countryId,
                                        LinkedHashMap<String,Object> params,
                                        int start,
                                        int end)
                                 throws SystemException
Throws:
SystemException

search

public static List<Organization> search(long companyId,
                                        long parentOrganizationId,
                                        String keywords,
                                        String type,
                                        Long regionId,
                                        Long countryId,
                                        LinkedHashMap<String,Object> params,
                                        int start,
                                        int end,
                                        OrderByComparator obc)
                                 throws SystemException
Throws:
SystemException

search

public static List<Organization> search(long companyId,
                                        long parentOrganizationId,
                                        String name,
                                        String type,
                                        String street,
                                        String city,
                                        String zip,
                                        Long regionId,
                                        Long countryId,
                                        LinkedHashMap<String,Object> params,
                                        boolean andOperator,
                                        int start,
                                        int end)
                                 throws SystemException
Throws:
SystemException

search

public static List<Organization> search(long companyId,
                                        long parentOrganizationId,
                                        String name,
                                        String type,
                                        String street,
                                        String city,
                                        String zip,
                                        Long regionId,
                                        Long countryId,
                                        LinkedHashMap<String,Object> params,
                                        boolean andOperator,
                                        int start,
                                        int end,
                                        OrderByComparator obc)
                                 throws SystemException
Throws:
SystemException

search

public static Hits search(long companyId,
                          long parentOrganizationId,
                          String name,
                          String type,
                          String street,
                          String city,
                          String zip,
                          String region,
                          String country,
                          LinkedHashMap<String,Object> params,
                          boolean andSearch,
                          int start,
                          int end,
                          Sort sort)
                   throws SystemException
Throws:
SystemException

searchCount

public static int searchCount(long companyId,
                              long parentOrganizationId,
                              String keywords,
                              String type,
                              Long regionId,
                              Long countryId,
                              LinkedHashMap<String,Object> params)
                       throws SystemException
Throws:
SystemException

searchCount

public static 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)
                       throws SystemException
Throws:
SystemException

setGroupOrganizations

public static void setGroupOrganizations(long groupId,
                                         long[] organizationIds)
                                  throws PortalException,
                                         SystemException
Throws:
PortalException
SystemException

unsetGroupOrganizations

public static void unsetGroupOrganizations(long groupId,
                                           long[] organizationIds)
                                    throws PortalException,
                                           SystemException
Throws:
PortalException
SystemException

unsetPasswordPolicyOrganizations

public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
                                                    long[] organizationIds)
                                             throws SystemException
Throws:
SystemException

updateAsset

public static void updateAsset(long userId,
                               Organization organization,
                               long[] assetCategoryIds,
                               String[] assetTagNames)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

updateOrganization

public static Organization updateOrganization(long companyId,
                                              long organizationId,
                                              long parentOrganizationId,
                                              String name,
                                              String type,
                                              boolean recursable,
                                              long regionId,
                                              long countryId,
                                              int statusId,
                                              String comments,
                                              ServiceContext serviceContext)
                                       throws PortalException,
                                              SystemException
Throws:
PortalException
SystemException

getService

public static OrganizationLocalService getService()

setService

public void setService(OrganizationLocalService service)

Liferay 6.0-ee-sp2