Track: Extend your application

Last modified by Simon Urli on 2023/10/10 12:08

In the last track you've created your first application. Congratulations! 

Applications are usually the way we want users to interact with XWiki. They should use the application to create, edit, delete entries. Applications are usually the most complex type of entity, because they can contain other types of entities in their code. As you've seen, applications are composed of classes, sheets, templates, translations, etc. But there are also other types of entities that come with XWiki by default that you can create and use, like macros, skins, color themes, panels, etc. Each entity type has a particular functionality and reason of why you would need it. 

Task 1: Create a wiki macro

Macros are reusable pieces of functionality that can be integrated inside pages. Users can insert macros using the editor or using syntax.

In your local instance you have the Macros Index that will list the macros that are installed on that particular XWiki instance. There are some macros that are vital for development and you will use them regularly (like Velocity macro, HTML macro, etc.).

In this task you should create a wiki macro that lists the recent 5 entries created for your application. Have at least one optional parameter for your macro. You should display the title of the entry, the author and the date it was created. 

In order to succeed in this task you might need to read more about:

Task 2: Style your macro

You should try to display the entries in a nice way. You can add CSS and JS extensions to enhance your macro styling or interaction. Add a SSX extension and style your entries. You could have a custom icon for the list entries or use a different color for the date when the entry was created.

Read more about Skin extensions at: 

Task 3: Create a panel

In XWiki you can combine multiple entities / classes in order to create engaging experienced for your users. When installing an application, that application can also have a custom color palette, launch its own notifications, or can provide a custom panel, macro or gadget that users can integrate in other parts of their wiki.

In this task you should create a custom panel that uses the macro you've created and place that panel so that is visible on multiple pages of your wiki.

Task 4: Export your panel

You should export this panel and add it to your application module that you've created in the previous track. Now your application is more complete. Build your application and test it on a fresh XWiki instance.

Note: In case you get an error like Missing ... when testing your changes, make sure you've exported and committed all the dependencies / pages.


Do you have other ideas of what functionality you could create a macro for? How about an application idea? As a developer you have the power to bring all these ideas to life so that other people can use them.

Tags:
   

Get Connected