On Thu, 28 Jan 2010, Victor Engmark wrote:
> The WebTag module contains functions to insert and delete tags in the
> database. Is it OK to use them in inveniocfg.py's
> cli_cmd_create_demo_site? That way I won't have to review
> democfgdata.sql for each update to WebTag.
Assuming these are demo data (Romeo creating tags love1, love2, love3,
and Juliet love1, love4), then usually these data indeed live in
democfgdata.sql. One notable exception is `webaccessadmin', see how it
is used in inveniocfg.
So, depending on the demo data you have, if it is simple to do that in
democfgdata.sql, then please do it there. Otherwise we can do stuff via
webaccessadmin-like technique.
If your data is not only for demo, but also for stress-testing, then
they can be created/removed inside webtag_regression_tests.py.
Another consideration is the export info. Assuming we want to export
user tags to some friendly third parties for study, we will surely have
some INI-style or XML-style format like:
[tag]
value = love1
user = juliet
user = romeo
status = private
[tag]
value = love2
user = romeo
status = group:cms
(just a stripped-down example to illustrate things)
We can draft such a format, and then we can have `--load-webtag-data'
and `--dump-webtag-data' options, and you would have files like
`webtag-atlantis-data.conf' that would be loaded upon site creation.
The democfgdata.sql technique is really just a relic, created mostly by
using UI admin tools and mysqldump, e.g. in case of WebAccess. It was
since a long time in our plans that all modules should have a nice
CONF/INI/XML style configuration files, so that one can do things like
dump-edit-load a configuration, or put stuff from DEV to PROD server:
sitedev$ inveniocfg --dump-websearch-conf > websearch.conf
sitedev$ scp websearch.conf sitepro:/tmp
sitepro$ inveniocfg --load-websearch-conf < /tmp/websearch.conf
so that we would not be relying on mysqldump/grep/dbexec.
There are some musings in the mailing list archives and on Savannah
about this. Nobody has had time to take this task. Some newer modules
like WebStat started, but are still rather alone.
Since WebTag is also a new module, we should probably go straight for
this option. So, just as we have `webstatadmin --dump-config', we can
create options:
- export/import of WebTag config, if it lives in DB:
$ webtagadmin --dump-config
$ webtagadmin --load-config
- export/import of the user data:
$ webtagadmin --dump-data
$ webtagadmin --load-data
We can muse about these options more IRL.
Best regards
--
Tibor Simko ** CERN Document Server ** <http://cds.cern.ch/>