[daisy] change the default namespace name

Tom Brusselle tb at schaubroeck.be
Mon May 14 07:31:21 CDT 2007


Hi,

We use a daisy template installation that we copy to install different
daisies.  Now I've realized that we won't ever be able to migrate
documents between any of these daisies because they all have the same
namespace id (and even the same fingerprint).  So I would like to change
the name (and id) of the default namespace of a daisy repository that
already has documents in it, including the namespace of the already
existing documents.  There are no imported documents or other namespaces
present in the repository.

I've nosed around a little and i think this might work:
1) change the "name_" and "fingerprint" values of the existing namespace
in the "daisy_namespaces" table in the database;
2) change the default namespace in myconfig.xml
3) change all links in all daisy documents that link to other daisy
documents to replace the existing namespace in the link with a new one
(the new default namespace)


External links to pages in this daisy don't exist yet so the fact that
all the links will change isn't a problem for me.  But there are links
within the existing daisy documents that will have to be changed.  There
is already a docid_convertor tool present for upgrading daisy 1.5 to
2.0, right now it converts all daisy links without a namespace to links
with a namespace.
I think it would be a relatively small adaptation to make it possible to
run this tool on all documents to change one namespace to another
namespace in all daisy links.  (i haven't looked at the code)
This way one could change the namespace of a daisy instance at any time
if a namespace conflict occurs.
(The only remaining disadvantage would be that all externally saved
links would become invalid.  But then you could create an apache url
rewrite or possibly implement some sort of deprecated-namespace-redirect
in daisy itsef to solve that)


Another question: in absense of the adapted docid convertor tool, would
the following sysadmin hack work to change all links?  (pseudocode)
- stop the repository
- for every file in the blobstore:
-- s/daisy:(\d+)-old/daisy:\1-new/g  (substitute all entries of the form
daisy:123-old to daisy:123-new)

or would this horribly corrupt something?


thanks very much in advance for you answers,

Tom Brusselle


 **** DISCLAIMER ****
 http://www.schaubroeck.be/maildisclaimer.htm


More information about the daisy mailing list