← Back to team overview

zim-wiki team mailing list archive

Re: ms-outlook uri support

 

Here is the code you are referring to (contained within a function called
open_url()):

    elif url.startswith('outlook:') and hasattr(os, 'startfile'):
      # Special case for outlook folder paths on windows
      os.startfile(url)

First thing I notice is that it's looking for "outlook" and not "Outlook"
(which is what the link generator program uses... no biggie).

The problem is that open_url() is only called if the link-type (as
determined by the link_type() function in parsing.py) does not match either
interwiki, page, file, or notebook (see pageview.py:4547).  Without the
modifications I made, the link-type is determined to be a page as it does
not match the url regex, and therefore, the open_url() function never gets
called for an outlook link.

Does that make sense?

If the outlook links had the double slash after the colon (outlook://), we
wouldn't be having this problem as it would match the url regex.  But it
does not.

Greg





On Thu, Dec 1, 2011 at 11:22 AM, Jaap Karssenberg <
jaap.karssenberg@xxxxxxxxx> wrote:

> Hi Greg,
>
> Actually outlook URLs should be supported since version 0.49 of zim (but
> didn't test it recently myself). See the URL handler code in
> zim/gui/__init__.py .  Or does this patch add something that is not yet
> supported by that handler ?
>
> Regards,
>
> Jaap
>
>
>
> On Thu, Dec 1, 2011 at 6:27 PM, Greg Warner <gdwarner@xxxxxxxxx> wrote:
>
>> Hi Jaap, list,
>>
>> I recently wanted to be able to link to my outlook (work) emails from
>> within Zim.  The URLs for outlook, however, look like this:
>> "outlook:SDKFJLSDJFLJKJKJ234fjLSDJFLKS(somereallylongGUID)".  Zim doesn't
>> recognize this as a URL/URI, but thinks it's a page, so hence the patch.
>>
>> And for those interested, tweaking Zim is only half the battle.  If you
>> want to use outlook URLs, you'll also need to:
>>
>>    - Add support for outlook urls to your registry:
>>    http://www.davidtan.org/outlook-2007-adding-outlook-url-protocol/
>>    - Download a little utility that creates the outlook urls (basically
>>    finds the GUID of the message in question).  The above link will point the
>>    way.
>>
>> I'm hoping this will allow me to more easily create action items
>> referring to outlook emails as well as point to emails as reference
>> material.
>>
>> Greg
>>
>
>

Follow ups

References