The implementation structure visible in CRXDE Lite is subject to change once the UI becomes available.

Badges

Badges are placed under a member's name to indicate either their role or their standing in the community. Badges may either be displayed as an image or as a name. When displayed as an image, the name is included as alternate text for accessibility.

By default, badges are located in the repository at

/etc/community/badging/images

If stored in a different location, they should be read accessible by everyone.

Badges are differentiated in UGC as to whether they were assigned or were earned according to the rules. Presently, assigned badges appear as text and earned badges appear as an image.

Badge Management UI

Tthe Communities Badges console provides the ability to add custom badges which can be displayed for a member when earned (awarded) or when they take on a specific role in the community (assigned).

Assigned Badges

Role-based badges are assigned by an administrator to community members based on their role in the community.

Assigned (and awared) badges are stored in the selected SRP and are not directly accessible. Until a GUI is available, the only means for assigning role-based badges is to do so with code or cURL. For cURL instructions, see the section titled Assign and Revoke Badges.

Scoring rules may be configured to assign negative points for posts flagged as inappropriate and thus affect the score value. However, once a badge is earned, it will not be automatically removed due to scoring point reduction or scoring rule changes.

Awarded badges may be revoked in the same manner as assigned badges. See the Assign and Revoke Badges section. Future improvements will include an UI to manage members’ badges.

Custom Badges

Custom badges can be installed using the Badges console and either assigned or specified in badging rules.

When installed from the Badges console, custom badges are automatically replicated to the publish environment.

Enable Scoring

Scoring is not enabled by default. The basic steps for setting up and enabling scoring and awarding of badges are :

If a scoring rule appears to have no effect on awarding badges, ensure the scoring rule has not been blocked by the badging rule's scoringRules property. See the section titled Badging Rules.

Enable Badges for Component

The scoring and bading rules are in effect only for instances of components that have enabled badging by editing the component configuration in authoring mode.

A boolean property, allowBadges, enables/disables the display of badges for a component instance. It is configurable in the component edit dialog for forum, QnA and comment components through a checkbox labeled Display Badges.

Example : allowBadges for Forum component instance

Megjegyzés:

Any component can be overlaid to display badges using the HBS code found in forums, QnA, and comments as an example.

Scoring Rules

Scoring rules are the foundation of scoring for the purpose of awarding badges.

Very simply, each scoring rule is a list of one or more sub-rules. Scoring rules are applied to the community site content to identify the rules to apply when badges are enabled.

subRules is an attribute of type String[] on the rule's jcr:content node

sub-rules may be shared among various scoring rules

rules should be located in a repository location with read permission for everyone

rule names must be unique regardless of location

Activating Custom Scoring Rules

Any changes or additions made to scoring rules or sub-rules made in the author environment need to be installed on publish.

Badging Rules

Badging rules link scoring rules to badges by specifying :

which scoring rule

the score necessary to be awared a specific badge

Badging rules are nodes of type cq:Page with properties on its jcr:content node that correlate scoring rules to scores and badges.

The rules for badging consist of a mandatory thresholds property that is an ordered list of scores mapped to badges. The scores must be ordered in increasing value. For example :

1|/etc/community/badging/images/bronze-badge/jcr:content/bronze.png

a bronze badge is awared for earning 1 point

60|/etc/community/badging/images/silver-badge/jcr:content/silver.png

a silver badge is awarded when 60 points have been accumulated

80|/etc/community/badging/images/gold-badge/jcr:content/gold.png

a gold badge is awared when 80 points have been accumulated

Badging rules are paired with scoring rules, which determine how points accumulate. See the section titled Apply Rules to Content.

The scoringRules property on a badging rule simply restricts which scoring rules can be paired with that particular badging rule.

Megjegyzés:

Best practice : create badge images unique to each AEM site.

Property

Type

Value Description

thresholds

String[]

(required) A multi-value string of the form 'number|path'

number = score

| = the vertical line char (U+007C)

path = full path to badge image resource

The strings must be ordered so that the numbers are increasing in value and no whitespace should appear between the number and path.
Example entry :80|/etc/community/badging/images/gold-badge/jcr:content/gold.png

badgingType

String

(optional) Identifies the scoring engine as either "basic" or "advanced". If the advanced scoring engine is desired, see (Beta) Advanced Scoring and Badges.
Default is "basic".

scoringRules

String[]

(optional) A multi-value string to restrict the badging rule to scoring events identified by the scoring rules

Using cURL to assign and revoke badges works for any badge image, but when assigned instead of earned, they are marked as assigned badges and handled accordingly.

Scoring and Badges for Custom Components

Scoring and badging rules may be created for custom components by associating the event topics created for the component with verbs.

Topics and Verbs

When members interact with communities features, events are sent that can trigger asynchronous listeners, like notifications and scoring.

A component's SocialEvent instance records the events as actions that occur for a topic. The SocialEvent includes a method to return a verb associated with the action. There is an n-1 relationship between actions and verbs.

For the communities components delivered in the releae, the following tables describe the verbs defined for each topic available for use in scoring sub-rules.

Megjegyzés:

A new boolean property, allowBadges, enables/disables the display of badges for a component instance. It will be configurable in updated component edit dialogs through a checkbox labeled Display Badges.

Custom Component Events

For a custom component, a SocialEvent is instantiated to record the component's events as actions that occur for a topic.

To support scoring, the SocialEvent would need to override the method getVerb() so that an appropriate verb is returned for each action. The verb returned for an action may be one commonly used (such as POST) or one specialized for the component (such as ADD RATING). There is an n-1 relationship between actions and verbs.

Troubleshooting

Badges are not appearing

If scoring and badging rules have been applied to the web site's content, but badges are not being awared for any activity, ensure badges have been enabled for that component's instance.

Scoring rule has no effect

If scoring and badging rules have been applied to the web site's content, and badges are being awarded for some actions, but not others, check that the badging rule has not restricted the scoring rules to which it applies.