Discussion about InterWikiMap maintenance on moin-user list #871 From: "Robert Seeger" To: Subject: [Moin-user] How to use a wiki page as the shared_intermap in moin 1.3.5? Dear MoinMoin Masters, I'm still in the migration from 1.1 to 1.3.5 and am puzzled with regard to InterWiki configuration. In 1.1. you could easily use shared_intermap to point to a text file that was also a wiki page, as pages had a static file name an location. This was described in the HelpMiscellaneous for 1.1.: If you want your users to easily add new InterWiki monikers, change your moin_config.py to contain an entry like this: shared_intermap = ['/usr/local/moin/mywiki/data/text/intermap_2etxt'] Then create a page named intermap.txt (see intermap.txt for an example) with the following content: .... This allowed easy maintenance of interwiki definitions in the usual Wiki way. As we use InterWiki a lot to make our IntraNet flexible (not only for various wikis in a farm, but also to bug trackers, databases, file server, mail repository...) this is a very convenient way. Now in 1.3.5 we have a completely different physical storage of the pages and each revision gets a different file name, so I'm not sure how it is now possible to point to the newest revision. As I've seen the central http://moinmoin.wikiwikiweb.de/InterWikiMap I was wondering if you serve the InterWiki directly from there? If 'Yes' then I would like to know how you do this by configuration? If 'No' then I will think about a way to patch this in wikiutil.resolve_wiki - should not be too difficult. I am thinking alog the line of if filename.startswith("wiki:"): #parse page instead of file I live in the Windows/NTFS world, so "wiki:" could never be the start of a valid file name, but how about other os/filesystems? Or should I better introduce a second config parameter? Kind Regards, Robert Seeger #876 From: Thomas Waldmann To: moin-user@lists.sourceforge.net Subject: Re: [Moin-user] How to use a wiki page as the shared_intermap in moin 1.3.5? Hi Robert, > In 1.1. you could easily use shared_intermap to point to a text file You can do that with 1.3.5, too, but ... > was also a wiki page, as pages had a static file name an location. ... this isn't any more the case. > This allowed easy maintenance of interwiki definitions in the usual Wiki > way. With 1.3+ you can just use a wget call to the raw action of the interwiki wiki page. Maybe using cron. > As I've seen the central http://moinmoin.wikiwikiweb.de/InterWikiMap I was > wondering if you serve the InterWiki directly from there? We use wget to make the dist version of the file. > If 'Yes' then I would like to know how you do this by configuration? > If 'No' then I will think about a way to patch this in > wikiutil.resolve_wiki - should not be too difficult. I am thinking alog the > line of > > if filename.startswith("wiki:"): > #parse page instead of file The point why I didn't already do that, is that using a local file is worse for a wiki farm than using a (common) file. greetings, Thomas #877 From: "Robert Seeger" To: Subject: Re: [Moin-user] How to use a wiki page as the shared_intermap in moin 1.3.5 Date: Tue, 25 Oct 2005 15:07:21 +0200 Hi Thomas, > > With 1.3+ you can just use a wget call to the raw action of the > interwiki wiki page. Maybe using cron. > thanks for the info. I'm an old Windows user who has not come near any Unix prompt since Linux and the WWW were invented (I used to be an OS/2 freak for many years ;-)), thus I'm not familiar with wget and don't like cron jobs etc. very much. I prefer that my edit of a page has immediate effect. However your mentioning of the raw action and wget pointed me in the right direction and I tried a different solution inspired by a function in MoinMoin\scripts\xmlrpc-tools\getmasterpages2 (I think it is yours?). It seems to work well, but I haven't done much testing yet. I created two wiki pages, one as a copy of moinmaster's InterWikiMap and one with my (Intranet) additions. Then I simply put the http URL with the raw action in shared_intermap: shared_intermap = ['http://ors-x-know/master13cgi/moin.cgi/InterWikiMap?action=raw','http://or s-x-know/master13cgi/moin.cgi/InterWikiMapOrs?action=raw'] Then I patched wikiutil.resolve_wiki: for filename in intermap_files: if filename and os.path.isfile(filename): f = open(filename, "r") lines.extend(f.readlines()) f.close() #RS elif filename and filename.startswith("http:"): #maybe this is an URL to get a raw page? pagedata = urllib.urlopen(filename).read() lines.extend(pagedata.split("\n")) #RS end I'm not sure about unicode and encoding issues, but at least page InterWiki in any wiki of my farm now shows all my InterWiki additions. Of course your solution using wget is much better from the performance point of view. Thanx and kind regards, Robert