Use file path in office macro

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Use file path in office macro

Mario
We currently display an attached excel file on a wiki page using the office macro and syntax {{office filterStyles="false" reference="attach:MyFile.xlsx"/}}.
Instead we'd like to use the path of an file saved on our server, a working url for this is [[unc:\\serverhostname\folder\folder\MyFile.xlsx]]

However, {{office reference=" unc:\\serverhostname\folder\folder\MyFile.xlsx " filterStyles="false"/}} does not work (Failed to view office attachment).
The Office Macro documentation states: "The supported resources are URLs (url:) and attachments (attach:)."

Is there currently a way to use a file path with the office macro? I tried variants using url: but none of them worked.

Thank you.
Mario
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Use file path in office macro

vmassol
Administrator
Hi,

> On 23 Aug 2016, at 09:49, Hofstätter Mario <[hidden email]> wrote:
>
> We currently display an attached excel file on a wiki page using the office macro and syntax {{office filterStyles="false" reference="attach:MyFile.xlsx"/}}.
> Instead we'd like to use the path of an file saved on our server, a working url for this is [[unc:\\serverhostname\folder\folder\MyFile.xlsx]]
>
> However, {{office reference=" unc:\\serverhostname\folder\folder\MyFile.xlsx " filterStyles="false"/}} does not work (Failed to view office attachment).
> The Office Macro documentation states: "The supported resources are URLs (url:) and attachments (attach:)."
>
> Is there currently a way to use a file path with the office macro? I tried variants using url: but none of them worked.

Note that in general it’s not a good idea to use a path in the browser because most browser disable this by default so all the wiki users would need to have that set up in the browser.

The office macro states that you can use a URL or an attachment, so I guess you could use  a file://// URL (make sure to use only forward slashes).

Thanks
-Vincent

> Thank you.
> Mario

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Use file path in office macro

Mario
vmassol wrote
The office macro states that you can use a URL or an attachment, so I guess you could use  a file://// URL (make sure to use only forward slashes).
I tried file://// (four slashes?) as well as file:/// and file:// but non seem to work.
E.g. {{office reference="URL:file://serverhostname/folder/folder/MyFile.xlsx" filterStyles="false"/}}
This link works when pasted to windows Explorer (on the xwiki server)

Also tried with the "URL": {{office reference="file://serverhostname/folder/folder/MyFile.xlsx" filterStyles="false"/}}

The macro exception stack (see http://pastebin.com/Q9vwCYhe ) using URL:file:// clearly states that it is looking for an attachment as opposed to a file link.
(Attachment [Attachment ax:Sandbox.WebHome@URL:file://serverhostname/folder/folder/MyFile.xlsx] does not exist.). The same goes for file://

Any ideas? I could still try some of the other windows file uri Schemas as shown in https://en.wikipedia.org/wiki/File_URI_scheme

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Use file path in office macro

vmassol
Administrator
Hi Mario,

BTW have you seen that there’s a thumbnail macro:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Thumbnail+Macro

I think it does what you want.

Thanks
-Vincent

> On 23 Aug 2016, at 15:37, Mario <[hidden email]> wrote:
>
> vmassol wrote
>> The office macro states that you can use a URL or an attachment, so I
>> guess you could use  a file://// URL (make sure to use only forward
>> slashes).
>
> I tried file://// (four slashes?) as well as file:/// and file:// but non
> seem to work.
> E.g. {{office
> reference="URL:file://serverhostname/folder/folder/MyFile.xlsx"
> filterStyles="false"/}}
> This link works when pasted to windows Explorer (on the xwiki server)
>
> Also tried with the "URL": {{office
> reference="file://serverhostname/folder/folder/MyFile.xlsx"
> filterStyles="false"/}}
>
> The macro exception stack (see http://pastebin.com/Q9vwCYhe ) using
> URL:file:// clearly states that it is looking for an attachment as opposed
> to a file link.
> (Attachment [Attachment
> ax:Sandbox.WebHome@URL:file://serverhostname/folder/folder/MyFile.xlsx] does
> not exist.). The same goes for file://
>
> Any ideas? I could still try some of the other windows file uri Schemas as
> shown in https://en.wikipedia.org/wiki/File_URI_scheme
>
> Thank you.
>
>
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Use-file-path-in-office-macro-tp7600777p7600801.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Use file path in office macro

vmassol
Administrator
sorry I’ve replied to the wrong thread. I meant to reply to the "[xwiki-users] Use image popup as default behavior” thread.

-Vincent

> On 23 Aug 2016, at 18:51, Vincent Massol <[hidden email]> wrote:
>
> Hi Mario,
>
> BTW have you seen that there’s a thumbnail macro:
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Thumbnail+Macro
>
> I think it does what you want.
>
> Thanks
> -Vincent
>
>> On 23 Aug 2016, at 15:37, Mario <[hidden email]> wrote:
>>
>> vmassol wrote
>>> The office macro states that you can use a URL or an attachment, so I
>>> guess you could use  a file://// URL (make sure to use only forward
>>> slashes).
>>
>> I tried file://// (four slashes?) as well as file:/// and file:// but non
>> seem to work.
>> E.g. {{office
>> reference="URL:file://serverhostname/folder/folder/MyFile.xlsx"
>> filterStyles="false"/}}
>> This link works when pasted to windows Explorer (on the xwiki server)
>>
>> Also tried with the "URL": {{office
>> reference="file://serverhostname/folder/folder/MyFile.xlsx"
>> filterStyles="false"/}}
>>
>> The macro exception stack (see http://pastebin.com/Q9vwCYhe ) using
>> URL:file:// clearly states that it is looking for an attachment as opposed
>> to a file link.
>> (Attachment [Attachment
>> ax:Sandbox.WebHome@URL:file://serverhostname/folder/folder/MyFile.xlsx] does
>> not exist.). The same goes for file://
>>
>> Any ideas? I could still try some of the other windows file uri Schemas as
>> shown in https://en.wikipedia.org/wiki/File_URI_scheme
>>
>> Thank you.
>>
>>
>>
>> --
>> View this message in context: http://xwiki.475771.n2.nabble.com/Use-file-path-in-office-macro-tp7600777p7600801.html
>> Sent from the XWiki- Users mailing list archive at Nabble.com.
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users