[Moin-user] reference ot external file possible?

Markus Liebelt markus.liebelt at online.de
Sun Oct 2 13:41:29 EDT 2005


Hello Nir,

thank you for you tip. I tried it out, but could not tell to what effect. What I get is:

1. I expand the wikiconfig.py like you said
2. I define a directory wiki/resources
3. I include there a file test.txt
4. I enter an URL in a wiki page: file:///resources/test.txt

When I click on the URL, the following happens:
1. In the browser, nothing is done
2. In the MMDE shell output, noting is seen.

What I think is, that the browser does not accept a link like that.

Then I tried to replace the file: by http: to avoid that, and get the following result:

1. Browser tells me that he has an internal communication error, that the resource is not available. The exact output was:

Internal communication error

You tried to access the address http:///resources/test.txt, which is currently unavailable. Please make sure that the Web address (URL) is correctly spelled and punctuated, then try reloading the page.

Perhaps the whole scheme does not work with the MMDE (Desktop Edition), I don't know.

So I stick to the original idea to implement a macro and corresponding action. See my other mail in that thread.

Thank you a lot for your help, these are pretty interesting times ...

Bye
	Markus

On Thu, 29 Sep 2005 14:25:39 +0200, Nir Soffer <nirs at actcom.net.il> wrote:

>
> On 29 Sep, 2005, at 10:46, Markus Liebelt wrote:
>
>> I want to get something doing this:
>> - I have a setup where the MoinMoin Desktop Edition will be installed
>> on a DVD. It is a knowledge repository that may be easily installed on
>> every desktop.
>> - Together with the wiki come a lot of ressources which are handled
>> external to the wiki. There are some reasons for to do that, but just
>> believe me, that is necessary.
>> - There should be a way to link the external ressources inside the
>> wiki. When I use a link like file:///d:/some/stupid/file.exe, it is
>> displayed in the browser, but the browser does not open it for
>> security reasons.
>>
>> What I would like to get is the following:
>> 1. Expand the configuration to allow for a variable that denotes the
>> root of the external ressources file system.
>> 2. Write a macro or action, that takes the value of the variable, the
>> relative path to a ressource, and provides that ressource as a http
>> ressource to the browser.
>
> You don't need this Windows centric solution. The wiki knows the path
> to the data directory, therefore the path to your external resources
> directory.
>
> You just need a way to map urls to the external resources to the
> current location. Maybe the url_mapping option will do that for you.
>
> Try this (untested) code in your wikiconfig:
>
> 	# Your external resources are located in wiki/resources
> 	external_resources = os.path.abspath("./resources")
> 	url_mapping = {"file:///resources/": "file:///%s/" %
> external_resources}
>
>
> Best Regards,
>
> Nir Soffer
>
>






More information about the Moin-user mailing list