Гледате помощното съдържание за версия:

The AEM Communities scoring and badges feature provides the ability to identify and reward community members.

The details of setting up the feature are described at

This page contains additional technical details :

Внимание:

The implementation structure visible in CRXDE Lite is subject to change.

Displaying Badges

Whether a badge is displayed as text or image is controlled on the client side in the HBS template.

For example, search for this.isAssigned in /libs/social/forum/components/hbs/topic/list-item.hbs, :

 

{{#each author.badges}}

  {{#if this.isAssigned}}

    <div class="scf-badge-text">

      {{this.title}}

    </div>

  {{/if}}

{{/each}}

{{#each author.badges}}

  {{#unless this.isAssigned}}

    <img class="scf-badge-image" alt="{{this.title}}" title="{{this.title}}" src="{{this.imageUrl}}" />

  {{/unless}}

{{/each}}

If true, isAssigned indicates the badge was assigned for a role and the badge should be displayed as text.  

If false, is Assigned indicates the badge was awarded for an earned score and the badge should be displayed as an image.

Any changes to this behavior should be made in a customized script (either override or overlay).  See Client-side Customizaton.

Debug Log for Scoring and Badging

To help debug scoring and badging, a custom log file can be setup.  The contents of this log file may then be provided to customer support if problems are encountered with the feature.

For detailed instructions, visit Create a Custom Log File.

To quickly setup a slinglog file :

  1. access the Adobe Experience Manager Web Console Log Support, for example
    • http://localhost:4502/system/console/slinglog
  2. select Add new logger
    1. select DEBUG for Log Level
    2. enter a name for Log File, for example
      • logs/scoring-debug.log
    3. enter two Logger (class) entries (using + icon)
      • com.adobe.cq.social.scoring
      • com.adobe.cq.social.badging
    4. select Save
chlimage_1

To see log entries

  • from the Web Console
    • under the Status menu
    • select Log Files
    • search for your Log File name, such as scoring-debug
  • on the server's local disk
    • the log file is at <server-install-dir>/crx-quickstart/logs/<log-file-name>.log
    • for example, .../crx-quickstart/logs/scoring-debug.log
chlimage_1

UGC for Scoring and Badging

It is possible to view the UGC related to scoring and badging when the chosen SRP is either JSRP or MSRP, but not ASRP.  (If not familiar with these terms, see Community Content Storage and Storage Resource Provider Overview.)

The descriptions for accessing scoring and badging data use JSRP, as the UGC is easily accessible using CRXDE Lite.

JSRP on author  : experimenting in the author environment results in UGC that is only visible from the author environment.  

JSRP on publish  : similarly, if testing on the publish environment, it will be necessary to access CRXDE Lite with administrative privileges on a publish instance.  If the publish instance is running in production mode (nosamplecontent runmode), it will be necessary to enable CRXDE Lite.

The base location of UGC on JSRP is /content/usergenerated/asi/jcr/.

Scoring and Badging APIs

The following APIs are available for use :

The latest Javadocs for the installed feature pack are available to developers from the Adobe repository. See Using Maven for Communities : Javadocs.

The location and format of the UGC in the repository is subject to change without warning.

Example Setup

The screen shots of repository data come from setting up scoring and badging for a forum on two different AEM sites :

1) An AEM site with an unique id (community site created using wizard) :

  • using the Getting Started Tutorial (engage) site created during the getting started tutorial
  • locate the forum page node
    • /content/sites/engage/en/forum/jcr:content
  • add scoring and badging properties
    • scoringRules = [/etc/community/scoring/rules/comments-scoring,
       /etc/community/scoring/rules/forums-scoring]
    • badgingRules =[/etc/community/badging/rules/comments-scoring,
       /etc/community/badging/rules/forums-scoring]
  • locate the forum component node
    • /content/sites/engage/en/forum/jcr:content/content/primary/forum
        (sling:resourceType = social/forum/components/hbs/forum)
  • add property to display badges
    • allowBadges = true
  • a user signs in, creates a forum topic, and is awarded a bronze badge

2) An AEM site without an unique id :

  • using the Community Components guide
  • locate the forum page node
    • /content/community-components/en/forum/jcr:content
  • add scoring and badging properties
    • scoringRules = [/etc/community/scoring/rules/comments-scoring,
       /etc/community/scoring/rules/forums-scoring]
    • badgingRules =[/etc/community/badging/rules/comments-scoring,
       /etc/community/badging/rules/forums-scoring]
  • locate the forum component node
    • /content/community-components/en/forum/jcr:content/content/forum
        (sling:resourceType = social/forum/components/hbs/forum)
  • add property to display badges
    • allowBadges = true
  • a user signs in, creates a forum topic, and is awarded a bronze badge

3) a user is assigned a moderator badge using cURL :

curl -i -X POST -H "Accept:application/json" -u admin:admin -F ":operation=social:assignBadge" -F "badgeContentPath=/etc/community/badging/images/moderator/jcr:content/moderator.png" http://localhost:4503/home/users/community/w271OOup2Z4DjnOQrviv/profile.social.json

As a user has earned two bronze badges and has been awarded a moderator badge, this is how the user appears with their forum entry :

chlimage_1

Бележка:

This example does not follow these best practices :

  • scoring rule names should be globally unique; they should not end with the same name.
    An example of what not to do :
        /etc/community/scoring/rules/site1/forums-scoring
        /etc/community/scoring/rules/site2/forums-scoring
  • creating unique badge images for different AEM sites

Access Scoring UGC

Use of the APIs is preferred.

For investigative purposes, using JSRP for the example, the base folder containing scores is

  • /content/usergenerated/asi/jcr/scoring

The child node of scoring is the scoring rule name.  Thus, a best practice is that scoring rule names on a server be globally unique.

For the Geometrixx Engage site, the user and their score is in a path contstructed with the scoring rule name, community site's site id (engage-ba81p),  an unique id, and the user's id :

  • .../scoring/forums-scoring/engage-ba81p/6d179715c0e93cb2b20886aa0434ca9b5a540401/riley

For the Community Components guide site, the user and their score is in a path constructed with the scoring rule name, a default id (default-site), an unique id, and the user's id :

  • .../scoring/forums-scoring/default-site/b27a17cb4910a9b69fe81fb1b492ba672d2c086e/riley

The score is stored in the property  scoreValue_tl which may directonly contain a value or indirectly refer to an atomicCounter.

chlimage_1

Access Badging UGC

Use of the APIs is preferred.

For investigative purposes, using JSRP for the example, the base folder containing information about assigned or awarded badges is

  • /content/usergenerated/asi/jcr

Followed by the path to the user's profile, ending in a badges folder, such as

  • /home/users/community/w271OOup2Z4DjnOQrviv/profile/badges

awarded badge

chlimage_1

assigned badge

chlimage_1

Additional Information

To display a sorted list of members based on points :

Този материал е лицензиран под лиценз Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported  Публикациите в Twitter™ и Facebook не попадат под клаузите на Creative Commons.

Правни бележки   |   Правила за онлайн поверителност