DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:perspective

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
tips:perspective [2013-06-06 23:24] 65.243.46.2tips:perspective [2014-04-14 19:39] (current) 65.244.148.222
Line 4: Line 4:
 I've migrated my company's Perspective wiki to dokuwiki. The Perspective wiki had dozens of collections and editors and attachments and hundreds of pages, and the importing script worked reasonably well.  Perspective is a Windows hosted wiki, so this is a Windows Python script.  (The path separators are hardcoded.) I've migrated my company's Perspective wiki to dokuwiki. The Perspective wiki had dozens of collections and editors and attachments and hundreds of pages, and the importing script worked reasonably well.  Perspective is a Windows hosted wiki, so this is a Windows Python script.  (The path separators are hardcoded.)
  
-**ToDo**: This script creates an "imported.log" file with the same format as "changes.log"  But it can't be merged into changes.log as is.  Andreas points out that, "The ID and the lastmod timestamp needs to match. So first create the file then get it's timestamp and save that one to the changelog."+**ToDo**:  
 +  * This script creates an "imported.log" file with the same format as "changes.log"  But it can't be merged into changes.log as is.  Andreas points out that, "The ID and the lastmod timestamp needs to match. So first create the file then get it's timestamp and save that one to the changelog."
  
-I found that the script was saving pages that originally had spaces in the name without spaces.  The dokuwiki behavior is to save with an underscore in place of each space.  To fix this replace this code: <code py>+  * I found that the script was saving pages that originally had spaces in the name without spaces.  The dokuwiki behavior is to save with an underscore in place of each space.  To fix this replace this code: <code py>
 name = GetNode(fields, "name", "page.name").firstChild.data name = GetNode(fields, "name", "page.name").firstChild.data
 doku_namespace = "" doku_namespace = ""
Line 15: Line 16:
 else: else:
    doku_name = name    doku_name = name
-</code> +</code> with this code: <code py>
- +
-with this code: +
-<code py>+
 doku_namespace = "" doku_namespace = ""
 doku_name = "" doku_name = ""
 doku_namespace = "\\" + GetNode(fields, "name", "page.collection").firstChild.data doku_namespace = "\\" + GetNode(fields, "name", "page.collection").firstChild.data
 doku_name = GetNode(fields, "name", "page.display-name").firstChild.data doku_name = GetNode(fields, "name", "page.display-name").firstChild.data
 +</code> This will also allow you to search for a full page name with spaces in the search term instead of only being able to find the page by searching for the full name without spaces or one word from the page title.
 +
 +  * Found that the BOM messes up the conversion, and then a few more characters in my ten-year-old PerspectiveWiki weren't liked either, so added to ParsePage:<code.py>
 +            s = s.replace(u'\ufeff',"")
 +            s = s.replace(u'\uf06c',"o")
 +            s = s.replace(u'\xad', "<<")
 +            s = s.replace(u'\xae', ">>")
 +            s = s.replace(u'\xa7', " degrees ")
 +            s = s.replace(u'\xe0', "-")
 +            s = s.replace(u'\xef', "i")
 </code> </code>
- 
-This will also allow you to search for a full page name with spaces in the search term instead of only being able to find the page by searching for the full name without spaces or one word from the page title. 
  
 **Requirements**:  **Requirements**: 
Line 32: Line 38:
  
 **Note**: **Note**:
-After running this script, run the indexer.php script in dokuwiki\bin+After running this script, run the indexer.php script in dokuwiki\bin.  This will vastly improve the search functionality.
  
 <code python> <code python>
tips/perspective.1370553874.txt.gz · Last modified: 2013-06-06 23:24 by 65.243.46.2

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