Return-Path: Delivered-To: apmail-incubator-jspwiki-user-archive@minotaur.apache.org Received: (qmail 26287 invoked from network); 26 Feb 2010 19:04:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Feb 2010 19:04:28 -0000 Received: (qmail 20065 invoked by uid 500); 26 Feb 2010 19:04:28 -0000 Delivered-To: apmail-incubator-jspwiki-user-archive@incubator.apache.org Received: (qmail 20028 invoked by uid 500); 26 Feb 2010 19:04:27 -0000 Mailing-List: contact jspwiki-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-user@incubator.apache.org Delivered-To: mailing list jspwiki-user@incubator.apache.org Received: (qmail 20020 invoked by uid 99); 26 Feb 2010 19:04:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 19:04:27 +0000 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=DATE_IN_PAST_06_12,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of janne.jalkanen@ecyrd.com designates 193.64.5.122 as permitted sender) Received: from [193.64.5.122] (HELO mail.ecyrd.com) (193.64.5.122) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 19:04:18 +0000 Received: from [192.168.0.3] (cs181005170.pp.htv.fi [82.181.5.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.ecyrd.com (Postfix) with ESMTPSA id 9A44697C13F for ; Fri, 26 Feb 2010 21:03:56 +0200 (EET) Message-Id: <7416CA2D-0EC0-4230-BD98-792CF332D383@ecyrd.com> From: Janne Jalkanen To: jspwiki-user@incubator.apache.org In-Reply-To: <4B86E1D2.9030604@it20one.at> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Can the "jspwiki.baseURL" expanded dynamically? Date: Fri, 26 Feb 2010 10:00:13 +0200 References: <4B8695ED.9050303@gmx.at> <184515F3-7A39-4A02-92A0-8CC7D2F06D33@ecyrd.com> <4B86E1D2.9030604@it20one.at> X-Mailer: Apple Mail (2.936) But you could have a small shell script which would replace the relevant sections in jspwiki.properties with sed or something...? /Janne On Feb 25, 2010, at 22:47 , Siegfried Goeschl wrote: > Hi Janne, > > this helps for streamlining my configuration but does not solve the > problem - ${localhost.hostName} whould be completely dynamic > (InetAddress.getHostName()), i.e. no manual configuration involved. > > Cheers, > > Siegfried Goeschl > > On 25.02.10 20:27, Janne Jalkanen wrote: >> >> Ugh... Yeah, you might be able to do that using cascading >> properties and >> variable expansion, and storing one of the cascading propfiles >> somewhere >> where it's easily editable. This isn't documented very well anywhere, >> but here are the relevant snippets: >> >> /** >> * You define a property variable by using the prefix "var.x" as a >> * property. In property values you can then use the "$x" identifier >> * to use this variable. >> * >> * For example you could declare a base directory for all your files >> * like this and use it in all your other property definitions with >> * a "$basedir". Note that it does not matter if you define the >> * variable before its usage. >> *
>> * var.basedir = /p/mywiki;
>> * jspwiki.fileSystemProvider.pageDir = $basedir/www/
>> * jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
>> * jspwiki.workDir = $basedir/wrk/
>> * 
>> >> *

Cascading Properties

>> *

>> * You can define additional property files and merge them into the >> default >> * properties file in a similar process to how you define cascading >> style >> * sheets; hence we call this cascading property files. This >> way you >> * can overwrite the default values and only specify the properties >> you >> * need to change in a multiple wiki environment. >> *

>> * You define a cascade in the context mapping of your servlet >> container. >> *

>> * jspwiki.properties.cascade.1
>> * jspwiki.properties.cascade.2
>> * jspwiki.properties.cascade.3
>> * 
>> * and so on. You have to number your cascade in a descending way >> starting >> * with "1". This means you cannot leave out numbers in your >> cascade. This >> * method is based on an idea by Olaf Kaus, see >> [JSPWiki:MultipleWikis]. >> >> /Janne >> >> On Feb 25, 2010, at 17:23 , Siegfried Goeschl wrote: >> >>> Hi folks, >>> >>> for my "Wiki On A Stick" I'm currently using the following entry in >>> jspwiki.properties >>> >>> jspwiki.baseURL=http://localhost:9627/wiki/ >>> >>> That works fine if your server is running on your local machine but >>> not on a copy of local wiki on a different box. Is there something >>> to >>> expand the host name and/or address automatically >>> >>> jspwiki.baseURL=http://${localhost.hostName}:9627/wiki/ >>> >>> or >>> >>> jspwiki.baseURL=http://${localhost.address}:9627/wiki/ >>> >>> assuming that this will break on a multi-homed host >>> >>> Thanks in advance >>> >>> Siegfried Goeschl >> >>