Pasting preformatted text, periods in space names, removing an empty space with a malformed name
Hello. We've just installed xwiki and we're hoping it becomes a valuable tool for storing our knowledge. 1. Pasting preformatted text I have documents which are basically logs of software releases, complete with commands, hash ("#") marks, dot-separated version numbers, etc. All these things are getting parsed by xwiki, even when I place {pre} or {code} tags at either end of it. These documents can't really be adapted to not use xwiki syntax, and I'd really like to store them as pages in xwiki. If I can't store them as pages, I'll store them as attachments. I see a FAQ item that seems like it might address my question, but it paradoxically seems to display a failure to render because of syntax: <http://www.xwiki.org/xwiki/bin/view/FAQ/HowDoIEmbedXwikiCodeAsText> http://www.xwiki.org/xwiki/bin/view/FAQ/HowDoIEmbedXwikiCodeAsText What is the Answer to that FAQ? 2. Periods in space names I do release engineering. I deal with version numbers. Version numbers contain periods, usually. Periods in space names causes problems. Is there a way to have a space look like N.N.N.N, by escaping the dots or using some other notation? I know the title can contain periods. Right now I'm using N-N-N-N for names and N.N.N.N for titles. 3. I have a malformed space, which I can't delete, that's the result of my trying to learn how to use xwiki to do 1. and 2. above. I tried creating a page Existing+Space.2\\.3\\.3\\.1. I thought I might be able to escape the periods in the version number with \\ characters. Now I have a space that looks like this: Existing Space.2<br/>.3<br/>.1<br/> I tried using the "Delete Space Snippet" ( <http://www.xwiki.org/xwiki/bin/view/Code/DeleteSpaceSnippet> http://www.xwiki.org/xwiki/bin/view/Code/DeleteSpaceSnippet) and the "Rename Space Page" ( <http://www.xwiki.org/xwiki/bin/view/Code/RenameSpacePage> http://www.xwiki.org/xwiki/bin/view/Code/RenameSpacePage) snippets from the Code Zone. The Delete Space snippet (http://our.site:8080/xwiki/bin/view/Sandbox/mypage?space=Existing%20Space.2 %3Cbr/%3E.3%3Cbr/%3E.1%3Cbr/%3E) would prompt me to confirm the deletion, (http://our.site:8080/xwiki/bin/edit//3%3Cbr%2F?parent=Sandbox.mypage&editor =wysiwyg) and upon clicking the prompt I'd get a blank page. Nothing would have been changed. The Rename Space snippet appeared to let me rename the page, but nothing was actually changed. The space once had a child page "1", which I deleted early on. Can I get rid of this space somehow? Do I do it at the db level? If so, can you offer me some guidance? Thanks, Morgan
Hi Morgan, I will only try to answer number 1 on your list. On 6/23/07, Morgan Fletcher <[email protected]> wrote: [snip]
1. Pasting preformatted text
I have documents which are basically logs of software releases, complete with commands, hash ("#") marks, dot-separated version numbers, etc. All these things are getting parsed by xwiki, even when I place {pre} or {code} tags at either end of it. These documents can't really be adapted to not use xwiki syntax, and I'd really like to store them as pages in xwiki.
Are you using a clean install of the latest xwiki release? In theory I think this should work, but it seems that too often xwiki has problems escaping things. Sorry about this. Hopefully this will be improved with time.
If I can't store them as pages, I'll store them as attachments.
If you don't need to edit them afterwards then I would suggest you go this way for now. Attachments get an URL like pages do, so you should be able to link to the text files from your wiki.
I see a FAQ item that seems like it might address my question, but it paradoxically seems to display a failure to render because of syntax:
http://www.xwiki.org/xwiki/bin/view/FAQ/HowDoIEmbedXwikiCodeAsText
This is something I reported here: http://www.nabble.com/Escaping-velocity-code-inside-form-fields-does-not-wor... Unfortunately I'm not able to reproduce this on anything else than xwiki.org so finding the cause is not easy at all.
What is the Answer to that FAQ?
[snip]
Here you go (logged in, edited the FAQ page, and grabbed the source): 1 Including XWiki code as part of your text. (Escaping Xwiki code) Sometimes, especially when we are trying to create these FAQs and documentation for Xwiki, we will need to display XWiki programming code as part of our text. For example, if we are trying to write a tutorial on how to create a Blog in XWiki. If you simply put the code inside the standard *\{code\}* tags, the rendering engine will still execute it. The reason is that the special characters *"\#"* and *"\$"* must be *~~escaped~~*. When the rendering engine sees that this character is escaped, it ignores it as a processing instruction and then just displays it. *The escape character for Xwiki code is the ~~backslash~~ "\\\" character.* So, to include a code section, type it in like this: {code} \{code\} \\#set(\$page = \$doc.fullName) \\#includeForm("Test.BlogMacro") \{code\} {code} If you type the previous code into your document exactly as it appears, with the backslashes, the resulting output would look like: {code} \#set(\$page = \$doc.fullName) \#includeForm("Test.BlogMacro") {code} If it is a large piece of code, type or paste it into a seperate document that people wont see directly. In this example we will use a document that contains the Blog code most people use: [Doc.BlogMacro] Dev.BlogMacro contains no textual content, it is just the code for the Blog list. To get it into this document, use the following code: {code} \{code\} \{pre\} \#set(\$code = \$xwiki.getDocument("Doc.BlogMacro").content) \#set(\$code = \$code.replace("\#","\\\#")) \#set(\$code = \$code.replace("\$","\\\$")) \$code \{/pre\} \{code\} {code} An example of the output of the preceding code is: {code} #set($code = $xwiki.getDocument("Doc.BlogMacro").content) #set($code = $code.replace("#","\\#")) #set($code = $code.replace("$","\\$")) $code {code} And thats how you would embed code. It was wierd embeddeding code to show how to embed code, so if you wanna see my headache, view the code for this page. You'll *LOVE* it! In the meantime, if you want to know how I escaped the esacape character. Well, you can display a single backslash character by typing in three backshashes in a row, like: "\\\". However, if I had actually tried to show three escaped backslashes in a row, it would have been a mess, if not impossible, therefore, I simply used the backslash HTML Identity Reference, which is 92. Pretty slick huh? :-p Hope this helps :) Regards, Catalin
Thanks, Catalin. I will attach my notes rather than trying to paste them in-line. I don't want to have to escape special characters. BTW, I was able to figure out the schema of xwiki with mysqldump, as well as getting a backup. I found and deleted the row which contained the malformed empty space and now it's gone from the xwiki pages as well. Morgan
Hi Morgan, one thing you could do (though this is not "clean" at all and may well prevent the WYSIWYG editor from working on your page) is using an iframe (the way shown here: http://www.xwiki.org/xwiki/bin/view/Code/ViewOfficeDocument) to display yor attached text document on the wiki page itself. Guillaume On 26/06/07, Morgan Fletcher <[email protected]> wrote:
Thanks, Catalin. I will attach my notes rather than trying to paste them in-line. I don't want to have to escape special characters.
BTW, I was able to figure out the schema of xwiki with mysqldump, as well as getting a backup. I found and deleted the row which contained the malformed empty space and now it's gone from the xwiki pages as well.
Morgan
-- You receive this message as a subscriber of the [email protected] list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
participants (3)
-
Catalin Hritcu -
Guillaume Lerouge -
Morgan Fletcher