DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:gview

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:gview [2013-03-19 14:54] – [Examples/Usage] s.saharaplugin:gview [2018-05-28 22:44] (current) – [Installation] Klap-in
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Show online document using Google Docs Viewer Service +description: Show online document using Google Docs Viewer Service or browser Plug-In 
-author     : s.sahara+author     : S.Sahara
 email      : sahara.satoshi@gmail.com  email      : sahara.satoshi@gmail.com 
 type       : syntax type       : syntax
-lastupdate : 2013-03-18 +lastupdate : 2014-11-16 
-compatible : +compatible : Adora Belle, Weatherwax, Binky, 2014-05-05 "Ponder Stibbons", 2016-06-26
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : google, embed+tags       : google, embed, html5
  
 downloadurl: https://github.com/ssahara/dw-plugin-gview/archive/master.zip downloadurl: https://github.com/ssahara/dw-plugin-gview/archive/master.zip
Line 24: Line 24:
  
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:plugin installation instructions]] on how to install plugins manually. 
 + 
 +==== Prerequisite to embed document stored in media directory ==== 
 + 
 +If your have set [[config:userewrite]] option to "**''1''**" in order to get nicer URLs for your DW page, you do not need to do any more.  The Google Docs Viewer Service will accept url of DW media document file ( for example: //<nowiki>http://example.com/_media/ns:document.pdf</nowiki>// ). 
 + 
 +**Otherwise**, you need to prepare a virtual (sub)directory named "**_media**" in the same place where 'doku.php' file exists. You might setup it by one of following measures: 
 +  * make relevant entry in httpd.conf for apache 
 +  * make virtual directory using IIS admin panel 
 +  * make symbolic link -- ln -s /path/to/data/media _media (linux) 
 +  * make Junction in NTFS for Windows 2003S -- linkd -d _media  /path/to/data/media 
 +  * Windows 2008S supports symbolic link
  
  
Line 33: Line 44:
  
 Let's suppose you have a link (with small fileicon) to given online document in your page source: Let's suppose you have a link (with small fileicon) to given online document in your page source:
-<code>{{http://example.com/path/to/document.pdf}}</code>+<code>{{:ns:document.pdf}}</code>
  
-To show the document in the embedded viewer, markup it with ''<nowiki>{{gview></nowiki>'' and ''<nowiki>}}</nowiki>'' as follows: +To show the document in the embedded viewer, change it as follows: 
-<code>{{gview>{{http://example.com/path/to/document.pdf}}}}</code> +<code>{{gview>:ns:document.pdf}}</code>
- +
-You do not need to remove ''<nowiki>{{</nowiki>'' and ''<nowiki>}}</nowiki>'' around document URL; When you decide to stop embedding in future, it is enough to delete only gview markup. However you may remove inner ''<nowiki>{{</nowiki>'' and ''<nowiki>}}</nowiki>''to embed the document. +
- +
- +
-A most simple example: +
-  {{gview>http://example.com/path/to/document.pdf}}+
  
 Some more complex example: Some more complex example:
  
-  {{gview> http://example.com/path/to/document.pdf 50%,200px}} +  {{gview 50%,200px > :ns:document.pdf}} 
-  {{gview> http://example.com/path/to/document.pdf 400px}} +  {{gview 400px> :ns:document.pdf|title}} 
-  {{gview> {{http://example.com/path/to/document.pdf|title}} noreference }}+  {{gview noreference> http://example.com/path/to/document.pdf|title }}
  
  
 ==== Note ==== ==== Note ====
-  * The document to view must be "public to the world".+  * The document to view must be "public to the world" when using Google's service.
   * The DW page must be reachable from the internet (because Google's servers are used).   * The DW page must be reachable from the internet (because Google's servers are used).
-  * Uploaded file through mediamanager may not shown in the embedded viewer.  
- 
  
 +==== Limitation ====
 +  * Unfortunatly, the Google Docs Viewer service seems not accept ugly url \\ ( for example:  //<nowiki>http://example.com/lib/exe/fetch.php?media=document.pdf</nowiki>// ).
 +  * Therefore, you may need to extra setup explained in [[#Installation]] section.
  
 ===== Syntax ===== ===== Syntax =====
 <code> <code>
-{{gview> url [size] [noembedded] [noreference] }}+{{gview [size] [noembed] [noreference] > id|title }}
 </code> </code>
  
-  * **url** : Full URL of the online document to view, must starts with "<nowiki>http:</nowiki>" or "<nowiki>https:</nowiki>".+  * **id** : DW media "id" or full URL (must starts with "<nowiki>http:</nowiki>" or "<nowiki>https:</nowiki>" ) of the online document to view. 
 +    * This means you may embed a document published at different web site. The source url (reference) acknowleged above the viewer frame. 
 +    * you can use "{:ns:file.ext|title}" format that is inserted via media manager.
  
   * **size** : Size of embedded viewer.   * **size** : Size of embedded viewer.
Line 69: Line 77:
     * When one value is given it is assumed to be the height.      * When one value is given it is assumed to be the height. 
  
-  * **noembedded** (or **noembed**)+  * **noembed** (or **noembedded**)
     * Indicate to show only hyperlink to the viewer, instead of embedded viewer.     * Indicate to show only hyperlink to the viewer, instead of embedded viewer.
-    * Document title specified in ''<nowiki>{{</nowiki>'' and ''<nowiki>}}</nowiki>'' (after "|"is used as a link text.+    * Document title specified after "|" in ''<nowiki>{{</nowiki>'' and ''<nowiki>}}</nowiki>''  is used as a link text.
  
   * **noreference**   * **noreference**
     * Suppress a reference line just above embedded viewer frame. The reference is a hyperlink (url) to the online document shown in the viewer.     * Suppress a reference line just above embedded viewer frame. The reference is a hyperlink (url) to the online document shown in the viewer.
  
 +
 +==== trick syntax ====
 +There is another **experimental** trick syntax available. The markup key is "obj:" instead of "gview".
 +
 +  {{obj:[class] [size] [noembed] [noreference] > id|title }}
 +
 +which will embed media resource in html using HTML5 object tag. If you do not like to use google service, please try this usage. The ''<nowiki>{{gview ... > ... }}</nowiki>'' is simplified markup of ''<nowiki>{{obj:gview ... > ... }}</nowiki>''.  
  
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
 There are no configuration options for this plugin.  There are no configuration options for this plugin. 
  
-//[also CSS style tips]// ... comming later+=== CSS === 
 +The class //obj_container_gview// is available for selector of html elementBorder settings for embedded viewer found in style.css. 
  
 ==== Language file ==== ==== Language file ====
Line 91: Line 108:
 I have just started github. I have just started github.
  
-{{rss>https://github.com/ssahara/dw-plugin-gview/commits/master.atom date}}+{{rss>https://github.com/ssahara/dw-plugin-gview/commits/master.atom date 5}}
  
  
 === ToDo === === ToDo ===
-//[developers roadmap]// ... will be supplemented later+ 
 +  * Support embedding Google document, sheet, presentation and drawings on Google Drive. 
 +  * also, support Skydrive, even plugin name is not appropriate... 
 +  * <del>consider [[:rewrite|URL rewrite]] to allow embedding media file in data/media directory in case of $conf['userewrite'= 1; (rewrite ugly url: //<nowiki>.../lib/exe/fetch.php?media=document.pdf</nowiki>// -> //<nowiki>.../_media/document.pdf</nowiki>//) </del> 
 +  * change syntax to ''<nowiki>{{gview [size] [noembedded] [noreference] > id|title }}</nowiki>'' in order to quickly get back to genuine DW syntax (''<nowiki>{{id|title}</nowiki>'') by text replacement of .txt file using sed command via terminal shell-> done at releaee 2013-05-26 
  
 ===== FAQ ===== ===== FAQ =====
  
 //[discussions should ideally be deleted and turned into FAQ entries along the way]// //[discussions should ideally be deleted and turned into FAQ entries along the way]//
- 
 ===== Discussion ===== ===== Discussion =====
 +Great plugin! It would be good to be able to support the likes of the BOX viewer (HTML5). As it stands the correct height can be adjusted, but the width stays locked to 100%, even when changed to something else, i.e:
 +  
 +  {{obj:  50%, 600px  noreference > https://view-api.box.com/1/sessions/7b8e51cb284a407ba5bec7a7fa2ba1b2/view?theme=light |Test}}
 +The viewer works correctly though, it is just the width adjustment.
 +==== Show PDF documents stored in DW media ====
  
 +Thanks for this plugin!\\ 
 +It would be great, to view pdf documents stored in DW media directory. <sub>//Joe, 2013-03-20//</sub>
 +> Thanks for your comment. It was my original objectives of this plugin. New release 2013-03-22 supports DW media docs with some prerequisite. I have tested CentOS6-Apache 2-Adora Belle and Win2003S-IIS6-Weatherwax RC1. --- [[user>s.sahara|s.sahara]] //2013-03-22// 
  
- +I actually have my DW site protected by **.htaccess**, which prevents gview from displaying the files.\\  
 +If I rename **.htaccess** everything works fine.\\  
 +Do you have some hints how to modify **.htaccess** for using with gview? This would be great. 
 +I tried a lot of hints from the web, but nothing worked. e.g.: 
 +<code>RewriteEngine on 
 +RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] 
 +RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?docs.google.com [NC] 
 +RewriteRule \.(pdf)$ - [NC,F,L]</code> 
 +Working under debian linux with ''ln -s /path/to/data/media _media'' <sub>//Joe, 2013-09-02//</sub>
plugin/gview.1363701249.txt.gz · Last modified: 2013-03-19 14:54 by s.sahara

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki