Question
I am writing a converter from XWiki to TWiki. I have been able to convert most of XWiki syntax to TWiki syntax and therefore have directory of files converted to TWiki Syntax. I have some questions:
1) What should be the directory structure of these files. I mean where should i keep these files in TWiki so that my TWiki starts showing up these pages.
2) Do I need to create some sort of mapping to link all the wiki pages or they get link automatically by Wiki Links
3) How does TWiki handles attachments.
It would be of great help if someone answers these questions.
Environment
--
BikramjitSingh - 30 Oct 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
1) The default structure in TWiki is like this:
twiki/data/Sandbox/TestTopic1.txt - TestTopic1 page in Sandbox web/namespace
twiki/data/Sandbox/TestTopic1.txt,v - History file of TestTopic1 page
twiki/data/Sandbox/SubWebs/IfNeeded/FooBar.txt - Page in nested web (if needed)
twiki/data/Sandbox/SubWebs/IfNeeded/FooBar.txt,v
twiki/pub/Sandbox/TestTopic1/test_file.doc - File attached to TestTopic1 page in Sandbox web
twiki/pub/Sandbox/TestTopic1/test_file.doc,v - History file of attached file
twiki/pub/Sandbox/TestTopic1/test_image.jpg - Image attached to same page
twiki/pub/Sandbox/TestTopic1/test_image.jpg,v - History file of attached image
If you use the official API of TWiki (e.g. the
TWiki::Func:: API documented at
TWikiFuncDotPm) you will get the history files automatically. Simply generating the text files is OK too if you do not care about the history, TWiki will add a history file the first time a person updates a page.
2) Linking of pages: You can rely on the automatic WikiWord linking if XWiki does that. If not, you can force a link with the
[[TestTopic1]] syntax. Linking across webs/namespaces works too, use the
[[Otherweb.TestTopic1]] syntax.
3) TWiki attachments are handled properly if you use the official API. If you do not care about history and attachment table, you can put files as indicated in 1). To link to an attached file, write
%ATTACHURL%/test_file.doc to get the full URL, or
[[%ATTACHURL%/test_file.doc][test_file.doc]] to get just the linked filename. See details in
FileAttachment.
Please consider sharing your converter with the
TWikiCommunity! You can do that by posting a
XWikiToTWikiAddOn (starting from
AddOnPackageHowTo.)
--
PeterThoeny - 31 Oct 2007
Thanks a lot we will definitely share the converter
--
BikramjitSingh - 31 Oct 2007
Cool, thanks! See also other
Extensions:import
for inspiration.
--
PeterThoeny - 31 Oct 2007
I am facing some problem with white-spaces. There are many pages in XWiki which are not wiki words and they don't link to the forced links. example
i have one page named Bikramjit Singh and one forced link like
Bikramjit Singh. On wiki a "?" appears following Bikramjit Singh. When i click to that "?" a new page opens which trims the space between two words and says that page
BikramjitSingh does not exist. So what can be done to overcome this issue
--
BikramjitSingh - 06 Nov 2007
Two approches:
- Change page name text according to TWiki's link rule:
- Capitalize initial letters and remove spaces, e.g. "foo bar.txt" becomes "FooBar.txt"
- Links such as
[[foo bar]] will point properly to "FooBar"
- Change spaces to underscores:
- Replace space with underscore, capitalize initial letter of file, e.g. "foo bar.txt" becomes "Foo_bar.txt"
- In links, replace spaces with underscores such as
[[foo_bar]] will point to "Foo_bar"
--
PeterThoeny - 09 Nov 2007
Means there is no way to preserve spaces??
--
BikramjitSingh - 11 Nov 2007
Not out of the box. Yes with some customization. See
SpacedWikiWordPlugin,
UnderscoreWikiWords,
UnderscoreWikiWordsWithoutSyntaxChange.
--
PeterThoeny - 12 Nov 2007
I have some converted data and I want to run it on TWiki. But when I copy all XWiki Webs(about 30 webs. many of them contain only one page) to data folder in TWiki. It shows three webs Main and two other webs. But it doesn't show up rest of the webs.
Do I have to define change some settings or define something specific so that all the webs show up?
One more problems is with
WebHome, One Web which is showing up does not contain
WebHome, So what should be the possible solution?
--
BikramjitSingh - 12 Nov 2007
You need all topics from the
_default web in each of the generated webs:
WebAtom,
WebChanges,
WebHome,
WebIndex,
WebLeftBar,
WebNotify,
WebPreferences,
WebRss,
WebSearchAdvanced,
WebSearch,
WebStatistics,
WebTopicCreator,
WebTopicList. The
WebHome and
WebPreferences are mandatory, the other are recommended.
--
PeterThoeny - 13 Nov 2007
Is there any way to create
WebHome and
WebPreferences automatically as I have countless Webs
--
BikramjitSingh - 19 Nov 2007
Peter, One more problem which am facing is that if theres any
WikiWord eg.P4CLIENT and
P4V they are coming up as link, do u have any possible solution except escaping (it would be a pain to escape those many words)in mind regarding those
--
BikramjitSingh - 19 Nov 2007
Yea, we had an unfortunate spec change in the last release where alpha-number-alpha are now valid WikiWords. Look into the
StopWikiWordLinkPlugin.
On default topics, simple copy the ones you find in the
_default web.
--
PeterThoeny - 20 Nov 2007