T - The response value object that a tally will keep track ofpublic interface Tally<T extends ResponseValue>
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUserRespond()
checks if the current logged in user has privileges to respond to this tally (based on ACLs).
|
boolean |
canUserRespond(SlingHttpServletRequest request)
checks if the current logged in user has privileges to respond to this tally (based on ACLs).
|
T |
getCurrentUserResponse() |
String |
getName() |
Iterator<Response<T>> |
getResponses(Long start) |
Iterator<Response<T>> |
getResponses(Long start,
int numberOfResponses) |
Map<T,Long> |
getResponseTallies() |
Resource |
getTallyTarget() |
Long |
getTotalNumberOfResponses() |
boolean |
getUseReferrerUrl()
Check if the tally is using referrerUrl for its
AbstractTally.getFriendlyUrl() or not. |
Response<T> |
getUserResponse(String userId) |
void |
setTallyResourceType(String resourceType) |
Resource |
setUserResponse(String userId,
String responseValue)
sets the user response for this tally in jcr.
|
Resource |
setUserResponse(String userId,
String responseValue,
Map<String,Object> additionalPoperties)
sets the user response for this tally in jcr.
|
Resource |
unsetUserResponse(String userId)
unsets the user response in jcr.
|
String getName()
Long getTotalNumberOfResponses()
Response<T> getUserResponse(String userId) throws TallyException, RepositoryException
userId - the user for whom the response is requested forTallyException - when there was an error in reading the users latest responseRepositoryException - when there is a JCR error in reading the users latest responseT getCurrentUserResponse() throws TallyException
TallyException - when there was an error in reading the users latest responseIterator<Response<T>> getResponses(Long start, int numberOfResponses)
start - the beginning index which to return the responses fromnumberOfResponses - the number of responses to be returnedIterator<Response<T>> getResponses(Long start)
start - the beginning index which to return the responses fromMap<T,Long> getResponseTallies()
Resource getTallyTarget()
Resource setUserResponse(String userId, String responseValue) throws TallyException, RepositoryException
userId - the authorizable id of the user who responded to the tallyresponseValue - the response value entered by the user for the tallyResource object representing the responseTallyException - when there is an error in setting the user responseRepositoryException - when there is a JCR error in setting the user responseResource setUserResponse(String userId, String responseValue, Map<String,Object> additionalPoperties) throws TallyException, RepositoryException
userId - the authorizable id of the user who responded to the tallyresponseValue - the response value entered by the user for the tallyadditionalPoperties - any additional properties to write to the resource; may be nullResource object representing the responseTallyException - when there is an error in setting the user responseRepositoryException - when there is a JCR error in setting the user responseResource unsetUserResponse(String userId) throws TallyException, RepositoryException
userId - the authorizable id of the user who responded to the tallyResource object representing the node that indicates an unset responseTallyException - when there is an error in trying to unset the user responseRepositoryException - when there is a JCR error in setting the user responseboolean canUserRespond()
boolean canUserRespond(SlingHttpServletRequest request)
request - the sling request to use as the basis of the user determinationvoid setTallyResourceType(String resourceType)
resourceType - - the resource type to use when creating tally component resource nodes if needed in ugc.boolean getUseReferrerUrl()
AbstractTally.getFriendlyUrl() or not."Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"