|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PollListManager
This is the interface for the Manager for our poll tool, it handles the data access functionality of the tool, we currently have 2 implementations (memory and hibernate)
| Field Summary | |
|---|---|
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
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from interface org.sakaiproject.entity.api.EntityProducer |
|---|
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getHttpAccess, getLabel, merge, parseEntityReference, willArchiveMerge |
| Field Detail |
|---|
static 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
| Method Detail |
|---|
void deleteOption(Option option)
option - - The option to delete
void 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 remove
SecurityException
IllegalArgumentExceptionList<Poll> findAllPolls(String siteId)
siteId - - the siteId of the site
List<Poll> findAllPollsForUserAndSitesAndPermission(String userId,
String[] siteIds,
String permissionConstant)
PERMISSION_VOTE
userId - 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 control
Option getOptionById(Long optionId)
List<Option> getOptionsForPoll(Long pollId)
pollId - the id for a poll
IllegalArgumentException - if the pollId is invalidList<Option> getVisibleOptionsForPoll(Long pollId)
pollId - the id of the poll
IllegalArgumentException - if the pollId is invalidList<Option> getOptionsForPoll(Poll poll)
the - poll
IllegalArgumentException - if the pollId is invalidPoll getPoll(String ref)
Poll getPollById(Long pollId)
throws SecurityException
pollId -
SecurityException
Poll 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 save
SecurityException
IllegalArgumentExceptionboolean isPollPublic(Poll poll)
poll -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||