Class BadgeService
java.lang.Object
org.exoplatform.addons.gamification.service.configuration.BadgeService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd Badge to DBvoiddeleteBadge(Long id) Delete a BadgeEntity using the idfindBadgeById(Long badgeId) Find a BadgeEntity by idfindBadgeByTitle(String badgeTitle) Find a BadgeEntity by titlefindBadgeByTitleAndDomain(String badgeTitle, String domain) Find a BadgeEntity by titlefindBadgesByDomain(String badgeDomain) findEnabledBadgesByDomain(String badgeDomain) Return all badges within the DBGet all Rules by with null DomainDTO from DBGet all Domains from Rules from DBupdateBadge(BadgeDTO badgeDTO) Update Badge to DB
-
Field Details
-
badgeStorage
-
-
Constructor Details
-
BadgeService
public BadgeService()
-
-
Method Details
-
findBadgeByTitle
Find a BadgeEntity by title- Parameters:
badgeTitle- : badge title- Returns:
- an instance BadgeDTO
-
findBadgeById
Find a BadgeEntity by id- Parameters:
badgeId- : badge id- Returns:
- an instance BadgeDTO
-
findBadgeByTitleAndDomain
Find a BadgeEntity by title- Parameters:
badgeTitle- : badge titledomain- : badge domain- Returns:
- an instance BadgeDTO
-
getAllBadges
Return all badges within the DB- Returns:
- a list of BadgeDTO
-
addBadge
public BadgeDTO addBadge(BadgeDTO badgeDTO) throws org.exoplatform.commons.ObjectAlreadyExistsException Add Badge to DB- Parameters:
badgeDTO- : an object of type RuleDTO- Returns:
- BadgeDTO object
- Throws:
org.exoplatform.commons.ObjectAlreadyExistsException- when badge already exists
-
updateBadge
public BadgeDTO updateBadge(BadgeDTO badgeDTO) throws org.exoplatform.commons.ObjectAlreadyExistsException Update Badge to DB- Parameters:
badgeDTO- : an instance of type BadgeDTO- Returns:
- BadgeDTO object
- Throws:
org.exoplatform.commons.ObjectAlreadyExistsException- when badge already exists
-
deleteBadge
Delete a BadgeEntity using the id- Parameters:
id- : badge id- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when badge doesn't exist
-
findBadgesByDomain
-
findEnabledBadgesByDomain
-
getAllBadgesWithNullDomain
Get all Rules by with null DomainDTO from DB- Returns:
- RuleDTO list
-
getDomainListFromBadges
Get all Domains from Rules from DB- Returns:
- String list
-