public interface BadgingService
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_BADGES
Badging types.
|
static String |
ALLOW_BADGES_PROP
For components supporting badge display, use this Boolean property to toggle badge display on/off.
|
static String |
ASSIGNED_BADGES |
static String |
ASSIGNED_PROP
True if this is an assigned badge.
|
static String |
BADGE_EARNED_DATE_PROP
The date when badge was awarded.
|
static String |
BADGE_EARNED_SCORE_PROP
The score when badge was awarded.
|
static String |
BADGE_PATH_PROP
Path of the badge's resource/image.
|
static String |
BADGE_PATHS_PROP
advanced badging engine specific properties
|
static String |
BADGING_FOLDER_NAME
badging folder name located in SRP after the home users profile dir.
|
static String |
BADGING_LEVELS_PROP |
static String |
BADGING_RULES_PROP
badging rule property.
|
static String |
BADGING_TYPE_PROP
badging engine type.
|
static String |
EARNED_BADGES |
static String |
FILTER_BY_COMP_PROP
When badge display is turned on in a component, set this boolean property in the
component resource to display all the user's badges or just badges earned/assigned for this component.
|
static String |
RULE_PAGE_PATH_PROP
The containing page path of the rule's location this badge belongs to.
|
static String |
RULE_PROP
The rule path.
|
static String |
SITE_ID_PROP
The site the badge belongs to.
|
static String |
THRESHOLDS_PROP
basic badging engine specific properties.
|
static String |
THRESHOLDS_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
int |
deleteBadge(ResourceResolver resolver,
String userId,
Resource ruleResource,
Resource componentResource,
String badgeContentPath,
boolean assigned)
Delete a user's badges where the badgeContentPath matches the input parameter.
|
List<UserBadge> |
getBadges(ResourceResolver resourceResolver,
String userId,
Resource pageResource,
CommunityContext context,
String badgeType)
Retrieves badges for a user.
|
void |
saveBadge(ResourceResolver resolver,
String userId,
Resource ruleResource,
Resource componentResource,
String badgeContentPath,
boolean assigned,
Map<String,Object> props)
Save or update a user's badge.
|
static final String BADGING_TYPE_PROP
static final String BADGING_RULES_PROP
static final String BADGING_FOLDER_NAME
static final String RULE_PAGE_PATH_PROP
static final String BADGE_PATH_PROP
static final String SITE_ID_PROP
static final String RULE_PROP
static final String ASSIGNED_PROP
static final String BADGE_EARNED_SCORE_PROP
static final String BADGE_EARNED_DATE_PROP
static final String ALL_BADGES
static final String ASSIGNED_BADGES
static final String EARNED_BADGES
static final String THRESHOLDS_PROP
static final String THRESHOLDS_SEPARATOR
static final String BADGE_PATHS_PROP
static final String BADGING_LEVELS_PROP
static final String ALLOW_BADGES_PROP
static final String FILTER_BY_COMP_PROP
List<UserBadge> getBadges(ResourceResolver resourceResolver, String userId, Resource pageResource, CommunityContext context, String badgeType) throws RepositoryException
resourceResolver - resolver used for reading badge resourcesuserId - the user's useridpageResource - restrict badges that are in this resource (and above) only. null for no path restrictions.
Note that a resource in a community restricts badges to that community so no need to set the context
parameter.context - restrict badges to this community. null for no community restrictions. Useful for retrieving all
badges for a specific community by setting pageResource to null.badgeType - the badge type to retrieve: ALL, ASSIGNED, EARNEDUserBadge objects for the user.RepositoryException - thrown if unable to retrieve the scorevoid saveBadge(ResourceResolver resolver, String userId, Resource ruleResource, Resource componentResource, String badgeContentPath, boolean assigned, Map<String,Object> props) throws RepositoryException, PersistenceException
resolver - resolver used for writing the badgeuserId - the user's useridruleResource - the badging rule the badge was earned from. Can't be null for earned badges.componentResource - the resource where the rule was located (Not necessarily at a component. Could be at
jcr:content, etc.). Can't be null for earned badges.badgeContentPath - the path for the badge content resource containing the imageassigned - true if this badge is an assigned badge, false for an earned badgeprops - any addition properties to store with the badgeRepositoryException - error saving badgePersistenceException - error saving badgeint deleteBadge(ResourceResolver resolver, String userId, Resource ruleResource, Resource componentResource, String badgeContentPath, boolean assigned) throws RepositoryException, PersistenceException
resolver - resolver used for writing the badgeuserId - the user's useridruleResource - the badging rule the badge was earned from. Can't be null for earned badges.componentResource - the resource where the rule was located (Not necessarily at a component. Could be at
jcr:content, etc.). Can't be null for earned badges.badgeContentPath - the path for the badge content resource containing the imageassigned - true for only assigned badgesRepositoryException - error saving badgePersistenceException - error saving badge"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"