You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by sa...@tkk.fi on 2008/05/16 09:13:20 UTC

Hyperlinks starting with file:

http://www.jspwiki.org/wiki/TextFormattingRules says

"The link can also be a direct URL starting with http:, ftp:, mailto:,  
https:, or news:, in which case the link points to an external entity. "

I wonder why file: is not allowed. If I type something like
    file://localhost/myanmar.xls
into my browser's address field (and hit Enter), OpenOffice Calc is  
launched and opens the file named. It doesn't happen if, instead of  
file:, the link starts with http: (in which case I get the dreaded  
"Object not found!" error.)

Now, I wanted to put a link like that (file:) into a JSPWiki page. But  
clicking it doesn't work - there is no error message, even. (If I  
start the link with http:, it's "Object not found!" again.)

Just curious whether there is a reason for this, or whether it's  
something no one else finds useful...


Sakari Aaltonen



Re: UTF-8 and Search

Posted by sa...@tkk.fi.
Quoting Florian Holeczek <fl...@holeczek.de>:

> Have a look at http://www.jspwiki.org/wiki/TomcatAndUTF8

Problem solved - thank you!

(It's not only JSPWiki that is new to me; Tomcat is, too...)


Sakari Aaltonen





Re: UTF-8 and Search

Posted by Florian Holeczek <fl...@holeczek.de>.
Have a look at http://www.jspwiki.org/wiki/TomcatAndUTF8

 Florian

Ursprüngliche Nachricht vom 20.05.2008 um 13:46:
> We have been editing several pages with text containing "Nordic"  
> characters - words like "pöytäkirja", say. No problems. Now, however,
> someone wanted to search for this word, and typed it into the Search  
> box (where it first says "Quick Navigation"). But on the Search page  
> that opened, it read "pöytäkirja", changed, apparently, by JSPWiki.

> The search was, of course, unsuccessful.

> What am I doing wrong? The file  
> $CATALINA_HOME/webapps/JSPWiki/WEB-INF/jspwiki.properties does include
> the line

>     jspwiki.encoding = UTF-8


> Thank you,
> Sakari Aaltonen




UTF-8 and Search

Posted by sa...@tkk.fi.
We have been editing several pages with text containing "Nordic"  
characters - words like "pöytäkirja", say. No problems. Now, however,  
someone wanted to search for this word, and typed it into the Search  
box (where it first says "Quick Navigation"). But on the Search page  
that opened, it read "pöytäkirja", changed, apparently, by JSPWiki.

The search was, of course, unsuccessful.

What am I doing wrong? The file  
$CATALINA_HOME/webapps/JSPWiki/WEB-INF/jspwiki.properties does include  
the line

    jspwiki.encoding = UTF-8


Thank you,
Sakari Aaltonen




Re: Hyperlinks starting with file:

Posted by Dirk Frederickx <di...@gmail.com>.
Here's a quick solution  (didn't test it ;-)

1) go to PageContent.jsp

2) find the first </wiki:Tab> element

3) Insert this line just before that line

    <wiki:Include page="AttachmentTab.jsp"/>


Hit refresh on your browser to see the attachment table on the front page too.

good luck

dirk


On Mon, May 19, 2008 at 11:32 AM,  <sa...@tkk.fi> wrote:
> Quoting Gavin Goldsmith <gg...@pnp.co.za>:
>
>> Perhaps JSPWiki/tomcat has no permissions to save the attachments. Take
>> a look at the following 2 items in the jspwiki.properties file:
>>   jspwiki.attachmentProvider = BasicAttachmentProvider
>>   jspwiki.basicAttachmentProvider.storageDir =
>> /JSPWiki/user_attachments
>>
>> See that they are set and that the relevant permissions are set.
>
> Indeed, this seems to have been the root cause, as the jspwiki.properties
> file's relevant line read
>    jspwiki.basicAttachmentProvider.storageDir = /p/web/www-data/jspwiki/
> which (obviously) did not point to anything useful on my machine.
>
> Once I corrected it, attachments started working in the way I expected them
> to. However, Janne J mentioned <templates> in an earlier mail as being the
> cause of the attachments being "hidden" under the Attach button/tab. But
> which <template> is responsible for this?  How can attachments be listed on
> the page itself, immediately visible?
>
>
> Thank you,
> Sakari Aaltonen
>
>
>

RE: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Quoting Gavin Goldsmith <gg...@pnp.co.za>:

> Perhaps JSPWiki/tomcat has no permissions to save the attachments. Take
> a look at the following 2 items in the jspwiki.properties file:
>    jspwiki.attachmentProvider = BasicAttachmentProvider
>    jspwiki.basicAttachmentProvider.storageDir =
> /JSPWiki/user_attachments
>
> See that they are set and that the relevant permissions are set.

Indeed, this seems to have been the root cause, as the  
jspwiki.properties file's relevant line read
     jspwiki.basicAttachmentProvider.storageDir = /p/web/www-data/jspwiki/
which (obviously) did not point to anything useful on my machine.

Once I corrected it, attachments started working in the way I expected  
them to. However, Janne J mentioned <templates> in an earlier mail as  
being the cause of the attachments being "hidden" under the Attach  
button/tab. But which <template> is responsible for this?  How can  
attachments be listed on the page itself, immediately visible?


Thank you,
Sakari Aaltonen



RE: Hyperlinks starting with file:

Posted by Gavin Goldsmith <gg...@pnp.co.za>.
 

> -----Original Message-----
> From: sakari.aaltonen@tkk.fi [mailto:sakari.aaltonen@tkk.fi] 
> 
> Quoting Florian Holeczek <fl...@holeczek.de>:
> 
> >> (When I look under the "Attach" tab, all I see is a dialog for 
> >> selecting the file to be attached.)
> >
> > Sure, because nothing is attached yet. Simply attach a file and it 
> > will appear in a list below this dialog. There's even a 
> nice preview 
> > function for pictures, just like in your mail reader.
> 
> After I attach a file (I take this means "select a file and 
> hit Upload"), it does not appear anywhere. There is no list.
> 
Perhaps JSPWiki/tomcat has no permissions to save the attachments. Take
a look at the following 2 items in the jspwiki.properties file:
   jspwiki.attachmentProvider = BasicAttachmentProvider
   jspwiki.basicAttachmentProvider.storageDir =
/JSPWiki/user_attachments

See that they are set and that the relevant permissions are set.

Gavin

Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093? 
If you don't have web access, the disclaimer can be mailed to you on request. 
Disclaimer requests to be sent to it-security@pnp.co.za 
 

Re: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Quoting Florian Holeczek <fl...@holeczek.de>:

>> (When I look under the "Attach" tab, all I see is a dialog for
>> selecting the file to be attached.)
>
> Sure, because nothing is attached yet. Simply attach a file and it
> will appear in a list below this dialog. There's even a nice preview
> function for pictures, just like in your mail reader.

After I attach a file (I take this means "select a file and hit  
Upload"), it does not appear anywhere. There is no list.


Sakari Aaltonen




Re: Hyperlinks starting with file:

Posted by Florian Holeczek <fl...@holeczek.de>.
>> Hmm... Try this on sandbox.jspwiki.org, there you'll see!
>> I've just attached a picture to the Main page.
>>
>> Maybe your configuration is missing something and therefore no
>> attachments are included (but that's just a guess).
>>

> A very useful tip; thank you. I tried it and, yes, I was able to add  
> an .XLS file as an attachment *and* have OpenOffice launched when I  
> clicked on the file's name. This is *almost* what I'm looking for. It
> would be even better if the file name was visible somewhere on the  
> page, rather than sort of hidden "under" the Attach button.

> Yes, my configuration is sure to miss something (I have basically  
> unzipped JSPWiki-corepages.zip.) But what is it?

We were mailing off the list here.
Have a look at Gavin Goldsmith's response regarding configuration.

Florian

Re: Hyperlinks starting with file:

Posted by Florian Holeczek <fl...@holeczek.de>.
> (When I look under the "Attach" tab, all I see is a dialog for
> selecting the file to be attached.)

Sure, because nothing is attached yet. Simply attach a file and it
will appear in a list below this dialog. There's even a nice preview
function for pictures, just like in your mail reader.

Florian

Re: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Quoting Janne Jalkanen <Ja...@ecyrd.com>:

> Look under the "Attach" tab.  They were delegated off the main page in
> the default template for clarity's sake.  It's trivial for you to
> change the template to show them under the page text, if that is what
> you want.

Thank you, but, well, it's not trivial for me. At the moment, I don't  
even understand what a template does, let alone which (default)  
template to change, and how. (When I look under the "Attach" tab, all  
I see is a dialog for selecting the file to be attached.)


Sakari Aaltonen



Re: Hyperlinks starting with file:

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> Ermm... I don't understand JSPWiki's concept of attachment. When I  
> attach a file to a page I edit, the resulting page does not show  
> any sign or indication of the file or even of the fact that  
> something has, in fact, been attached, which is what I expect. That  
> is, something in the style of email attachments, which result in  
> clickable links on the mail reader's page.

Look under the "Attach" tab.  They were delegated off the main page  
in the default template for clarity's sake.  It's trivial for you to  
change the template to show them under the page text, if that is what  
you want.

/Janne

Re: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Quoting Janne Jalkanen <Ja...@ecyrd.com>:

>>
>> Sounds reasonable. However, in our case we have a number of   
>> documents of various types - Word, Excel, TeX, PDF, PowerPoint,   
>> etc. that we want publish to all users of the wiki. It seems very   
>> complicated and error-prone to try to transform all these existing   
>> documents into some JSPWiki format (by plugins?). Instead, it would  
>>  be much easier, I think, to keep the documents as they are, and   
>> just launch an appropriate program (in a separate window or tab)   
>> when a user clicks on the name of a document, wanting to have a   
>> closer look.
>
>
> Why can't you use attachments?

Ermm... I don't understand JSPWiki's concept of attachment. When I  
attach a file to a page I edit, the resulting page does not show any  
sign or indication of the file or even of the fact that something has,  
in fact, been attached, which is what I expect. That is, something in  
the style of email attachments, which result in clickable links on the  
mail reader's page.


Sakari Aaltonen




Re: Hyperlinks starting with file:

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
>
> Sounds reasonable. However, in our case we have a number of  
> documents of various types - Word, Excel, TeX, PDF, PowerPoint,  
> etc. that we want publish to all users of the wiki. It seems very  
> complicated and error-prone to try to transform all these existing  
> documents into some JSPWiki format (by plugins?). Instead, it would  
> be much easier, I think, to keep the documents as they are, and  
> just launch an appropriate program (in a separate window or tab)  
> when a user clicks on the name of a document, wanting to have a  
> closer look.


Why can't you use attachments?

As everyone has pointed out, the blocking of file:// URLs is a  
security feature mandated by the browser, and JSPWiki can not  
influence it in any way.

/Janne

Re: Hyperlinks starting with file:

Posted by Murray Altheim <mu...@altheim.com>.
Janne Jalkanen wrote:
>> You can edit the file extensions recognized by JSPWiki as attachments
>> by editing the value of jspwiki.attachment.allow in
>> $WIKI_HOME/WEB-INF/jspwiki.properties. If you were providing links
>
> Wrong.  Any file attached as an attachment is recognized as an 
> attachment.  As is logical.
> 
> The jspwiki.attachment.allow only influences the uploading of 
> attachments - which attachment types may be uploaded.

The jspwiki.attachment.* properties are as you say only influential
on attachments, which is one of the possible solutions to this
problem. The other was my suggestion of a plugin index of a
directory, a directory within the wiki hierarchy that could be served
via http:. I wasn't meaning to imply otherwise; they are two separate
suggestions.

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Re: Hyperlinks starting with file:

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> You can edit the file extensions recognized by JSPWiki as attachments
> by editing the value of jspwiki.attachment.allow in
> $WIKI_HOME/WEB-INF/jspwiki.properties. If you were providing links
>

Wrong.  Any file attached as an attachment is recognized as an  
attachment.  As is logical.

The jspwiki.attachment.allow only influences the uploading of  
attachments - which attachment types may be uploaded.

/Janne

Re: Hyperlinks starting with file:

Posted by Murray Altheim <mu...@altheim.com>.
Gavin Goldsmith wrote:
> Hi
>  
>> Sounds reasonable. However, in our case we have a number of 
>> documents of various types - Word, Excel, TeX, PDF, 
>> PowerPoint, etc. that we want publish to all users of the 
>> wiki. 
>>
> A possible solution is to create a shared folder within the structres
> which  JSPWiki/Tomcat is able to "serve up". The files can then be
> placed there and accessed with standard markup, e.g. [Label/Description
> | http://servername/JSPWiki/images/xmlCoffeeCup.png].
> 
> You can do this with all file types recognised by JSPWiki (there was a
> reference to this on this list earlier today).

Yes, and the directory used could even be a symbolic link, i.e., you
wouldn't have to move the files from their existing location. It
would be relatively easy to write a plugin* to provide an index of the
files in a given directory, so you could even avoid having to do any
manual creation of links (which would be the case if you were to use
attachments).

You can edit the file extensions recognized by JSPWiki as attachments
by editing the value of jspwiki.attachment.allow in
$WIKI_HOME/WEB-INF/jspwiki.properties. If you were providing links
to files in a directory the the file extensions are handled by the
user's browser. These would of course be http: protocol links, not
file: links (since they're being served by Apache/your server from
a suitable directory rather than an arbitrary location on the server).

Murray

* likely using java.io.File#listFiles()
...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

RE: Hyperlinks starting with file:

Posted by Gavin Goldsmith <gg...@pnp.co.za>.
Hi
 
> Sounds reasonable. However, in our case we have a number of 
> documents of various types - Word, Excel, TeX, PDF, 
> PowerPoint, etc. that we want publish to all users of the 
> wiki. 
>
A possible solution is to create a shared folder within the structres
which  JSPWiki/Tomcat is able to "serve up". The files can then be
placed there and accessed with standard markup, e.g. [Label/Description
| http://servername/JSPWiki/images/xmlCoffeeCup.png].

You can do this with all file types recognised by JSPWiki (there was a
reference to this on this list earlier today).

Hope this helps some.


Gavin


Read our disclaimer at: http://www.picknpay.co.za/pnp/view/pnp/en/page5093? 
If you don't have web access, the disclaimer can be mailed to you on request. 
Disclaimer requests to be sent to it-security@pnp.co.za 
 

Re: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Lainaus Murray Altheim <mu...@altheim.com>:

> Sakari,
>
> It is indeed for security purposes. Few systems administrators would
> want to install software that permitted external users to access any
> file on a server, or even have access (at all) to the local file
> system. Wikis in general don't need such access so there's not much
> of an argument for including it.

Sounds reasonable. However, in our case we have a number of documents  
of various types - Word, Excel, TeX, PDF, PowerPoint, etc. that we  
want publish to all users of the wiki. It seems very complicated and  
error-prone to try to transform all these existing documents into some  
JSPWiki format (by plugins?). Instead, it would be much easier, I  
think, to keep the documents as they are, and just launch an  
appropriate program (in a separate window or tab) when a user clicks  
on the name of a document, wanting to have a closer look.

(Also, the wiki is intended to be strictly internal to the workplace  
here. We shall make an effort not to have external users.)


Sakari Aaltonen



Re: Hyperlinks starting with file:

Posted by Murray Altheim <mu...@altheim.com>.
Sakari,

It is indeed for security purposes. Few systems administrators would
want to install software that permitted external users to access any
file on a server, or even have access (at all) to the local file
system. Wikis in general don't need such access so there's not much
of an argument for including it. It probably wouldn't be too difficult
to modify JSPWiki to permit it, but nobody would want that as a default.

Murray

sakari.aaltonen@tkk.fi wrote:
> http://www.jspwiki.org/wiki/TextFormattingRules says
> 
> "The link can also be a direct URL starting with http:, ftp:, mailto:, 
> https:, or news:, in which case the link points to an external entity. "
> 
> I wonder why file: is not allowed. If I type something like
>    file://localhost/myanmar.xls
> into my browser's address field (and hit Enter), OpenOffice Calc is 
> launched and opens the file named. It doesn't happen if, instead of 
> file:, the link starts with http: (in which case I get the dreaded 
> "Object not found!" error.)
> 
> Now, I wanted to put a link like that (file:) into a JSPWiki page. But 
> clicking it doesn't work - there is no error message, even. (If I start 
> the link with http:, it's "Object not found!" again.)
> 
> Just curious whether there is a reason for this, or whether it's 
> something no one else finds useful...
> 
> 
> Sakari Aaltonen

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Re: Hyperlinks starting with file:

Posted by Derek Hohls <DH...@csir.co.za>.
Not sure about IE, but here is a link regarding FF:
http://www.petersblog.org/node/1049 


>>> On 2008/05/16 at 11:45, in message <20...@webmail1.tkk.fi>, <sa...@tkk.fi> wrote:
Lainaus Florian Holeczek <fl...@holeczek.de>:

> Hallo Sakari,
>
> I guess this is for security reasons, because file:// doesn't
> necessarily mean your computer, but the page requester's computer in
> general.
>
> I've once been experimenting with this and used the following InterWiki
> link in jspwiki.properties:
>
> jspwiki.interWikiRef.WindowsShare = file:///%s
>
> You can then define a link via [WindowsShare:c:/bla/xyz.txt] in your
> wiki pages.
>
> This link then appears correctly in the HTML code, but it seems as if
> modern browsers block it (clicking on it doesn't do anything in IE7
> and Firefox 2). However, this feature may be configurable.

I tried this, but there doesn't seem to be any real difference, as  
just writing file: (directly) in the JSPWiki link results in HTML code  
that is practically identical with that produced by the WindowsShare  
explained above (just two instead of three slashes.) The browser  
behavior is identical, too.

Apparently, something else is needed to make the browser launch an  
application when needed (according to file type), which is what I'm  
after here.


Thank you anyway,
Sakari Aaltonen




-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


Re: Hyperlinks starting with file:

Posted by sa...@tkk.fi.
Lainaus Florian Holeczek <fl...@holeczek.de>:

> Hallo Sakari,
>
> I guess this is for security reasons, because file:// doesn't
> necessarily mean your computer, but the page requester's computer in
> general.
>
> I've once been experimenting with this and used the following InterWiki
> link in jspwiki.properties:
>
> jspwiki.interWikiRef.WindowsShare = file:///%s
>
> You can then define a link via [WindowsShare:c:/bla/xyz.txt] in your
> wiki pages.
>
> This link then appears correctly in the HTML code, but it seems as if
> modern browsers block it (clicking on it doesn't do anything in IE7
> and Firefox 2). However, this feature may be configurable.

I tried this, but there doesn't seem to be any real difference, as  
just writing file: (directly) in the JSPWiki link results in HTML code  
that is practically identical with that produced by the WindowsShare  
explained above (just two instead of three slashes.) The browser  
behavior is identical, too.

Apparently, something else is needed to make the browser launch an  
application when needed (according to file type), which is what I'm  
after here.


Thank you anyway,
Sakari Aaltonen



Re: Hyperlinks starting with file:

Posted by Florian Holeczek <fl...@holeczek.de>.
Hallo Sakari,

I guess this is for security reasons, because file:// doesn't
necessarily mean your computer, but the page requester's computer in
general.

I've once been experimenting with this and used the following InterWiki
link in jspwiki.properties:

jspwiki.interWikiRef.WindowsShare = file:///%s

You can then define a link via [WindowsShare:c:/bla/xyz.txt] in your
wiki pages.

This link then appears correctly in the HTML code, but it seems as if
modern browsers block it (clicking on it doesn't do anything in IE7
and Firefox 2). However, this feature may be configurable.

Regards,
 Florian

Ursprüngliche Nachricht vom 16.05.2008 um 09:13:
> http://www.jspwiki.org/wiki/TextFormattingRules says

> "The link can also be a direct URL starting with http:, ftp:, mailto:,
> https:, or news:, in which case the link points to an external entity. "

> I wonder why file: is not allowed. If I type something like
>     file://localhost/myanmar.xls
> into my browser's address field (and hit Enter), OpenOffice Calc is  
> launched and opens the file named. It doesn't happen if, instead of  
> file:, the link starts with http: (in which case I get the dreaded  
> "Object not found!" error.)

> Now, I wanted to put a link like that (file:) into a JSPWiki page. But
> clicking it doesn't work - there is no error message, even. (If I  
> start the link with http:, it's "Object not found!" again.)

> Just curious whether there is a reason for this, or whether it's  
> something no one else finds useful...


> Sakari Aaltonen