click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: SAK-14216
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: David Horwitz
Reporter: Aaron Zeckoski
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Sakai

Add entity support to Polls tool

Created: 17-Aug-2008 04:31   Updated: 28-Sep-2009 16:16
Component/s: Entity Broker, Polls
Affects Version/s: 2.6.0
Fix Version/s: 2.6.0, 2.7.0

Time Tracking:
Not Specified

Issue Links:
Relate
 

2.6.x Status: Closed
2.5.x Status: None
2.4.x Status: None


 Description  « Hide
The polls tool should expose entities and views via the entity broker system.
Data feeds for "all polls a user has access to", "poll data", "poll questions", and "poll results" should be exposed
There should be support for view passthroughs as well which allow submission of poll results and the ability to get an AHAH view from the poll

 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 18-Aug-2008 13:42
Aaron, by "all polls a user has access to", do you mean all polls across all sites in which the user is a member, or do you mean polls that are currently votable within a specific site?

Aaron Zeckoski added a comment - 18-Aug-2008 14:02
Not quite. I mean this:
1) All the polls a user can participate in (with option to limit by site)
2) All the polls a user can control (with option to limit by site)

Stephen Marquard added a comment - 19-Aug-2008 00:32
Hi Aaron,

Please can you add some more details about use cases. Are these for synoptic widgets? Maybe the complex requirements should be a separate JIRA from the basic entity support through EB.

I'm concerned about how to efficiently answer some of the cross-site questions, given that the current site and authz APIs are not really optimal for this.

The results might also have to take into account which sites the user has hidden, as generally when people belong to sites but has hidden them (through My Workspace / Preferences), then they don't want to see synoptic info from those sites.

Aaron Zeckoski added a comment - 19-Aug-2008 00:44
I did not realize that polls depended so heavily on sakai to determine what polls a user has access to. I had assumed it was more like eval where we can find all the sites a user has the "be.evaluated" permission in very rapidly and then cross reference that with our own internal record of which siteIds are associated. If this is not the case then you are certainly correct, it would be very inefficient to have to fetch all the sites and then cross check them against the internal polls data storage.
Part of the use case here is to make the poll browseable (part of entity picker) so it could be selected from a listing. We could limit this by the current site but it seems unfortunate to have to restrict users to only seeing the polls for the site they happen to currently be in.

Stephen Marquard added a comment - 19-Aug-2008 01:43
This is a similar case to evaluations, but looking at the current eval code in getEvalGroupsForUser, it's efficient for authz (using authzGroupService.getAuthzGroupsIsAllowed()), but is still loading each site individually, just to get the title.

In performance terms, the aim (esp. if this is say a user homepage widget which shows polls open for voting) is to have the number of db queries independent of the size of the user's site membership or the number of polls in each site or in total.

For the widget-case, the most efficient solution is something like:

- Get the list of sites that the user belongs to
- Get the subset of those sites which the user hasn't hidden
- Get the intersection of the subset above and authzGroupService.getAuthzGroupsIsAllowed()
- From the resulting set of site contexts, get (i) polls open for voting, (ii) "current" polls (by some definition) for which results are viewable.

What are the use cases for the entity picker?

Aaron Zeckoski added a comment - 19-Aug-2008 11:29
Sounds like the same use case for the picker. You would basically be "picking" to either embed a poll in a page or embed the results (which I sort of see as possibly the same action). The options would have to be to limit the selectable polls to the ones they have administrative control over. There would not really be a use case for embedding the polls that someone has the ability to take.

On the other hand, there is certainly a use case for getting all polls a user can take (for the widget case). I am thinking a widget which shows either a specific poll OR shows a list of all the polls you have not yet responded to and when you select one the widget transforms into the poll itself.

You are right about having to fetch site titles for eval. This is annoying but since sites are cached and 9 times out of 10 the ones we are looking up are already loaded anyway (especially in the case of getting them for the current user) it ends up typically adding very little. Ideally the site service needs 3-4 more methods for finding sites and partially finding site information.

Aaron Zeckoski added a comment - 20-Aug-2008 09:57
Moved polls to new version and fixed poms

Stephen Marquard added a comment - 21-Aug-2008 03:05
Notes on the entitypicker support: there are really 3 actions that you might want to select for a poll. Not all users would have all actions available. Some may be time-limited (vote/results), some affected by permissions and/or poll ownership (manage).

* Vote
* View results
* Manage

So in a context like authoring content, the entitypicker needs to allow the user to select a poll, then select an action/view for the poll.

Peter A. Knoop added a comment - 29-Sep-2008 07:22
[Bulk Comment] This Task (or Sub-Task) issue currently is Unresolved, but has a Fix Version of 2.6. The Code Freeze for Sakai 2.6 has now passed (29-Sep-2008, 8:00am Eastern US time).

If you are still working to resolve this issue for 2.6, then please post an email to sakai-dev to let everyone now that you need an exception for this JIra, explain what is left to do, and when you plan to have the work completed; please include that information here in the Jira as well.

Otherwise, if the resolution of this task has been postponed, please reset the Fix Version to 2.7 or Unknown, depending on what you're new expectations for completion are. If the issue is no longer relevant, please close the issue as Won't Fix or Incomplete with an explanation of why.

Thanks!

Peter A. Knoop added a comment - 08-Oct-2008 11:16
[Bulk Comment] The fix version for this Unresolved Tasks still indicates 2.6, but the code freeze is well passed now, and no exception was requested for this work. The Fix Version of this issue is being reset to 2.7, with the expectation that you are planning to finish the work in time for that release. If that is not the case, please update the Fix Version appropriately, or if you are not actively working on this issue, consider turning it into a Feature Request.

Megan May added a comment - 10-Nov-2008 11:57
Aaron, what is the status in relation to the 2.6 release? There are quite a few check ins associated with this JIRA but it's not marked as resolved.

Merci!
Megan

Stephen Marquard added a comment - 03-Dec-2008 04:55 - edited
Current problems:

NPE if not logged in: for example a URL like:

http://mocha.cet.uct.ac.za:8080/direct/poll-vote/1.json

message Direct request failure: NullPointerException:null:Direct request failure: NullPointerException:null: Sakai version: 2.7.0([r54744-rtrunk]) Server: mocha.cet.uct.ac.za(sakai-trunk-a) [sakai-trunk-a-1228242072953] Request URI: /direct/poll-vote/1.json Path Info: /poll-vote/1.json Context path: /direct Method: GET

Logs show:

java.lang.NullPointerException
        at org.sakaiproject.poll.tool.entityproviders.PollVoteEntityProvider.getEntity(PollVoteEntityProvider.java:146)
        at org.sakaiproject.entitybroker.impl.EntityBrokerManager.fetchEntityObject(EntityBrokerManager.java:307)
        at org.sakaiproject.entitybroker.impl.EntityBrokerManager.internalGetEntities(EntityBrokerManager.java:503)
        at org.sakaiproject.entitybroker.impl.EntityBrokerManager.getEntitiesData(EntityBrokerManager.java:339)
        at org.sakaiproject.entitybroker.impl.EntityHandlerImpl.handleEntityAccess(EntityHandlerImpl.java:472)
        at org.sakaiproject.entitybroker.servlet.DirectServlet.dispatch(DirectServlet.java:151)
        at org.sakaiproject.entitybroker.servlet.DirectServlet.handleRequest(DirectServlet.java:119)
        at org.sakaiproject.entitybroker.servlet.DirectServlet.service(DirectServlet.java:95)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

Plus as a site owner, you can see who voted and how they voted with a URL like this:

http://mocha.cet.uct.ac.za:8080/direct/poll-vote.json?pollId=7

which defeats the business rules of the tool, viz. polls are anonymous.

Stephen Marquard added a comment - 03-Dec-2008 05:04
Either needs to be resolved correctly for 2.6.0, or disabled or backed out.

David Horwitz added a comment - 05-Jan-2009 06:20
r55737 addresses the disclosure issuse in stephen's comment. The list is now anonymized for non-admin users (except for the users own submission)

David Horwitz added a comment - 05-Jan-2009 06:26
testing would suggest that the other problem is fixed in trunk

Stephen Marquard added a comment - 12-Jan-2009 03:57
Verified on local trunk build - user identities in votes are not visible to a site maintainer.

Stephen Marquard added a comment - 12-Jan-2009 04:00
Followups in SAK-15354

Anthony Whyte added a comment - 28-Sep-2009 16:16
in 2.6.0.