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() |
java.lang.String |
getName() |
java.util.Iterator<Response<T>> |
getResponses(java.lang.Long start) |
java.util.Iterator<Response<T>> |
getResponses(java.lang.Long start,
int numberOfResponses) |
java.util.Map<T,java.lang.Long> |
getResponseTallies() |
Resource |
getTallyTarget() |
java.lang.Long |
getTotalNumberOfResponses() |
boolean |
getUseReferrerUrl()
Check if the tally is using referrerUrl for its
AbstractTally.getFriendlyUrl() or not. |
Response<T> |
getUserResponse(java.lang.String userId) |
void |
setTallyResourceType(java.lang.String resourceType) |
Resource |
setUserResponse(java.lang.String userId,
java.lang.String responseValue)
sets the user response for this tally in jcr.
|
Resource |
setUserResponse(java.lang.String userId,
java.lang.String responseValue,
java.util.Map<java.lang.String,java.lang.Object> additionalPoperties)
sets the user response for this tally in jcr.
|
Resource |
unsetUserResponse(java.lang.String userId)
unsets the user response in jcr.
|
java.lang.String getName()
java.lang.Long getTotalNumberOfResponses()
Response<T> getUserResponse(java.lang.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 responsejava.util.Iterator<Response<T>> getResponses(java.lang.Long start, int numberOfResponses)
start
- the beginning index which to return the responses fromnumberOfResponses
- the number of responses to be returnedjava.util.Iterator<Response<T>> getResponses(java.lang.Long start)
start
- the beginning index which to return the responses fromjava.util.Map<T,java.lang.Long> getResponseTallies()
Resource getTallyTarget()
Resource setUserResponse(java.lang.String userId, java.lang.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(java.lang.String userId, java.lang.String responseValue, java.util.Map<java.lang.String,java.lang.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(java.lang.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(java.lang.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 - 2020 Adobe. All Rights Reserved