citizen-cyberscience-centre/pybossa — Issue #28: Framework for Managing TaskPresenter 
Author: rgrp
Created: 2012-01-06 15:56:51+00:00
State: open

This follows on from discussion in #10. Issue is how we mount TaskPresenter for a given app *into* PyBossa

NB: it is also possible that the TaskPresenter lives completely outside PyBossa but that is more complex (and for that a) need to enable CORS b) work out how user identity works.

## Proposal

* Each app info object has a key named: task_presenter. The value of this is a hash with following two alternative keys:
* callback_url: a url which will then be iframed into the task page
* Question: how is data (e.g. task info) passed to the TaskPresenter. Remember iframes can't access anything from their parent.
* Answer: we json serialize the Task object and inject it into the page hash in some way or other (or just put it into the query string?)

* html: html and javascript representing for the TaskPresenter. PyBossa will inject this material directly into the page.
* Note this HTML can also rely on some JS info also being in the page which it can use, namely:
* var PyBossa.currentUser - an object representing the currentUser including at least an id attribute.
* var PyBossa.currentTask - an object representing the current task.

## Background

@nigini: [https://github.com/citizen-cyberscience-centre/pybossa/issues/10#issuecomment-3181462](said):

> Have you seen the Facebook model? when you register an App, you have to put a "callback" url, so, when a user (at pyBossa) calls for the application, we provides a frame with the given HTML!