DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:owncloud

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:owncloud [2013-06-12 19:55] – Uppercase filenames 178.9.64.7plugin:owncloud [2023-10-30 22:37] (current) Klap-in
Line 1: Line 1:
 ====== ownCloud Plugin ====== ====== ownCloud Plugin ======
- 
 ---- plugin ---- ---- plugin ----
 description: Use your ownCloud instance as media-backend for DokuWiki description: Use your ownCloud instance as media-backend for DokuWiki
Line 7: Line 6:
 type       : syntax, action, helper type       : syntax, action, helper
 lastupdate : 2013-06-01 lastupdate : 2013-06-01
-compatible : "Weatherwax"+compatible : Weatherwax, Binky
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : !experimental, file, mediamanager, cloud+tags       : !experimental, file, mediamanager, cloud, owncloud
  
  
Line 60: Line 59:
  
 ===== Installation ===== ===== Installation =====
 +
 First you have to [[http://doc.owncloud.org/server/5.0/admin_manual/#installation|install ownCloud]]((You can find [[Google>ownCloud installation|many other tutorials]] on  First you have to [[http://doc.owncloud.org/server/5.0/admin_manual/#installation|install ownCloud]]((You can find [[Google>ownCloud installation|many other tutorials]] on 
 the web.)).\\ the web.)).\\
Line 66: Line 66:
 Refer to "[[#configure_owncloud|Configure ownCloud]]" to find out how to configure the app. Refer to "[[#configure_owncloud|Configure ownCloud]]" to find out how to configure the app.
  
-After this install this DokuWiki plugin using the [[plugin:plugin|Plugin Manager]] and the download %%URL%% above, which points to the latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+After this search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
  
Line 103: Line 103:
 Change to the admin menu and scroll down to the section //DokuWiki app configuration//. There you have to set 4 settings: Change to the admin menu and scroll down to the section //DokuWiki app configuration//. There you have to set 4 settings:
 ^Config item ^Description ^ Default ^ ^Config item ^Description ^ Default ^
-|%%URL%% to DokuWiki | The %%URL%% which points to your DowkuWiki installation | //%%http://example.org/dokuwiki%%// |+|%%URL%% to DokuWiki | The %%URL%% which points to your DokuWiki installation | //%%http://example.org/dokuwiki%%// |
 |Path to DokuWiki| This is the directory where you installed DokuWiki. E.g. here is the //doku.php// located.|''/var/www/dokuwiki'' | |Path to DokuWiki| This is the directory where you installed DokuWiki. E.g. here is the //doku.php// located.|''/var/www/dokuwiki'' |
 |Clean page names| This **has to be exactly the same value** as you choose for [[config:deaccent|deaccent (How to clean page names)]] in your DokuWiki configuration.\\ :!: If you don't want to clean page names, and you use e.g. umlauts in file names, you have to set [[config:fnencode|fnencode (Method for encoding non-ASCII file names)]] in your DokuWiki configuration to //utf-8// |0|  |Clean page names| This **has to be exactly the same value** as you choose for [[config:deaccent|deaccent (How to clean page names)]] in your DokuWiki configuration.\\ :!: If you don't want to clean page names, and you use e.g. umlauts in file names, you have to set [[config:fnencode|fnencode (Method for encoding non-ASCII file names)]] in your DokuWiki configuration to //utf-8// |0| 
Line 111: Line 111:
  
  
-:!: You should fix one thing inside the ownCloud core files. If you want to overwrite a file, e.g. ''foo.bar''  using drag&drop, ownCloud first creates a file like ''foo (2).bar''. If you choose //replace//, this file will be renamed to the original file. But the DokuWiki app will rename this file to ''foo_2.bar'', because this is a valid file name for DokuWiki. Replacing will work, but there will be continuously a loading icon, because ownCloud will be searching the database for ''foo (2).bar''. To avoid this, open ''<path-to-owncloud/lib/helper.php>'' and scroll down to line 616. Replace the content of function ''buildNotExistingFileName()'' that it looks like this:+:!: You should fix one thing inside the ownCloud core files. If you want to overwrite a file, e.g. ''foo.bar''  using drag&drop, ownCloud first creates a file like ''foo (2).bar''. If you choose //replace//, this file will be renamed to the original file. But the DokuWiki app will rename this file to ''foo_2.bar'', because this is a valid file name for DokuWiki. Replacing will work, but there will be continuously a loading icon, because ownCloud will be searching the database for ''foo (2).bar''. To avoid this, open ''<path-to-owncloud>/lib/helper.php'' and scroll down to line 616. Replace the content of function ''buildNotExistingFileName()'' that it looks like this:
 <code php> <code php>
 public static function buildNotExistingFileName($path, $filename) { public static function buildNotExistingFileName($path, $filename) {
Line 118: Line 118:
 } }
 </code> </code>
 +
 +**Since owncloud 6** please open ''<path-to-owncloud>/lib/private/helper.php'' and scroll down to line 635. Replace the content of function ''buildNotExistingFileName()'' that it looks like this:
 +
 +
 +<code php>
 +public static function buildNotExistingFileName($path, $filename) {
 +   $view = \OC\Files\Filesystem::getView();
 +   require_once('dokuwiki/lib/helper.php');
 +   return buildNotExistingFileNameWithoutSpaces($path, $filename, $view);
 +}
 +</code>
 +
 +
  
  
Line 164: Line 177:
  
 There is a different [[https://github.com/lebowski42/owncloudapp-dokuwiki/issues|bug tracker for the ownCloud app]]. There is a different [[https://github.com/lebowski42/owncloudapp-dokuwiki/issues|bug tracker for the ownCloud app]].
 +
 +==== SQLite compatibility ====
 +Running Ubuntu 12.04 I was able to set up on my server. However when I make a changean and try to save the dokuwiki page, it hangs permanently.
 +
 +Actually my owncloud is installed with SQLite because it's just for test. In the plugin in action.php, the following resquest is done :
 +
 +$helper->dbQuery('INSERT IGNORE INTO *PREFIX*dokuwiki_media_use (fileid, wikipage,wikipage_hash,firstheading) VALUES (?,?,?,?)', array($fileid, $ID, md5($ID), $heading));
 +}
 +
 +**The problem is : SQLite doesn't use "INSERT IGNORE", only "INSERT OR IGNORE"**
 +
 +My colleague suggest the following fix for helper.php :
 +
 +Line 61 replace "public function dbQuery($sql, $params)" by the following
 +
 +<code>
 +public function dbQuery($sql, $params){
 +    $dbtype = OC_Config::getValue('dbtype', 'sqlite');
 +    if($dbtype == 'sqlite' || $dbtype == 'sqlite3') $sql = str_replace('INSERT IGNORE', 'INSERT OR IGNORE', $sql);
 +    $db = OC_DB::prepare($sql);
 +    $this->lastQuery = $db->execute($params);
 +}
 +</code>
 +
 +And now it works, thanks for this excellent plugin !  =)
 +
 +Olivier
  
 ==== ChangeLog ==== ==== ChangeLog ====
plugin/owncloud.1371059719.txt.gz · Last modified: 2013-06-12 19:55 by 178.9.64.7

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