You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Siegfried Goeschl <sg...@gmx.at> on 2010/02/25 16:23:25 UTC

Can the "jspwiki.baseURL" expanded dynamically?

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


Re: Can the "jspwiki.baseURL" expanded dynamically?

Posted by Florian Holeczek <fl...@holeczek.de>.
Hi Siegfried,

we really appreciate your WOAS approach and so I tried to have a look at
this. However, time...

Could you please open a JIRA issue on this, so it doesn't get lost?

I personally believe that looking at how computing devices become mobile
more and more, a somehow dynamic BaseURL might be important use case.
We're really quite inflexible at this point.

One possibility I'm thinking of would be passing the variable definition
via the java command line (-Djspwiki.baseURL=...). However, this should
be discussed in JIRA.

Regards
 Florian

Am 27.02.2010 14:24, schrieb Siegfried Goeschl:
> Hi Janne,
> 
> not really feasable with native executable for Windows or Mac and also
> not elegant ... :-)
> 
> Siegfried Goeschl
> 
> On 26.02.10 09:00, Janne Jalkanen wrote:
>>
>> 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.
>>>> * <pre>
>>>> * var.basedir = /p/mywiki;
>>>> * jspwiki.fileSystemProvider.pageDir = $basedir/www/
>>>> * jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
>>>> * jspwiki.workDir = $basedir/wrk/
>>>> * </pre>
>>>>
>>>> * <h3>Cascading Properties</h3>
>>>> * <p>
>>>> * 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 <i>cascading property files</i>. This
>>>> way you
>>>> * can overwrite the default values and only specify the properties you
>>>> * need to change in a multiple wiki environment.
>>>> * <p>
>>>> * You define a cascade in the context mapping of your servlet
>>>> container.
>>>> * <pre>
>>>> * jspwiki.properties.cascade.1
>>>> * jspwiki.properties.cascade.2
>>>> * jspwiki.properties.cascade.3
>>>> * </pre>
>>>> * 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
>>>>
>>>>
>>
>>

Re: Can the "jspwiki.baseURL" expanded dynamically?

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Janne,

not really feasable with native executable for Windows or Mac and also 
not elegant ... :-)

Siegfried Goeschl

On 26.02.10 09:00, Janne Jalkanen wrote:
>
> 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.
>>> * <pre>
>>> * var.basedir = /p/mywiki;
>>> * jspwiki.fileSystemProvider.pageDir = $basedir/www/
>>> * jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
>>> * jspwiki.workDir = $basedir/wrk/
>>> * </pre>
>>>
>>> * <h3>Cascading Properties</h3>
>>> * <p>
>>> * 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 <i>cascading property files</i>. This
>>> way you
>>> * can overwrite the default values and only specify the properties you
>>> * need to change in a multiple wiki environment.
>>> * <p>
>>> * You define a cascade in the context mapping of your servlet container.
>>> * <pre>
>>> * jspwiki.properties.cascade.1
>>> * jspwiki.properties.cascade.2
>>> * jspwiki.properties.cascade.3
>>> * </pre>
>>> * 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
>>>
>>>
>
>

Re: Can the "jspwiki.baseURL" expanded dynamically?

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
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.
>> * <pre>
>> * var.basedir = /p/mywiki;
>> * jspwiki.fileSystemProvider.pageDir = $basedir/www/
>> * jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
>> * jspwiki.workDir = $basedir/wrk/
>> * </pre>
>>
>> * <h3>Cascading Properties</h3>
>> * <p>
>> * 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 <i>cascading property files</i>. This  
>> way you
>> * can overwrite the default values and only specify the properties  
>> you
>> * need to change in a multiple wiki environment.
>> * <p>
>> * You define a cascade in the context mapping of your servlet  
>> container.
>> * <pre>
>> * jspwiki.properties.cascade.1
>> * jspwiki.properties.cascade.2
>> * jspwiki.properties.cascade.3
>> * </pre>
>> * 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
>>
>>


Re: Can the "jspwiki.baseURL" expanded dynamically?

Posted by Siegfried Goeschl <si...@it20one.at>.
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.
> * <pre>
> * var.basedir = /p/mywiki;
> * jspwiki.fileSystemProvider.pageDir = $basedir/www/
> * jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
> * jspwiki.workDir = $basedir/wrk/
> * </pre>
>
> * <h3>Cascading Properties</h3>
> * <p>
> * 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 <i>cascading property files</i>. This way you
> * can overwrite the default values and only specify the properties you
> * need to change in a multiple wiki environment.
> * <p>
> * You define a cascade in the context mapping of your servlet container.
> * <pre>
> * jspwiki.properties.cascade.1
> * jspwiki.properties.cascade.2
> * jspwiki.properties.cascade.3
> * </pre>
> * 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
>
>

Re: Can the "jspwiki.baseURL" expanded dynamically?

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
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.
      *  <pre>
      *  var.basedir = /p/mywiki;
      *  jspwiki.fileSystemProvider.pageDir =         $basedir/www/
      *  jspwiki.basicAttachmentProvider.storageDir = $basedir/www/
      *  jspwiki.workDir =                            $basedir/wrk/
      *  </pre>

      *  <h3>Cascading Properties</h3>
      *  <p>
      *  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 <i>cascading property files</i>.  
This way you
      *  can overwrite the default values and only specify the  
properties you
      *  need to change in a multiple wiki environment.
      *  <p>
      *  You define a cascade in the context mapping of your servlet  
container.
      *  <pre>
      *  jspwiki.properties.cascade.1
      *  jspwiki.properties.cascade.2
      *  jspwiki.properties.cascade.3
      *  </pre>
      *  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