public interface PollListManager extends EntityProducer
| Modifier and Type | Field and Description |
|---|---|
static String |
PERMISSION_ADD |
static String |
PERMISSION_DELETE_ANY |
static String |
PERMISSION_DELETE_OWN |
static String |
PERMISSION_EDIT_ANY |
static String |
PERMISSION_EDIT_OWN |
static String |
PERMISSION_VOTE |
static String |
REF_POLL_TYPE |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteOption(Option option)
Delete an option from the database.
|
void |
deleteOption(Option option,
boolean soft)
Delete a poll option, either "hard" or "soft".
|
boolean |
deletePoll(Poll t)
Delete a poll
|
List<Poll> |
findAllPolls(String siteId)
Gets all the task objects for the site
|
List<Poll> |
findAllPollsForUserAndSitesAndPermission(String userId,
String[] siteIds,
String permissionConstant)
Get all the polls for a user in a set of sites (can be one) given the permission,
will return only polls that can be voted on if the permission is
PERMISSION_VOTE |
Option |
getOptionById(Long optionId)
Get a specific option by its id
|
List<Option> |
getOptionsForPoll(Long pollId)
Get all options for a specific poll
|
List<Option> |
getOptionsForPoll(Poll poll)
Get all options for a specific poll
|
Poll |
getPoll(String ref)
get a poll by its Entity Reference
|
Poll |
getPollById(Long pollId)
Retrieve a specific poll
|
Poll |
getPollById(Long pollId,
boolean includeOptions)
Retrieve a specific poll
|
Poll |
getPollWithVotes(Long pollId)
Get a specific poll with all its votes
|
List<Option> |
getVisibleOptionsForPoll(Long pollId)
Get options for the given poll that are not flagged as deleted.
|
boolean |
isAllowedViewResults(Poll poll,
String userId)
Can the this user view the results for this poll?
|
boolean |
isPollPublic(Poll poll)
Is this poll public?
|
boolean |
saveOption(Option t)
Save an individual option
|
boolean |
savePoll(Poll t)
Save a poll
|
boolean |
userCanDeletePoll(Poll poll)
Is user allowed to delete the votes on a poll?
|
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getEntityUrl, getHttpAccess, getLabel, merge, parseEntityReference, willArchiveMergestatic final String PERMISSION_VOTE
static final String PERMISSION_ADD
static final String PERMISSION_DELETE_OWN
static final String PERMISSION_DELETE_ANY
static final String PERMISSION_EDIT_ANY
static final String PERMISSION_EDIT_OWN
static final String REF_POLL_TYPE
void deleteOption(Option option)
option - - The option to deletevoid deleteOption(Option option, boolean soft)
option - - The option to deletesoft - - true if you want to "soft" delete (flag the 'deleted' field) or false to "hard" delete (remove from database)boolean deletePoll(Poll t) throws SecurityException, IllegalArgumentException
t - - the poll object to removeSecurityExceptionIllegalArgumentExceptionList<Poll> findAllPolls(String siteId)
siteId - - the siteId of the siteList<Poll> findAllPollsForUserAndSitesAndPermission(String userId, String[] siteIds, String permissionConstant)
PERMISSION_VOTEuserId - a sakai internal user id (not eid)siteIds - an array of site ids (can be null or empty to get the polls for all without security check)permissionConstant - either the PERMISSION_VOTE (for all polls a user can vote on) or
PERMISSION_ADD for all the polls the user can controlList<Option> getOptionsForPoll(Long pollId)
pollId - the id for a pollIllegalArgumentException - if the pollId is invalidList<Option> getVisibleOptionsForPoll(Long pollId)
pollId - the id of the pollIllegalArgumentException - if the pollId is invalidList<Option> getOptionsForPoll(Poll poll)
the - pollIllegalArgumentException - if the pollId is invalidPoll getPollById(Long pollId) throws SecurityException
pollId - SecurityExceptionPoll getPollById(Long pollId, boolean includeOptions) throws SecurityException
pollId - includeOptions - if true then options included, else no options (poll only)SecurityExceptionPoll getPollWithVotes(Long pollId)
pollId - boolean isAllowedViewResults(Poll poll, String userId)
poll - userId - boolean saveOption(Option t)
t - boolean savePoll(Poll t) throws SecurityException, IllegalArgumentException
t - - the poll object to saveSecurityExceptionIllegalArgumentExceptionboolean isPollPublic(Poll poll)
poll - boolean userCanDeletePoll(Poll poll)
poll - - the poll objectCopyright © 2003–2021 Sakai Project. All rights reserved.