Return-Path: Delivered-To: apmail-incubator-jspwiki-user-archive@minotaur.apache.org Received: (qmail 57045 invoked from network); 25 Feb 2010 20:47:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Feb 2010 20:47:56 -0000 Received: (qmail 14234 invoked by uid 500); 25 Feb 2010 20:47:56 -0000 Delivered-To: apmail-incubator-jspwiki-user-archive@incubator.apache.org Received: (qmail 14222 invoked by uid 500); 25 Feb 2010 20:47:56 -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 14214 invoked by uid 99); 25 Feb 2010 20:47:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 20:47:56 +0000 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [78.142.186.20] (HELO smtp-04.sil.at) (78.142.186.20) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 20:47:46 +0000 Received: from chello080108123177.3.11.vie.surfer.at ([80.108.123.177] helo=darkstar.local) by smtp-04.sil.at with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1NkkcH-0004Xj-QV for jspwiki-user@incubator.apache.org; Thu, 25 Feb 2010 21:47:25 +0100 Message-ID: <4B86E1D2.9030604@it20one.at> Date: Thu, 25 Feb 2010 21:47:14 +0100 From: Siegfried Goeschl Reply-To: siegfried.goeschl@it20one.at Organization: IT20one User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: jspwiki-user@incubator.apache.org Subject: Re: Can the "jspwiki.baseURL" expanded dynamically? References: <4B8695ED.9050303@gmx.at> <184515F3-7A39-4A02-92A0-8CC7D2F06D33@ecyrd.com> In-Reply-To: <184515F3-7A39-4A02-92A0-8CC7D2F06D33@ecyrd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HELO-Warning: Remote host 80.108.123.177 (chello080108123177.3.11.vie.surfer.at) incorrectly presented itself as darkstar.local X-Scan-Signature: 32c8c53979551377c4846eb2e7f6c25c X-Virus-Checked: Checked by ClamAV on apache.org 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 > >