Class TeamLocalServiceUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Team
addTeam
(long userId, long groupId, String name, String description, ServiceContext serviceContext) static Team
Adds the team to the database.static boolean
addUserGroupTeam
(long userGroupId, long teamId) static boolean
addUserGroupTeam
(long userGroupId, Team team) static boolean
addUserGroupTeams
(long userGroupId, long[] teamIds) static boolean
addUserGroupTeams
(long userGroupId, List<Team> teams) static boolean
addUserTeam
(long userId, long teamId) static boolean
addUserTeam
(long userId, Team team) static boolean
addUserTeams
(long userId, long[] teamIds) static boolean
addUserTeams
(long userId, List<Team> teams) static void
clearUserGroupTeams
(long userGroupId) static void
clearUserTeams
(long userId) static PersistedModel
createPersistedModel
(Serializable primaryKeyObj) static Team
createTeam
(long teamId) Creates a new team with the primary key.static PersistedModel
deletePersistedModel
(PersistedModel persistedModel) static Team
deleteTeam
(long teamId) Deletes the team with the primary key from the database.static Team
deleteTeam
(Team team) Deletes the team from the database.static void
deleteTeams
(long groupId) static void
deleteUserGroupTeam
(long userGroupId, long teamId) static void
deleteUserGroupTeam
(long userGroupId, Team team) static void
deleteUserGroupTeams
(long userGroupId, long[] teamIds) static void
deleteUserGroupTeams
(long userGroupId, List<Team> teams) static void
deleteUserTeam
(long userId, long teamId) static void
deleteUserTeam
(long userId, Team team) static void
deleteUserTeams
(long userId, long[] teamIds) static void
deleteUserTeams
(long userId, List<Team> teams) static <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static DynamicQuery
static <T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.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.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.static long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static long
dynamicQueryCount
(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.static Team
fetchTeam
(long teamId) static Team
static Team
fetchTeamByUuidAndGroupId
(String uuid, long groupId) Returns the team matching the UUID and group.static ActionableDynamicQuery
static ExportActionableDynamicQuery
getExportActionableDynamicQuery
(PortletDataContext portletDataContext) getGroupTeams
(long groupId) static int
getGroupTeamsCount
(long groupId) static String
Returns the OSGi service identifier.static PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static TeamLocalService
static Team
getTeam
(long teamId) Returns the team with the primary key.static Team
static Team
getTeamByUuidAndGroupId
(String uuid, long groupId) Returns the team matching the UUID and group.getTeams
(int start, int end) Returns a range of all the teams.getTeamsByUuidAndCompanyId
(String uuid, long companyId) Returns all the teams matching the UUID and company.getTeamsByUuidAndCompanyId
(String uuid, long companyId, int start, int end, OrderByComparator<Team> orderByComparator) Returns a range of teams matching the UUID and company.static int
Returns the number of teams.static long[]
getUserGroupPrimaryKeys
(long teamId) Returns the userGroupIds of the user groups associated with the team.getUserGroupTeams
(long userGroupId) getUserGroupTeams
(long userGroupId, int start, int end) getUserGroupTeams
(long userGroupId, int start, int end, OrderByComparator<Team> orderByComparator) static int
getUserGroupTeamsCount
(long userGroupId) getUserOrUserGroupTeams
(long groupId, long userId) static long[]
getUserPrimaryKeys
(long teamId) Returns the userIds of the users associated with the team.getUserTeams
(long userId) getUserTeams
(long userId, int start, int end) getUserTeams
(long userId, int start, int end, OrderByComparator<Team> orderByComparator) getUserTeams
(long userId, long groupId) static int
getUserTeamsCount
(long userId) static boolean
hasUserGroupTeam
(long userGroupId, long teamId) static boolean
hasUserGroupTeams
(long userGroupId) static boolean
hasUserTeam
(long userId, long teamId) static boolean
hasUserTeams
(long userId) search
(long groupId, String name, String description, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Team> orderByComparator) static int
searchCount
(long groupId, String name, String description, LinkedHashMap<String, Object> params) static void
setService
(TeamLocalService service) static void
setUserGroupTeams
(long userGroupId, long[] teamIds) static void
setUserTeams
(long userId, long[] teamIds) static Team
updateTeam
(long teamId, String name, String description) static Team
updateTeam
(Team team) Updates the team in the database or adds it if it does not yet exist.
-
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
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
-
addUserGroupTeams
-
addUserGroupTeams
public static boolean addUserGroupTeams(long userGroupId, long[] teamIds) -
addUserTeam
public static boolean addUserTeam(long userId, long teamId) -
addUserTeam
-
addUserTeams
-
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
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
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
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
- Throws:
PortalException
-
deleteUserGroupTeam
public static void deleteUserGroupTeam(long userGroupId, long teamId) -
deleteUserGroupTeam
-
deleteUserGroupTeams
-
deleteUserGroupTeams
public static void deleteUserGroupTeams(long userGroupId, long[] teamIds) -
deleteUserTeam
public static void deleteUserTeam(long userId, long teamId) -
deleteUserTeam
-
deleteUserTeams
-
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
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.TeamModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- 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
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.TeamModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchTeam
-
fetchTeam
-
fetchTeamByUuidAndGroupId
Returns the team matching the UUID and group.- Parameters:
uuid
- the team's UUIDgroupId
- the primary key of the group- Returns:
- the matching team, or
null
if a matching team could not be found
-
getActionableDynamicQuery
-
getExportActionableDynamicQuery
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getGroupTeams
-
getGroupTeamsCount
public static int getGroupTeamsCount(long groupId) -
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
getTeam
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
- Throws:
PortalException
-
getTeamByUuidAndGroupId
Returns the team matching the UUID and group.- Parameters:
uuid
- the team's UUIDgroupId
- the primary key of the group- Returns:
- the matching team
- Throws:
PortalException
- if a matching team could not be found
-
getTeams
Returns a range of all the teams.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.TeamModelImpl
.- Parameters:
start
- the lower bound of the range of teamsend
- the upper bound of the range of teams (not inclusive)- Returns:
- the range of teams
-
getTeamsByUuidAndCompanyId
Returns all the teams matching the UUID and company.- Parameters:
uuid
- the UUID of the teamscompanyId
- 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 teamscompanyId
- the primary key of the companystart
- the lower bound of the range of teamsend
- the upper bound of the range of teams (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- 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
-
getUserGroupTeams
-
getUserGroupTeams
public static List<Team> getUserGroupTeams(long userGroupId, int start, int end, OrderByComparator<Team> orderByComparator) -
getUserGroupTeamsCount
public static int getUserGroupTeamsCount(long userGroupId) -
getUserOrUserGroupTeams
-
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
-
getUserTeams
-
getUserTeams
public static List<Team> getUserTeams(long userId, int start, int end, OrderByComparator<Team> orderByComparator) -
getUserTeams
-
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
- Throws:
PortalException
-
updateTeam
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
-
setService
-