Rough architecture overview for backend and frontend
diff --git a/StatisticsModule.wiki b/StatisticsModule.wiki index 3a9450e..eff86ca 100644 --- a/StatisticsModule.wiki +++ b/StatisticsModule.wiki
@@ -11,6 +11,32 @@ || Mario Ferraro || [http://socghop.appspot.com/student_project/show/google/gsoc2009/melange/t124022698336 Ajax Statistics module] || || Daniel Hans || [http://socghop.appspot.com/student_project/show/google/gsoc2009/melange/t124022698771 Statistic Module] || += Rough architecture overview = + +We decided to go also for more flexible statistics, using [http://www.hugoware.net/ jLinq]. Doing this will affect also the way the backend works, so we probably need this kind of structure: + + * * Backend *: + * _statistic.py_ will handle also JSONs which are not produced by [http://code.google.com/apis/visualization/documentation/dev/gviz_api_lib.html gviz] for immediate consumption by Google Visualization Datatable, but there will be also "raw" JSONs to tweak client side with jLinq (say, no students per age with fixed ranges, but number of students per single age, the range to be selected client side). Furthermore, it will also handle JSONs tweaked by hosts. For example, if an host wants to publish some data based on data which contains fields which are private, that JSON should not be sent on public clients in any way. Hence the reason to store them on their own with some fields cut. + * So, _statistic.py_ will handle: + # JSONs collected by jobs and "ready-to-serve" to visualizations with gviz + # JSONs collected by jobs which are to be tweaked with jLinq client side + # JSONs saved by host. For this thing to happen, _statistic.py_ need to be expanded to handle a boolean that shows if that data has been collected automatically or it's been saved by an user. This will also represent a sort of "snapshot". + * _chart.py_ should be inheriting from _document.py_ (to inherit read/write accesses and also be a Linkable), and will need basically the following fields: + * original_data (reference to _statistic.py_) + * user (reference to the user that chart belongs to) + * name_for_user (name of the saved statistic) + * jlinq_steps (something that handles the steps to reproduce filters on the data) + * chart_options (a JSON, with a fixed field that contains the type of chart and other fields which are the options selected for that chart.. colors, etc) + +In some way all the charts should be called and created through a link_id, so they can be embedded in the dashboard as well as in documents (probably using an iframe). + + * * Frontend: * There will be at least 5 main tasks JS should afford: + # UI handling + # Transformation of raw JSON to Google Visualization Datatable JSON + # Data tweaking using jLinq + # Chart options editing based on the type of chart requested + # Backend querying for the correct data + # A sort of "stateful" object that is coupled with each chart and that keep track of the current state, to be saved to the backend when needed. = Gathering Data =