XWiki comparison between versions 1.8 and 2.1.1, with macro snippet sample in xwiki 2.0 syntax

Share

This is just a study between 2 version of xwiki, to see on single page what were the changes.  All the information regarding the xwiki releases were taken from their official website.

Xwiki1.8 features:

  • choose new page syntax from a visual element in the interface when editing a page. Before this version the xwiki 2.0 syntax was chosen by modifying the WEB-INF/xwiki.cfg file and configure the xwiki.rendering.syntaxes property.

NOTE: Xwiki 2.0 syntax was introduced from version 1.7 and from their documentation they fixed a lot af bugs. Have tested xwiki 1.3 long time ago, and then passed on trying xwiki 1.8 version. There were differences in the user experience that is for sure.

Some features of this new syntax:
– “Not optimal symbols” – by this they refer (besides other that i may not know), about the double characters: double stars for bold, double underscore for italic etc. They made everything double so the single characters that may have been used by the user don’t mess things up the xwiki syntax. Personally, as a user, i am fond of the idea, it does not make my time more effective to write everything in doubles.
– As it seems the CREOLE syntax “is becoming a standard for wiki syntax ” and xwiki 2.0 syntax is doing it’s best to be close to the standard they want to define in wiki applications. (http://www.wikicreole.org/wiki/LinksReasoning) .

NOTE: Reading a bit on this standard proposed by CREOLE, i found the explication why we need to use double “[[ ]]” when  we declare an internal or external link: “Almost all wikis use square brackets ([[]]) to make links. Using double square brackets allows single square brackets to be used freely without worry of turning them into links.

  • An interesting feature that I found was that there is a  syntax convertor from 1.0 to 2.0 and vice versa. This feature can be crucial if you have a 1.6 and less version of xwiki and you don’t want to loose a lot of information from the pages. Don’t get me wrong, the data from your created pages will dot vanish in thin air, but the way the look(user interface) can put your spirit down a while, till you fix the syntax issues. Using this tool of converting, you rely on first hand on the power of the conversion, but in addition the developer or simple user can change the mishaps from the actual result, by editing yourself.
  • A new GWT WYSIWYG editor
  • possibility to display users avatar
  • Usability improvements :
  1. – dashboard interface improvements
  2. –  tags new features: rename/delete
  • On xwiki 1.8 release notes they state that the “Page loading time reduced by 30% “. have to be honest…never had the curiosity to test how many seconds does it take for a xwiki page to load. Mainly because i find it default to click a link and see the page fast. So at this feature, i just have to accept what they declare. What i do know is that pages that have very very much information, are a bit of a trickier for xwiki to display, but it didn’t came to the situation in which you get bored of waiting. No, it displays the page. Just as a remark, opening large documents is an issue for Xeclipse…there you can wait a lot for the page to load and show the code.
  • Another feature is the translations: french, german, spanish. NOTE: haven’t used it, cannot comment on it
  • Office Importer: now this is a very cool tool that makes your life much more easier 😀

This great (from my opinion) tool makes use of OpenOffice . This is what xwiki declares: “makes use of a running OpenOffice server to convert Office documents (MS Office or OO) into HTML before they are transformed into XWiki 2.0 syntax ” basically...if you have a Microsoft Office document and want to import that into xwiki (imagine you have a huge table, not just plain text..for that…i don’t think it’s necessary to use this tool and you need a solution to import that table into xwiki. And yes, you agree that making the table all over again is not a good solution), all you need to do is install the Office Importer Application. The all you need to know basis can be found here
Install it following the instruction found there,  and then to use it, you just have to open the page that displays it’s wizard (will find a link in the dashboard) , browse for the document you want to import, in my example from above.. ‘test.doc’ and then press “Import” 🙂

  • Among other features: Rest Api, Blog Application

The new version –  XWiki 2.1.1

Here you can find the XWiki official 2.1.1 release notes: http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise211

This version has the features from 1.8 of course so those will not be discussed again. This version I have used much more in my pursuit to solve some requirements.

NOTE: The first thing i noticed when i installed a fresh XWiki2.1.1 version was the layout. I has changed it’s arrangements a bit , from what i got used to see in the dashboard. Somebody told me that in design, the first thing a client/user looks at si the top right corner of the page, in this case web page.

I did just that and found that instead of seeing the “Administration” option link there was my login username displayed. I do think the Adminstration link is much more important :D. If you want to use that, just go into xwiki template folders, find the velocity script : global.vm and change there the code…comment what you don’t want to see in that menu (just in case you need it before) and write the link to the adminstration. The version is stable but there are exceptions that i cannot reproduce when i want to, on saving the edited document.

What i have noticed..since version 1.3 is at the import feature, there are chances(not a very technical exprimation indeed) that what you want to import does not import at all. You add the .xar to the “ready to import” list, and when you want to import it, it does .. nothing. This is not about wanting to import a huge .xar, i am talking about 10MB for instance. It helps to delete the .xar and start again.
The cool thing about the web, I think, is that a lot of created tools can be used and put together in a common platform. Using Jquery and Javascript for instance, makes the world spin faster when you want to develop something easy and user friendly. But, as an idea, if you want to push the limit of the platform you are using, in this case xwiki, you can search a bit for ideas to make something work from velocity, groovy script, java. And maybe, in some cases, when you ask yourself if something can be done, don’t think of other additional tools(javascript) but think if you can make it with xwiki and the power of the ground it was build on. So…asking if something can be done with xwiki and velocity etc when you know it can be done with javascript, is not a dumb question. 🙂

IMPORTANT: This new version has so far : over 300 reported bugs: http://jira.xwiki.org/jira/secure/IssueNavigator.jspa?

If working with XWiki, you may want to read this list, just in case you stumble into cases when the normal, expected, necessary reaction of the code you write is way different from what you get as a result.

NOTE: when the current status of a requirement is unsure by a blocker bug, feature not existing etc, you can always create a plugin using JAVA that will just make it all work. Creating a Java plugin for xwiki to use is not too complicated.

As a scheme in thinking when wanting to create one:

  • there are 2 clases: TestClass.java and TestClassApi.java
  • the first one “extends XWikiDefaultPlugin implements XWikiPluginInterface ” and you need to override the: “public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context) ” method
  • the second one extends “extends Api”
  • import all the libs you need…they can be found searching them on Google
  • add there the logic you want. make all methods public
  • export the project to a .war, add this to the xwiki lib folder.
  • in the xwiki page where you need it, call the plugin like this: “$xwiki.dynamicList.[name of method]”

Some small tips if found when using XWiki 2.1.1:

  • if you want to import a javascript file or css in a page you create, you can place the actual file either in the skin you are using. Do this if you know that skin is custom for what you need. Or just copy paste the files here: “../webapps/xwiki/resources/js/xwiki

In the page you want to import this use this declaration:
{{velocity}}
$xwiki.ssx.use(“ClassSheet”)
$xwiki.jsx.use(“JQuery”)
{{/velocity}}

  • Each of those from above (ClassShetet,  JQuery) are actual pages in xwiki, that you create and add objects to its class. (Edit->Objects) There you have a panel from which you add them. You can distinguish the type of class you add: JavaScriptExtension, StyleSheetExtension etc. Create one of them and then write the code you want in the fields aditional. Think of this like you create a folder in which you keep a lot of files , resources that will be used in a website. It’s as simple as that!

Quick Snippet : create a simple macro in xwiki 2.1.1 with 2.0 syntax

  • create a page in space of xwiki
  • edit the page “?editor=object
  • use the Add a Class wizard and create a new Xwiki.MacroClass: here you will have the logic
  • use the Add a Class wizard and create a new Xwiki.MacroClassParameter : here you add the parameters you want to ask the user to send you before inserting your macro in your page. These parameters can be made “optional” or “mandatory”.

Back to the macro class properties . What i remember reading was that the “macro content type” option should be put on “no content”. Write your code in the “macro code” section, just like you are writing in a page. Use the velocity and the html tags, import files you need, all the necessary steps to have a functionality code.
If you asked the user for some input before the macro is created and inserted into the page, you can access the parameters as follows:
#set($userThoughts = $!context.macro.params.userThoughts)

Now just write the velocity code in the macro code place to show the list of pages from space. To get the list just use a foraech statement to walk through all the pages “$xwiki.getSpaceDocsName(“$doc.space”)” finds for you.

{{velocity}}
#set($allPages = $xwiki.getSpaceDocsName(“$doc.space”))

#foreach($page in $allPages)

<br />- $page
#end

{{/velocity}}

NOTE: You want to see the end result of this macro right?
Edit a page you want. From obvious reasons avoid this one 🙂 and in the WYSIWYG editor click “Macro->Insert Macro” and you will the the name of the macro you created there in the list.
Choose your macro. And then insert it into the page.. it’s all about the “click next” philosophy. 😀
Then “Save and View” the page . At this point you will see the end result, a list of all the pages from the current space.

This macro cannot be edited in any way by(in the page you have the macro) the user, it can be deleted or inserted.

From here, you can complicate the idea as much as you can. 😀

Finally, there’s another very important peculiarity of what does Cialis that brings it so high above its alternatives. It is the only med that is available in two versions – one intended for use on as-needed basis and one intended for daily use. As you might know, Viagra and Levitra only come in the latter of these two forms and should be consumed shortly before expected sexual activity to ensure best effect. Daily Cialis, in its turn, contains low doses of Tadalafil, which allows to build its concentration up in your system gradually over time and maintain it on acceptable levels, which, consequently, makes it possible for you to enjoy sex at any moment without having to time it.

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close