Confirmed users
764
edits
No edit summary |
|||
Line 60: | Line 60: | ||
** AutoCompleteProcessSearch() http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp#1000 - does post-processing | ** AutoCompleteProcessSearch() http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp#1000 - does post-processing | ||
* This file (or these queries at least) are being rewritten in JS: see _processRow() in https://bug455555.bugzilla.mozilla.org/attachment.cgi?id=363641 | * This file (or these queries at least) are being rewritten in JS: see _processRow() in https://bug455555.bugzilla.mozilla.org/attachment.cgi?id=363641 | ||
= Implementation = | |||
=== Database generator === | |||
set up django: | |||
http://www.djangoproject.com/download/1.0.2/tarball/ | |||
uncompress and run: | |||
sudo python setup.py install | |||
add django bin to your path | |||
export PATH=$PATH:~/code/python/django/bin:~/code/python | |||
cd ~/code/python | |||
run this: | |||
django-admin.py startproject places | |||
django-admin.py startapp builddb | |||
copy a places.sqlite file to ~/code/python/places | |||
export PLACES_DB_PATH=~/code/python/places/places.sqlite | |||
export DJANGO_SETTINGS_MODULE=places.settings | |||
export PYTHONPATH=$PYTHONPATH:~/code/python | |||
edit the places/settings.py: | |||
import os | |||
DATABASE_ENGINE = 'sqlite3' | |||
DATABASE_NAME = os.environ['PLACES_DB_PATH'] | |||
reverse engineer the Django Models from the schema: | |||
cd ~/code/python/places | |||
python manage.py inspectdb >> builddb/models.py | |||
Now, we need to clean up the foreign keys. | |||
=== Stats collector === | |||
https://secure.nomenklatur.org/places/ | |||
The stats collector is a CGI script written in Ruby currently located at the above address. When viewing the page, visitors are presented with instructions on how to submit statistics related to their Places databases. They copy a small piece of JavaScript, located at | |||
https://secure.nomenklatur.org/places/stats.js and embedded in the page, and paste it into Firefox's JavaScript console and evaluate it. The JavaScript computes numerous statistics from their Places database, presents them to the user, and allows him to submit them to the site. Once submitted, the stats are inserted into a MySQL database, from which they are presented to all visitors to the site. | |||
We are currently talking with Mozilla IT to setup a more official site at the mozilla.com domain. Once that's completed, we will publicize the site via blogs, forums, and wherever else to solicit submissions from the community. | |||
= Bugs = | |||
* {{bug|480340}} | |||
* https://secure.nomenklatur.org/places/ | |||
= Misc Notes for ddahl and adw = | |||
Some notes on the above funcs and SQL: | Some notes on the above funcs and SQL: | ||
Line 220: | Line 283: | ||
AutoComplete is definitely important, but we'd like our database construction scripts/methodology to be general enough to generate places databases for any kind of testing context. | AutoComplete is definitely important, but we'd like our database construction scripts/methodology to be general enough to generate places databases for any kind of testing context. | ||