public class ResourceDetailsImpl
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ASSET_ARRAY |
static java.lang.String |
RATINGS_OBJECT |
static java.lang.String |
RESOURCE_INFO |
| Constructor and Description |
|---|
ResourceDetailsImpl() |
| Modifier and Type | Method and Description |
|---|---|
JSONObject |
getResourceDetails(Resource resource)
Get the resource's detail at the pointed to by the resource.
|
public static final java.lang.String RESOURCE_INFO
public static final java.lang.String ASSET_ARRAY
public static final java.lang.String RATINGS_OBJECT
public JSONObject getResourceDetails(Resource resource) throws RepositoryException, TallyException, JSONException
resource - Resource for which com.adobe.cq.social.enablement.model.EnablementResource 's
details are requiredJSONObject with following properties:
RESOURCE_INFO: value of 1st level properties of resource node in JCRASSET_ARRAY: value as an array of assets participating in this resource. This array would
consist of objects with properties:
RATINGS_OBJECT: this object would have following rating related properties:
Sample Response:
{
//1st level resource information saved in a resource node in JCR(essentially <resource-end-point>.json)
"info": {
"jcr:primaryType": "nt:unstructured",
"jcr:mixinTypes": ["rep:AccessControllable"],
"allow-social-switch": false,
"resource-experts": [],
"description": "Tutorial on AEM",
"cover-image-path": "./cover-image/file/image",
"resource-managers": [],
"allow-ratings": false,
"date-modified": "Tue Feb 11 2014 19:19:05 GMT+0530",
"is-mandatory": false,
"publish": true,
"id": "101",
"url": "",
"name": "AEM Training2",
"tags": ["adobe:social"],
"category": ["adobe:aem"],
"resource-contact": [],
"date-created": "Tue Feb 11 2014 19:19:05 GMT+0530",
"moderate-comments": true,
"catalog-visibility": "open",
"created-by": "nikeadmin",
"allow-comments": false
},
//asset list for this resource with some meta-information about asset.
//The meta info about asset is basically with guidance that what information is relevant to be
//shown while detailing asset(suggestion needed--a few guesses by me: duration, pages[if applicable]
//more specific info about asset(like video progress) need to be pulled from asset end-point
"assets": [ //0..*
{
"name": "KB2.mp4",
"end-point": "/content/enablement/data/nike/resources/nikeadmin/AEMTraining/assets/asset1/jcr:content",
"cover-image-path": "/content/enablement/data/nike/resources/nikeadmin/AEMTraining/assets/asset1/cover-img/image",
"type": "video/mp4",
},
{
"name": "IMG_3418.jpg",
"end-point": "/content/enablement/data/nike/resources/nikeadmin/AEMTraining/assets/asset2/jcr:content",
"cover-image-path": "/content/enablement/data/nike/resources/nikeadmin/AEMTraining/assets/asset2/cover-img/image",
"type": "image/jpeg",
}
],
"ratings": {
"count": 1,
"average": 3,
"user-rating": 3, //(optional)
"user-rating-string": "3.0" //(optional)
}
}
RepositoryException - -- throws exception when unable to find the resourceTallyException - -- generic exception for all failures in the Tally API.JSONException - -- throws when there are issue with the JSON"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"