Class TeamLocalServiceUtil

Object
com.liferay.portal.kernel.service.TeamLocalServiceUtil

public class TeamLocalServiceUtil extends Object
Provides the local service utility for Team. This utility wraps com.liferay.portal.service.impl.TeamLocalServiceImpl and is an access point for service operations in application layer code running on the local server. 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.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • TeamLocalServiceUtil

      public TeamLocalServiceUtil()
  • Method Details

    • addTeam

      public static Team addTeam(long userId, long groupId, String name, String description, ServiceContext serviceContext) throws PortalException
      Throws:
      PortalException
    • addTeam

      public static Team addTeam(Team team)
      Adds the team to the database. Also notifies the appropriate model listeners.

      Important: Inspect TeamLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      team - the team
      Returns:
      the team that was added
    • addUserGroupTeam

      public static boolean addUserGroupTeam(long userGroupId, long teamId)
    • addUserGroupTeam

      public static boolean addUserGroupTeam(long userGroupId, Team team)
    • addUserGroupTeams

      public static boolean addUserGroupTeams(long userGroupId, List<Team> teams)
    • addUserGroupTeams

      public static boolean addUserGroupTeams(long userGroupId, long[] teamIds)
    • addUserTeam

      public static boolean addUserTeam(long userId, long teamId)
    • addUserTeam

      public static boolean addUserTeam(long userId, Team team)
    • addUserTeams

      public static boolean addUserTeams(long userId, List<Team> teams)
    • addUserTeams

      public static boolean addUserTeams(long userId, long[] teamIds)
    • clearUserGroupTeams

      public static void clearUserGroupTeams(long userGroupId)
    • clearUserTeams

      public static void clearUserTeams(long userId)
    • createPersistedModel

      public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • createTeam

      public static Team createTeam(long teamId)
      Creates a new team with the primary key. Does not add the team to the database.
      Parameters:
      teamId - the primary key for the new team
      Returns:
      the new team
    • deletePersistedModel

      public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Throws:
      PortalException
    • deleteTeam

      public static Team deleteTeam(long teamId) throws PortalException
      Deletes the team with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect TeamLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      teamId - the primary key of the team
      Returns:
      the team that was removed
      Throws:
      PortalException - if a team with the primary key could not be found
    • deleteTeam

      public static Team deleteTeam(Team team) throws PortalException
      Deletes the team from the database. Also notifies the appropriate model listeners.

      Important: Inspect TeamLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      team - the team
      Returns:
      the team that was removed
      Throws:
      PortalException
    • deleteTeams

      public static void deleteTeams(long groupId) throws PortalException
      Throws:
      PortalException
    • deleteUserGroupTeam

      public static void deleteUserGroupTeam(long userGroupId, long teamId)
    • deleteUserGroupTeam

      public static void deleteUserGroupTeam(long userGroupId, Team team)
    • deleteUserGroupTeams

      public static void deleteUserGroupTeams(long userGroupId, List<Team> teams)
    • deleteUserGroupTeams

      public static void deleteUserGroupTeams(long userGroupId, long[] teamIds)
    • deleteUserTeam

      public static void deleteUserTeam(long userId, long teamId)
    • deleteUserTeam

      public static void deleteUserTeam(long userId, Team team)
    • deleteUserTeams

      public static void deleteUserTeams(long userId, List<Team> teams)
    • deleteUserTeams

      public static void deleteUserTeams(long userId, long[] teamIds)
    • dslQuery

      public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dslQueryCount

      public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
    • dynamicQuery

      public static DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
      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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.TeamModelImpl.

      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
    • dynamicQuery

      public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
      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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.TeamModelImpl.

      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
    • dynamicQueryCount

      public static long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchTeam

      public static Team fetchTeam(long teamId)
    • fetchTeam

      public static Team fetchTeam(long groupId, String name)
    • fetchTeamByUuidAndGroupId

      public static Team fetchTeamByUuidAndGroupId(String uuid, long groupId)
      Returns the team matching the UUID and group.
      Parameters:
      uuid - the team's UUID
      groupId - the primary key of the group
      Returns:
      the matching team, or null if a matching team could not be found
    • getActionableDynamicQuery

      public static ActionableDynamicQuery getActionableDynamicQuery()
    • getExportActionableDynamicQuery

      public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
    • getGroupTeams

      public static List<Team> getGroupTeams(long groupId)
    • getGroupTeamsCount

      public static int getGroupTeamsCount(long groupId)
    • getIndexableActionableDynamicQuery

      public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

      public static String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Throws:
      PortalException
    • getTeam

      public static Team getTeam(long teamId) throws PortalException
      Returns the team with the primary key.
      Parameters:
      teamId - the primary key of the team
      Returns:
      the team
      Throws:
      PortalException - if a team with the primary key could not be found
    • getTeam

      public static Team getTeam(long groupId, String name) throws PortalException
      Throws:
      PortalException
    • getTeamByUuidAndGroupId

      public static Team getTeamByUuidAndGroupId(String uuid, long groupId) throws PortalException
      Returns the team matching the UUID and group.
      Parameters:
      uuid - the team's UUID
      groupId - the primary key of the group
      Returns:
      the matching team
      Throws:
      PortalException - if a matching team could not be found
    • getTeams

      public static List<Team> getTeams(int start, int end)
      Returns a range of all the teams.

      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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.TeamModelImpl.

      Parameters:
      start - the lower bound of the range of teams
      end - the upper bound of the range of teams (not inclusive)
      Returns:
      the range of teams
    • getTeamsByUuidAndCompanyId

      public static List<Team> getTeamsByUuidAndCompanyId(String uuid, long companyId)
      Returns all the teams matching the UUID and company.
      Parameters:
      uuid - the UUID of the teams
      companyId - the primary key of the company
      Returns:
      the matching teams, or an empty list if no matches were found
    • getTeamsByUuidAndCompanyId

      public static List<Team> getTeamsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<Team> orderByComparator)
      Returns a range of teams matching the UUID and company.
      Parameters:
      uuid - the UUID of the teams
      companyId - the primary key of the company
      start - the lower bound of the range of teams
      end - the upper bound of the range of teams (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the range of matching teams, or an empty list if no matches were found
    • getTeamsCount

      public static int getTeamsCount()
      Returns the number of teams.
      Returns:
      the number of teams
    • getUserGroupPrimaryKeys

      public static long[] getUserGroupPrimaryKeys(long teamId)
      Returns the userGroupIds of the user groups associated with the team.
      Parameters:
      teamId - the teamId of the team
      Returns:
      long[] the userGroupIds of user groups associated with the team
    • getUserGroupTeams

      public static List<Team> getUserGroupTeams(long userGroupId)
    • getUserGroupTeams

      public static List<Team> getUserGroupTeams(long userGroupId, int start, int end)
    • getUserGroupTeams

      public static List<Team> getUserGroupTeams(long userGroupId, int start, int end, OrderByComparator<Team> orderByComparator)
    • getUserGroupTeamsCount

      public static int getUserGroupTeamsCount(long userGroupId)
    • getUserOrUserGroupTeams

      public static List<Team> getUserOrUserGroupTeams(long groupId, long userId)
    • getUserPrimaryKeys

      public static long[] getUserPrimaryKeys(long teamId)
      Returns the userIds of the users associated with the team.
      Parameters:
      teamId - the teamId of the team
      Returns:
      long[] the userIds of users associated with the team
    • getUserTeams

      public static List<Team> getUserTeams(long userId)
    • getUserTeams

      public static List<Team> getUserTeams(long userId, int start, int end)
    • getUserTeams

      public static List<Team> getUserTeams(long userId, int start, int end, OrderByComparator<Team> orderByComparator)
    • getUserTeams

      public static List<Team> getUserTeams(long userId, long groupId)
    • getUserTeamsCount

      public static int getUserTeamsCount(long userId)
    • hasUserGroupTeam

      public static boolean hasUserGroupTeam(long userGroupId, long teamId)
    • hasUserGroupTeams

      public static boolean hasUserGroupTeams(long userGroupId)
    • hasUserTeam

      public static boolean hasUserTeam(long userId, long teamId)
    • hasUserTeams

      public static boolean hasUserTeams(long userId)
    • search

      public static List<Team> search(long groupId, String name, String description, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<Team> orderByComparator)
    • searchCount

      public static int searchCount(long groupId, String name, String description, LinkedHashMap<String,Object> params)
    • setUserGroupTeams

      public static void setUserGroupTeams(long userGroupId, long[] teamIds)
    • setUserTeams

      public static void setUserTeams(long userId, long[] teamIds)
    • updateTeam

      public static Team updateTeam(long teamId, String name, String description) throws PortalException
      Throws:
      PortalException
    • updateTeam

      public static Team updateTeam(Team team)
      Updates the team in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect TeamLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Parameters:
      team - the team
      Returns:
      the team that was updated
    • getService

      public static TeamLocalService getService()
    • setService

      public static void setService(TeamLocalService service)